moar comments, moar constants

This commit is contained in:
2021-11-30 22:58:01 +01:00
parent 0a2eef8336
commit bab32fa68d
2 changed files with 15 additions and 13 deletions

View File

@@ -23,7 +23,7 @@ BitsSet:
EXPORT DefaultMap
SECTION "Default Map", ROM0, ALIGN[8]
DefaultMap:
; 32x18 map matching the startup nintendo logo
; 32x18 game of life map matching the startup nintendo logo
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

View File

@@ -44,7 +44,8 @@ Intro:
jr z, .setBGPalette
; fade bg palette
ld b, 8
FADE_DELAY = 8 ; frames
ld b, FADE_DELAY
.fadeDelay0
HaltAndClearInterrupts
dec b
@@ -53,7 +54,7 @@ Intro:
ld a, %11111100
ldh [rBGP], a
ld b, 8
ld b, FADE_DELAY
.fadeDelay1
HaltAndClearInterrupts
dec b
@@ -62,7 +63,7 @@ Intro:
ld a, %11111000
ldh [rBGP], a
ld b, 8
ld b, FADE_DELAY
.fadeDelay2
HaltAndClearInterrupts
dec b
@@ -127,7 +128,7 @@ Intro:
ld a, LCDCF_ON | LCDCF_BGON | LCDCF_BG9800
ldh [rLCDC], a
; sound
; sweep sound while transforming nintendo logo into game of life of it
ld a, $77
ldh [rNR10], a ; sweep
ld a, (%00 << 6) + 0
@@ -146,22 +147,23 @@ FREQUENCY = 146
ld b, 20
.loopX
ld c, 2
; 3 frame delay
HaltAndClearInterrupts
HaltAndClearInterrupts
HaltAndClearInterrupts
.loopY
; copy 8 tiles (that's how many there is before L and E overflow)
; copy 8 tiles from (that's how many there is before L and E overflow)
REPT 8
ld a, [hl]
ld [de], a
ld a, l
add a, $20
add a, SCRN_VX_B
ld l, a
ld a, e
add a, $20
add a, SCRN_VX_B
ld e, a
ENDR
; L and E overflowed, we can increment H and L
; L and E overflowed, we can increment high byte of pointers (h and d)
inc h
inc d
dec c
@@ -171,10 +173,10 @@ REPT 2
ld a, [hl]
ld [de], a
ld a, l
add a, $20
add a, SCRN_VX_B
ld l, a
ld a, e
add a, $20
add a, SCRN_VX_B
ld e, a
ENDR
; back to beginning (high byte)
@@ -187,10 +189,10 @@ ENDR
; back to beginning + next column (low byte)
ld a, l
sub a, $3F
sub a, SCRN_VX_B * 2 - 1
ld l, a
ld a, e
sub a, $3F
sub a, SCRN_VX_B * 2 - 1
ld e, a
dec b