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 b, a
|
||||
|
||||
ld a, [vCurrentCardReversed]
|
||||
call OneRandomByte
|
||||
ld a, [rLFSR]
|
||||
and a, 1
|
||||
ld a, [vSelectedCardIndex]
|
||||
ld b, 0
|
||||
ld c, a ; bc from a, the number of the card in the cards list
|
||||
ld hl, DECK_FLIPS + 1
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [vCurrentCardReversed], a
|
||||
|
||||
cp a, 0
|
||||
@ -428,11 +430,11 @@ CardInit:
|
||||
ld [rOBP0], a
|
||||
ld [rOBP1], a
|
||||
|
||||
call CARD_INIT - 1
|
||||
|
||||
ld a, [vCurrentCardReversed]
|
||||
cp a, 0
|
||||
call nz, RotateSprites180
|
||||
|
||||
call CARD_INIT - 1
|
||||
ret
|
||||
|
||||
CardUpdate:
|
||||
|
@ -93,6 +93,21 @@ CardBrowseUpdate:
|
||||
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, [vSelectedCardIndex]
|
||||
ld hl, rMYBTNP
|
||||
bit 0, [hl]
|
||||
@ -103,6 +118,8 @@ CardBrowseUpdate:
|
||||
jp z, :+ ; skip the following code if right is not pressed
|
||||
dec a
|
||||
:
|
||||
.doneWithButtons
|
||||
|
||||
ld [vSelectedCardIndex], a
|
||||
ld hl, Cards
|
||||
call ArrayClampLooping
|
||||
@ -113,6 +130,8 @@ CardBrowseUpdate:
|
||||
cp a, [hl]
|
||||
ret z ; if the selected card diddn't change, nothing to do
|
||||
|
||||
.attemptCardChange
|
||||
|
||||
ld a, [vBlocked]
|
||||
cp a, 0
|
||||
ret nz
|
||||
|
@ -91,6 +91,7 @@ CardReadUpdate:
|
||||
ret
|
||||
.doneWithB
|
||||
|
||||
|
||||
ld a, [vSelectedSpreadCard]
|
||||
ld hl, rMYBTNP
|
||||
bit 1, [hl]
|
||||
@ -181,6 +182,7 @@ ChangedCardTask:
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
|
||||
ld [vSelectedCardIndex], a
|
||||
ld [vPreviousCardIndex], a
|
||||
|
||||
|
@ -27,8 +27,7 @@ ScreenShuffle:
|
||||
dw ShuffleTeardown
|
||||
|
||||
ShuffleSetup:
|
||||
ld hl, SHUFFLED_DECK
|
||||
ld a, [hl]
|
||||
ld a, [SHUFFLED_DECK]
|
||||
dec a
|
||||
ld [vShuffleIndex], a
|
||||
|
||||
@ -164,22 +163,18 @@ CenterButtonHandler:
|
||||
ld hl, rMYBTNP
|
||||
: bit 0, [hl]
|
||||
jp z, :+
|
||||
|
||||
ld a, S_RightOut
|
||||
ld [vState], a
|
||||
: bit 1, [hl]
|
||||
jp z, :+
|
||||
|
||||
ld a, S_LeftOut
|
||||
ld [vState], a
|
||||
: bit 2, [hl]
|
||||
jp z, :+
|
||||
|
||||
ld a, S_UpOut
|
||||
ld [vState], a
|
||||
: bit 3, [hl]
|
||||
jp z, :+
|
||||
|
||||
ld a, S_DownOut
|
||||
ld [vState], a
|
||||
: ret
|
||||
@ -353,6 +348,10 @@ DoSomeShuffling:
|
||||
call OneSwap
|
||||
call OneSwap
|
||||
call OneSwap
|
||||
call OneSwap
|
||||
call OneSwap
|
||||
call OneSwap
|
||||
call OneSwap
|
||||
ret
|
||||
|
||||
OneSwap: ; shuffles once and decrements vshuffleindex
|
||||
@ -370,6 +369,17 @@ OneSwap: ; shuffles once and decrements vshuffleindex
|
||||
ld hl, SHUFFLED_DECK
|
||||
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]
|
||||
dec a
|
||||
ld [vShuffleIndex], a ; decrement vshuffleindex so the next time around
|
||||
|
@ -7,9 +7,15 @@
|
||||
TheFool:
|
||||
db 10, "PAGE OF "
|
||||
db 10, "CUPS "
|
||||
|
||||
db 9, "dreamer "
|
||||
db 9, "new love "
|
||||
db 9, "imagine "
|
||||
|
||||
db 9, "childish "
|
||||
db 9, "seduction"
|
||||
db 9, "envy "
|
||||
|
||||
dw .BackgroundCopyEnd - .BackgroundCopy
|
||||
dw .BackgroundCopy
|
||||
dw .KeyArtTilesEnd - .KeyArtTiles
|
||||
@ -26,12 +32,9 @@ TheFool:
|
||||
.fDraw: ret
|
||||
.fPrintPrep: ret
|
||||
|
||||
|
||||
|
||||
.SpriteTiles:
|
||||
.SpriteTilesEnd:
|
||||
|
||||
|
||||
.KeyArtTiles:
|
||||
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
|
||||
|
21
main.asm
21
main.asm
@ -7,9 +7,6 @@
|
||||
; fae for all your help on music and sound and sunday mornings
|
||||
; sadie for hardware and packaging help
|
||||
|
||||
|
||||
|
||||
|
||||
def MY_OAM equ $c000
|
||||
|
||||
; $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 AUDIO_VARS_START equ $c800 ; variables for the audio subsystem
|
||||
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]
|
||||
ZEROES: ds $200
|
||||
@ -138,8 +136,10 @@ EntryPoint:
|
||||
ld a, 0
|
||||
ld [vSelectedSpreadIndex], a
|
||||
ld [vSelectedCardIndex], a
|
||||
|
||||
; set up the SHUFFLED_DECK
|
||||
ld hl, Cards
|
||||
ld b, [hl]
|
||||
ld b, [hl] ; b holds the length of the card array
|
||||
ld hl, SHUFFLED_DECK
|
||||
ld [hl], b
|
||||
inc hl
|
||||
@ -149,6 +149,17 @@ EntryPoint:
|
||||
cp a, b
|
||||
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 [rLFSR], a
|
||||
|
||||
|
BIN
source.zip
BIN
source.zip
Binary file not shown.
Loading…
Reference in New Issue
Block a user