upgrade navigation on browse screen and start adding minor arcana
This commit is contained in:
parent
0f8152a803
commit
2bc8134741
@ -123,9 +123,20 @@ Spreads:
|
||||
db 18, " Month by month "
|
||||
|
||||
.end
|
||||
|
||||
AdjacentCards:
|
||||
.Downs:
|
||||
db 26
|
||||
db 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
db 22, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
db 0, 1, 2, 3
|
||||
.Ups:
|
||||
db 26
|
||||
db 22, 23, 24, 25, 25, 25, 25, 25, 25, 25
|
||||
db 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9,
|
||||
db 10, 11, 12, 13,
|
||||
|
||||
Cards:
|
||||
db 22 ; length
|
||||
db 26 ; length
|
||||
db BANK(TheFool)
|
||||
dw TheFool
|
||||
db BANK(TheMagician)
|
||||
@ -170,6 +181,16 @@ Cards:
|
||||
dw Judgement
|
||||
db BANK(TheWorld)
|
||||
dw TheWorld
|
||||
|
||||
db BANK(Cups11Page)
|
||||
dw Cups11Page
|
||||
db BANK(Cups11Page)
|
||||
dw Cups11Page
|
||||
db BANK(Cups11Page)
|
||||
dw Cups11Page
|
||||
db BANK(Cups11Page)
|
||||
dw Cups11Page
|
||||
|
||||
|
||||
SECTION "First Eight Cards", ROMX
|
||||
INCLUDE "00TheFool.inc"
|
||||
@ -201,4 +222,5 @@ INCLUDE "19TheSun.inc"
|
||||
|
||||
SECTION "FIFTH EIGHT CARDS", ROMX
|
||||
INCLUDE "20Judgement.inc"
|
||||
INCLUDE "21TheWorld.inc"
|
||||
INCLUDE "21TheWorld.inc"
|
||||
INCLUDE "cups11page.inc"
|
@ -118,17 +118,42 @@ CardBrowseUpdate:
|
||||
jp z, :+ ; skip the following code if right is not pressed
|
||||
dec a
|
||||
:
|
||||
.doneWithButtons
|
||||
ld [vSelectedCardIndex], a
|
||||
ld hl, Cards
|
||||
call ArrayClampLooping
|
||||
ld [vSelectedCardIndex], a
|
||||
|
||||
ld hl, rMYBTNP
|
||||
bit 2, [hl] ; up
|
||||
jp z, :+
|
||||
ld hl, AdjacentCards.Ups+1
|
||||
ld b, 0
|
||||
ld c, a
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
:
|
||||
|
||||
ld hl, rMYBTNP
|
||||
bit 3, [hl] ; up
|
||||
jp z, :+
|
||||
ld hl, AdjacentCards.Downs+1
|
||||
ld b, 0
|
||||
ld c, a
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
:
|
||||
|
||||
ld [vSelectedCardIndex], a
|
||||
ld hl, Cards
|
||||
call ArrayClampLooping
|
||||
ld [vSelectedCardIndex], a
|
||||
|
||||
.doneWithButtons
|
||||
|
||||
ld a, [vSelectedCardIndex]
|
||||
ld hl, vPreviousCardIndex
|
||||
cp a, [hl]
|
||||
ret z ; if the selected card diddn't change, nothing to do
|
||||
ret z ; if the selected card didn't change, nothing to do
|
||||
|
||||
.attemptCardChange
|
||||
|
||||
@ -184,44 +209,54 @@ DrawDeckMinimap:
|
||||
ld hl, Cards
|
||||
ld c, [hl] ; count of cards
|
||||
srl c
|
||||
set 0, c
|
||||
;set 0, c
|
||||
|
||||
ld hl, vSelectedCardIndex
|
||||
ld d, [hl] ; selected card!
|
||||
ld b, $ff ; start at -1 lol
|
||||
ld hl, _SCRN0 + 32 + 11
|
||||
ld hl, _SCRN0 + 32 + 10
|
||||
|
||||
; for this loop, c holds the total tile count
|
||||
; d holds the card which is currently selected
|
||||
; b holds the index of the TILE (two cards) we're currently drawing
|
||||
; hl points to the place we're drawing
|
||||
.loop
|
||||
inc hl
|
||||
inc b
|
||||
ld a, b
|
||||
cp a, 5
|
||||
jp nz, .noNewLine
|
||||
ld [hl], $13
|
||||
ld hl, _SCRN0 + 32*2 + 11
|
||||
cp a, 5 ; after we've drawn 5 tiles (10 cards), draw a newline
|
||||
jp nz, :+
|
||||
ld [hl], $13
|
||||
ld hl, _SCRN0 + 32*2 + 11
|
||||
:
|
||||
cp a, 11 ; after we've drawn 11 tiles (5 + 6) draw a newline
|
||||
jp nz, :+
|
||||
ld [hl], $13
|
||||
ld hl, _SCRN0 + 32*3 + 11
|
||||
:
|
||||
; add more conditions here to define newlines!
|
||||
.noNewLine
|
||||
ld a, b
|
||||
cp a, c
|
||||
jp nc, .doneDrawing
|
||||
jp nc, .doneDrawing ; if b - c doesn't underflow, then we're done; jump to the end
|
||||
|
||||
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
|
||||
srl a ; divide current index by two
|
||||
cp a, b ; check if the currently selected card is in current tile
|
||||
jp z, .drawSelectedCard
|
||||
.drawUnselectedCards ; if it's not, then draw unselected cards
|
||||
ld [hl], $12
|
||||
jp .loop
|
||||
.drawSelectedCard ; if it's in this tile, draw it
|
||||
bit 0, d
|
||||
jp nz, .drawSelectedSecond ; if the 1 bit of the current selection is zero, draw the left-selected-tile
|
||||
ld [hl], $14
|
||||
jp .loop
|
||||
.drawSelectedSecond ; if the 1 bit is nonzero draw the right-selected-tile
|
||||
ld [hl], $15
|
||||
jp .loop
|
||||
.doneDrawing
|
||||
ld [hl], $13
|
||||
ld [hl], $13 ; when we're done, draw a cap
|
||||
ret
|
||||
|
||||
CardBrowse.UpdatePrintUI:
|
||||
@ -305,13 +340,13 @@ CardBrowse.UITilemap:
|
||||
db $0e, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0a, $0f, $09, $02, $02, $02, $02, $02, $02, $02, $02, $08
|
||||
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $00, $04
|
||||
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $00, $04
|
||||
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $03, $00, $00, $00, $00, $00, $00, $00, $00, $04
|
||||
db $0b, $00, $00, $00, $00, $00, $00, $00, $00, $0c, $06, $05, $05, $05, $05, $05, $05, $05, $05, $07
|
||||
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
|
||||
|
@ -91,6 +91,21 @@ CardReadUpdate:
|
||||
ret
|
||||
.doneWithB
|
||||
|
||||
ld hl, rMYBTNP
|
||||
bit 4, [hl]
|
||||
jp z, .doneWithA
|
||||
ld a, [vSelectedCardIndex]
|
||||
ld b, 0
|
||||
ld c, a
|
||||
ld hl, DECK_FLIPS+1
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
xor a, %10000000
|
||||
ld [hl], a
|
||||
|
||||
jr .attemptCardChange
|
||||
.doneWithA
|
||||
|
||||
|
||||
ld a, [vSelectedSpreadCard]
|
||||
ld hl, rMYBTNP
|
||||
@ -102,6 +117,8 @@ CardReadUpdate:
|
||||
jp z, :+ ; skip the following code if right is not pressed
|
||||
inc a
|
||||
:
|
||||
|
||||
.doneWithButtons
|
||||
ld [vSelectedSpreadCard], a
|
||||
ld a, [vCurrentSpread]
|
||||
ld l, a
|
||||
@ -115,6 +132,7 @@ CardReadUpdate:
|
||||
cp a, [hl]
|
||||
ret z ; if the selected card diddn't change, nothing to do
|
||||
|
||||
.attemptCardChange
|
||||
ld a, [vBlocked]
|
||||
cp a, 0
|
||||
ret nz
|
||||
|
Binary file not shown.
@ -4,7 +4,7 @@
|
||||
; then the 16bit address of the tile set
|
||||
; then a 16bit value of the offset between tile map and end
|
||||
; then the 16bit address of the tile map
|
||||
TheFool:
|
||||
Cups11Page:
|
||||
db 10, "PAGE OF "
|
||||
db 10, "CUPS "
|
||||
|
||||
|
BIN
source.zip
BIN
source.zip
Binary file not shown.
Loading…
Reference in New Issue
Block a user