ThomasSpeedrunner Help Thread

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

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

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Okay, so what do I do if I want to add a new character (in this case, Knuckles) to my Sonic 2 hack without using the S3K Hg disassembly? I want to use the KiS2 code, but all I get is a bunch of errors. What I already know:

    • Below this:

      bne.s InitPlayers_TailsAlone ; branch if this is a Tails alone game
      I am supposed to put this:
      Code:
      bne.s	InitPlayers_KnuxAlone    ; branch if this is a Knuckles alone game
    • Under this:
      Code:
      InitPlayers_TailsAlone:
      	move.b	#ObjID_Tails,(MainCharacter+id).w ; load Obj02 Tails object at $FFFFB000
      	move.w  #Tails_Tails,(Tails_Tails_ptr).w
      	move.b	#ObjID_SpindashDust,(Tails_Dust+id).w ; load Obj08 Tails' spindash dust/splash object at $FFFFD100
      	addi.w	#4,(MainCharacter+y_pos).w
      	rts
      I am supposed to put this:
      Code:
      InitPlayers_KnuxAlone:
      	move.b	#ObjID_Knuclles,(MainCharacter+id).w ; load Obj4C Knuckles object at $FFFFB000
      	move.b	#ObjID_SpindashDust,(Knuckles_Dust+id).w ; load Obj08 Knuckles' spindash dust/splash object at $FFFFD100
      	addi.w	#4,(MainCharacter+y_pos).w
      	rts
      
       
       
    Anyone who can help me with this, please do not hesitate in any way to do so.


    And until next time, I bid you farewell.
     
    Last edited by a moderator: Jan 29, 2013
  2. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    If you could please post your errors, we then have something to work with.
     
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

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


    > > >s2.asm(57477): error: jump distance too big
    > > >         bsr.w    ResumeMusic
    > > >s2.asm(57504): error: jump distance too big
    > > >         bsr.w    ResumeMusic
    > > >s2.asm(57524): error: jump distance too big
    > > >         bsr.w    ResumeMusic
    > > >s2.asm(57546): error: jump distance too big
    > > >         bsr.w    AnglePos
    > > >s2.asm(57671): error: jump distance too big
    > > >         bsr.w    CheckLeftCeilingDist
    > > >s2.asm(57680): error: jump distance too big
    > > >         bsr.w    CheckRightCeilingDist
    > > >s2.asm(58216): error: jump distance too big
    > > >         bsr.w    AnglePos
    > > >s2.asm(58447): error: jump distance too big
    > > >         bsr.w    CalcRoomInFront          ; Also known as Sonic_WalkSpeed in Sonic 1
    > > >s2.asm(58935): error: jump distance too big
    > > >         bsr.w    CalcRoomOverHead
    > > >s2.asm(59163): error: jump distance too big
    > > >         bsr.w    AnglePos
    > > >s2.asm(59244): error: jump distance too big
    > > >         bsr.w    AnglePos
    > > >s2.asm(59433): error: jump distance too big
    > > >         bsr.w    CheckLeftWallDist
    > > >s2.asm(59441): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59462): error: jump distance too big
    > > >         bsr.w    CheckLeftWallDist
    > > >s2.asm(59470): error: jump distance too big
    > > >         bsr.w    CheckCeilingDist
    > > >s2.asm(59486): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59513): error: jump distance too big
    > > >         bsr.w    CheckLeftWallDist
    > > >s2.asm(59521): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59529): error: jump distance too big
    > > >         bsr.w    CheckCeilingDist
    > > >s2.asm(59540): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59548): error: jump distance too big
    > > >         bsr.w    CheckCeilingDist
    > > >s2.asm(59598): error: jump distance too big
    > > >         bsr.w    CheckLeftWallDist
    > > >s2.asm(59605): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59662): error: jump distance too big
    > > >         bsr.w    CheckLeftWallDist
    > > >s2.asm(59672): error: jump distance too big
    > > >         bsr.w    CheckCeilingDist
    > > >s2.asm(59701): error: jump distance too big
    > > >         bsr.w    CheckLeftWallDist
    > > >s2.asm(59708): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59715): error: jump distance too big
    > > >         bsr.w    CheckCeilingDist
    > > >s2.asm(59740): error: jump distance too big
    > > >         bsr.w    CheckRightWallDist
    > > >s2.asm(59750): error: jump distance too big
    > > >         bsr.w    CheckCeilingDist
    > > >s2.asm(59875): error: jump distance too big
    > > >         blt.w    JmpTo_KillCharacter
    > > >s2.asm(59893): error: symbol double defined
    > > > JMPTO_KILLCHARACTER
    > > > JmpTo_KillCharacter:                  ; ...
    > > >s2.asm(59923): error: jump distance too big
    > > >         bsr.w    CheckGameOver
    > > >s2.asm(59935): error: symbol double defined
    > > > CHECKGAMEOVER
    > > > CheckGameOver:    
     


    And until next time, I bid you farewell.
     
    Last edited by a moderator: Jan 30, 2013
  4. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Hold on, I fixed the first set of errors, attempted to build the ROM...

    ...AND GOT ANOTHER SET OF ERRORS:


    > > >s2.asm(57287): error: symbol undefined
    > > > SK_Map_Knuckles
    > > > move.l #SK_Map_Knuckles,4(a0) ; SK_Map_Knuckles
    > > >s2.asm(57297): error: symbol undefined
    > > > Adjust2PArtPointer2_Useless
    > > > bsr.w Adjust2PArtPointer2_Useless
    > > >s2.asm(57814): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(57867): error: symbol undefined
    > > > sub_3192E6
    > > > bsr.w sub_3192E6 ; Doesn't exist in S2
    > > >s2.asm(57915): error: symbol undefined
    > > > sub_318FF6
    > > > bsr.w sub_318FF6
    > > >s2.asm(58046): error: symbol undefined
    > > > loc_319208
    > > > bra.w loc_319208
    > > >s2.asm(58052): error: symbol undefined
    > > > loc_3193D2
    > > > bra.w loc_3193D2
    > > >s2.asm(59449): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(59500): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(59563): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(59612): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(59687): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(59765): error: symbol undefined
    > > > Player_CheckFloor
    > > > bsr.w Player_CheckFloor
    > > >s2.asm(60380): error: symbol undefined
    > > > SK_PLC_Knuckles
    > > > lea (SK_PLC_Knuckles).l,a2 ; SK_PLC_Knuckles
    > > >s2.asm(60380): error: addressing mode not allowed here
    > > > lea (SK_PLC_Knuckles).l,a2 ; SK_PLC_Knuckles
    > > >s2.asm(60401): error: symbol undefined
    > > > SK_ArtUnc_Knux
    > > > lea (SK_ArtUnc_Knux).l,a1 ; SK_ArtUnc_Knux
    > > >s2.asm(60401): error: addressing mode not allowed here
    > > > lea (SK_ArtUnc_Knux).l,a1 ; SK_ArtUnc_Knux
    > > >s2.asm(74551): error: addressing mode not allowed on 68000
    > > > move.w word_38810(pc,d1.w),d2
    > > >s2.asm(74551): error: addressing mode not allowed here
    > > > move.w word_38810(pc,d1.w),d2
    > > >s2.asm(74556): error: addressing mode not allowed on 68000
    > > > lea byte_38820(pc,d1.w),a1
    > > >s2.asm(74556): error: addressing mode not allowed here
    > > > lea byte_38820(pc,d1.w),a1
    > > >s2.asm(83462): error: addressing mode not allowed on 68000
    > > > lea Touch_Sizes(pc,d0.w),a2
    > > >s2.asm(83462): error: addressing mode not allowed here
    > > > lea Touch_Sizes(pc,d0.w),a2
    > > >s2.asm(83726): error: addressing mode not allowed on 68000
    > > > move.w Enemy_Points(pc,d0.w),d0
    > > >s2.asm(83726): error: addressing mode not allowed here
    > > > move.w Enemy_Points(pc,d0.w),d0
    > > >s2.asm(85000): error: addressing mode not allowed on 68000
    > > > move.w AnimPatMaps(pc,d0.w),d0
    > > >s2.asm(85000): error: addressing mode not allowed here
    > > > move.w AnimPatMaps(pc,d0.w),d0
    > > >s2.asm(85001): error: addressing mode not allowed on 68000
    > > > lea AnimPatMaps(pc,d0.w),a0
    > > >s2.asm(85001): error: addressing mode not allowed here
    > > > lea AnimPatMaps(pc,d0.w),a0


    This one, I have no understanding of. Please don't delay in assisting me to fix these errors.

    And until next time, I bid you farewell.
     
  5. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    One question, what the fuck are you doing? I've added in Knuckles successfully into Sonic 2 with minimal issues, but seeing this...this makes me rethink things.

    First off, half of your routines don't exist. I'm looking at your log and it's pretty self explanatory.

    "> > >s2.asm(59687): error: symbol undefined"

    =

    It doesn't exist. If you honestly thought that straight porting the Knuckles object from the KiS2 disasm will work, it won't. Routine and Sub names are different per disasm. Now, before you go all port happy and adding in all these missing subordinates, see if the S2F disasm has the equivalent names. If it doesn't, then add them in, but seeing as it mainly Knuckles in Sonic 2 is well.... Sonic 2, it should exist. You'll obviously need to add the art as well, and as far as those addressing issues toward the end, it may be solved if you fix all those disasm errors. 
     
  6. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    SuperEgg is right, but here is a more in-depth help.

    > > > Player_CheckFloor> > > bsr.w Player_CheckFloor> > >s2.asm(59765): error: symbol undefined

    This type of error is basically telling you that "Player_CheckFloor" doesn't exist. On line 59765, you're trying to branch to a subroutine that doesn't exist. You can either:

    • Port "Player_CheckFloor" subroutine from the disassembly you're porting Knuckles from
    • Find a similar routine in the Sonic 2 disassembly that can be used instead. From the top of my head, try changing that branch to "Sonic_CheckFloor"
    Most of these missing subroutines already exist in Sonic 2, just with different names. But there are a few that does not exist that you may need to port. This will take a bit of time for searching for these.


    > > >s2.asm(57287): error: symbol undefined> > > SK_Map_Knuckles> > > move.l #SK_Map_Knuckles,4(a0) ; SK_Map_Knuckles

    Same thing here. You're trying to move "SK_Map_Knuckles" into the object mappings, when "SK_Map_Knuckles" does not exist. This is something you'll need to port over.

    > > >s2.asm(59701): error: jump distance too big> > > bsr.w CheckLeftWallDist

    As simple as it says, the branch is too big. Go to that line, and change it to jsr. The smallest is bsr.s, then bsr.w, then biggest is jsr (same with bra.s, bra.w and jmp).

    > > >s2.asm(59893): error: symbol double defined> > > JMPTO_KILLCHARACTER> > > JmpTo_KillCharacter:

    This means there are two labels called "JMPTO_KILLCHARACTER" You'll need to either:

    • Rename one of the labels
    • Delete one of the labels
    This might cause another error, probably one like "out of range", which I've explained above.



    Once you've fixed these errors, then errors like these:

    > > >s2.asm(74556): error: addressing mode not allowed on 68000> > > lea byte_38820(pc,d1.w),a1> > >s2.asm(74556): error: addressing mode not allowed here> > > lea byte_38820(pc,d1.w),a1

    Should just fix themselves.
     
  7. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Can I have my cookie now =P
     
  8. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Thanks, RHS. I'll try this and reply again if something goes wrong.

    ...

    I'm a bit late, aren't I?

    Also, where do I place this:


    SK_Map_Knuckles: equ $14A8D6


    If anyone can answer that there question, I would be all set to finish up the porting and transfer it to my hack's disassembly.
     
    Last edited by a moderator: Jan 30, 2013
  9. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    You don't place that, it's a reference to data in the Sonic & Knuckles ROM. You need to put in the actual mappings data from Sonic & Knuckles, converted to Sonic 2's format, since Sonic 2 can't read Sonic & Knuckles' mappings data.
     
    Last edited by a moderator: Jan 30, 2013
  10. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Okay, I already have the S3K disassembly, so the actual mappings are ripe for the taking, but how do I convert said mappings to Sonic 2's format?
     
  11. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    There are two ways:

    1. You could open SonMapEd, set the game format to S3K, load the mappings file, set the game format to S2, and save the mappings.
    2. You could use my converter.
     
  12. ThomasThePencil

    ThomasThePencil resident psycho Member

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

    Are the sprites supposed to pretty much show Blue Knuckles instead of Red Knuckles?

    Also, where do I move the finished product in terms of the Sonic 2 disassembly?
     
    Last edited by a moderator: Jan 31, 2013
  13. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Move them next to Sonic's mappings.
     
  14. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Should the corresponding section look like this?

    ArtTile_ArtUnc_Knuckles = $????

    ArtTile_ArtUnc_Sonic = $0780

    ArtTile_ArtUnc_Tails = $07A0

    ArtTile_ArtUnc_Tails_Tails = $07B0

    If so, what should the ???? be?
     
  15. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The same as Sonic's.
     
  16. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Mind explaining how that won't fuck everything up?
     
  17. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The ArtTile constants are referring to the VRAM address at which a certain art file will be loaded (or DMA'd to in the case of DPLCs). Since Sonic and Knuckles are both always the first player, their art is loaded to the same address in VRAM. The only possible conflict arises when attempting to put them both onscreen at the same time.
     
  18. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Well, that explains why I've never seen anyone use a "Sonic and Knuckles" player select option in Sonic 2 before (meaning playing as Sonic with Knuckles as the sidekick).
     
  19. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    That, and you would have to implement a Tails-like AI within Knuckles' code, and add a bunch of checks for the new player mode so you don't lose rings or die when he gets hit.
     
  20. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    YYYYYeeeeeaaaaahhhhh......and I don't think anybody feels like doing that :p
     
Thread Status:
Not open for further replies.