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
    Um, have you tried SonLVL?
     
    PokeTogeKiss, Aier and Trickster like this.
  2. PokeTogeKiss

    PokeTogeKiss That one plonker who draws green hedgehogs. Member

    Joined:
    Jun 29, 2019
    Messages:
    27
    Location:
    Whatever he(ck) that spawned Blaster.
    I would, but I'm building the hack off of the Esrael Sonic 2 Simon Wai Proto. There aren't any INI's for that, to my knowledge. Also, I'm made a music track (MIDI), converted it to SMPS (mid2smps), and played it in the SMPS player, and it was fine, but in-game, it was nothing but glitched sound. BTW, same hack.
     
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    There's a program for converting SonED2 project files to SonLVL projects in the SonLVL Updater.
     
    PokeTogeKiss likes this.
  4. PokeTogeKiss

    PokeTogeKiss That one plonker who draws green hedgehogs. Member

    Joined:
    Jun 29, 2019
    Messages:
    27
    Location:
    Whatever he(ck) that spawned Blaster.
    Cheers! (EDIT: I found the INI's in the disassembly.)
     
  5. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    If I recall, MID2SMPS converts for the Sonic 1 sound driver, and therefore is not ready for the Sonic 2 beta sound driver. There might be a guide out there on porting it, but I'm not all too sure. Hope this leads you in the right direction.
     
    PokeTogeKiss likes this.
  6. PokeTogeKiss

    PokeTogeKiss That one plonker who draws green hedgehogs. Member

    Joined:
    Jun 29, 2019
    Messages:
    27
    Location:
    Whatever he(ck) that spawned Blaster.
    Big ol' cheers, innit! I've found a guide for porting the song on the SCHG (Music Hacking: Tricks Of The Trade). Thanks for the help!
     
  7. badnest

    badnest Newcomer Member

    Joined:
    Dec 3, 2019
    Messages:
    20
    Location:
    Brazil Bad Future
    There's a design choice in the original MD Sonic that always puzzled me, but I've never seen it discussed or even mentioned anywhere.

    Why is the BG y scrolling reversed in GHZ? I mean, when sonic goes up, the BG scrolls up, when he goes down, it scrolls down. In all other zones (and in real life) it's the other way around. Maybe the programmers did this to simulate a bird's eye view (i.e. Sonic looking down upon the landscape) when in high places?

    Also, which part of the GHZ scroll code does this?
     
    Last edited: Dec 4, 2019
  8. penPhobic

    penPhobic Everything's all topsy-turvy now. Member

    Joined:
    Dec 11, 2016
    Messages:
    67
    Location:
    Basement
    Just asking a basic question. It is possible to make FM drums and/or PSG drums? How does it work?
     
  9. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    Probably just an oversight, since it scrolls so slowly vertically. The code is in Deform_GHZ.
    REV00:
    Code:
            move.w    (v_screenposy).w,d0
            andi.w    #$7FF,d0
            lsr.w    #5,d0
            neg.w    d0
            addi.w    #$26,d0
            move.w    d0,(v_bg2screenposy).w
    REV01:
    Code:
            move.w    (v_screenposy).w,d0
            andi.w    #$7FF,d0
            lsr.w    #5,d0
            neg.w    d0
            addi.w    #$20,d0
            bpl.s    loc_62F6
            moveq    #0,d0
    loc_62F6:
            move.w    d0,d4
            move.w    d0,(v_bgscrposy_dup).w
    Yes. I do know there are actually quite a few official Mega Drive games that use FM for drums. You could probably use some clever manipulation of volume and pitch to make an interesting percussion sound for the square wave channels in PSG. You probably already know this, but the noise channel in PSG is commonly used for things like hi-hats and such. I don't know the specifics of all this too well, but I know that there's definitely some people on this site that could go deeper into it (like @Ozaleto)
     
    penPhobic likes this.
  10. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    Ok, so I've hit a bit of a snag. In my first attempt to code a custom player move, I've attempted to recreate the Air Roll from Sonic Triple Trouble, however when I attempt to use it in-game, the spring animation stays intact. I've already tried to figure out the issue, with no results, hence why I am posting here.

    Here is the current Air Roll code:

    Code:
    ; ---------------------------------------------------------------------------
    ; Subroutine to allow Sonic to push a button to roll mid-air
    ; ---------------------------------------------------------------------------
    
    Sonic_AirRoll:
            move.b    ($FFFFF603).w,d0 
            andi.b    #$70,d0
            beq.w    AirRoll_Return
            cmpi.b    #$10,$1C(a0)
            bne.s   AirRoll_Return
            btst    #2,$22(a0)
            beq.s   AirRoll_Return
            move.w    #$BC,d0
            jsr    (PlaySound_Special).l
            move.b    #2,$1C(a0)
                    
    AirRoll_Return:
            rts
    And here is Obj01_MdNormal, if it is of any aid:

    Code:
    ; ---------------------------------------------------------------------------
    ; Modes    for controlling    Sonic
    ; ---------------------------------------------------------------------------
    
    Obj01_MdNormal:                ; XREF: Obj01_Modes
            bsr.w    Sonic_SpinDash    ; add this line!
            bsr.w    Sonic_Jump
            bsr.w    Sonic_SlopeResist
            bsr.w    Sonic_Move
            bsr.w    Sonic_Roll
            bsr.w   Sonic_AirRoll
            bsr.w    Sonic_LevelBound
            jsr    SpeedToPos
            bsr.w    Sonic_AnglePos
            bsr.w    Sonic_SlopeRepel
            rts    
    Any help would be appreciated.
     
  11. badnest

    badnest Newcomer Member

    Joined:
    Dec 3, 2019
    Messages:
    20
    Location:
    Brazil Bad Future
    @Ralakimia Thanks a lot for replying. I'm just getting started on ASM. What I understand from the code is that it copies the y screen position to the d0 data register, manipulates it (likely to set the difference in scroll speed) and then sets it as the BG y position.

    A commented version of the REV01 code section on what exactly is being done or a general hint on why it comes out reversed would be nice though, if possible. Thanks.
     
  12. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    REV00:
    Code:
            move.w    (v_screenposy).w,d0   ; Get camera Y position
            andi.w    #$7FF,d0              ; ANDed with $7FF
            lsr.w    #5,d0                  ; Divided by $20
            neg.w    d0                     ; Negated
            addi.w    #$26,d0               ; + $26
            move.w    d0,(v_bg2screenposy).w; Store as background Y position
    REV01:
    Code:
            move.w    (v_screenposy).w,d0   ; Get camera Y position
            andi.w    #$7FF,d0              ; ANDed with $7FF
            lsr.w    #5,d0                  ; Divided by $20
            neg.w    d0                     ; Negated
            addi.w    #$20,d0               ; + $20
            bpl.s    loc_62F6               ; If the result a positive number, branch
            moveq    #0,d0                  ; If it's a negative number, cap the value at 0
    loc_62F6:
            move.w    d0,d4
            move.w    d0,(v_bgscrposy_dup).w; Store as background Y position
    The general calculation for the background's Y position is "-(((CAMERA Y) & 0x7FF) >> 5) + 0x26" (+ 0x20 in REV01, final value capped at 0 if negative in REV01 as well)

    It's really that it gets negated that makes it scroll in reverse.
     
    badnest and ProjectFM like this.
  13. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    I believe you should be putting the bsr to Sonic_AirRoll under Obj01_MdJump or Obj01_MdJump2. Most likely the latter.
     
  14. badnest

    badnest Newcomer Member

    Joined:
    Dec 3, 2019
    Messages:
    20
    Location:
    Brazil Bad Future
    That was very helpful. I had noticed that removing the neg instruction resulted in reversing when I was fumbling with the code, although it messes up everything else. But I can figure out the rest on my own. Thanks a lot for the kickstart.
     
    Inferno likes this.
  15. sogilbert

    sogilbert Newcomer In Limbo

    Joined:
    Dec 1, 2019
    Messages:
    10
    Location:
    Meteor Herd
    I have looked at Sonic Retro, and they don't seem to say anything about it. Could you help me? Thanks.
     
  16. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
  17. sogilbert

    sogilbert Newcomer In Limbo

    Joined:
    Dec 1, 2019
    Messages:
    10
    Location:
    Meteor Herd
    Oh, I didn't look there before. Thanks for showing me.
     
  18. Eiskaffee

    Eiskaffee Tails in in the sonic movie Member

    Joined:
    May 1, 2016
    Messages:
    12
    Location:
    United States
    So I am working on a Sonic 2 Hack thats kinda just a test project to learn about it. I want to enable Tails and Knuckles (Which I ported over using a guide on Sonic Retro) to use object placement mode

    How would I go about doing that

    Im using github disassembly btw
    Also is it possible to have two tails I added in the option for them both and kinda just went off the sonic and tails code for that option (same method I used to add a Knuckles and Tails option into the game that worked) but all I got was this [​IMG]
     
  19. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    A. I'd suggest looking at how Sonic handles debug, and porting that over. I'm not at the position to explain where. If someone else can, please do.
    B. While technically yes, the results will end up like this due to DPLC and VRAM conflicts, so unless you use up even more VRAM to create duplicate art and DPLCs (which would be inefficient, since VRAM is a precious commodity), it would end up with a garbled Tails. Also, make sure you aren't using Sonic's DPLC for Tails 1 in this case.
     
  20. Eiskaffee

    Eiskaffee Tails in in the sonic movie Member

    Joined:
    May 1, 2016
    Messages:
    12
    Location:
    United States
    I managed to copy some code to make debug mode work with tails sorta it breaks his control and screws up debug mode with sonic

    Knuckles Debug Mode after changing a few lines worked flawlessly
     
    Last edited: Dec 11, 2019