sehugg / 8bitworkshop

web-based IDE for 8-bit programming and Verilog development
http://8bitworkshop.com/
GNU General Public License v3.0
516 stars 84 forks source link

Strange memory error for the NES. #187

Open BroDudeGuyMan opened 4 months ago

BroDudeGuyMan commented 4 months ago

I am coding my first NES game in assembly using the NES 2.0 headers (*.s files) and I was following along Inkbox's beginner tutorial. I was happily frying my brain, and the code ran. It showed the background and 4 sprites that I picked! Everything was going great! I then changed some palette values and then these errors came up:

1) this.program: Warning: neslib2.cfg:12: Segment 'HEADER' overflows memory area 'HEADER' by 16 bytes

2) this.program: Warning: neslib2.cfg:28: Segment 'VECTORS' overflows memory area 'VECTORS' by 4 bytes

3) this.program: Error: Cannot generate most of the files due to memory area overflows

I don't entirely know what happened, but it screamed BUG!

Here are the aforementioned HEADER and VECTORS segments:

.segment "HEADER" .byte "NES" ;Identification string. MUST HAVE!! .byte $1A .byte $02 .byte $01 .byte $00 .byte $00, $00, $00, $00 .byte $00, $00, $00, $00, $00

.segment "VECTORS" .word NMI .word RESET ; Specialized hardware interupts

None of the rest of the code is getting flagged, even when I remove these segments.

sehugg commented 4 months ago

The immediate thing that comes to mind, can it be possible you have two copies of the header and vector segments? Or you are .include-ing them again somewhere else?

BroDudeGuyMan commented 4 months ago

I did not do that. There are only 5 segments in my code: HEADER, ZEROPAGE, STARTUP, VECTORS, and CHAR. When I ran the same code on my local system, it built and ran just fine.