http://pouet.net/prod.php?which=31326
I tried commenting in that thread, but every time I tried to register I got "WTF ERROR" and it didn't tell me what the error was.
I know visy stops by here every once in a while. Hopefully he'll see this. I don't know how else to get in touch with him.
Anyway... I tried that demo in my emu after someone reported it was messing up. Assuming you tried this on a real system, I figured it was a bug in my emu. So I traced what was happening and found several errors that were not due to my emu.
1) you don't turn off the PPU before letting it warm up (you may not technically have to -- but you probably should.)
2) you don't back up your registers on NMI
3) you enable NMIs during VBlank, without first clearing the VBlank flag (this triggers an immediate NMI)
2 and 3 cause the monochrome bit to flip on in my emu, because an NMI is triggering right before the write to $2001. Here's a truncated trace log:
The $2000 write is occuring when the VBlank flag is high, which immediately triggers an NMI (after the LDA). The NMI then changes A to $1F, and when you RTI... $1F, instead of the desired $1E, is being written to $2001, causing monochrome mode.
this can be solved by any one of the following:
1) clearing the VBlank flag by reading $2002 before you write to $2000
2) backing up A on NMI entry, and restoring it on exit
3) not writing to $2000 until the very end of your prep code (just before the infinite loop)
If you are testing this on a PowerPAK, it is likely interfereing with the startup time (ie: your code is being jumped to at a different time in the frame than it would be if you were on a normal cartridge -- meaning it's possible/likely that the glitch that is happening on my emu would happen if your ROM was on a normal cart).
However, if you are testing this on a straight cart with no additional software/BIOS running, please let me know so I can adjust the powerup time in my emulator.
Thank you.
PS - please don't give your .txt files an .nfo extension.
To anyone else: If you know how to contact visy or anyone else on the wAMMA team, please direct them here for me. Thanks.
I tried commenting in that thread, but every time I tried to register I got "WTF ERROR" and it didn't tell me what the error was.
I know visy stops by here every once in a while. Hopefully he'll see this. I don't know how else to get in touch with him.
Anyway... I tried that demo in my emu after someone reported it was messing up. Assuming you tried this on a real system, I figured it was a bug in my emu. So I traced what was happening and found several errors that were not due to my emu.
1) you don't turn off the PPU before letting it warm up (you may not technically have to -- but you probably should.)
2) you don't back up your registers on NMI
3) you enable NMIs during VBlank, without first clearing the VBlank flag (this triggers an immediate NMI)
2 and 3 cause the monochrome bit to flip on in my emu, because an NMI is triggering right before the write to $2001. Here's a truncated trace log:
Code:
A8C6:A9 LDA #$88 00 07 10 [..I..] FF -- 9,186 -- <0000,0000>
A8C8:8D STA $2000 [2000=00] 88 07 10 [N.I..] FF -- 9,192 -- <0000,0000>
A8CB:A9 LDA #$1E 88 07 10 [N.I..] FF -- 9,205 -- <0000,0000>
*** NMI ***
CE8B:AD LDA $2002 [2002=82] 1E 07 10 [..I..] FC -- 9,234 -- <0000,0000>
...
893C:BD LDA $0300,X [0300=3C] 03 00 00 [..I..] F8 -- 166,274 -- <0000,0000>
893F:4A LSR A 3C 00 00 [..I..] F8 -- 166,287 -- <0000,0000>
8940:4A LSR A 1E 00 00 [..I..] F8 -- 166,294 -- <0000,0000>
8941:1D ORA $0394,X [0394=10] 0F 00 00 [..I..] F8 -- 166,300 -- <0000,0000>
8944:BC LDY $8AD1,X [8AD1=00] 1F 00 00 [..I..] F8 -- 166,313 -- <0000,0000>
...
CF59:40 RTI 1F FF 00 [..I..] FC -- 167,154 -- <0000,0000>
A8CD:8D STA $2001 [2001=01] 1F FF 00 [..I..] FF -- 167,173 -- <0000,0000>
A8C8:8D STA $2000 [2000=00] 88 07 10 [N.I..] FF -- 9,192 -- <0000,0000>
A8CB:A9 LDA #$1E 88 07 10 [N.I..] FF -- 9,205 -- <0000,0000>
*** NMI ***
CE8B:AD LDA $2002 [2002=82] 1E 07 10 [..I..] FC -- 9,234 -- <0000,0000>
...
893C:BD LDA $0300,X [0300=3C] 03 00 00 [..I..] F8 -- 166,274 -- <0000,0000>
893F:4A LSR A 3C 00 00 [..I..] F8 -- 166,287 -- <0000,0000>
8940:4A LSR A 1E 00 00 [..I..] F8 -- 166,294 -- <0000,0000>
8941:1D ORA $0394,X [0394=10] 0F 00 00 [..I..] F8 -- 166,300 -- <0000,0000>
8944:BC LDY $8AD1,X [8AD1=00] 1F 00 00 [..I..] F8 -- 166,313 -- <0000,0000>
...
CF59:40 RTI 1F FF 00 [..I..] FC -- 167,154 -- <0000,0000>
A8CD:8D STA $2001 [2001=01] 1F FF 00 [..I..] FF -- 167,173 -- <0000,0000>
The $2000 write is occuring when the VBlank flag is high, which immediately triggers an NMI (after the LDA). The NMI then changes A to $1F, and when you RTI... $1F, instead of the desired $1E, is being written to $2001, causing monochrome mode.
this can be solved by any one of the following:
1) clearing the VBlank flag by reading $2002 before you write to $2000
2) backing up A on NMI entry, and restoring it on exit
3) not writing to $2000 until the very end of your prep code (just before the infinite loop)
If you are testing this on a PowerPAK, it is likely interfereing with the startup time (ie: your code is being jumped to at a different time in the frame than it would be if you were on a normal cartridge -- meaning it's possible/likely that the glitch that is happening on my emu would happen if your ROM was on a normal cart).
However, if you are testing this on a straight cart with no additional software/BIOS running, please let me know so I can adjust the powerup time in my emulator.
Thank you.
PS - please don't give your .txt files an .nfo extension.
To anyone else: If you know how to contact visy or anyone else on the wAMMA team, please direct them here for me. Thanks.