Cleaned up some code.

This commit is contained in:
rheiny 2007-02-05 20:41:23 +00:00
parent 54ff3f3b9d
commit be3ec4a072
12 changed files with 404 additions and 217 deletions

View File

@ -50,103 +50,149 @@ static int FReadString(FILE *fp, char *str, int n)
static void GetValueR(FILE *fp, char *str, void *v, int c)
{
char buf[256];
int s;
char buf[256];
int s;
while(FReadString(fp,buf,256))
{
fread(&s,1,4,fp);
if(!strcmp(str, buf))
{
if(!c) // String, allocate some memory.
{
if(!(*(char **)v=(char*)malloc(s)))
goto gogl;
fread(*(char **)v,1,s,fp);
continue;
}
else if(s>c || s<c)
{
gogl:
fseek(fp,s,SEEK_CUR);
continue;
}
fread((uint8*)v,1,c,fp);
}
else
fseek(fp,s,SEEK_CUR);
}
fseek(fp,4,SEEK_SET);
while(FReadString(fp,buf,256))
{
fread(&s,1,4,fp);
if(!strcmp(str, buf))
{
if(!c) // String, allocate some memory.
{
if(!(*(char **)v=(char*)malloc(s)))
goto gogl;
fread(*(char **)v,1,s,fp);
continue;
}
else if(s>c || s<c)
{
gogl:
fseek(fp,s,SEEK_CUR);
continue;
}
fread((uint8*)v,1,c,fp);
}
else
{
fseek(fp,s,SEEK_CUR);
}
}
fseek(fp,4,SEEK_SET);
}
static void SetValueR(FILE *fp, char *str, void *v, int c)
void SetValueR(FILE *fp, const char *str, void *v, int c)
{
fwrite(str,1,strlen(str)+1,fp);
fwrite((uint8*)&c,1,4,fp);
fwrite((uint8*)v,1,c,fp);
fwrite(str,1,strlen(str)+1,fp);
fwrite((uint8*)&c,1,4,fp);
fwrite((uint8*)v,1,c,fp);
}
static void SaveParse(CFGSTRUCT *cfgst, FILE *fp)
{
int x=0;
while(cfgst[x].ptr)
{
if(!cfgst[x].name) // Link to new config structure
{
SaveParse((CFGSTRUCT*)cfgst[x].ptr,fp); // Recursion is sexy. I could
// save a little stack space if I made
// the file pointer a non-local
// variable...
x++;
continue;
}
if(cfgst[x].len) // Plain data
SetValueR(fp,cfgst[x].name,cfgst[x].ptr,cfgst[x].len);
else // String
if(*(char **)cfgst[x].ptr) // Only save it if there IS a string.
SetValueR(fp,cfgst[x].name,*(char **)cfgst[x].ptr,
strlen(*(char **)cfgst[x].ptr)+1);
x++;
}
}
void SaveFCEUConfig(char *filename, CFGSTRUCT *cfgst)
{
FILE *fp;
fp=fopen(filename,"wb");
if(fp==NULL) return;
SaveParse(cfgst,fp);
fclose(fp);
}
static void LoadParse(CFGSTRUCT *cfgst, FILE *fp)
/**
* Parses a configuration structure and saves information from the structure into a file.
*
* @param cfgst The configuration structure.
* @param fp File handle.
**/
void SaveParse(const CFGSTRUCT *cfgst, FILE *fp)
{
int x=0;
while(cfgst[x].ptr)
{
if(!cfgst[x].name) // Link to new config structure
{
LoadParse((CFGSTRUCT*)cfgst[x].ptr,fp);
x++;
continue;
}
GetValueR(fp,cfgst[x].name,cfgst[x].ptr,cfgst[x].len);
x++;
}
{
if(!cfgst[x].name) // Link to new config structure
{
SaveParse((CFGSTRUCT*)cfgst[x].ptr, fp); // Recursion is sexy. I could
// save a little stack space if I made
// the file pointer a non-local
// variable...
x++;
continue;
}
if(cfgst[x].len)
{
// Plain data
SetValueR(fp,cfgst[x].name,cfgst[x].ptr,cfgst[x].len);
}
else
{
// String
if(*(char **)cfgst[x].ptr)
{
// Only save it if there IS a string.
SetValueR(fp,cfgst[x].name,*(char **)cfgst[x].ptr, strlen(*(char **)cfgst[x].ptr)+1);
}
}
x++;
}
}
void LoadFCEUConfig(char *filename, CFGSTRUCT *cfgst)
/**
* Stores information from a configuration struct into a configuration file.
*
* @param filename Name of the configuration file
* @param cfgst The configuration struct
**/
void SaveFCEUConfig(const char *filename, const CFGSTRUCT *cfgst)
{
FILE *fp;
FILE *fp = fopen(filename,"wb");
fp=fopen(filename,"rb");
if(fp==NULL) return;
LoadParse(cfgst,fp);
fclose(fp);
if(fp==NULL)
{
return;
}
SaveParse(cfgst, fp);
fclose(fp);
}
/**
* Parses information from a file into a configuration structure.
*
* @param cfgst The configuration structure.
* @param fp File handle.
**/
void LoadParse(CFGSTRUCT *cfgst, FILE *fp)
{
int x = 0;
while(cfgst[x].ptr)
{
if(!cfgst[x].name) // Link to new config structure
{
LoadParse((CFGSTRUCT*)cfgst[x].ptr, fp);
x++;
continue;
}
GetValueR(fp, cfgst[x].name, cfgst[x].ptr, cfgst[x].len);
x++;
}
}
/**
* Loads config information from the config file.
*
* @param filename Name of the config file.
**/
void LoadFCEUConfig(const char *filename, CFGSTRUCT *cfgst)
{
FILE *fp = fopen(filename,"rb");
if(fp==NULL)
{
return;
}
LoadParse(cfgst, fp);
fclose(fp);
}

