Well, I should have expected the Fibonacci code to work since I already checked out all the previous functions of it. So I'm wondering what isn't going to be working to prevent the ROM code from working. I'm running the ROM v3 code because I'm worried about the ROM v4 code is incompatible. I noticed the new bus expansion board uses the same instruction set hack that I used - it uses the same invalid memory instructions to talk to the expansion board as I use to talk to my control registers. The v3 does not use these instructions, so it should run ok.
So I'm starting to really scratch my head on what the problem could be here. I'm starting to think it may be a clock problem - all the code that runs slowly works correctly. So next I may try to slowly run the rom code and see if it works. All I really need to see is the 4 LEDs turn on one at a time to show the board has booted. I need to modify my Arduino flash loader to read the ROM file and dump the whole thing into the flash cartridge.
// Fibonacci series // $ = a // $ = b // $ = tmp byteProgram(0x0000, 0x0000); // ld $00 ; outer loop byteProgram(0x0001, 0xc200); // st [$00] ; a=0 byteProgram(0x0002, 0x0001); // ld $01 ; b=1 byteProgram(0x0003, 0xfc0a); // bra $0a byteProgram(0x0004, 0x0200); // nop ; (pipelining) // inner loop start byteProgram(0x0005, 0x0100); // ld [$00] byteProgram(0x0006, 0xc202); // st [$02] ; tmp=a byteProgram(0x0007, 0x0101); // ld [$01] byteProgram(0x0008, 0xc200); // st [$00] ; a=b byteProgram(0x0009, 0x8102); // adda [$02] byteProgram(0x000a, 0xc201); // st [$01] ; b+=tmp byteProgram(0x000b, 0x1800); // ld 0x00, OUT ; Prepare XOUT update, hSync goes down, RGB to black byteProgram(0x000c, 0x1840); // ld 0x40, OUT ; hSync goes up (bit 6), updating XOUT and blinkenlights byteProgram(0x000d, 0xf405); // bge $05 ; repeat if bit7 is still 0 byteProgram(0x000e, 0x0200); // nop ; (pipelining) // inner loop end byteProgram(0x000f, 0xfc00); // bra $00 ; start over again byteProgram(0x0010, 0x0200); // nop ; (pipelining) // output: //0 0000 0000 //1 0000 0001 //1 0000 0001 //2 0000 0010 //3 0000 0011 //5 0000 0101 //8 0000 1000 //13 0000 1101 //21 0001 0101 //34 0010 0010 //55 0011 0111 //89 0101 1001 //144 1001 0000