Skip to content

Commit

Permalink
twoplayer: Fix Type B endgame completion
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
ejona86 committed Nov 10, 2020
1 parent 150c709 commit 4df9e8a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
15 changes: 15 additions & 0 deletions twoplayer-tetris-PRG.s.diff
Original file line number Diff line number Diff line change
Expand Up @@ -1139,3 +1139,18 @@
jmp @pauseLoop

@resume:lda #$1E
@@ -4379,12 +4462,12 @@ @copySuccessGraphic:
inx
iny
jmp @copySuccessGraphic

@graphicCopied:
- lda #$00
- sta player1_vramRow
+ jsr_i playState_bTypeGoalCheck_mod ;lda #$00
+ nop ;sta player1_vramRow
jsr sleep_for_14_vblanks
lda #$00
sta renderMode
lda #$80
jsr sleep_for_a_vblanks
40 changes: 40 additions & 0 deletions twoplayer.s
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,46 @@ updateMusicSpeed_foundBlockInRow_mod:
cmp #$00
rts

playState_bTypeGoalCheck_mod:
.export playState_bTypeGoalCheck_mod
lda numberOfPlayers
cmp #$02
beq @twoPlayers
lda #$00
sta player1_vramRow
rts

@twoPlayers:
; pop return address
pla
pla

lda sleepCounter
bne @alreadyInited
; No need to set vramRow=0 to display the "Success!" message, as
; playState_checkForCompletedRows does so already
lda #$80
sta sleepCounter
rts

@alreadyInited:
lda currentlyPlayingMusicTrack
cmp #$02
bne @checkIfMusicComplete
; The music is already loaded; don't restart it
lda #$00
sta musicTrack

@checkIfMusicComplete:
lda sleepCounter
cmp #$01
beq @doneWithEndMusic
rts

@doneWithEndMusic:
lda #$00
; a is 0, to be stored in playState

playState_updateGameOverCurtain_curtainFinished_mod:
.export playState_updateGameOverCurtain_curtainFinished_mod
sta playState
Expand Down

0 comments on commit 4df9e8a

Please sign in to comment.