shuffle functionality working!

This commit is contained in:
Shoofle 2025-01-23 13:16:55 -05:00
parent b03a1da831
commit 9718277834
19 changed files with 793 additions and 120 deletions

View File

@ -1,3 +1,4 @@
; async variables from ff80-ff8f!
def vAsyncAF equ $ff80
def vAsyncHL EQU $ff82
def vAsyncDE EQU $ff84
@ -8,7 +9,7 @@ def vAsyncAfter equ $ff8c
def vAsyncProgress equ $ff8e
def SAFE_ASYNC_START EQU 146
def SAFE_ASYNC_END EQU 153
def SAFE_ASYNC_END EQU 152
DoInAsyncVBlank:
di
@ -133,7 +134,7 @@ DoInAsyncVBlank_EnterThread:
DoInAsyncVBlank_EarlyReturn:
; stack:
; af, de, bc, hl, PC (smc int @ LYC90), PC (hw int @ LYC 90), PC (outer context)
PRINTln "early return handle is ", DoInAsyncVBlank_EarlyReturn
;PRINTln "early return handle is ", DoInAsyncVBlank_EarlyReturn
; save state of registers
di
push af

131
Random.inc Normal file
View File

@ -0,0 +1,131 @@
ClockLFSR: ; uses af, bc and clocks one bit of the LFSR.
; at return time, a holds the bottom eight of lfsr state.
ldh a, [rLFSR] ;
ld b, a ; b has shifted value ; 1 cycle
srl b ; second tap is two shifts ; 2 cycles
srl b ; 2 cycles
xor a, b ; 1 cycle
srl b ; third tap iis one more shift ; 2 cycles
xor a, b ; 1 cycle
srl b ; fourth tap is two more shifts ; 2 cycles
srl b ; 2 cycles
xor a, b ; 1 cycle
and a, $1 ; now the zero flag is set iff the tap bit is 0 ; 1 cycle
; set carry flag from zero flag
scf ; 1 cycle
jr nz, .noComplementCarry ; 2 or 3 cycles
ccf ; 1 cycle if prev was 2 cycles :)
.noComplementCarry
ldh a, [rLFSR+1] ; 2 cycles
rra ; 1 cycle ; this should populate with the carry flag
ldh [rLFSR+1], a ; 2 cycles
ldh a, [rLFSR] ; 2 cycles
rra ; 1 cycle
ldh [rLFSR], a ; 2 cycles
ret ; 37 cycles total. can call roughly three of these per scanline
OneRandomByte: ; clocks LFSR 8 times so a is
call ClockLFSR
call ClockLFSR
call ClockLFSR
call ClockLFSR
call ClockLFSR
call ClockLFSR
call ClockLFSR
call ClockLFSR
ret
RandomUnderD: ; takes d as limit (inclusive)
; check what the highest bit of d is and dispatch to thee number of bits
; we're going to generate
ld d, a
ld e, %1111_1111
bit 7, d
jr nz, .inEight
ld e, %0111_1111
bit 6, d
jr nz, .inSeven
ld e, %0011_1111
bit 5, d
jr nz, .inSix
ld e, %0001_1111
bit 4, d
jr nz, .inFive
ld e, %0000_1111
bit 3, d
jr nz, .inFour
ld e, %0000_0111
bit 2, d
jr nz, .inThree
ld e, %0000_0011
bit 1, d
jr nz, .inTwo
ld e, %0000_0001
bit 0, d
jr nz, .inOne
ld a, 0
ret
.inEight
call ClockLFSR
.inSeven
call ClockLFSR
.inSix
call ClockLFSR
.inFive
call ClockLFSR
.inFour
call ClockLFSR
.inThree
call ClockLFSR
.inTwo
call ClockLFSR
.inOne
call ClockLFSR
and a, e
cp a, d
ret z
ret c
jr .inOne
SwapCards: ; takes hl as array, c and e as indices to swap (uses b and d)
inc hl ; first element of array
push hl ; save it for later
ld b, 0
ld d, 0
add hl, bc
ld a, [hl]
ld b, a ; stash old [hl+0c] in b
pop hl
push hl
add hl, de
ld a, [hl]
ld d, a ; stash old [hl+0e] in d
ld [hl], b ; put old [hl+0c] in [hl+0e]
pop hl
ld b, 0 ; return 0 to b
add hl, bc
ld [hl], d ; put old [hl+0e] in [hl+0c]
ret

