incomplete sub-routine equivalency guide. All edit

Discussion in 'Engineering & Reverse Engineering' started by .hack//zero, Aug 26, 2006.

Thread Status:
Not open for further replies.
  1. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    My reason for doing this: To make it easier for people to port enemys. That's the main point of this, but I'm dealing with the other things because it might come in handy for guys in other areas.

    Okay I see why tweaker was having a problem with the way I was dealing with this thing. Mainly because I'm using hex to find the subs instead of assembly. Both ways work fine. So don't insult the fact that I was using hex to find some of them. Anytime I'm not sure if I got the right sub. I test it out.

    I know, I know, there are some comflicting subs. I'll check them out when I get the chance.

    <TABLE border="1">
    <caption><EM>sub routines that do have equivalents</EM></caption>
    <TR><TH>S1<TD>S1JP <TD>S2B<TD>S2<TD>S2K<TD>S3<TD>S3&K
    <TR><TH>ReadJoypads<TD>?<td>132C <TD> 111C<td>?<TD>1372<TD>10DE
    <TR><TH>JoypadInit<td> ?<TD> 12FC <TD>10EC<td> ? <TD>1342<TD> 10AE
    <TR><TH>VDPSetupGame <td> ?<TD> 1368 <TD> 1158<td> ? <TD> 13AE <TD> 111A
    <TR><TH>clearScreen<td> ?<TD> 142A, and 1458 <TD> 1248, and 1276<td> ?<TD> 14D4, and 1502<TD> 1240, and 126E
    <TR><TH>PauseGame<td> ? <TD> 14DC<TD> ?<td> ?<TD> ?<TD> ?
    <TR><TH>PalLoad1 <td> ?<TD>?<TD>2712<td> ?<TD> ?<TD> ?
    <TR><TH>PalLoad2 <td> ?<TD>?<TD> 272E<td> ?<TD> ?<TD> ?
    <TR><TH>PalLoad3_Water<td> ?<TD> ?<TD> 2746<td> ?<TD> ?<TD> ?
    <TR><TH>PalLoad4_Water <td> ?<TD>?<TD>2764 <td> ?<TD> ?<TD> ?
    <TR><TH>AnimateSprite <td> ?<TD>? <TD>sub_16544<TD> ?<td> ?<TD> ?
    <TR><TH>DisplaySprite <td> ?<TD> ?<TD>sub_164F4 <td> ?<TD> 19240 <TD>219240
    <TR><TH>DeleteObject <td> ?<TD>D3C2 <TD>loc_2DFEE<td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>SingleObjLoad<td> ?<TD> ?<TD> loc_17FDA<td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>SingleObjLoad2<td> ?<TD> ?<TD> loc_17FFA <td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>ObjHitFloor <td> ?<TD>13898<TD>loc_1EDFA:<td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>ObjHitFloor2<td> ? <TD>?<TD>loc_1EE0E<td> ?<td> ?<td> ?
    <TR><TH>SpeedToPos<td> ? <TD>?<TD>sub_163AC<td> ?<td> ?<td> ?
    <TR><TH>MarkObjGone<td> ?<TD>D340<TD>16472 <td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>findfloor <td> ?<TD> ?<TD>locret_1EE2E<TD>?<td> ?<TD>?<TD>?
    <TR><TH>ObjectFall/D5B2<td> ?<TD>?<TD>sub_16380<td> ?<TD>?<TD>?
    <TR><TH>Play Song<td> ? <td> ?<TD>sub_1370<TD> ?<td> ?<TD> ?
    <TR><TH>Play Sound<td> ?<TD> ?<TD> sub_1376 <TD> ?<td> ?<TD> ?<TD> ?
    <TR><TH>Sub Routine to Generate Random Number <TD>?<td> ?<TD> sub_3390<td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>Calulate Sine wave <td> ?<TD>?<TD> sub_33B6 <td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>Delete Object <td> ?<TD> ?<TD> loc_164E6 <td> ?<TD> ?<TD> ?<TD> ?
    <TR><TH>Load Pattern Load Cue<TD> ? <TD> ?<TD>sub_F65E<TD> ?<TD> ?<TD> ?
    <TR><TH>Boss Move Routine<TD> ?<TD> ?<TD>sub_163AC<TD> ?<TD> ?<TD> ?
    <TR><TH>Add Points Routine <TD> ?<TD> ?<TD>sub_40D06<TD> ?<TD> ?<TD> ?
    <TR><TH>Boss defeated Routine<TD> ?<TD> ?<TD>loc_2D6CC<TD> ?<TD> ?<TD> ?
    <TR><TH>Boss Move Routine<TD> ?<TD>?<TD>loc_2DB0E<TD> ?<TD> ?<TD> ?
    <TR><TH>Obj15_Move2<TD> ?<TD>?<TD>loc_28AF4<TD> ?<TD> ?<TD> ?
    <TR><TH>Obj48_Move<TD> ?<TD>?<TD>loc_FFA2 <TD> ?<TD> ?<TD> ?

    </table>



    <TABLE border="1">
    <caption><EM>S1 Core engine Sub Routines (subs that have equivalents will be changed as we find them.</EM></caption>
    <TR><TH>unknown<TD> 5BA
    <TR><TH>unknown<TD> 5CA
    <TR><TH>ErrorWaitForC<TD> 5E0
    <TR><TH>Demo_Time<TD> D84
    <TR><TH>unknown<TD> 106E
    <TR><TH>PalToCRAM<TD> 1126
    11B6
    <TR><TH>SoundDriverLoad
    <TR><TH>PlaySound<TD> ?
    <TR><TH>PlaySound_Special<TD> ?
    <TR><TH>PlaySound_Unk<TD> ?
    <TR><TH>PauseGame<TD> 13A8
    <TR><TH>ShowVDPGraphics<TD>1420
    <TR><TH>NemDec<TD>1440
    <TR><TH>NemDec2<TD>148A
    <TR><TH>NemDec3<TD>14CC
    <TR><TH>NemDec4<TD>152E
    <TR><TH>LoadPLC<TD>1580
    <TR><TH>LoadPLC2<TD>15B2
    <TR><TH>ClearPLC<TD>15DE
    <TR><TH>RunPLC_RAM<TD>15EC
    <TR><TH>unknown<TD>1642
    <TR><TH>unknown<TD>165E
    <TR><TH>RunPLC_ROM<TD>16E2-16FE
    <TR><TH>EniDec<TD>16FE-173E
    <TR><TH>unknown<TD>188C
    <TR><TH>KosDec bt <TD>189A-18A8
    <TR><TH>KosinskiDec <TD>?
    <TR><TH>PalCycle_Load <TD>?
    <TR><TH>Pal_FadeIn<TD> 1DE4
    <TR><TH>Pal_AddColor <TD>1E26
    <TR><TH>Pal_FadeFrom <TD>1E52
    <TR><TH>Pal_FadeOut <TD>1E72
    <TR><TH>Pal_DecColor <TD>1EA0
    <TR><TH>Pal_MakeWhite <TD>1ED0
    <TR><TH>Pal_WhiteToBlack<TD> 1F0A
    <TR><TH>Pal_DecColor2<TD> 1F4C
    <TR><TH>Pal_MakeFlash<TD> 1F7C
    <TR><TH>Pal_ToWhite<TD> 1F9C
    <TR><TH>Pal_AddColor2<TD> 1FCA

    <TR><TH>DelayProgram<TD> 29A8
    <TR><TH>RandomNumber<TD> 29B4
    <TR><TH>CalcSine <TD>29DA
    <TR><TH>calcAngle <TD>2CA8
    <TR><TH>LevSelControls <TD>3460
    <TR><TH>LevSelTextLoad<TD>34E6
    <TR><TH>LevSel_ChgSnd<TD> 3572
    <TR><TH>LevSel_ChgLine<TD> 3586
    <TR><TH>MoveSonicInDemo <TD>3E32
    <TR><TH>ColIndexLoad<TD> 3F34
    <TR><TH>OscillateNumInit <TD>3FD0
    <TR><TH>OscillateNumDo<TD> 416E
    <TR><TH>SS_BGLoad <TD>489C
    <TR><TH>PalCycle_SS<TD> 4962
    <TR><TH>SS_BGAnimate <TD>4BE4
    <TR><TH>End_MoveSonic<TD> 5370
    <TR><TH>EndingDemoLoad <TD>5898
    <TR><TH>LevelSizeLoad<TD> 5EBE
    <TR><TH>BgScrollSpeed<TD> 61EC
    <TR><TH>DeformBgLayer <TD>6286
    <TR><TH>ScrollHoriz<TD> 657E
    <TR><TH>ScrollHoriz2<TD> 65B2
    <TR><TH>ScrollVertical <TD>6616
    <TR><TH>ScrollBlock1<TD> 6768
    <TR><TH>ScrollBlock2 <TD>67D2
    <TR><TH>ScrollBlock3 <TD>6814
    <TR><TH>ScrollBlock4<TD> 6844
    <TR><TH>unknown(Might have something to do load tiles as you move. I'll have to check it once I get my computer up and running again.<TD> 6886
    <TR><TH>LoadTilesAsYouMove<TD> 68B2
    <TR><TH>unknown<TD> 6954
    <TR><TH>unknown <TD>69F4
    <TR><TH>unknown <TD>6AD8
    <TR><TH>unknown <TD>6ADA
    <TR><TH>unknown <TD>6B04
    <TR><TH>unknown <TD>6B06
    <TR><TH>unknown <TD>6B32
    <TR><TH>unknown <TD>6BD6
    <TR><TH>unknown <TD>6C20
    <TR><TH>unknown <TD>6C3C
    <TR><TH>LoadTilesFromtitle screen <TD>6C3C
    <TR><TH>LoadTilesFromtitle screen 2<TD> 6C58
    <TR><TH>MainLoadBlockLoad<TD> 6CA6
    <TR><TH>LevelLayoutLoad<TD> 6D12
    <TR><TH>LevLoad_ClrRam<TD> 6D1C
    <TR><TH>LevelLayoutLoad2 <TD>6D32
    <TR><TH>DynScrResizeLoad<TD> 6D6C
    <TR><TH>AnimateSprite<TD> A718
    <TR><TH>unknown<TD> B09C? ? ? ? ? ?
    </table>


    <TABLE border="1">
    <caption><EM>S1 Palette Cycles</EM></caption>
    <TR><TH>Segalogo <TD>LZ <TD> SLZ <TD> SYZ
    <TR><TH>2006-2020<TD>1DAC <TD>1A3C-1A60<TD>BT
    </table>


    <TABLE border="1">
    <caption><EM>S1 zone sub routines</EM></caption>
    <TR><TH>Deform_GHZ <TD> 62DE-633C
    <TR><TH>Deform_LZ <TD> 6384-63C6
    <TR><TH>Deform_MZ <TD> 63C6-6402
    <TR><TH>Deform_SLZ <TD> 6426-6480
    <TR><TH>Deform_SLZ_2<TD> 6482-64CE
    </table>

    <TABLE border="1">
    <caption><EM>S1 object specialized sub routines</EM></caption>
    LZWindTunnels <TD> 3BD0<TD>
    <TR><TH>LZWaterSlides <TD> 3C28-3C56
    <TR><TH>ChangeRingFrame<TD>4206
    <TR><TH>SignpostArtLoad<TD>4274
    <TR><TH>Obj11_Solid<TD> 741C
    <TR><TH>PlatformObject <TD>744C
    <TR><TH>Platform2 <TD>746E
    <TR><TH>Platform3 <TD>7474
    <TR><TH>SlopeObject<TD> 7520
    <TR><TH>Obj15_Solid <TD>755C
    <TR><TH>Obj11_WalkOff <TD>7592
    <TR><TH>ExitPlatform <TD>75C0
    <TR><TH>ExitPlatform2 <TD>75C2
    <TR><TH>Obj11_MoveSonic <TD>75F4
    <TR><TH>Obj11_Bend<TD> 7620
    <TR><TH>MvSonicOnPtfm<TD> 7B22
    <TR><TH>MvSonicOnPtfm2 <TD>7B2E
    <TR><TH>MvSoniconptfm3 <TD>7B3A
    <TR><TH>Obj15_Move<TD> 7B64
    <TR><TH>Obj48_Move<TD> 7D88
    <TR><TH>Obj15_Move2<TD> 7B9C
    <TR><TH>Obj17_RotateSpikes<TD> 7D88
    <TR><TH>Obj18_Nudge<TD> 7F2C
    <TR><TH>Obj18_Move<TD> 7F46
    <TR><TH>Obj1A_WalkOff 829C
    <TR><TH>WalkOff <TD>83D8
    <TR><TH>SlopeObject<TD>2852A
    <TR><TH>bj1D_ChkTouch<TD>88E0
    <TR><TH>Obj44_SolidWall <TD>8A62
    <TR><TH>Obj44_SolidWall2 <TD>8ADA
    <TR><TH>unknown<TD> 9404
    <TR><TH>Obj1F_SetAni<TD> 9688
    <TR><TH>Obj23_ChkCancel<TD> 99A4
    <TR><TH>CollectRing <TD>9C76
    <TR><TH>Obj7C_Collect <TD>9F38
    <TR><TH>SolidSides<TD> A48E
    <TR><TH>Obj2D_ChkSonic <TD>ADF2
    <TR><TH>Obj2D_ChkSonic2 <TD>AE22
    <TR><TH>Obj2F_Types<TD> AF9E
    <TR><TH>Obj30_Types<TD> B4DE
    <TR><TH>Obj45_Move<TD> BAC6
    </table>

    <TABLE border="1">
    <caption><EM>S2 only Core engine Subs</EM></caption>
    <TD>Effects how tails moves in a normal game, but not when you're controlling him. <TD> AE8
    </table>



    credit:
    R. Solaris For a few converstions that I really wanted to find. Mainly the boss ones.
    thunderspeed for a few converstions.
    Aurochs, for his s2 disassembly.
    hivebrain for his s1 disassembly
    drx for his less complete s1 disassembly. So I can find the locations of the subs from hivebrains disassembly
     
  2. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    You need to make it a table. Lemme give that a shot...

    <TABLE border="1">
    <caption><EM>Routine Equivelants</EM></caption>
    <TR><TH>S1<TD>S2B<TD>S2F
    <TR><TH>MarkObjGone<TD>loc_16472<TD>
    <TR><TH>Obj_HitFloor<TD>loc_1EDFA<TD>
    <TR><TH>AnimateSprite<TD>loc_16544<TD>
    <TR><TH>DisplaySprite<TD>loc_164F4<TD>
    <TR><TH>DeleteObject<TD>loc_2DFEE<TD>
    <TR><TH>SingleObjLoad<TD>loc_6F8E<TD> </table>

    I'm pretty shit at HMTL, but that's a basic idea of how it should look.
     
  3. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Well, atleast it seems like I'm getting support for this one. Unlike my last few ideas. Really it should, because if it goes the way I plan it to. It should as importent as nemisis's hacking guides.
     
  4. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    I think it'd be more productive if someone who knew what they were doing (IE: Stealth, drx, Hive, etc...) made the list instead. I'm in favor of it, but I can't rely entirely on your guide simply because you seem to be getting by it due to pure luck.
     
  5. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    I know, I'm gonna PM them about it. Right now, I'm just doing the basic stuff from the disassemblies. I can think of think of so many advantages of doing this way.

    - We won't have to wait for access.
    - We can figure out the unknowns faster.
    - We will be able to see mistakes faster.
    - More people can contribute. Which will cause it to get done faster.
     
  6. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    This is actually a neat idea, but I do ask that you are 100% sure of something before adding it. Also, maybe add this to SHIT.

    Edit: I wouldn't be surprised if some people already have this all documented.
     
  7. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    I'm not doing it alone. (I hope) I'm PMing some people that I really think could help with this. Also, anyone that info to add about this can add it.
     
  8. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Tweaker, the part I'm doing right now isn't rocket science. It's just taking a look from the dissasemblies to find the sub routines, and the info from them.It's the part after that I'm gonna need some real help on. Even then I do know how to check for what they do. Also like rika asked, I won't post anything that I'm not 100% sure about. shit, double post.
     
  9. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,528
    8
    18
    Married life <3
    I'll see what else I can dig up. It might even help my hack in the end.
     
  10. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    I don't think it can just help your hack. It can help mine, and every other major hack. That's the main reason why this needs to be made. After I'm done with EHZ act 2 in my hack. I'm gonna go full time with this guide and my porting abilitys. FYI: this doesn't mean I'm gonna quit my hack. It's just a break so I can learn some crap to make it even better.
     
  11. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,528
    8
    18
    Married life <3
    Cool, it got pinned.

    K, As for the palette loading routines, I have equivalent subroutine names. The Sonic 2 names should, though I'm not sure, be the hex location:

    <table border=1 bordercolor=ef0000 cellspacing=0>
    <TR>
    <TD>Sonic 1</TD>
    <TD>Sonic 2</TD>
    </TR>
    <TR>
    <TD>PalLoad1</TD>
    <TD>sub_2712</TD>
    </TR>
    <TR>
    <TD>PalLoad2</TD>
    <TD>sub_272E</TD>
    </TR>
    <TR>
    <TD>PalLoad_U</TD>
    <TD>sub_2746</TD>
    </TR>
    <TR>
    <TD>PalLoad4</TD>
    <TD>sub_2764</TD>
    </TR>></table>

    It's a small addition, but ehh. =P

    EDIT: fixed the table. It screwed the page over. =P
     
  12. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Thanks, it doesn't matter if it's a small update or a major update. As long as it helps.
     
  13. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    Yes, I read your PM. No, I'm not interested. Sorry, but I'm too busy with that damn special stage engine to bother with this.

    Oh, by the way, expect me to follow a very different naming convention from Hivebrain. Descriptiveness is more importiant to me than shortness. For example, there are three or for different routines for processing PLRs:
    "loadPlrNormal" (hunts for the first empty spot in the queue and starts copying to there)
    "loadPlrOverwrite" (copies the PLR to the base of the queue without regard to preexisting data)
    "doPlrFromRom" (processes the entire list at once directly from ROM)
     
  14. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Well, you're welcome to help anytime you're ready. You're probably gonna be finished with SS engine before this guide is.
     
  15. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Then maybe I should wait to work on the s2 subs till you release the 2006 s2 dissasembly.
     
  16. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Okay, tweaker say that the way that I'm doing this guide is worthless. What do you guys think about it. Also I made a few new additions.

    <TABLE border="1">
    <caption><EM>sub routines that do have equivalents</EM></caption>
    <TR><TH>S1 <TD>S2B<TD>S2<TD>S3<TD>S3&K
    <TR><TH>ReadJoypads<TD>132C <TD> 111C<TD>1372<TD>10DE
    <TR><TH>JoypadInit<TD> 12FC <TD>10EC <TD>1342<TD> 10AE
    <TR><TH>VDPSetupGame <TD> 1368 <TD> 1158 <TD> 13AE <TD> 111A
    <TR><TH>clearScreen<TD> 142A, and 1458 <TD> 1248, and 1276<TD> 14D4, and 1502<TD> 1240, and 126E
    <TR><TH>PauseGame <TD> 14DC<TD> ?<TD> ?<TD> ?
    <TR><TH>DisplaySprite <TD> ?<TD>164F4 <TD> 19240 <TD>219240
    </table>
     
  17. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    Now THAT's MUCH better. I think you finally understand what I was telling you to do.
     
  18. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    Tweaker, I've had it that way for most of the day. I still still don't see why you care some much about it being like this. like this.

    describe(coming from the s1 dissasembly) s1 offset in hex s2b s2 s3 s3&k
     
  19. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    No, you haven't. In either case, I don't feel like arguing this any further.

    You really should stick loc_ before the addresses in S2 though. Try to match the labels in whatever way you can.

    Also, how can you have two results for the same subroutine? That doesn't make sense... if they don't match exactly, then they aren't the same subroutine (although admittedly some are modified between the two but still do the same thing... but in that case you still wouldn't have two results).
     
  20. .hack//zero

    .hack//zero

    Member
    2,998
    0
    16
    Learning NES ASM, Finding a girlfriend.
    I thought it was a clearscreen 2 or something. I'll fix it. Ok, I changed it 3 or 4 hours ago. Also for the most part it's like sub_(offset) in sonic 2. So, there really isn't much of a point in doing that way. As for searching for it, all you need to do is (offset): and you should find it.
     
Thread Status:
Not open for further replies.