don't click here

Sonic ERaZor source code (and everything else)

Discussion in 'Engineering & Reverse Engineering' started by Selbi, Mar 30, 2023.

  1. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,487
    1,820
    93
    your mom
    A lot of what I learned in the past almost 10 years (!) when it came to Sonic hacking and Genesis/CD development came from either studying other people's code that was public or at least seeing an in-depth explanation/breakdown of how something worked, and then learning how I could apply that stuff in other situations. Over the past few years, I have made a bunch of things open source (shameless plug), including old hacks, demonstrations of different effects, and other stuff. Even if the quality of the code isn't the best, I figured that someone else may find some good use from them.

    So yeah, I'm all in favor of open sourcing stuff for others to look at and study. As far as originality goes, well, in my opinion, it's all part just of the learning experience and finding yourself.
     


  2. Redhotsonic just covered this in But Does it Work on Real Hardware?, and in it he found a strange bug where if the game is being played without SRAM, it breaks when it reaches the text screens. Looking at the source code, apparently the game uses SRAM to set the RAM value that determines what text box it should use (not sure why we don't just use the text box RAM itself); as a result, without SRAM, it can't find that value and tries to load garbage data, causing the game to eventually freeze.

    So, fair warning to anyone playing this game on hardware with carts lacking batteries.
    Code (Text):
    1. CS_ClrObjRam:
    2.         move.l    d0,(a1)+
    3.         dbf    d1,CS_ClrObjRam
    4.  
    5.         move.b    #1,($A130F1).l            ; enable SRAM
    6.         move.b    ($200001).l,($FFFFFFA0).w    ; get current chaper number
    7.         bpl.s    @cont
    8.         move.b    #0,($FFFFFFA0).w
    9.  
    10. @cont:
    11.         move.b    #0,($A130F1).l            ; disable SRAM
    12.  
    13.         cmpi.w    #$501,($FFFFFE10).w
    14.         beq.s    @contGHZ
     
  3. Selbi

    Selbi

    The Euphonic Mess Member
    1,524
    131
    43
    Northern Germany
    Sonic ERaZor
    That's most certainly the work of teenage me circa 2011 not knowing what the hell I was doing. Gah. Kinda surprised nobody has ever brought this up to me, even after over a decade.

    I've made a small poll on YouTube asking whether or not I should be working on another bugfix release after all and I would appreciate you guys taking a minute to vote: https://www.youtube.com/post/UgkxveW8rOVkeKwuQUlqYBq8KOgavWU90ruI