ThomasSpeedrunner Help Thread

Discussion in 'Discussion and Q&A Archive' started by ThomasThePencil, Jan 29, 2013.

Thread Status:
Not open for further replies.
  1. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    I literally told you about this sort of error 3 days ago.
     
  2. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?


    I literally told you about this sort of error 3 days ago.

    What if I told you that every single one of these labels already exists?
     
  3. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Maybe there's two of the same name label?  But I'm sure the error would be "double defined".  You're editing the right ASM file, right?  There's been many times where I couldn't fix an error then to find out I was editing a back-up and trying to compile a recent =P
     
  4. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Isn't that the assembler's job? Just include the _smps2asm_inc.asm file and set the SonicDriverVer constant to 1.
     
  5. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Two replies in one post.

    Actually, I found the offending lines. You know how there's an include directive with filename s2.sounddriver.asm? Well, I replaced that filename with filename s2.clonedriver.asm (that's what I renamed the file). But the error is, this comes before the end of the ROM. And guess what lines the Clone Driver's file has at the end?


    EndofRom:
    END


    BINGO. Those two lines right there are causing my problems. The clone driver is declaring the end of the ROM before the actual end of the ROM; in other words, the EndofRom declaration is coming too early. And as such, my s2.asm file can't read the last bit of code, and thus, the errors I showed. If only I had looked at the end of the ASM file before, this wouldn't have happened. Although, a useful tip to Clone Driver users: If you're putting that driver before the end of the ROM, head to the end of the driver's ASM file and delete the two lines shown above.

    Erm...it's actually because the .asm files for Knuckles' sounds (you should know which ones I'm referring to) are still in Sonic 2 sound driver format. I don't suppose you have .asm files for those sounds converted to Sonic 1 format, do you?

    EDIT: Hold the phone...there is still an issue that I don't understand. What do I do with these errors:


    > > >s2.asm(83364): error: symbol undefined
    > > > zPalModeByte
    > > > sne (Z80_RAM+zPalModeByte).l ; set if PAL
    > > >s2.asm(83364): error: addressing mode not allowed here
    > > > sne (Z80_RAM+zPalModeByte).l ; set if PAL


    They seem to still be following the Sonic 2 sound driver.
     
    Last edited by a moderator: Mar 18, 2013
  6. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    XD

    Well, we all make mistakes.

    Again, "zPalModeByte" doesn't exist.  Unless you've put it after "ENDOFROM" again =P

    The other two should fix itself once you've fixed the "undefined" error (because the Z80 is trying to add "zPalModeByte" which doesn't exist).
     
  7. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?


    XD

    Well, we all make mistakes.

    Again, "zPalModeByte" doesn't exist.  Unless you've put it after "ENDOFROM" again =P

    The other two should fix itself once you've fixed the "undefined" error (because the Z80 is trying to add "zPalModeByte" which doesn't exist).

    Actually, I think maybe that in particular was in the s2.sounddriver.asm file, which I already got rid of D:

    What should I do?
     
  8. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Update!

    So, I've tried commenting out the two lines involving PAL mode for the sound driver. It lets me build, but all I get is a black screen. Does anyone know what I should do?
     
  9. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Erm...it's actually because the .asm files for Knuckles' sounds (you should know which ones I'm referring to) are still in Sonic 2 sound driver format. I don't suppose you have .asm files for those sounds converted to Sonic 1 format, do you?If you are referring to the sounds in my guide, those are NOT in any particular sound driver's format. The _smps2asm_inc.asm file contains macro and constant definitions which allow them to work with all three sound drivers. I took them directly from the huge archive of asm format sfx/music.
     
    Last edited by a moderator: Mar 19, 2013
  10. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?

    Erm...it's actually because the .asm files for Knuckles' sounds (you should know which ones I'm referring to) are still in Sonic 2 sound driver format. I don't suppose you have .asm files for those sounds converted to Sonic 1 format, do you?
    If you are referring to the sounds in my guide, those are NOT in any particular sound driver's format. The _smps2asm_inc.asm file contains macro and constant definitions which allow them to work with all three sound drivers. I took them directly from the huge archive of asm format sfx/music.
    Yes, but when I try to build using the default files, I get an error saying that the pointers in a Sonic 1 song need to be after the song. Am I doing something wrong?
     
  11. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Update 2!

    Wow, I'm assuming it's easier now. I just remembered, I never got rid of the s2.sounddriver.asm file! I merely kept it off to the side in my disassembly! Think maybe now you guys can give an answer as to what I should do about those errors?

    EDIT: This is going to be harder than I thought. I tried copying the zPalModeByte thing from the Sonic 2 sound driver, and apparently the Sonic 1 sound driver doesn't support the command "db" (not that I know what it means anyway)
     
    Last edited by a moderator: Mar 19, 2013
  12. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Do I need to set anything up to make a PAL flag with the Sonic 2 Clone Driver? That's my only question atm.
     
  13. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The Sonic 2 sound driver is Z80 code, the Sonic 1 sound driver is 68000 code. 'db' is the z80 mnemonic for storing a byte value, the 68000 equivalent is 'dc.b'.
     
  14. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Somehow, I am still getting a black screen. Does it have to do with these lines:


    btst #0,(VDP_control_port+1).l ; check video mode
    sne (Z80_RAM+PalModeByte).l ; set if PAL


    I am starting to get a bit frustrated at the amount of trouble this one damned PAL flag is giving me.
     
  15. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I don't know, I try to avoid messing with sound drivers.
     
  16. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Well, I'll leave the question out there for someone who does know.

    Does the problem I'm getting have to do with these lines?


    btst #0,(VDP_control_port+1).l ; check video mode
    sne (Z80_RAM+PalModeByte).l ; set if PAL


    I want to be able to give some screenshots this evening, and I've got the layouts I want to show ready. I just need this problem fixed.
     
  17. rika_chou

    rika_chou Adopt Member

    Joined:
    Aug 11, 2007
    Messages:
    689
    If I understand those two lines, commenting them out would just always run the sound in NTSC mode. So I don't think it would be that important, and if your ROM doesn't start then you may have messed up something else.
     
  18. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I think I might have messed up something else...here's the disassembly if anyone wants to have at it:

    http://www.mediafire.com/?48kd5ph25pjjly3

    If anyone can figure out what's going wrong, please don't hesitate to let me know.
     
  19. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    Got it working.

    https://dl.dropbox.com/u/44757401/S2HG_Fix_4TS.7z

    First off, those two lines about toggling PAL mode you mentioned earlier physically couldn't be the case: they were the part of original sound driver loading routine, which wasn't even executed. Doing anything to that code is pointless, since you have commented out the only jump to it in JmpTo_SoundDriverLoad. Instead, a new code related to the new driver was working in JmpTo_SoundDriverLoad, which is totally right. Speaking of PAL mode, Sonic 1's SMPS doesn't have a PAL mode switcher, which is nothing bad, but the music will play slower on 50 Hz machines.

    I also noticed that you didn't remove calls to sndDriverInput from V_Int routines. This subroutine was meant to transfer commands/sound ids queue from 68K to Z80 RAM of original driver. Since the new driver works on 68K side, it doesn't have issues with accessing its RAM, so this transfer becomes completely odd, moreover, this could also conflict with the DAC driver (they used Jman's driver back then, if I'm right), that now took SMPS Z80's place. It's also weird how instead of a proper $A01B80 address, you have $A01B8000 in this routine.

    But the main issue was here:



    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Sonic 2 Clone Driver (modified S1 sound driver)
    ; ---------------------------------------------------------------------------
    ; loc_EC0E8:
    Snd_Driver:
    include "s2.clonedriver.asm" ; CPU 68k

    ; CPU 68000
    ; padding off
    ; listing off
    ; supmode on
    ; !org (Snd_Driver+Size_of_Snd_driver_guess) ; don't worry; I know what I'm doing


    ; loc_ED04C:
    Snd_Driver_End:

    As you see, I commented out these lines, and everything worked after that. I'm not too familiar with the AS compiler, as I'm using the ASM68K for all my needs, but I'm pretty sure those directives were the reason the data was compiled wrongly and the game was unable to run.

    Switching CPU type is odd here, since it wasn't changed in the file you included. But perhaps, this would work. The ORG directive usually changes the current offset. It works slightly differently on every assembler, I'm not sure how it works in the AS exactly, but I think due to wrong/dead constants or whatever, all the data after them was assembled into the wrong location or had wrong offsets, which is why the game crashed.

    So, now the game runs, so does the new sound driver. However, I can hear a lot of sound ids are playing the wrong sounds. I don't know if this is how the new driver works, or it's another bug (I have never tried this driver and I barely hacked Sonic 2), check this out.
     
    Last edited by a moderator: Mar 20, 2013
  20. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Weird when I commented out those lines in his file I still got a white screen (that's how I did It on mine and it worked) and it shouldn't be playing the wrong sound ids the only thing that comes with putting the S1 sound drive in regards to sounds is that you don't have the spin dash rev anymore since that sound wasn't in the original sonic 1 he may have did something wrong a long the way that is making the sound ids play the wrong sounds he will have to check that out. Or maybe with the hg version more bugs occur when adding the sonic 1 sound driver but I find that very unlikely. You'll need someone other than Vladikcomper and me to help since Vladikcomper is more advanced in Sonic 1 and well I'm not a genius either when it comes to sonic 2 lol

    Edit: I stand corrected your hack is way messed up all the music and sounds play in the wrong instances. For example when jumping you get the Sonic and Tails two player results music instead of the jumping sound and the sega sound is all fucked up there is more than that you need to fix and its going to take a lot of work. You may have to retrace your steps.

    Your level layout has way too many death pits and dick moves and for some reason your water in chemical Plant zone is black and has other colors flashing oh and dieing in the water and getting a game over crashes the game. Actually all the water has that issue.

    redhotsonic edit: Removed quote.  No need to quote the whole of vladikcomper's post when posting directly underneath, especially when his post was quite big =)
     
    Last edited by a moderator: Mar 20, 2013
Thread Status:
Not open for further replies.