Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: igwgames/nes-starter-kit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: igwgames/nes-starter-kit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: section5_chr_ram
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 14 files changed
  • 1 contributor

Commits on Jan 27, 2024

  1. Basic chr ram setup

    potatolain committed Jan 27, 2024
    Copy the full SHA
    c769017 View commit details
  2. Copy the full SHA
    64c8321 View commit details
  3. Copy the full SHA
    c67387e View commit details
83 changes: 11 additions & 72 deletions config/ca65.cfg
Original file line number Diff line number Diff line change
@@ -12,51 +12,18 @@ MEMORY {
PRG: start = $c000, size = $3c00, file = %O, fill = yes, define = no;
DMC: start = $fc00, size = $03f0, file = %O, fill = yes, define = yes;
PRG_STUB: start = $fff0, size = $0010, file = %O, fill = yes, define = no;
CHR_00: start = $0000, size = $1000, file = %O, fill = yes;
CHR_01: start = $0000, size = $1000, file = %O, fill = yes;
CHR_02: start = $0000, size = $1000, file = %O, fill = yes;
CHR_03: start = $0000, size = $1000, file = %O, fill = yes;
CHR_04: start = $0000, size = $1000, file = %O, fill = yes;
CHR_05: start = $0000, size = $1000, file = %O, fill = yes;
CHR_06: start = $0000, size = $1000, file = %O, fill = yes;
CHR_07: start = $0000, size = $1000, file = %O, fill = yes;
CHR_08: start = $0000, size = $1000, file = %O, fill = yes;
CHR_09: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0A: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0B: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0C: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0D: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0E: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0F: start = $0000, size = $1000, file = %O, fill = yes;
CHR_10: start = $0000, size = $1000, file = %O, fill = yes;
CHR_11: start = $0000, size = $1000, file = %O, fill = yes;
CHR_12: start = $0000, size = $1000, file = %O, fill = yes;
CHR_13: start = $0000, size = $1000, file = %O, fill = yes;
CHR_14: start = $0000, size = $1000, file = %O, fill = yes;
CHR_15: start = $0000, size = $1000, file = %O, fill = yes;
CHR_16: start = $0000, size = $1000, file = %O, fill = yes;
CHR_17: start = $0000, size = $1000, file = %O, fill = yes;
CHR_18: start = $0000, size = $1000, file = %O, fill = yes;
CHR_19: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1A: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1B: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1C: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1D: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1E: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1F: start = $0000, size = $1000, file = %O, fill = yes;


RAM: start = $0300, size = $0500, define = yes;
SRAM: start = $6000, size = $2000, define = yes;

SRAM: start = $6000, size = $2000, define = yes;
}

