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.

ROM 3 fix teaser

 

Enjoy !

 

++ Lint

14 Responses to “FIXED … action [PART III]”

  1. Tomy Says:

    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.

  2. Tomy Says:

    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.

  3. Tomy Says:

    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.

  4. lint Says:

    Thanks for the support. I’m sending you aversion that I fixed by email for testing. Let me know…

  5. Tomy Says:

    Have you sended ? Still not receive it yet. Thanks.

  6. lint Says:

    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

  7. Tomy Says:

    I just tested it on real hardware. It don’t work, same as before. Joypad can not make movement. Any idea ?

  8. Tomy Says:

    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 ?

  9. Tomy Says:

    Received your file. Now, debug window got fixed. But readPad problem still there. Hope you can fix it.

  10. lint Says:

    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

  11. Tomy Says:

    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.

  12. lint Says:

    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 …

  13. Tomy Says:

    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.

  14. lint Says:

    i have understand that. So now everything should be ok in rom_tomy2.smc since I placed readPad after waitForVBlank();