- Removed BOOL and replaced it with native C++ type, bool.

- Removed TRUE and FALSE, changed to 'true' and 'false' keywords.
This commit is contained in:
Bart Trzynadlowski 2011-09-08 06:34:18 +00:00
parent abd86a5624
commit 11d1d61bc2
55 changed files with 1895 additions and 1893 deletions

View file

@ -170,7 +170,7 @@ void CBlockFile::NewBlock(const char *name, const char *comment)
WriteBlockHeader(name, comment);
}
BOOL CBlockFile::FindBlock(const char *name)
bool CBlockFile::FindBlock(const char *name)
{
long int curPos = 0;
unsigned blockLen, nameLen, commentLen;
@ -208,7 +208,7 @@ BOOL CBlockFile::FindBlock(const char *name)
return FAIL;
}
BOOL CBlockFile::Create(const char *file, const char *headerName, const char *comment)
bool CBlockFile::Create(const char *file, const char *headerName, const char *comment)
{
fp = fopen(file, "wb");
if (NULL == fp)
@ -218,7 +218,7 @@ BOOL CBlockFile::Create(const char *file, const char *headerName, const char *co
return OKAY;
}
BOOL CBlockFile::Load(const char *file)
bool CBlockFile::Load(const char *file)
{
fp = fopen(file, "rb");
if (NULL == fp)

View file

@ -70,7 +70,7 @@ public:
* Returns:
* OKAY if found, FAIL if unable to locate.
*/
BOOL FindBlock(const char *name);
bool FindBlock(const char *name);
/*
* Write(data, numBytes):
@ -112,7 +112,7 @@ public:
* Returns:
* OKAY if successfully opened, otherwise FAIL.
*/
BOOL Create(const char *file, const char *headerName, const char *comment);
bool Create(const char *file, const char *headerName, const char *comment);
/*
* Load(file):
@ -128,7 +128,7 @@ public:
* subsequent operations will be silently ignored (reads will return
* 0's). Write commands will be ignored.
*/
BOOL Load(const char *file);
bool Load(const char *file);
/*
* Close(void):

View file

@ -248,7 +248,7 @@ void M68KSetContext(M68KCtx *Src)
// One-time initialization
BOOL M68KInit(void)
bool M68KInit(void)
{
m68k_init();
m68k_set_cpu_type(M68K_CPU_TYPE_68000);

View file

@ -211,7 +211,7 @@ extern void M68KAttachBus(CBus *BusPtr);
* Returns:
* Always returns OKAY.
*/
extern BOOL M68KInit(void);
extern bool M68KInit(void);
/*
* M68KGetContext(M68KCtx *Dest):

View file

@ -526,7 +526,7 @@ static void SPR(char *dest, unsigned spr_field)
* Predecodes the SIMM field for us. If do_unsigned, it is printed as an
* unsigned 32-bit integer.
*/
static void DecodeSigned16(char *outbuf, UINT32 op, BOOL do_unsigned)
static void DecodeSigned16(char *outbuf, UINT32 op, bool do_unsigned)
{
INT16 s;
@ -573,7 +573,7 @@ static UINT32 Mask(unsigned mb, unsigned me)
* Perform checks on the instruction as required by the flags. Returns 1 if
* the instruction failed.
*/
static BOOL Check(UINT32 op, unsigned flags)
static bool Check(UINT32 op, unsigned flags)
{
unsigned nb, rt, ra;
@ -634,7 +634,7 @@ static BOOL Check(UINT32 op, unsigned flags)
* Handles all simplified instruction forms. Returns 1 if one was decoded,
* otherwise 0 to indicate disassembly should carry on as normal.
*/
static BOOL Simplified(UINT32 op, UINT32 vpc, char *signed16, char *mnem, char *oprs)
static bool Simplified(UINT32 op, UINT32 vpc, char *signed16, char *mnem, char *oprs)
{
UINT32 value, disp;
@ -806,8 +806,8 @@ static BOOL Simplified(UINT32 op, UINT32 vpc, char *signed16, char *mnem, char *
* Zero if successful, non-zero if the instruction was unrecognized or
* had an invalid form (see note above in function description.)
*/
BOOL DisassemblePowerPC(UINT32 op, UINT32 vpc, char *mnem, char *oprs,
BOOL simplify)
bool DisassemblePowerPC(UINT32 op, UINT32 vpc, char *mnem, char *oprs,
bool simplify)
{
char signed16[12];
UINT32 disp;
@ -1135,7 +1135,7 @@ int main(int argc, char **argv)
UINT8 *buffer;
unsigned i, fsize, start = 0, len, org, file = 0;
UINT32 op;
BOOL len_specified = 0, org_specified = 0, little = 0, simple = 1;
bool len_specified = 0, org_specified = 0, little = 0, simple = 1;
char *c;

View file

@ -52,7 +52,7 @@
* OKAY if successful, FAIL if the instruction was unrecognized or had an
* invalid form (see note above in function description.)
*/
extern BOOL DisassemblePowerPC(UINT32 op, UINT32 vpc, char *mnem, char *oprs,
BOOL simplify);
extern bool DisassemblePowerPC(UINT32 op, UINT32 vpc, char *mnem, char *oprs,
bool simplify);
#endif // INCLUDED_PPCDISASM_H

View file

@ -175,7 +175,7 @@ typedef struct {
typedef struct {
BOOL fatalError; // if true, halt PowerPC until hard reset
bool fatalError; // if true, halt PowerPC until hard reset
UINT32 r[32];
UINT32 pc;
@ -306,7 +306,7 @@ static void ppc_change_pc(UINT32 newpc)
DebugLog("Invalid PC %08X, previous PC %08X\n", newpc, ppc.pc);
ErrorLog("PowerPC is out of bounds. Halting emulation until reset.");
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
INLINE UINT8 READ8(UINT32 address)
@ -551,7 +551,7 @@ INLINE void ppc_set_spr(int spr, UINT32 value)
ErrorLog("PowerPC wrote to an invalid register. Halting emulation until reset.");
DebugLog("ppc: set_spr: unknown spr %d (%03X) !\n", spr, spr);
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
INLINE UINT32 ppc_get_spr(int spr)
@ -613,7 +613,7 @@ INLINE UINT32 ppc_get_spr(int spr)
ErrorLog("PowerPC read from an invalid register. Halting emulation until reset.");
DebugLog("ppc: get_spr: unknown spr %d (%03X) !\n", spr, spr);
ppc.fatalError = TRUE;
ppc.fatalError = true;
return 0;
}
@ -623,7 +623,7 @@ INLINE void ppc_set_msr(UINT32 value)
{
ErrorLog("PowerPC entered an unemulated mode. Halting emulation until reset.");
DebugLog("ppc: set_msr: little_endian mode not supported !\n");
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
MSR = value;

View file

@ -201,7 +201,7 @@ void ppc603_exception(int exception)
default:
ErrorLog("PowerPC triggered an unknown exception. Emulation halted until reset.");
DebugLog("PowerPC triggered an unknown exception (%d).\n", exception);
ppc.fatalError = TRUE;
ppc.fatalError = true;
break;
}
}
@ -237,7 +237,7 @@ static void ppc603_check_interrupts(void)
void ppc_reset(void)
{
ppc.fatalError = FALSE; // reset the fatal error flag
ppc.fatalError = false; // reset the fatal error flag
ppc.pc = ppc.npc = 0xfff00100;
@ -272,7 +272,7 @@ int ppc_execute(int cycles)
char string1[200];
char string2[200];
opcode = BSWAP32(*ppc.op);
DisassemblePowerPC(opcode, ppc.npc, string1, string2, TRUE);
DisassemblePowerPC(opcode, ppc.npc, string1, string2, true);
printf("%08X: %s %s\n", ppc.npc, string1, string2);
}*/
// printf("trigger cycle %d (%08X)\n", ppc_dec_trigger_cycle, ppc_dec_trigger_cycle);
@ -333,7 +333,7 @@ int ppc_execute(int cycles)
char string1[200];
char string2[200];
opcode = BSWAP32(*ppc.op);
DisassemblePowerPC(opcode, ppc.npc, string1, string2, TRUE);
DisassemblePowerPC(opcode, ppc.npc, string1, string2, true);
printf("%08X: %s %s\n", ppc.npc, string1, string2);
}
*/

View file

@ -38,7 +38,7 @@ static void ppc_unimplemented(UINT32 op)
{
ErrorLog("PowerPC hit an unimplemented instruction. Halting emulation until reset.");
DebugLog("PowerPC encountered an unimplemented opcode %08X at %08X\n", op, ppc.pc);
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
static void ppc_addx(UINT32 op)
@ -769,7 +769,7 @@ static void ppc_lswx(UINT32 op)
{
ErrorLog("PowerPC hit an unimplemented instruction. Halting emulation until reset.");
DebugLog("ppc: lswx unimplemented at %08X\n", ppc.pc);
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
static void ppc_lwarx(UINT32 op)
@ -1285,7 +1285,7 @@ static void ppc_stswx(UINT32 op)
{
ErrorLog("PowerPC hit an unimplemented instruction. Halting emulation until reset.");
DebugLog("ppc: stswx unimplemented\n");
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
static void ppc_stw(UINT32 op)
@ -1553,7 +1553,7 @@ static void ppc_invalid(UINT32 op)
{
ErrorLog("PowerPC hit an invalid instruction. Halting emulation until reset.");
DebugLog("ppc: Invalid opcode %08X PC : %X, %08X\n", op, ppc.pc, ppc.npc);
ppc.fatalError = TRUE;
ppc.fatalError = true;
}
@ -1964,7 +1964,7 @@ static void ppc_mftb(UINT32 op)
default:
ErrorLog("PowerPC read from an invalid register. Halting emulation until reset.");
DebugLog("ppc: Invalid timebase register %d at %08X\n", x, ppc.pc);
ppc.fatalError = TRUE;
ppc.fatalError = true;
break;
}
}

View file

@ -3621,7 +3621,7 @@ int CZ80::Run(int numCycles)
pc = 0x0066;
iff = (iff&~2) | ((iff&1)<<1);
iff &= ~1;
nmiTrigger = FALSE; // clear NMI
nmiTrigger = false; // clear NMI
// TODO: if in HALTed state, un-halt
}
else if (intLine) // INT asserted
@ -3679,7 +3679,7 @@ int CZ80::Run(int numCycles)
}
}
else // if no callback, do nothing, clear INT line
intLine = FALSE;
intLine = false;
break;
case 1:
/*
@ -3693,7 +3693,7 @@ int CZ80::Run(int numCycles)
if (NULL != INTCallback)
INTCallback(this);
else // no callback, clear INT line automatically
intLine = FALSE;
intLine = false;
break;
case 2:
/*
@ -3712,10 +3712,10 @@ int CZ80::Run(int numCycles)
iff = 0;
}
else // if no callback, do nothing, clear INT line
intLine = FALSE;
intLine = false;
break;
default: // should never happen (nothing will be done)
intLine = FALSE;
intLine = false;
break;
}
}
@ -3734,10 +3734,10 @@ HALTExit:
void CZ80::TriggerNMI(void)
{
nmiTrigger = TRUE;
nmiTrigger = true;
}
void CZ80::SetINT(BOOL state)
void CZ80::SetINT(bool state)
{
intLine = state;
}
@ -3768,8 +3768,8 @@ void CZ80::Reset(void)
af_sel = 0;
regs_sel = 0;
intLine = FALSE;
nmiTrigger = FALSE;
intLine = false;
nmiTrigger = false;
}
void CZ80::SaveState(CBlockFile *StateFile, const char *name)

View file

@ -103,11 +103,11 @@ public:
* callbacks to clear interrupts.
*
* Parameters:
* state If TRUE, this is equivalent to /INT being asserted on the
* Z80 (INT line low, which triggers an interrupt). If FALSE,
* state If true, this is equivalent to /INT being asserted on the
* Z80 (INT line low, which triggers an interrupt). If false,
* this deasserts /INT (INT line high, no interrupt pending).
*/
void SetINT(BOOL state);
void SetINT(bool state);
/*
* GetPC(void):
@ -161,7 +161,7 @@ public:
*
* An interrupt callback, which is called each time an interrupt occurs,
* should also be supplied. The interrupt callback should explicitly clear
* the INT status (using SetINT(FALSE)) and then return the appropriate
* the INT status (using SetINT(false)) and then return the appropriate
* vector depending on the interrupt mode that is used by the system.
*
* For mode 0, only Z80_INT_RST_* values are acceptable. For mode 1, the
@ -214,8 +214,8 @@ private:
CBus *Bus;
// Interrupts
BOOL nmiTrigger;
BOOL intLine;
bool nmiTrigger;
bool intLine;
int (*INTCallback)(CZ80 *Z80);
};

View file

@ -301,7 +301,7 @@ namespace Debugger
char valStr[40];
UINT32 opcode = m_bus->Read32(addr);
operands[0] = '\0';
if (!::DisassemblePowerPC(opcode, addr, mnemonic, opStr, TRUE))
if (!::DisassemblePowerPC(opcode, addr, mnemonic, opStr, true))
{
char *o = opStr;
char *s = strstr(o, "0x");

View file

@ -113,7 +113,7 @@ namespace Debugger
DetachFromCPU();
}
BOOL __cdecl DebugHandler(TURBO68K_INT32 pc, TURBO68K_INT32 opcode)
bool __cdecl DebugHandler(TURBO68K_INT32 pc, TURBO68K_INT32 opcode)
{
// Return true to let Turbo68K know if PC was changed by user
return debug->CheckExecution((UINT32)pc, (UINT32)opcode);

File diff suppressed because it is too large Load diff

View file

@ -72,7 +72,7 @@ struct GameInfo
unsigned year; // year released (in decimal)
int step; // Model 3 hardware stepping: 0x10 = 1.0, 0x15 = 1.5, 0x20 = 2.0, 0x21 = 2.1
unsigned cromSize; // size of fixed CROM (up to 8 MB)
BOOL mirrorLow64MB; // mirror low 64 MB of banked CROM space to upper 64 MB
bool mirrorLow64MB; // mirror low 64 MB of banked CROM space to upper 64 MB
unsigned vromSize; // size of video ROMs (32 or 64 MB; if 32 MB, will have to be mirrored)
unsigned sampleSize; // size of sample ROMS (8 or 16 MB; if 8 MB, will have to be mirrored)
unsigned inputFlags; // game input types

View file

@ -40,7 +40,7 @@
// Overflow in the local vertex buffer, which holds one model
BOOL CRender3D::ErrorLocalVertexOverflow(void)
bool CRender3D::ErrorLocalVertexOverflow(void)
{
if ((errorMsgFlags&ERROR_LOCAL_VERTEX_OVERFLOW))
return FAIL;
@ -49,7 +49,7 @@ BOOL CRender3D::ErrorLocalVertexOverflow(void)
}
// Model could not be cached, even after dumping display list and re-caching
BOOL CRender3D::ErrorUnableToCacheModel(UINT32 modelAddr)
bool CRender3D::ErrorUnableToCacheModel(UINT32 modelAddr)
{
if ((errorMsgFlags&ERROR_UNABLE_TO_CACHE_MODEL))
return FAIL;

View file

@ -145,7 +145,7 @@ void CRender3D::DrawDisplayList(ModelCache *Cache, POLY_STATE state)
}
// Appends an instance of a model or viewport to the display list, copying over the required state information
BOOL CRender3D::AppendDisplayList(ModelCache *Cache, BOOL isViewport, const struct VBORef *Model)
bool CRender3D::AppendDisplayList(ModelCache *Cache, bool isViewport, const struct VBORef *Model)
{
int lm, i;
@ -363,11 +363,11 @@ void CRender3D::InsertVertex(ModelCache *Cache, const Vertex *V, const Poly *P,
Cache->vboCurOffset += VBO_VERTEX_SIZE*sizeof(GLfloat);
}
BOOL CRender3D::InsertPolygon(ModelCache *Cache, const Poly *P)
bool CRender3D::InsertPolygon(ModelCache *Cache, const Poly *P)
{
GLfloat n[3], v1[3], v2[3], normZFlip;
int i;
BOOL doubleSided;
bool doubleSided;
// Bounds testing: up to 12 triangles will be inserted (worst case: double sided quad is 6 triangles)
if ((Cache->curVertIdx[P->state]+6*2) >= Cache->maxVertIdx)
@ -376,7 +376,7 @@ BOOL CRender3D::InsertPolygon(ModelCache *Cache, const Poly *P)
return FAIL; // this just indicates we may need to re-cache
// Is the polygon double sided?
doubleSided = (P->header[1]&0x10) ? TRUE : FALSE;
doubleSided = (P->header[1]&0x10) ? true : false;
/*
* Determine polygon winding by taking cross product of vectors formed from
@ -468,7 +468,7 @@ BOOL CRender3D::InsertPolygon(ModelCache *Cache, const Poly *P)
}
// Begins caching a new model by resetting to the start of the local vertex buffer
BOOL CRender3D::BeginModel(ModelCache *Cache)
bool CRender3D::BeginModel(ModelCache *Cache)
{
int m;
@ -546,7 +546,7 @@ struct VBORef *CRender3D::CacheModel(ModelCache *Cache, int lutIdx, UINT16 texOf
{
Vertex Prev[4]; // previous vertices
int numPolys = 0;
BOOL done = FALSE;
bool done = false;
// Sega Rally 2 bad models
//if (lutIdx == 0x27a1 || lutIdx == 0x21e0)
@ -731,13 +731,13 @@ void CRender3D::ClearModelCache(ModelCache *Cache)
ClearDisplayList(Cache);
}
BOOL CRender3D::CreateModelCache(ModelCache *Cache, unsigned vboMaxVerts,
bool CRender3D::CreateModelCache(ModelCache *Cache, unsigned vboMaxVerts,
unsigned localMaxVerts, unsigned maxNumModels, unsigned numLUTEntries,
unsigned displayListSize, BOOL isDynamic)
unsigned displayListSize, bool isDynamic)
{
unsigned i;
int vboBytes, localBytes;
BOOL success;
bool success;
Cache->dynamic = isDynamic;
@ -757,13 +757,13 @@ BOOL CRender3D::CreateModelCache(ModelCache *Cache, unsigned vboMaxVerts,
localBytes = localMaxVerts*VBO_VERTEX_SIZE*sizeof(GLfloat);
// Try allocating until size is
success = FALSE;
success = false;
while (vboBytes >= localBytes)
{
glBufferData(GL_ARRAY_BUFFER, vboBytes, 0, isDynamic?GL_STREAM_DRAW:GL_STATIC_DRAW);
if (glGetError() == GL_NO_ERROR)
{
success = TRUE;
success = true;
break;
}

View file

@ -265,7 +265,7 @@ void CRender2D::DrawCompleteLayer(int layerNum, const UINT16 *nameTableBase)
int hFullScrollPri, hFullScrollAlt; // full-screen horizontal scroll values (from registers)
int vOffset; // vertical pixel offset within tile
int tx, i, j;
BOOL lineScrollPri, lineScrollAlt; // line scrolling enable/disable
bool lineScrollPri, lineScrollAlt; // line scrolling enable/disable
UINT16 mask;
// Determine layer color depths (1 if 4-bit, 0 if 8-bit)
@ -491,7 +491,7 @@ void CRender2D::DrawCompleteLayer(int layerNum, const UINT16 *nameTableBase)
int hOffset, vOffset; // pixel offsets
int ntOffset; // offset in name table
int tx;
BOOL lineScrollPri, lineScrollAlt; // line scrolling enable/disable
bool lineScrollPri, lineScrollAlt; // line scrolling enable/disable
UINT16 mask;
// Determine layer color depths (1 if 4-bit, 0 if 8-bit)
@ -614,7 +614,7 @@ void CRender2D::UpdateLayer(int layerNum)
{
glBindTexture(GL_TEXTURE_2D, texID[layerNum]);
allDirty = TRUE;
allDirty = true;
if (allDirty)
{
// If everything is dirty, update the whole thing at once
@ -710,7 +710,7 @@ void CRender2D::BeginFrame(void)
{
UpdateLayer(i);
}
allDirty = FALSE;
allDirty = false;
// Draw bottom layer
Setup2D();
@ -762,7 +762,7 @@ void CRender2D::WriteVRAM(unsigned addr, UINT32 data)
return;
// For now, mark everything as dirty
allDirty = TRUE;
allDirty = true;
// Palette
if (addr >= 0x100000)
@ -810,7 +810,7 @@ void CRender2D::AttachVRAM(const UINT8 *vramPtr)
#define MEMORY_POOL_SIZE (512*512*4+0x20000)
BOOL CRender2D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes)
bool CRender2D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes)
{
float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000;
@ -843,7 +843,7 @@ BOOL CRender2D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned
// Clear textures and dirty rectangles (all memory)
memset(memoryPool, 0, MEMORY_POOL_SIZE);
memset(dirty, 0, sizeof(dirty));
allDirty = TRUE;
allDirty = true;
// Create textures
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

View file

@ -120,7 +120,7 @@ public:
* OKAY is successful, otherwise FAILED if a non-recoverable error
* occurred. Prints own error messages.
*/
BOOL Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes);
bool Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes);
/*
* CRender2D(void):
@ -167,7 +167,7 @@ private:
// Dirty rectangles (non-zero indicates region is dirty)
UINT8 dirty[2][64/DIRTY_RECT_HEIGHT][48/DIRTY_RECT_WIDTH];
BOOL allDirty; // global dirty flag (forces everything to be updated)
bool allDirty; // global dirty flag (forces everything to be updated)
// Buffers
UINT8 *memoryPool; // all memory is allocated here

View file

@ -547,7 +547,7 @@ void CRender3D::InitMatrixStack(UINT32 matrixBaseAddr)
* operations within the stack machine). We must be careful to ensure that no
* games ever write data to this high nibble.
*/
void CRender3D::Push(UINT32 ptr, BOOL pushMatrix)
void CRender3D::Push(UINT32 ptr, bool pushMatrix)
{
#ifdef DEBUG
if ((ptr&0xF0000000)) // high nibble already being used for something!
@ -572,7 +572,7 @@ void CRender3D::Push(UINT32 ptr, BOOL pushMatrix)
}
else
{
stackOverflow = TRUE; // signal that a stack overflow occurred
stackOverflow = true; // signal that a stack overflow occurred
#ifdef DEBUG
printf("stack overflow\n");
#endif
@ -601,7 +601,7 @@ UINT32 CRender3D::Pop(void)
void CRender3D::ClearStack(void)
{
stackTop = 0;
stackOverflow = FALSE;
stackOverflow = false;
}
@ -622,7 +622,7 @@ void CRender3D::ClearStack(void)
* The current texture offset state, texOffset, is also used. Models are cached
* for each unique texOffset.
*/
BOOL CRender3D::DrawModel(UINT32 modelAddr)
bool CRender3D::DrawModel(UINT32 modelAddr)
{
ModelCache *Cache;
const UINT32 *model;
@ -666,7 +666,7 @@ BOOL CRender3D::DrawModel(UINT32 modelAddr)
}
// Add to display list
return AppendDisplayList(Cache, FALSE, ModelRef);
return AppendDisplayList(Cache, false, ModelRef);
}
// Descends into a 10-word culling node
@ -865,7 +865,7 @@ void CRender3D::StackMachine(UINT32 nodeAddr)
unsigned listStackDepth = 0;
// Push this address on to the stack to begin the process
Push(nodeAddr,FALSE);
Push(nodeAddr,false);
// Process the stack (keep popping until all finished)
while (stackTop > 0)
@ -943,7 +943,7 @@ void CRender3D::StackMachine(UINT32 nodeAddr)
if (!(list[i]&0x01000000)) // Fighting Vipers (this bit seems to indicate "do not process"
{
if ((nodeAddr != 0) && (nodeAddr != 0x800800))
Push(nodeAddr,FALSE); // don't need to save matrix (each culling node saves/restores matrix)
Push(nodeAddr,false); // don't need to save matrix (each culling node saves/restores matrix)
}
if ((list[i]&0x02000000)) // list terminator
@ -980,7 +980,7 @@ void CRender3D::StackMachine(UINT32 nodeAddr)
z = *(float *) &node[0x06-offset];
// Push second link on stack (this also saves current matrix and will ensure it is restored)
Push(node2Ptr,TRUE);
Push(node2Ptr,true);
// Apply matrix and translation, then process first link
if ((node[0x00]&0x10)) // apply translation vector
@ -994,7 +994,7 @@ void CRender3D::StackMachine(UINT32 nodeAddr)
if (NULL != lodTable)
{
if ((node[0x03-offset]&0x20000000))
Push(lodTable[0]&0x00FFFFFF,FALSE); // process as culling node
Push(lodTable[0]&0x00FFFFFF,false); // process as culling node
else
{
if (DrawModel(lodTable[0]&0x00FFFFFF))
@ -1003,7 +1003,7 @@ void CRender3D::StackMachine(UINT32 nodeAddr)
}
}
else
Push(node1Ptr,FALSE);
Push(node1Ptr,false);
break;
@ -1166,8 +1166,8 @@ void CRender3D::RenderViewport(UINT32 addr, int pri)
}
// Render
AppendDisplayList(&VROMCache, TRUE, 0); // add a viewport display list node
AppendDisplayList(&PolyCache, TRUE, 0);
AppendDisplayList(&VROMCache, true, 0); // add a viewport display list node
AppendDisplayList(&PolyCache, true, 0);
stackDepth = 0;
listDepth = 0;
@ -1283,7 +1283,7 @@ void CRender3D::SetStep(int stepID)
DebugLog("Render3D set to Step %d.%d\n", (step>>4)&0xF, step&0xF);
}
BOOL CRender3D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes)
bool CRender3D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes)
{
// Allocate memory for texture buffer
textureBuffer = new(std::nothrow) GLfloat[512*512*4];
@ -1311,9 +1311,9 @@ BOOL CRender3D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned
return ErrorLog("OpenGL was unable to provide a 2048x2048-texel texture map.");
// Create model caches and VBOs
if (CreateModelCache(&VROMCache, NUM_STATIC_VERTS, NUM_LOCAL_VERTS, NUM_STATIC_MODELS, 0x4000000/4, NUM_DISPLAY_LIST_ITEMS, FALSE))
if (CreateModelCache(&VROMCache, NUM_STATIC_VERTS, NUM_LOCAL_VERTS, NUM_STATIC_MODELS, 0x4000000/4, NUM_DISPLAY_LIST_ITEMS, false))
return FAIL;
if (CreateModelCache(&PolyCache, NUM_DYNAMIC_VERTS, NUM_LOCAL_VERTS, NUM_DYNAMIC_MODELS, 0x400000/4, NUM_DISPLAY_LIST_ITEMS, TRUE))
if (CreateModelCache(&PolyCache, NUM_DYNAMIC_VERTS, NUM_LOCAL_VERTS, NUM_DYNAMIC_MODELS, 0x400000/4, NUM_DISPLAY_LIST_ITEMS, true))
return FAIL;
// Initialize lighting parameters (updated as viewports are traversed)

View file

@ -79,7 +79,7 @@ struct VBORef
// Display list items: model instances and viewport settings
struct DisplayList
{
BOOL isViewport; // if true, this is a viewport node
bool isViewport; // if true, this is a viewport node
union
{
@ -125,7 +125,7 @@ struct DisplayList
struct ModelCache
{
// Cache type
BOOL dynamic;
bool dynamic;
// Vertex buffer object
unsigned vboMaxOffset; // size of VBO (in bytes)
@ -282,7 +282,7 @@ public:
* occurred. Any allocated memory will not be freed until the
* destructor is called. Prints own error messages.
*/
BOOL Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes);
bool Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes);
/*
* CRender3D(void):
@ -304,16 +304,16 @@ private:
// Model caching and display list management
void DrawDisplayList(ModelCache *Cache, POLY_STATE state);
BOOL AppendDisplayList(ModelCache *Cache, BOOL isViewport, const struct VBORef *Model);
bool AppendDisplayList(ModelCache *Cache, bool isViewport, const struct VBORef *Model);
void ClearDisplayList(ModelCache *Cache);
BOOL InsertPolygon(ModelCache *cache, const Poly *p);
bool InsertPolygon(ModelCache *cache, const Poly *p);
void InsertVertex(ModelCache *cache, const Vertex *v, const Poly *p, float normFlip);
BOOL BeginModel(ModelCache *cache);
bool BeginModel(ModelCache *cache);
struct VBORef *EndModel(ModelCache *cache, int lutIdx, UINT16 texOffset);
struct VBORef *CacheModel(ModelCache *cache, int lutIdx, UINT16 texOffset, const UINT32 *data);
struct VBORef *LookUpModel(ModelCache *cache, int lutIdx, UINT16 texOffset);
void ClearModelCache(ModelCache *cache);
BOOL CreateModelCache(ModelCache *cache, unsigned vboMaxVerts, unsigned localMaxVerts, unsigned maxNumModels, unsigned numLUTEntries, unsigned displayListSize, BOOL isDynamic);
bool CreateModelCache(ModelCache *cache, unsigned vboMaxVerts, unsigned localMaxVerts, unsigned maxNumModels, unsigned numLUTEntries, unsigned displayListSize, bool isDynamic);
void DestroyModelCache(ModelCache *cache);
// Texture management
@ -322,12 +322,12 @@ private:
// Stack management
void MultMatrix(UINT32 matrixOffset);
void InitMatrixStack(UINT32 matrixBaseAddr);
void Push(UINT32 ptr, BOOL pushMatrix);
void Push(UINT32 ptr, bool pushMatrix);
UINT32 Pop(void);
void ClearStack(void);
// Scene database traversal
BOOL DrawModel(UINT32 modelAddr);
bool DrawModel(UINT32 modelAddr);
void DescendCullingNode(UINT32 addr);
void DescendPointerList(UINT32 addr);
void DescendNodePtr(UINT32 nodeAddr);
@ -335,8 +335,8 @@ private:
void RenderViewport(UINT32 addr, int pri);
// In-frame error reporting
BOOL ErrorLocalVertexOverflow(void);
BOOL ErrorUnableToCacheModel(UINT32 modelAddr);
bool ErrorLocalVertexOverflow(void);
bool ErrorUnableToCacheModel(UINT32 modelAddr);
void ClearErrors(void);
/*
@ -365,7 +365,7 @@ private:
UINT32 *stack;
int stackSize; // number of elements stack can contain
int stackTop; // current top of stack (free spot, last element is stackTop-1)
BOOL stackOverflow; // records stack overflows (cleared by ClearStack())
bool stackOverflow; // records stack overflows (cleared by ClearStack())
// Current viewport parameters (updated as viewports are traversed)
GLfloat lightingParams[6];

View file

@ -82,13 +82,13 @@ static char *LoadShaderSource(const char *file)
return buf;
}
BOOL LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint *fragmentShaderPtr, const char *vsFile, const char *fsFile, const char *vsString, const char *fsString)
bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint *fragmentShaderPtr, const char *vsFile, const char *fsFile, const char *vsString, const char *fsString)
{
char msg[2048+128], infoLog[2048];
const char *vsSource, *fsSource; // source code
GLuint shaderProgram, vertexShader, fragmentShader;
GLint result, len;
BOOL ret = OKAY;
bool ret = OKAY;
// Load shaders from files if specified
if (vsFile != NULL)

View file

@ -51,7 +51,7 @@
* Returns:
* OKAY is successfully loaded, otherwise FAIL. Prints own error messages.
*/
extern BOOL LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr,
extern bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr,
GLuint *fragmentShaderPtr, const char *vsFile,
const char *fsFile, const char *vsString,
const char *fsString);

View file

@ -67,9 +67,9 @@ using namespace std;
Basic Functions
******************************************************************************/
BOOL CINIFile::Write(const char *comment)
bool CINIFile::Write(const char *comment)
{
BOOL writeSuccess;
bool writeSuccess;
// In order to truncate, we must close and reopen as truncated
File.close();
@ -129,7 +129,7 @@ BOOL CINIFile::Write(const char *comment)
return writeSuccess;
}
BOOL CINIFile::Open(const char *fileNameStr)
bool CINIFile::Open(const char *fileNameStr)
{
FileName = fileNameStr;
@ -142,7 +142,7 @@ BOOL CINIFile::Open(const char *fileNameStr)
return OKAY;
}
BOOL CINIFile::OpenAndCreate(const char *fileNameStr)
bool CINIFile::OpenAndCreate(const char *fileNameStr)
{
FileName = fileNameStr;
@ -173,7 +173,7 @@ void CINIFile::Close(void)
******************************************************************************/
// Finds index of first matching section in the section list. Returns FAIL if not found.
BOOL CINIFile::LookUpSection(unsigned *idx, string SectionName)
bool CINIFile::LookUpSection(unsigned *idx, string SectionName)
{
for (unsigned i = 0; i < Sections.size(); i++)
{
@ -232,7 +232,7 @@ void CINIFile::Set(string SectionName, string SettingName, int value)
// Update the setting!
UpdateIntValue:
Sections[sectionIdx].Settings[settingIdx].isNumber = TRUE;
Sections[sectionIdx].Settings[settingIdx].isNumber = true;
Sections[sectionIdx].Settings[settingIdx].value = value;
Sections[sectionIdx].Settings[settingIdx].String = "";
}
@ -281,13 +281,13 @@ void CINIFile::Set(string SectionName, string SettingName, string String)
// Update the setting!
UpdateString:
Sections[sectionIdx].Settings[settingIdx].isNumber = FALSE;
Sections[sectionIdx].Settings[settingIdx].isNumber = false;
Sections[sectionIdx].Settings[settingIdx].String = String;
Sections[sectionIdx].Settings[settingIdx].value = 0;
}
// Obtains a numerical setting, if it exists, otherwise does nothing.
BOOL CINIFile::Get(string SectionName, string SettingName, int& value)
bool CINIFile::Get(string SectionName, string SettingName, int& value)
{
for (unsigned i = 0; i < Sections.size(); i++)
{
@ -309,7 +309,7 @@ BOOL CINIFile::Get(string SectionName, string SettingName, int& value)
return FAIL;
}
BOOL CINIFile::Get(string SectionName, string SettingName, unsigned& value)
bool CINIFile::Get(string SectionName, string SettingName, unsigned& value)
{
int intVal;
if (Get(SectionName, SettingName, intVal) == FAIL || intVal < 0)
@ -321,7 +321,7 @@ BOOL CINIFile::Get(string SectionName, string SettingName, unsigned& value)
}
// Obtains a string setting, if it exists, otherwise does nothing.
BOOL CINIFile::Get(string SectionName, string SettingName, string& String)
bool CINIFile::Get(string SectionName, string SettingName, string& String)
{
for (unsigned i = 0; i < Sections.size(); i++)
{
@ -371,11 +371,11 @@ CINIFile::CToken::CToken(void)
}
// Returns true for white space, comment symbol, or null terminator.
static BOOL IsBlank(char c)
static bool IsBlank(char c)
{
if (isspace(c) || (c==';') || (c=='\0'))
return TRUE;
return FALSE;
return true;
return false;
}
// Fetches a string. Tolerates all characters between quotes.
@ -414,7 +414,7 @@ CINIFile::CToken CINIFile::GetNumber(void)
{
CToken T;
unsigned long long number = 0;
BOOL isNeg = FALSE;
bool isNeg = false;
int overflow = 0;
T.type = TOKEN_NUMBER;
@ -422,7 +422,7 @@ CINIFile::CToken CINIFile::GetNumber(void)
// See if begins with minus sign
if (linePtr[0]=='-')
{
isNeg = TRUE;
isNeg = true;
linePtr++;
}
@ -598,11 +598,11 @@ void CINIFile::InitParseTree(void)
Sections.push_back(FirstSection);
}
BOOL CINIFile::Parse(void)
bool CINIFile::Parse(void)
{
CToken T, U, V, W;
string currentSection; // current section we're processing
BOOL parseStatus = OKAY;
bool parseStatus = OKAY;
lineNum = 0;

View file

@ -66,9 +66,9 @@ public:
* checked. If the setting is not found, the output parameter will not
* be modified.
*/
BOOL Get(string SectionName, string SettingName, int& value);
BOOL Get(string SectionName, string SettingName, unsigned& value);
BOOL Get(string SectionName, string SettingName, string& String);
bool Get(string SectionName, string SettingName, int& value);
bool Get(string SectionName, string SettingName, unsigned& value);
bool Get(string SectionName, string SettingName, string& String);
/*
* Set(SectionName, SettingName, value):
@ -111,7 +111,7 @@ public:
* procedure, it is possible that nothing will be output and the
* previous contents will be lost.
*/
BOOL Write(const char *comment);
bool Write(const char *comment);
/*
* Parse(void):
@ -125,7 +125,7 @@ public:
* Returns:
* OKAY if successful, FAIL if there was a file or parse error.
*/
BOOL Parse(void);
bool Parse(void);
/*
* SetDefaultSectionName(SectionName):
@ -160,7 +160,7 @@ public:
* Returns:
* OKAY if successful, FAIL if unable to open for reading and writing.
*/
BOOL Open(const char *fileNameStr);
bool Open(const char *fileNameStr);
/*
* OpenAndCreate(fileNameStr):
@ -174,7 +174,7 @@ public:
* Returns:
* OKAY if successful, FAIL if unable to open file.
*/
BOOL OpenAndCreate(const char *fileNameStr);
bool OpenAndCreate(const char *fileNameStr);
/*
* Close(void):
@ -197,7 +197,7 @@ private:
};
// Parse tree
BOOL LookUpSection(unsigned *idx, string SectionName);
bool LookUpSection(unsigned *idx, string SectionName);
void InitParseTree(void);
// Tokenizer
@ -222,14 +222,14 @@ private:
struct Setting // it is up to caller to determine whether to use value or string
{
string Name; // setting name
BOOL isNumber; // internal flag: true if the setting is a number, false if it is a string
bool isNumber; // internal flag: true if the setting is a number, false if it is a string
int value; // value of number
string String; // string
Setting(void)
{
value = 0; // initialize value to 0
isNumber = TRUE; // indicate the setting is initially a number
isNumber = true; // indicate the setting is initially a number
}
};
struct Section

View file

@ -104,9 +104,9 @@ static inline UINT32 Fetch(struct NCR53C810Context *Ctx)
}
//TO-DO: check if this ever occurs in single-step mode (if so, we would need to stack interrupts)
static BOOL SCRIPTS_Int_IntFly(struct NCR53C810Context *Ctx)
static bool SCRIPTS_Int_IntFly(struct NCR53C810Context *Ctx)
{
Ctx->halt = TRUE; // halt SCRIPTS execution
Ctx->halt = true; // halt SCRIPTS execution
Ctx->regISTAT |= 1; // DMA interrupt pending
Ctx->regDSTAT |= 4; // SCRIPTS interrupt instruction received
Ctx->IRQ->Assert(Ctx->scsiIRQ);
@ -116,7 +116,7 @@ static BOOL SCRIPTS_Int_IntFly(struct NCR53C810Context *Ctx)
return OKAY;
}
static BOOL SCRIPTS_MoveMemory(struct NCR53C810Context *Ctx)
static bool SCRIPTS_MoveMemory(struct NCR53C810Context *Ctx)
{
UINT32 src, dest;
unsigned numBytes, i;
@ -154,13 +154,13 @@ static BOOL SCRIPTS_MoveMemory(struct NCR53C810Context *Ctx)
}
// Invalid instruction handler
static BOOL SCRIPTS_Invalid(struct NCR53C810Context *Ctx)
static bool SCRIPTS_Invalid(struct NCR53C810Context *Ctx)
{
DebugLog("53C810 encountered an unrecognized instruction (%02X%06X, DSP=%08X)\n!", Ctx->regDCMD, Ctx->regDBC, Ctx->regDSP);
return FAIL;
}
void C53C810::Run(BOOL singleStep)
void C53C810::Run(bool singleStep)
{
UINT32 op;
int i;
@ -201,7 +201,7 @@ void C53C810::Run(BOOL singleStep)
}
// Insert instructions into the LUT under control of the mask
void C53C810::Insert(UINT8 mask, UINT8 op, BOOL (*Handler)(struct NCR53C810Context *))
void C53C810::Insert(UINT8 mask, UINT8 op, bool (*Handler)(struct NCR53C810Context *))
{
UINT32 i;
@ -291,13 +291,13 @@ void C53C810::WriteRegister(unsigned reg, UINT8 data)
case 0x2F: // DSP 31-24
Ctx.regDSP &= 0x00FFFFFF;
Ctx.regDSP |= (data<<24);
Ctx.halt = FALSE; // writing this register un-halts 53C810 operation (pg.6-31 of LSI manual)
Ctx.halt = false; // writing this register un-halts 53C810 operation (pg.6-31 of LSI manual)
if (!(Ctx.regDMODE&1)) // if MAN=0, start SCRIPTS automatically
// To-Do: is this correct? Should single step really be tested first?
//if (!(Ctx.regDCNTL&0x10) && !(Ctx.regDMODE&1)) // if MAN=0 and not single stepping, start SCRIPTS automatically
{
DebugLog("53C810: Automatically starting (PC=%08X, LR=%08X, single step=%d)\n", ppc_get_pc(), ppc_get_lr(), !!(Ctx.regDCNTL&0x10));
Run(FALSE); // automatic
Run(false); // automatic
}
break;
case 0x30: // DSPS 7-0
@ -324,12 +324,12 @@ void C53C810::WriteRegister(unsigned reg, UINT8 data)
if ((Ctx.regDCNTL&0x14) == 0x14) // single step
{
DebugLog("53C810: single step: %08X, (halt=%d)\n", Ctx.regDSP, Ctx.halt);
Run(TRUE);
Run(true);
}
else if ((Ctx.regDCNTL&0x04)) // start DMA bit
{
DebugLog("53C810: Manually starting\n");
Run(FALSE);
Run(false);
}
break;
default:
@ -472,7 +472,7 @@ void C53C810::Reset(void)
Ctx.regDMODE = 0;
Ctx.regDSTAT = 0x80; // DMA FIFO empty
Ctx.regISTAT = 0;
Ctx.halt = FALSE;
Ctx.halt = false;
DebugLog("53C810 reset\n");
}

View file

@ -51,7 +51,7 @@ struct NCR53C810Context
UINT8 regISTAT; // ISTAT: Interrupt Status
// Operational status
BOOL halt; // set TRUE if halted by interrupt instruction
bool halt; // set true if halted by interrupt instruction
// Big endian bus object for DMA memory access and instruction fetching
CBus *Bus;
@ -185,10 +185,10 @@ public:
private:
// Private members
void Run(int numOps);
void Run(bool singleStep);
void BuildOpTable(void);
void Insert(UINT8 mask, UINT8 op, BOOL (*Handler)(struct NCR53C810Context *));
BOOL (*OpTable[256])(struct NCR53C810Context *);
void Insert(UINT8 mask, UINT8 op, bool (*Handler)(struct NCR53C810Context *));
bool (*OpTable[256])(struct NCR53C810Context *);
// Context (register file)
struct NCR53C810Context Ctx;

View file

@ -162,7 +162,7 @@ int main(int argc, char **argv)
UINT8 *buffer;
unsigned i, num, offset, fsize, start = 0, len, org, file = 0;
UINT32 op[3];
BOOL len_specified = 0, org_specified = 0;
bool len_specified = 0, org_specified = 0;
char *c;

View file

@ -118,7 +118,7 @@ void C93C46::Write(unsigned pinCS, unsigned pinCLK, unsigned pinDI)
if (CS == 0)
{
bitBufferIn = 0; // this must be cleared each time (only leading 0's can exist prior to commands)
receiving = TRUE; // ready to accept commands
receiving = true; // ready to accept commands
busyCycles = 5; // some applications require the chip to take time while writing
return;
}
@ -126,7 +126,7 @@ void C93C46::Write(unsigned pinCS, unsigned pinCLK, unsigned pinDI)
// Rising clock edge
if (!prevCLK && CLK)
{
if (receiving == TRUE) // is the chip receiving commands?
if (receiving == true) // is the chip receiving commands?
{
// Shift in a new bit
bitBufferIn <<= 1;
@ -139,17 +139,17 @@ void C93C46::Write(unsigned pinCS, unsigned pinCLK, unsigned pinDI)
bitBufferOut = ReverseBits16(regs[addr]); // reverse so that D15 is shifted out first
//bitBufferOut <<= 1; // a leading 0 precedes the first word read (causes problems)
bitsOut = 0; // how many bits read out
receiving = FALSE; // transmitting data now
receiving = false; // transmitting data now
DebugLog("93C46: READ %X\n", addr);
}
else if (bitBufferIn == 0x13) // WEN (write enable)
{
locked = FALSE;
locked = false;
DebugLog("93C46: WEN\n");
}
else if (bitBufferIn == 0x10) // WDS (write disable)
{
locked = TRUE;
locked = true;
DebugLog("93C46: WDS\n");
}
else if ((bitBufferIn&0xFFC00000) == 0x01400000) // WRITE
@ -232,8 +232,8 @@ void C93C46::Clear(void)
void C93C46::Reset(void)
{
receiving = TRUE;
locked = TRUE;
receiving = true;
locked = true;
bitBufferIn = 0;
bitBufferOut = 0;
addr = 0;

View file

@ -117,10 +117,10 @@ private:
UINT32 bitBufferOut; // bits to be shifted out
UINT32 bitBufferIn; // stores bits as they are shifted in
int bitsOut; // how many bits have been shifted out
BOOL receiving; // if true, accepting data, if false, sending data out (read commands)
bool receiving; // if true, accepting data, if false, sending data out (read commands)
unsigned addr; // latched address
int busyCycles; // when > 0, counts down delay cycles and indicates busy
BOOL locked; // whether the EEPROM is in a locked state
bool locked; // whether the EEPROM is in a locked state
};

View file

@ -377,7 +377,7 @@ UINT8 CDSB1::IORead8(UINT32 addr)
else
status |= 2;
Z80.SetINT(FALSE); // clear IRQ
Z80.SetINT(false); // clear IRQ
//printf("Z80: INT cleared, read from FIFO\n");
return d;
@ -436,7 +436,7 @@ void CDSB1::RunFrame(INT16 *audioL, INT16 *audioR)
// While FIFO not empty, fire interrupts, run for up to one frame
for (cycles = (4000000/60)/4; (cycles > 0) && (fifoIdxR != fifoIdxW); )
{
Z80.SetINT(TRUE); // fire an IRQ to indicate pending command
Z80.SetINT(true); // fire an IRQ to indicate pending command
//printf("Z80 INT fired\n");
cycles -= Z80.Run(500);
}
@ -561,7 +561,7 @@ void CDSB1::LoadState(CBlockFile *StateFile)
#define DSB1_OFFSET_MPEG_RIGHT 0x8644 // 1604 bytes right MPEG buffer
#define DSB1_MEMORY_POOL_SIZE (0x8000 + 0x644 + 0x644)
BOOL CDSB1::Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr)
bool CDSB1::Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr)
{
float memSizeMB = (float)DSB1_MEMORY_POOL_SIZE/(float)0x100000;
@ -1122,7 +1122,7 @@ void CDSB2::LoadState(CBlockFile *StateFile)
#define DSB2_OFFSET_MPEG_RIGHT 0x20644 // 1604 bytes right MPEG buffer
#define DSB2_MEMORY_POOL_SIZE (0x20000 + 0x644 + 0x644)
BOOL CDSB2::Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr)
bool CDSB2::Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr)
{
float memSizeMB = (float)DSB2_MEMORY_POOL_SIZE/(float)0x100000;

View file

@ -50,7 +50,7 @@
class CDSBConfig
{
public:
bool emulateDSB; // DSB emulation (enabled if TRUE)
bool emulateDSB; // DSB emulation (enabled if true)
// Sound (SCSP) volume (0-200, 100 being full amplitude)
inline void SetSoundVolume(unsigned vol)
@ -207,7 +207,7 @@ public:
* Returns:
* OKAY if successful, otherwise FAIL.
*/
virtual BOOL Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr) = 0;
virtual bool Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr) = 0;
};
@ -239,7 +239,7 @@ public:
void Reset(void);
void SaveState(CBlockFile *StateFile);
void LoadState(CBlockFile *StateFile);
BOOL Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr);
bool Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr);
// Constructor and destructor
CDSB1(void);
@ -311,7 +311,7 @@ public:
void Reset(void);
void SaveState(CBlockFile *StateFile);
void LoadState(CBlockFile *StateFile);
BOOL Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr);
bool Init(const UINT8 *progROMPtr, const UINT8 *mpegROMPtr);
// Constructor and destructor
CDSB2(void);

