So I'm creating some new demo code and I've been playing around with the ca65 .cfg file to try and understand it better (as you may know if you've answered some of my previous questions on this forum).
In my Nesteroids game when I set up the vectors I was doing it the way I learned from rainwarrior's demo code.
It looked like this:
For some reason in my new code, the irq was getting executed instead of the nmi, so I had to reverse the order in that segment like this:
I had been playing around with the .cfg files to try and understand them better. Here is the original:
And this is the new version that was calling the irq instead of the nmi:
Any idea why the vectors segment might work out differently?
Thanks
In my Nesteroids game when I set up the vectors I was doing it the way I learned from rainwarrior's demo code.
It looked like this:
Code:
.segment "VECTORS" ; THIS IS THE LAST 6 BYTES OF THE FILE, USED AS ADDRESSES FOR INTERRUPTS
.word nmi
.word reset
.word irq
.word nmi
.word reset
.word irq
For some reason in my new code, the irq was getting executed instead of the nmi, so I had to reverse the order in that segment like this:
Code:
.segment "VECTORS" ; THIS IS THE LAST 6 BYTES OF THE FILE, USED AS ADDRESSES FOR INTERRUPTS
.word irq
.word reset
.word nmi
.word irq
.word reset
.word nmi
I had been playing around with the .cfg files to try and understand them better. Here is the original:
Code:
MEMORY {
ZP: start = $00, size = $0100, type = rw, file = "";
OAM: start = $0200, size = $0100, type = rw, file = "";
RAM: start = $0300, size = $0500, type = rw, file = "";
HDR: start = $0000, size = $0010, type = ro, file = %O, fill = yes, fillval = $00;
PRG: start = $8000, size = $8000, type = ro, file = %O, fill = yes, fillval = $00;
CHR: start = $0000, size = $2000, type = ro, file = %O, fill = yes, fillval = $00;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
OAM: load = OAM, type = bss, align = $100;
BSS: load = RAM, type = bss;
HEADER: load = HDR, type = ro;
CODE: load = PRG, type = ro, start = $8000;
TABLES: load = PRG, type = ro, start = $E000;
RODATA: load = PRG, type = ro;
VECTORS: load = PRG, type = ro, start = $FFFA;
TILES: load = CHR, type = ro;
}
ZP: start = $00, size = $0100, type = rw, file = "";
OAM: start = $0200, size = $0100, type = rw, file = "";
RAM: start = $0300, size = $0500, type = rw, file = "";
HDR: start = $0000, size = $0010, type = ro, file = %O, fill = yes, fillval = $00;
PRG: start = $8000, size = $8000, type = ro, file = %O, fill = yes, fillval = $00;
CHR: start = $0000, size = $2000, type = ro, file = %O, fill = yes, fillval = $00;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
OAM: load = OAM, type = bss, align = $100;
BSS: load = RAM, type = bss;
HEADER: load = HDR, type = ro;
CODE: load = PRG, type = ro, start = $8000;
TABLES: load = PRG, type = ro, start = $E000;
RODATA: load = PRG, type = ro;
VECTORS: load = PRG, type = ro, start = $FFFA;
TILES: load = CHR, type = ro;
}
And this is the new version that was calling the irq instead of the nmi:
Code:
MEMORY {
ZP: start = $00, size = $0100, type = rw, file = "";
OAM: start = $0200, size = $0100, type = rw, file = "";
RAM: start = $0300, size = $0500, type = rw, file = "";
HDR: start = $0000, size = $0010, type = ro, file = %O, fill = yes, fillval = $00;
PRG: start = $8000, size = $8000, type = ro, file = %O, fill = yes, fillval = $00;
CHR: start = $0000, size = $2000, type = ro, file = %O, fill = yes, fillval = $00;
}
SEGMENTS {
FASTVARS: load = ZP, type = zp;
OAM: load = OAM, type = bss, align = $100;
VARS: load = RAM, type = bss;
HEADER: load = HDR, type = ro;
CODE: load = PRG, type = ro, start = $8000;
ROMDATA: load = PRG, type = ro, start = $E000;
VECTORS: load = PRG, type = ro, start = $FFFA;
IMG: load = CHR, type = ro;
}
ZP: start = $00, size = $0100, type = rw, file = "";
OAM: start = $0200, size = $0100, type = rw, file = "";
RAM: start = $0300, size = $0500, type = rw, file = "";
HDR: start = $0000, size = $0010, type = ro, file = %O, fill = yes, fillval = $00;
PRG: start = $8000, size = $8000, type = ro, file = %O, fill = yes, fillval = $00;
CHR: start = $0000, size = $2000, type = ro, file = %O, fill = yes, fillval = $00;
}
SEGMENTS {
FASTVARS: load = ZP, type = zp;
OAM: load = OAM, type = bss, align = $100;
VARS: load = RAM, type = bss;
HEADER: load = HDR, type = ro;
CODE: load = PRG, type = ro, start = $8000;
ROMDATA: load = PRG, type = ro, start = $E000;
VECTORS: load = PRG, type = ro, start = $FFFA;
IMG: load = CHR, type = ro;
}
Any idea why the vectors segment might work out differently?
Thanks