I feel that the subsequent compilers punish undefined behavior in such nasty ways ... ways which the co-founders couldn't have imagined.
I think Garth had once told me that he didn't like C because of the typecasting at all. I totally agree. If I have an 'unsigned char' it should add into an 'unsigned long' without me needing to tell it anything special. *shrug*
Does your device programming method include a read-back to check to make sure it "took" and reads back correctly? I seem to remember the 8-bit PICs are only guaranteed for something like a hundred writes to program memory (Edit: I just looked it up for the 16F72, and it says 1000 writes typical, but doesn't guarantee a number), but I'm sure I've gone way over the hundred, and never had a bad read-back. My home-made programmer checks each program word after writing it, before moving on, and then when the whole thing is done, it re-checks the whole thing at a lower Vcc voltage, then again at a higher Vcc voltage, which may just be a leftover from the days of EPROM-type PICs (like the 16C7x), to verify good program margin for the '0' bits and good erase margin for the '1' bits.
Those are great questions Garth. I have FAR surpassed 1000 writes, hm. The PICkit3 I have can read back the memory in there, but it also checks the memory as its writing it too. But higher and lower voltages are *possible* with the PICkit3 but its highly inconvenient to do that each time. But possible
This made me think though. Something I haven't mentioned is that I've been burning the NES ROM's onto the chip each time I load a new game, or after reprogramming it. As in, half the chip gets burned TWICE as much: Once for re-programming, once for loading the ROM onto the chip. Perhaps that also is contributing to its issues. When I am burning the ROM into flash memory, I now have a read-back function, comparing it with the original on the SD card. So far that's never errored, but it is there now. But again, who knows what happens at high or low voltages? There would have to be some extensive testing.
In the end, turning ECC code protection off has been working great (for now!). I really wish I could have thought about a possible electrical issue earlier, I could have saved a lot of time and heart-ache. But, of course I learned a lot, and that's important too. Yay for learning :/
Because of my lack of racing-type games, I decided to (re)implement the ANROM mapper. I got RC Pro AM 2 to work really well, and Super Off Road to work ok enough. Of course the infamous Battletoads game is also an ANROM, and I decided to try it out. And yeah, it's playable, but no status bar, and the scrolling is weird. Oh well, I'm leaving it on my main list simply because it is Battletoads, it gets a special place in every emulator's (digital) heart
Alright, 55 games on my list now! They have ratings of Perfect (i.e. Super Mario), Great (perfectly playable, minor graphical errors, i.e. Kirby, after hacks), Good (incredibly playable, major graphical errors, i.e. Zelda), and Fair (mostly playable, severe graphical errors, i.e. Battletoads). Again my code and list is all here:
https://github.com/stevenchadburrow/AcolyteHandPICd32
Click the "NES" folder to see specifically for this NES emulator.
The project is essentially complete at this point. Thank you for putting up with my up's and down's during this project. I've learned so much! Next I'm thinking of making a hand-held version, perhaps using the PIC32CZ instead since it goes 50% faster than this chip.
Thank you again everyone
Chad