[4.5] Quick fix for the 1st background/sprite color palette issue

dale_coop

Moderator
Staff member
In the 4.5, there is a small issue, the loading palette is done differently than the previous version, causing the screen 1st color always been rewritten by the Player 1st color (the transparent color #0):

2020-07-20-09-32-24-NES-MAKER-4-5-2-Version-0x175-Tutorial-Project-MST.png

(my screen uses the 0C color as 1st color)

2020-07-20-09-31-41-NES-MAKER-4-5-2-Version-0x175-Tutorial-Project-MST.png

(my player uses the 15 color as transparent color)

The issue, on every screens, the screen 1st color is always 15:
2020-07-20-09-31-21-FCEUX-2-2-3-game.png



Here's a quick fix to change that "intended behavior",:

1) Open the Windows Explorer, then in your "NESmaker" folder, navigate to the "GameEngineData\Routines\BASE_4_5\Game\DataLoadScripts" subfolder. Make a new file and name it "LoadSpritePalettes_NMI_DC.asm" for example (you could duplicate the "LoadSpritePalettes_NMI.asm" and modify it).
Then, modify that new "LoadSpritePalettes_NMI_DC.asm" script and replace with that code:

Code:
;; Load sprites palettes
;; dale_coop: modified to start writing at 3F11 (ignoring the palette 0 color 0)
 
    LDA $2002
    LDA #$3F
    STA $2006
    LDA #$11
    STA $2006
    LDX #$01
LoadSpritePal_NMI:
    LDA sprPal,x
    STA $2007
    INX
    CPX #$10
    BNE LoadSpritePal_NMI
 
    LDA updateScreenData
    AND #%11111101
    STA updateScreenData
 
    ;;; this script runs in-line.


2) In NESmaker, open the "Project Settings > Script Settings" and assign the new "LoadSpritePalettes_NMI_DC.asm" to the "Load Sprite Palettes" element (under "Subroutines"):

2020-07-20-09-51-37-NES-MAKER-4-5-2-Version-0x175-Tutorial-Project-MST.png



VoilĂ , now the screen 1st color overwrite the player 1st color:

2020-07-20-09-45-33-FCEUX-2-2-3-game.png



But, this new behavior could cause other issues... it needs to be more tested.
 
Last edited:

jimbox114

New member
Hello wanted to thank you for this post. I could not figure out why my game was having palette issues and your script fixed the problem for me.
 
i was having this issue with sprite palette loading and my start screen was messed up, i tried this script change and it got worse.. im at a loss here pls help
 

dale_coop

Moderator
Staff member
Make sure to assign your modified script to the "Load Sprites Palettes" (not the "Load Palettes" one).
If you follow the instructions (and the screenshot), it should work.

Else share what you did (script and screenshots of the settings... like in the my original post)
 
Top Bottom