don't click here

Random Hack/Mini Project Thread

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

  1. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,231
    968
    93
    Long-term happiness
    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
    1
    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.

    Code (ASM):
    1. ; Variables for maintaining the new features
    2. HasBlueRing equ $FFFFFFFC       ; byte
    3. SavedRingCount equ $FFFFFFFD        ; word
    I use a macro to reset these variables whenever a level is loaded:

    Code (ASM):
    1. resetBlueRing macro
    2.         move.b  #0,(HasBlueRing)    ; take blue ring off
    3.         move.w  #0,(SavedRingCount)
    4.     endm
    5. ; ...
    6. PlayLevel:              ; XREF: ROM:00003246j ...
    7. ; ...
    8.         move.l  d0,($FFFFFE26).w ; clear score
    9.         resetBlueRing
    10. ; ...
    11. Demo_Level:
    12. ; ...
    13.         move.l  d0,($FFFFFE26).w ; clear score
    14.         resetBlueRing
    15. ; ...
    16. Level_LoadObj:
    17. ; ...
    18.         move.b  d0,($FFFFFE1B).w ; clear lives counter
    19.         resetBlueRing
    20. loc_39E8:
    21. ; ...
    22.         move.b  d0,($FFFFFE2E).w ; clear speed shoes
    23.         resetBlueRing
    24. ; ...
    25. Cont_GotoLevel:             ; XREF: Cont_MainLoop
    26. ; ...
    27.         move.l  d0,($FFFFFE26).w ; clear score
    28.         resetBlueRing
    29. ; ...
    30. Obj80_Main:             ; XREF: Obj80_Index
    31. ; ...
    32.         move.w  #0,($FFFFFE20).w ; clear rings
    33.         resetBlueRing
    34. ; ...
    35. EndingDemoLoad:             ; XREF: Credits
    36. ; ...
    37.         move.l  d0,($FFFFFE26).w ; clear score
    38.         resetBlueRing
    39. ; ...
    40. Boundary_Bottom:
    41. ; ...
    42.         clr.b   ($FFFFFE30).w   ; clear lamppost counter
    43.         resetBlueRing
    44. ; ...
    45. KillSonic:
    46.         tst.w   ($FFFFFE08).w   ; is debug mode active?
    47.         bne.s   Kill_NoDeath    ; if yes, branch
    48.         resetBlueRing
    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:

    Code (ASM):
    1. Obj2E_ChkRings:
    2.         cmpi.b  #6,d0       ; does monitor contain 10 rings?
    3.         bne.s   Obj2E_ChkS
    4.         move.b  #1,(HasBlueRing)
    5.         rts
    Next, when Sonic gets hurt, we coerce the game into thinking he only lost one ring:

    Code (ASM):
    1. HurtSonic:
    2.         tst.b   ($FFFFFE2C).w   ; does Sonic have a shield?
    3.         bne.s   Hurt_Shield ; if yes, branch
    4.         tst.w   ($FFFFFE20).w   ; does Sonic have any rings?
    5.         beq.w   Hurt_NoRings    ; if not, branch
    6.         tst.b   (HasBlueRing)   ; does Sonic have a blue ring?
    7.         bne.s   Hurt_Blue   ; if yes, branch
    8.         jmp     Hurt_LoseRings
    9.  
    10. Hurt_Blue:
    11.         move.b  #0,(HasBlueRing)        ; take it off
    12.         move.w  ($FFFFFE20),(SavedRingCount)    ; save # of rings
    13.         move.w  #1,($FFFFFE20)          ; only one ring at first
    14.  
    15. Hurt_LoseRings:
    16.         jsr SingleObjLoad
    17.         bne.s   Hurt_Shield
    18.         move.b  #$37,0(a1)  ; load bouncing multi rings object
    19.         move.w  8(a0),8(a1)
    20.         move.w  $C(a0),$C(a1)
    21.  
    22. Hurt_Shield:
    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:

    Code (ASM):
    1. Obj37_Collect:              ; XREF: Obj37_Index
    2.         addq.b  #2,$24(a0)
    3.         move.b  #0,$20(a0)
    4.         move.b  #1,$18(a0)
    5.         tst.w   (SavedRingCount)    ; do we have saved rings?
    6.         bne.w   RecollectRings      ; if so, recollect the rings
    7.         bsr.w   CollectRing
    8.         bra.w   Obj37_Sparkle
    9.  
    10. RecollectRings:
    11.         move.w  (SavedRingCount),($FFFFFE20)
    12.         ori.b   #1,($FFFFFE1D).w ; update the rings counter
    13.         move.w  #$B5,d0     ; play ring sound
    14.         jsr     Obj25_PlaySnd
    15.         move.w  #0,(SavedRingCount)
    16.  
    17. Obj37_Sparkle:              ; XREF: Obj37_Index
    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:

    Code (ASM):
    1. Obj37_Delete:               ; XREF: Obj37_Index
    2.         move.w  ($FFFFF72E).w,d0
    3.         addi.w  #$E0,d0
    4.         cmp.w   $C(a0),d0   ; has object moved below level boundary?
    5.         bcs.s   Obj37_DoDelete  ; if yes, don't bother regenerating those rings
    6.         tst.w   (SavedRingCount)    ; did we save rings?
    7.         beq.w   Obj37_DoDelete      ; nope (or these are regenerated)
    8.         move.w  (SavedRingCount),($FFFFFE20)    ; generate
    9.         move.w  #0,(SavedRingCount)     ; kill those rings!
    10.         jsr     HurtSonic
    11.  
    12. Obj37_DoDelete:
    13.         bra.w   DeleteObject
    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.
    Sonineckles, 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
    1
    0
    Writing my own MD/Genesis sound driver :D
    A small update to WTF Lame 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
    89
    7
    8
  6. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,231
    968
    93
    Long-term happiness
    Me too, on tiny.bin.

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

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

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

    MainMemory

    Kate the Wolf Tech Member
    4,741
    338
    63
    SonLVL
    Here's a truly Random Hack: Not-so-Super Sonic the Hedgehog 2!

    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 Straight Line Zone Act 1.
     
  9. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    [​IMG]

    Link

    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.
     
  10. Spanner

    Spanner

    The Tool Member
    "Sonic and Friends"
    My submission for the hacking contest and like Penis Special Stage which I submitted in 2008, was created on the day before submissions ended.
    I will warn you, this is NSFW and it's a joke hack. Regardless, enjoy! Thanks to Marc for his splash screen system that he made months ago.
     
  11. Enzo Aquarius

    Enzo Aquarius

    20% Cooler. Member
    1,420
    0
    0
    Canada, eh.
    Sonic TV Scripts, Sonic Comic Wiki Work
    Holy crap. :psyduck: I think that's a definite win for the Shadow Award.
     
  12. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
  13. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,231
    968
    93
    Long-term happiness
    The biggest pisser about that boss is the floor. =P Took me 3 tries to finally kill the thing!
     
  14. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    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:
    + - 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.  

    ---
    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]

    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?
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,741
    338
    63
    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?
     
  16. nineko

    nineko

    I am the Holy Cat Tech Member
    6,305
    481
    63
    italy
    The glitch with 45° slopes has been fixed only in Sonic CD, afaik.
     
  17. FraGag

    FraGag

    Tech Member
    Sonic 1 with rotating monitors (I.e. the item a monitor gives you changes every so often, like in those prototype videos). 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...) :) .
     
  18. 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.
     
  19. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    [​IMG]
    Labyrinth Zone act 3 layout is finished and completable.

    Get the updated rom here. 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, can you find and destroy all the 1up monitors?
    + - 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.  


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