Skip to content

Commit abcb395

Browse files
committed
a start
1 parent 0ff3bff commit abcb395

File tree

11 files changed

+65
-97
lines changed

11 files changed

+65
-97
lines changed

src/chr.asm

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
.segment "CHR"
1+
chrTitle = 0
2+
chrRocket = 1
3+
chrGame = 2
24

3-
.if HAS_MMC
5+
.segment "CHR"
46
.incbin "chr/title_menu_tileset.chr"
5-
.incbin "chr/game_tileset.chr"
67
.incbin "chr/rocket_tileset.chr"
7-
.elseif INES_MAPPER = 3
8-
.incbin "chr/rocket_tileset.chr"
9-
.repeat $1000
10-
.byte $0
11-
.endrepeat
12-
.incbin "chr/title_menu_tileset.chr"
138
.incbin "chr/game_tileset.chr"
14-
.endif

src/gamemode/gametypemenu/menu.asm

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ gameMode_gameTypeMenu:
1414
.if HAS_MMC
1515
; switch to blank charmap
1616
; (stops glitching when resetting)
17-
lda #$03
18-
jsr changeCHRBank1
17+
; lda #$03
18+
; jsr changeCHRBank1 ; should this be all or nothing?
1919
.endif
20-
.if INES_MAPPER = 4
20+
21+
.if INES_MAPPER = 4 ; centralize mirroring
2122
; Horizontal mirroring
2223
lda #$1
2324
sta MMC3_MIRRORING
@@ -41,14 +42,9 @@ gameMode_gameTypeMenu:
4142
jsr copyRleNametableToPpuOffset
4243
.addr game_type_menu_nametable_extra
4344
lda #$00
44-
jsr changeCHRBank0
45-
lda #$00
46-
jsr changeCHRBank1
47-
.if INES_MAPPER = 3
48-
CNROM_CHR_MENU:
49-
lda #1
50-
sta CNROM_CHR_MENU+1
51-
.endif
45+
jsr changeCHRBanks
46+
lda #$80
47+
sta currentPpuCtrl
5248
jsr waitForVBlankAndEnableNmi
5349
jsr updateAudioWaitForNmiAndResetOamStaging
5450
jsr updateAudioWaitForNmiAndEnablePpuRendering

src/gamemode/levelmenu.asm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@ gameMode_levelMenu:
22
RESET_MMC1
33
lda #$10
44
jsr setMMC1Control
5-
.if INES_MAPPER = 3
5+
; .if INES_MAPPER = 3
66
lda currentPpuCtrl
77
and #%10000000
88
sta currentPpuCtrl
9-
.endif
9+
; .endif
1010
jsr updateAudio2
1111
lda #$7
1212
sta renderMode
1313
jsr updateAudioWaitForNmiAndDisablePpuRendering
1414
jsr disableNmi
1515
lda #$00
16-
jsr changeCHRBank0
17-
lda #$00
18-
jsr changeCHRBank1
16+
jsr changeCHRBanks
1917
jsr bulkCopyToPpu
2018
.addr menu_palette
2119
jsr copyRleNametableToPpu

src/gamemode/speedtest.asm

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,8 @@ gameMode_speedTest:
2121
sta PPUADDR
2222
lda #$30
2323
sta PPUDATA
24-
.if HAS_MMC
25-
lda #$01
26-
jsr changeCHRBank0
27-
lda #$01
28-
jsr changeCHRBank1
29-
.elseif INES_MAPPER = 3
30-
lda #%10011001
31-
sta PPUCTRL
32-
sta currentPpuCtrl
33-
.endif
24+
lda #$02
25+
jsr changeCHRBanks
3426

3527
jsr waitForVBlankAndEnableNmi
3628
jsr updateAudioWaitForNmiAndResetOamStaging

