Skip to content

Commit

Permalink
taus: Combine render code into render stats
Browse files Browse the repository at this point in the history
This avoids a collision with twoplayer caused by an optimization to run
render sooner.
  • Loading branch information
ejona86 committed Apr 26, 2020
1 parent 2086dbf commit 0e32721
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
4 changes: 0 additions & 4 deletions taus.ips.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
MEMORY {
RAM: start = $0760, size = $00A0, file = ""; # GAMEBSS init is limited to 255 bytes
IPSHDR: start = $0000, size = $0005;
JMP_RENDER_MODHDR:start = $0000, size = $0005;
JMP_RENDER_MOD: start = $800E, size = $0003;
SKIP_LEGALHDR:start = $0000, size = $0005;
SKIP_LEGAL: start = $8236, size = $0002;
JMP_INIT_GAME_STATEHDR:start = $0000, size = $0005;
Expand Down Expand Up @@ -49,8 +47,6 @@ SEGMENTS {
JMP_INIT_GAME_STATE: load = JMP_INIT_GAME_STATE, define = yes;
JMP_POST_GAME_STATSHDR: load = JMP_POST_GAME_STATSHDR;
JMP_POST_GAME_STATS: load = JMP_POST_GAME_STATS, define = yes;
JMP_RENDER_MODHDR: load = JMP_RENDER_MODHDR;
JMP_RENDER_MOD: load = JMP_RENDER_MOD, define = yes;
JMP_RENDER_STATSHDR: load = JMP_RENDER_STATSHDR;
JMP_RENDER_STATS: load = JMP_RENDER_STATS, define = yes;
}
39 changes: 15 additions & 24 deletions taus.s
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ chartDrawn:

.segment "CODE"

renderMod:
jsr render

lda copyToPpuDuringRenderAddr+1
beq @ret
sta tmp2
lda copyToPpuDuringRenderAddr
sta tmp1
jsr copyToPpu
lda #$00
sta copyToPpuDuringRenderAddr
sta copyToPpuDuringRenderAddr+1
@ret:
rts

initGameState_mod:
.import __GAMEBSS_SIZE__, __GAMEBSS_RUN__
jsr memset_page
Expand Down Expand Up @@ -345,7 +330,7 @@ renderStats:
bne @hasTrns
lda TRNS+2
bne @hasTrns
beq @ret
beq @checkForAddrToCopy
@hasTrns:
lda #$22
sta PPUADDR
Expand All @@ -357,6 +342,16 @@ renderStats:
jsr twoDigsToPPU
lda TRNS
jsr twoDigsToPPU
@checkForAddrToCopy:
lda copyToPpuDuringRenderAddr+1
beq @ret
sta tmp2
lda copyToPpuDuringRenderAddr
sta tmp1
jsr copyToPpu
lda #$00
sta copyToPpuDuringRenderAddr
sta copyToPpuDuringRenderAddr+1
@ret:
lda #$00
sta $B0
Expand All @@ -383,10 +378,14 @@ postGameStats:
.import chart_attributetable_patch
cmp #20-6-2
bne @checkInput
; Handled by renderStats
lda #<chart_attributetable_patch
sta copyToPpuDuringRenderAddr
lda #>chart_attributetable_patch
sta copyToPpuDuringRenderAddr+1
lda outOfDateRenderFlags
ora #$40
sta outOfDateRenderFlags

@checkInput:
; require pressing start independent of score
Expand Down Expand Up @@ -603,14 +602,6 @@ multiplyBy100:
; is okay. We want to leave the #$03 intact to support Game Genie codes
; that skip the ending animation.

.segment "JMP_RENDER_MODHDR"
ips_hunkhdr "JMP_RENDER_MOD"

.segment "JMP_RENDER_MOD"

; within nmi, replaces "jsr render"
jsr renderMod

.segment "JMP_RENDER_STATSHDR"
ips_hunkhdr "JMP_RENDER_STATS"

Expand Down

0 comments on commit 0e32721

Please sign in to comment.