PIC18F

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PIC18F
by on (#18133)
Is anyone interested in supporting the Squeedo hardware in the their emulator? I could help out by writing part (most or all) of the emulation of the PIC18 MCU, but I've never written a CPU emulator before and I'm wondering if there's a way it could be written so it could be usable in various emulators?

Instruction set can be seen here:
http://microcontroleur.vije.net/EnglishSite/MicrocontrolersPICBody.html

Is there a 6502 core or something I could base it off of? I looked at Marat Fayzullin's M6502, but the license in there doesn't give me much hope of actually using it (even though an almost complete re-write, I just need something to start out with).

by on (#18135)
Personally, I don't think I would ever support the Squeedo mapper with low-level emulation. The most I would be likely to do would be high-level emulation (i.e. bank switching and IRQ counters, and possibly sound as well) since it would simply involve emulating the PIC's control program. Alternate program images could possibly be handled using the "NES 2.0" submapper, but personally I wouldn't be willing to cram a PIC core into a mapper, since it would likely slow down the rest of the emulator very significantly.

by on (#18136)
High-level emulation would be good enough for a lot of stuff, music players and more traditionally-coded NES programs, so that'd be cool. Once the firmware nears the 1.0 stage.

I can definitely see how it'd slow an emulator down. The chip itself is pretty fast, but there's also the async communication with the NES (and PPU, but at least the IRQ counter and associated bankswitching mode is kinda psuedo-synchronous).

The really interesting (to me) part is that I've reserved a lot of the PIC's memory for user code/data. So theoretically, anyone could write a PIC routine (or several) and have them run (taking inputs and giving outputs, or not) when the NES writes to the user regs. This part is gonna pretty much require low-level emulation, and my own file format.

There's an LED too. :D
Really useful for debugging.