Basic Questions and Answers Thread

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

  1. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    Awesome! Thank you! That would be great.
     
  2. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    And almost everything is working fine - in normal level the counter is where it should be and counts how it should. But in hubs...

    [​IMG]

    the "0" is one tile to the left. Althrough, after collecting a ring, that garbage changes to 1, 2, etc. but after hurt, the digit in place of garbage don't changes to 0. Also, sometimes the garbage appears again after passing few pixels without collecting rings.

    To make it weirder, after collecting rings in hubs generates garbage in the BG

    [​IMG]

    So my question is: how to move the "0" 1 tile to the right? I think that this generates all the other problems mentioned in this post.
    I moved all the hub art 2 tiles back, so now there's a place for the 4th digit. But still the "0" in rings is 1 tile to the left (althrough after collecting a ring, the 1, 2, 3, etc. digit appears in the collect place). Additionally, after getting hurt the first digit still is here and changes to the currint numer of rings. Also the garbage dissapeared (and that's good).

    My question is as in quoted post: how to move the "0" 1 tile to the right?
     
    Last edited by a moderator: Jul 23, 2014
  3. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How can you make an object spawn other objects at a location relative to it? I've searched the code for answers, but the game seems to use lots of different methods, and testing them usually results a crash.
     
  4. Shockwave

    Shockwave 3 Time Stones Member

    Joined:
    Dec 18, 2013
    Messages:
    121
    Location:
    LA, CA
    The most simplistic way to load other objects would be this:



    bsr.w SingleObjLoad ; find free object RAM
    bne.w Whatever ; branch if none available
    move.b #$8E,0(a1) ; load Obj8E
    move.w 8(a0),8(a1) ; copy original object's x-pos
    move.w $C(a0),$C(a1) ; copy original object's y-pos

    Whatever:


    This will spawn another object on the exact same position as the original object you try to load it from. And if you, for example, wanted to have the object spawn slightly above and to the left, you could also change those last 2 lines to this:


    Code:
     move.w 8(a0),d0 ; get original object's x-pos
    move.w $C(a0),d1 ; get original object's y-pos
    subi.w #8,d0 ; move slightly to the left
    subi.w #8,d1 ; move slightly upwards
    move.w d0,8(a1) ; set new object's x-pos
    move.w d1,($C(a1) ; set new object's y-pos
    
     
  5. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Thanks! I have big, big plans for this...

    I'll put you in my hacks credits :3
     
  6. LooneyDude

    LooneyDude Back after a long absence! Member

    Joined:
    Feb 1, 2014
    Messages:
    277
    Location:
    EVERYWHERE
    I've noticed that the GHZ ball has multiple mappings for it, but only two are used. I can't find where the animation properties for it are (I use the SVN disassembly), so does anyone know where to adjust the animation to use all mappings?
     
  7. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How do you disassemble Sonic CD? I want to import some art through sonlvl, and try porting the super peel out, but for once, Sonic Retro doesn't have a ready to use disassembly on its disassemblies page. 
     
  8. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
  9. 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
    http://sonicresearch.org/forums/index.php?showtopic=4004&p=46998

    This is literally in the topic you made =P

    Also, you need IDA pro if you're gonna disassemble =P
     
    Last edited by a moderator: Jul 27, 2014
  10. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    Last edited by a moderator: Jul 27, 2014
  11. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    Thank you very much!
     
  12. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    Glad I could help you tell me if it works.
     
  13. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    It works EXACTLY how I need it! Thanks a lot!
     
  14. N30member

    N30member non-pro user btw Member

    Joined:
    Feb 15, 2014
    Messages:
    216
    Location:
    Kazakhstan
    You can find Super Peel Out sprites in this topic. Also, Irixion explained how to modify Spin Dash's code to get Super Peel Out.
     
  15. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How do you load objects with subtypes?
     
  16. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    ; There are two ways to do it.move.w #$number,subtype(a1)

    ; or

    move.w subtype(a0),subtype(a1)

    ; Either of the above works.
     
    Last edited by a moderator: Jul 29, 2014
  17. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I can't get this to work. I'm trying to make the goggles monitors spawn bubbles while playing the shield sound. The sound plays, so I know the monitor code works, but it doesn't appear to spawn anything. Here is my code:

    Obj2E_ChkGoggles:

      cmpi.b #8,d0  ; does monitor contain 'goggles'

      bne.w Obj2E_ChkEnd

      move.b  #$AF,d0

      jsr PlaySound

      bsr.w SingleObjLoad ; find free object RAM

      bne.w Obj2E_ChkEnd ; branch if none available

      move.w 80(a0),80(a1)

      move.b #$64,0(a1) ; load Obj8E

      move.w 8(a0),8(a1) ; copy original object's x-pos

      move.w $C(a0),$C(a1) ; copy original object's y-pos

      bra Obj2E_ChkEnd

    Also, how do you put the code in the formatting you put it in? I can't figure out how to do it.
     
  18. 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're not..

    A. Loading the right object (iirc Don't think you are, as your label says Obj8E, and your loading Obj64, so....)

    B. Even if you were, you aren't loading it to RAM, so it ain't ever gonna load. SingleObjectLoad doesn't load an object into RAM. You have to manually call for it. "$FFFFD000" I believe is the case.

    As a quick hint, take a quick look at the Shield_Monitor properties or whatever the name equivalent is in Obj2E. Literally, you could just copy that code and modify it to load the object you want.

    Whoops, did I just give the answer? How silly of me.
     
    Last edited by a moderator: Jul 29, 2014
  19. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I forgot to fix the comment, 64 is the ID for the bubbles in sonic 1. Also, what is the command for manually calling addresses like that? It previously used a branching command, which understandably would crash the game if an address was dumped in there. Also, the shield monitor's code doesn't change the subtype like I need it to, and I don't think it spawns it at the monitors location (the shield does follow sonic, after all). Plus, I've had bad experiences with using the other monitors code, as the lines which spawn the invincibility sparkles crashes the game when another value is dumped in.
     
  20. 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
    That's why you experiment  ;)

    Also, actually, the invincibility monitor subtype is quite useful, it shows you how to call in subtypes for other objects.

    First, let's look at Obj38.


    Obj38_Index:
    dc.w Obj38_Main-Obj38_Index ; Subtype 00
    dc.w Obj38_Shield-Obj38_Index ; Subtype 01
    dc.w Obj38_Stars-Obj38_Index ; Subtype 02

    In the Obj38_Index, you see three subtypes being shown. Obviously, I labeled it for simplicity. Do note that the Invincibility is the second subtype. This is important for the next part.

    Now, lemme explain how you get invincibility stars on screen. Looking at Obj2E....


    Obj2E_ChkInvinc:
    ; code that is irrelevant to example
    move.b #$38,($FFFFD200).w ; load stars object ($3801)
    move.b #1,($FFFFD21C).w

    You see this. As I mentioned in my last post, the RAM address for Object RAM is $FFFFD000.

    "But I only see $FFFFD200"

    Well that's the magic of it. What was the subtype for the invincibility stars?

    "Subtype 2. Why?"

    Because  you multiply the subtype location by 100, then add it to the objectRAM. So doing math, you get $200+$FFFFD000.  Adding that together gets you the  $FFFFD200.

    The line after that is simply stating the object animation. Not too important, but just for you, I added it for easier searching.

    As a side note, Obj64 doesn't...

    a. Have a subtype for just the bubbles alone.

    b. Follow Sonic around, as the obj38 calls for the shield's to follow Sonic, as it is a shield. This isn't, the case of Obj64