View File

@ -116,6 +116,8 @@ CardBrowseUpdate:
ret
CardBrowseDraw:
; the card data is loaded asynchronously, initiated in CardReadUpdate
ld hl, SquaresTiles
inc hl
ld b, 0
@ -132,9 +134,54 @@ CardBrowseDraw:
ld bc, (SquaresTileset8 - SquaresTileset7) / 8
call CopyRangeUnsafeBy8s
; the card data is loaded asynchronously, initiated in CardReadUpdate
call DrawDeckMinimap
ret
DrawDeckMinimap:
ld hl, Cards
ld c, [hl] ; count of cards
srl c
set 0, c
ld hl, vSelectedCardIndex
ld d, [hl] ; selected card!
ld b, $ff ; start at -1 lol
ld hl, $9800 + 32 + 11
.loop
inc b
ld a, b
cp a, 2
jp nz, .noNewLine
ld [hl], $13
ld hl, $9800 + 32*2 + 11
.noNewLine
ld a, b
cp a, c
jp nc, .doneDrawing
ld a, d
srl a
cp a, b
jp z, .drawSelectedCard
.drawUnselectedCards
ld [hl], $12
inc hl
jp .loop
.drawSelectedCard
bit 0, d
jp nz, .drawSelectedSecond
ld [hl], $14
inc hl
jp .loop
.drawSelectedSecond
ld [hl], $15
inc hl
jp .loop
.doneDrawing
ld [hl], $13
ret
CardBrowseTeardown:
ret
@ -298,13 +345,13 @@ CardBrowse.UITilemap:
db $0e, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0f, $09, $02, $02, $02, $02, $02, $02, $02, $08, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $06, $05, $05, $05, $05, $05, $05, $05, $07, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

View File

