Basic Questions and Answers Thread

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

  1. EMK-20218

    EMK-20218 The Fuss Maker Member

    Joined:
    Aug 8, 2008
    Messages:
    1,066
    Location:
    Jardim Capelinha, São Paulo
    Yes. Puto did one. search for s2kdasm on the community then you will find it. After extract the file you'll see both the IDA and the ASM text format available. Just for add, the Puto's s2K disassembler is from the Upmem ROM.
     
  2. GalliumGrant

    GalliumGrant Void. Member

    Joined:
    May 11, 2010
    Messages:
    384
    Thanks for the help. But as I expected a link, I got something that kinda startled me. [​IMG]


    There's this chart with a TON of stuff on it!! Path? RSS Feed? I might need an explanation.
     
  3. Ravenfreak

    Ravenfreak Incineroooaaarr! Member

    Joined:
    Feb 10, 2010
    Messages:
    370
    Location:
    O'Fallon, MO
    Actually that's the SVN on Sonic Retro, where the ROM is. You don't need to worry about those things, but hehe mybad. :p' Instead of searching the page, just download it here: http://www.mediafire.com/?36krnritk8k3bin I'm sorry, I should have done this to begin with. :\
     
  4. Gardeguey

    Gardeguey Well-Known Member Member

    Joined:
    Aug 6, 2010
    Messages:
    82
    Location:
    México
    Ok, now i need help...


    When Sonic touches a lamppost and dies, the level x-pos camera starts from $0


    Download video [Kega codec format]


    (I know about the GFX, i can fix that myself)


    And i never touched the lamppost code since i started hacking with s2na.


    EDIT: Video [MP4 Codec]
     
    Last edited by a moderator: Sep 2, 2010
  5. GalliumGrant

    GalliumGrant Void. Member

    Joined:
    May 11, 2010
    Messages:
    384
    I've ported the spindash tiles to Sonic 1 using Tile Molester, however when I try to add these codes into my disassembly;



    Code:
    	 
    
    	 move.b #$1F,$1C (a0)
    
    	 
    
    	 dc.w SonPLC_Spindash1-SonicDynPLC; 58
    
    	 dc.w SonPLC_Spindash2-SonicDynPLC; 59
    
    	 dc.w SonPLC_Spindash3-SonicDynPLC; 5a
    
    	 dc.w SonPLC_Spindash4-SonicDynPLC; 5b
    
    	 dc.w SonPLC_Spindash5-SonicDynPLC; 5c
    
    	 dc.w SonPLC_Spindash6-SonicDynPLC; 5d
    
    	 
    
    	 SonPLC_Spindash1: dc.b 1, $F5, $10
    
    	 SonPLC_Spindash2: dc.b 1, $F5, $20
    
    	 SonPLC_Spindash3: dc.b 1, $F5, $30
    
    	 SonPLC_Spindash4: dc.b 1, $F5, $40
    
    	 SonPLC_Spindash5: dc.b 1, $F5, $50
    
    	 SonPLC_Spindash6: dc.b 1, $F5, $60
    
    
    
    	 dc.w byte_spdh1-Map_Sonic, byte_spdh2-Map_Sonic
    
    	 dc.w byte_spdh3-Map_Sonic, byte_spdh4-Map_Sonic
    
    	 dc.w byte_spdh5-Map_Sonic, byte_spdh6-Map_Sonic
    
    	 
    
    	 byte_spdh1:	 dc.b 1
    
    						  dc.b $F8, $F, 0, 0, $F0
    
    	 byte_spdh2:	 dc.b 1
    
    						  dc.b $F8, $F, 0, 0, $F0
    
    	 byte_spdh3:	 dc.b 1
    
    						  dc.b $F8, $F, 0, 0, $F0
    
    	 byte_spdh4:	 dc.b 1
    
    						  dc.b $F8, $F, 0, 0, $F0
    
    	 byte_spdh5:	 dc.b 1
    
    						  dc.b $F8, $F, 0, 0, $F0
    
    	 byte_spdh6:	 dc.b 1
    
    						  dc.b $F8, $F, 0, 0, $F0
    
    	
    
    	 dc.w SonAni_Spindash-SonicAniData; 1F
    
    	 
    
    	 SonAni_Spindash: dc.d 0, $58, $59, $58, $5A, $58, $5B, $58, $5C, $58, $5D, $FF

    I save, build, open the ROM with an emulator, and the game crashes with the black screen of death.


    I think I may have this stuff on the wrong drive (not on the C:/ drive).


    (Once again I'm following QJimbo's lovely tutorial. =P)


    Am I doing something wrong?
     
    Last edited by a moderator: Sep 7, 2010
  6. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Add log>txt in the build.bat (open it up into note pad) then build it, it should create either txt file or log file and open it with notepad and see what errors you get. I hope all of this isn't like in one file? I mean the animation code is in the animation code, and maps are in maps etc?.
     
  7. GalliumGrant

    GalliumGrant Void. Member

    Joined:
    May 11, 2010
    Messages:
    384
    Yes. The coding is in its rightful files. Thanks.
     
  8. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    So the file compiles correctly and you get a black screen immediately after opening the rom in your emulator, right?


    I don't think it can be related to the drive (I'm working on drive F myself and there's no problem about it).


    It's unusual for the game to crash immediately after opening when what you modified is a move that won't influence anything until its routines are being processed, so something else might have been modified. Maybe some data got misaligned after your changes.


    Where do you include the new files? Is there an "even" after or at the end of the modified (or new) arrays and binary files?
     
  9. GalliumGrant

    GalliumGrant Void. Member

    Joined:
    May 11, 2010
    Messages:
    384
    Yes.

    Well, most of the ASM files remained unedited, except a few minor edits (A new working item box, and a half-working spindash).

    Also, the "even" at the end of each binary file wasn't touched. They're still there.

    No, there aren't any new files...
     
  10. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,823
    It might be caused by the header of the rom (i.e. the beginning of the source where the vectors and rom name/info are).
     
  11. FireRat

    FireRat Well-Known Member Exiled

    Joined:
    Oct 31, 2009
    Messages:
    544
    Newq uestion: How can that objects can have more than 127 images? I'm porting the S3 sonic sprites, but don't work correctly because have too many images (It's up to $7F)


    (I suppose, the mappings don't have problems, SonMapEd show the mappings fine...)
     
    Last edited by a moderator: Sep 8, 2010
  12. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,823
    That's the number of objects if I recall correctly, and not the number of sprites, the maximum number of sprites is 50 (Hex) [i think 80 (Hex) provided certain registers are set, though don't quote me on that one] for the VDP chip, no higher.


    In order to have more objects to be loaded, you'd need more ram space and a decent amount of processing power.
     
  13. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    Like that?
     
  14. FireRat

    FireRat Well-Known Member Exiled

    Joined:
    Oct 31, 2009
    Messages:
    544
    Don't work. When Sonic use the Roll animation, the animations stops


    Images used: $96, $97 and $98
     
    Last edited by a moderator: Sep 8, 2010
  15. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375
    The stuff you call Images are Frames. Call them that please. What's this rolling animation shit about now?
     
  16. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    384
    Location:
    Russia
    You've fixed mapping frames limit, but there is a limit in Sonic_Animate code as well.


    You'll need to fix this subroutine:



    SAnim_Do2:
    moveq #0,d1


    move.b $1B(a0),d1 ; load current frame number


    move.b 1(a1,d1.w),d0 ; read sprite number from script


    bmi.s SAnim_End_FF ; if animation is complete, branch



    The last command tests, if d0 is negative. The byte is negative, when his value is $80 and more. Due to Sonic 1 objects weren't meant to have more than $80 frames, SAnim_Do2 just counted any value more than $7F to be a restart animation command (i.e. $FF). That's why the animation freezes - it's restarts endlessly.


    Fixing this is easy. Just change the code, so it branched to SAnim_End_FF only if d0 is more than $F0:



    SAnim_Do2:
    moveq #0,d1


    move.b $1B(a0),d1 ; load current frame number


    move.b 1(a1,d1.w),d0 ; read sprite number from script


    ;bmi.s SAnim_End_FF ; if animation is complete, branch


    cmpi.b #$F0,d0 ;++


    bcc.s SAnim_End_FF ;++ if animation is complete, branch



    That's the way it's done in Sonic 2 btw.
     
    Last edited by a moderator: Sep 10, 2010
  17. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    @Hcktrox: I completely forgot about it, but if it's still not working you can add ext.w d1 before bmi.s loc_D720


    I have a question, well, it isn't really a technical question about a bug rather something I noticed and can't really explain:


    Why is Labyrinth zone the place where every single thing that can go wrong will go wrong?


    When I make some changes and forget to align, if it causes bugs in only one zone, it will be labyrinth, when I make changes to the camera, background deformation routines and such, no problem anywhere excepted in Labyrinth, even when the changes are not at all specifically related to Labyrinth zone. An example, the other day, I was making some changes on springs, and there was a single little 8x8 tile on one single 16x16 block on one single 256x256 chunk that wouldn't load properly in Labyrinth and only there. Is it using specific memory locations or something? Some times ago, the penguins' graphics were messed up, etc.


    Maybe it's only a mere coincidence, or a glitch in fusion (because it never happens in regen), but if someone has an idea about it, I'd be happy to know.
     
    Last edited by a moderator: Sep 12, 2010
  18. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    267
    Location:
    Birmingham, UK
    Fuck, I'm having quite a bit of a problem with this. I just can't seem to get it to work:




    Obj01_Super:


    cmpi.b #1,(superflag).w


    bne.s countend


    ; move.w #60,($FFFFF614).w


    Obj01SuperLoop:


    cmpi.w #0,($FFFFFE20).w ;does sonic have no rings?


    beq.w makenotsuper ;if rings=0, branch.


    subq.w #1,($FFFFF614).w


    cmpi.w #0,($FFFFF614).w


    bne.w countend


    move.w #60,($FFFFF614).w


    subq.w #1,($FFFFFE20).w ; add 1 to level timer


    move.b #1,(update_HUD_rings).w;


    countend:


    rts



    The countdown is the only problem I have. I even tried porting across S2's countdown code, but still no luck. =/
     
  19. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    When I was attempting to port Super Sonic, The only problem was the countdown. Theocas suggested a different RAM address, and it worked.


    BTW: Your code looks a little small there.
     
  20. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    267
    Location:
    Birmingham, UK
    Obj01_Super:


    cmpi.b #1,(superflag).w ; Ignore all this code if not Super Sonic


    bne.s return_1AC3C


    subq.w #1,(Super_Sonic_frame_count).w


    bpl.w return_1AC3C


    move.w #60,(Super_Sonic_frame_count).w ; Reset frame counter to 60


    tst.w (Ring_count).w


    beq.s Sonic_RevertToNormal


    move.b #1,(Update_HUD_rings).w


    cmpi.w #1,(Ring_count).w


    beq.s ssplus


    cmpi.w #10,(Ring_count).w


    beq.s ssplus


    cmpi.w #100,(Ring_count).w


    bne.s ssplusplus


    ssplus:


    move.b #$80,(Update_HUD_rings).w


    ssplusplus:


    subq.w #1,(Ring_count).w


    bne.s return_1AC3C


    ; loc_1ABF2:


    Sonic_RevertToNormal:


    jmp makenotsuper


    return_1AC3C:


    rts



    This different code is a direct port of the countdown from S2, but it still does nothing. Everything I've tried seems to do nothing.


    Edit: I've used a free slot in RAM for the super_sonic_frame_count.
     
    Last edited by a moderator: Sep 19, 2010