usbcopynesblue icon indicating copy to clipboard operation
usbcopynesblue copied to clipboard

.nes Filesize overflow

Open cubicibo opened this issue 6 years ago • 2 comments

Hi, In misc.c, WriteNES() will not write the NES file correctly if the PRG and/or CHR are too large as the unsigned char value for either will eventually overflow (code at lines 23x). I would have fixed it myself but I don't have Visual Studio.

I also had a bug when I tried to generate a ROM file with a NES2.0 mapper n# (the number in the file was just plain wrong) but I have not figured yet where this happens in the code.

cubicibo avatar Apr 18 '20 21:04 cubicibo

So by "too large" you mean too large for iNES 1, right?

So... this issue more like a feature request for iNES 2 support. (Edit: hmm, no it must be a bug because support was already written? See below.) Probably won't be too difficult to add though. I'll take a look now.

I've taken the opportunity to set up appveyor, so if you wanted to test a pull request it could build a binary for you.

bbbradsmith avatar Apr 18 '20 22:04 bbbradsmith

Hmm, it looks like CaitSith2 already wrote iNES 2 support in 57bd0b81f7c5e4a65d2bedb3349ceb9cd1ad90a3

So... I dunno what the bug is here, can't see anything wrong. Perhaps nes2 isn't getting automatically set before the call to WriteNES()? Not sure how to approach debugging this, since I don't have any relevant cart.

bbbradsmith avatar Apr 18 '20 22:04 bbbradsmith