add joy button support & text intro

This commit is contained in:
Dagen Brock 2014-06-04 23:47:32 -05:00
parent bd33f90e2c
commit 66778e7f20
2 changed files with 58 additions and 11 deletions

View File

@ -129,6 +129,15 @@ DL_NibSwap
and #07
adc $00
rts
DL_WipeInNoNib
sty DL_WipeLn2 ; set up color bytes to write
sty DL_WipeLn2_I
stx DL_WipeLn1
stx DL_WipeLn1_I
sta DL_WipeLn0
sta DL_WipeLn0_I
jmp DL_WipeIt
DL_WipeIn
sty DL_WipeLn2 ; set up color bytes to write
stx DL_WipeLn1
@ -144,6 +153,7 @@ DL_WipeIn
jsr DL_NibSwap
sta DL_WipeLn2_I
DL_WipeIt
ldx DL_WipeDelay
jsr VBlankX ; Frame 1 - special case (clipped)
lda DL_WipeLn0
@ -349,6 +359,7 @@ DrawTap lda #tapMaskColor
rts
DrawYou
sty SPR_Y
lda #youMaskColor
sta SPR_MASKCOLOR
@ -362,14 +373,14 @@ DrawYou
sta SPR_WIDTH
lda #13
sta SPR_X
lda #4
sta SPR_Y
lda #0
sta SPR_CURLINE
jsr DrawSprite
rts
* y = Y
DrawHi
sty SPR_Y
lda #hiMaskColor
sta SPR_MASKCOLOR
@ -383,8 +394,6 @@ DrawHi
sta SPR_WIDTH
lda #13
sta SPR_X
lda #11
sta SPR_Y
lda #0
sta SPR_CURLINE
jsr DrawSprite

View File

@ -23,8 +23,11 @@ CopyPtr MAC
Main
jsr GetRand ; hack to avoid ugly color on first high score display
jsr DetectMachine ; also inits vbl
jsr LoadHiScore
jsr IntroWipe
jsr DL_SetDLRMode
Title
@ -103,6 +106,8 @@ PreGameLoop
jmp HiScreen
jsr ButtonsCheck
bcs :key
:checkKey lda KEY
bpl :noKey
:key sta STROBE
@ -152,7 +157,9 @@ GAME_OVER
sta SPR_Y
jsr DrawPlaqueShared
ldy #4
jsr DrawYou
ldy #11
jsr DrawHi
ldx #19
@ -181,12 +188,13 @@ GAME_OVER
HiScreen
jsr GetRand
jsr DL_Clear
lda #10
lda #9
sta SPR_Y
jsr DrawPlaqueShared
ldy #10
jsr DrawHi
ldx #19
ldy #11
ldy #10
jsr DrawHiScore
ldx #60
ldy #5
@ -220,8 +228,6 @@ SND_Flap1
rts
SND_Flap2
* lda #5
* sta $c034
ldx #$16 ;LENGTH OF NOISE BURST
:spkLoop sta SPEAKER ;TOGGLE SPEAKER
txa
@ -233,8 +239,6 @@ SND_Flap2
bne :waitLoop
dex ;GET NEXT PULSE OF THIS NOISE BURST
bne :spkLoop
* ldx #$0 ;LENGTH OF NOISE BURST
* stx $c034
rts
@ -242,7 +246,6 @@ SND_Static
ldx #$80 ;LENGTH OF NOISE BURST
:spkLoop lda SPEAKER ;TOGGLE SPEAKER
jsr GetRand
and #%1000000
tay
* ldy $BA00,X ;GET PULSE WIDTH PSEUDO-RANDOMLY
:waitLoop dey ;DELAY LOOP FOR PULSE WIDTH
@ -253,6 +256,7 @@ SND_Static
ldx #$60 ;LENGTH OF NOISE BURST
:spkLoop2 lda SPEAKER ;TOGGLE SPEAKER
jsr GetRand
and #%1000000
tay
* ldy $BA00,X ;GET PULSE WIDTH PSEUDO-RANDOMLY
:waitLoop2 dey ;DELAY LOOP FOR PULSE WIDTH
@ -276,6 +280,8 @@ HandleInput
lda BIRD_Y
sta BIRD_Y_OLD
;Update bird and velocity in here
jsr ButtonsCheck ;returns 0 when no button hit
bcs :flap ;don't even check keys if button was hit
:kloop lda KEY
bpl :noFlap
:key sta STROBE
@ -319,6 +325,18 @@ HandleInput
sta BIRD_Y
:keyDone jmp HandleInputDone
ButtonsCheck
lda $c061 ;b0
cmp #128
bcs :hit
lda $c062 ;b1
cmp #128
bcs :hit
lda $c063 ;b2
bcs :hit
clc
:hit rts ;will be non-zero if we bcs'ed our way here
* A= key
QuitKeyCheck cmp #"q"
beq :quitHit
@ -796,6 +814,26 @@ DetectMachine
GMachineIIgs dw 0
IntroWipe
sta C80STOREON
lda #"="
ldx #"-"
ldy #" "
jsr DL_WipeInNoNib
sta TXTPAGE1
ldx #1
:loop lda IntroText,x
beq :done
sta Lo12+10,x
inx
cpx IntroText ; length byte
bne :loop
:done
ldx #90
ldy #1
jsr WaitKeyXY
rts
IntroText str "Dagen Brock presents..."
Greetz str "Michael J. Mahon" ; MJM
str "Antoine Vignau" ; Brutal Deluxe