Skip to content

Commit 2fa52ce

Browse files
committed
change 255 to unused mapper id 1000
1 parent b286f46 commit 2fa52ce

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const mappers = { // https://www.nesdev.org/wiki/Mapper
1212
3: 'CNROM',
1313
4: 'MMC3',
1414
5: 'MMC5',
15-
255: 'Autodetect MMC1/CNROM',
15+
1000: 'Autodetect MMC1/CNROM',
1616
};
1717

1818
// options handling
@@ -51,7 +51,7 @@ console.log(`using ${nativeCC65 ? 'system' : 'wasm'} ca65/ld65`);
5151

5252
// mapper options
5353

54-
const mapper = args.find((d) => d.startsWith('-m'))?.slice(2) ?? 255;
54+
const mapper = args.find((d) => d.startsWith('-m'))?.slice(2) ?? 1000;
5555

5656
if (!mappers[mapper]) {
5757
console.error(

src/constants.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.ifndef INES_MAPPER ; is set via ca65 flags
2-
INES_MAPPER := 255 ; 1 (MMC1), 3 (CNROM), 4 (MMC3), 5 (MMC5), and 255 (autodetect 1/3)
2+
INES_MAPPER := 1000 ; 1 (MMC1), 3 (CNROM), 4 (MMC3), 5 (MMC5), and 1000 (autodetect 1/3)
33
.endif
44

55
.ifndef SAVE_HIGHSCORES

src/header.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
INES_MIRROR = 0 ; 0 = horizontal mirroring, 1 = vertical mirroring (ignored in MMC1)
1313
INES_SRAM = 1 ; 1 = battery backed SRAM at $6000-7FFF
1414

15-
; Override INES_MAPPER for mode 255 (auto detect)
16-
.if INES_MAPPER = 255
15+
; Override INES_MAPPER for mode 1000 (auto detect)
16+
.if INES_MAPPER = 1000
1717
.if CNROM_OVERRIDE
1818
_INES_MAPPER = 3 ; Test CNROM on Emulator/Flashcart
1919
.else

src/io.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ MMC5_CHR_BANK0 := $5123 ; 4kb page index
6262
MMC5_CHR_BANK1 := $5127
6363

6464
.macro RESET_MMC1
65-
.if INES_MAPPER = 1 .or INES_MAPPER = 255
65+
.if INES_MAPPER = 1 .or INES_MAPPER = 1000
6666
: inc :- ; increments inc ($aa), writing a negative value to prg
6767
; https://www.nesdev.org/wiki/MMC1#Reset
6868
.endif

src/main.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mainLoop:
5555
.include "util/menuthrottle.asm"
5656
.include "util/modetext.asm"
5757
.include "util/mapper.asm"
58-
.if INES_MAPPER = 255
58+
.if INES_MAPPER = 1000
5959
.include "util/autodetect.asm"
6060
.endif
6161

src/ram.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ dasOnlyShiftDisabled: .res 1 ; $63A
210210

211211
invisibleFlag: .res 1 ; $63B ; 0 for normal mode, non-zero for Invisible playfield rendering. Reset on game init and game over.
212212

213-
mapperId: .res 1 ; $63C ; For INES_MAPPER 255 (autodetect). 0 = CNROM. 1 = MMC1.
213+
mapperId: .res 1 ; $63C ; For INES_MAPPER 1000 (autodetect). 0 = CNROM. 1 = MMC1.
214214

215215
.res $38
216216

src/reset.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ reset: cld
5353

5454
mapperInit:
5555
; autodetect
56-
.if INES_MAPPER = 255
56+
.if INES_MAPPER = 1000
5757
setMMC1PRG ; initialize mmc1 just in case
5858
; cnrom can pass one of these tests but not both.
5959
; Start with the one it's supposed to fail.

src/util/mapper.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ changeCHRBanks:
4747
sta generalCounter
4848

4949
; autodetect
50-
.if INES_MAPPER = 255
50+
.if INES_MAPPER = 1000
5151
ldx mapperId
5252
beq @cnrom
5353
changeCHRBanksMMC1
@@ -113,7 +113,7 @@ changeCHRBanks:
113113

114114
setHorizontalMirroring:
115115
; autodetect
116-
.if INES_MAPPER = 255
116+
.if INES_MAPPER = 1000
117117
lda mapperId
118118
beq @cnrom
119119
lda #%10011
@@ -144,10 +144,10 @@ setHorizontalMirroring:
144144
rts
145145

146146
setVerticalMirroring:
147-
; Unused except during mapper detect for INES_MAPPER 255
147+
; Unused except during mapper detect for INES_MAPPER 1000
148148

149149
; autodetect
150-
.if INES_MAPPER = 255
150+
.if INES_MAPPER = 1000
151151
lda mapperId
152152
beq @cnrom
153153
lda #%10010
@@ -177,7 +177,7 @@ setVerticalMirroring:
177177
.endif
178178
rts
179179

180-
.if INES_MAPPER = 3 .or INES_MAPPER = 255
180+
.if INES_MAPPER = 3 .or INES_MAPPER = 1000
181181
; bus conflict workaround
182182
cnromBanks:
183183
.byte $00,$01

0 commit comments

Comments
 (0)