@ -164,7 +164,12 @@ LoadCardDataAsync:
ldh [vPreviousCardIndex], a
ld b, 0
ld c, a ; load bc from a, the number of the card in the cards list
ld c, a ; load bc from a, the number of the card in the shuffled deck
ld hl, SHUFFLED_DECK + 1
add hl, bc
ld a, [hl] ; this now holds the index into the ROM cards array
ld c, a ; loadd bc from a, the number of the card in the ROM deck
ld hl, Cards + 1 ; skip the length prefix
add hl, bc
add hl, bc ; add this twice to double the offset because it's two bytes per address
@ -244,6 +249,12 @@ LoadCardDataAsync:
ldh a, [vSelectedCardIndex]
ldh [vPreviousCardIndex], a
ld b, 0
ld c, a ; load bc from a, the number of the card in the shuffled deck
ld hl, SHUFFLED_DECK + 1
add hl, bc
ld a, [hl] ; this now holds the index into the ROM cards array
ld b, 0
ld c, a ; load bc from a, the number of the card in the cards list
ld hl, Cards + 1 ; skip the length prefix
@ -281,7 +292,7 @@ LoadCardDataAsync:
ld h, d
ld l, e ; hl takes the source
ld de, $91b0 ; always load tile data into the same spot in vram
ld de, $9000 + VARIABLE_TILES_START*$10 ; always load tile data into the same spot in vram
ld a, LOW(CopyRangeUnsafe)
ld [vAsyncNext], a
ld a, HIGH(CopyRangeUnsafe)
@ -310,61 +321,6 @@ LoadCardDataAsync:
ret
BigLetterTiles:
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $ee,$ee,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44
db $7c,$7c,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$ee,$ee
db $10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$38,$38
db $38,$38,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10
db $70,$70,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$42,$42,$fe,$fe
db $fe,$fe,$42,$42,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40
db $48,$48,$44,$44,$44,$44,$44,$44,$44,$44,$42,$42,$42,$42,$e3,$e3
db $fc,$fc,$42,$42,$42,$42,$42,$42,$42,$42,$7c,$7c,$48,$48,$48,$48
db $42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$3c,$3c
db $3c,$3c,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42
db $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$70,$70
db $7c,$7c,$22,$22,$22,$22,$22,$22,$22,$22,$3c,$3c,$20,$20,$20,$20
db $38,$38,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$ee,$ee
db $10,$10,$28,$28,$28,$28,$28,$28,$28,$28,$28,$28,$28,$28,$28,$28
db $ce,$ce,$44,$44,$64,$64,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54
db $54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$4c,$4c,$44,$44,$e6,$e6
db $fe,$fe,$92,$92,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10
db $7e,$7e,$22,$22,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20
db $38,$38,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$70,$70
db $70,$70,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20
db $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$22,$22,$7e,$7e
db $42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$fc,$fc
db $f8,$f8,$44,$44,$42,$42,$42,$42,$44,$44,$78,$78,$44,$44,$42,$42
db $ee,$ee,$44,$44,$44,$44,$44,$44,$44,$44,$7c,$7c,$44,$44,$44,$44
db $44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$ee,$ee
db $7e,$7e,$22,$22,$20,$20,$20,$20,$20,$20,$38,$38,$20,$20,$20,$20
db $fe,$fe,$42,$42,$40,$40,$40,$40,$40,$40,$70,$70,$40,$40,$40,$40
db $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$42,$42,$fe,$fe
db $3c,$3c,$42,$42,$42,$42,$42,$42,$40,$40,$40,$40,$40,$40,$40,$40
db $40,$40,$40,$40,$40,$40,$40,$40,$42,$42,$42,$42,$42,$42,$3c,$3c
db $42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$44,$44,$f8,$f8
db $f8,$f8,$44,$44,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42,$42
db $80,$80,$80,$80,$8f,$8f,$8a,$8a,$82,$82,$82,$82,$44,$44,$38,$38
db $38,$38,$44,$44,$82,$82,$82,$82,$82,$82,$80,$80,$80,$80,$80,$80
db $04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$44,$44,$44,$44,$38,$38
db $0e,$0e,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04
db $ee,$ee,$44,$44,$44,$44,$48,$48,$50,$50,$60,$60,$50,$50,$48,$48
db $54,$54,$54,$54,$54,$54,$54,$54,$44,$44,$44,$44,$44,$44,$ee,$ee
db $c6,$c6,$6c,$6c,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54
db $42,$42,$42,$42,$42,$42,$42,$42,$4a,$4a,$4c,$4c,$4c,$4c,$36,$36
db $3c,$3c,$42,$42,$42,$42,$40,$40,$40,$40,$3c,$3c,$02,$02,$02,$02
db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$42,$42,$42,$42,$3c,$3c
db $44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$28,$28,$10,$10
db $44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$44,$38,$38
db $44,$44,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$28,$28
db $10,$10,$10,$10,$28,$28,$28,$28,$28,$28,$44,$44,$44,$44,$ee,$ee
db $ee,$ee,$44,$44,$44,$44,$28,$28,$28,$28,$28,$28,$10,$10,$10,$10
db $ee,$ee,$44,$44,$44,$44,$28,$28,$10,$10,$10,$10,$10,$10,$10,$10
db $fe,$fe,$82,$82,$04,$04,$04,$04,$08,$08,$08,$08,$08,$08,$10,$10
db $10,$10,$20,$20,$20,$20,$20,$20,$40,$40,$40,$40,$82,$82,$fe,$fe
BigLetterTilesEnd:
UITilemap:
db $0e, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0f, $09, $02, $02, $02, $02, $02, $02, $02, $08, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
@ -384,5 +340,4 @@ UITilemap:
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $11, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $10, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
UITilemapEnd:

View File

