Memblers wrote: ↑Mon Aug 03, 2020 6:33 am
Has the emulator been tested on a "plain" flash cart yet? I noticed in HIGAN there's usually not much showing up on screen (though the games are running), that makes me wonder if there's some missing S-PPU initialization. By plain I mean just a ROM chip, as the SD2SNES, PowerPak etc, menus won't be leaving the S-PPU in it's power-on default state. Maybe someone here could test that, I can't because I only have an SD2SNES for now.
So firstly, what a wonderful project!
I've tested the emulator with a plain HiROM flashcard containing 256kb of SRAM in a SNS-CPU-RGB-01 Motherboard SNES and the result was exactly the same that you described with HIGAN. Tested Super Mario Bros and while it sounds fine and reacts to the controller inputs (from what i hear), theres absolutely nothing on screen.
So i've decided to test the missing PPU inicialization hypotesis that you proposed, for that (i know this is not advisable), i've booted a cart that i know works to set the PPU, removed it with the SNES running and inserted the flash card, then i reseted the SNES and voila! Video output working!
After that Super Mario Worked as expected, congratulations to Myself086, i would never think that such a project would even be possible!
If you need someone to test in real hardware and plain flashcard, i can do it.
Thanks,
Soniccd123
Edit:
I've investigated the generated rom with bsnes-plus accuracy debugger (which shows the same behavior as HIGAN and the real hardware). I found that, comparing the PPU registers in the accuracy branch with the same on the performance branch, that some of them are not zeroed and only a few are writen during the Nested rom initialization process, leaving some in random states.
To test this, i've hijacked the first jump on program execution and sent the program counter to a empty rom space, which i found at 0x28000:
Code: Select all
FF1E- 5C 00 80 82 JML $828000 //Normally this would jump to $818002
There i wrote a simple routine that zeros all the PPU registers before any initialization is done and, after that, just jumped back to normal execution:
Code: Select all
28000- 9C 01 21 STZ $2101
28003- 9C 02 21 STZ $2102
28006- 9C 03 21 STZ $2103
28009- 9C 05 21 STZ $2105
2800C- 9C 06 21 STZ $2106
2800F- 9C 07 21 STZ $2107
28012- 9C 08 21 STZ $2108
28015- 9C 09 21 STZ $2109
28018- 9C 0A 21 STZ $210A
2801B- 9C 0B 21 STZ $210B
2801E- 9C 0C 21 STZ $210C
28021- 9C 0D 21 STZ $210D
28024- 9C 0E 21 STZ $210E
28027- 9C 0F 21 STZ $210F
2802A- 9C 10 21 STZ $2110
2802D- 9C 11 21 STZ $2111
28030- 9C 12 21 STZ $2112
28033- 9C 13 21 STZ $2113
28036- 9C 15 21 STZ $2115
28039- 9C 16 21 STZ $2116
2803C- 9C 17 21 STZ $2117
2803F- 9C 1A 21 STZ $211A
28042- 9C 1B 21 STZ $211B
28045- 9C 1C 21 STZ $211C
28048- 9C 1D 21 STZ $211D
2804B- 9C 1E 21 STZ $211E
2804E- 9C 1F 21 STZ $211F
28051- 9C 20 21 STZ $2120
28054- 9C 21 21 STZ $2121
28057- 9C 23 21 STZ $2123
2805A- 9C 24 21 STZ $2124
2805D- 9C 25 21 STZ $2125
28060- 9C 26 21 STZ $2126
28063- 9C 27 21 STZ $2127
28066- 9C 28 21 STZ $2128
28069- 9C 29 21 STZ $2129
2806C- 9C 2A 21 STZ $212A
2806F- 9C 2B 21 STZ $212B
28072- 9C 2C 21 STZ $212C
28075- 9C 2D 21 STZ $212D
28078- 9C 2E 21 STZ $211E
2807B- 9C 30 21 STZ $2130
2807E- 9C 31 21 STZ $2131
28081- 9C 32 21 STZ $2132
28084- 9C 33 21 STZ $2133
28087- 5C 00 80 82 JML $818002 //Now that all is set, jump to where it was suposed to
It worked with bsnes-plus accuracy and on real hardware, also did the same to Blaster Master and Donkey Kong and both work.
(I'm not the most knowledgeble person about the SNES hardware and 65816 machine code, so excuse me if theres some problem with the code)