va_end(ap);
}
-INLINE void SelectTileRenderer (bool8_32 normal)
+static inline void SelectTileRenderer (bool normal)
{
if (normal)
{
IPPU.OBJChanged = FALSE;
}
-void DrawOBJS (bool8_32 OnMain = FALSE, uint8 D = 0)
+static void DrawOBJS (bool OnMain = FALSE, uint8 D = 0)
{
uint32 O;
uint32 BaseTile, Tile;
}
}
-void DrawBackgroundMosaic (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackgroundMosaic (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
{
CHECK_SOUND();
}
}
-void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
{
CHECK_SOUND();
uint32 MaxCount = 8;
uint32 s = Left * GFX_PIX_SIZE + Y * GFX.PPL;
- bool8_32 left_hand_edge = (Left == 0);
+ bool left_hand_edge = (Left == 0);
Width = Right - Left;
if (Left & 7)
// for the tile at the left-hand edge of the screen.
VOffset = LineData [Y].BG[bg].VOffset;
HOffset = LineHOffset;
- left_hand_edge = FALSE;
+ left_hand_edge = false;
}
else
{
}
}
-void DrawBackgroundMode5 (uint32 /* BGMODE */, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackgroundMode5 (uint32 /*BGMODE*/, uint32 bg, uint8 Z1, uint8 Z2)
{
CHECK_SOUND();
}
}
-void DrawBackground (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackground (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
{
BG.TileSize = BGSizes [PPU.BG[bg].BGSize];
BG.BitShift = BitShifts[BGMode][bg];
RENDER_BACKGROUND_MODE7_LINE(TYPE,FUNC) \
\
-
-void DrawBGMode7Background (uint8 *Screen, int bg)
-{
- RENDER_BACKGROUND_MODE7 (uint8, (uint8) (b & bmask))
-}
-
-void DrawBGMode7Background16 (uint8 *Screen, int bg)
+static void DrawBGMode7Background16 (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7 (uint16, GFX.ScreenColors [b & bmask]);
}
-void DrawBGMode7Background16Add (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
GFX.ScreenColors [b & bmask]);
}
-void DrawBGMode7Background16Add1_2 (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add1_2 (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
GFX.ScreenColors [b & bmask]);
}
-void DrawBGMode7Background16Sub (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
GFX.ScreenColors [b & bmask]);
}
-void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
Screen += GFX.StartY * GFX.Pitch; \
uint8 *Depth = GFX.DB + GFX.StartY * GFX.PPL; \
struct SLineMatrixData *l = &LineMatrixData [GFX.StartY]; \
- bool8_32 allowSimpleCase = FALSE; \
+ bool allowSimpleCase = false; \
if (!l->MatrixB && !l->MatrixC && (l->MatrixA == 0x0100) && (l->MatrixD == 0x0100) \
&& !LineMatrixData[GFX.EndY].MatrixB && !LineMatrixData[GFX.EndY].MatrixC \
&& (LineMatrixData[GFX.EndY].MatrixA == 0x0100) && (LineMatrixData[GFX.EndY].MatrixD == 0x0100) \
) \
- allowSimpleCase = TRUE; \
+ allowSimpleCase = true; \
\
for (uint32 Line = GFX.StartY; Line <= GFX.EndY; Line++, Screen += GFX.Pitch, Depth += GFX.PPL, l++) \
{ \
yy += (VOffset - CentreY) % 1023; \
else \
yy += VOffset - CentreY; \
- bool8_32 simpleCase = FALSE; \
+ bool simpleCase = false; \
int BB; \
int DD; \
/* Make a special case for the identity matrix, since it's a common case and */ \
{ \
BB = CentreX << 8; \
DD = (yy + CentreY) << 8; \
- simpleCase = TRUE; \
+ simpleCase = true; \
} \
else \
{ \
} \
}
-STATIC uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
+static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
{
register uint32 x = ((A >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) +
((B >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) +
return x+y;
}
-void DrawBGMode7Background16_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16_i (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7_i (uint16, theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
}
-void DrawBGMode7Background16Add_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add_i (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
}
-void DrawBGMode7Background16Add1_2_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add1_2_i (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
}
-void DrawBGMode7Background16Sub_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub_i (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
}
-void DrawBGMode7Background16Sub1_2_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub1_2_i (uint8 *Screen, int bg)
{
RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
(*(d + GFX.DepthDelta) != 1 ?
HIGH_BITS_SHIFTED_TWO_MASK = (( (FIRST_COLOR_MASK | SECOND_COLOR_MASK | THIRD_COLOR_MASK) & \
~TWO_LOW_BITS_MASK ) >> 2);
-void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D)
+static void RenderScreen(uint8 *Screen, bool sub, bool force_no_add, uint8 D)
{
- bool8_32 BG0;
- bool8_32 BG1;
- bool8_32 BG2;
- bool8_32 BG3;
- bool8_32 OB;
+ bool BG0, BG1, BG2, BG3, OB;
GFX.S = Screen;
_BUILD_PIXEL(GBR555)
_BUILD_PIXEL(RGB5551)
-bool8_32 S9xSetRenderPixelFormat (int format)
+bool8 S9xSetRenderPixelFormat (int format)
{
extern uint32 current_graphic_format;
extern char *rom_filename;
extern bool8 LoadZip(const char* , int32 *, int32 *);
-bool8_32 CMemory::AllASCII (uint8 *b, int size)
+bool CMemory::AllASCII (uint8 *b, int size)
{
for (int i = 0; i < size; i++)
{
if (b[i] < 32 || b[i] > 126)
- return (FALSE);
+ return false;
}
- return (TRUE);
+ return true;
}
-int CMemory::ScoreHiROM (bool8_32 skip_header)
+int CMemory::ScoreHiROM (bool skip_header)
{
int score = 0;
int o = skip_header ? 0xff00 + 0x200 : 0xff00;
return (score);
}
-int CMemory::ScoreLoROM (bool8_32 skip_header)
+int CMemory::ScoreLoROM (bool skip_header)
{
int score = 0;
int o = skip_header ? 0x7f00 + 0x200 : 0x7f00;
/* Init() */
/* This function allocates all the memory needed by the emulator */
/**********************************************************************************************/
-bool8_32 CMemory::Init ()
+bool CMemory::Init ()
{
RAM = (uint8 *) malloc (0x20000);
SRAM = (uint8 *) malloc (0x20000);
!IPPU.TileCached [TILE_4BIT] || !IPPU.TileCached [TILE_8BIT])
{
Deinit ();
- return (FALSE);
+ return false;
}
// FillRAM uses first 32K of ROM image area, otherwise space just
SDD1Data = NULL;
SDD1Index = NULL;
- return (TRUE);
+ return true;
}
void CMemory::Deinit ()
#pragma warning(disable : 4101)
#pragma warning(disable : 4700)
#endif
-bool8_32 CMemory::LoadROM (const char *filename)
+bool CMemory::LoadROM (const char *filename)
{
unsigned long FileSize = 0;
int retry_count = 0;
STREAM ROMFile;
- bool8_32 Interleaved = FALSE;
- bool8_32 Tales = FALSE;
+ bool Interleaved = FALSE;
+ bool Tales = FALSE;
char dir [_MAX_DIR + 1];
char drive [_MAX_DRIVE + 1];
char name [_MAX_FNAME + 1];
HeaderCount = 0;
uint8 *ptr = ROM;
- bool8_32 more = FALSE;
+ bool more = FALSE;
do
{
if (ptr - ROM < MAX_ROM_SIZE + 0x200 &&
(isdigit (ext [0]) && ext [1] == 0 && ext [0] < '9'))
{
- more = TRUE;
+ more = true;
ext [0]++;
PathMake(fname, drive, dir, name, ext);
}
isdigit (name [2]) && isdigit (name [3]) && isdigit (name [4]) &&
isdigit (name [5]) && isalpha (name [len - 1])))
{
- more = TRUE;
+ more = true;
name [len - 1]++;
PathMake(fname, drive, dir, name, ext);
}
else
- more = FALSE;
+ more = false;
} while (more && (ROMFile = OPEN_STREAM (fname, "rb")) != NULL);
}
}
else
{
- bool8_32 t = LoROM;
+ bool8 t = LoROM;
LoROM = HiROM;
HiROM = t;
S9xReset ();
- return (TRUE);
+ return true;
}
void S9xDeinterleaveMode2 ()
}
free ((char *) tmp);
}
- Memory.InitROM (FALSE);
+ Memory.InitROM (false);
S9xReset ();
}
-void CMemory::InitROM (bool8_32 Interleaved)
+void CMemory::InitROM (bool Interleaved)
{
#ifndef ZSNES_FX
SuperFX.nRomBanks = CalculatedSize >> 15;
S9xMessage (S9X_INFO, S9X_ROM_INFO, String);
}
-bool8_32 CMemory::LoadSRAM (const char *filename)
+bool CMemory::LoadSRAM (const char *filename)
{
int size = Memory.SRAMSize ?
(1 << (Memory.SRAMSize + 3)) * 128 : 0;
else
S9xHardResetSRTC ();
- return (TRUE);
+ return true;
}
S9xHardResetSRTC ();
- return (FALSE);
+ return false;
}
if (Settings.SDD1)
S9xSDD1LoadLoggedData ();
- return (TRUE);
+ return true;
}
-bool8_32 CMemory::SaveSRAM (const char *filename)
+bool CMemory::SaveSRAM (const char *filename)
{
size_t size = Memory.SRAMSize ?
(1 << (Memory.SRAMSize + 3)) * 128 : 0;
{
if (fwrite((char *) ::SRAM, size, 1, file) == size) {
fclose(file);
- return TRUE;
+ return true;
}
fclose(file);
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return true;
}
void CMemory::FixROMSpeed ()
WriteProtectROM ();
}
-void CMemory::TalesROMMap (bool8_32 Interleaved)
+void CMemory::TalesROMMap (bool Interleaved)
{
int c;
int i;
#define IPS_EOF 0x00454F46l
-void CMemory::CheckForIPSPatch (const char *rom_filename, bool8_32 header,
+void CMemory::CheckForIPSPatch (const char *rom_filename, bool header,
int32 &rom_size)
{
char fname [_MAX_PATH + 1];
};
struct InternalPPU {
- bool8_32 ColorsChanged;
+ bool8 ColorsChanged;
uint8 HDMA;
- bool8_32 HDMAStarted;
+ bool8 HDMAStarted;
uint8 MaxBrightness;
- bool8_32 LatchedBlanking;
- bool8_32 OBJChanged;
- bool8_32 RenderThisFrame;
- bool8_32 DirectColourMapsNeedRebuild;
+ bool8 LatchedBlanking;
+ bool8 OBJChanged;
+ bool8 RenderThisFrame;
+ bool8 DirectColourMapsNeedRebuild;
uint32 FrameCount;
uint32 RenderedFramesCount;
uint32 DisplayedRenderedFrameCount;
uint32 FrameSkip;
uint8 *TileCache [3];
uint8 *TileCached [3];
- bool8_32 FirstVRAMRead;
- bool8_32 LatchedInterlace;
- bool8_32 DoubleWidthPixels;
+ bool8 FirstVRAMRead;
+ bool8 LatchedInterlace;
+ bool8 DoubleWidthPixels;
int RenderedScreenHeight;
int RenderedScreenWidth;
uint32 Red [256];
uint8 Brightness;
struct {
- bool8_32 High;
+ bool8 High;
uint8 Increment;
uint16 Address;
uint16 Mask1;
uint16 SCSize;
} BG [4];
- bool8_32 CGFLIP;
+ bool8 CGFLIP;
uint16 CGDATA [256];
uint8 FirstSprite;
uint8 LastSprite;
uint16 ScreenHeight;
uint32 WRAM;
uint8 BG_Forced;
- bool8_32 ForcedBlanking;
- bool8_32 OBJThroughMain;
- bool8_32 OBJThroughSub;
+ bool8 ForcedBlanking;
+ bool8 OBJThroughMain;
+ bool8 OBJThroughSub;
uint8 OBJSizeSelect;
uint16 OBJNameBase;
- bool8_32 OBJAddition;
+ bool8 OBJAddition;
uint8 OAMReadFlip;
uint8 OAMData [512 + 32];
- bool8_32 VTimerEnabled;
- bool8_32 HTimerEnabled;
+ bool8 VTimerEnabled;
+ bool8 HTimerEnabled;
short HTimerPosition;
uint8 Mosaic;
- bool8_32 BGMosaic [4];
- bool8_32 Mode7HFlip;
- bool8_32 Mode7VFlip;
+ bool8 BGMosaic [4];
+ bool8 Mode7HFlip;
+ bool8 Mode7VFlip;
uint8 Mode7Repeat;
uint8 Window1Left;
uint8 Window1Right;
uint8 ClipWindowOverlapLogic [6];
uint8 ClipWindow1Enable [6];
uint8 ClipWindow2Enable [6];
- bool8_32 ClipWindow1Inside [6];
- bool8_32 ClipWindow2Inside [6];
- bool8_32 RecomputeClipWindows;
+ bool8 ClipWindow1Inside [6];
+ bool8 ClipWindow2Inside [6];
+ bool8 RecomputeClipWindows;
uint8 CGFLIPRead;
uint16 OBJNameSelect;
- bool8_32 Need16x8Mulitply;
+ bool8 Need16x8Mulitply;
uint8 Joypad3ButtonReadPos;
uint8 MouseSpeed[2];
};
#define CLIP_XNOR 3
struct SDMA {
- bool8_32 TransferDirection;
- bool8_32 AAddressFixed;
- bool8_32 AAddressDecrement;
+ bool8 TransferDirection;
+ bool8 AAddressFixed;
+ bool8 AAddressDecrement;
uint8 TransferMode;
uint8 ABank;
uint16 TransferBytes;
// H-DMA only:
- bool8_32 HDMAIndirectAddressing;
+ bool8 HDMAIndirectAddressing;
uint16 IndirectAddress;
uint8 IndirectBank;
uint8 Repeat;