tepples wrote:Unless you're using Linux on a non-x86 platform, you can do what I did: sudo apt-get install wine and then use the Windows version.
Pure 64-bit, so Wine is not a possibility.
dougeff wrote:Is there any other code that would also happen at level change, that writes to the PPU? Is it perhaps doing it while rendering is on?
No, that is all. And it baffles me how I can run it several times over with no ill effects, but run after a second of gameplay, that function crashes.
It's very curious how the full chain works the first time. The outer loop literally goes
Code: Select all
while (1) {
loadlevel(foo);
gameplay();
}
The same path works the first time, but fails the second.
Well, it definitely looks to me like your game is repeatedly writing the same chunk of data to the PPU over and over while rendering is on. This would also give a 'scrolling' effect, as PPU changes also effect scroll position.
Why would the music stop in that case? It would only be possible if there was an eternal loop in the NMI itself, so it never reached the music code.
GradualGames wrote:Here's another guess---are you decompressing a level/screen etc. into RAM and then decoding that into vram writes? If so---perhaps your nes.cfg allocates too much ram space to CC65 and this decompression is actually overwriting local/cc65 stack. I recall the default nes.cfg uses 3 pages, which is kinda huge. I asked about this in
Efficiency of development process using C versus 6502 and the general response (rainwarrior's response actually) was it can be much smaller, perhaps as small as 64 or even 32 if you're careful. I imagine you already checked into this, just thought I'd throw that out there.
The decompression goes into a statically allocated BSS buffer. There's almost 200 bytes free for cc65's stack, and no function uses more than a couple variables local stack. No deep call chains either. If it's stack corruption, it's not because of my code.