From 95890b21ea07b25f176001311cb03b738aca7b55 Mon Sep 17 00:00:00 2001 From: zeromus <zeromus@users.sf.net> Date: Mon, 12 Oct 2015 22:40:14 +0000 Subject: [PATCH] fix message display during NSF rendering --- trunk/src/nsf.cpp | 11 ++++++----- trunk/src/palette.cpp | 24 +++++++++--------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/trunk/src/nsf.cpp b/trunk/src/nsf.cpp index a47640aa..453e4fa9 100644 --- a/trunk/src/nsf.cpp +++ b/trunk/src/nsf.cpp @@ -568,13 +568,14 @@ void DrawNSF(uint8 *XBuf) } } - DrawTextTrans(ClipSidesOffset+XBuf+10*256+4+(((31-strlen((char*)NSFHeader.SongName))<<2)), 256, NSFHeader.SongName, 6); - DrawTextTrans(ClipSidesOffset+XBuf+26*256+4+(((31-strlen((char*)NSFHeader.Artist))<<2)), 256,NSFHeader.Artist, 6); - DrawTextTrans(ClipSidesOffset+XBuf+42*256+4+(((31-strlen((char*)NSFHeader.Copyright))<<2)), 256,NSFHeader.Copyright, 6); + static const int kFgColor = 1; + DrawTextTrans(ClipSidesOffset+XBuf+10*256+4+(((31-strlen((char*)NSFHeader.SongName))<<2)), 256, NSFHeader.SongName, kFgColor); + DrawTextTrans(ClipSidesOffset+XBuf+26*256+4+(((31-strlen((char*)NSFHeader.Artist))<<2)), 256,NSFHeader.Artist, kFgColor); + DrawTextTrans(ClipSidesOffset+XBuf+42*256+4+(((31-strlen((char*)NSFHeader.Copyright))<<2)), 256,NSFHeader.Copyright, kFgColor); - DrawTextTrans(ClipSidesOffset+XBuf+70*256+4+(((31-strlen("Song:"))<<2)), 256, (uint8*)"Song:", 6); + DrawTextTrans(ClipSidesOffset+XBuf+70*256+4+(((31-strlen("Song:"))<<2)), 256, (uint8*)"Song:", kFgColor); sprintf(snbuf,"<%d/%d>",CurrentSong,NSFHeader.TotalSongs); - DrawTextTrans(XBuf+82*256+4+(((31-strlen(snbuf))<<2)), 256, (uint8*)snbuf, 6); + DrawTextTrans(XBuf+82*256+4+(((31-strlen(snbuf))<<2)), 256, (uint8*)snbuf, kFgColor); { static uint8 last=0; diff --git a/trunk/src/palette.cpp b/trunk/src/palette.cpp index 94990a46..40773709 100644 --- a/trunk/src/palette.cpp +++ b/trunk/src/palette.cpp @@ -498,9 +498,9 @@ void FCEU_ResetPalette(void) static void ChoosePalette(void) { - //if it's an NSF, there's NO palette? that's right, only the 'unvarying' palette will get used + //NSF uses a fixed palette always: if(GameInfo->type==GIT_NSF) - palo = NULL; + palo = default_palette[0]; //user palette takes priority over others else if(palette_user_available) palo = palette_user; @@ -537,19 +537,13 @@ void WritePalette(void) for(x=7;x<256;x++) FCEUD_SetPalette(x,205,205,205); - if(GameInfo->type==GIT_NSF) - { - #ifdef _S9XLUA_H - FCEU_LuaUpdatePalette(); - #endif - } - else - { - //sets palette entries >= 128 with the 64 selected main colors - for(x=0;x<64;x++) - FCEUD_SetPalette(128+x,palo[x].r,palo[x].g,palo[x].b); - SetNESDeemph_OldHacky(lastd,1); - } + //sets palette entries >= 128 with the 64 selected main colors + for(x=0;x<64;x++) + FCEUD_SetPalette(128+x,palo[x].r,palo[x].g,palo[x].b); + SetNESDeemph_OldHacky(lastd,1); + #ifdef _S9XLUA_H + FCEU_LuaUpdatePalette(); + #endif } void FCEUI_GetNTSCTH(int *tint, int *hue)