Monitor help

Discussion in 'Discussion and Q&A Archive' started by CrashSG32, Jan 31, 2012.

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

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    In Sonic 2, I am trying to change to change either the robotnik monitor or the static monitor into the 'S' monitor. I've found a guide online, but when I tried putting it into the asm file, I click find and it can never find this line:


    ; ============== END RELATIVE POINTER LIST ==================================


    ; badnik_monitor:



    robotnik_monitor:



    addq.w #1,(a2)



    jmp Touch_ChkHurt2



    ; ===========================================================================



    First I tried using Notepad, but then I found a free program called HxD to edit the file.


    I'm using the dissasembly from here:


    http://svn.sonicretr...sasm_hg/summary


    I know I probably sound like a noob, but PLEASE HELP!
     
  2. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    ......just look up "robotnik_monitor:".....it should be there. Hell, if you tried pasting that whole code, it probably wouldn't even find it.
     
  3. CrashSG32

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    ^Didn't work. And no, I didn't paste the whole code -.-
     
  4. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    fuck that shit then, use Notepad++. Less of a hassle. I found it by looking it up in under 4 seconds.
     
  5. CrashSG32

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    ^Thanks! That program found it!


    But now I have another problem:


    When I tried using S2LVL to build it and test it, this happened:


    [​IMG]


    Here's what I added in (In the red outline):


    [​IMG]


    Can someone tell me what I'm doing wrong?
     
  6. Ravenfreak

    Ravenfreak Still hacking the 8-bit titles Member

    Joined:
    Feb 10, 2010
    Messages:
    410
    Location:
    O'Fallon, MO
    First off check the log file that has the list of errors and copy/paste it here, so we can see what errors have occured. Also looks like you didn't copy/paste the code in the correct place,


    Code:
    addq.w #1,(a2)
    
    and
    Code:
    bra.w Touch_ChkHurt2
    
    is the specific code for the monitor, and this is where your code belongs. Just for now, copy and paste over those lines and check the log file. :(
     
    Last edited by a moderator: Jan 31, 2012
  7. CrashSG32

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    ^ okay, I'll try to find it when I get back on the computer (I'm using my ipad to write this).


    I think this is it:


    > > >s2.asm(23210): error: unknown opcode


    > > > +


    > > > +


    > > >s2.asm(23212): error: range overflow


    > > > addq.w #32,($FFFFFE20).w; add 50 to rings


    > > >s2.asm(23212): error: operand must be in range 1..8


    > > > addq.w #32,($FFFFFE20).w; add 50 to rings


    > > >s2.asm(23216): error: short addressing not allowed


    > > > move.b #$F,(Palette_frame_count).w


    > > >s2.asm(23216): error: addressing mode not allowed here


    > > > move.b #$F,(Palette_frame_count).w
     
    Last edited by a moderator: Jan 31, 2012
  8. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    All of them seems to be 'out of range' errors. Did you tried to jump the subroutine to another place of the ROM?
     
    Last edited by a moderator: Jan 31, 2012
  9. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Code:
    > > >s2.asm(23210): error: unknown opcode
    
    > > > +
    
    > > > +


    You see the "+" and then your code underneath? The plus is too far to the right, so it doesn't show up as a label. In other words, instead of:





    Code:
    	+
    
    	lea   (Ring_count).w,a2
    
    	addq.w  #$32,(Player_mode).w ; is player Tails?


    Do this:





    Code:
    +
    
    	lea   (Ring_count).w,a2
    
    	addq.w  #$32,(Player_mode).w ; is player Tails?










    Code:
    > > >s2.asm(23212): error: range overflow
    
    > > > addq.w #32,($FFFFFE20).w; add 50 to rings
    
    > > >s2.asm(23212): error: operand must be in range 1..8
    
    > > > addq.w #32,($FFFFFE20).w; add 50 to rings
    
    > > >s2.asm(23216): error: short addressing not allowed


    Put a $ in front of the 32. So instead of #32, you will have #$32











    Code:
    > > > move.b #$F,(Palette_frame_count).w
    
    > > >s2.asm(23216): error: addressing mode not allowed here
    
    > > > move.b #$F,(Palette_frame_count).w


    Not too sure on this one. Can "Palette_frame_count" go as high as F?



    EDIT: A thought occured. Have you made an equate for "Palette_frame_count"? If not, try replacing it with $FFFFF65E. For example, instead of:





    Code:
    move.b  #$F,(Palette_frame_count).w


    Try this:





    Code:
    move.b  #$F,($FFFFF65E).w
     
    Last edited by a moderator: Jan 31, 2012
  10. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    ADDQ and SUBQ only allow numbers 1 to 8. For larger values, use ADDI and SUBI.

    $ sign indicates that number is hexadecimal, it doesn't affect addressing mode used or something. No sign indicates decimal number.


    By putting '$' you will basically get another value, $32, while it used to be 32 = $20. So, it won't help.


    Choosing numeric system doesn't influence on anything, use whichever you like. For example, you can write



    addq.w #32,(68719476256).w



    instead of



    addq.w #32,($FFFFFE20).w



    and it will be the same memory address =P


    RAM locations are easier to present in HEX though.

    I'm not sure about this one, as I don't know much about the AS assembler.


    I've seen how people were getting builds errors everywhere on correct instructions because something went wrong earlier, so it seems AS is vary volatile sometimes, maybe that's the case.


    Anyways, check out the 'Palette_frame_count' constant. Short addressing can only use addresses $0000-$7FFF and $FFFF8000-$FFFFFFFF, other values are not reachable, so the assembler may complain about them.
     
  11. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    You see, I did know aboutt his, but for some strange reason, I had it in my head it would only work for 20 and below, anything above that, you would have to put a $ in front, Where I got that from, I can't remember =P

    I learn something new everyday.
     
  12. CrashSG32

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    Thanks to your help guys, I got it to work! But, it transforms Sonic into Super Sonic, but he's not invincible, and it gives an extra life aswell. How could I make him invincible and stop it giving an extra life?


    Also, how can I change the picture on the monitor to the S?
     
    Last edited by a moderator: Feb 1, 2012
  13. DarkLeach

    DarkLeach Well-Known Member Member

    Joined:
    Jul 3, 2011
    Messages:
    193
    Location:
    In the middle of desert heat
    Comment or remove the code that Gives Sonic a Life (If you're using the 1-up box as a base), it should be a RAM Counter, but I don't know what it is in Sonic 2, and remove or comment the code that plays the 1-up sound as well, don't know why it's not making you invincible (Maybe try copying some things from the Invincibility Box as a Base to help you get started).

    You could do that by copying the tile graphics from the Sonic 1 "monitors.bin" in the "artnem" folder using TLPfixed (after you've decompressed the art into an editable form) ( and I've never been able to edit monitor art in SonMapEd (It pastes it over the first monitor for some reason)) into the corresponding place in the S2 Monitor File (after you've decompressed that art as well) (Don't know what it's called exactly because I haven't hacked Sonic 2 or gone into a Sonic 2 disassembly) and made the proper art edit to make the "S" work with the S2 Pallet. Then recompress that monitor art and build your ROM. This may not be the best way to do that, but that is how I would do it.


    Hope that helped in any way ;)
     
    Last edited by a moderator: Feb 1, 2012
  14. CrashSG32

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    I managed to make him invincible by copying some of the invincible monitor code.


    Now I'm gonna try and fix the extra life problem ;)

    Is there a different/quicker way? Rather than going into Sonic 1 taking it out of there, and all that other stuff.
     
    Last edited by a moderator: Feb 1, 2012
  15. DarkLeach

    DarkLeach Well-Known Member Member

    Joined:
    Jul 3, 2011
    Messages:
    193
    Location:
    In the middle of desert heat
    If you're using the 1-Up Monitor as a base then just comment or remove the code that says Give Sonic an Extra Life, Update the Lives Counter, and the code that plays the 1-up Tune. Comment or remove the lines that are commented below



    Code:
    
    sonic_1up:
    
    ;addq.w #1,(Monitors_Broken).w
    
    ;addq.b #1,(Life_count).w
    
    ;addq.b #1,(Update_HUD_lives).w
    
    ;move.w #MusID_ExtraLife,d0
    
    ;jmp (PlayMusic).l ; Play extra life music
    
    
    
    ;Comment or remove these Commented lines.
    
    

    There may be but to my knowledge this might be the only way, you could ask one of the more experienced members if there is a different way. However to get it the only games that have the "S" Monitors are Sonic 1, Sonic CD, and Sonic 3/Knuckles, You'd have to get art from one of those games, and I believe it would be WAY Easier to port from Sonic 1 because I think Sonic 1 is the easiest of the three to edit. Anyway unless you want to draw it out on your own, this really might be the only way to do it. If you don't feel like doing it I will, just tell me, I'm kind of stuck on what to do in my hack right now, So I'd be happy to help :)

    [/CODE]
     
    Last edited by a moderator: Feb 1, 2012
  16. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    You can get it from a spritesheet and rip it and save it as the S monitor or whatever. Then import it over the desired icon into SonMapED. Or you could open up the monitors.bin in SonMapED from the Sonic 1 Disassembly, open the maps(obj26.asm in _maps folder). Then export the S icon from there, unload everything and open the monitors file in Sonic 2(Don't know if its the same name), and its mappings proberly still obj26, and then import the S icon you just exported.


    I know it may sound complicated and I explain things a bit orquidly, but it really isn't that hard. To make things easier, if you haven't already follow this guide: http://info.sonicretro.org/SCHG_How-to:Use_SonMapEd/Part_1 it will be explain the basics of using this program and I would recommend this.
     
  17. DarkLeach

    DarkLeach Well-Known Member Member

    Joined:
    Jul 3, 2011
    Messages:
    193
    Location:
    In the middle of desert heat
    The how come whenever I try importing custom monitor art It overwrites the first monitor graphic even if I import the graphic over the art I want to replace? :
     
    Last edited by a moderator: Feb 1, 2012
  18. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    You are obviously doing something wrong. You press '[' and ']' to scroll through which sprite you want to edit/replace. I think I may speed up the process and get my art tutorial going because it seems like people are needing it.
     
  19. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    you have to also copy the new tiles. if you copy the sprite, it is just that, you are just copying the sprite, using the tiles it is set to. You have to press copy tiles or whatever the jazz button maybe, and have it duplicate the tiles. then create a new sprite with the duplicates, export it, do whatever, import, save, profit.
     
  20. CrashSG32

    CrashSG32 Classy and I know it Member

    Joined:
    Jan 21, 2012
    Messages:
    54
    Location:
    Australia
    Okay, I'll try that ;)

    @Darkleach7: I put it over the robotnik monitor, which is directly above the 1up monitor code, so maybe that has something to do with it.


    Also: VIDEO!:
     
    Last edited by a moderator: Feb 2, 2012
Thread Status:
Not open for further replies.