Basic Questions and Answers Thread

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

  1. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    102
    I try that and I don't get any results at all. Using $1B results in an odd glitch where the last objects only appear under a certain condition the player is undergoing rather than the animation frame. Here is a fuller example of the routine:


    HammerSpin_Cont:
    move.b #1,($FFFFFFCC).w ; if not, set jumpdash flag
    move.b #$20,$1C(a0) ; show hammer animation
    move.w #$BC,d0 ; set jumpdash sound
    jsr (PlaySound).l ; play jumpdash sound
     
     
    HammerSpin_Hearts1:
    cmpi.b #1,$1B(a0)
    bcs.s HammerSpin_Hearts2 ; if not, branch
    bsr.w SingleObjLoad
    bne.w HammerSpin_Hearts2
    move.b #$10,(a1) ;Obj10
    move.w 8(a0),8(a1)
    move.w $C(a0),$C(a1)
    sub.w #$20,8(a1)
           btst    #0,$22(a0)
            beq.s HammerSpin_Hearts2
            neg.w   $10(a1)
            add.w   #$40,8(a1)

    HammerSpin_Hearts2:
    cmpi.b #3,$1B(a0)
    bcs.s HammerSpin_Hearts3 ; if not, branch
    bsr.w SingleObjLoad2
    bne.w HammerSpin_Hearts3
    move.b #$10,(a1) ;Obj10
    move.w 8(a0),8(a1)
    move.w $C(a0),$C(a1)
    sub.w #0,8(a1)
           btst    #0,$22(a0)
            beq.s HammerSpin_Hearts3
            neg.w   $10(a1)
            add.w   #0,8(a1)

    HammerSpin_Hearts3:
    cmpi.b #5,$1B(a0)
    bcs.s HS_End2 ; if not, branch
    bsr.w SingleObjLoad
    bne.w HS_End2
    move.b #$10,(a1) ;Obj10
    move.w 8(a0),8(a1)
    move.w $C(a0),$C(a1)
    add.w #$20,8(a1)
           btst    #0,$22(a0)
            beq.s HS_End2
            neg.w   $10(a1)
            sub.w   #$40,8(a1)
     
    HS_End2:
    clr.w $10(a0) ; clear X-velocity to move sonic directly down
    tst.w $12(a0) ; is Sonic moving upwards?
    bpl.s HS_End3 ; if not, branch
    clr.w $12(a0) ; clear X-velocity to move sonic directly down
     
    HS_End3:
    rts ; return
    ; End of function Sonic_HammerSpin

    Basically I want the objects to appear one by one in a flurry following the player. Right now they only appear all at the same time at the start of the animation or not at all.
     
    Last edited by a moderator: Mar 10, 2015
  2. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    question concerning splash screen. I'm trying to make one, but have it as a Title Screen. Routine works, but the image ain't It shows a black screen instead of

    [​IMG]

    this.

    I followed this guide

    http://sonicresearch.org/forums/index.php?showtopic=4213&page=2

    for the splash screen & this guide

    http://sonicresearch.org/forums/index.php?showtopic=4047

    for making files.
    I know the routine works (Besides the SpashScreen being a black screen) cause I can press start & goes to level & yes i know by doing this method LevelSelect & Demo won't run.

    EDIT: here's the code

    Code:
    ; ============================================================================================
    ; Sega Screen example - This code only works as a replacement for the SEGA screen
    ; For regular Splash screens, read the guide this code comes with!
    ; 2014, Hitaxas
    ; ============================================================================================
    CastlevaniaTitle: ; Stop previous music, clear vram and screen to set up this new screen
        move.l  #Sound_E4,d0                  ; set music ID to stop
        jsr    PlayControl            ; play music ID
        jsr    Pal_FadeFrom.w         ; fade palette out
        move   #$2700,sr                ; disable interrupts
        move.w ($FFFFF60C).w,d0         ; load VDP register 81XX data
        andi.b #%10111111,d0            ; set display to "disable"
        move.w d0,($FFC00004).l  ; save to VDP
        jsr    ClearPLC.w             ; clear pattern load cues
        jsr    ClearScreen.w          ; clear VRAM planes, sprite buffer and scroll buffer
        lea    ($FF0000).l,a1   ; load dump location
        lea    MAPS_SEGA.l,a0         ; load compressed mappings address
        move.w #320,d0                  ; prepare pattern index value to patch to mappings
        jsr    EniDec.w               ; decompress and dump
        move.l #$60000003,d0            ; prepare VRAM write mode address (Plane B E000)
        moveq  #$28-$01,d1              ; set map box draw width
        moveq  #$1E-$01,d2              ; set map box draw height
        jsr  ShowVDPGraphics          ; flush mappings to VRAM
        lea    ($FFC00004).l,a6  ; load VDP control port
        move.l #$68000000,(a6)          ; set VDP to VRAM write mode (Address 2800)
        lea    ART_SEGA.l,a0          ; load compressed art address
        jsr    NemDec.w               ; decompress and dump to VDP memory
        lea    Pal_SEGANew.l,a0          ; load palette address
        lea    ($FFFFFB80).w,a1    ; load palette buffer address
        moveq  #$F,d0                   ; set repeat times
    
    SegaScreen_PalLoop:
        move.l (a0)+,(a1)+              ; copy colours to buffer
        move.l (a0)+,(a1)+              ; ''
        dbf    d0,SegaScreen_PalLoop    ; repeat until done
        move.w ($FFFFF60C).w,d0         ; load VDP register 81XX data
        ori.b  #%01000000,d0            ; set display to "enable"
        move.w d0,(a6)                  ; save to VDP
        jsr    Pal_FadeTo               ; fade palette in
        move.w #3*60,($FFFFF614).w ; set delay time (3 seconds on a 60hz system)
    
    Sega_MainLoop:
        move.b #2,($FFFFF62A).w      ; set V-blank routine to run
        jsr    DelayProgram.w         ; wait for V-blank (decreases "Demo_Time_left")
        tst.b  ($FFFFF605).w            ; has player 1 pressed start button?
        bmi.s  Title_GotoLevel           ; if so, branch
        tst.w  ($FFFFF634).w       ; has the delay time finished?
        bne.s  Sega_MainLoop            ; if not, branch
    
    Title_GotoLevel:
        move.b #$0C,($FFFFF600).w       ; set the screen mode to Title Screen
        rts                             ; return    
    ; ===========================================================================
    
    ART_SEGA:        incbin    "ART_RIS1AGBW.bin"
                even
     
    MAPS_SEGA:        incbin    "MAP_RIS1AGBW.bin"
                
                even
    
    Pal_SEGANew:        incbin    "PAL_RIS1AGBW.bin"
        even
    
     
    Last edited by a moderator: Mar 10, 2015
  3. N30member

    N30member non-pro user btw Member

    Joined:
    Feb 15, 2014
    Messages:
    216
    Location:
    Kazakhstan
    Just do NOT use a splash screen as title screen. You can port image to Genesis tiles via GetArt.NET (also generates palette and mappings) or ImaGenesis, and set up mappings with SoniPlane. Then replace original title screen files. Give it a try, maybe it works. And, ummm...

    Code:
    ; Sega Screen example - This code only works as a replacement for the SEGA screen
    
     
    Last edited by a moderator: Mar 11, 2015
  4. Chaotix

    Chaotix Bad at Team Fortress 2 Member

    Joined:
    Aug 21, 2014
    Messages:
    190
    Location:
    England
    So, I want to make something unique. As I was searching videos on one of my favourite YouTubers, whoisthisgit, I wanted to make this a thing.

    https://www.youtube.com/watch?v=KHdad2ntAQY

    So, I have a few questions.

    1. How do I make it so that Sonic can't move with the D-Pad?

    2. How do I make Debug Mode start when the game starts?

    And 3. How do I make the game end when you defeat Silver Sonic?

    I'll just figure out the rest from Sonic Retro.
     
  5. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    1: Go to "Sonic_Move" and delete the respective checks for left and right. Also block "Sonic_Roll".

    2: In the title screen code is a line to disable "Debug_mode_flag". Enable it instead.

    3: Set the game mode to the ending sequence ($20) when Silver Sonic gets deleted (loc_39BA4).
     
  6. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    question on tutorials. I've made a Super Sonic Tutorial, not yet posted on here. Someone asked on

    Porting Sonic 2's Title Menu to Sonic 1, wanting the text highlighted Which originated from (Stolen Content Site) & I said on that post

    Question is, ANY KIND OF PORTING tutorials ok?
     
  7. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Does anyone know how I can make it so a level ends and goes to the next level only when the animal capsule is broken while passing a signpost will only show the results screen and then run the code for the signpost in SBZ Act 2? I use the Sonic 1 Hivebrain disassembly.

    @warr1or2: I've always wondered what should be allowed for tutorials. I wouldn't recommend posting it because I believe tutorials should only be for either simple additions (eggman monitor and splash screens) or things that will improve the game (bug fixes). Try posting it on asm2genesis where people will just assume it's stolen from Megamix (I'm kidding).
     
  8. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    424
    Location:
    Western New York, USA
    Branch to SBZ2 code if v_act (or whatever the hivebrain address equivalent is) is not equal to $02, instead of just when the current stage is SBZ 2, perhaps?
     
  9. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    @warr1or2: Just post it. It's up to you what you want to put out there, it is your work after all (at least I hope 0.e). Just make sure that it requires some common sense and elbow grease. For example, my recent S2 lost levels guide forces you to figure out how to actually implement the levels in the level select/level order on your own.

    EDIT: Looking at the guide on SGD, it looks just fine. I have to think to get through it, I approve!
     
    Last edited by a moderator: Mar 12, 2015
  10. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    I Only asked cause of a tutorial on (Stolen Content Site) which had sonic 2's title menu to sonic 1.

    & i say "(Stolen Content Site)" due to the fact, if i'm not mistaken, that site's link is not allowed.

    OK. It's simply in 2 parts.
     
  11. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    I want to have an animal capsule at the end of every act. The signposts will only be there as checkpoints and a break so it can tally up your score. The capsule will be the only thing that sends you to the next level. It will be like how modern Sonic games have loading times in between different parts of the level.
     
  12. Mohammad Sanjakdar

    Mohammad Sanjakdar Newcomer Trialist

    Joined:
    Jan 20, 2015
    Messages:
    12
    Location:
    Aleppo, Syria
    Hi everyone

    I want to ask something

    Where are the lines that makes GHZ boss swinging ball swing?

    i searched for them for an hour and everytime I test a line I get illegal instruction so I came to ask here.

    Thanks for any help given
     
  13. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    The ball object itself is Obj48. However, the swinging isn't done directly there. Instead, the code is simply called from there. In particular this snippet:

    Code:
    Obj48_Display:
    	>	bsr.w	sub_17C2A
    	>	move.b	$26(a0),d0
    	>	jsr	(Obj15_Move2).l
    		jmp	DisplaySprite
    ; ===========================================================================
    
    Obj48_Display2:				; XREF: Obj48_Index
    	>	bsr.w	sub_17C2A
    	>	jsr	(Obj48_Move).l
    		jmp	DisplaySprite
    
    The marked lines are all responsible for this. Obj48_Display is initiated when the boss fight has just started (the part where Eggman laughs and the ball moves down). Obj48_Display2, on the other hand, is continuously called until the boss is defeated.
     
    Last edited by a moderator: Mar 13, 2015
  14. Mohammad Sanjakdar

    Mohammad Sanjakdar Newcomer Trialist

    Joined:
    Jan 20, 2015
    Messages:
    12
    Location:
    Aleppo, Syria
    I went to swing move2 (obj15_move2) in Hivebrains dissasm and the obj48_swing and tried to change things there but I couldnt make the ball change its swinging

    I should have asked how to make the ball change its swinging not where are the lines

    And thanks Selbi for your help
     
  15. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    There are different ways you can change GHZ's boss' ball's swinging. If you want to make your own custom boss, figure out what the code does and edit it how you want. You can't really ask how to change it's swinging if there are so many different things you can do to change it. Good luck.
     
  16. Mohammad Sanjakdar

    Mohammad Sanjakdar Newcomer Trialist

    Joined:
    Jan 20, 2015
    Messages:
    12
    Location:
    Aleppo, Syria
    I figured how to change the boss movment in the beginning of the fight and where does he spawn (which was in the DLE)

    But I tried to figure out how to change his ball swinging and didnt do it so i came to ask here

    And thanks ProjectFM for your reply
     
  17. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
  18. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Just have it reload the main level graphics again. The game usually has those graphics loaded by default, and almost never overwrites them, so it only fixes that when exiting special stages and starting a level from the title screen. I'd give more technical advice, but I don't have a dis assembly in front of me at the moment. I believe the PLR value is "1", or something along those lines, put that into d0 and run the subroutine that deals with loading level graphics and what not.
     
  19. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    424
    Location:
    Western New York, USA

    "I want to have an animal capsule at the end of every act. The signposts will only be there as checkpoints and a break so it can tally up your score. The capsule will be the only thing that sends you to the next level. It will be like how modern Sonic games have loading times in between different parts of the level."

    What you would need to do is modify the signpost object to always do what it does at the end of SBZ 2, then place it wherever you want in the level. The only trick, is getting the signpost's art to be able to load mid-level, or fit in the already set PLC's.
     
    Last edited by a moderator: Jul 3, 2015
  20. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    The problem with that is that the animal capsule will also follow SBZ 2's code. My goal is to make it only follow that code when passing a signpost.