@ -1,19 +1,18 @@
; global variables at the start of hram
DEF vCurrentSpread EQU $ff90 ; 16bit address of current spread
DEF vSelectedSpreadIndex equ vCurrentSpread + 2
def vSelectedSpreadCard equ vSelectedSpreadIndex + 1
def vSelectedCardIndex equ vSelectedSpreadCard+1
DEF vFrameCountSquares EQU vSelectedCardIndex+1
DEF vTime EQU vFrameCountSquares+1 ; 16bit
println "after vTime is ", vTime+2
DEF vCurrentSpread EQU GLOBAL_VARS_START ; 16bit address of current spread, ff90
DEF vSelectedSpreadIndex equ vCurrentSpread + 2 ; ff92
def vSelectedSpreadCard equ vSelectedSpreadIndex + 1 ; ff93
def vSelectedCardIndex equ vSelectedSpreadCard+1 ; ff94
DEF vFrameCountSquares EQU vSelectedCardIndex+1 ; ff95
DEF vTime EQU vFrameCountSquares+1 ; 16bit ; ff96
println "after vTime is ", vTime+2 ; ff98
; (but after async vars!)
; they probably don't needd to be there but whatever
; screen-specific variables
DEF vFrameCount1 EQU VARIABLES_START
DEF vFrameCount2 equ vFrameCount1+1
DEF vFrameCount3 EQU vFrameCount2+1
DEF vMenuIndex equ vFrameCount3 + 1
DEF vMenuIndex equ vFrameCount3+1
DEF vMenuIndexPrevious equ vMenuIndex + 1
ScreenMainMenu:
@ -235,7 +234,9 @@ MainMenuUpdate:
call ChangeScene
ret
.option2
jp .doneWithMenuSelect
ld hl, ScreenShuffle
call ChangeScene
ret
.option3
ld a, 0
ldh [vSelectedCardIndex], a
@ -284,11 +285,6 @@ MainMenuUpdate:
call ArrayClampLooping
ldh [vFrameCount3], a
;ldh a, [vFrameCount4]
;inc a
;call ArrayClampLooping
;ldh [vFrameCount4], a
ld hl, SquaresTiles
ldh a, [vFrameCountSquares]
inc a
@ -405,6 +401,9 @@ MainMenuTeardown:
DrawWholeCard: ; hl memory location, b y, c x, e width, d wiggle
ld a, e
cp a, 32
ld e, TileStartCardBackSprites24
jp z, Draw4x4Card
cp a, 24
ld e, TileStartCardBackSprites24
jp z, Draw3x3Card
@ -435,9 +434,8 @@ DrawWholeCard: ; hl memory location, b y, c x, e width, d wiggle
; else fall through into 2x2card
Draw2x2Card:
; hl memory location, b y coord, c x coord, e width
; hl memory location, b y coord, c x coord, e tile start
; top-left
ld e, TileStartCardBackSprites16
ld a, $0
call DrawTile
@ -561,6 +559,118 @@ Draw3x3Card:
call DrawTile
ret
Draw4x4Card:
; hl memory location, b y coord, c x coord, e base for tiles, d wiggle
;first row
; top-left
ld a, 0
call DrawTile
ld a, c
add a, 8 ; add stride to x
ld c, a
ld a, $2
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $2
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $4
call DrawTile
;second row
ld a, b
add a, 16
ld b, a ; add 16 to y coord
ld a, c
sub a, 24
ld c, a ; restore the state to before we drew the first row
ld a, $6
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $8
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $8
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $a
call DrawTile
;second row
ld a, b
add a, 16
ld b, a ; add 16 to y coord
ld a, c
sub a, 24
ld c, a ; restore the state to before we drew the first row
ld a, $6
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $8
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $8
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $a
call DrawTile
; third row
ld a, b
add a, 16
ld b, a ; add stridex2 to y coord
ld a, c
sub a, 24
ld c, a ; subtract stridex2 from x
ld a, $c
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $e
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $e
call DrawTile
ld a, c
add a, 8
ld c, a
ld a, $10
call DrawTile
ret
DrawTile: ; b: y. c: x. a: part id. hl: location of sprite in OAM
; e: sprite bank
ld d, a ; immediateely put the card part id into d

395
ScreenShuffle.inc Normal file
View File

@ -0,0 +1,395 @@
; screen variables already ddefined in screencardread
;DEF vPreviousCardIndex EQU VARIABLES_START
;def vBlocked equ vPreviousCardIndex + 1
def vAnimationFrame EQU VARIABLES_START
def vAnimationState EQU vAnimationFrame+1
def vCurrentAnimation EQU vAnimationState+1 ; 2 bytes
def vShuffleIndex equ vCurrentAnimation+2
def vShuffleTime equ vShuffleIndex+1 ; 2 bytes
ScreenShuffle:
dw ShuffleSetup
dw ShuffleUpdate
dw ShuffleDraw
dw ShuffleTeardown
ShuffleSetup:
ld hl, SHUFFLED_DECK
ld a, [hl]
dec a
ldh [vShuffleIndex], a
ld a, 0
ldh [vAnimationFrame], a
ldh [vAnimationState], a
ld a, LOW(ShuffleAnimationRight)
ldh [vCurrentAnimation], a
ld a, HIGH(ShuffleAnimationRight)
ldh [vCurrentAnimation+1], a
ld a, LOW(RunDMA) ; zero out the OAM
ld [vAsyncNext], a
ld a, HIGH(RunDMA)
ld [vAsyncNext+1], a
ld a, LOW(.loadUIMap)
ld [vAsyncAfter], a
ld a, HIGH(.loadUIMap)
ld [vAsyncAfter+1], a
ld a, HIGH(ZEROES)
ld de, vMenuIndexPrevious+2 ; arguments to the first async call.
call DoInAsyncVBlank
ld hl, ZEROES ; hl is source
ld de, $c000 ; de is destination
ld bc, $100 ; length to copy
call CopyRangeUnsafe
ret
.loadUIMap
ld hl, Shuffle.UITilemap ; origin
ld de, $9800 ; destination
ld b, 18 ; height
ld c, 20 ; width
ld a, LOW(CopyTilesToMapThreadsafe)
ld [vAsyncNext], a
ld a, HIGH(CopyTilesToMapThreadsafe)
ld [vAsyncNext+1], a
ld a, LOW(.loadTiles)
ld [vAsyncAfter], a
ld a, HIGH(.loadTiles)
ld [vAsyncAfter+1], a
ret
.loadTiles
ld hl, Shuffle.UITileData
ld de, $9000 + VARIABLE_TILES_START*16
ld bc, Shuffle.UITileDataEnd - Shuffle.UITileData
ld a, LOW(CopyRangeUnsafe)
ldh [vAsyncNext], a
ld a, HIGH(CopyRangeUnsafe)
ldh [vAsyncNext+1], a
ld a, LOW(.drawBigCard)
ld [vAsyncAfter], a
ld a, HIGH(.drawBigCard)
ld [vAsyncAfter+1], a
ret
.drawBigCard
ld hl, $9800 + $20*5 + 8
ld a, VARIABLE_TILES_START
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
ld b, 0
ld c, 32 - 4
add hl, bc
inc a
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
add hl, bc
sub a, 2
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
add hl, bc
sub a, 2
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
add hl, bc
sub a, 2
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
add hl, bc
sub a, 2
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
add hl, bc
sub a, 2
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
add hl, bc
inc a
ld [hl+], a
inc a
ld [hl+], a
ld [hl+], a
inc a
ld [hl+], a
ret
ShuffleUpdate:
ld hl, vShuffleTime
ldh a, [rDELTAT]
ld b, a
ld a, [hl]
add a, b
ld [hl+], a ; inc hl to get high byte
ld a, [hl]
adc a, 0
ld [hl], a ; this is addinig rDELTAT to vShuffleTime so we can use it for
; seeding the rng
ld hl, vTime
ldh a, [rDELTAT]
ld b, a
ld a, [hl]
add a, b
ld [hl+], a ; inc hl to get high byte
ld a, [hl]
adc a, 0
ld [hl], a ; increment time. when the 16bit time register is greater
; than 4096 ($10_00) then one second has passed. so that's satisfied when
; vTime+1 is equal to or greater than $10
ld a, [hl]
cp a, $01
jp c, .doneTimer ; if the timer is less than $0100, skip to end
;otherwise reset the timer
ld a, 0
ld [hl-], a
ld [hl], a
ld hl, SquaresTiles
ldh a, [vFrameCountSquares]
inc a
call ArrayClampLooping
ldh [vFrameCountSquares], a
.doneTimer
ld hl, rMYBTNP
ld a, 0
cp a, [hl]
jr z, .noButtons
ldh a, [rLFSR]
ldh [rLFSR+1], a ; lfsr = (lfsr << 8) + (vShuffleTime & $ff)
ldh a, [vShuffleTime]
ldh [rLFSR], a
.noButtons
bit 4, [hl]
jp z, .doneWithB
ld hl, ScreenMainMenu
call ChangeScene
ret
.doneWithB
bit 0, [hl]
jp z, .doneWithRight
ld a, 1
ldh [vAnimationState], a
ld a, 0
ldh [vAnimationFrame], a
ld a, LOW(ShuffleAnimationRight)
ldh [vCurrentAnimation], a
ld a, HIGH(ShuffleAnimationRight)
ldh [vCurrentAnimation+1], a
call DoSomeShuffling
.doneWithRight
bit 1, [hl]
jp z, .doneWithLeft
ld a, 1
ldh [vAnimationState], a
ld a, 0
ldh [vAnimationFrame], a
ld a, LOW(ShuffleAnimationRightReturn)
ldh [vCurrentAnimation], a
ld a, HIGH(ShuffleAnimationRightReturn)
ldh [vCurrentAnimation+1], a
.doneWithLeft
;animation logic!
ldh a, [vCurrentAnimation]
ld l, a
ldh a, [vCurrentAnimation+1]
ld h, a ; fetch current animation
ldh a, [vAnimationState]
or a, a
jp z, .doneWithAnimation
ldh a, [vAnimationFrame]
inc a
cp a, [hl]
jp nz, .animNotDone
dec a
ldh [vAnimationFrame], a
ld a, 0
ld [vAnimationState], a
ldh a, [vAnimationFrame]
.animNotDone
call ArrayClampLooping
ldh [vAnimationFrame], a
.doneWithAnimation
inc hl
ld b, 0
ldh a, [vAnimationFrame]
ld c, a
add hl, bc
add hl, bc ; two bytes per entry
; hl points to xy offsets
ld a, 40+16
add a, [hl]
ld b, a
inc hl
ld a, 64+8
add a, [hl]
ld c, a
ld a, 32
ld e, a
ld hl, $c000
call DrawWholeCard
ret
ShuffleDraw:
; the card data is loaded asynchronously, initiated in CardReadUpdate
ld hl, SquaresTiles
inc hl
ld b, 0
ldh a, [vFrameCountSquares]
ld c, a
add hl, bc
add hl, bc
ld c, [hl]
inc hl
ld b, [hl]
ld h, b
ld l, c
ld de, $8000+$100*16 + 1*16 ; tile number $101 is the sliding background
ld bc, (SquaresTileset8 - SquaresTileset7) / 8
call CopyRangeUnsafeBy8s
ld de, vMenuIndexPrevious+2 ; safe bytes in hram for dma code to live at
ld a, $c0
call RunDMA
ret
ShuffleTeardown:
ret
DoSomeShuffling:
call OneSwap
call OneSwap
call OneSwap
call OneSwap
call OneSwap
call OneSwap
ret
OneSwap: ; shuffles once and decrements vshuffleindex
; vShuffleIndex holds the index of the next card to swap with something
ldh a, [vShuffleIndex]
cp a, 1
jp z, .zeroIndex ; if we're swapping index 1 with index 0 skip it
ld d, a
dec d ; this holds the highest index we could want to swap with
call RandomUnderD ; takes d as limit (inclusive)
ld e, a ; shuffle 2 is randint(vshuffleindex-1)
ld c, d ; shuffle 1 is vshuffleindex
ld hl, SHUFFLED_DECK
call SwapCards ; arguments c and e as indices to swap, hl as array in memory
ldh a, [vShuffleIndex]
dec a
ldh [vShuffleIndex], a ; decrement vshuffleindex so the next time around
; we do the next step of the shuffle
ret
.zeroIndex
ld a, [SHUFFLED_DECK]
dec a
ldh [vShuffleIndex], a
ret
ShuffleAnimationRight:
db 15, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15
ShuffleAnimationRightReturn:
db 15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1
Shuffle.UITilemap:
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
Shuffle.UITilemapEnd:
Shuffle.UITileData:
db $00,$ff,$7f,$ff,$7f,$ff,$60,$ff,$6f,$ff,$6d,$fa,$6a,$fd,$6d,$fa ; top-left
db $00,$ff,$ff,$ff,$ff,$ff,$00,$ff,$ff,$ff,$55,$aa,$aa,$55,$55,$aa ; top-middle
db $00,$ff,$fe,$ff,$fe,$ff,$06,$ff,$f6,$ff,$56,$bf,$b6,$5f,$56,$bf ; top-right
db $6a,$fd,$6d,$fa,$6a,$fd,$6d,$fa,$6a,$fd,$6d,$fa,$6a,$fd,$6d,$fa ; middle-left
db $aa,$55,$55,$aa,$aa,$55,$55,$aa,$aa,$55,$55,$aa,$aa,$55,$55,$aa ; middle-middle
db $b6,$5f,$56,$bf,$b6,$5f,$56,$bf,$b6,$5f,$56,$bf,$b6,$5f,$56,$bf ; middle-right
db $6a,$fd,$6d,$fa,$6a,$fd,$6f,$ff,$60,$ff,$7f,$ff,$7f,$ff,$00,$ff ; bottom-left
db $aa,$55,$55,$aa,$aa,$55,$ff,$ff,$00,$ff,$ff,$ff,$ff,$ff,$00,$ff ; bottom-middle
db $b6,$5f,$56,$bf,$b6,$5f,$f6,$ff,$06,$ff,$fe,$ff,$fe,$ff,$00,$ff ; bottom-right
Shuffle.UITileDataEnd:

View File

@ -599,7 +599,7 @@ DrawSpreadMinimap:
push hl ; need this bc drawsmallcard changes hl
push bc
ld a, [bc]
ld bc, $1817
ld bc, $1716
call DrawSmallCard
pop bc
pop hl
@ -620,7 +620,7 @@ DrawSpreadMinimap:
ld a, [hl]
pop hl ; stack: empty
ld bc, $1a19
ld bc, $1918
call DrawSmallCard
ret

BIN
judgement.aseprite Normal file

Binary file not shown.

Binary file not shown.

View File

@ -9,20 +9,38 @@
; 0xc102 HIGH
; 0xc103 RET
; 0xc104 CALL ...
def MY_OAM equ $c000
DEF SCENE_SETUP EQU $c101
DEF SCENE_UPDATE EQU SCENE_SETUP + 4 ; call then ret is 3+1 bytes
DEF SCENE_DRAW EQU SCENE_UPDATE + 4
DEF SCENE_TEARDOWN EQU SCENE_DRAW + 4
DEF INTERRUPT_LCD EQU $c111
def SHUFFLED_DECK equ $c200 ; location for the shuffled deck
def ZEROES equ $D000
def ONES equ $D200
DEF rMYBTN EQU $FFA8
DEF ASYNC_VARS_START equ $ff80 ; these are defined manually in async.inc
DEF SYSTEM_VARS_START equ ASYNC_VARS_START + $10
; allocating $8 spaces for system variables, currently only using $3 bytes
DEF rMYBTN EQU SYSTEM_VARS_START
DEF rMYBTNP EQU rMYBTN + 1
DEF rDELTAT EQU rMYBTNP + 1
DEF VARIABLES_START EQU rDELTAT+1
def rLFSR equ rDELTAT + 1 ; 16 bit
DEF GLOBAL_VARS_START EQU SYSTEM_VARS_START + $8
; global app-wide variables go after GLOBAL_VARS_START. allocated $10 for them
def VARIABLES_START equ GLOBAL_VARS_START + $10
; screen-specific variables live after VARIABLES_START
; WRAM Layout looks like this:
; $c000 - $c100 OAM DMA source
; $c101 - $c113 self-modifying code interrupts
; $d000 - $d400 zeroes and ones, just because they're handy!
def VARIABLE_TILES_START equ 27
INCLUDE "hardware.inc"
SECTION "Interrupts", ROM0[$0]
@ -51,7 +69,7 @@ EntryPoint:
ld [hl+], a
ld a, b
or a, c
dec bc
dec bc ; we still need to do the `or` to set the zero flag bc dec r16 doesn't do that
jp nz, .buildZeros
ld a, 1
@ -63,7 +81,7 @@ EntryPoint:
ld [hl+], a
ld a, b
or a, c
dec bc
dec bc ; we still need to do the `or` to set the zero flag bc dec r16 doesn't do that
jp nz, .buildOnes
ld hl, UITiles
@ -76,10 +94,23 @@ EntryPoint:
ld bc, LetterTilesEnd - LetterTiles
call CopyRangeUnsafe
; initialize app-wide variables
; initialize global variables
ld a, 0
ldh [vSelectedSpreadIndex], a
ldh [vSelectedCardIndex], a
ld hl, Cards
ld b, [hl]
ld hl, SHUFFLED_DECK
ld [hl], b
inc hl
.writeCard
ld [hl+], a
inc a
cp a, b
jr nz, .writeCard
ld a, %1010_1010
ldh [rLFSR], a
; move on to framework stuff
@ -170,7 +201,6 @@ Loop:
ldh [rDELTAT], a
xor a, a ; zero a out in one cycle
; store dpad and btn state in the rMYBTN register
ld hl, rP1
ld [hl], P1F_GET_DPAD
@ -310,6 +340,10 @@ Instructions:
call SCENE_UPDATE + 2
ret
UITiles:
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $05,$00,$05,$00,$05,$00,$05,$00,$05,$00,$fd,$00,$00,$00,$fd,$00
@ -329,11 +363,10 @@ UITiles:
db $00,$00,$fc,$00,$fe,$00,$ae,$50,$1e,$e0,$06,$f8,$ce,$f0,$c6,$f8
db $ce,$f0,$c6,$f8,$0e,$f0,$16,$e8,$5e,$a0,$fe,$00,$fc,$00,$00,$00
db $63,$1f,$73,$0f,$60,$1f,$78,$07,$75,$0a,$7f,$00,$3f,$00,$00,$00
db $00,$0f,$00,$10,$00,$10,$00,$10,$00,$0f,$00,$10,$00,$10,$00,$10
db $00,$7f,$00,$80,$00,$80,$00,$80,$00,$7f,$00,$10,$00,$10,$00,$10
db $00,$0f,$00,$10,$00,$10,$00,$10,$00,$7f,$00,$80,$00,$80,$00,$80
db $00,$7f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$0f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$77,$00,$88,$00,$88,$00,$88,$00,$88,$00,$88,$00,$88,$00,$77
db $00,$00,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$00
db $00,$77,$00,$88,$20,$a8,$20,$a8,$20,$a8,$20,$a8,$00,$88,$00,$77
db $00,$77,$00,$88,$02,$8a,$02,$8a,$02,$8a,$02,$8a,$00,$88,$00,$77
db $56,$c3,$6a,$c3,$56,$c3,$6a,$c3,$56,$c3,$6a,$c3,$7e,$ff,$00,$ff
db $00,$ff,$7e,$ff,$56,$c3,$6a,$c3,$56,$c3,$6a,$c3,$56,$c3,$6a,$c3
db $99,$5a,$99,$5a,$99,$5a,$99,$5a,$99,$5a,$81,$42,$81,$7e,$ff,$00
@ -440,12 +473,14 @@ LetterTiles:
LetterTilesEnd:
INCLUDE "Async.inc"
INCLUDE "Random.inc"
INCLUDE "CopyRangeSafe.inc"
INCLUDE "CopyTilesSafe.inc"
INCLUDE "ScreenMainMenu.inc"
INCLUDE "ScreenSpreadSelect.inc"
INCLUDE "ScreenCardRead.inc"
INCLUDE "ScreenCardBrowse.inc"
INCLUDE "ScreenShuffle.inc"
INCLUDE "CardLibrary.inc"