src/gamemode/waitscreen.asm

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,9 @@ waitScreenLoad:
66
sta renderMode
77
jsr updateAudioWaitForNmiAndDisablePpuRendering
88
jsr disableNmi
9-
.if HAS_MMC
10-
lda #$02
11-
jsr changeCHRBank0
12-
lda #$02
13-
jsr changeCHRBank1
14-
.elseif INES_MAPPER = 3
15-
CNROM_CHR_LEGAL:
16-
lda #0
17-
sta CNROM_CHR_LEGAL+1
18-
sta currentPpuCtrl
19-
.endif
20-
9+
lda #$00
10+
sta currentPpuCtrl ; all or nothing?
11+
jsr changeCHRBanks
2112
jsr bulkCopyToPpu
2213
.addr wait_palette
2314
jsr copyRleNametableToPpu

src/gamemodestate/initbackground.asm

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
gameModeState_initGameBackground:
22
jsr updateAudioWaitForNmiAndDisablePpuRendering
33
jsr disableNmi
4-
.if HAS_MMC
5-
lda #$01
6-
jsr changeCHRBank0
7-
lda #$01
8-
jsr changeCHRBank1
9-
.endif
4+
lda #$02
5+
jsr changeCHRBanks
106
jsr bulkCopyToPpu
117
.addr game_palette
128
jsr copyRleNametableToPpu
@@ -43,11 +39,11 @@ gameModeState_initGameBackground:
4339
@heartEnd:
4440

4541

46-
.if INES_MAPPER = 3
47-
lda #%10011000
42+
; .if INES_MAPPER = 3
43+
lda #%10000000
4844
sta PPUCTRL
4945
sta currentPpuCtrl
50-
.elseif INES_MAPPER = 4
46+
.if INES_MAPPER = 4
5147
; Vertical mirroring (Prevents screen glitching)
5248
lda #$0
5349
sta MMC3_MIRRORING

src/highscores/entry_screen.asm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,10 @@ highScoreEntryScreen:
119119
jsr updateAudioWaitForNmiAndDisablePpuRendering
120120
jsr disableNmi
121121
lda #$00
122-
jsr changeCHRBank0
123-
lda #$00
124-
jsr changeCHRBank1
125-
.if INES_MAPPER = 3
126-
lda #%10000000
122+
jsr changeCHRBanks
123+
lda #%10000000 ; should this be all or nothing?
127124
sta PPUCTRL
128125
sta currentPpuCtrl
129-
.endif
130126
jsr bulkCopyToPpu
131127
.addr menu_palette
132128
jsr copyRleNametableToPpu

src/nmi/render_mode_play_and_demo.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ render_mode_play_and_demo:
198198
bne @noFlash
199199
stx PPUDATA
200200
@noFlash:
201-
.if INES_MAPPER = 3
202-
lda #%10011000
201+
; .if INES_MAPPER = 3
202+
lda #%10000000
203203
sta PPUCTRL
204204
sta currentPpuCtrl
205-
.endif
205+
; .endif
206206
jsr resetScroll
207207
rts
208208

src/playstate/gameover_rocket.asm

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,10 @@ sleep_gameplay:
7676
endingAnimation: ; rocket_screen
7777
jsr updateAudioWaitForNmiAndDisablePpuRendering
7878
jsr disableNmi
79-
.if HAS_MMC
80-
lda #$02
81-
jsr changeCHRBank0
82-
lda #$02
83-
jsr changeCHRBank1
84-
.elseif INES_MAPPER = 3
85-
CNROM_CHR_ROCKET:
86-
lda #0
87-
sta CNROM_CHR_ROCKET+1
88-
.endif
79+
lda #$00
80+
jsr changeCHRBanks
81+
lda #%10011000
82+
sta currentPpuCtrl
8983
jsr copyRleNametableToPpu
9084
.addr rocket_nametable
9185
jsr bulkCopyToPpu

src/reset.asm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ reset: cld
2222
lda #$10
2323
jsr setMMC1Control
2424
lda #$00
25-
jsr changeCHRBank0
26-
lda #$00
27-
jsr changeCHRBank1
25+
jsr changeCHRBanks
2826
lda #$00
2927
jsr changePRGBank
3028
jmp initRam

0 commit comments

Comments
 (0)