Basic Questions and Answers Thread

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

  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The art is in art/nemesis/1Player2VS.bin, sprite mappings are in mappings/sprite/obj0F.bin, and the object's art tile is set to the start of VRAM, so you'll need to load a VRAM dump of the title screen as art to be able to view and edit the mappings properly.
     
    MarkeyJester and Niko like this.
  2. Ziro_

    Ziro_ Mentally Skewed Member

    Joined:
    Aug 1, 2016
    Messages:
    59
    Location:
    What are you a cop
    I tried porting the sonic 2 sprites to sonic 1. The animations for skidding and balancing don't display in game. The animations are called in the code and are view-able in sonAni. The number corresponding to the balance animation is 6
    Code:
    ptr_Balance:    dc.w SonAni_Balance-Ani_Sonic ;6
    and it gets called here
    Code:
    Sonic_Balance:
            jsr    ObjHitFloor
            cmpi.w    #$C,d1
            blt.s    Sonic_LookUp
            cmpi.b    #3,$36(a0)
            bne.s    loc_12F62
    
    loc_12F5A:
            bclr    #0,$22(a0)
            bra.s    loc_12F70
    ; ===========================================================================
    
    loc_12F62:
            cmpi.b    #3,$37(a0)
            bne.s    Sonic_LookUp
    
    loc_12F6A:
            bset    #0,$22(a0)
    
    loc_12F70:
            move.b    #6,$1C(a0)    ; use "balancing" animation
            bra.s    Obj01_ResetScr
    Picture of animation in sonAni http://prntscr.com/gte7s7

    Also I seem to be unable to find which piece of code respawns objects after sonics death,
     
    Last edited by a moderator: Oct 5, 2017
  3. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    Merged your posts together. Please refrain from double posting. Thanks!
     
  4. SKtE

    SKtE Newcomer Trialist

    Joined:
    Nov 25, 2015
    Messages:
    11
    Last edited: Oct 5, 2017
  5. Ziro_

    Ziro_ Mentally Skewed Member

    Joined:
    Aug 1, 2016
    Messages:
    59
    Location:
    What are you a cop
    I added 3 new monitors for Emeralds. What I am trying to do is once one of these monitors are collected it sets a flag so that if sonic dies and spawns back in the emerald monitor disappears so sonic can no longer collect it to avoid duplication of emeralds. These flags are cleared every time sonic hits the goal post at the end of each act. The problem is that they are not deleting. Also yes I am aware that I did not add anything that adds emeralds to a counter yet I am currently trying to get them to delete on sonic's death.




    Code:
    Obj2E_Main:                ; XREF: Obj2E_Index
            addq.b    #2,$24(a0)
            move.w    #$680,2(a0)
            move.b    #$24,1(a0)
            move.b    #3,$18(a0)
            move.b    #8,$19(a0)
            move.w    #-$300,$12(a0)
            moveq    #0,d0
            move.b    $1C(a0),d0
            addq.b    #2,d0
            move.b    d0,$1A(a0)
            movea.l    #Map_obj26,a1
            add.b    d0,d0
            adda.w    (a1,d0.w),a1
            addq.w    #1,a1
            move.l    a1,4(a0)
    
    Obj2E_Move:                ; XREF: Obj2E_Index
            tst.w    $12(a0)        ; is object moving?
            bpl.w    Obj2E_ChkEggman    ; if not, branch
            bsr.w    SpeedToPos
            addi.w    #$18,$12(a0)    ; reduce object    speed
            rts
    ; ===========================================================================
    
    Obj2E_ChkEggman:            ; XREF: Obj2E_Move
            addq.b    #2,$24(a0)
            move.w    #29,$1E(a0)
            move.b    $1C(a0),d0
            cmpi.b    #1,d0        ; does monitor contain Eggman?
            bne.s    Obj2E_ChkSonic
            rts            ; Eggman monitor does nothing
    ; ===========================================================================
    
    Obj2E_ChkSonic:
            cmpi.b    #2,d0        ; does monitor contain Sonic?
            bne.s    Obj2E_ChkShoes
    
    ExtraLife:
            addq.b    #1,($FFFFFE12).w ; add 1 to the    number of lives    you have
            addq.b    #1,($FFFFFE1C).w ; add 1 to the    lives counter
            move.w    #$88,d0
            jmp    (PlaySound).l    ; play extra life music
    ; ===========================================================================
    
    Obj2E_ChkShoes:
            cmpi.b    #3,d0        ; does monitor contain speed shoes?
            bne.s    Obj2E_ChkShield
            move.b    #1,($FFFFFE2E).w ; speed up the    BG music
            move.w    #$4B0,($FFFFD034).w ; time limit for the power-up
            move.w    #$C00,($FFFFF760).w ; change Sonic's top speed
            move.w    #$18,($FFFFF762).w
            move.w    #$80,($FFFFF764).w
            move.w    #$E2,d0
            jmp    (PlaySound).l    ; Speed    up the music
    ; ===========================================================================
    
    Obj2E_ChkShield:
            cmpi.b    #4,d0        ; does monitor contain a shield?
            bne.s    Obj2E_ChkInvinc
            move.b    #1,($FFFFFE2C).w ; give    Sonic a    shield
            move.b    #$38,($FFFFD180).w ; load shield object    ($38)
            move.w    #$AF,d0
            jmp    (PlaySound).l    ; play shield sound
    ; ===========================================================================
    
    Obj2E_ChkInvinc:
            cmpi.b    #5,d0        ; does monitor contain invincibility?
            bne.s    Obj2E_ChkRings
            move.b    #1,($FFFFFE2D).w ; make    Sonic invincible
            move.w    #$4B0,($FFFFD032).w ; time limit for the power-up
            move.b    #$38,($FFFFD200).w ; load stars    object ($3801)
            move.b    #1,($FFFFD21C).w
            move.b    #$38,($FFFFD240).w ; load stars    object ($3802)
            move.b    #2,($FFFFD25C).w
            move.b    #$38,($FFFFD280).w ; load stars    object ($3803)
            move.b    #3,($FFFFD29C).w
            move.b    #$38,($FFFFD2C0).w ; load stars    object ($3804)
            move.b    #4,($FFFFD2DC).w
            tst.b    ($FFFFF7AA).w    ; is boss mode on?
            bne.s    Obj2E_NoMusic    ; if yes, branch
            move.w    #$87,d0
            jmp    (PlaySound).l    ; play invincibility music
    ; ===========================================================================
    
    Obj2E_NoMusic:
            rts
    ; ===========================================================================
    
    Obj2E_ChkRings:
            cmpi.b    #6,d0        ; does monitor contain 10 rings?
            bne.s    Obj2E_ChkS
            addi.w    #$A,($FFFFFE20).w ; add    10 rings to the    number of rings    you have
            ori.b    #1,($FFFFFE1D).w ; update the ring counter
            cmpi.w    #100,($FFFFFE20).w ; check if you have 100 rings
            bcs.s    Obj2E_RingSound
            bset    #1,($FFFFFE1B).w
            beq.w    ExtraLife
            cmpi.w    #200,($FFFFFE20).w ; check if you have 200 rings
            bcs.s    Obj2E_RingSound
            bset    #2,($FFFFFE1B).w
            beq.w    ExtraLife
    
    Obj2E_RingSound:
            move.w    #$B5,d0
            jmp    (PlaySound).l    ; play ring sound
    ; ===========================================================================
    
    Obj2E_ChkS:
            cmpi.b    #7,d0        ; does monitor contain 'Emerald'
            bne.s    Obj2E_ChkEm2
            cmpi.w     #0,($FFFFF601).w    ; did player collect this 'emerald'
            bne.s    Obj2E_Delete
            move.b  #1,($FFFFF601).w
    Obj2E_ChkEm2:
            cmpi.b    #8,d0        ; does monitor contain 'Emerald'
            bne.s    Obj2E_ChkEm3
            cmpi.w    #0,($FFFFF5C0).w        ; did player collect this 'emerald'
            bne.s    Obj2E_Delete
            move.b  #1,($FFFFF5C0).w
    Obj2E_ChkEm3:
            cmpi.b    #9,d0        ; does monitor contain 'Emerald'
            bne.s    Obj2E_ChkEnd
            cmpi.w     #0,($FFFFF5FF).w        ; did player collect this 'emerald'
            bne.s    Obj2E_Delete
            move.b  #1,($FFFFF5FF).w
    
    Obj2E_ChkEnd:
            rts            ; 'S' and goggles monitors do nothing
    ; ===========================================================================
    
    Obj2E_Delete:                ; XREF: Obj2E_Index
            subq.w    #1,$1E(a0)
            bmi.w    DeleteObject
            rts
    
    edits: sorry accidentally formatted code embed wrong
     
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Object 2E is the item that comes out of the monitor, you want to add your checks to object 26, the monitor itself.

    Also this should probably go in the basic q&a thread.
     
  7. Ziro_

    Ziro_ Mentally Skewed Member

    Joined:
    Aug 1, 2016
    Messages:
    59
    Location:
    What are you a cop
    Sorry last time I put something in basic it got trampled and was never answered. :(
    Thanks for responding, I'll go see if it works.
     
  8. Wudibou

    Wudibou Newcomer In Limbo

    Joined:
    Sep 30, 2017
    Messages:
    20
    Location:
    France
    Hi,
    I wanted to know how to have the animations while using a spring and insert them too
    (I'm too new for this)

    Staff edit: Moved to Q&A thread
     

    Attached Files:

    Last edited by a moderator: Oct 7, 2017
    Ashuro likes this.
  9. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    astroblema likes this.
  10. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    The thing that i'm the most familiar in hacking si the animations.

    Do you know how to import the sprite into the game?

    You have to import them with SonMapEd.

    First, open SonMapEd and then load the uncompressed tiles under "artunc": sonic.bin
    Load the mappings under "_maps": Sonic.asm
    Load the pattern cues under "_inc": Sonic dynamic pattern load cues.asm

    You have to follow the SonMaped tutorials on Sonic Retro: http://info.sonicretro.org/SCHG_How-to:Guide

    Import your sprites, and save the files.
    Open Sonic.asm under "_anim", and in "SonAni_Spring", replace the byte "$40" by the bytes of your sprites. You can know what is your sprite byte value by looking at this:
    Sans titre.png

    Look at some tutorials, make some research, good luck!
    (Don't forget to create a backup of your hack)
    Sorry for the bad english, i'm lazy today :p

    I'm sorry, but... this is because of this kind: "Please show that you've made an effort to look up your problem and attempt to solve it yourself before asking a question here."
    That I was stuck for days at a time when I was just starting out, too. It's a bit unfortunate that birds are thrown out of the nest without at least showing them how or where to fly. We don't even know if he came in without looking before, maybe he's been looking for hours. But I totally agree with the fact that he has to fend for himself first, Google was my friend too: p
    (Sorry for the double post, i'm really tired this morning :p

    Staff edit: Merged posts
     
    Last edited by a moderator: Oct 7, 2017
    Niko, MarkeyJester and Soldaten like this.
  11. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    Aside from the double post (there's an edit button right there at the bottom), being new is not an excuse to not put effort in to figuring out the problem yourself before asking a question here. You also contradict yourself in saying that whay I told him was the equivalent of tossing birds out of a nest (which my statement did none of the sort) and then saying that yes, he should use google initially to try to solve his problems first so I really don't know what you're trying to get at here.

    Have a question? (And this goes for everyone), show that you've put some effort into figuring out your problem before making a post here. Simple.
     
    Ashuro likes this.
  12. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Just for the record, the link you, Xeal, posted, was not really relevant to the question he was asking at all. Should probably invest some effort into actually understanding what you are about to suggest.
     
    MarkeyJester, AkumaYin and Ashuro like this.
  13. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    Mistakes can be made which I'll admit too but my point stands.
     
  14. Wudibou

    Wudibou Newcomer In Limbo

    Joined:
    Sep 30, 2017
    Messages:
    20
    Location:
    France
    I have a new problem...
    Sonic is too much on the left or the right (The red square is where I am)
    How can I fix it ?
    Do I need to go through the code ?
     

    Attached Files:

  15. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    You can use SonMapED to adjust the position of the sprites by 8 pixels using the arrow keys (hold shift to move by 1 pixel). Go through each sprite and move it two 8 pixel spaces to the left. You should look through the other functions of SonMapED, too, so you can better know what it is capable of.
     
  16. Wudibou

    Wudibou Newcomer In Limbo

    Joined:
    Sep 30, 2017
    Messages:
    20
    Location:
    France
    I will try that !

    IT WORKED !!! Thanks to make me do something that I want and learn at the same time !
    (for the first time...)
    Sorry for double-posting >_<
     
    Last edited by a moderator: Oct 7, 2017
    Ashuro likes this.
  17. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    Don't double post, just edit your last post.
     
  18. Wudibou

    Wudibou Newcomer In Limbo

    Joined:
    Sep 30, 2017
    Messages:
    20
    Location:
    France
    So how I delete a post because I wanted to make the second one blank to delete it and it dosen't work.
     
  19. Misinko

    Misinko Oh SHIT it's the Biolizard! Member

    Joined:
    Apr 30, 2013
    Messages:
    722
    Location:
    Ohio
    Only we can delete a post for you. If you want a post deleted, edit it to say such, and we'll delete it when we see it. If a couple hours or so have passed, just report the post, and we'll be along to snag it.
     
  20. LazloPsylus

    LazloPsylus The Railgun Member

    Joined:
    Nov 25, 2009
    Messages:
    Location:
    Academy City
    Only staff can delete and remove posts. Usually just editing the duplicated post with something like "Double post, please delete." is sufficient.

    ~E~: Ha, looks like others are already on top of it. Good.