View File

@ -5,8 +5,8 @@ typedef struct {
int len;
} CFGSTRUCT;
void SaveFCEUConfig(char *filename, CFGSTRUCT *cfgst);
void LoadFCEUConfig(char *filename, CFGSTRUCT *cfgst);
void SaveFCEUConfig(const char *filename, const CFGSTRUCT *cfgst);
void LoadFCEUConfig(const char *filename, CFGSTRUCT *cfgst);
/* Macros for building CFGSTRUCT structures. */

View File

@ -20,6 +20,9 @@
#include "../common/args.h"
/**
* Parses commandline arguments
**/
char *ParseArgies(int argc, char *argv[])
{
//int x; //mbg merge 7/17/06 removed
@ -33,8 +36,12 @@ char *ParseArgies(int argc, char *argv[])
{"-nothrottle",0,&eoptions,0x8000|EO_NOTHROTTLE},
};
if(argc<=1) return(0);
if(argc <= 1)
{
return(0);
}
ParseArguments(argc-2, &argv[1], FCEUArgs);
return(argv[argc-1]);
}

View File

@ -26,7 +26,10 @@
/* */
/****************************************************************/
static CFGSTRUCT fceuconfig[]={
/**
* Structure that contains configuration information
**/
static CFGSTRUCT fceuconfig[] = {
ACS(rfiles[0]),
ACS(rfiles[1]),
@ -125,13 +128,15 @@ static CFGSTRUCT fceuconfig[]={
static void SaveConfig(char *filename)
{
SaveFCEUConfig(filename,fceuconfig);
SaveFCEUConfig(filename,fceuconfig);
}
static void LoadConfig(char *filename)
void LoadConfig(const char *filename)
{
FCEUI_GetNTSCTH(&ntsctint,&ntschue);
LoadFCEUConfig(filename,fceuconfig);
FCEUI_SetNTSCTH(ntsccol,ntsctint,ntschue);
FCEUI_GetNTSCTH(&ntsctint, &ntschue);
LoadFCEUConfig(filename, fceuconfig);
FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);
}

View File

@ -1291,8 +1291,11 @@ void ApplyDefaultCommandMapping(void)
int i;
memset(FCEUD_CommandMapping, 0, sizeof(FCEUD_CommandMapping));
for(i=0; i<NUM_DEFAULT_MAPPINGS; ++i)
{
FCEUD_CommandMapping[DefaultCommandMapping[i].cmd] = DefaultCommandMapping[i].key;
}
}
int FCEUD_TestCommandState(int c)

View File

@ -75,27 +75,42 @@ HRESULT ddrval;
// cheats, misc, nonvol, states, snaps, ..., base
static char *DOvers[6]={0,0,0,0,0,0};
static char *defaultds[5]={"cheats","sav","fcs","snaps","movie"};
static const char *defaultds[5]={"cheats","sav","fcs","snaps","movie"};
static char TempArray[2048];
/**
* Contains the base directory of FCE
**/
static char BaseDirectory[2048];
void SetDirs(void)
{
int x;
static int jlist[6]=
{FCEUIOD_CHEATS,FCEUIOD_MISC,FCEUIOD_NV,FCEUIOD_STATE,FCEUIOD_SNAPS, FCEUIOD__COUNT};
int x;
FCEUI_SetSnapName(eoptions&EO_SNAPNAME);
static int jlist[6]= {
FCEUIOD_CHEATS,
FCEUIOD_MISC,
FCEUIOD_NV,
FCEUIOD_STATE,
FCEUIOD_SNAPS,
FCEUIOD__COUNT};
for(x=0;x<6;x++)
{
FCEUI_SetDirOverride(jlist[x], DOvers[x]);
}
if(DOvers[5])
FCEUI_SetBaseDirectory(DOvers[5]);
else
FCEUI_SetBaseDirectory(BaseDirectory);
FCEUI_SetSnapName(eoptions & EO_SNAPNAME);
for(x=0; x < sizeof(jlist) / sizeof(*jlist); x++)
{
FCEUI_SetDirOverride(jlist[x], DOvers[x]);
}
if(DOvers[5])
{
FCEUI_SetBaseDirectory(DOvers[5]);
}
else
{
FCEUI_SetBaseDirectory(BaseDirectory);
}
}
/* Remove empty, unused directories. */
void RemoveDirs(void)
@ -110,30 +125,44 @@ void RemoveDirs(void)
}
}
/**
* Creates the default directories.
**/
void CreateDirs(void)
{
int x;
int x;
for(x=0;x<5;x++)
if(!DOvers[x])
{
sprintf(TempArray,"%s\\%s",DOvers[5]?DOvers[5]:BaseDirectory,defaultds[x]);
CreateDirectory(TempArray,0);
}
for(x = 0; x < sizeof(defaultds) / sizeof(*defaultds); x++)
{
if(!DOvers[x])
{
sprintf(TempArray, "%s\\%s", DOvers[5] ? DOvers[5] : BaseDirectory, defaultds[x]);
CreateDirectory(TempArray,0);
}
}
}
static char *gfsdir=0;
/**
* Fills the BaseDirectory string
*
* TODO: Potential buffer overflow caused by limited size of BaseDirectory?
**/
void GetBaseDirectory(void)
{
int x;
BaseDirectory[0]=0;
GetModuleFileName(0,(LPTSTR)BaseDirectory,2047);
unsigned int i;
GetModuleFileName(0, (LPTSTR)BaseDirectory, sizeof(BaseDirectory) - 1);
for(x=strlen(BaseDirectory);x>=0;x--)
{
if(BaseDirectory[x]=='\\' || BaseDirectory[x]=='/')
{BaseDirectory[x]=0;break;}
}
// Search for the last / or \ in the directory and terminate the string there
for(i = strlen(BaseDirectory); i >= 0 ; i--)
{
if(BaseDirectory[i]=='\\' || BaseDirectory[i]=='/')
{
BaseDirectory[i] = 0;
return;
}
}
}
static int exiting=0;
@ -333,7 +362,6 @@ static void DriverKill(void)
}
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
void ApplyDefaultCommandMapping(void);
@ -347,25 +375,28 @@ void _updateMemWatch() {
HANDLE mapGameMemBlock;
HANDLE mapRAM;
uint32 *BotInput;
void win_AllocBuffers(uint8 **GameMemBlock, uint8 **RAM) {
void win_AllocBuffers(uint8 **GameMemBlock, uint8 **RAM)
{
mapGameMemBlock = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, 131072,"fceu.GameMemBlock");
if(mapGameMemBlock == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
{
//mbg 7/38/06 - is this the proper error handling?
//mbg 7/28/06 - is this the proper error handling?
//do we need to indicate to user somehow that this failed in this emu instance?
CloseHandle(mapGameMemBlock);
mapGameMemBlock = NULL;
*GameMemBlock = (uint8 *) malloc(131072);
*RAM = (uint8 *) malloc(2048);
}
else
{
*GameMemBlock = (uint8 *)MapViewOfFile(mapGameMemBlock, FILE_MAP_WRITE, 0, 0, 0);
*GameMemBlock = (uint8 *)MapViewOfFile(mapGameMemBlock, FILE_MAP_WRITE, 0, 0, 0);
// set up shared memory mappings
mapRAM = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, 0x800,"fceu.RAM");
*RAM = (uint8 *)MapViewOfFile(mapRAM, FILE_MAP_WRITE, 0, 0, 0);
mapRAM = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, 0x800,"fceu.RAM");
*RAM = (uint8 *)MapViewOfFile(mapRAM, FILE_MAP_WRITE, 0, 0, 0);
}
// Give RAM pointer to state structure
@ -412,6 +443,13 @@ void win_FreeBuffers(uint8 *GameMemBlock, uint8 *RAM) {
}
#endif
void do_exit()
{
DriverKill();
timeEndPeriod(1);
FCEUI_Kill();
}
int main(int argc,char *argv[])
{
char *t;
@ -424,61 +462,89 @@ int main(int argc,char *argv[])
InitCommonControls();
if(!FCEUI_Initialize())
goto doexito;
{
do_exit();
return 1;
}
ApplyDefaultCommandMapping();
srand(GetTickCount()); // rand() is used for some GUI sillyness.
fceu_hInstance=GetModuleHandle(0);
fceu_hInstance = GetModuleHandle(0);
// Get the base directory
GetBaseDirectory();
// Load the config information
sprintf(TempArray,"%s\\fceu98.cfg",BaseDirectory);
LoadConfig(TempArray);
t=ParseArgies(argc,argv);
// Parse the commandline arguments
t = ParseArgies(argc, argv);
/* Bleh, need to find a better place for this. */
{
palyo&=1;
palyo &= 1;
FCEUI_SetVidSystem(palyo);
genie&=1;
genie &= 1;
FCEUI_SetGameGenie(genie);
fullscreen&=1;
soundo&=1;
fullscreen &= 1;
soundo &= 1;
FCEUI_SetSoundVolume(soundvolume);
FCEUI_SetSoundQuality(soundquality);
}
ParseGIInput(NULL); /* Since a game doesn't have to be
loaded before the GUI can be used, make
sure the temporary input type variables
are set.
*/
// Initialize default directories
CreateDirs();
SetDirs();
DoVideoConfigFix();
DoTimingConfigFix();
if(eoptions&EO_CPALETTE)
if(eoptions & EO_CPALETTE)
{
FCEUI_SetPaletteArray(cpalette);
}
if(!t) fullscreen=0;
if(!t)
{
fullscreen=0;
}
CreateMainWindow();
if(!InitDInput())
goto doexito;
{
do_exit();
return 1;
}
if(!DriverInitialize())
goto doexito;
{
do_exit();
return 1;
}
UpdateMenu();
if(t)
{
ALoad(t);
else if(eoptions&EO_FOAFTERSTART)
}
else if(eoptions & EO_FOAFTERSTART)
{
LoadNewGamey(hAppWnd, 0);
}
doloopy:
UpdateFCEUWindow();
@ -514,7 +580,6 @@ doloopy:
if(!exiting)
goto doloopy;
doexito:
DriverKill();
timeEndPeriod(1);
FCEUI_Kill();

View File

@ -176,14 +176,20 @@ uint8 *RAM;
//---------
//windows might need to allocate these differently, so we have some special code
static void AllocBuffers() {
#ifdef _USE_SHARED_MEMORY_
static void AllocBuffers()
{
#ifdef _USE_SHARED_MEMORY_
void win_AllocBuffers(uint8 **GameMemBlock, uint8 **RAM);
win_AllocBuffers(&GameMemBlock, &RAM);
#else
#else
GameMemBlock = (uint8*)FCEU_gmalloc(131072);
RAM = (uint8*)FCEU_gmalloc(0x800);
#endif
#endif
}
static void FreeBuffers() {
@ -347,21 +353,30 @@ FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode)
}
/**
* Return: Flag that indicates whether the function was succesful or not.
**/
int FCEUI_Initialize(void)
{
if(!FCEU_InitVirtualVideo())
{
return 0;
}
AllocBuffers();
// Initialize some parts of the settings structure
memset(&FSettings,0,sizeof(FSettings));
FSettings.UsrFirstSLine[0]=8;
FSettings.UsrFirstSLine[1]=0;
FSettings.UsrLastSLine[0]=231;
FSettings.UsrLastSLine[1]=239;
FSettings.SoundVolume=100;
FCEUPPU_Init();
X6502_Init();
return 1;
}

View File

@ -588,27 +588,38 @@ static char FileExt[2048]; /* Includes the . character, as in ".nes" */
static char FileBaseDirectory[2048];
/**
* Updates the base directory
**/
void FCEUI_SetBaseDirectory(const char *dir)
{
strncpy(BaseDirectory,dir,2047);
BaseDirectory[2047]=0;
strncpy(BaseDirectory, dir, sizeof(BaseDirectory));
// TODO: Necessary?
BaseDirectory[2047] = 0;
}
static char *odirs[FCEUIOD__COUNT]={0,0,0,0,0}; // odirs, odors. ^_^
void FCEUI_SetDirOverride(int which, char *n)
{
// FCEU_PrintError("odirs[%d]=%s->%s", which, odirs[which], n);
if(which < FCEUIOD__COUNT)
odirs[which]=n;
// FCEU_PrintError("odirs[%d]=%s->%s", which, odirs[which], n);
if (which < FCEUIOD__COUNT)
{
odirs[which] = n;
}
if(GameInfo) /* Rebuild cache of present states/movies. */
{
if(which==FCEUIOD_STATE)
FCEUSS_CheckStates();
else if(which == FCEUIOD_MISC)
FCEUMOV_CheckMovies();
}
if(GameInfo) /* Rebuild cache of present states/movies. */
{
if(which==FCEUIOD_STATE)
{
FCEUSS_CheckStates();
}
else if(which == FCEUIOD_MISC)
{
FCEUMOV_CheckMovies();
}
}
}
#ifndef HAVE_ASPRINTF

View File

@ -267,8 +267,8 @@ void WritePalette(void)
void FCEUI_GetNTSCTH(int *tint, int *hue)
{
*tint=ntsctint;
*hue=ntschue;
*tint = ntsctint;
*hue = ntschue;
}
static int controlselect=0;

View File

@ -64,38 +64,39 @@ static uint32 ppulut3[128];
static void makeppulut(void)
{
int x;
int y;
int x;
int y;
int cc,xo,pixel;
for(x=0;x<256;x++)
{
ppulut1[x]=0;
for(y=0;y<8;y++)
ppulut1[x]|=((x>>(7-y))&1)<<(y*4);
ppulut2[x]=ppulut1[x]<<1;
}
{
for(x=0;x<256;x++)
{
ppulut1[x] = 0;
for(y=0;y<8;y++)
{
ppulut1[x] |= ((x>>(7-y))&1)<<(y*4);
}
int cc,xo,pixel;
ppulut2[x] = ppulut1[x] << 1;
}
for(cc=0;cc<16;cc++)
{
for(xo=0;xo<8;xo++)
{
ppulut3[xo|(cc<<3)]=0;
for(pixel=0;pixel<8;pixel++)
{
int shiftr;
shiftr=(pixel+xo)/8;
shiftr*=2;
ppulut3[xo|(cc<<3)]|=(( cc>>shiftr )&3)<<(2+pixel*4);
}
// printf("%08x\n",ppulut3[xo|(cc<<3)]);
}
}
}
for(cc=0;cc<16;cc++)
{
for(xo=0;xo<8;xo++)
{
ppulut3[ xo | ( cc << 3 ) ] = 0;
for(pixel=0;pixel<8;pixel++)
{
int shiftr;
shiftr = ( pixel + xo ) / 8;
shiftr *= 2;
ppulut3[ xo | (cc<<3) ] |= ( ( cc >> shiftr ) & 3 ) << ( 2 + pixel * 4 );
}
// printf("%08x\n",ppulut3[xo|(cc<<3)]);
}
}
}
static int ppudead=1;
@ -1212,9 +1213,12 @@ void FCEUPPU_SetVideoSystem(int w)
}
}
/**
* Initializes the PPU
**/
void FCEUPPU_Init(void)
{
makeppulut();
makeppulut();
}
void FCEUPPU_Reset(void)

