Random Hack/Mini Project Thread

Discussion in 'Engineering & Reverse Engineering' started by Malevolence, Jul 4, 2009.

  1. Overlord

    Overlord

    ...did we just switch realities? Moderator
    17,581
    68
    28
    Berkshire, England
    Learning Cymraeg
    Nice.

    Reminds me a bit of when Esrael got S2&K down to the 1MB of Sonic 2, though obviously that wasn't anywhere near as difficult in terms of amounts of data =P
     
  2. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    All right, some people were interested in the blue ring monitor code. Please excuse my use of the old disassembly; that's what I had =P

    First, I need two variables: one as a flag to store whether or not we picked up a blue ring, and one to store the number of rings lost when you get hit with a blue ring in hand.

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm"><span style="color: #adadad; font-style: italic;">; Variables for maintaining the new features</span>
    HasBlueRing equ <span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFFFC</span> <span style="color: #adadad; font-style: italic;">; byte</span>
    SavedRingCount equ <span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFFFD</span> <span style="color: #adadad; font-style: italic;">; word</span></pre><!--gc2--><!--OyBWYXJpYWJsZXMgZm9yIG1haW50YWluaW5nIHRoZSBuZXcgZmVhdHVyZXMKSGFzQmx1ZVJpbmcgZXF1
    ICYjMDM2O0ZGRkZGRkZDCQk7IGJ5dGUKU2F2ZWRSaW5nQ291bnQgZXF1ICYjMDM2O0ZGRkZGRkZECQk7I
    HdvcmQ=--><!--egc2--><!--g2--></div><!--eg2-->

    I use a macro to reset these variables whenever a level is loaded:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">resetBlueRing <span style="color: #00CC66;">macro</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span>HasBlueRing<span style="">)</span> <span style="color: #adadad; font-style: italic;">; take blue ring off</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span>SavedRingCount<span style="">)</span>
    <span style="color: #00CC66;">endm</span>
    <span style="color: #adadad; font-style: italic;">; ...</span>
    PlayLevel: <span style="color: #adadad; font-style: italic;">; XREF: ROM:00003246j ...</span>
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">l</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE26</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear score</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    Demo_Level:
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">l</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE26</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear score</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    Level_LoadObj:
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE1B</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear lives counter</span>
    resetBlueRing
    loc_39E8:
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE2E</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear speed shoes</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    Cont_GotoLevel: <span style="color: #adadad; font-style: italic;">; XREF: Cont_MainLoop</span>
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">l</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE26</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear score</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    Obj80_Main: <span style="color: #adadad; font-style: italic;">; XREF: Obj80_Index</span>
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear rings</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    EndingDemoLoad: <span style="color: #adadad; font-style: italic;">; XREF: Credits</span>
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">l</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE26</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear score</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    Boundary_Bottom:
    <span style="color: #adadad; font-style: italic;">; ...</span>
    <span style="color: #00bfff;">clr</span>.<span style="color: #00bfff;">b</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE30</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear lamppost counter</span>
    resetBlueRing
    <span style="color: #adadad; font-style: italic;">; ...</span>
    KillSonic:
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE08</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; is debug mode active?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> Kill_NoDeath <span style="color: #adadad; font-style: italic;">; if yes, branch</span>
    resetBlueRing</pre><!--gc2--><!--cmVzZXRCbHVlUmluZyBtYWNybwoJCW1vdmUuYgkjMCwoSGFzQmx1ZVJpbmcpCTsgdGFrZSBibHVlIHJp
    bmcgb2ZmCgkJbW92ZS53CSMwLChTYXZlZFJpbmdDb3VudCkKCWVuZG0KOyAuLi4KUGxheUxldmVsOgkJC
    Qk7IFhSRUY6IFJPTTowMDAwMzI0NhhqIC4uLgo7IC4uLgoJCW1vdmUubAlkMCwoJiMwMzY7RkZGRkZFMj
    YpLncgOyBjbGVhciBzY29yZQoJCXJlc2V0Qmx1ZVJpbmcKOyAuLi4KRGVtb19MZXZlbDoKOyAuLi4KCQl
    tb3ZlLmwJZDAsKCYjMDM2O0ZGRkZGRTI2KS53IDsgY2xlYXIgc2NvcmUKCQlyZXNldEJsdWVSaW5nCjsg
    Li4uCkxldmVsX0xvYWRPYmo6CjsgLi4uCgkJbW92ZS5iCWQwLCgmIzAzNjtGRkZGRkUxQikudyA7IGNsZ
    WFyIGxpdmVzIGNvdW50ZXIKCQlyZXNldEJsdWVSaW5nCmxvY18zOUU4Ogo7IC4uLgoJCW1vdmUuYglkMC
    woJiMwMzY7RkZGRkZFMkUpLncgOyBjbGVhciBzcGVlZCBzaG9lcwoJCXJlc2V0Qmx1ZVJpbmcKOyAuLi4
    KQ29udF9Hb3RvTGV2ZWw6CQkJCTsgWFJFRjogQ29udF9NYWluTG9vcAo7IC4uLgoJCW1vdmUubAlkMCwo
    JiMwMzY7RkZGRkZFMjYpLncgOyBjbGVhciBzY29yZQoJCXJlc2V0Qmx1ZVJpbmcKOyAuLi4KT2JqODBfT
    WFpbjoJCQkJOyBYUkVGOiBPYmo4MF9JbmRleAo7IC4uLgoJCW1vdmUudwkjMCwoJiMwMzY7RkZGRkZFMj
    ApLncgOyBjbGVhciByaW5ncwoJCXJlc2V0Qmx1ZVJpbmcKOyAuLi4KRW5kaW5nRGVtb0xvYWQ6CQkJCTs
    gWFJFRjogQ3JlZGl0cwo7IC4uLgoJCW1vdmUubAlkMCwoJiMwMzY7RkZGRkZFMjYpLncgOyBjbGVhciBz
    Y29yZQoJCXJlc2V0Qmx1ZVJpbmcKOyAuLi4KQm91bmRhcnlfQm90dG9tOgo7IC4uLgoJCWNsci5iCSgmI
    zAzNjtGRkZGRkUzMCkudwk7IGNsZWFyCWxhbXBwb3N0IGNvdW50ZXIKCQlyZXNldEJsdWVSaW5nCjsgLi
    4uCktpbGxTb25pYzoKCQl0c3QudwkoJiMwMzY7RkZGRkZFMDgpLncJOyBpcyBkZWJ1ZyBtb2RlCWFjdGl
    2ZT8KCQlibmUucwlLaWxsX05vRGVhdGgJOyBpZiB5ZXMsIGJyYW5jaAoJCXJlc2V0Qmx1ZVJpbmc=--><!--egc2--><!--g2--></div><!--eg2-->

    If some of these are unnecessary, please let me know.

    Okay now here's where we implement the actual code. First we need to modify the 10-ring monitor to give us a blue ring:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm">Obj2E_ChkRings:
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">6</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; does monitor contain 10 rings?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> Obj2E_ChkS
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span>HasBlueRing<span style="">)</span>
    <span style="color: #00bfff;">rts</span></pre><!--gc2--><!--T2JqMkVfQ2hrUmluZ3M6CgkJY21waS5iCSM2LGQwCQk7IGRvZXMgbW9uaXRvciBjb250YWluIDEwIHJp
    bmdzPwoJCWJuZS5zCU9iajJFX0Noa1MKCQltb3ZlLmIJIzEsKEhhc0JsdWVSaW5nKQoJCXJ0cw==--><!--egc2--><!--g2--></div><!--eg2-->

    Next, when Sonic gets hurt, we coerce the game into thinking he only lost one ring:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">HurtSonic:
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">b</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE2C</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; does Sonic have a shield?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> Hurt_Shield <span style="color: #adadad; font-style: italic;">; if yes, branch</span>
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; does Sonic have any rings?</span>
    <span style="color: #00bfff;">beq</span>.<span style="color: #00bfff;">w</span> Hurt_NoRings <span style="color: #adadad; font-style: italic;">; if not, branch</span>
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">b</span> <span style="">(</span>HasBlueRing<span style="">)</span> <span style="color: #adadad; font-style: italic;">; does Sonic have a blue ring?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> Hurt_Blue <span style="color: #adadad; font-style: italic;">; if yes, branch</span>
    <span style="color: #00bfff;">jmp</span> Hurt_LoseRings
    &nbsp;
    Hurt_Blue:
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span>HasBlueRing<span style="">)</span> <span style="color: #adadad; font-style: italic;">; take it off</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>,<span style="">(</span>SavedRingCount<span style="">)</span> <span style="color: #adadad; font-style: italic;">; save # of rings</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span> <span style="color: #adadad; font-style: italic;">; only one ring at first</span>
    &nbsp;
    Hurt_LoseRings:
    <span style="color: #00bfff;">jsr</span> SingleObjLoad
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> Hurt_Shield
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">37</span></span>,<span style="color: #ff0000;">0</span><span style="">(</span><span style="font-weight:bold;">a1</span><span style="">)</span> <span style="color: #adadad; font-style: italic;">; load bouncing multi rings object</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">8</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>,<span style="color: #ff0000;">8</span><span style="">(</span><span style="font-weight:bold;">a1</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">C</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;">C</span><span style="">(</span><span style="font-weight:bold;">a1</span><span style="">)</span>
    &nbsp;
    Hurt_Shield:</pre><!--gc2--><!--SHVydFNvbmljOgoJCXRzdC5iCSgmIzAzNjtGRkZGRkUyQykudwk7IGRvZXMgU29uaWMgaGF2ZSBhIHNo
    aWVsZD8KCQlibmUucwlIdXJ0X1NoaWVsZAk7IGlmIHllcywgYnJhbmNoCgkJdHN0LncJKCYjMDM2O0ZGR
    kZGRTIwKS53CTsgZG9lcyBTb25pYyBoYXZlIGFueSByaW5ncz8KCQliZXEudwlIdXJ0X05vUmluZ3MJOy
    BpZiBub3QsIGJyYW5jaAoJCXRzdC5iCShIYXNCbHVlUmluZykJOyBkb2VzIFNvbmljIGhhdmUgYSBibHV
    lIHJpbmc/CgkJYm5lLnMJSHVydF9CbHVlCTsgaWYgeWVzLCBicmFuY2gKCQlqbXAJCUh1cnRfTG9zZVJpbmdzCgpI
    dXJ0X0JsdWU6CgkJbW92ZS5iCSMwLChIYXNCbHVlUmluZykJCTsgdGFrZSBpdCBvZmYKCQltb3ZlLncJK
    CYjMDM2O0ZGRkZGRTIwKSwoU2F2ZWRSaW5nQ291bnQpCTsgc2F2ZSAjIG9mIHJpbmdzCgkJbW92ZS53CS
    MxLCgmIzAzNjtGRkZGRkUyMCkJCQk7IG9ubHkgb25lIHJpbmcgYXQgZmlyc3QKCkh1cnRfTG9zZVJpbmd
    zOgoJCWpzcglTaW5nbGVPYmpMb2FkCgkJYm5lLnMJSHVydF9TaGllbGQKCQltb3ZlLmIJIyYjMDM2OzM3
    LDAoYTEpCTsgbG9hZCBib3VuY2luZwltdWx0aSByaW5ncyBvYmplY3QKCQltb3ZlLncJOChhMCksOChhM
    SkKCQltb3ZlLncJJiMwMzY7QyhhMCksJiMwMzY7QyhhMSkKCkh1cnRfU2hpZWxkOg==--><!--egc2--><!--g2--></div><!--eg2-->

    Now we are going to change the bouncing multi-rings object. If the single ring that fell was collected, give the player back all his rings and take out the blue ring:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">Obj37_Collect: <span style="color: #adadad; font-style: italic;">; XREF: Obj37_Index</span>
    <span style="color: #00bfff;">addq</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">2</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">24</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">20</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">18</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">w</span> <span style="">(</span>SavedRingCount<span style="">)</span> <span style="color: #adadad; font-style: italic;">; do we have saved rings?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">w</span> RecollectRings <span style="color: #adadad; font-style: italic;">; if so, recollect the rings</span>
    <span style="color: #00bfff;">bsr</span>.<span style="color: #00bfff;">w</span> CollectRing
    <span style="color: #00bfff;">bra</span>.<span style="color: #00bfff;">w</span> Obj37_Sparkle
    &nbsp;
    RecollectRings:
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span>SavedRingCount<span style="">)</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>
    <span style="color: #00bfff;">ori</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE1D</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; update the rings counter</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">B5</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; play ring sound</span>
    <span style="color: #00bfff;">jsr</span> Obj25_PlaySnd
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span>SavedRingCount<span style="">)</span>
    &nbsp;
    Obj37_Sparkle: <span style="color: #adadad; font-style: italic;">; XREF: Obj37_Index</span></pre><!--gc2--><!--T2JqMzdfQ29sbGVjdDoJCQkJOyBYUkVGOiBPYmozN19JbmRleAoJCWFkZHEuYgkjMiwmIzAzNjsyNChh
    MCkKCQltb3ZlLmIJIzAsJiMwMzY7MjAoYTApCgkJbW92ZS5iCSMxLCYjMDM2OzE4KGEwKQoJCXRzdC53C
    ShTYXZlZFJpbmdDb3VudCkJOyBkbyB3ZSBoYXZlIHNhdmVkIHJpbmdzPwoJCWJuZS53CVJlY29sbGVjdF
    JpbmdzCQk7IGlmIHNvLCByZWNvbGxlY3QgdGhlIHJpbmdzCgkJYnNyLncJQ29sbGVjdFJpbmcKCQlicmE
    udwlPYmozN19TcGFya2xlIAoKUmVjb2xsZWN0UmluZ3M6CgkJbW92ZS53CShTYXZlZFJpbmdDb3VudCks
    KCYjMDM2O0ZGRkZGRTIwKQoJCW9yaS5iCSMxLCgmIzAzNjtGRkZGRkUxRCkudyA7IHVwZGF0ZSB0aGUgc
    mluZ3MgY291bnRlcgoJCW1vdmUudwkjJiMwMzY7QjUsZDAJCTsgcGxheSByaW5nIHNvdW5kCgkJanNyCQ
    lPYmoyNV9QbGF5U25kCgkJbW92ZS53CSMwLChTYXZlZFJpbmdDb3VudCkKCk9iajM3X1NwYXJrbGU6CQk
    JCTsgWFJFRjogT2JqMzdfSW5kZXg=--><!--egc2--><!--g2--></div><!--eg2-->

    But if the player failed to collect the ring before the game thinks that ring should be destroyed, we have to respawn the old rings and take out the blue ring:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">Obj37_Delete: <span style="color: #adadad; font-style: italic;">; XREF: Obj37_Index</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF72E</span><span style="">)</span>.<span style="color: #00bfff;">w</span>,<span style="font-weight:bold;">d0</span>
    <span style="color: #00bfff;">addi</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">E0</span>,<span style="font-weight:bold;">d0</span>
    <span style="color: #00bfff;">cmp</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">C</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; has object moved below level boundary?</span>
    <span style="color: #00bfff;">bcs</span>.<span style="color: #00bfff;">s</span> Obj37_DoDelete <span style="color: #adadad; font-style: italic;">; if yes, don't bother regenerating those rings</span>
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">w</span> <span style="">(</span>SavedRingCount<span style="">)</span> <span style="color: #adadad; font-style: italic;">; did we save rings?</span>
    <span style="color: #00bfff;">beq</span>.<span style="color: #00bfff;">w</span> Obj37_DoDelete <span style="color: #adadad; font-style: italic;">; nope (or these are regenerated)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span>SavedRingCount<span style="">)</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span> <span style="color: #adadad; font-style: italic;">; generate</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span>SavedRingCount<span style="">)</span> <span style="color: #adadad; font-style: italic;">; kill those rings!</span>
    <span style="color: #00bfff;">jsr</span> HurtSonic
    &nbsp;
    Obj37_DoDelete:
    <span style="color: #00bfff;">bra</span>.<span style="color: #00bfff;">w</span> DeleteObject</pre><!--gc2--><!--T2JqMzdfRGVsZXRlOgkJCQk7IFhSRUY6IE9iajM3X0luZGV4CgkJbW92ZS53CSgmIzAzNjtGRkZGRjcy
    RSkudyxkMAoJCWFkZGkudwkjJiMwMzY7RTAsZDAKCQljbXAudwkmIzAzNjtDKGEwKSxkMAk7IGhhcyBvY
    mplY3QgbW92ZWQgYmVsb3cgbGV2ZWwgYm91bmRhcnk/CgkJYmNzLnMJT2JqMzdfRG9EZWxldGUJOyBpZiB5ZXMsIGRvbiYjMzk7dCBib3RoZXIgcmVnZW5lcmF0
    aW5nIHRob3NlIHJpbmdzCgkJdHN0LncJKFNhdmVkUmluZ0NvdW50KQk7IGRpZCB3ZSBzYXZlIHJpbmdzP
    woJCWJlcS53CU9iajM3X0RvRGVsZXRlCQk7IG5vcGUgKG9yIHRoZXNlIGFyZSByZWdlbmVyYXRlZCkKCQ
    ltb3ZlLncJKFNhdmVkUmluZ0NvdW50KSwoJiMwMzY7RkZGRkZFMjApCTsgZ2VuZXJhdGUKCQltb3ZlLnc
    JIzAsKFNhdmVkUmluZ0NvdW50KQkJOyBraWxsIHRob3NlIHJpbmdzJiMzMzsKCQlqc3IJCUh1cnRTb25p
    YwoKT2JqMzdfRG9EZWxldGU6CgkJYnJhLncJRGVsZXRlT2JqZWN0--><!--egc2--><!--g2--></div><!--eg2-->

    The work to respawn the rings is left to HurtSonic. Sonic's hurt animation doesn't load because he didn't touch an enemy or spikes.

    So that's it.
     
  3. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    <a href="http://www.pu7o.org/stuff/s1neckles.bin" target="_blank">Sonineckles</a>, literally just Knuckles slapped in Sonineko. With full permission by nineko, I might add - like Marc, I'm against the idea of hacking other people's hacks without getting permission.
     
  4. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    <a href="http://idisk.mac.com/pietro10-Public/wtfmod.zip" target="_blank">A small update to WTF Lame</a> which modifies what the game does on reset. In the original, you could reset to avoid reading the tl;dr. In this modification, if you reset during a tl;dr, you get another. Source code included.

    Idea: when the Reset button is hit, nothing gets reinitialized, so both Port A and Port C are okay. (I added another check before the first RAM clear, just in case.) Note: by reset I mean hitting the reset button ("soft reset"), not the hard reset of some emulators.
     
  5. snkenjoi

    snkenjoi

    Tech Member
    85
    0
    0
    <a href="http://snk.digibase.ca/hacks/s2headache.bin" target="_blank">Sonic 2 Headache</a>

    <a href="http://snk.digibase.ca/hacks/tiny.bin" target="_blank">tiny.bin</a> - <a href="http://gendev.spritesmind.net/forum/viewtopic.php?t=594" target="_blank">(spritesmind thread)</a>
     
  6. <!--quoteo(post=339011:date=Aug 9 2009, 07:38 AM:name=snkenjoi)--><div class='quotetop'>QUOTE (snkenjoi @ Aug 9 2009, 07:38 AM) <a href="index.php?act=findpost&pid=339011"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><a href="http://snk.digibase.ca/hacks/s2headache.bin" target="_blank">Sonic 2 Headache</a>

    <a href="http://snk.digibase.ca/hacks/tiny.bin" target="_blank">tiny.bin</a> - <a href="http://gendev.spritesmind.net/forum/viewtopic.php?t=594" target="_blank">(spritesmind thread)</a><!--QuoteEnd--></div><!--QuoteEEnd-->
    DAMN. Sonic 2 Headache....uggggg *holds head in pain.

    Also tiny.bin gives me a blue screen.
     
  7. Overlord

    Overlord

    ...did we just switch realities? Moderator
    17,581
    68
    28
    Berkshire, England
    Learning Cymraeg
    Me too, on tiny.bin.

    The other rom - ahahahahaah! That's the most challenge EHZ has given me in YEARS =P
     
  8. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    <!--quoteo(post=339011:date=Aug 9 2009, 08:38 AM:name=snkenjoi)--><div class='quotetop'>QUOTE (snkenjoi @ Aug 9 2009, 08:38 AM) <a href="index.php?act=findpost&pid=339011"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><a href="http://snk.digibase.ca/hacks/s2headache.bin" target="_blank">Sonic 2 Headache</a><!--QuoteEnd--></div><!--QuoteEEnd-->FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

    That said, it's sad that I could beat the first boss without getting hurt despite the camera being like that :psyduck:
     
  9. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,373
    43
    28
    SonLVL
    Here's a truly Random Hack: <a href="http://sharebee.com/a46ec4e6" target="_blank">Not-so-Super Sonic the Hedgehog 2</a>!

    Features:
    Start as Super Sonic/Tails without invincibility or ring drain.
    Level select and debug always enabled. (Hold A for level select)

    Zones:
    Straight Line Zone
    Hidden Palace Zone (S3K) (Access through level select)

    Updates are extremely unlikely.

    Edit: Video of <a href="http://www.youtube.com/watch?v=SqtjLxOtIm8" target="_blank">Straight Line Zone Act 1</a>.
     
  10. GT Koopa

    GT Koopa

    Member
    1,999
    0
    16
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    <img src="http://i2.photobucket.com/albums/y39/galapagosturtle/alt/lblayout.png" border="0" class="linked-image" />

    <a href="http://209.85.62.24/175/17/0/p210486/GTtest.bin" target="_blank">Link</a>

    This is my test hack of Sonic 1. I use it for random stuff, mainly for testing. Right now, use level select to go to Labyrinth Zone act 3, as I worked on a short layout today that might be interesting for you guys. I am already aware of the problems and glitches, mainly due to the labyrinth zone act 3 specific events, which I have to figure out how to disable. Tell me if you like it or not.
     
  11. Spanner

    Spanner

    The Tool Member
    3,250
    44
    28
    United Kingdom
    Sonic Hacking Contest
    <a href="http://blueballs.ath.cx/hacks/s2lolz.rar" target="_blank">"Sonic and Friends"</a>
    My submission for the hacking contest and like <a href="http://blueballs.ath.cx/hacks/Sonic%201%20-%20Penis%20Special%20Stage.zip" target="_blank">Penis Special Stage</a> which I submitted in 2008, was created on the day before submissions ended.
    <I>I will warn you, <b>this is NSFW</b> and it's a joke hack. Regardless, enjoy! Thanks to Marc for his splash screen system that he made months ago.</I>
     
  12. Enzo Aquarius

    Enzo Aquarius

    20% Cooler. Member
    1,420
    0
    0
    Canada, eh.
    Sonic TV Scripts, Sonic Comic Wiki Work
    <!--quoteo(post=346112:date=Sep 1 2009, 05:13 PM:name=SOTI)--><div class='quotetop'>QUOTE (SOTI @ Sep 1 2009, 05:13 PM) <a href="index.php?act=findpost&pid=346112"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><a href="http://blueballs.ath.cx/hacks/s2lolz.rar" target="_blank">"Sonic and Friends"</a>
    My submission for the hacking contest and like <a href="http://blueballs.ath.cx/hacks/Sonic%201%20-%20Penis%20Special%20Stage.zip" target="_blank">Penis Special Stage</a> which I submitted in 2008, was created on the day before submissions ended.
    <I>I will warn you, <b>this is NSFW</b> and it's a joke hack. Regardless, enjoy! Thanks to Marc for his splash screen system that he made months ago.</I><!--QuoteEnd--></div><!--QuoteEEnd-->

    Holy crap. :psyduck: I think that's a definite win for the Shadow Award.
     
  13. GT Koopa

    GT Koopa

    Member
    1,999
    0
    16
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    <a href="http://209.85.62.24/175/17/0/p211688/totemGHZbossedit.bin" target="_blank">Do you dare face the Terrible Totem?</a>
     
  14. Overlord

    Overlord

    ...did we just switch realities? Moderator
    17,581
    68
    28
    Berkshire, England
    Learning Cymraeg
    The biggest pisser about that boss is the floor. =P Took me 3 tries to finally kill the thing!
     
  15. GT Koopa

    GT Koopa

    Member
    1,999
    0
    16
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    LOL tips which you shouldn't read yet if you want to try it on your own first:
    <span style='color:#000000;background:#000000'>You can stand on the middle part of the totem and not get hit, unless you move of course. Since this is the danger zone of the original GHZ boss, first time players will naturally hide below it where they have no time to react to Robotnik's sudden change of habit. Hiding in the top part of the totem can get a free hit on robotnik as he comes back into the arena, however you need to get out fast as the wrecking ball will soon close in, dangerous if you accidently get knocked into there. The floor idea I surprisingly haven't seen from any released hacks to my knowledge, and I used a similar concept as a arena in my test hack linked above. I like the one I made here better, of course.</span>

    ---
    Anyway, here is the finished layout for the labyrinth zone edit above. It is a tiny bit old since I have already switched a few chunks around, but the path structure is still intact.
    <img src="http://i2.photobucket.com/albums/y39/galapagosturtle/alt/LevelMapGTlab.png" border="0" class="linked-image" />

    Anyway, I also figured out how to get rid of the Labyrinth Zone specific codes, including the water. However side effects include accidently deleting the boss load up code. Also, I am still having a problem with slopes, as 45 degrees plus horizontal = stuck and glitch through. Putting object blocks underneath just switches the problem in reverse. I would like to know how to fix THAT. Also having problems with switches. I figured out the whole numbering system and how setting the "door" with the same number activates the switch, but it has a wierd range, ie it can't be a certain distance away or else it won't work. Something which is bad since I made the whole layout already thinking the switches could be far away and still work. But what IS that range?
     
  16. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,373
    43
    28
    SonLVL
    My best guess would be that the door has to be loaded in RAM when you hit the switch. So 1 1/2, maybe 2 screens?
     
  17. nineko

    nineko

    I am the Holy Cat Tech Member
    The glitch with 45° slopes has been fixed only in Sonic CD, afaik.
     
  18. FraGag

    FraGag

    Tech Member
    <a href="http://www.fileden.com/files/2008/5/25/1929849/sonic1-rotatingmonitors.bin" target="_blank">Sonic 1 with rotating monitors</a> (I.e. the item a monitor gives you changes every so often, like in <a href="http://forums.sonicretro.org/index.php?showtopic=17414" target="_blank">those prototype videos</a>). Also, I actually implemented the Eggman monitor, for a bit of challenge :P . Also, if you have time, play through the whole game, and see if you miss a few power-ups you usually rely on (invincibility, super sneakers...) :) .
     
  19. The Prof

    The Prof

    The Island Professor Member
    107
    0
    16
    Orkney, Scotland
    Sonic 1 Yarmar Edition
    Well done. It's surprisingly different to normal S1 even though very little was changed. I was actually just working on that so now I'll have to add a new twist to it.
     
  20. GT Koopa

    GT Koopa

    Member
    1,999
    0
    16
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    <img src="http://i2.photobucket.com/albums/y39/galapagosturtle/alt/labtube.png" border="0" class="linked-image" />
    Labyrinth Zone act 3 layout is finished and completable.

    <a href="http://209.85.62.24/175/17/0/p221069/Labzoneact3.bin" target="_blank">Get the updated rom here.</a> Use level select to access it of course.

    I urge you all to run through it, time attack it, etc. As an added exploration bonus, <I>can you find and destroy all the 1up monitors?</I>
    <span style='color:#000000;background:#000000'>There is a total of 4 1ups in the act. It is possible to get them all and still complete the act in under 10 minutes, so getting them all in one go is...well, "S ranking" the mission.</span>


    I will take what I learned from making this layout and expand and refine it for future hacks.