Use linker script

develop^2
Christophe Parent 2023-12-03 23:48:15 -08:00
parent 77f35f881d
commit 2c48f59c68
2 changed files with 20 additions and 1 deletions

View File

@ -32,7 +32,7 @@ $ cp <path_to_the_graphics_file> src/smb.chr
To build the binary, execute:
```shell
$ cl65 -t nes -o target/smb.nes src/smbdis.asm
$ cl65 -t nes -o target/smb.nes -C src/smb.cfg src/smbdis.asm
```
### Running

19
src/smb.cfg Normal file
View File

@ -0,0 +1,19 @@
MEMORY {
ZP: file = "", start = $0000, size = $0100;
OAM: file = "", start = $0200, size = $0100, define = yes;
RAM: file = "", start = $0300, size = $0500;
HDR: file = %O, start = $0000, size = $0010, fill = yes;
PRG0: file = %O, start = $8000, size = $7FFA, fill = yes, fillval = $FF;
PRGV: file = %O, start = $FFFA, size = $0006, fill = yes, fillval = $FF;
CHR: file = %O, start = $0000, size = $2000, fill = yes, fillval = $FF;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes;
SPRITE: load = OAM, type = bss, optional = yes;
BSS: load = RAM, type = bss, optional = yes;
HEADER: load = HDR, type = ro;
STARTUP: load = PRG0, type = ro;
VECTORS: load = PRGV, type = ro;
CHARS: load = CHR, type = ro, optional = yes;
}