How to change the Level-Select Cheat

Discussion in 'Approved' started by Selbi, Jul 21, 2008.

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

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    How-to change the Level-Select Cheat


    Mirror: http://sonicsanctuary.digibase.ca/index.php?showtopic=183


    The Code for the D-Pad:


    You know: If you press Up, Down, Left, Right, A+Start you will come to the Level Select. But if you've created a hack, where the people shouldn't use the Level Select, you can change it.


    To do that, go to the misc folder in your Split Disassembly and open ls_jcode.bin and ls_ucode.bin with a Hex-Editor. You should see this (in both files):



    Code:
    01 02 04 08  00 FF


    Ok, let me explain this: The 00 FF are just bytes for the level select code which needs to be there to get the code to work, don't change them. The first 4 bytes are to be used for the Level-Select Code. So you can see, what it means:




    So let's say, we want type '''Left, Right, Left, Right'''. The code should look like this:





    Code:
    04 08 04 08  00 FF


    That's all. Save the files and build your ROM. And try: Left, Right, Left and Right. *kling* If you hear the ring sound, you made everything correct. So press A+Start and you should see the Level Select. Have fun!





    Longer / shorter Level Select codes:



    It's also possible to create Level Select codes with more or less than 4 inputs. To do this just put some Bytes before the ''00 FF'' in. For example, if you want to type "Up, up, down, down, left, right, left and right" you should have this:





    Code:
    01 01 02 02  04 08 04 08  00 FF


    And if you want to type things like "Up and Down" you should have this:





    Code:
    01 02 00 FF




    Changing the A+Start system:



    You can also edit the A+Start system. To do this open sonic1.asm and go to "Title_ChkLevSel:". You shold see this:



    Title_ChkLevSel:

    tst.b ($FFFFFFE0).w ; check if level select code is on

    beq.w PlayLevel ; if not, play level

    -> btst #6,($FFFFF604).w ; check if A is pressed

    beq.w PlayLevel ; if not, play level


    There are many ways to edit this. But I will just show you how to replace A with something else.

    Here is a list with some possibilities:




    Code:
    ; A Button =
    
    		btst	#6,($FFFFF604).w
    
    
    
    ; B Button =  
    
    		btst	#4,($FFFFF604).w
    
    
    
    ; C Button =  
    
    		btst	#5,($FFFFF604).w
    
    
    
    ________________________
    
    
    
    ; Up Button =  
    
    		btst	#0,($FFFFF604).w
    
    
    
    ; Down Button =  
    
    		btst	#1,($FFFFF604).w
    
    
    
    ________________________
    
    
    
    ; Start Button =  
    
    		btst	#7,($FFFFF604).w
    
    
    
    ________________________
    
    
    
    ; A, B, C or Start =  
    
    		move.b	($FFFFF605).w,d0
    
    		and.b	#$F0,d0
    
    So, if you want to replace the A with B now, you should have this:




    Code:
    Title_ChkLevSel:
    
    		tst.b	($FFFFFFE0).w	; check	if level select	code is	on
    
    		beq.w	PlayLevel	; if not, play level
    
            	btst	#4,($FFFFF604).w ; check if B is pressed
    
    		beq.w	PlayLevel	; if not, play level
    
    Disable the Level Select



    If you want to disable the Level Select Cheat, then open "sonic1.asm" and go to "Title_ChkLevSel:" again. Replace the second line:




    Code:
    		beq.w	PlayLevel	; if not, play level
    
    With this:


    Code:
    		bra	PlayLevel	; branch always, play level
    
    Now try to enter the Level Select Cheat, but it won't show up. So, congratulations.



    If you also want to disable the ring sound, simply go to "Title_PlayRing:" and comment these 2 lines out:


    Code:
    		move.b	#$B5,d0		; play ring sound when code is entered
    
    		bsr.w	PlaySound_Special
    
    Now it should work.





    Disable the Level Select for Game Genie cheaters



    Even you are doing the last step, there are still a lot of people, who are using the Game Genie code AJ3A-AA4G. They can use the Level Select without typing in the code, even you disabled it! However, there is another way to disable the Level Select, also for cheaters. Here I will tell you how to do it:



    Open the file misc\ls_point.bin with your Hex-Editor. It's unnecesarry, what you see. Just replace everything with 00.



    What is this doing? It's pretty much self explaining, but if you don't know, what this means, don't worry, I'll tell you:

    These are the Level Select Pointers. Each pointer has 2 bytes, which tells you, where to go when selecting a Level. The first byte is for the Zone:





    Code:
    00 = GHZ
    
    01 = LZ
    
    02 = MZ
    
    03 = SLZ
    
    04 = SYZ
    
    05 = SBZ


    The second byte tells us the Act:





    Code:
    00 = Act 1
    
    01 = Act 2
    
    02 = Act 3
    
    03 = Act 4 (this is only for SBZ Act 3 (aka. LZ Act 4))

    What my code does: Every time you are picking a Level, you will always come to GHZ Act 1, and this is actually useless for cheaters.


    I hope, this will help you a bit and explains you the Level Select engine a bit! ;)


    Credits:


    Me (Selbi): Writing the Guide and the entire coding


    shobiz: For telling me the A+Start section and the A, B, C or Start thing


    Last cleanup:


    15th August 2009
     
    Last edited by a moderator: Aug 15, 2009
  2. Sephiroth

    Sephiroth WHY SO CURIOUS?!? Member

    Joined:
    Aug 11, 2007
    Messages:
    507
    Location:
    Qatar, M.E.
    Nice work, although it is common knowledge and easy enough to figure out without the use of a guide.
     
  3. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I know! But there are maybe some people, who don´t know this!
     
  4. sonic

    sonic Well-Known Member Member

    Joined:
    Mar 27, 2008
    Messages:
    62
    Location:
    Michigan
    I didn't know how to do it. Good job!
     
  5. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Tutorials are my best Skills!^^
     
  6. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    You might want to add how to disable the cheat?


    Plus, what would happen if you put a different number in? Say, 01, 02, 04, 05? =P
     
  7. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I didn´t try it!
     
  8. GasparXR

    GasparXR Rides the metal monster Member

    Joined:
    Aug 10, 2007
    Messages:
    84
    Location:
    Ontario, Canada
    Are the 00 FF A+Start, or are they just bytes that need to be there for the code to work? I was hoping there would be a way to change the A+Start as well.
     
  9. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    They're just bytes which need to be there for the code to work, but the A+Start part is this:



    Code:
    loc_3230:
    
    		tst.w	($FFFFF614).w
    
    		beq.w	Demo
    
    		andi.b	#$80,($FFFFF605).w&#59; check if Start is pressed
    
    		beq.w	loc_317C&#59; if not, branch
    
    
    
    Title_ChkLevSel:
    
    		tst.b	($FFFFFFE0).w&#59; check	if level select	code is	on
    
    		beq.w	PlayLevel&#59; if not, play level
    
    		btst	#6,($FFFFF604).w&#59; check if A is pressed
    
    		beq.w	PlayLevel&#59; if not, play level
     
  10. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Update: I added a "A+Start" part. Hope this helps! :p
     
  11. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    It's not really a good idea to AND that RAM variable directly, you're better off moving it to a register first.
     
  12. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Oh, then you should use:



    Code:
    		move.b	#$F0,($FFFFF605).w&#59; is	A, B, C, or Start pressed?

    Well, I've never heard about the andi comment! What does the i means?
     
  13. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    No, you need to use



    Code:
    		move.b	($FFFFF605).w,d0; is	A, B, C, or Start pressed?
    
    		and.b	#$F0,d0
    The i stands for immediate, it just means you're ANDing by an immediate value. It isn't necessary to write andi, you can just write and instead (like I've done here), since the assembler is smart enough to switch to the appropriate instruction.
     
    Last edited by a moderator: Dec 21, 2008
  14. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Fixed, but one question: It also works with andi.b and move.b (without and)! Why should I use move.b and and.b?
     
  15. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    Another no brainer guide? : / It's good for people who are too lazy to search for the title screen code and look through it, but....
     
  16. Jami393

    Jami393 Active Member Member

    Joined:
    May 1, 2009
    Messages:
    26
    Thanks for the tutorial, Selbi. I can use it, for when I start my first hack.
     
  17. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    Thanks for the bump, it was much appreciated.


    Note for future use: Thread bumping is only acceptable when the post is relevent and worthwhile, your post was neither of these.
     
  18. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    How about adding this to the rules? (also, split plz)
     
  19. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    thank you this helped me allot!
     
  20. Jami393

    Jami393 Active Member Member

    Joined:
    May 1, 2009
    Messages:
    26
    Thanks for the tutorial Selbi, but I have a question. Is it possible to add A B or C in the level select code, for example up down A C left A and start, something like that.
     
Thread Status:
Not open for further replies.