reversed cards now integrated into shuffling etc
This commit is contained in:
parent
e70b752ec2
commit
0f8152a803
@ -113,10 +113,12 @@ LoadCardDataAsync:
|
|||||||
ld [cvCardAddress + 1], a
|
ld [cvCardAddress + 1], a
|
||||||
ld b, a
|
ld b, a
|
||||||
|
|
||||||
ld a, [vCurrentCardReversed]
|
ld a, [vSelectedCardIndex]
|
||||||
call OneRandomByte
|
ld b, 0
|
||||||
ld a, [rLFSR]
|
ld c, a ; bc from a, the number of the card in the cards list
|
||||||
and a, 1
|
ld hl, DECK_FLIPS + 1
|
||||||
|
add hl, bc
|
||||||
|
ld a, [hl]
|
||||||
ld [vCurrentCardReversed], a
|
ld [vCurrentCardReversed], a
|
||||||
|
|
||||||
cp a, 0
|
cp a, 0
|
||||||
@ -428,11 +430,11 @@ CardInit:
|
|||||||
ld [rOBP0], a
|
ld [rOBP0], a
|
||||||
ld [rOBP1], a
|
ld [rOBP1], a
|
||||||
|
|
||||||
|
call CARD_INIT - 1
|
||||||
|
|
||||||
ld a, [vCurrentCardReversed]
|
ld a, [vCurrentCardReversed]
|
||||||
cp a, 0
|
cp a, 0
|
||||||
call nz, RotateSprites180
|
call nz, RotateSprites180
|
||||||
|
|
||||||
call CARD_INIT - 1
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CardUpdate:
|
CardUpdate:
|
||||||
|
@ -93,6 +93,21 @@ CardBrowseUpdate:
|
|||||||
ret
|
ret
|
||||||
.doneWithB
|
.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, [vSelectedCardIndex]
|
ld a, [vSelectedCardIndex]
|
||||||
ld hl, rMYBTNP
|
ld hl, rMYBTNP
|
||||||
bit 0, [hl]
|
bit 0, [hl]
|
||||||
@ -103,6 +118,8 @@ CardBrowseUpdate:
|
|||||||
jp z, :+ ; skip the following code if right is not pressed
|
jp z, :+ ; skip the following code if right is not pressed
|
||||||
dec a
|
dec a
|
||||||
:
|
:
|
||||||
|
.doneWithButtons
|
||||||
|
|
||||||
ld [vSelectedCardIndex], a
|
ld [vSelectedCardIndex], a
|
||||||
ld hl, Cards
|
ld hl, Cards
|
||||||
call ArrayClampLooping
|
call ArrayClampLooping
|
||||||
@ -113,6 +130,8 @@ CardBrowseUpdate:
|
|||||||
cp a, [hl]
|
cp a, [hl]
|
||||||
ret z ; if the selected card diddn't change, nothing to do
|
ret z ; if the selected card diddn't change, nothing to do
|
||||||
|
|
||||||
|
.attemptCardChange
|
||||||
|
|
||||||
ld a, [vBlocked]
|
ld a, [vBlocked]
|
||||||
cp a, 0
|
cp a, 0
|
||||||
ret nz
|
ret nz
|
||||||
|
@ -91,6 +91,7 @@ CardReadUpdate:
|
|||||||
ret
|
ret
|
||||||
.doneWithB
|
.doneWithB
|
||||||
|
|
||||||
|
|
||||||
ld a, [vSelectedSpreadCard]
|
ld a, [vSelectedSpreadCard]
|
||||||
ld hl, rMYBTNP
|
ld hl, rMYBTNP
|
||||||
bit 1, [hl]
|
bit 1, [hl]
|
||||||
@ -181,6 +182,7 @@ ChangedCardTask:
|
|||||||
ld b, 0
|
ld b, 0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
|
|
||||||
ld [vSelectedCardIndex], a
|
ld [vSelectedCardIndex], a
|
||||||
ld [vPreviousCardIndex], a
|
ld [vPreviousCardIndex], a
|
||||||
|
|
||||||
|
@ -27,8 +27,7 @@ ScreenShuffle:
|
|||||||
dw ShuffleTeardown
|
dw ShuffleTeardown
|
||||||
|
|
||||||
ShuffleSetup:
|
ShuffleSetup:
|
||||||
ld hl, SHUFFLED_DECK
|
ld a, [SHUFFLED_DECK]
|
||||||
ld a, [hl]
|
|
||||||
dec a
|
dec a
|
||||||
ld [vShuffleIndex], a
|
ld [vShuffleIndex], a
|
||||||
|
|
||||||
@ -164,22 +163,18 @@ CenterButtonHandler:
|
|||||||
ld hl, rMYBTNP
|
ld hl, rMYBTNP
|
||||||
: bit 0, [hl]
|
: bit 0, [hl]
|
||||||
jp z, :+
|
jp z, :+
|
||||||
|
|
||||||
ld a, S_RightOut
|
ld a, S_RightOut
|
||||||
ld [vState], a
|
ld [vState], a
|
||||||
: bit 1, [hl]
|
: bit 1, [hl]
|
||||||
jp z, :+
|
jp z, :+
|
||||||
|
|
||||||
ld a, S_LeftOut
|
ld a, S_LeftOut
|
||||||
ld [vState], a
|
ld [vState], a
|
||||||
: bit 2, [hl]
|
: bit 2, [hl]
|
||||||
jp z, :+
|
jp z, :+
|
||||||
|
|
||||||
ld a, S_UpOut
|
ld a, S_UpOut
|
||||||
ld [vState], a
|
ld [vState], a
|
||||||
: bit 3, [hl]
|
: bit 3, [hl]
|
||||||
jp z, :+
|
jp z, :+
|
||||||
|
|
||||||
ld a, S_DownOut
|
ld a, S_DownOut
|
||||||
ld [vState], a
|
ld [vState], a
|
||||||
: ret
|
: ret
|
||||||
@ -353,6 +348,10 @@ DoSomeShuffling:
|
|||||||
call OneSwap
|
call OneSwap
|
||||||
call OneSwap
|
call OneSwap
|
||||||
call OneSwap
|
call OneSwap
|
||||||
|
call OneSwap
|
||||||
|
call OneSwap
|
||||||
|
call OneSwap
|
||||||
|
call OneSwap
|
||||||
ret
|
ret
|
||||||
|
|
||||||
OneSwap: ; shuffles once and decrements vshuffleindex
|
OneSwap: ; shuffles once and decrements vshuffleindex
|
||||||
@ -370,6 +369,17 @@ OneSwap: ; shuffles once and decrements vshuffleindex
|
|||||||
ld hl, SHUFFLED_DECK
|
ld hl, SHUFFLED_DECK
|
||||||
call SwapCards ; arguments c and e as indices to swap, hl as array in memory
|
call SwapCards ; arguments c and e as indices to swap, hl as array in memory
|
||||||
|
|
||||||
|
call ClockLFSR
|
||||||
|
ld a, [vShuffleIndex]
|
||||||
|
ld b, 0
|
||||||
|
ld c, a
|
||||||
|
ld hl, DECK_FLIPS+1
|
||||||
|
add hl, bc
|
||||||
|
ld a, [rLFSR]
|
||||||
|
and a, %10000000
|
||||||
|
ld [hl], a
|
||||||
|
|
||||||
|
|
||||||
ld a, [vShuffleIndex]
|
ld a, [vShuffleIndex]
|
||||||
dec a
|
dec a
|
||||||
ld [vShuffleIndex], a ; decrement vshuffleindex so the next time around
|
ld [vShuffleIndex], a ; decrement vshuffleindex so the next time around
|
||||||
|
@ -7,9 +7,15 @@
|
|||||||
TheFool:
|
TheFool:
|
||||||
db 10, "PAGE OF "
|
db 10, "PAGE OF "
|
||||||
db 10, "CUPS "
|
db 10, "CUPS "
|
||||||
|
|
||||||
db 9, "dreamer "
|
db 9, "dreamer "
|
||||||
db 9, "new love "
|
db 9, "new love "
|
||||||
db 9, "imagine "
|
db 9, "imagine "
|
||||||
|
|
||||||
|
db 9, "childish "
|
||||||
|
db 9, "seduction"
|
||||||
|
db 9, "envy "
|
||||||
|
|
||||||
dw .BackgroundCopyEnd - .BackgroundCopy
|
dw .BackgroundCopyEnd - .BackgroundCopy
|
||||||
dw .BackgroundCopy
|
dw .BackgroundCopy
|
||||||
dw .KeyArtTilesEnd - .KeyArtTiles
|
dw .KeyArtTilesEnd - .KeyArtTiles
|
||||||
@ -26,12 +32,9 @@ TheFool:
|
|||||||
.fDraw: ret
|
.fDraw: ret
|
||||||
.fPrintPrep: ret
|
.fPrintPrep: ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.SpriteTiles:
|
.SpriteTiles:
|
||||||
.SpriteTilesEnd:
|
.SpriteTilesEnd:
|
||||||
|
|
||||||
|
|
||||||
.KeyArtTiles:
|
.KeyArtTiles:
|
||||||
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||||
db $00,$00,$00,$00,$01,$01,$03,$03,$07,$07,$0f,$0f,$0f,$0f,$0f,$0f
|
db $00,$00,$00,$00,$01,$01,$03,$03,$07,$07,$0f,$0f,$0f,$0f,$0f,$0f
|
||||||
|
23
main.asm
23
main.asm
@ -7,9 +7,6 @@
|
|||||||
; fae for all your help on music and sound and sunday mornings
|
; fae for all your help on music and sound and sunday mornings
|
||||||
; sadie for hardware and packaging help
|
; sadie for hardware and packaging help
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def MY_OAM equ $c000
|
def MY_OAM equ $c000
|
||||||
|
|
||||||
; $c100 - c120 call handles, scene stack, interrupt, card functions
|
; $c100 - c120 call handles, scene stack, interrupt, card functions
|
||||||
@ -41,7 +38,8 @@ def CARD_VARS_START equ $c700 ; variables for animation of individual cards
|
|||||||
def CVS equ CARD_VARS_START ; handy to be able to refer to CVS by a short name
|
def CVS equ CARD_VARS_START ; handy to be able to refer to CVS by a short name
|
||||||
def AUDIO_VARS_START equ $c800 ; variables for the audio subsystem
|
def AUDIO_VARS_START equ $c800 ; variables for the audio subsystem
|
||||||
def PRINTER_VARS_START equ $c900
|
def PRINTER_VARS_START equ $c900
|
||||||
def SHUFFLED_DECK equ $ca00 ; location for the shuffled deck
|
def SHUFFLED_DECK equ $cb00 ; location for the shuffled deck
|
||||||
|
def DECK_FLIPS equ $cb80 ; location for the flips
|
||||||
|
|
||||||
pushs "work spaces", WRAMX[$D000]
|
pushs "work spaces", WRAMX[$D000]
|
||||||
ZEROES: ds $200
|
ZEROES: ds $200
|
||||||
@ -138,17 +136,30 @@ EntryPoint:
|
|||||||
ld a, 0
|
ld a, 0
|
||||||
ld [vSelectedSpreadIndex], a
|
ld [vSelectedSpreadIndex], a
|
||||||
ld [vSelectedCardIndex], a
|
ld [vSelectedCardIndex], a
|
||||||
|
|
||||||
|
; set up the SHUFFLED_DECK
|
||||||
ld hl, Cards
|
ld hl, Cards
|
||||||
ld b, [hl]
|
ld b, [hl] ; b holds the length of the card array
|
||||||
ld hl, SHUFFLED_DECK
|
ld hl, SHUFFLED_DECK
|
||||||
ld [hl], b
|
ld [hl], b
|
||||||
inc hl
|
inc hl
|
||||||
.writeCard
|
.writeCard
|
||||||
ld [hl+], a
|
ld [hl+], a
|
||||||
inc a
|
inc a
|
||||||
cp a, b
|
cp a, b
|
||||||
jr nz, .writeCard
|
jr nz, .writeCard
|
||||||
|
|
||||||
|
ld c, 0 ; c holds the thing to write to each flip
|
||||||
|
ld a, b ; a holds the length of the array
|
||||||
|
ld hl, DECK_FLIPS
|
||||||
|
ld [hl+], a
|
||||||
|
.writeFlip
|
||||||
|
ld [hl], c ; write a zero to a spot in the array
|
||||||
|
inc hl
|
||||||
|
dec a ; decrement our length counter
|
||||||
|
jr nz, .writeFlip
|
||||||
|
|
||||||
|
|
||||||
ld a, %1010_1010
|
ld a, %1010_1010
|
||||||
ld [rLFSR], a
|
ld [rLFSR], a
|
||||||
|
|
||||||
|
BIN
source.zip
BIN
source.zip
Binary file not shown.
Loading…
Reference in New Issue
Block a user