View File

@ -74,46 +74,62 @@ void FCEU_KillVirtualVideo(void)
//}
}
/**
* Return: Flag that indicates whether the function was succesful or not.
*
* TODO: This function is Windows-only. It should probably be moved.
**/
int FCEU_InitVirtualVideo(void)
{
if(!XBuf) /* Some driver code may allocate XBuf externally. */
/* 256 bytes per scanline, * 240 scanline maximum, +8 for alignment,
*/
if(!XBuf) /* Some driver code may allocate XBuf externally. */
/* 256 bytes per scanline, * 240 scanline maximum, +8 for alignment,
*/
#ifdef _USE_SHARED_MEMORY_
mapXBuf = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, 256 * 256 + 8,"fceu.XBuf");
mapXBuf = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, 256 * 256 + 8, "fceu.XBuf");
if(mapXBuf == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
{
CloseHandle(mapXBuf);
mapXBuf = NULL;
XBuf= (uint8*) (FCEU_malloc(256 * 256 + 8));
XBackBuf= (uint8*) (FCEU_malloc(256 * 256 + 8));
XBuf = (uint8*) (FCEU_malloc(256 * 256 + 8));
XBackBuf = (uint8*) (FCEU_malloc(256 * 256 + 8));
}
else
{
XBuf = (uint8 *)MapViewOfFile(mapXBuf, FILE_MAP_WRITE, 0, 0, 0);
XBuf = (uint8 *)MapViewOfFile(mapXBuf, FILE_MAP_WRITE, 0, 0, 0);
XBackBuf = (uint8*) (FCEU_malloc(256 * 256 + 8));
}
if (!XBuf || !XBackBuf)
{
return 0;
}
#else
if(!(XBuf= (uint8*) (FCEU_malloc(256 * 256 + 8))) ||
!(XBackBuf= (uint8*) (FCEU_malloc(256 * 256 + 8))))
return 0;
#endif //_USE_SHARED_MEMORY_
xbsave=XBuf;
if(sizeof(uint8*)==4)
{
uint32 m;
m=(uint32)XBuf;
m=(4-m)&3;
XBuf+=m;
}
memset(XBuf,128,256*256); //*240);
memset(XBackBuf,128,256*256);
return 1;
if(!(XBuf= (uint8*) (FCEU_malloc(256 * 256 + 8))) ||
!(XBackBuf= (uint8*) (FCEU_malloc(256 * 256 + 8))))
{
return 0;
}
#endif //_USE_SHARED_MEMORY_
xbsave = XBuf;
if( sizeof(uint8*) == 4 )
{
uint32 m = (uint32)XBuf;
m = ( 4 - m) & 3;
XBuf+=m;
}
memset(XBuf,128,256*256); //*240);
memset(XBackBuf,128,256*256);
return 1;
}
int howlong;

View File

@ -363,16 +363,31 @@ void X6502_Reset(void)
{
_IRQlow=FCEU_IQRESET;
}
/**
* Initializes the 6502 CPU
**/
void X6502_Init(void)
{
int x;
unsigned int i;
// Initialize the CPU structure
memset((void *)&X,0,sizeof(X));
for(x=0;x<256;x++)
if(!x) ZNTable[x]=Z_FLAG;
else if(x&0x80) ZNTable[x]=N_FLAG;
else ZNTable[x]=0;
for(i = 0; i < sizeof(ZNTable); i++)
{
if(!i)
{
ZNTable[i] = Z_FLAG;
}
else if ( i & 0x80 )
{
ZNTable[i] = N_FLAG;
}
else
{
ZNTable[i] = 0;
}
}
}
void X6502_Power(void)