card browse screen started
This commit is contained in:
parent
4175bfcd69
commit
cf5202996c
180
CardLibrary.inc
180
CardLibrary.inc
@ -4,129 +4,129 @@ Spreads:
|
||||
db 8 ; length
|
||||
.onecard
|
||||
db 1, $31
|
||||
db 8, "Answer "
|
||||
db 8, "to query"
|
||||
db 7, "Reply "
|
||||
db 7, " "
|
||||
db 18, " One Card "
|
||||
db 18, " Draw one card. "
|
||||
db 18, " Make any query. "
|
||||
.threecard
|
||||
db 3, $11, $31, $51
|
||||
db 8, "Past "
|
||||
db 8, " "
|
||||
db 8, "Present "
|
||||
db 8, " "
|
||||
db 8, "Future "
|
||||
db 8, " "
|
||||
db 7, "Past "
|
||||
db 7, " "
|
||||
db 7, "Present"
|
||||
db 7, " "
|
||||
db 7, "Future "
|
||||
db 7, " "
|
||||
db 18, "Three Card Spread "
|
||||
db 18, " Old reliable. "
|
||||
.threecardB
|
||||
db 3, $12, $52, $30
|
||||
db 8, "Mind "
|
||||
db 8, " "
|
||||
db 8, "Body "
|
||||
db 8, " "
|
||||
db 8, "Spirit "
|
||||
db 8, " "
|
||||
db 7, "Mind "
|
||||
db 7, " "
|
||||
db 7, "Body "
|
||||
db 7, " "
|
||||
db 7, "Spirit "
|
||||
db 7, " "
|
||||
db 18, "Three Card Spread "
|
||||
db 18, " Many variations. "
|
||||
.fivecardSituation
|
||||
db 5, $10, $50, $12, $52, $31
|
||||
db 8, "Scenario"
|
||||
db 8, " "
|
||||
db 8, "Things "
|
||||
db 8, "at play "
|
||||
db 8, "Dangers "
|
||||
db 8, "afoot "
|
||||
db 8, "Outcome "
|
||||
db 8, " "
|
||||
db 8, "Theme "
|
||||
db 8, " "
|
||||
db 7, "Goings "
|
||||
db 7, "on "
|
||||
db 7, "Things "
|
||||
db 7, "at play"
|
||||
db 7, "Dangers"
|
||||
db 7, "afoot "
|
||||
db 7, "Outcome"
|
||||
db 7, " "
|
||||
db 7, "Theme "
|
||||
db 7, " "
|
||||
db 18, "Situation reading "
|
||||
db 18, "What's going on? "
|
||||
.fivecardRelationship
|
||||
db 5, $01, $61, $20, $31, $42
|
||||
db 8, "Querent "
|
||||
db 8, " "
|
||||
db 8, "Other "
|
||||
db 8, "person "
|
||||
db 8, "Past "
|
||||
db 8, "history "
|
||||
db 8, "Present "
|
||||
db 8, "moment "
|
||||
db 8, "Future "
|
||||
db 8, "outcomes"
|
||||
db 7, "Querent"
|
||||
db 7, " "
|
||||
db 7, "Other "
|
||||
db 7, "person "
|
||||
db 7, "Past "
|
||||
db 7, "history"
|
||||
db 7, "Present"
|
||||
db 7, "moment "
|
||||
db 7, "Future "
|
||||
db 7, "outcome"
|
||||
db 18, " Relationships "
|
||||
db 18, "5 cards, 2 people."
|
||||
.sixcard
|
||||
db 6, $11, $21, $30, $32, $41, $51
|
||||
db 8, "Querent " ; 01
|
||||
db 8, " "
|
||||
db 8, "Problem " ; 11
|
||||
db 8, " "
|
||||
db 8, "Logic " ; 20
|
||||
db 8, "view "
|
||||
db 8, "Emotion " ; 22
|
||||
db 8, "view "
|
||||
db 8, "Path of " ; 31
|
||||
db 8, "action "
|
||||
db 8, "Outcome " ; 41
|
||||
db 8, " "
|
||||
db 7, "Querent" ; 01
|
||||
db 7, " "
|
||||
db 7, "Problem" ; 11
|
||||
db 7, " "
|
||||
db 7, "Logic " ; 20
|
||||
db 7, "view "
|
||||
db 7, "Emotion" ; 22
|
||||
db 7, "view "
|
||||
db 7, "Path of" ; 31
|
||||
db 7, "action "
|
||||
db 7, "Outcome" ; 41
|
||||
db 7, " "
|
||||
db 18, " Horizontal Cross "
|
||||
db 18, "For facing issues."
|
||||
.alexNine
|
||||
db 9, $01, $10, $12, $20, $22, $30, $32, $41, $61
|
||||
db 8, "Querent "
|
||||
db 8, "role "
|
||||
db 8, "Problems"
|
||||
db 8, "you know"
|
||||
db 8, "Problems"
|
||||
db 8, "hidden "
|
||||
db 8, "Strength"
|
||||
db 8, "you know"
|
||||
db 8, "Strength"
|
||||
db 8, "unknown "
|
||||
db 8, "Weakness"
|
||||
db 8, "you know"
|
||||
db 8, "Weakness"
|
||||
db 8, "ignored "
|
||||
db 8, "Advice "
|
||||
db 8, " "
|
||||
db 8, "Outcome "
|
||||
db 8, " "
|
||||
db 7, "Querent"
|
||||
db 7, "role "
|
||||
db 7, "Woes "
|
||||
db 7, "known "
|
||||
db 7, "Woes "
|
||||
db 7, "hidden "
|
||||
db 7, "Power "
|
||||
db 7, "known "
|
||||
db 7, "Power "
|
||||
db 7, "unknown"
|
||||
db 7, "Frailty"
|
||||
db 7, "known "
|
||||
db 7, "Frailty"
|
||||
db 7, "ignored"
|
||||
db 7, "Advice "
|
||||
db 7, " "
|
||||
db 7, "Outcome"
|
||||
db 7, " "
|
||||
db 18, " Eight Plus One "
|
||||
db 18, " What faces you? "
|
||||
.twelvecard
|
||||
db 12, $00, $10, $20, $40, $50, $60, $02, $12, $22, $42, $52, $62
|
||||
db 8, "This " ; 00
|
||||
db 8, "month "
|
||||
db 8, "Next " ; 10
|
||||
db 8, "month "
|
||||
db 8, "Third " ; 20
|
||||
db 8, "month "
|
||||
db 8, "Fourth " ; 30
|
||||
db 8, "month "
|
||||
db 8, "Fifth " ; 40
|
||||
db 8, "month "
|
||||
db 8, "Sixth " ; 02
|
||||
db 8, "month "
|
||||
db 8, "Seventh " ; 12
|
||||
db 8, "month "
|
||||
db 8, "Eighth " ; 22
|
||||
db 8, "month "
|
||||
db 8, "Ninth " ; 32
|
||||
db 8, "month "
|
||||
db 8, "Tenth " ; 42
|
||||
db 8, "month "
|
||||
db 8, "Eleventh" ; 42
|
||||
db 8, "month "
|
||||
db 8, "Twelfth " ; 42
|
||||
db 8, "month "
|
||||
db 7, "This " ; 00
|
||||
db 7, "month "
|
||||
db 7, "Next " ; 10
|
||||
db 7, "month "
|
||||
db 7, "3rd " ; 20
|
||||
db 7, "month "
|
||||
db 7, "4th " ; 30
|
||||
db 7, "month "
|
||||
db 7, "5th " ; 40
|
||||
db 7, "month "
|
||||
db 7, "6th " ; 02
|
||||
db 7, "month "
|
||||
db 7, "7th " ; 12
|
||||
db 7, "month "
|
||||
db 7, "8th " ; 22
|
||||
db 7, "month "
|
||||
db 7, "9th " ; 32
|
||||
db 7, "month "
|
||||
db 7, "10th " ; 42
|
||||
db 7, "month "
|
||||
db 7, "11th " ; 42
|
||||
db 7, "month "
|
||||
db 7, "12th " ; 42
|
||||
db 7, "month "
|
||||
db 18, " One Year Spread "
|
||||
db 18, " Month by month "
|
||||
|
||||
.end
|
||||
|
||||
Cards:
|
||||
db 7 ; length
|
||||
db 9 ; length
|
||||
dw TheFool
|
||||
dw TheMagician
|
||||
dw TheHighPriestess
|
||||
|
@ -1,67 +1,79 @@
|
||||
; screen variables
|
||||
DEF vSelectedCardIndex EQU VARIABLES_START
|
||||
DEF vPreviousCardIndex EQU vSelectedCardIndex + 1
|
||||
; screen variables already ddefined in screencardread
|
||||
;DEF vPreviousCardIndex EQU VARIABLES_START
|
||||
;def vBlocked equ vPreviousCardIndex + 1
|
||||
|
||||
ScreenCardRead:
|
||||
dw CardReadSetup
|
||||
dw CardReadUpdate
|
||||
dw CardReadDraw
|
||||
dw CardReadTeardown
|
||||
ScreenCardBrowse:
|
||||
dw CardBrowseSetup
|
||||
dw CardBrowseUpdate
|
||||
dw CardBrowseDraw
|
||||
dw CardBrowseTeardown
|
||||
|
||||
CardReadSetup:
|
||||
; Turn the LCD off
|
||||
ld hl, rLCDC
|
||||
bit 7, [hl]
|
||||
jp z, .screenOff
|
||||
.busyWait
|
||||
ld a, [rLY]
|
||||
cp a, 143
|
||||
jp c, .busyWait
|
||||
ld [hl], 0
|
||||
.screenOff
|
||||
ld hl, UITiles ; source
|
||||
ld de, $8000 + $80*16; destination of copy
|
||||
ld bc, UITilesEnd - UITiles ; length to copy
|
||||
call CopyRangeUnsafe
|
||||
CardBrowseSetup:
|
||||
ld a, 1
|
||||
ldh [vBlocked], a
|
||||
|
||||
ld hl, LetterTiles ; map the small font into vram at ascii locations
|
||||
ld de, $8000 + (127 + $21)*16
|
||||
ld bc, LetterTilesEnd - LetterTiles
|
||||
call CopyRangeUnsafe
|
||||
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 hl, UITilemap ; origin
|
||||
ld a, HIGH(ZEROES)
|
||||
ld de, $ffc0 ; arguments to the first async call.
|
||||
|
||||
call DoInAsyncVBlank
|
||||
ret
|
||||
|
||||
.loadUIMap
|
||||
|
||||
ld hl, CardBrowse.UITilemap ; origin
|
||||
ld de, $9800 ; destination
|
||||
ld b, 18 ; height
|
||||
ld c, 10 ; width
|
||||
call CopyTilesToMapUnsafe
|
||||
ld c, 20 ; width
|
||||
|
||||
ld a, LOW(CopyTilesToMapThreadsafe)
|
||||
ld [vAsyncNext], a
|
||||
ld a, HIGH(CopyTilesToMapThreadsafe)
|
||||
ld [vAsyncNext+1], a
|
||||
|
||||
ld hl, ZEROES
|
||||
ld de, $9800 + 10
|
||||
ld b, 18
|
||||
ld c, 10
|
||||
call CopyTilesToMapUnsafe
|
||||
ld a, LOW(CardBrowse.LoadCardDataAsync)
|
||||
ld [vAsyncAfter], a
|
||||
ld a, HIGH(CardBrowse.LoadCardDataAsync)
|
||||
ld [vAsyncAfter+1], a
|
||||
ret
|
||||
|
||||
; set LCD and display registers
|
||||
ld a, %11100100
|
||||
ld [rBGP], a
|
||||
CardBrowseUpdate:
|
||||
ld hl, vTime
|
||||
ldh a, [rDELTAT]
|
||||
ld b, a
|
||||
ldh a, [vTime]
|
||||
add a, b
|
||||
ldh [vTime], a
|
||||
ldh a, [vTime+1]
|
||||
adc a, 0
|
||||
ldh [vTime+1], 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, LCDCF_BLK01 | LCDCF_ON | LCDCF_BGON
|
||||
ld [rLCDC], a
|
||||
ldh a, [vTime+1]
|
||||
cp a, $01
|
||||
jp c, .doneTimer ; if the timer is less than $0100, skip to end
|
||||
|
||||
; arguments for the screen
|
||||
;otherwise reset the timer
|
||||
ld a, 0
|
||||
ldh [vSelectedSpreadCard], a
|
||||
; vCurrentSpread is set by the calling context.
|
||||
ld a, $FF
|
||||
ldh [vPreviousCardIndex], a
|
||||
ld a, 0
|
||||
ldh [vSelectedCardIndex], a
|
||||
call LoadCardData
|
||||
ei
|
||||
ret ; return from cardreadsetup
|
||||
ldh [vTime], a
|
||||
ldh [vTime+1], a
|
||||
|
||||
CardReadUpdate:
|
||||
ld hl, SquaresTiles
|
||||
ldh a, [vFrameCountSquares]
|
||||
inc a
|
||||
call ArrayClampLooping
|
||||
ldh [vFrameCountSquares], a
|
||||
|
||||
.doneTimer
|
||||
ld hl, rMYBTNP
|
||||
bit 4, [hl]
|
||||
jp z, .doneWithB
|
||||
@ -69,116 +81,72 @@ CardReadUpdate:
|
||||
call ChangeScene
|
||||
ret
|
||||
.doneWithB
|
||||
|
||||
ldh a, [vSelectedCardIndex]
|
||||
|
||||
bit 3, [hl] ; select the down key
|
||||
jp z, :+ ; skip the following code if down is not pressed
|
||||
inc a ; increment when they press down because the deck has card 0 at the top
|
||||
:
|
||||
bit 2, [hl] ; select up key %0000_0100
|
||||
jp z, :+ ; skip the following code if up is not pressed
|
||||
dec a ; decrement when they press up because the deck has card 0 at the top
|
||||
:
|
||||
ld hl, Cards
|
||||
call ArrayClampLooping
|
||||
ldh [vSelectedCardIndex], a ; load current selected tile index
|
||||
|
||||
ldh a, [vSelectedSpreadCard]
|
||||
ld hl, rMYBTNP
|
||||
bit 1, [hl]
|
||||
jp z, :+ ; skip the following code if left is not pressed
|
||||
dec a
|
||||
:
|
||||
bit 0, [hl]
|
||||
jp z, :+ ; skip the following code if right is not pressed
|
||||
bit 3, [hl]
|
||||
jp z, :+ ; skip the following code if down is not pressed
|
||||
inc a
|
||||
:
|
||||
ldh [vSelectedSpreadCard], a
|
||||
ldh a, [vCurrentSpread]
|
||||
ld l, a
|
||||
ldh a, [vCurrentSpread+1]
|
||||
ld h, a
|
||||
ldh a, [vSelectedSpreadCard]
|
||||
bit 2, [hl]
|
||||
jp z, :+ ; skip the following code if up is not pressed
|
||||
dec a
|
||||
:
|
||||
ldh [vSelectedCardIndex], a
|
||||
ld hl, Cards
|
||||
call ArrayClampLooping
|
||||
ldh [vSelectedSpreadCard], a
|
||||
ldh [vSelectedCardIndex], a
|
||||
|
||||
ret
|
||||
|
||||
CardReadDraw:
|
||||
; first, we draw the spread minimap
|
||||
ldh a, [vCurrentSpread]
|
||||
ld c, a
|
||||
ldh a, [vCurrentSpread+1]
|
||||
ld b, a
|
||||
ld hl, $9800 + (32*12)+11
|
||||
ldh a, [vSelectedCardInSpread]
|
||||
call DrawSpreadMinimap
|
||||
|
||||
; okay now we draw the deck minimap
|
||||
ld a, [Cards]
|
||||
srl a ; divide by two because we're drawing icons for pairs of cards
|
||||
ld b, a ; length of the cards data
|
||||
ld hl, $9800+32*4+19 ; start point
|
||||
ld de, 32 ; stride
|
||||
CardReadDrawCopyTile:
|
||||
ld [hl], $81 ; load the tile for "unselected pair of tiles"
|
||||
add hl, de ; step forward by stride (hl is the address we're drawing to on screen)
|
||||
dec b ; sets zero flag because it's an 8-bit register
|
||||
jp nz, CardReadDrawCopyTile ; repeat if there's more cards in the deck to draw
|
||||
ld [hl], $87 ; draw the cap at the end
|
||||
|
||||
; the rest of this stuff deals with drawing the set-out card for the current
|
||||
; selected card
|
||||
CardReadDrawSelectedTile:
|
||||
ldh a, [vSelectedCardIndex]
|
||||
srl a
|
||||
ld b, a
|
||||
ld hl, $9800+32*4+19 ; start point
|
||||
ld de, 32 ; stride
|
||||
; if the card we need to draw is in the zeroth spot, jump straight to drawing.
|
||||
jp z, CardReadDrawDrawSelectedTile
|
||||
CardReadDrawCountDownTile:
|
||||
; otherwise, decrement b until we're there
|
||||
add hl, de
|
||||
dec b
|
||||
jp nz, CardReadDrawCountDownTile
|
||||
CardReadDrawDrawSelectedTile:
|
||||
ldh a, [vSelectedCardIndex]
|
||||
and a, 1
|
||||
; if we're on an odd tile, draw the tile with the top card selected.
|
||||
; no other tile needs to change.
|
||||
ld [hl], $82
|
||||
jp z, CardReadDrawReturn
|
||||
; otherwise we need to draw the tile with the bottom card selected.
|
||||
; this is more complicated because the tile underneath needs to change as well.
|
||||
ld [hl], $90 ; draw the "bottom card is selected"
|
||||
add hl, de ; look down one tile (de has stride, remember)
|
||||
ld a, $81
|
||||
cp a, [hl] ; check if the existing tile at that spot is $81 (cards) or not (end cap)
|
||||
ld [hl], $91 ; draw the tile of "cards but the card above is selected"
|
||||
jp z, CardReadDrawReturn ; if that was right, then jump to the end
|
||||
ld [hl], $92 ; if that was wrong, draw "end cap but the card above is selected"
|
||||
CardReadDrawReturn:
|
||||
; check if the current selected tile is different from the previous;
|
||||
; if it is different, then load new card data
|
||||
ldh a, [vSelectedCardIndex]
|
||||
ld hl, vPreviousCardIndex
|
||||
cp a, [hl]
|
||||
call nz, LoadCardData ; only load new card data if the selected card has changed
|
||||
ret z ; if the selected card diddn't change, nothing to do
|
||||
|
||||
ldh a, [vBlocked]
|
||||
cp a, 0
|
||||
ret nz
|
||||
|
||||
ld a, LOW(CardBrowse.LoadCardDataAsync)
|
||||
ld [vAsyncAfter], a
|
||||
ld a, HIGH(CardBrowse.LoadCardDataAsync)
|
||||
ld [vAsyncAfter+1], a
|
||||
call DoInAsyncVBlank
|
||||
|
||||
|
||||
ret
|
||||
|
||||
CardReadTeardown:
|
||||
ret
|
||||
|
||||
LoadCardData:
|
||||
ld a, [vSelectedCardIndex]
|
||||
ld [vPreviousCardIndex], a
|
||||
|
||||
ld b, 144
|
||||
call AwaitLine ; wait for vblank before starting to work
|
||||
ld a, [vSelectedCardIndex]
|
||||
CardBrowseDraw:
|
||||
ld hl, SquaresTiles
|
||||
inc hl
|
||||
ld b, 0
|
||||
ld c, a ; load bc from a. coming into this we have the number of the card in the card array in a
|
||||
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
|
||||
ld bc, (SquaresTileset8 - SquaresTileset7) / 8
|
||||
call CopyRangeUnsafeBy8s
|
||||
|
||||
; the card data is loaded asynchronously, initiated in CardReadUpdate
|
||||
ret
|
||||
|
||||
CardBrowseTeardown:
|
||||
ret
|
||||
|
||||
CardBrowse.LoadCardDataAsync: ; to be called as async
|
||||
ei
|
||||
ld a, 1
|
||||
ldh [vBlocked], a
|
||||
ldh a, [vSelectedCardIndex]
|
||||
ldh [vPreviousCardIndex], a
|
||||
|
||||
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
|
||||
add hl, bc
|
||||
add hl, bc ; add this twice to double the offset because it's two bytes per address
|
||||
@ -192,22 +160,39 @@ LoadCardData:
|
||||
ld h, b
|
||||
ld l, c ; hl now contains the address of the card data.
|
||||
|
||||
ld a, LOW(.duringDraw)
|
||||
ld [vAsyncNext], a
|
||||
ld a, HIGH(.duringDraw)
|
||||
ld [vAsyncNext+1], a
|
||||
ld a, 0
|
||||
ld [vAsyncAfter], a
|
||||
ld [vAsyncAfter+1], a
|
||||
di
|
||||
nop
|
||||
nop
|
||||
ret
|
||||
.duringDraw
|
||||
di ; these function calls should be fast so we'll disable interrupts and do them
|
||||
; synchronously
|
||||
|
||||
; hl points to a card struct.
|
||||
; card struct starts with a sequence of length-prefixed strings in memory
|
||||
; so when we're done writing one, hl will be correctly placed to read the next
|
||||
; length-prefixed print doesn't require passing a length
|
||||
; so all we have to set is the destination for each
|
||||
ld de, $9800 + 32*1 + 10
|
||||
ld de, $9800 + 32*11 + 10
|
||||
call PrintString
|
||||
ld de, $9800 + 32*2 + 10
|
||||
ld de, $9800 + 32*12 + 10
|
||||
call PrintString
|
||||
ld de, $9800 + 32*6 + 10
|
||||
ld de, $9800 + 32*14 + 10
|
||||
call PrintString
|
||||
ld de, $9800 + 32*7 + 10
|
||||
ld de, $9800 + 32*15 + 10
|
||||
call PrintString
|
||||
ld de, $9800 + 32*8 + 10
|
||||
ld de, $9800 + 32*16 + 10
|
||||
call PrintString
|
||||
|
||||
ei
|
||||
|
||||
; hl now contains the address after all the strings.
|
||||
; [hl+] and [hl+] read the length first, into bc
|
||||
ld a, [hl+]
|
||||
@ -218,253 +203,114 @@ LoadCardData:
|
||||
ld e, a
|
||||
ld a, [hl+]
|
||||
ld d, a ; de has source of tile range copy
|
||||
push hl ; save the pointer to the next bit of card data (tile map)
|
||||
|
||||
ld h, d
|
||||
ld l, e ; source
|
||||
ld de, $9800 + 32 + 1 ; destination
|
||||
ld b, 16 ; height
|
||||
ld c, 8 ; width
|
||||
call CopyTilesSafe
|
||||
|
||||
ei
|
||||
WaitForSafeCopy:
|
||||
ld b, 140
|
||||
call AwaitLine
|
||||
ldh a, [vSafeCopyCount]
|
||||
ld b, a
|
||||
ldh a, [vSafeCopyCount+1]
|
||||
or a, b
|
||||
jp nz, WaitForSafeCopy
|
||||
ld a, LOW(CopyTilesToMapThreadsafe)
|
||||
ld [vAsyncNext], a
|
||||
ld a, HIGH(CopyTilesToMapThreadsafe)
|
||||
ld [vAsyncNext+1], a
|
||||
ld a, LOW(.afterCopyTiles)
|
||||
ld [vAsyncAfter], a
|
||||
ld a, HIGH(.afterCopyTiles)
|
||||
ld [vAsyncAfter+1], a
|
||||
di
|
||||
nop
|
||||
nop
|
||||
ret
|
||||
.afterCopyTiles
|
||||
ei
|
||||
ldh a, [vSelectedCardIndex]
|
||||
ldh [vPreviousCardIndex], a
|
||||
|
||||
pop hl
|
||||
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
|
||||
add hl, bc
|
||||
add hl, bc ; add this twice to double the offset because it's two bytes per address
|
||||
|
||||
; follow the pointer we're looking at
|
||||
ld a, [hl+]
|
||||
ld c, a
|
||||
ld a, [hl+]
|
||||
ld b, a ; bc has length
|
||||
ld b, a
|
||||
|
||||
ld h, b
|
||||
ld l, c ; hl now contains the address of the card data.
|
||||
di
|
||||
call PassList
|
||||
call PassList
|
||||
call PassList
|
||||
call PassList
|
||||
call PassList ; skip the strings
|
||||
ei
|
||||
inc hl
|
||||
inc hl ; skip tile map width
|
||||
inc hl
|
||||
inc hl ; skip tile map pointer
|
||||
ld a, [hl+]
|
||||
ld c, a
|
||||
ld a, [hl+]
|
||||
ld b, a ; bc has length of tile data
|
||||
ld a, [hl+]
|
||||
ld e, a
|
||||
ld a, [hl+]
|
||||
ld d, a ; de has source of tile range copy
|
||||
|
||||
; push hl ; we don't need to keep track of hl at this point and our stack is clean.
|
||||
ld h, d
|
||||
ld l, e ; hl takes the source
|
||||
|
||||
ld de, $8000 ; always load tile data into the same spot in vram
|
||||
call CopyRangeSafe
|
||||
|
||||
ei
|
||||
WaitForSafeCopy2:
|
||||
ld b, 140
|
||||
call AwaitLine
|
||||
ldh a, [vSafeCopyCount]
|
||||
ld b, a
|
||||
ldh a, [vSafeCopyCount+1]
|
||||
or a, b
|
||||
jp nz, WaitForSafeCopy2
|
||||
ld de, $91b0 ; always load tile data into the same spot in vram
|
||||
ld a, LOW(CopyRangeUnsafe)
|
||||
ld [vAsyncNext], a
|
||||
ld a, HIGH(CopyRangeUnsafe)
|
||||
ld [vAsyncNext+1], a
|
||||
ld a, LOW(.afterLoadingTiles)
|
||||
ld [vAsyncAfter], a
|
||||
ld a, HIGH(.afterLoadingTiles)
|
||||
ld [vAsyncAfter+1], a
|
||||
di
|
||||
nop
|
||||
nop
|
||||
ret
|
||||
.afterLoadingTiles
|
||||
ei
|
||||
ld a, 0
|
||||
ldh [vBlocked], a
|
||||
|
||||
ld a, 0
|
||||
ld [vAsyncNext], a
|
||||
ld [vAsyncNext+1], a
|
||||
ld [vAsyncAfter], a
|
||||
ld [vAsyncAfter+1], a
|
||||
di
|
||||
nop
|
||||
nop
|
||||
|
||||
ret
|
||||
|
||||
|
||||
INCLUDE "CopyRangeSafe.inc"
|
||||
|
||||
INCLUDE "CopyTilesSafe.inc"
|
||||
|
||||
UITiles:
|
||||
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $0f,$0f,$10,$10,$10,$10,$10,$10,$0f,$0f,$10,$10,$10,$10,$10,$10
|
||||
db $7f,$7f,$80,$80,$80,$80,$80,$80,$7f,$7f,$10,$10,$10,$10,$10,$10
|
||||
db $00,$3c,$3c,$7e,$42,$c3,$42,$c3,$42,$c3,$42,$c3,$42,$c3,$42,$c3
|
||||
db $42,$c3,$42,$c3,$42,$c3,$42,$c3,$42,$c3,$42,$c3,$3c,$7e,$00,$3c
|
||||
db $00,$3c,$3c,$7e,$42,$c3,$5a,$db,$5a,$db,$5a,$db,$5a,$db,$5a,$db
|
||||
db $5a,$db,$5a,$db,$5a,$db,$5a,$db,$5a,$db,$42,$c3,$3c,$7e,$00,$3c
|
||||
db $0f,$0f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $ce,$f0,$c6,$f8,$0e,$f0,$16,$e8,$5e,$a0,$fe,$00,$fc,$00,$00,$00
|
||||
db $ce,$f0,$c6,$f8,$ce,$f0,$c6,$f8,$ce,$f0,$c6,$f8,$ce,$f0,$c6,$f8
|
||||
db $00,$00,$fc,$00,$fe,$00,$ae,$50,$1e,$e0,$06,$f8,$ce,$f0,$c6,$f8
|
||||
db $00,$00,$3f,$00,$7f,$00,$7a,$05,$68,$17,$70,$0f,$63,$1f,$73,$0f
|
||||
db $63,$1f,$73,$0f,$60,$1f,$78,$07,$75,$0a,$7f,$00,$3f,$00,$00,$00
|
||||
db $00,$00,$ff,$00,$ff,$00,$aa,$55,$00,$ff,$00,$ff,$ff,$ff,$ff,$ff
|
||||
db $63,$1f,$73,$0f,$63,$1f,$73,$0f,$63,$1f,$73,$0f,$63,$1f,$73,$0f
|
||||
db $ff,$ff,$ff,$ff,$00,$ff,$00,$ff,$55,$aa,$ff,$00,$ff,$00,$00,$00
|
||||
db $0f,$0f,$10,$10,$10,$10,$10,$10,$7f,$7f,$80,$80,$80,$80,$80,$80
|
||||
db $7f,$7f,$10,$10,$10,$10,$10,$10,$0f,$0f,$10,$10,$10,$10,$10,$10
|
||||
db $7f,$7f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
UITilesEnd:
|
||||
|
||||
LetterTiles:
|
||||
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $03,$03,$07,$07,$0f,$0f,$0e,$0e,$1c,$1c,$30,$30,$c0,$c0,$c0,$c0
|
||||
db $24,$24,$6c,$6c,$6c,$6c,$48,$48,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $1a,$1a,$1a,$1a,$7f,$7f,$34,$34,$34,$34,$fe,$fe,$68,$68,$68,$68
|
||||
db $08,$08,$3c,$3c,$6a,$6a,$68,$68,$3c,$3c,$0a,$0a,$6a,$6a,$3c,$3c
|
||||
db $63,$63,$a6,$a6,$ac,$ac,$d8,$d8,$1b,$1b,$35,$35,$65,$65,$c6,$c6
|
||||
db $18,$18,$24,$24,$28,$28,$18,$18,$2c,$2c,$66,$66,$67,$67,$39,$39
|
||||
db $18,$18,$18,$18,$18,$18,$30,$30,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $04,$04,$0c,$0c,$18,$18,$10,$10,$10,$10,$18,$18,$0c,$0c,$04,$04
|
||||
db $20,$20,$30,$30,$18,$18,$08,$08,$08,$08,$18,$18,$30,$30,$20,$20
|
||||
db $00,$00,$08,$08,$28,$28,$1e,$1e,$78,$78,$14,$14,$10,$10,$00,$00
|
||||
db $00,$00,$00,$00,$18,$18,$18,$18,$7e,$7e,$18,$18,$18,$18,$00,$00
|
||||
db $00,$00,$00,$00,$00,$00,$00,$00,$0c,$0c,$0c,$0c,$0c,$0c,$18,$18
|
||||
db $00,$00,$00,$00,$00,$00,$1c,$1c,$38,$38,$00,$00,$00,$00,$00,$00
|
||||
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$18,$18,$18,$00,$00
|
||||
db $04,$04,$0c,$0c,$0c,$0c,$18,$18,$18,$18,$30,$30,$30,$30,$20,$20
|
||||
db $00,$00,$38,$38,$64,$64,$64,$64,$64,$64,$64,$64,$64,$64,$38,$38
|
||||
db $08,$08,$18,$18,$38,$38,$18,$18,$18,$18,$18,$18,$18,$18,$3c,$3c
|
||||
db $00,$00,$38,$38,$4c,$4c,$0c,$0c,$0c,$0c,$18,$18,$30,$30,$7c,$7c
|
||||
db $00,$00,$3c,$3c,$06,$06,$06,$06,$1c,$1c,$06,$06,$06,$06,$3c,$3c
|
||||
db $00,$00,$04,$04,$26,$26,$26,$26,$3e,$3e,$06,$06,$06,$06,$04,$04
|
||||
db $00,$00,$7c,$7c,$64,$64,$60,$60,$78,$78,$44,$44,$04,$04,$38,$38
|
||||
db $00,$00,$20,$20,$30,$30,$30,$30,$3c,$3c,$32,$32,$32,$32,$1c,$1c
|
||||
db $00,$00,$7c,$7c,$4c,$4c,$0c,$0c,$3e,$3e,$18,$18,$30,$30,$20,$20
|
||||
db $00,$00,$78,$78,$64,$64,$64,$64,$38,$38,$64,$64,$64,$64,$3c,$3c
|
||||
db $00,$00,$38,$38,$4c,$4c,$4c,$4c,$3c,$3c,$0c,$0c,$0c,$0c,$18,$18
|
||||
db $00,$00,$00,$00,$18,$18,$18,$18,$00,$00,$18,$18,$18,$18,$00,$00
|
||||
db $00,$00,$00,$00,$0c,$0c,$0c,$0c,$00,$00,$0c,$0c,$0c,$0c,$18,$18
|
||||
db $00,$00,$0c,$0c,$18,$18,$30,$30,$60,$60,$30,$30,$18,$18,$0c,$0c
|
||||
db $00,$00,$00,$00,$3c,$3c,$3c,$3c,$00,$00,$3c,$3c,$3c,$3c,$00,$00
|
||||
db $00,$00,$30,$30,$18,$18,$0c,$0c,$06,$06,$0c,$0c,$18,$18,$30,$30
|
||||
db $38,$38,$6c,$6c,$24,$24,$0c,$0c,$18,$18,$18,$18,$00,$00,$18,$18
|
||||
db $3c,$3c,$62,$62,$59,$59,$45,$45,$5d,$5d,$5d,$5d,$63,$63,$38,$38
|
||||
db $00,$00,$38,$38,$34,$34,$32,$32,$3e,$3e,$32,$32,$32,$32,$32,$32
|
||||
db $00,$00,$7c,$7c,$32,$32,$32,$32,$3c,$3c,$32,$32,$32,$32,$1c,$1c
|
||||
db $00,$00,$3c,$3c,$72,$72,$62,$62,$60,$60,$60,$60,$62,$62,$3c,$3c
|
||||
db $00,$00,$f8,$f8,$64,$64,$62,$62,$62,$62,$62,$62,$62,$62,$3c,$3c
|
||||
db $00,$00,$fc,$fc,$60,$60,$60,$60,$78,$78,$60,$60,$60,$60,$3c,$3c
|
||||
db $00,$00,$fc,$fc,$60,$60,$60,$60,$78,$78,$60,$60,$60,$60,$20,$20
|
||||
db $00,$00,$78,$78,$64,$64,$60,$60,$60,$60,$6e,$6e,$64,$64,$3c,$3c
|
||||
db $00,$00,$40,$40,$62,$62,$62,$62,$7e,$7e,$62,$62,$62,$62,$22,$22
|
||||
db $00,$00,$10,$10,$18,$18,$18,$18,$18,$18,$18,$18,$18,$18,$08,$08
|
||||
db $00,$00,$08,$08,$0c,$0c,$0c,$0c,$0c,$0c,$4c,$4c,$6c,$6c,$3c,$3c
|
||||
db $00,$00,$40,$40,$64,$64,$68,$68,$70,$70,$68,$68,$64,$64,$22,$22
|
||||
db $00,$00,$20,$20,$30,$30,$30,$30,$30,$30,$30,$30,$32,$32,$1e,$1e
|
||||
db $00,$00,$3e,$3e,$6a,$6a,$6a,$6a,$6a,$6a,$62,$62,$62,$62,$22,$22
|
||||
db $00,$00,$72,$72,$6a,$6a,$6a,$6a,$6a,$6a,$66,$66,$62,$62,$22,$22
|
||||
db $00,$00,$3c,$3c,$66,$66,$62,$62,$62,$62,$62,$62,$32,$32,$1e,$1e
|
||||
db $00,$00,$f8,$f8,$64,$64,$64,$64,$7c,$7c,$60,$60,$60,$60,$20,$20
|
||||
db $00,$00,$38,$38,$64,$64,$62,$62,$62,$62,$6a,$6a,$64,$64,$3b,$3b
|
||||
db $00,$00,$f8,$f8,$64,$64,$64,$64,$7c,$7c,$68,$68,$64,$64,$23,$23
|
||||
db $00,$00,$38,$38,$64,$64,$60,$60,$38,$38,$04,$04,$64,$64,$38,$38
|
||||
db $00,$00,$7e,$7e,$5a,$5a,$18,$18,$18,$18,$18,$18,$18,$18,$08,$08
|
||||
db $00,$00,$40,$40,$62,$62,$62,$62,$62,$62,$62,$62,$62,$62,$3c,$3c
|
||||
db $00,$00,$40,$40,$62,$62,$62,$62,$62,$62,$24,$24,$34,$34,$18,$18
|
||||
db $00,$00,$c3,$c3,$62,$62,$62,$62,$6a,$6a,$6a,$6a,$6a,$6a,$34,$34
|
||||
db $00,$00,$42,$42,$62,$62,$34,$34,$18,$18,$3c,$3c,$66,$66,$42,$42
|
||||
db $00,$00,$4c,$4c,$4c,$4c,$4c,$4c,$3c,$3c,$0c,$0c,$4c,$4c,$78,$78
|
||||
db $00,$00,$7e,$7e,$46,$46,$0c,$0c,$18,$18,$30,$30,$62,$62,$7e,$7e
|
||||
db $7c,$7c,$60,$60,$60,$60,$60,$60,$60,$60,$60,$60,$60,$60,$7c,$7c
|
||||
db $20,$20,$30,$30,$30,$30,$18,$18,$18,$18,$0c,$0c,$0c,$0c,$04,$04
|
||||
db $3e,$3e,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$3e,$3e
|
||||
db $18,$18,$3c,$3c,$66,$66,$42,$42,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7c,$7c,$3e,$3e
|
||||
db $30,$30,$18,$18,$0c,$0c,$04,$04,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
db $00,$00,$00,$00,$38,$38,$0c,$0c,$3c,$3c,$4c,$4c,$3a,$3a,$00,$00
|
||||
db $00,$00,$30,$30,$30,$30,$3c,$3c,$32,$32,$32,$32,$3c,$3c,$00,$00
|
||||
db $00,$00,$00,$00,$1c,$1c,$30,$30,$30,$30,$30,$30,$1c,$1c,$00,$00
|
||||
db $00,$00,$0c,$0c,$0c,$0c,$3c,$3c,$4c,$4c,$4c,$4c,$3c,$3c,$00,$00
|
||||
db $00,$00,$00,$00,$38,$38,$64,$64,$78,$78,$60,$60,$3c,$3c,$00,$00
|
||||
db $00,$00,$0e,$0e,$18,$18,$3c,$3c,$18,$18,$18,$18,$18,$18,$00,$00
|
||||
db $00,$00,$00,$00,$3c,$3c,$4c,$4c,$4c,$4c,$3c,$3c,$0c,$0c,$38,$38
|
||||
db $00,$00,$60,$60,$60,$60,$78,$78,$64,$64,$64,$64,$64,$64,$00,$00
|
||||
db $00,$00,$10,$10,$00,$00,$38,$38,$18,$18,$18,$18,$3c,$3c,$00,$00
|
||||
db $00,$00,$08,$08,$00,$00,$0c,$0c,$0c,$0c,$0c,$0c,$2c,$2c,$18,$18
|
||||
db $00,$00,$60,$60,$68,$68,$68,$68,$70,$70,$68,$68,$64,$64,$00,$00
|
||||
db $00,$00,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$18,$18,$00,$00
|
||||
db $00,$00,$00,$00,$74,$74,$6a,$6a,$6a,$6a,$6a,$6a,$6a,$6a,$00,$00
|
||||
db $00,$00,$00,$00,$78,$78,$64,$64,$64,$64,$64,$64,$64,$64,$00,$00
|
||||
db $00,$00,$00,$00,$38,$38,$64,$64,$64,$64,$64,$64,$38,$38,$00,$00
|
||||
db $00,$00,$00,$00,$78,$78,$64,$64,$64,$64,$78,$78,$60,$60,$60,$60
|
||||
db $00,$00,$00,$00,$3c,$3c,$4c,$4c,$4c,$4c,$3c,$3c,$0c,$0c,$0e,$0e
|
||||
db $00,$00,$00,$00,$1c,$1c,$30,$30,$30,$30,$30,$30,$30,$30,$00,$00
|
||||
db $00,$00,$00,$00,$38,$38,$60,$60,$38,$38,$0c,$0c,$78,$78,$00,$00
|
||||
db $00,$00,$30,$30,$78,$78,$30,$30,$30,$30,$30,$30,$1c,$1c,$00,$00
|
||||
db $00,$00,$00,$00,$64,$64,$64,$64,$64,$64,$64,$64,$3c,$3c,$00,$00
|
||||
db $00,$00,$00,$00,$64,$64,$64,$64,$64,$64,$28,$28,$10,$10,$00,$00
|
||||
db $00,$00,$00,$00,$62,$62,$6a,$6a,$6a,$6a,$6a,$6a,$34,$34,$00,$00
|
||||
db $00,$00,$00,$00,$64,$64,$38,$38,$18,$18,$2c,$2c,$46,$46,$00,$00
|
||||
db $00,$00,$00,$00,$4c,$4c,$4c,$4c,$4c,$4c,$3c,$3c,$0c,$0c,$38,$38
|
||||
db $00,$00,$00,$00,$7e,$7e,$0c,$0c,$18,$18,$30,$30,$7e,$7e,$00,$00
|
||||
db $3c,$3c,$60,$60,$30,$30,$60,$60,$60,$60,$30,$30,$60,$60,$3c,$3c
|
||||
db $20,$20,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$10,$10
|
||||
db $3c,$3c,$06,$06,$0c,$0c,$06,$06,$06,$06,$0c,$0c,$06,$06,$3c,$3c
|
||||
db $00,$00,$00,$00,$31,$31,$7b,$7b,$de,$de,$8c,$8c,$00,$00,$00,$00
|
||||
db $c0,$c0,$a0,$a0,$b8,$b8,$b0,$b0,$da,$da,$12,$12,$1a,$1a,$03,$03
|
||||
LetterTilesEnd:
|
||||
|
||||
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 $8b, $8d, $8d, $8d, $8d, $8d, $8d, $8d, $8d, $8a
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8e, $80, $80, $80, $80, $80, $80, $80, $80, $89
|
||||
db $8c, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $88
|
||||
UITilemapEnd:
|
||||
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, $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
|
||||
CardBrowse.UITilemapEnd:
|
||||
|
@ -12,6 +12,7 @@ CardReadSetup:
|
||||
ld a, 1
|
||||
ldh [vBlocked], a
|
||||
|
||||
ld [vAsyncAfter+1], a
|
||||
ld hl, UITilemap ; origin
|
||||
ld de, $9800 ; destination
|
||||
ld b, 18 ; height
|
||||
@ -130,6 +131,26 @@ CardReadDraw:
|
||||
ld hl, $9800 + (32*1)+11
|
||||
ldh a, [vSelectedSpreadCard]
|
||||
call DrawSpreadMinimap
|
||||
|
||||
ldh a, [vCurrentSpread]
|
||||
ld l, a
|
||||
ldh a, [vCurrentSpread+1]
|
||||
ld h, a
|
||||
call PassList ; skip spread layout
|
||||
ldh a, [vSelectedSpreadCard]
|
||||
or a, a
|
||||
.loopThroughSpreadPositions
|
||||
jp z, .foundSpreadPositionDescription
|
||||
call PassList
|
||||
call PassList
|
||||
dec a
|
||||
jp .loopThroughSpreadPositions
|
||||
.foundSpreadPositionDescription
|
||||
ld de, $9800 + 32*5 + 11
|
||||
call PrintString
|
||||
ld de, $9800 + 32*6 + 11
|
||||
call PrintString
|
||||
|
||||
; the card data is loaded asynchronously, initiated in CardReadUpdate
|
||||
ret
|
||||
|
||||
|
@ -230,18 +230,16 @@ MainMenuUpdate:
|
||||
jp .doneWithMenuSelect
|
||||
.option1
|
||||
ld a, 0
|
||||
ld [vSelectedSpreadIndex], a
|
||||
ldh [vSelectedSpreadIndex], a
|
||||
ld hl, ScreenSpreadSelect
|
||||
call ChangeScene
|
||||
ret
|
||||
.option2
|
||||
jp .doneWithMenuSelect
|
||||
.option3
|
||||
ld hl, vCurrentSpread
|
||||
ld [hl], LOW(Spreads.threecard)
|
||||
inc hl
|
||||
ld [hl], HIGH(Spreads.threecard)
|
||||
ld hl, ScreenCardRead
|
||||
ld a, 0
|
||||
ldh [vSelectedCardIndex], a
|
||||
ld hl, ScreenCardBrowse
|
||||
call ChangeScene
|
||||
ret
|
||||
.doneWithMenuSelect
|
||||
|
@ -9,7 +9,6 @@ ScreenSpreadSelect:
|
||||
|
||||
SpreadSelectSetup:
|
||||
ld a, 0
|
||||
ldh [vSelectedSpreadIndex], a
|
||||
ldh [vPreviousSpreadIndex], a
|
||||
ldh [vSelectedSpreadCard], a
|
||||
ldh [vPreviousSpreadCard], a
|
||||
|
23
main.asm
23
main.asm
@ -1,8 +1,14 @@
|
||||
; FF80 CALL
|
||||
; FF81 LOW
|
||||
; FF82 HIGH
|
||||
; FF83 RET
|
||||
; pattern repeats for the first 16 bytes so we can have some call vectors for the scene system
|
||||
; infinite thanks to:
|
||||
; gbdev.io and the pandocs for everything
|
||||
; alex for consulting on tarot endlessly
|
||||
; moss for keeping me from working sixteen hours a day and burning out
|
||||
; yuri for letting me bounce ideas off you at all times
|
||||
|
||||
; 0xc100 CALL
|
||||
; 0xc101 LOW - SCENE_SETUP points to this
|
||||
; 0xc102 HIGH
|
||||
; 0xc103 RET
|
||||
; 0xc104 CALL ...
|
||||
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
|
||||
@ -70,6 +76,12 @@ EntryPoint:
|
||||
ld bc, LetterTilesEnd - LetterTiles
|
||||
call CopyRangeUnsafe
|
||||
|
||||
; initialize app-wide variables
|
||||
ld a, 0
|
||||
ldh [vSelectedSpreadIndex], a
|
||||
ldh [vSelectedCardIndex], a
|
||||
|
||||
; move on to framework stuff
|
||||
|
||||
; set up the scene and interrupt vectors
|
||||
ld hl, Instructions
|
||||
@ -433,6 +445,7 @@ INCLUDE "CopyTilesSafe.inc"
|
||||
INCLUDE "ScreenMainMenu.inc"
|
||||
INCLUDE "ScreenSpreadSelect.inc"
|
||||
INCLUDE "ScreenCardRead.inc"
|
||||
INCLUDE "ScreenCardBrowse.inc"
|
||||
|
||||
INCLUDE "CardLibrary.inc"
|
||||
|
||||
|
BIN
source.zip
BIN
source.zip
Binary file not shown.
32
tileset.asm
32
tileset.asm
@ -34,21 +34,21 @@ tileset:
|
||||
|
||||
|
||||
BackgroundCopyCopy:
|
||||
db $0e, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0f, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
|
||||
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, $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, $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 $11, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $10, $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
|
||||
|
Loading…
Reference in New Issue
Block a user