EEPROM and FLASH emulation

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

EEPROM and FLASH emulation

Post by posit »

Sharing EEPROM and FLASH emulation source for anyone interested. Free to use for any purpose.

Note it is written in C# but is unsafe low level API intended for efficient use in Mapper code, therefore leaving it to the caller to ensure correctness. It should be very little work to port to C or other languages if desired.

https://github.com/itscool/saw_cs/blob/ ... M_FLASH.cs
User avatar
dink
Posts: 157
Joined: Sun Jan 12, 2020 8:42 pm

Re: EEPROM and FLASH emulation

Post by dink »

This is really nice, it would be easy to modify the flash part with the manuf-id&deviceid of the chips that haradius and haratyler use for mapper support. I would definitely had ported this to c and used it if I didn't already write my own.

best regards,
- dink
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

Re: EEPROM and FLASH emulation

Post by posit »

Thanks :) The source is updated with the 3 chips used for haradius and haratyler. Somewhat interestingly, aside from the IDs, 2 of them use 12-bit commands instead of 16-bit (and less interestingly, of course, different page sizes).

Also added in a similar vein source for CRC-32, MD5, SHA-1, and SHA-256. Mostly just ports to C#, so it wouldn't be very useful for someone to port them back to C/C++, but useful if you're working with C#. It's all public domain, and generates reasonably fast code (though the SHA-256 in particular could use some optimization love)
https://raw.githubusercontent.com/itsco ... /Hashes.cs
Post Reply