SEGMENTS {

HEADER: load = HEADER, type = ro;
STARTUP: load = PRG, type = ro, define = yes;
LOWCODE: load = PRG, type = ro, optional = yes;
INIT: load = PRG, type = ro, define = yes, optional = yes;
HEADER: load = HEADER, type = ro;
STARTUP: load = PRG, type = ro, define = yes;
LOWCODE: load = PRG, type = ro, optional = yes;
INIT: load = PRG, type = ro, define = yes, optional = yes;
ONCE: load = PRG, type = ro, define = yes, optional = yes;
ROM_00: load = ROM_00, type = ro, define = no;
ROM_01: load = ROM_01, type = ro, define = no;
@@ -65,6 +32,7 @@ SEGMENTS {
ROM_04: load = ROM_04, type = ro, define = no;
ROM_05: load = ROM_05, type = ro, define = no;
ROM_06: load = ROM_06, type = ro, define = no;

# Stubs that contain reset code to put ourselves into a known fixed-c000 state.
STUB_00: load = ROM_00, type = ro, start = $BFF0;
STUB_01: load = ROM_01, type = ro, start = $BFF0;
@@ -74,47 +42,16 @@ SEGMENTS {
STUB_05: load = ROM_05, type = ro, start = $BFF0;
STUB_06: load = ROM_06, type = ro, start = $BFF0;


CODE: load = PRG, type = ro, define = yes;
RODATA: load = PRG, type = ro, define = yes;
DATA: load = PRG, run = RAM, type = rw, define = yes;
STUB_PRG: load = PRG_STUB, type = ro, start = $FFF0;
CHR_00: load = CHR_00, type = ro;
CHR_01: load = CHR_01, type = ro;
CHR_02: load = CHR_02, type = ro;
CHR_03: load = CHR_03, type = ro;
CHR_04: load = CHR_04, type = ro;
CHR_05: load = CHR_05, type = ro;
CHR_06: load = CHR_06, type = ro;
CHR_07: load = CHR_07, type = ro;
CHR_08: load = CHR_08, type = ro;
CHR_09: load = CHR_09, type = ro;
CHR_0A: load = CHR_0A, type = ro;
CHR_0B: load = CHR_0B, type = ro;
CHR_0C: load = CHR_0C, type = ro;
CHR_0D: load = CHR_0D, type = ro;
CHR_0E: load = CHR_0E, type = ro;
CHR_0F: load = CHR_0F, type = ro;
CHR_10: load = CHR_10, type = ro;
CHR_11: load = CHR_11, type = ro;
CHR_12: load = CHR_12, type = ro;
CHR_13: load = CHR_13, type = ro;
CHR_14: load = CHR_14, type = ro;
CHR_15: load = CHR_15, type = ro;
CHR_16: load = CHR_16, type = ro;
CHR_17: load = CHR_17, type = ro;
CHR_18: load = CHR_18, type = ro;
CHR_19: load = CHR_19, type = ro;
CHR_1A: load = CHR_1A, type = ro;
CHR_1B: load = CHR_1B, type = ro;
CHR_1C: load = CHR_1C, type = ro;
CHR_1D: load = CHR_1D, type = ro;
CHR_1E: load = CHR_1E, type = ro;
CHR_1F: load = CHR_1F, type = ro;

SRAM: load = SRAM, type = bss, optional = yes;
DMC: load = DMC, type = ro;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes;
SRAM: load = SRAM, type = bss, optional = yes;
ZEROPAGE: load = ZP, type = zp;
}

@@ -132,6 +69,7 @@ FEATURES {
segment = RODATA,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__;

}

SYMBOLS {
@@ -140,5 +78,6 @@ SYMBOLS {
# WARNING: If you change this next variable, you also need to update its sibling _contants.asm file, in the same
# folder. The value of SYS_PRG_BANKS must equal the value of NES_PRG_BANKS
NES_PRG_BANKS: value = 8, type = weak; # number of 16K PRG banks, change to 2 for NROM256
NES_CHR_BANKS: value = 16, type = weak; # number of 8K CHR banks (If using 4k, divide by 2!)
NES_CHR_BANKS: value = 0, type = weak; # number of 8K CHR banks (If using 4k, divide by 2!)

}
144 changes: 144 additions & 0 deletions config/ca65.cfg.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
MEMORY {

ZP: start = $0000, size = $0100, type = rw, define = yes;
HEADER: start = $0000, size = $0010, file = %O ,fill = yes;
ROM_00: start = $8000, size = $4000, file = %O, fill = yes, define = no;
ROM_01: start = $8000, size = $4000, file = %O, fill = yes, define = no;
ROM_02: start = $8000, size = $4000, file = %O, fill = yes, define = no;
ROM_03: start = $8000, size = $4000, file = %O, fill = yes, define = no;
ROM_04: start = $8000, size = $4000, file = %O, fill = yes, define = no;
ROM_05: start = $8000, size = $4000, file = %O, fill = yes, define = no;
ROM_06: start = $8000, size = $4000, file = %O, fill = yes, define = no;
PRG: start = $c000, size = $3c00, file = %O, fill = yes, define = no;
DMC: start = $fc00, size = $03f0, file = %O, fill = yes, define = yes;
PRG_STUB: start = $fff0, size = $0010, file = %O, fill = yes, define = no;
CHR_00: start = $0000, size = $1000, file = %O, fill = yes;
CHR_01: start = $0000, size = $1000, file = %O, fill = yes;
CHR_02: start = $0000, size = $1000, file = %O, fill = yes;
CHR_03: start = $0000, size = $1000, file = %O, fill = yes;
CHR_04: start = $0000, size = $1000, file = %O, fill = yes;
CHR_05: start = $0000, size = $1000, file = %O, fill = yes;
CHR_06: start = $0000, size = $1000, file = %O, fill = yes;
CHR_07: start = $0000, size = $1000, file = %O, fill = yes;
CHR_08: start = $0000, size = $1000, file = %O, fill = yes;
CHR_09: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0A: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0B: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0C: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0D: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0E: start = $0000, size = $1000, file = %O, fill = yes;
CHR_0F: start = $0000, size = $1000, file = %O, fill = yes;
CHR_10: start = $0000, size = $1000, file = %O, fill = yes;
CHR_11: start = $0000, size = $1000, file = %O, fill = yes;
CHR_12: start = $0000, size = $1000, file = %O, fill = yes;
CHR_13: start = $0000, size = $1000, file = %O, fill = yes;
CHR_14: start = $0000, size = $1000, file = %O, fill = yes;
CHR_15: start = $0000, size = $1000, file = %O, fill = yes;
CHR_16: start = $0000, size = $1000, file = %O, fill = yes;
CHR_17: start = $0000, size = $1000, file = %O, fill = yes;
CHR_18: start = $0000, size = $1000, file = %O, fill = yes;
CHR_19: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1A: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1B: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1C: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1D: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1E: start = $0000, size = $1000, file = %O, fill = yes;
CHR_1F: start = $0000, size = $1000, file = %O, fill = yes;


RAM: start = $0300, size = $0500, define = yes;
SRAM: start = $6000, size = $2000, define = yes;

}

SEGMENTS {

HEADER: load = HEADER, type = ro;
STARTUP: load = PRG, type = ro, define = yes;
LOWCODE: load = PRG, type = ro, optional = yes;
INIT: load = PRG, type = ro, define = yes, optional = yes;
ONCE: load = PRG, type = ro, define = yes, optional = yes;
ROM_00: load = ROM_00, type = ro, define = no;
ROM_01: load = ROM_01, type = ro, define = no;
ROM_02: load = ROM_02, type = ro, define = no;
ROM_03: load = ROM_03, type = ro, define = no;
ROM_04: load = ROM_04, type = ro, define = no;
ROM_05: load = ROM_05, type = ro, define = no;
ROM_06: load = ROM_06, type = ro, define = no;
# Stubs that contain reset code to put ourselves into a known fixed-c000 state.
STUB_00: load = ROM_00, type = ro, start = $BFF0;
STUB_01: load = ROM_01, type = ro, start = $BFF0;
STUB_02: load = ROM_02, type = ro, start = $BFF0;
STUB_03: load = ROM_03, type = ro, start = $BFF0;
STUB_04: load = ROM_04, type = ro, start = $BFF0;
STUB_05: load = ROM_05, type = ro, start = $BFF0;
STUB_06: load = ROM_06, type = ro, start = $BFF0;

CODE: load = PRG, type = ro, define = yes;
RODATA: load = PRG, type = ro, define = yes;
DATA: load = PRG, run = RAM, type = rw, define = yes;
STUB_PRG: load = PRG_STUB, type = ro, start = $FFF0;
CHR_00: load = CHR_00, type = ro;
CHR_01: load = CHR_01, type = ro;
CHR_02: load = CHR_02, type = ro;
CHR_03: load = CHR_03, type = ro;
CHR_04: load = CHR_04, type = ro;
CHR_05: load = CHR_05, type = ro;
CHR_06: load = CHR_06, type = ro;
CHR_07: load = CHR_07, type = ro;
CHR_08: load = CHR_08, type = ro;
CHR_09: load = CHR_09, type = ro;
CHR_0A: load = CHR_0A, type = ro;
CHR_0B: load = CHR_0B, type = ro;
CHR_0C: load = CHR_0C, type = ro;
CHR_0D: load = CHR_0D, type = ro;
CHR_0E: load = CHR_0E, type = ro;
CHR_0F: load = CHR_0F, type = ro;
CHR_10: load = CHR_10, type = ro;
CHR_11: load = CHR_11, type = ro;
CHR_12: load = CHR_12, type = ro;
CHR_13: load = CHR_13, type = ro;
CHR_14: load = CHR_14, type = ro;
CHR_15: load = CHR_15, type = ro;
CHR_16: load = CHR_16, type = ro;
CHR_17: load = CHR_17, type = ro;
CHR_18: load = CHR_18, type = ro;
CHR_19: load = CHR_19, type = ro;
CHR_1A: load = CHR_1A, type = ro;
CHR_1B: load = CHR_1B, type = ro;
CHR_1C: load = CHR_1C, type = ro;
CHR_1D: load = CHR_1D, type = ro;
CHR_1E: load = CHR_1E, type = ro;
CHR_1F: load = CHR_1F, type = ro;

DMC: load = DMC, type = ro;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes;
SRAM: load = SRAM, type = bss, optional = yes;
ZEROPAGE: load = ZP, type = zp;
}

FEATURES {

CONDES: segment = INIT,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = RODATA,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
CONDES: type = interruptor,
segment = RODATA,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__;
}

SYMBOLS {
__STACKSIZE__: value = $0500, type = weak; # 5 pages stack

# WARNING: If you change this next variable, you also need to update its sibling _contants.asm file, in the same
# folder. The value of SYS_PRG_BANKS must equal the value of NES_PRG_BANKS
NES_PRG_BANKS: value = 8, type = weak; # number of 16K PRG banks, change to 2 for NROM256
NES_CHR_BANKS: value = 16, type = weak; # number of 8K CHR banks (If using 4k, divide by 2!)
}
83 changes: 0 additions & 83 deletions config/ca65_chr_ram.cfg

This file was deleted.

3 changes: 1 addition & 2 deletions config/ca65_constants.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; Defines the number of PRG banks in the game. We have to store this separately, as the values
; in the .cfg file are only available at link-time, and cannot be used in code generation.
; Sorry for the duplication!
.define SYS_PRG_BANKS 8

.define SYS_PRG_BANKS 8
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; Defines the number of PRG banks in the game. We have to store this separately, as the values
; in the .cfg file are only available at link-time, and cannot be used in code generation.
; Sorry for the duplication!
.define SYS_PRG_BANKS 8
.define SYS_PRG_BANKS 8

Loading