Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    It's alright Tom, and I was in a hurry when I posted that.
     
  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
    If you still have problems, get the art from the Sonic 128 disasm
     
  3. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    Indeed.
     
  4. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    Y'know I'm very good at working with PCM samples in hex. But I never tried working on a palette hands on with it. Might as well attempt it some time to see how well I can do it.
     
  5. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    I edit many things in ms-dos editor, but that's well known by now. An incomplete list includes: SMPS data, Special Stage layouts, level select text, object placements, ...
     
  6. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    What subroutine should I look in to make it so that Sonic needs to hit enemies twice in order to destroy them? I was testing a few things with motobug but maybe I'm overlooking something?
     
  7. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    I can do palettes, art and mappings (level, sprite & object) in hex.
     
  8. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Ah, but can you do it in ASM? Muhahaha *runs*

    Duh, anyone can if can in hex.
     
    Last edited by a moderator: Jun 14, 2013
  9. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
  10. 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
    Not everybody uses the HG disasm =P
     
  11. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    As much as I hate to say it, this right here. Although someday people will use it...just not anytime in the foreseeable future =P
     
  12. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    Yep Super egg is right - but I was able to fix the dust using this so not all bad... would be great if somebody could convert the whole thing to work with the older disasmbelies though.
     
  13. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    As much as I hate to say it, this right here. Although someday people will use it...just not anytime in the foreseeable future =P
    Okay, just one more time, and you're out...

    STOP QUOTING THE POST ABOVE YOU!

    Also, to be fair to MainMemory, he answered the question fine. It's only a small fix so it doesn't matter what disassembly you're using. I'm sure he can figure it out no matter what disassembly he is using.
     
    Last edited by a moderator: Jun 15, 2013
  14. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    Can someone help me with this code? I'm trying to create a boost ability for Sonic 1 but Sonic automatically runs as soon as the game starts (I can't jump or anything either) but he should only run if I press "C".


    Sonic_Autorun:

    move.b #1,(v_invinc).w ; make Sonic invincible
    cmpi.b #btnC,(v_jpadpress1).w ; is button C pressed?
    beq.s Nothing ; if not, branch
    move.w #(btnR<<8),(v_jpadhold2).w ; move Sonic to the right
    rts

    Nothing:
    rts
    ; End of subroutine Sonic_Invinc

    This is what the code looks like soo far. I know I gotta add some stuff to determine what direction to go in or something like that.
     
  15. fdswerty

    fdswerty Well-Known Member Member

    Joined:
    Apr 10, 2013
    Messages:
    138
    Your code has something wrong. You'd firstly have to check if button C was pressed, and THEN make Sonic invincible.

    I've made the correction to your code:


    Sonic_Autorun:

    cmpi.b #btnC,(v_jpadpress1).w ; is button C pressed?
    beq.s Nothing ; if not, branch

    move.b #1,(v_invinc).w ; make Sonic invincible

    move.w #(btnR<<8),(v_jpadhold2).w ; move Sonic to the right
    rts

    Nothing:
    rts
    ; End of subroutine Sonic_Invinc

    That should work fine.

    P.S: Oh and yeah, why don't you use Hivebrain 2005 disasm? there's a lot of guides for that disasm.

    EDIT: Why the asm tags ain't working today?
     
    Last edited by a moderator: Jun 16, 2013
  16. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    What the hell is up with that code? It's all like... high level or something, what the hell are they doing with the disassemblies?

    On subject though, I don't have too much understanding through the high level changes in that code, but I would opt probably for something like this:

    Code:
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Subroutine to allow Sonic to boost
    ; ---------------------------------------------------------------------------
    
    Sonic_Autorun:
    		btst.b	#$05,($FFFFF603).w			; is C pressed?
    		beq	SAR_NoRun				; if not, branch
    		move.w	#$0800,d0				; prepare speed
    		btst.b	#$00,$22(a0)				; is Sonic facing right?
    		beq	SAR_NoReverse				; if so, branch
    		neg.w	d0					; reverse speed
    
    SAR_NoReverse:
    		move.w	d0,$14(a0)				; set ground speed
    		sf.b	$1C(a0)					; set animation to 00 (walking/running)
    
    SAR_NoRun:
    		rts						; return
    
    ; ===========================================================================
    Call this routine around "Obj01_MdNormal", somewhere here would be appropriate:
    Code:
    Obj01_MdNormal:				; XREF: Obj01_Modes
    		bsr.w	Sonic_Jump
    		bsr.w	Sonic_SlopeResist
    		bsr.w	Sonic_Move
    		bsr.w	Sonic_Autorun		; <-
    		bsr.w	Sonic_Roll
    For it to work, you will require to change the button press at "Sonic_Jump":
    Code:
    Sonic_Jump:				; XREF: Obj01_MdNormal; Obj01_MdRoll
    		move.b	($FFFFF603).w,d0
    		andi.b	#$70,d0		; is A,	B or C pressed?
    		beq.w	locret_1348E	; if not, branch
    Exclude the C press from there, otherwise Jumping will occur first, before the boost.
     
    Last edited by a moderator: Jun 16, 2013
  17. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    Alright thanks.
     
  18. ScoutCDTen

    ScoutCDTen Newcomer Trialist

    Joined:
    Jun 15, 2013
    Messages:
    17
    Location:
    Italy
    Help! I have a problem with SonED2 (i use latest version and SVN disassembly).I try to import my art made in MSPaint (i used IrfanView to reduce palette and ImaGenesis) but it shows only garbled graphics.2) When i save GHZ project file i wait 1 minute.When i build the rom and test it title screen background is empty and GHZ is empty.
     
  19. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
  20. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    Continuing from my previous question about making a boost button. How do I get it to subtract similar to Super Sonic and work while rolling or holding left or right?

    Here's what it looks like now thanks to MarkeyJester.

    Code:
    Sonic_Autorun:
    		btst.b	#$05,($FFFFF603).w			; is C pressed?
    		beq	SAR_NoRun				; if not, branch
    		andi.b	#btnR+btnL,(v_jpadpress1).w
    		beq      Cont
    Cont:
    ;                tst.w	(v_rings).w ; check if you have no rings
    ;               beq     SAR_NoRun
    
    
    		move.w	#$1100,d0				; prepare speed
    
    		btst.b	#$00,$22(a0)				; is Sonic facing right?
    		beq	SAR_NoReverse				; if so, branch
    		neg.w	d0					; reverse speed