Pallette Fixing

Discussion in 'Discussion and Q&A Archive' started by Psi, Jan 10, 2015.

Thread Status:
Not open for further replies.
  1. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    98
    I've been trying to fine tune some of the palette issues in my Sonic 1 hack, while I've worked out tricks for a lot of the more glaring cases, I wonder if there are solutions for any of these:

    * Is there any way to get the title card screen to load the second palette line without screwing up the transition in any way? I more or less just want it so I can use the yellow for the act numbers.

    * Is there a way to have separate tiles for when the HUD font flashes red. I switched the tiles to load from the yellow of the second line, but editing on the first line means it doesn't flash the right colour. Whenever I try to add tiles it just ends up corrupted by the score number font supposedly due to VRAM placement. Any suggestible loophole here?

    * Another concerning the HUD font, I want a separate file to load during the Special Stage results screen. I can get half way with this since I can get the file to load using the Pattern Load Cues file, but after loading the new file from the SS results it then uses that file for normal gameplay rather than switching back. Is there a branch to keep both files to particular screens?
     
    Last edited by a moderator: Jan 10, 2015
  2. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    409
    Location:
    Buffalo, NY, USA
    1) What do you mean by "without screwing up the transition"? Not sure what you mean, but when I change the Palette line of the Title Card, it just changes the color of the oval and the number, but it doesn't mess with the fade from black.
     
    2) See Below; This trick may work mid-stage by calling for HUD_Update and HUD_Base ( Of course, you'd have to edit those subroutines to skip the SCORE and TIME text in this instance if you don't want those to be affected) in Object 21 HUD.asm, when you have no rings (and it branches to @norings, or your disassembly's equivalent). For me it works, but it results in an odd bug that slightly changes the display of the numbers (but maybe you might find a way around that issue).
     
    3) Yes. I'm guessing you have to go here in "sonic.asm", and just include and load the new art:
     


    loc_47D4:
    tst.w (v_demolength).w
    bne.s SS_FinLoop

    disable_ints
    lea (vdp_control_port).l,a6
    move.w #$8200+(vram_fg>>10),(a6) ; set foreground nametable address
    move.w #$8400+(vram_bg>>13),(a6) ; set background nametable address
    move.w #$9001,(a6) ; 64-cell hscroll size
    bsr.w ClearScreen
    locVRAM $B000
    lea (Nem_TitleCardNewArt).l,a0 ;load title card patterns->>Use this line to Load Different Art
    bsr.w NemDec
    jsr Hud_Base ; ---->>>>>Go to this subroutine to load new HUD art
    enable_ints
    moveq #palid_SSResult,d0
    bsr.w PalLoad2 ; load results screen palette
    moveq #plcid_Main,d0
    bsr.w NewPLC
    moveq #plcid_SSResult,d0
    bsr.w AddPLC ; load results screen patterns

    For different HUD art (the SCORE and RINGS text), in my hack I set up the HUD so that it loads an alternate tile set to show the time when the "Got Through Card" ran. I did this by creating a variable that was turned on at the right time (since you're working with the Special Stage, you might be able to check if the gamemode is Special). As seen by the "jsr Hud_Base" above, you can configure the subroutine to load the alternate art (should be in the file "HUD_Update.asm"):

     


    Hud_Base: ; XREF: GM_Level; SS_EndLoop; GM_Ending
    lea ($C00000).l,a6
    bsr.w Hud_Lives
    locVRAM $DC40
    cmpi.b #id_Special,(v_gamemode).w ;->>> Since you are using the Special Stage, you may be able to use the Special Stage Gamemode check
    beq.w LoadOtherArt
    lea Hud_TilesBase(pc),a2
    bra.w ContinueCode
    LoadOtherArt:
    lea     Hud_TilesBase2(pc),a2
    ContinueCode:
    move.w #$E,d2

    loc_1C83E: ; XREF: Hud_LoadZero
    cmpi.b #id_Special,(v_gamemode).w ;
    beq.w LoadOtherArt2
             lea    Art_Hud(pc),a1
    bra.w loc_1C842
    LoadOtherArt2:
    lea    Art_Hud2(pc),a1 ;>>>>>>>>>>>>>>Load New Art

    loc_1C842:
    move.w #$F,d1
    move.b (a2)+,d0
    bmi.s loc_1C85E
    ext.w d0
    lsl.w #5,d0
    lea (a1,d0.w),a3

    loc_1C852:
    move.l (a3)+,(a6)
    dbf d1,loc_1C852

    loc_1C858:
    dbf d2,loc_1C842

    rts
    ; ===========================================================================

    loc_1C85E:
    move.l #0,(a6)
    dbf d1,loc_1C85E

    bra.s loc_1C858
    ; End of function Hud_Base

    ; ===========================================================================
    Hud_TilesBase: dc.b $16, $FF, $FF, $FF, $FF, $FF, $FF, 0, 0, $14, 0, 0
    Hud_TilesZero: dc.b $FF, $FF, 0, 0
    Hud_TilesBase2:    dc.b $16, $FF, $FF, $FF, $FF, $FF, $FF,    0, 0, $14, 0, 0
    Hud_TilesZero2:    dc.b $FF, $FF, 0, 0


    The above lines change the time, but further down in the file there's a subroutine called "Hud_LoadArt", where you need to do the same thing to change the "Score" and "Ring" Art.
     
  3. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    98
    I heard somewhere you can't alter the visible palette lines without screwing up the black out at the start.

    Well more specifically I need two palette lines rather than just changing the one, the first for the oval and the second for the numbers. I can alter the line, but it leads to this transition problem:


    [​IMG]

    [​IMG]

    I can't get the check for the special stage results to work either, though it might have to do with me using the Hivebrain version, is the gamemode check any different for it (I've found the equivalent for checking for special stage ($10), though don't know if it's any different for the results screen)?
     
    Last edited by a moderator: Jan 14, 2015
  4. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    98
    Okay managed to pull of the first edit by extending Sonic's palette to have the second line of yellows, however it indeed DOES screw up the transition, making the sprites with that colour load more suddenly than the others (and sometimes before the objects are loaded properly). It also fucks up the ending. Probably not worth it then.

    Does anyone know if special stage and special stage results are a separate game mode bit by the way?
     
  5. N30member

    N30member non-pro user btw Member

    Joined:
    Feb 15, 2014
    Messages:
    216
    Location:
    Kazakhstan
    If you search for "GameModeArray", yeah, special stage is referred as separate game mode (at least it is separate from normal level mode).
     
  6. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    409
    Location:
    Buffalo, NY, USA
    The Special Stage and the results screen aren't separate though. Upon further inspection of the special stage loop code however, it turns out the gamemode does change to 'Level' before the results screen. But, what you could do instead is create a new variable that would be set at the beginning of the Special Stage routines, and turned off after they're all over.
     
Thread Status:
Not open for further replies.