SID is happy to announce his arrival in P2 land!
Just some small modifications to the P1 SIDcog code and this is what I have got so far. I first looked at the P2 instruction set and thought to myself that it's too different from the P1 and this will be a cumbersome task to get going on the P2. Boy, was I wrong!! I couldn't see the forest for all the trees. (soooooooo many instructions now) Almost everything is unmodified instruction wise vs the P1. After changing MIN/MAX with FGES/FLES, "wc wz" with "wcz", removing some "NR" after TJNZ, changing some MOVS for LUT´s to the P2 equivalent and changing P1 "counter code" with P2 "smartpin code"..... It works!
I have made NO optimizations at all compared to the P1 code, because I would like a P2 baseline version that is as close to the P1 code as possible. I will start optimizing from there. Actually, It still uses subroutine calls for multiplication, slow HUB access with RDLONG/RDWORD/WRWORD and 31 kHz sample rate (the P2 is mostly idling between samples at 180 MHz and twice the instruction rate compared to the P1). My goal is to have it running at 250 kHz (1/4 of a real SID) on the P2 with 180 MHz, using LUT ram, real multiplication instructions and other P2 specific optimizations.
The fun times begins! Just load the code on your P2 eval board and change L_PIN/R_PIN at the top and change dumpFile at the bottom for different tunes.