FIXED … action [PART III]
A quick fix is avalaible here for the yesterday release.
There was 2 problems. One for everybody because of a bad tile transformation of the debugFont. And the other one was only visible in BSnes. The later bug was due to a bad size of tile being copied to DMA and direct write VRAM for each character writed in debug screen. Now i update the buffer (debugMap) and i DMA copy it in one shot in VRAM.
So now that everything is fixe, please enjouy the code. I modified a bit the routetine for writing to screen. Don’t forget to make your string finishing with a “\0”. I added also support for new line and line bigger than 32 character. No scroll support when too much is writed to the screen. It might come quick I think.
Enjoy !
++ Lint
May 29th, 2008 at 6:16 pm
Thanks for the fix. But still have control problem. You can not use joypad to control movement on real hardware. I do some test. But can’t find the problem is.
If I change this on main.c :
if(pad1.left) {
if(currentScrollEvent == NULL)
currentScrollEvent = addEvent(&scrollLeft, 1);
}
to :
if(currentScrollEvent == NULL)
currentScrollEvent = addEvent(&scrollLeft, 1);
Then screen can move left without press left button.
It prove program not hanged. Only maybe readjoy routine or other problem that can not detect which button pressed on real hardware.
May 29th, 2008 at 7:26 pm
I use two hours to find the problem, but no luck.
Because we have debug routine. So, I want to print some debug info on screen.
But can’t, seems just hang if I jump to debug.
if(pad1.start) {
debug();
}
to :
debug();
Don’t know why. But in emulator, all work fine.
May 29th, 2008 at 8:33 pm
I used 4 hours to fix the problem. I found it. (Because I’m no good on C and no good on programming SNES. If not, I think no need 4 hours. But it is true, no joke)
The problem is that real hardware seems no NMI event. But Readpad routine running at NMI routine. So, if no NMI, then main.c can not Readpad.
So, I add this line in main.c :
pad1 = readPad((byte) 0);
after
waitForVBlank();
Then It worked well on real hardware. But again, another problem, debug window have problem.
See this : http://img232.imageshack.us/my.php?image=rom3gx2.jpg
I have no time to fix this. Maybe later.
May 30th, 2008 at 11:46 am
Thanks for the support. I’m sending you aversion that I fixed by email for testing. Let me know…
May 30th, 2008 at 12:21 pm
Have you sended ? Still not receive it yet. Thanks.
May 30th, 2008 at 12:30 pm
I have send the email about 2 hours ago on rayman _AT_ yoursite. Do you have any problem ? the rom is avalaible here anyway : http://images.antihero.org/snesdev/rom_tomy.smc
Keep me updated… ++ Lint
May 30th, 2008 at 12:33 pm
I just tested it on real hardware. It don’t work, same as before. Joypad can not make movement. Any idea ?
May 30th, 2008 at 12:48 pm
I tested your older fix. I find out Readpad routine should not be problem.
Because fade-in, fade-out working, seems NMI is working. Only it can’t do Readpad.
I think maybe variable “pad1” when return, it is damaged by other routine ?
May 30th, 2008 at 2:27 pm
Received your file. Now, debug window got fixed. But readPad problem still there. Hope you can fix it.
May 30th, 2008 at 3:10 pm
Can you try again with http://images.antihero.org/snesdev/rom_tomy2.smc I patched with pad reading after the waitForVblank() and removed NMI pad reading.
++ Lint
May 30th, 2008 at 4:07 pm
Sorry Lint, it still not work. I don’t understand why if I add this line in
main.c :
pad1 = readPad((byte) 0);
after
waitForVBlank();
Then it work. Only when readPad inside NMI, then it don’t work.
May 30th, 2008 at 4:16 pm
Very strange that’s the way I patched the my code. I’m going to disassemble a few game and see when and how they read the pad …
May 30th, 2008 at 4:58 pm
Lint, notice that, I don’t say your readPad routine have problem. I fully tested it. It work good. Only don’t know why inside NMI, it don’t work.
May 30th, 2008 at 5:15 pm
i have understand that. So now everything should be ok in rom_tomy2.smc since I placed readPad after waitForVBlank();