Basic Questions and Answers Thread

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

  1. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I'm not entirely sure what code you've changed, but:

    Code:
    Sonic_Loops:				; XREF: Obj01_Control
    		cmpi.b	#3,($FFFFFE10).w ; is level SLZ	?
    		beq.s	loc_13926	; if yes, branch
    		tst.b	($FFFFFE10).w	; is level GHZ ?
    		bne.w	locret_139C2	; if not, branch
    
    loc_13926:
    You will need to add an exception for LZ if you haven't already.
     
    Scrap Sorra likes this.
  2. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    The loop works, thanks!
    Side problem: I recently ported over the Peelout and the max speed animations, and they work fine, but whenever I go up a slope facing left the game doesn't seem to like it at all. upload_2020-9-28_2-23-47.png
    The game, freaking out.
    upload_2020-9-28_2-26-27.png
    upload_2020-9-28_2-26-52.png
    Then it loaded a few more random sprites and did that first screenshot. Worth noting is that this is kinda tricky to trigger, I have to use frame by frame on GENS to get it consistently.
    There also seems to be another strange bug where sideways red springs decide they don't want to have collision anymore.
    upload_2020-9-28_2-25-10.png
    When I imported the Peelout, you can release the dash without having to charge it up. I don't want this functionality in my hack but I don't know how to remove it
    Are there any ways I can fix these issues? (I know this is kinda a big thread but like I have a lot of questions to ask so yeah)
     

    Attached Files:

  3. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    Show the dash animation in a graphics editor. I'm 70% sure you're missing the actual angle frames.
     
  4. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    upload_2020-9-29_7-46-53.png
    Sonic has them all. Since Sonic's peelout animation only had 8 frames I used RotSprite to rotate the others. I went to make sure the bug still worked and yeah it still does.
    upload_2020-9-29_7-49-38.png
    Different result but it's still there. Worth noting is that the spring bug I mentioned earlier seems to have fixed itself somehow so that's nice.
     
  5. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    I can only suggest a few things
    1: Your animation script is wrong in some way
    2: You're loading the animation incorrectly
    3: You've reached a sprite limit.
    Here's a fix to the last one
     
    TheInvisibleSun and ProjectFM like this.
  6. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    I've already extended the sprite limit so I guess I'll just either have to hope this goes away somehow or just live with it. Moving on to yet another question, I implemented a chaos emerald monitor that sets a flag and the player will receive the chaos emerald upon clearing the act. I wanted the game to load the special stage results display text & emerald sprites when that happened, but I couldn't get it to work when I tried. Is there any way I can get it to work? (I can clear out the second palette line for the emerald's colors in most zones besides Marble since the second half of its background uses that row.)
     
  7. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    I always wanted to know how to work the loops in other zone, my problem is in SYZ.
     
  8. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    102
    Hello, I'm trying to make out how to make a moving platform step by step.

    So far I've figured out how to make a solid object the player can stand on, but am having issues figuring out how to make it move when they land on it:

    Code:
    ObjD1:
        moveq    #0,d0
        move.b    routine(a0),d0
        move.w    off_HPZP(pc,d0.w),d1
        jmp    off_HPZP(pc,d1.w)
    ; ===========================================================================
    off_HPZP:
        dc.w ObjD1_Init-off_HPZP
        dc.w ObjD1_Check-off_HPZP; 1
        dc.w ObjD1_Stand-off_HPZP; 1
    ; ===========================================================================
    
    ObjD1_Init:
        addq.b    #2,routine(a0)
        move.l    #ObjD1_MapUnc,mappings(a0)
        move.w    #0,art_tile(a0)
        jsr    JmpTo10_Adjust2PArtPointer
        move.b    #4,render_flags(a0)
        move.b    #$20,width_pixels(a0)
        move.b    #4,priority(a0)
    
    ObjD1_Check:
        move.w    #$20,d1
        move.w    #$10,d2
        move.w    #$10,d3
        move.w    x_pos(a0),d4
        jsr    SolidObject
        move.w    x_pos(a0),d0
        andi.w    #$FF80,d0
        sub.w    (Camera_X_pos_coarse).w,d0
        cmpi.w    #$280,d0
        bhi.w    DeleteObject
        jmp    DisplaySprite
    
    ObjD1_Stand:
        lea    (MainCharacter).w,a1 ; a1=character
        bsr.s    ObjD1_Player
        lea    (Sidekick).w,a1 ; a1=character
    
    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    
    ObjD1_Player:
        btst    #3,status(a1)
        beq.s    ObjD1_End
        bset    #1,status(a1)
        move.b    #2,routine(a1)
        move.w    y_vel(a0),y_vel(a1)
        jsr    CalcSine
        move.w    #$100,y_vel(a0)
        jsr    ObjectMove
    
    
    ObjD1_End:
        rts
    My ultimate intent is to make a platform that moves the player when they stand on it but then moves back to default position when they come off it, but right now I just wanna get past the basic of making the platform move AT ALL.
     
  9. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    I wanted to give Sonic a victory animation, but when I tried to do it it didn't work. I wanted it to function like Sonic 3's victory animation, and I've added the animation script and sprites to the files. Using Github disassam.

    Edit: Realized I changed part of the ending animation instead of the victory animation. I was trying to change out his standing animation with his victory animation.

    Second edit: I realized that there's something in the code preventing the results from playing if Sonic isn't at the far right end of the screen, but I have no idea what's doing this or how to change it.

    Third edit: Didn't look hard enough for an answer, so this post was pointless and should be ignored, sorry about that.
     
    Last edited: Oct 5, 2020
  10. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    General rule of thumb when asking for help regarding code related issues is to post your code so others can have an understanding of what you attempted to do.
     
  11. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    I did my homework this time and have gotten it to work the way I wanted it to. Sonic won't move and the results play, however there's one problem: The animation won't play. I'm trying to replace his standing animation so I put this in SonicRollSpeed.asm. Is there a way to get this to work?
    Code:
    loc_131AA:
            tst.w    obInertia(a0)    ; is Sonic moving?
            bne.s    loc_131CC    ; if yes, branch
            bclr    #2,obStatus(a0)
            move.b    #$13,obHeight(a0)
            move.b    #9,obWidth(a0)
    Victory_Check:
            tst.b    f_victory
            beq.s    Stand_Normal
            move.b     #id_victory,obAnim(a0)
            bra.s    loc_131CC
    
    Stand_Normal:      
           
            move.b    #id_Wait,obAnim(a0) ; use "standing" animation
            subq.w    #5,obY(a0)
    Edit: Forgot to clarify that I'm using the Github disassembly.
     
    Last edited: Oct 6, 2020
  12. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    May I suggest changing:

    Code:
    tst.b f_victory
    To:
    Code:
    tst.b (f_victory).w
    RAM addresses generally look like how I set it up in the second example in all 3 of the Sonic trilogy's disasms.
    Otherwise, all seems correct.
     
  13. Angel X

    Angel X Well-Known Member Member

    Joined:
    Sep 15, 2017
    Messages:
    291
    Location:
    Italy
    Hello guys!
    I'm here again to ask an easier question,this time in Sonic 3 & knuckles disassembly(skdisasm).
    How do use hyper sonic jumps without emeralds?

    I checked the code, do I need to change something here?
    Code:
    Sonic_InstaAndShieldMoves:
            tst.b    double_jump_flag(a0)        ; is Sonic currently performing a double jump?
            bne.w    locret_11A14            ; if yes, branch
            move.b    (Ctrl_1_pressed_logical).w,d0
            andi.b    #$70,d0                ; are buttons A, B, or C being pressed?
            beq.w    locret_11A14            ; if not, branch
            bclr    #Status_RollJump,status(a0)
            tst.b    (Super_Sonic_Knux_flag).w    ; check Super-state
            beq.s    Sonic_FireShield        ; if not in a super-state, branch
            bmi.w    Sonic_HyperDash            ; if Hyper, branch
            move.b    #1,double_jump_flag(a0)
            rts
    Code:
    Sonic_CheckTransform:
            cmpi.b    #7,(Super_emerald_count).w    ; does Sonic have all 7 Super Emeralds?
            bhs.s    loc_119E8            ; if yes, branch
            cmpi.b    #7,(Emerald_count).w        ; does Sonic have all 7 Chaos Emeralds?
            blo.s    Sonic_InstaShield        ; if not, branch
            tst.b    (Emeralds_converted_flag).w
            bne.s    Sonic_InstaShield
    
    loc_119E8:
            cmpi.w    #50,(Ring_count).w    ; does Sonic have at least 50 rings?
            blo.s    Sonic_InstaShield    ; if not, perform Insta-Shield
            tst.b    (Update_HUD_timer).w
            bne.s    Sonic_Transform
    
    Sonic_InstaShield:
            btst    #Status_Shield,status_secondary(a0)    ; does Sonic have an S2 shield (The Elementals were already filtered out at this point)?
            bne.s    locret_11A14                ; if yes, branch
            move.b    #1,(Shield+anim).w
            move.b    #1,double_jump_flag(a0)
            move.w    #sfx_InstaAttack,d0
            jmp    (Play_Sound_2).l
    Code:
    ; ---------------------------------------------------------------------------
    ; Subroutine allowing Sonic to jump
    ; ---------------------------------------------------------------------------
    
    ; =============== S U B R O U T I N E =======================================
    
    
    Sonic_Jump:
            move.b    (Ctrl_1_pressed_logical).w,d0
            andi.b    #button_B_mask|button_C_mask|button_A_mask,d0 ; is A, B or C pressed?
            beq.w    locret_118B2    ; if not, return
            moveq    #0,d0
            move.b    angle(a0),d0
            tst.b    (Reverse_gravity_flag).w
            beq.s    loc_117FC
            addi.b    #$40,d0
            neg.b    d0
            subi.b    #$40,d0
    
    loc_117FC:
            addi.b    #-$80,d0
            movem.l    a4-a6,-(sp)
            bsr.w    CalcRoomOverHead
            movem.l    (sp)+,a4-a6
            cmpi.w    #6,d1            ; does Sonic have enough room to jump?
            blt.w    locret_118B2        ; if not, branch
            move.w    #$680,d2
            tst.b    (Super_Sonic_Knux_flag).w
            beq.s    loc_11822
            move.w    #$800,d2    ; set higher jump speed if super
    
    loc_11822:
            btst    #Status_Underwater,status(a0)    ; Test if underwater
            beq.s    loc_1182E
            move.w    #$380,d2    ; set lower jump speed if under
    
    loc_1182E:
            moveq    #0,d0
            move.b    angle(a0),d0
            subi.b    #$40,d0
            jsr    (GetSineCosine).l
            muls.w    d2,d1
            asr.l    #8,d1
            add.w    d1,x_vel(a0)    ; make Sonic jump (in X... this adds nothing on level ground)
            muls.w    d2,d0
            asr.l    #8,d0
            add.w    d0,y_vel(a0)    ; make Sonic jump (in Y)
            bset    #Status_InAir,status(a0)
            bclr    #Status_Push,status(a0)
            addq.l    #4,sp
            move.b    #1,jumping(a0)
            clr.b    stick_to_convex(a0)
            move.w    #sfx_Jump,d0
            jsr    (Play_Sound_2).l
            move.b    default_y_radius(a0),y_radius(a0)
            move.b    default_x_radius(a0),x_radius(a0)
            btst    #Status_Roll,status(a0)
            bne.s    Sonic_RollJump
            move.b    #$E,y_radius(a0)
            move.b    #7,x_radius(a0)
            move.b    #2,anim(a0)    ; use "jumping" animation
            bset    #Status_Roll,status(a0)
            move.b    y_radius(a0),d0
            sub.b    default_y_radius(a0),d0
            ext.w    d0
            tst.b    (Reverse_gravity_flag).w
            beq.s    loc_118AE
            neg.w    d0
    
    loc_118AE:
            sub.w    d0,y_pos(a0)
    
    locret_118B2:
            rts
    ; ---------------------------------------------------------------------------
    
    Sonic_RollJump:
            bset    #Status_RollJump,status(a0)    ; set the rolling+jumping flag
            rts
    ; End of function Sonic_Jump
     
  14. Elijah Rosado

    Elijah Rosado Newcomer Trialist

    Joined:
    Feb 8, 2019
    Messages:
    9
    Location:
    United States
    Hello, everyone!
    I'm trying to load the shield and invincibility stars as an uncompressed format in Sonic 1 using SuperEgg's guide, but every time I do, this happens.
    I keep getting a blue screen every time I try to load Green Hill Zone.
    [​IMG]
    Sonic 1 (Blue Background).PNG
    I've tried a lot of methods to free up the VRAM, but nothing's working. I've removed the original PLCs for the shield and invincibility stars, and I've added the DMA Queue.
    Here's the code for Obj38 and Obj4A: (I'm using Hivebrain's ASM68K Disassembly for Sonic 1.)
    Code:
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Object 38 - shield
    ; ---------------------------------------------------------------------------
    
    Obj38:                                        ; XREF: Obj_Index
    ShieldObj_Main:
                    moveq   #0,d0
                    move.b  $24(a0),d0
                    move.w  Shield_Index(pc,d0.w),d1
                    jmp     Shield_Index(pc,d1.w)
    ; ===========================================================================
    
    Shield_Index:
                    dc.w    Shield_Init-Shield_Index
                    dc.w    ShieldChecks-Shield_Index
    ; ===========================================================================
    
    Shield_Init:
                    addq.b  #2,$24(a0)
                    move.l  #Map_Obj38, $0004(A0) ; Load Shield Map into place
                    move.b  #4,1(a0)
                    move.b  #1,$18(a0)
                    move.b  #$18,$19(a0)
                    move.w  #$541,2(a0)       ; Set VRAM location
                    move.l  #Art_Shield,d1 ; Call for Regular Shield Art
                    move.w  #$A820,d2 ; Load Art from this location (VRAM location*20)
                    move.w  #$200,d3
                    jsr     (QueueDMATransfer).l
                    btst    #7,($FFFFD002).w
                    beq.s   ShieldChecks
                    bset    #7,2(a0)
    ; ---------------------------------------------------------------------------
    
    ShieldChecks:
                    tst.b   ($FFFFFE2D).w     ; Test if Sonic has a shield
                    bne.s   SonicHasShield    ; If so, branch to do nothing
                    tst.b   ($FFFFFE2C).w     ; Test if Sonic got invisibility
                    beq.s   jmp_DeleteObj38   ; If so, delete object temporarily
    
    ShieldProperties:
                    move.w  ($FFFFD008).w,8(a0)    ; Load Main Character X-position
                    move.w  ($FFFFD00C).w,$C(a0)    ; Load Main Character Y-position
                    move.b  ($FFFFD022).w,$22(a0)   ; Something about Character status
                    lea     (Ani_obj38).l, a1       ; Load Animation Scripts into a1
                    jsr     AnimateSprite
                    jmp     DisplaySprite
    
    SonicHasShield:
                    rts
    
    jmp_DeleteObj38:                                ; loc_12648:
                    jmp     DeleteObject
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Object 4A - invincibility stars
    ; ---------------------------------------------------------------------------
    
    Obj4A:                    ; XREF: Obj_Index
    Invincibility_Main:
                    moveq   #0,d0
                    move.b  $24(a0),d0
    
    Invincibility_Init:
                    addq.b  #2,$24(a0)
                    move.l  #Map_obj38,4(a0) ; loads mapping
                    move.b  #4,1(a0)
                    move.b  #1,$18(a0)
                    move.b  #$10,$19(a0)
                    move.w  #$541,2(a0) ; shield specific code
                    move.l  #Art_Stars,d1
                    move.w  #$A820,d2
                    move.w  #$200,d3
                    jsr     (QueueDMATransfer).l
    ; ===========================================================================
    
    Obj4A_Stars:                           ; XREF: Obj38_Index
                   tst.b    ($FFFFFE2D).w ; does Sonic have invincibility?
                   beq.s    Obj4A_Delete2 ; if not, branch
                   move.w   ($FFFFF7A8).w,d0
                   move.b   $1C(a0),d1
                   subq.b   #1,d1
                   bra.s    Obj4A_StarTrail
    ; ===========================================================================
    
                   lsl.b    #4,d1
                   addq.b   #4,d1
                   sub.b    d1,d0
                   move.b   $30(a0),d1
                   sub.b    d1,d0
                   addq.b   #4,d1
                   andi.b   #$F,d1
                   move.b   d1,$30(a0)
                   bra.s    Obj4A_StarTrail2a
    ; ===========================================================================
    
    Obj4A_StarTrail: ; XREF: Obj4A_Stars
                   lsl.b   #3,d1
                   move.b  d1,d2
                   add.b   d1,d1
                   add.b   d2,d1
                   addq.b  #4,d1
                   sub.b   d1,d0
                   move.b  $30(a0),d1
                   sub.b   d1,d0
                   addq.b  #4,d1
                   cmpi.b  #$18,d1
                   bcs.s   Obj4A_StarTrail2
                   moveq   #0,d1
    
    Obj4A_StarTrail2:
                   move.b  d1,$30(a0)
    
    Obj4A_StarTrail2a:
                   lea     ($FFFFCB00).w,a1
                   lea     (a1,d0.w),a1
                   move.w  (a1)+,8(a0)
                   move.w  (a1)+,$C(a0)
                   move.b  ($FFFFD022).w,$22(a0)
                   lea     (Ani_obj38).l,a1
                   jsr     (AnimateSprite).l
                   jmp     (DisplaySprite).l
    ; ===========================================================================
    
    Obj4A_Delete2:                          ; XREF: Obj4A_Stars
                   jmp     (DeleteObject).l
    ; ===========================================================================
    I'm just not sure what I did wrong. Does anyone have any suggestions?

    EDIT: Never mind! I figured it out!

    I was supposed to replace dc.w 2 with dc.w 0 under the PLC_Main2 label in the Pattern Load Cues file! I guess I didn't look closely at the tutorial.
     
    Last edited: Nov 13, 2020
  15. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    Question
    I've been working on making Sonic 1's Level Select as an Option Menu.[​IMG]
    I want to use the Art_Text instead of Hex Offset (Like seen on the Sound test),
    Code:
    LevSelTextLoad:                ; XREF: TitleScreen
            lea    (LevelMenuText).l,a1
            lea    ($C00000).l,a6
            move.l    #$62100003,d4    ; screen position (text)
            move.w    #$E680,d3    ; VRAM setting
            moveq    #$14,d1        ; number of lines of text
    
    loc_34FE:                ; XREF: LevSelTextLoad+26j
            move.l    d4,4(a6)
            bsr.w    LevSel_ChgLine
            addi.l    #$800000,d4
            dbf    d1,loc_34FE
            moveq    #0,d0
            move.w    ($FFFFFF82).w,d0
            move.w    d0,d1
            move.l    #$62100003,d4
            lsl.w    #7,d0
            swap    d0
            add.l    d0,d4
            lea    (LevelMenuText).l,a1
            lsl.w    #3,d1
            move.w    d1,d0
            add.w    d1,d1
            add.w    d0,d1
            adda.w    d1,a1
            move.w    #$C680,d3
            move.l    d4,4(a6)
            bsr.w    LevSel_ChgLine
            move.w    #$E680,d3
            cmpi.w    #$14,($FFFFFF82).w
            bne.s    loc_3550
            move.w    #$C680,d3
    
    loc_3550:
            move.l    #$6C300003,($C00004).l ; screen    position (sound    test)
            move.w    ($FFFFFF84).w,d0
            addi.w    #$80,d0
            move.b    d0,d2
            lsr.b    #4,d0
            bsr.w    LevSel_ChgSnd
            move.b    d2,d0
            bsr.w    LevSel_ChgSnd
            rts   
    ; End of function LevSelTextLoad
    
    
    ; ||||||||||||||| S U B    R O U T    I N E |||||||||||||||||||||||||||||||||||||||
    
    
    LevSel_ChgSnd:                ; XREF: LevSelTextLoad
            andi.w    #$F,d0
            cmpi.b    #$A,d0
            bcs.s    loc_3580
            addi.b    #7,d0
    
    loc_3580:
            add.w    d3,d0
            move.w    d0,(a6)
            rts   
    ; End of function LevSel_ChgSnd
    
    
    ; ||||||||||||||| S U B    R O U T    I N E |||||||||||||||||||||||||||||||||||||||
    
    
    LevSel_ChgLine:                ; XREF: LevSelTextLoad
            moveq    #$17,d2        ; number of characters per line
    
    loc_3588:
            moveq    #0,d0
            move.b    (a1)+,d0
            bpl.s    loc_3598
            move.w    #0,(a6)
            dbf    d2,loc_3588
            rts   
    ; ===========================================================================
    
    loc_3598:                ; XREF: LevSel_ChgLine
            add.w    d3,d0
            move.w    d0,(a6)
            dbf    d2,loc_3588
            rts   
    ; End of function LevSel_ChgLine
    
    This is from an Unmodified ASM. I've already gotten it to read ASCII. I'm wondering what in this code do I change to have it, that Left and Right would change the texts for "Character" and have it where i drew it in paint?
     
  16. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    I would like to know how to change the camera boundaries for zones in Sonic 1 (github). If someone could help me out that would be very appreciated.
     
  17. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    Same basic stuff as to what is in this tutorial applies. Just ignore the 1st step, and go to LevelSizes (should be in a separate file within _inc):
    http://sonicresearch.org/community/index.php?threads/sonic-1-how-to-work-with-resizing.5857/
    You'll also need this:
    http://sonicresearch.org/community/...ents-and-how-to-use-them-in-your-levels.5860/

    Also, keep in mind that Sonic 1 and Sonic 2 level layouts do eventually hit a max height and width, so either design around those limitations or suffer through changing the level layout format to one which allows for more space.
     
    Scrap Sorra, Kilo and DeltaWooloo like this.
  18. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    I would like to know how to get objects to use different palette lines in game. For example, in my hack I'm gonna make ring colors change by zone, and I wanted to make the 10 ring monitor use the ring colors, but I don't know how to change its palette line. I tried changing it in sonmaped, but I couldn't get it to work. Any way I can change its palette line?
     
  19. Spiritmaster

    Spiritmaster Megadrive-kun Member

    Joined:
    May 11, 2009
    Messages:
    61
    Location:
    Krasnodar, Russian Federation
    Is current buildscript of complete S3K of disasm on Github guaranteed to have resulting file with working saves (S3K only) when it is written on a real ROM chip (not Everdrive) on cart with SRAM? It's a question from other, non-SSRG, user who want to build a singlecart version. Again, Everdrive is out of question. From his explanation the cart setup is more or less the same as basic S3 alone, but I can refine my wording of conditions he has if needed.
     
    Last edited: Oct 25, 2020
  20. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    424
    Location:
    Western New York, USA
    Every visible object will have a piece of code that looks something like this:

    Lamp_Main: ; Routine 0
    addq.b #2,obRoutine(a0)
    move.l #Map_Lamp,obMap(a0)
    move.w #$6C0,obGfx(a0) ;
    ...
    The line in bold determines the palette, and the VRAM location the object is getting its art from. The first digit is typically used to designate the palette line, but since the lamppost uses line 1, this number is 0, and is thus not shown. Each palette line can be designated in intervals of 'two' (so if line 1 is $0, line 2 is is $2, line 3 is $4, and so on). So, to get it to use line 4 for example, the '#$6C0' would become '#$66C0'.

    Add checks and branches as needed to allow them to work differently per zone.

    Hope this helps! (somewhere on the internet, there is a far better, more in-depth explanation of how it works than this, but I forgot where it is)
     
    ProjectFM and Scrap Sorra like this.