Open 7keo opened 6 years ago
BOOLEAN would explain some of the cases of 8bit value being used as a boolean and i think it better then using c++ bool.
Candidates for BOOLEAN
type based on their use:
onlygood
argumentnSolidTable
global variablenBlockTable
global variablenMissileTable
global variablenTransTable
global variablenTrapTable
global variableThe following have BOOL
sometimes and BOOLEAN
sometimes, it seems:
sendmsg
argumentCandidates for BOOL
type based on their use:
pregen
argumentrecreate
argumentdelta
argumentThe only counter argument against BOOLEAN
is that the PSX has a typedef for BOOL
but not the former. It's also typdef'd as unsigned char/BYTE
where as some cases used a signed char.
The only counter argument against BOOLEAN is that the PSX has a typedef for BOOL but not the former. It's also typdef'd as unsigned char/BYTE where as some cases used a signed char.
While a valid counter argument, I think one reason that the PSX debug symbols don't have BOOLEAN is simply because there are no bits left to represent it. The SYM type representation uses all bits.
From https://github.com/sanctuary/sym/blob/master/type.go#L70
// Base types.
const (
BaseNull Base = 0x0 // NULL
BaseVoid Base = 0x1 // VOID
BaseChar Base = 0x2 // CHAR
BaseShort Base = 0x3 // SHORT
BaseInt Base = 0x4 // INT
BaseLong Base = 0x5 // LONG
BaseFloat Base = 0x6 // FLOAT
BaseDouble Base = 0x7 // DOUBLE
BaseStruct Base = 0x8 // STRUCT
BaseUnion Base = 0x9 // UNION
BaseEnum Base = 0xA // ENUM
// Member of enum.
BaseMOE Base = 0xB // MOE
BaseUChar Base = 0xC // UCHAR
BaseUShort Base = 0xD // USHORT
BaseUInt Base = 0xE // UINT
BaseULong Base = 0xF // ULONG
)
Therefore, I think we may still use BOOLEAN as some variables definitely have the bool characteristics.
But is there any base type for BOOL
itself? It seems like a typdef
94 Def class TPDEF type UCHAR size 0 name BOOL
Either way, I think we can still use BOOLEAN for convenience.
But is there any base type for BOOL itself? It seems like a typdef
Oh, I guess you are right.
Either way, I think we can still use BOOLEAN for convenience.
I think so too.
Nice 😊
VOID is in the sym file, but I don't see what benefit it gives us since a lot of other values use lower case variants still?
Currently winapi types are being used for mostly unsigned types (BYTE, WORD, DWORD). These are defined in WinDef.h, the project files also are including WinNT.h which defines the following types:
(note the use of "BOOLEAN" for 8 bit unlike the 32 bit "BOOL")
and was probably available at the time at least of v1.09b.
This would read well along with, and be consistent with the unsigned types already in use.
edit: my suggestion also includes the use of "VOID".