Binary file not shown.

Binary file not shown.

BIN
thedevil.aseprite Normal file

Binary file not shown.

BIN
themoon.aseprite Normal file

Binary file not shown.

BIN
thestar.aseprite Normal file

Binary file not shown.

BIN
thesun.aseprite Normal file

Binary file not shown.

BIN
thetower.aseprite Normal file

Binary file not shown.

BIN
theworld.aseprite Normal file

Binary file not shown.

View File

@ -21,11 +21,10 @@ tileset:
db $00,$00,$fc,$00,$fe,$00,$ae,$50,$1e,$e0,$06,$f8,$ce,$f0,$c6,$f8
db $ce,$f0,$c6,$f8,$0e,$f0,$16,$e8,$5e,$a0,$fe,$00,$fc,$00,$00,$00
db $63,$1f,$73,$0f,$60,$1f,$78,$07,$75,$0a,$7f,$00,$3f,$00,$00,$00
db $00,$0f,$00,$10,$00,$10,$00,$10,$00,$0f,$00,$10,$00,$10,$00,$10
db $00,$7f,$00,$80,$00,$80,$00,$80,$00,$7f,$00,$10,$00,$10,$00,$10
db $00,$0f,$00,$10,$00,$10,$00,$10,$00,$7f,$00,$80,$00,$80,$00,$80
db $00,$7f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$0f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$77,$00,$88,$00,$88,$00,$88,$00,$88,$00,$88,$00,$88,$00,$77
db $00,$00,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$00
db $00,$77,$00,$88,$20,$a8,$20,$a8,$20,$a8,$20,$a8,$00,$88,$00,$77
db $00,$77,$00,$88,$02,$8a,$02,$8a,$02,$8a,$02,$8a,$00,$88,$00,$77
db $56,$c3,$6a,$c3,$56,$c3,$6a,$c3,$56,$c3,$6a,$c3,$7e,$ff,$00,$ff
db $00,$ff,$7e,$ff,$56,$c3,$6a,$c3,$56,$c3,$6a,$c3,$56,$c3,$6a,$c3
db $99,$5a,$99,$5a,$99,$5a,$99,$5a,$99,$5a,$81,$42,$81,$7e,$ff,$00
@ -34,21 +33,21 @@ tileset:
BackgroundCopyCopy:
db $0e, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0f, $09, $02, $02, $02, $02, $02, $02, $02, $08, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $04, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $06, $05, $05, $05, $05, $05, $05, $05, $07, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $11, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $10, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01