In the moment, I'm a bit lost with that "nes.cfg" file. My problem is: The default one is built for a game with 2 x 16KB PRG code. But I want a game with 1 x 16KB PRG code.
For some reason, the config files from this link always give me some overflow errors.
So, I'm straight out asking: What do I have to do?
This is my "nes.cfg":
And yes, I know, there might be some things in there that can be thrown out later. But I will take care of this as soon as everything works. In the moment, I'd only like to solve my problem. I will take care of the cleanup afterwards.
Alright, if you take this source code: background2.asm and this chr file: mario.chr and compile it with
But as I said, I want 1 x 16 KB PRG code. So, I change the header in the asm file from
Now, the nes file doesn't work anymore. It only shows a gray screen in fceux and a black screen in Nestopia.
What do I have to change in the above "nes.cfg" so that the program works again?
I tried various things, like cutting down memory areas or using one of the sample cfg files. But it didn't work. So, could you please tell me which values I have to edit to make the program work as a 24 KB ROM instead of a 40 KB ROM?
For some reason, the config files from this link always give me some overflow errors.
So, I'm straight out asking: What do I have to do?
This is my "nes.cfg":
Code:
MEMORY
{
ZP: start = $2, size = $1A, type = rw, define = yes;
HEADER: start = $0, size = $10, file = %O, fill = yes;
ROM0: start = $8000, size = $7FF4, file = %O, fill = yes, define = yes;
ROMV: start = $FFF6, size = $C, file = %O, fill = yes;
ROM2: start = $0000, size = $2000, file = %O, fill = yes;
SRAM: start = $0500, size = $0300, define = yes;
RAM: start = $6000, size = $2000, define = yes;
}
SEGMENTS
{
HEADER: load = HEADER, type = ro;
STARTUP: load = ROM0, type = ro, define = yes;
LOWCODE: load = ROM0, type = ro, optional = yes;
INIT: load = ROM0, type = ro, define = yes, optional = yes;
CODE: load = ROM0, type = ro, define = yes;
RODATA: load = ROM0, type = ro, define = yes;
DATA: load = ROM0, run = RAM, type = rw, define = yes;
VECTORS: load = ROMV, type = rw;
CHARS: load = ROM2, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, 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: segment = RODATA, type = interruptor, label = __INTERRUPTOR_TABLE__, count = __INTERRUPTOR_COUNT__;
}
SYMBOLS
{
__STACKSIZE__ = $0300;
}
{
ZP: start = $2, size = $1A, type = rw, define = yes;
HEADER: start = $0, size = $10, file = %O, fill = yes;
ROM0: start = $8000, size = $7FF4, file = %O, fill = yes, define = yes;
ROMV: start = $FFF6, size = $C, file = %O, fill = yes;
ROM2: start = $0000, size = $2000, file = %O, fill = yes;
SRAM: start = $0500, size = $0300, define = yes;
RAM: start = $6000, size = $2000, define = yes;
}
SEGMENTS
{
HEADER: load = HEADER, type = ro;
STARTUP: load = ROM0, type = ro, define = yes;
LOWCODE: load = ROM0, type = ro, optional = yes;
INIT: load = ROM0, type = ro, define = yes, optional = yes;
CODE: load = ROM0, type = ro, define = yes;
RODATA: load = ROM0, type = ro, define = yes;
DATA: load = ROM0, run = RAM, type = rw, define = yes;
VECTORS: load = ROMV, type = rw;
CHARS: load = ROM2, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, 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: segment = RODATA, type = interruptor, label = __INTERRUPTOR_TABLE__, count = __INTERRUPTOR_COUNT__;
}
SYMBOLS
{
__STACKSIZE__ = $0300;
}
And yes, I know, there might be some things in there that can be thrown out later. But I will take care of this as soon as everything works. In the moment, I'd only like to solve my problem. I will take care of the cleanup afterwards.
Alright, if you take this source code: background2.asm and this chr file: mario.chr and compile it with
Code:
cl65 -t none -C nes.cfg -o Test.nes background2.asm
then everything works fine.But as I said, I want 1 x 16 KB PRG code. So, I change the header in the asm file from
Code:
.segment "HEADER"
.byte "NES", $1A ; iNES header identifier
.byte 2 ; 2x 16KB PRG code
.byte 1 ; 1x 8KB CHR data
.byte $01, $00 ; mapper 0, vertical mirroring
to.byte "NES", $1A ; iNES header identifier
.byte 2 ; 2x 16KB PRG code
.byte 1 ; 1x 8KB CHR data
.byte $01, $00 ; mapper 0, vertical mirroring
Code:
.segment "HEADER"
.byte "NES", $1A ; iNES header identifier
.byte 1 ; 1x 16KB PRG code
.byte 1 ; 1x 8KB CHR data
.byte $01, $00 ; mapper 0, vertical mirroring
(Line 4 was changed.).byte "NES", $1A ; iNES header identifier
.byte 1 ; 1x 16KB PRG code
.byte 1 ; 1x 8KB CHR data
.byte $01, $00 ; mapper 0, vertical mirroring
Now, the nes file doesn't work anymore. It only shows a gray screen in fceux and a black screen in Nestopia.
What do I have to change in the above "nes.cfg" so that the program works again?
I tried various things, like cutting down memory areas or using one of the sample cfg files. But it didn't work. So, could you please tell me which values I have to edit to make the program work as a 24 KB ROM instead of a 40 KB ROM?