View file

@ -117,7 +117,7 @@ void CDriveBoard::LoadState(CBlockFile *SaveState)
SendStopAll();
}
BOOL CDriveBoard::Init(const UINT8 *romPtr)
bool CDriveBoard::Init(const UINT8 *romPtr)
{
// Assign ROM (note that the ROM data has not yet been loaded)
m_rom = romPtr;

View file

@ -50,7 +50,7 @@ public:
void LoadState(CBlockFile *SaveState);
BOOL Init(const UINT8 *romPtr);
bool Init(const UINT8 *romPtr);
void AttachInputs(CInputs *InputsPtr, unsigned gameInputFlags);

View file

@ -2476,7 +2476,7 @@ static void Reverse32(UINT8 *buf, unsigned size)
}
// Dumps a memory region to a file for debugging purposes
static void Dump(const char *file, UINT8 *buf, unsigned size, BOOL reverse32, BOOL reverse16)
static void Dump(const char *file, UINT8 *buf, unsigned size, bool reverse32, bool reverse16)
{
FILE *fp;
@ -2518,7 +2518,7 @@ const struct GameInfo * CModel3::GetGameInfo(void)
}
// Stepping-dependent parameters (MPC10x type, etc.) are initialized here
BOOL CModel3::LoadROMSet(const struct GameInfo *GameList, const char *zipFile)
bool CModel3::LoadROMSet(const struct GameInfo *GameList, const char *zipFile)
{
struct ROMMap Map[] =
{
@ -2538,7 +2538,7 @@ BOOL CModel3::LoadROMSet(const struct GameInfo *GameList, const char *zipFile)
*(UINT64 *) driveROM = MAGIC_NUMBER;
// Load game
Game = LoadROMSetFromZIPFile(Map, GameList, zipFile, TRUE);
Game = LoadROMSetFromZIPFile(Map, GameList, zipFile, true);
if (NULL == Game)
return ErrorLog("Failed to load ROM set.");
@ -2669,7 +2669,7 @@ void CModel3::AttachInputs(CInputs *InputsPtr)
}
// Model 3 initialization. Some initialization is deferred until ROMs are loaded in LoadROMSet()
BOOL CModel3::Init(void)
bool CModel3::Init(void)
{
float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000;
@ -2754,12 +2754,12 @@ CModel3::~CModel3(void)
{
// Debug: dump some files
#if 0
Dump("ram", ram, 0x800000, TRUE, FALSE);
//Dump("vrom", vrom, 0x4000000, TRUE, FALSE);
//Dump("crom", crom, 0x800000, TRUE, FALSE);
//Dump("bankedCrom", &crom[0x800000], 0x7000000, TRUE, FALSE);
//Dump("soundROM", soundROM, 0x80000, FALSE, TRUE);
//Dump("sampleROM", sampleROM, 0x800000, FALSE, TRUE);
Dump("ram", ram, 0x800000, true, false);
//Dump("vrom", vrom, 0x4000000, true, false);
//Dump("crom", crom, 0x800000, true, false);
//Dump("bankedCrom", &crom[0x800000], 0x7000000, true, false);
//Dump("soundROM", soundROM, 0x80000, false, true);
//Dump("sampleROM", sampleROM, 0x800000, false, true);
#endif
// Stop all threads

View file

@ -36,7 +36,7 @@
class CModel3Config
{
public:
bool multiThreaded; // Multi-threading (enabled if TRUE)
bool multiThreaded; // Multi-threading (enabled if true)
// PowerPC clock frequency in MHz (minimum: 1 MHz)
inline void SetPowerPCFrequency(unsigned f)
@ -240,7 +240,7 @@ public:
* Returns:
* OKAY if successful, FAIL otherwise. Prints errors.
*/
BOOL LoadROMSet(const struct GameInfo *GameList, const char *zipFile);
bool LoadROMSet(const struct GameInfo *GameList, const char *zipFile);
/*
* AttachRenderers(Render2DPtr, Render3DPtr):
@ -273,7 +273,7 @@ public:
* OKAY is successful, otherwise FAILED if a non-recoverable error
* occurred. Prints own error messages.
*/
BOOL Init(void);
bool Init(void);
/*
* CModel3(void):
@ -352,14 +352,14 @@ private:
PPC_FETCH_REGION PPCFetchRegions[3];
// Multiple threading
bool startedThreads; // True if threads have been created and started
CThread *sndBrdThread; // Sound board thread
CThread *drvBrdThread; // Drive board thread
bool sndBrdThreadDone; // Flag to indicate sound board thread has finished processing for current frame
bool drvBrdThreadDone; // Flag to indicate drive board thread has finished processing for current frame
// Thread synchronization objects
CSemaphore *sndBrdThreadSync;
bool startedThreads; // True if threads have been created and started
CThread *sndBrdThread; // Sound board thread
CThread *drvBrdThread; // Drive board thread
bool sndBrdThreadDone; // Flag to indicate sound board thread has finished processing for current frame
bool drvBrdThreadDone; // Flag to indicate drive board thread has finished processing for current frame
// Thread synchronization objects
CSemaphore *sndBrdThreadSync;
CSemaphore *drvBrdThreadSync;
CMutex *notifyLock;
CCondVar *notifySync;

View file

@ -121,7 +121,7 @@ void CReal3D::RenderFrame(void)
{
//if (commandPortWritten)
Render3D->RenderFrame();
commandPortWritten = FALSE;
commandPortWritten = false;
}
void CReal3D::BeginFrame(void)
@ -668,7 +668,7 @@ void CReal3D::Flush(void)
unsigned i, size;
UINT32 header;
commandPortWritten = TRUE;
commandPortWritten = true;
DebugLog("Real3D 88000000 written @ PC=%08X\n", ppc_get_pc());
@ -806,7 +806,7 @@ void CReal3D::Reset(void)
{
error = false;
commandPortWritten = FALSE;
commandPortWritten = false;
fifoIdx = 0;
status = 0;
@ -857,7 +857,7 @@ void CReal3D::SetStep(int stepID)
DebugLog("Real3D set to Step %d.%d\n", (step>>4)&0xF, step&0xF);
}
BOOL CReal3D::Init(const UINT8 *vromPtr, CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned dmaIRQBit)
bool CReal3D::Init(const UINT8 *vromPtr, CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned dmaIRQBit)
{
float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000;

View file

@ -323,7 +323,7 @@ public:
* OKAY if successful otherwise FAIL (not enough memory). Prints own
* errors.
*/
BOOL Init(const UINT8 *vromPtr, CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned dmaIRQBit);
bool Init(const UINT8 *vromPtr, CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned dmaIRQBit);
/*
* CReal3D(void):
@ -382,7 +382,7 @@ private:
UINT8 dmaConfig;
// Command port
BOOL commandPortWritten;
bool commandPortWritten;
// Status and command registers
UINT32 status;

View file

@ -468,7 +468,7 @@ void CSoundBoard::AttachDSB(CDSB *DSBPtr)
#define OFFSET_AUDIO_RIGHT 0x2005BE // 1470 bytes right audio channel
#define MEMORY_POOL_SIZE (0x100000 + 0x100000 + 0x5BE + 0x5BE)
BOOL CSoundBoard::Init(const UINT8 *soundROMPtr, const UINT8 *sampleROMPtr)
bool CSoundBoard::Init(const UINT8 *soundROMPtr, const UINT8 *sampleROMPtr)
{
float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000;

View file

@ -40,7 +40,7 @@
class CSoundBoardConfig
{
public:
bool emulateSCSP; // SCSP emulation (enabled if TRUE)
bool emulateSCSP; // SCSP emulation (enabled if true)
// Defaults
CSoundBoardConfig(void)
@ -160,7 +160,7 @@ public:
* OKAY if successful, FAIL if unable to allocate memory. Prints own
* error messages.
*/
BOOL Init(const UINT8 *soundROMPtr, const UINT8 *sampleROMPtr);
bool Init(const UINT8 *soundROMPtr, const UINT8 *sampleROMPtr);
/*
* CSoundBoard(void):

View file

@ -156,7 +156,7 @@ void CTileGen::AttachRenderer(CRender2D *Render2DPtr)
#define MEMORY_POOL_SIZE 0x120000
BOOL CTileGen::Init(CIRQ *IRQObjectPtr)
bool CTileGen::Init(CIRQ *IRQObjectPtr)
{
float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000;

View file

@ -151,7 +151,7 @@ public:
* OKAY is successful, otherwise FAILED if a non-recoverable error
* occurred. Prints own error messages.
*/
BOOL Init(CIRQ *IRQObjectPtr);
bool Init(CIRQ *IRQObjectPtr);
/*
* CTileGen(void):

View file

@ -12,7 +12,7 @@
*
* Initializes the audio system.
*/
extern BOOL OpenAudio();
extern bool OpenAudio();
/*
* OutputAudio(unsigned numSamples, *INT16 leftBuffer, *INT16 rightBuffer)

View file

@ -249,7 +249,7 @@ extern void DebugLog(const char *fmt, ...);
* Returns:
* Must always return FAIL.
*/
extern BOOL ErrorLog(const char *fmt, ...);
extern bool ErrorLog(const char *fmt, ...);
/*
* InfoLog(fmt, ...);

View file

@ -173,7 +173,7 @@ static void LogAudioInfo(SDL_AudioSpec *fmt)
InfoLog("");
}
BOOL OpenAudio()
bool OpenAudio()
{
// Initialize SDL audio sub-system
if (SDL_InitSubSystem(SDL_INIT_AUDIO) != 0)

View file

@ -106,7 +106,7 @@ void InfoLog(const char *fmt, ...)
va_end(vl);
}
BOOL ErrorLog(const char *fmt, ...)
bool ErrorLog(const char *fmt, ...)
{
if (s_Logger == NULL)
return FAIL;
@ -139,8 +139,8 @@ unsigned xRes, yRes; // renderer output resolution (can be smaller than GL vi
* because the actual drawing area may need to be adjusted to preserve the
* Model 3 aspect ratio. The new resolution will be passed back as well.
*/
static BOOL CreateGLScreen(const char *caption, unsigned *xOffsetPtr, unsigned *yOffsetPtr, unsigned *xResPtr, unsigned *yResPtr,
BOOL keepAspectRatio, BOOL fullScreen)
static bool CreateGLScreen(const char *caption, unsigned *xOffsetPtr, unsigned *yOffsetPtr, unsigned *xResPtr, unsigned *yResPtr,
bool keepAspectRatio, bool fullScreen)
{
const SDL_VideoInfo *VideoInfo;
GLenum err;
@ -238,7 +238,7 @@ static void PrintGLInfo(bool createScreen, bool infoLog, bool printExtensions)
if (createScreen)
{
if (OKAY != CreateGLScreen("Supermodel - Querying OpenGL Information...",&xOffset,&yOffset,&xRes,&yRes,FALSE,FALSE))
if (OKAY != CreateGLScreen("Supermodel - Querying OpenGL Information...",&xOffset,&yOffset,&xRes,&yRes,false,false))
{
ErrorLog("Unable to query OpenGL.\n");
return;
@ -334,7 +334,7 @@ static bool ConfigureInputs(CInputs *Inputs, bool configure)
{
// Open an SDL window
unsigned xOffset, yOffset, xRes=496, yRes=384;
if (OKAY != CreateGLScreen("Supermodel - Configuring Inputs...",&xOffset,&yOffset,&xRes,&yRes,FALSE,FALSE))
if (OKAY != CreateGLScreen("Supermodel - Configuring Inputs...",&xOffset,&yOffset,&xRes,&yRes,false,false))
return (bool) ErrorLog("Unable to start SDL to configure inputs.\n");
// Configure the inputs
@ -674,8 +674,8 @@ int Supermodel(const char *zipFile, CInputs *Inputs, CINIFile *CmdLine)
unsigned fpsFramesElapsed, framesElapsed;
unsigned showCrosshairs = 0; // bit 1: player 1 crosshair, bit 0: player 2
bool gameHasLightguns = false;
BOOL quit = 0;
BOOL paused = 0;
bool quit = 0;
bool paused = 0;
// Initialize and load ROMs
if (OKAY != Model3->Init())
@ -694,7 +694,7 @@ int Supermodel(const char *zipFile, CInputs *Inputs, CINIFile *CmdLine)
xRes = g_Config.xRes;
yRes = g_Config.yRes;
sprintf(titleStr, "Supermodel - %s", Model3->GetGameInfo()->title);
if (OKAY != CreateGLScreen(titleStr,&xOffset,&yOffset,&xRes,&yRes,TRUE,g_Config.fullScreen))
if (OKAY != CreateGLScreen(titleStr,&xOffset,&yOffset,&xRes,&yRes,true,g_Config.fullScreen))
return 1;
// Info log GL information and user options
@ -1036,7 +1036,7 @@ static int DisassembleCROM(const char *zipFile, UINT32 addr, unsigned n)
Map[1].ptr = &crom[0x800000];
// Load ROM set
Game = LoadROMSetFromZIPFile(Map, g_Model3GameList, zipFile, FALSE);
Game = LoadROMSetFromZIPFile(Map, g_Model3GameList, zipFile, false);
if (NULL == Game)
return ErrorLog("Failed to load ROM set.");

View file

@ -44,7 +44,7 @@ class COSDConfig
{
public:
unsigned xRes, yRes; // X and Y resolution, in pixels
bool fullScreen; // Full screen mode (if TRUE)
bool fullScreen; // Full screen mode (if true)
bool throttle; // 60 Hz frame limiting
bool showFPS; // Show frame rate
bool flipStereo; // Flip stereo channels

View file

@ -33,13 +33,10 @@
#define INCLUDED_TYPES_H
// Booleans (must be 0 or 1 only)
#define TRUE 1
#define FALSE 0
#define OKAY FALSE
#define FAIL TRUE
#define OKAY 0
#define FAIL 1
// Types
typedef int BOOL;
typedef unsigned long long UINT64;
typedef signed long long INT64;
typedef unsigned int UINT32;

View file

@ -522,8 +522,8 @@ void CDirectInputSystem::OpenKeyboardsAndMice()
strcpy(keyDetails.name, "Unknown Keyboard");
m_keyDetails.push_back(keyDetails);
BOOL *pKeyState = new BOOL[255];
memset(pKeyState, 0, sizeof(BOOL) * 255);
bool *pKeyState = new bool[255];
memset(pKeyState, 0, sizeof(bool) * 255);
m_rawKeyStates.push_back(pKeyState);
}
else if (device.dwType == RIM_TYPEMOUSE)
@ -751,7 +751,7 @@ void CDirectInputSystem::CloseKeyboardsAndMice()
}
// Delete storage for keyboards
for (vector<BOOL*>::iterator it = m_rawKeyStates.begin(); it != m_rawKeyStates.end(); it++)
for (vector<bool*>::iterator it = m_rawKeyStates.begin(); it != m_rawKeyStates.end(); it++)
delete[] *it;
m_keyDetails.clear();
m_rawKeyboards.clear();
@ -828,7 +828,7 @@ void CDirectInputSystem::ProcessRawInput(HRAWINPUT hInput)
if (pData->header.dwType == RIM_TYPEKEYBOARD)
{
// Keyboard event, so identify which keyboard produced event
BOOL *pKeyState = NULL;
bool *pKeyState = NULL;
size_t kbdNum;
for (kbdNum = 0; kbdNum < m_rawKeyboards.size(); kbdNum++)
{
@ -843,9 +843,9 @@ void CDirectInputSystem::ProcessRawInput(HRAWINPUT hInput)
if (pKeyState != NULL)
{
// Get scancode of key and whether key was pressed or released
BOOL isRight = pData->data.keyboard.Flags & RI_KEY_E0;
int isRight = (pData->data.keyboard.Flags & RI_KEY_E0);
UINT8 scanCode = (pData->data.keyboard.MakeCode & 0x7f) | (isRight ? 0x80 : 0x00);
BOOL pressed = !(pData->data.keyboard.Flags & RI_KEY_BREAK);
bool pressed = !(pData->data.keyboard.Flags & RI_KEY_BREAK);
// Store current state for key
if (scanCode != 0xAA)
@ -1113,7 +1113,7 @@ void CDirectInputSystem::OpenJoysticks()
// If joystick has force feedback capabilities then disable auto-center
if (joyDetails.hasFFeedback)
{
dipdw.dwData = FALSE;
dipdw.dwData = false;
if (FAILED(hr = joystick->SetProperty(DIPROP_AUTOCENTER, &dipdw.diph)))
{
@ -1188,10 +1188,10 @@ void CDirectInputSystem::PollJoysticks()
pJoyState->lRy = (LONG)-gamepad.sThumbRY;
pJoyState->lRz = (LONG)CInputSource::Scale(gamepad.bRightTrigger, 0, 255, 0, 32767);
WORD buttons = gamepad.wButtons;
BOOL dUp = buttons & XINPUT_GAMEPAD_DPAD_UP;
BOOL dDown = buttons & XINPUT_GAMEPAD_DPAD_DOWN;
BOOL dLeft = buttons & XINPUT_GAMEPAD_DPAD_LEFT;
BOOL dRight = buttons & XINPUT_GAMEPAD_DPAD_RIGHT;
int dUp = (buttons & XINPUT_GAMEPAD_DPAD_UP);
int dDown = (buttons & XINPUT_GAMEPAD_DPAD_DOWN);
int dLeft = (buttons & XINPUT_GAMEPAD_DPAD_LEFT);
int dRight = (buttons & XINPUT_GAMEPAD_DPAD_RIGHT);
if (dUp)
{
if (dLeft) pJoyState->rgdwPOV[0] = 31500;
@ -1494,7 +1494,7 @@ bool CDirectInputSystem::IsKeyPressed(int kbdNum, int keyIndex)
if (m_useRawInput)
{
// For RawInput, check if key is currently pressed for given keyboard number
BOOL *keyState = m_rawKeyStates[kbdNum];
bool *keyState = m_rawKeyStates[kbdNum];
return !!keyState[diKey];
}
@ -1877,9 +1877,9 @@ bool CDirectInputSystem::Poll()
void CDirectInputSystem::SetMouseVisibility(bool visible)
{
if (m_useRawInput)
ShowCursor(!m_grabMouse && visible ? TRUE : FALSE);
ShowCursor(!m_grabMouse && visible ? true : false);
else
ShowCursor(visible ? TRUE : FALSE);
ShowCursor(visible ? true : false);
}
void CDirectInputSystem::GrabMouse()

View file

@ -59,7 +59,7 @@ struct DIEnumDevsContext
// RawInput API
typedef /*WINUSERAPI*/ INT (WINAPI *GetRawInputDeviceListPtr)(OUT PRAWINPUTDEVICELIST pRawInputDeviceList, IN OUT PUINT puiNumDevices, IN UINT cbSize);
typedef /*WINUSERAPI*/ INT (WINAPI *GetRawInputDeviceInfoPtr)(IN HANDLE hDevice, IN UINT uiCommand, OUT LPVOID pData, IN OUT PUINT pcbSize);
typedef /*WINUSERAPI*/ BOOL (WINAPI *RegisterRawInputDevicesPtr)(IN PCRAWINPUTDEVICE pRawInputDevices, IN UINT uiNumDevices, IN UINT cbSize);
typedef /*WINUSERAPI*/ bool (WINAPI *RegisterRawInputDevicesPtr)(IN PCRAWINPUTDEVICE pRawInputDevices, IN UINT uiNumDevices, IN UINT cbSize);
typedef /*WINUSERAPI*/ INT (WINAPI *GetRawInputDataPtr)(IN HRAWINPUT hRawInput, IN UINT uiCommand, OUT LPVOID pData, IN OUT PUINT pcbSize, IN UINT cbSizeHeader);
// XInput API
@ -111,7 +111,7 @@ private:
// RawInput keyboard and mice handles and states
vector<HANDLE> m_rawKeyboards;
vector<BOOL*> m_rawKeyStates;
vector<bool*> m_rawKeyStates;
vector<HANDLE> m_rawMice;
RawMseState m_combRawMseState;
vector<RawMseState> m_rawMseStates;

View file

@ -60,7 +60,7 @@ void CopyRegion(UINT8 *dest, unsigned destOffset, unsigned destSize, UINT8 *src,
}
// Search for a ROM within a single game based on its CRC
static BOOL FindROMByCRCInGame(const struct GameInfo **gamePtr, int *romIdxPtr, const struct GameInfo *Game, UINT32 crc)
static bool FindROMByCRCInGame(const struct GameInfo **gamePtr, int *romIdxPtr, const struct GameInfo *Game, UINT32 crc)
{
unsigned j;
@ -78,7 +78,7 @@ static BOOL FindROMByCRCInGame(const struct GameInfo **gamePtr, int *romIdxPtr,
}
// Search for a ROM in the complete game list based on CRC32 and return its GameInfo and ROMInfo entries
static BOOL FindROMByCRC(const struct GameInfo **gamePtr, int *romIdxPtr, const struct GameInfo *GameList, const struct GameInfo *TryGame, UINT32 crc)
static bool FindROMByCRC(const struct GameInfo **gamePtr, int *romIdxPtr, const struct GameInfo *GameList, const struct GameInfo *TryGame, UINT32 crc)
{
unsigned i;
@ -97,8 +97,8 @@ static BOOL FindROMByCRC(const struct GameInfo **gamePtr, int *romIdxPtr, const
return FAIL;
}
// Returns TRUE if this ROM appears only a single time in the entire game list (ie., it is not shared between games)
static BOOL ROMIsUnique(const struct GameInfo *GameList, UINT32 crc)
// Returns true if this ROM appears only a single time in the entire game list (ie., it is not shared between games)
static bool ROMIsUnique(const struct GameInfo *GameList, UINT32 crc)
{
int timesFound = 0;
@ -111,7 +111,7 @@ static BOOL ROMIsUnique(const struct GameInfo *GameList, UINT32 crc)
}
}
return (timesFound == 1) ? TRUE : FALSE;
return (timesFound == 1) ? true : false;
}
static void ByteSwap(UINT8 *buf, unsigned size)
@ -128,7 +128,7 @@ static void ByteSwap(UINT8 *buf, unsigned size)
}
// Load a single ROM file
static BOOL LoadROM(UINT8 *buf, unsigned bufSize, const struct ROMMap *Map, const struct ROMInfo *ROM, unzFile zf, const char *zipFile, BOOL loadAll)
static bool LoadROM(UINT8 *buf, unsigned bufSize, const struct ROMMap *Map, const struct ROMInfo *ROM, unzFile zf, const char *zipFile, bool loadAll)
{
char file[2048+1];
int err, bytes;
@ -202,7 +202,7 @@ static BOOL LoadROM(UINT8 *buf, unsigned bufSize, const struct ROMMap *Map, cons
* Pointer to GameInfo struct for loaded game if successful, NULL
* otherwise. Prints errors.
*/
const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const struct GameInfo *GameList, const char *zipFile, BOOL loadAll)
const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const struct GameInfo *GameList, const char *zipFile, bool loadAll)
{
unzFile zf;
unz_file_info fileInfo;
@ -212,7 +212,7 @@ const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const st
unsigned romsFound[sizeof(Game->ROM)/sizeof(struct ROMInfo)], numROMs;
int err;
unsigned i, maxSize;
BOOL multipleGameError = FALSE;
bool multipleGameError = false;
UINT8 *buf;
// Try to open file
@ -254,10 +254,10 @@ const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const st
if (CurGame != Game) // another game?
{
DebugLog("%s also contains: %s (%s)\n", zipFile, CurGame->id, CurGame->title);
if (multipleGameError == FALSE) // only warn about this once
if (multipleGameError == false) // only warn about this once
{
ErrorLog("Multiple games were found in %s; loading '%s'.", zipFile, Game->title);
multipleGameError = TRUE;
multipleGameError = true;
}
}
}
@ -295,7 +295,7 @@ const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const st
for (i = 0; i < numROMs; i++)
{
if ((0 == romsFound[i]) && !Game->ROM[i].optional) // if not found and also not optional
err |= ErrorLog("%s (CRC=%08X) is missing from %s.", Game->ROM[i].fileName, Game->ROM[i].crc, zipFile);
err |= (int) ErrorLog("%s (CRC=%08X) is missing from %s.", Game->ROM[i].fileName, Game->ROM[i].crc, zipFile);
}
if (err != OKAY)
{
@ -345,6 +345,7 @@ const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const st
// Ensure all ROMs were loaded
if (loadAll)
{
// See if any ROMs (that are not optional) could not be found
err = OKAY;
for (i = 0; i < numROMs; i++)
{

View file

@ -53,7 +53,7 @@ struct ROMInfo
unsigned groupSize; // number of consecutive bytes to fetch each time (groupSize%2 must = 0, must be consistent for region)
unsigned offset; // starting offset within ROM region
unsigned stride; // number of bytes to skip before loading next group of bytes from file (must be >= groupSize)
BOOL byteSwap; // swap every pair of bytes if true
bool byteSwap; // swap every pair of bytes if true
};
/*
@ -113,7 +113,7 @@ extern void CopyRegion(UINT8 *dest, unsigned destOffset, unsigned destSize, UINT
* otherwise. Prints errors.
*/
extern const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const struct GameInfo *GameList, const char *zipFile,
BOOL loadAll);
bool loadAll);
#endif // INCLUDED_ROMLOAD_H

View file

@ -43,9 +43,9 @@
* MPEG_IsPlaying(void):
*
* Returns:
* TRUE if an MPEG stream is currently playing, otherwise FALSE.
* TRUE if an MPEG stream is currently playing, otherwise false.
*/
extern BOOL MPEG_IsPlaying(void);
extern bool MPEG_IsPlaying(void);
/*
* MPEG_GetProgress(void):
@ -121,7 +121,7 @@ extern void MPEG_StopPlaying(void);
* Returns:
* OKAY if successful, FAIL if internal buffer could not be allocated.
*/
extern BOOL MPEG_Init(void);
extern bool MPEG_Init(void);
/*
* MPEG_Shutdown(void):

View file

@ -373,12 +373,12 @@ void MPEG_StopPlaying(void)
}
}
BOOL MPEG_IsPlaying(void)
bool MPEG_IsPlaying(void)
{
return playing ? TRUE : FALSE;
return playing ? TRUE : false;
}
BOOL MPEG_Init(void)
bool MPEG_Init(void)
{
if (!decoder_init)
{

View file

@ -68,7 +68,6 @@
/*
* Fundamental Data Types:
*
* BOOL Boolean (w/ TRUE = FAIL = 1, OKAY = FALSE = 0).
* UINT64 Unsigned 64-bit integer.
* INT64 Signed 64-bit integer.
* UINT32 Unsigned 32-bit integer.
@ -80,6 +79,11 @@
* FLOAT32 Single-precision, 32-bit floating point number.
* FLOAT64 Double-precision, 64-bit floating point number.
*
* Boolean Values:
*
* OKAY 0
* FAIL 1
*
* Types.h is used within C++ and C modules, so it must NOT include any C++-
* specific stuff. Some modules may choose to include it directly rather than
* use Supermodel.h, so it must exist.