winport - fix memory of custom palettes (part of #711)
This commit is contained in:
parent
aaf41d9c78
commit
fe687d30f3
|
@ -227,6 +227,7 @@ static CFGSTRUCT fceuconfig[] =
|
||||||
AC(goptions),
|
AC(goptions),
|
||||||
NAC("eoptions",eoptions),
|
NAC("eoptions",eoptions),
|
||||||
NACA("cpalette",cpalette),
|
NACA("cpalette",cpalette),
|
||||||
|
NAC("cpalette_count",cpalette_count),
|
||||||
|
|
||||||
NACA("InputType",InputType),
|
NACA("InputType",InputType),
|
||||||
|
|
||||||
|
|
|
@ -683,11 +683,11 @@ int main(int argc,char *argv[])
|
||||||
DoVideoConfigFix();
|
DoVideoConfigFix();
|
||||||
DoTimingConfigFix();
|
DoTimingConfigFix();
|
||||||
|
|
||||||
//TODO - how can this do anything? we havent set a palette yet
|
//restore the last user-set palette (cpalette and cpalette_count are preserved in the config file)
|
||||||
//if(eoptions & EO_CPALETTE)
|
if(eoptions & EO_CPALETTE)
|
||||||
//{
|
{
|
||||||
// FCEUI_SetUserPalette(cpalette);
|
FCEUI_SetUserPalette(cpalette,cpalette_count);
|
||||||
//}
|
}
|
||||||
|
|
||||||
if(!t)
|
if(!t)
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,6 +107,7 @@ extern int soundquality;
|
||||||
extern bool muteTurbo;
|
extern bool muteTurbo;
|
||||||
extern bool swapDuty;
|
extern bool swapDuty;
|
||||||
|
|
||||||
|
extern int cpalette_count;
|
||||||
extern uint8 cpalette[64*8*3];
|
extern uint8 cpalette[64*8*3];
|
||||||
extern int srendlinen;
|
extern int srendlinen;
|
||||||
extern int erendlinen;
|
extern int erendlinen;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
|
int cpalette_count = 0;
|
||||||
u8 cpalette[64*8*3] = {0};
|
u8 cpalette[64*8*3] = {0};
|
||||||
extern int palhue;
|
extern int palhue;
|
||||||
extern bool palhdtv;
|
extern bool palhdtv;
|
||||||
|
@ -17,7 +18,8 @@ bool SetPalette(const char* nameo)
|
||||||
{
|
{
|
||||||
int readed = fread(cpalette, 1, sizeof(cpalette), fp);
|
int readed = fread(cpalette, 1, sizeof(cpalette), fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
FCEUI_SetUserPalette(cpalette,readed/3);
|
cpalette_count = readed/3;
|
||||||
|
FCEUI_SetUserPalette(cpalette,cpalette_count);
|
||||||
eoptions |= EO_CPALETTE;
|
eoptions |= EO_CPALETTE;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue