More type/my name standardization

This commit is contained in:
InvisibleUp 2020-02-11 00:34:32 -05:00
parent 12c2ab0883
commit b98c8a8646
55 changed files with 3177 additions and 3196 deletions

View File

@ -4,29 +4,29 @@
Set x "rd:t1.txt"
Catenate "{my_project_d}"data:src:VIAEMDEV.c > "{x}"
Catenate "{project_d}"data:src:VIAEMDEV.c > "{x}"
Open "{x}"
Set CaseSensitive 1
Find ¥ "{x}"
Replace -c ° /'VIA1'/ 'VIA2' "{x}"
Find ¥ "{x}"
Replace -c ° /'VIAEMDEV'/ 'VIA2EMDV' "{x}"
Find ¥ "{x}"
Replace -c ° /'0x04'([0-9A-FX][0-9A-FX])¨1/ '0x05'¨1 "{x}"
Find <EFBFBD> "{x}"
Replace -c <EFBFBD> /'VIA1'/ 'VIA2' "{x}"
Find <EFBFBD> "{x}"
Replace -c <EFBFBD> /'VIAEMDEV'/ 'VIA2EMDV' "{x}"
Find <EFBFBD> "{x}"
Replace -c <EFBFBD> /'0x04'([0-9A-FX][0-9A-FX])<29>1/ '0x05'<27>1 "{x}"
Unset SearchType
Compare "{my_project_d}"data:src:VIA2EMDV.c "{x}"
Compare "{project_d}"data:src:VIA2EMDV.c "{x}"
Catenate "{my_project_d}"data:src:VIA2EMDV.c > "{x}"
Catenate "{project_d}"data:src:VIA2EMDV.c > "{x}"
Open "{x}"
Set CaseSensitive 1
Find ¥ "{x}"
Replace -c ° /'VIA2EMDV'/ 'VIAEMDEV' "{x}"
Find ¥ "{x}"
Replace -c ° /'VIA2'/ 'VIA1' "{x}"
Find ¥ "{x}"
Replace -c ° /'0x05'([0-9A-FX][0-9A-FX])¨1/ '0x04'¨1 "{x}"
Find <EFBFBD> "{x}"
Replace -c <EFBFBD> /'VIA2EMDV'/ 'VIAEMDEV' "{x}"
Find <EFBFBD> "{x}"
Replace -c <EFBFBD> /'VIA2'/ 'VIA1' "{x}"
Find <EFBFBD> "{x}"
Replace -c <EFBFBD> /'0x05'([0-9A-FX][0-9A-FX])<29>1/ '0x04'<27>1 "{x}"
Unset SearchType
Compare "{my_project_d}"data:src:VIAEMDEV.c "{x}"
Compare "{project_d}"data:src:VIAEMDEV.c "{x}"

View File

@ -40,7 +40,7 @@ IMPORTFUNC uint8_t ADB_ShiftInData(void);
#include "ADBSHARE.h"
LOCALVAR blnr ADB_ListenDatBuf;
LOCALVAR bool ADB_ListenDatBuf;
LOCALVAR uint8_t ADB_IndexDatBuf;
GLOBALPROC ADB_DoNewState(void)
@ -54,11 +54,11 @@ GLOBALPROC ADB_DoNewState(void)
switch (state) {
case 0: /* Start a new command */
if (ADB_ListenDatBuf) {
ADB_ListenDatBuf = falseblnr;
ADB_ListenDatBuf = false;
ADB_SzDatBuf = ADB_IndexDatBuf;
ADB_EndListen();
}
ADB_TalkDatBuf = falseblnr;
ADB_TalkDatBuf = false;
ADB_IndexDatBuf = 0;
ADB_CurCmd = ADB_ShiftInData();
/* which sets interrupt, acknowleding command */
@ -86,7 +86,7 @@ GLOBALPROC ADB_DoNewState(void)
"Reserved ADB command");
break;
case 2: /* listen */
ADB_ListenDatBuf = trueblnr;
ADB_ListenDatBuf = true;
#ifdef _VIA_Debug
fprintf(stderr, "*** listening\n");
#endif

View File

@ -33,13 +33,13 @@
#define ADB_MaxSzDatBuf 8
LOCALVAR uint8_t ADB_SzDatBuf;
LOCALVAR blnr ADB_TalkDatBuf = falseblnr;
LOCALVAR bool ADB_TalkDatBuf = false;
LOCALVAR uint8_t ADB_DatBuf[ADB_MaxSzDatBuf];
LOCALVAR uint8_t ADB_CurCmd = 0;
LOCALVAR uint8_t NotSoRandAddr = 1;
LOCALVAR uint8_t MouseADBAddress;
LOCALVAR blnr SavedCurMouseButton = falseblnr;
LOCALVAR bool SavedCurMouseButton = false;
LOCALVAR uint16_t MouseADBDeltaH = 0;
LOCALVAR uint16_t MouseADBDeltaV = 0;
@ -51,8 +51,8 @@ LOCALPROC ADB_DoMouseTalk(void)
EvtQEl *p;
uint16_t partH;
uint16_t partV;
blnr overflow = falseblnr;
blnr MouseButtonChange = falseblnr;
bool overflow = false;
bool MouseButtonChange = false;
if (nullpr != (p = EvtQOutP())) {
if (EvtQElKindMouseDelta == p->kind) {
@ -71,11 +71,11 @@ LOCALPROC ADB_DoMouseTalk(void)
partV = - partV;
}
if ((partH >> 6) > 0) {
overflow = trueblnr;
overflow = true;
partH = (1 << 6) - 1;
}
if ((partV >> 6) > 0) {
overflow = trueblnr;
overflow = true;
partV = (1 << 6) - 1;
}
if ((int16_t)MouseADBDeltaH < 0) {
@ -90,14 +90,14 @@ LOCALPROC ADB_DoMouseTalk(void)
if (nullpr != (p = EvtQOutP())) {
if (EvtQElKindMouseButton == p->kind) {
SavedCurMouseButton = p->u.press.down;
MouseButtonChange = trueblnr;
MouseButtonChange = true;
EvtQOutDone();
}
}
}
if ((0 != partH) || (0 != partV) || MouseButtonChange) {
ADB_SzDatBuf = 2;
ADB_TalkDatBuf = trueblnr;
ADB_TalkDatBuf = true;
ADB_DatBuf[0] = (SavedCurMouseButton ? 0x00 : 0x80)
| (partV & 127);
ADB_DatBuf[1] = /* 0x00 */ 0x80 | (partH & 127);
@ -107,7 +107,7 @@ LOCALPROC ADB_DoMouseTalk(void)
break;
case 3:
ADB_SzDatBuf = 2;
ADB_TalkDatBuf = trueblnr;
ADB_TalkDatBuf = true;
ADB_DatBuf[0] = 0x60 | (NotSoRandAddr & 0x0f);
ADB_DatBuf[1] = 0x01;
NotSoRandAddr += 1;
@ -139,13 +139,13 @@ LOCALPROC ADB_DoMouseListen(void)
LOCALVAR uint8_t KeyboardADBAddress;
LOCALFUNC blnr CheckForADBkeyEvt(uint8_t *NextADBkeyevt)
LOCALFUNC bool CheckForADBkeyEvt(uint8_t *NextADBkeyevt)
{
int i;
blnr KeyDown;
bool KeyDown;
if (! FindKeyEvent(&i, &KeyDown)) {
return falseblnr;
return false;
} else {
#if dbglog_HAVE && 0
if (KeyDown) {
@ -173,7 +173,7 @@ LOCALFUNC blnr CheckForADBkeyEvt(uint8_t *NextADBkeyevt)
break;
}
*NextADBkeyevt = (KeyDown ? 0x00 : 0x80) | i;
return trueblnr;
return true;
}
}
@ -186,7 +186,7 @@ LOCALPROC ADB_DoKeyboardTalk(void)
if (CheckForADBkeyEvt(&NextADBkeyevt)) {
ADB_SzDatBuf = 2;
ADB_TalkDatBuf = trueblnr;
ADB_TalkDatBuf = true;
ADB_DatBuf[0] = NextADBkeyevt;
if (! CheckForADBkeyEvt(&NextADBkeyevt)) {
ADB_DatBuf[1] = 0xFF;
@ -198,7 +198,7 @@ LOCALPROC ADB_DoKeyboardTalk(void)
break;
case 3:
ADB_SzDatBuf = 2;
ADB_TalkDatBuf = trueblnr;
ADB_TalkDatBuf = true;
ADB_DatBuf[0] = 0x60 | (NotSoRandAddr & 0x0f);
ADB_DatBuf[1] = 0x01;
NotSoRandAddr += 1;
@ -229,7 +229,7 @@ LOCALPROC ADB_DoKeyboardListen(void)
}
}
LOCALFUNC blnr CheckForADBanyEvt(void)
LOCALFUNC bool CheckForADBanyEvt(void)
{
EvtQEl *p = EvtQOutP();
if (nullpr != p) {
@ -237,7 +237,7 @@ LOCALFUNC blnr CheckForADBanyEvt(void)
case EvtQElKindMouseButton:
case EvtQElKindMouseDelta:
case EvtQElKindKey:
return trueblnr;
return true;
break;
default:
break;
@ -281,7 +281,7 @@ LOCALPROC ADB_Flush(void)
|| (Address == MouseADBAddress))
{
ADB_SzDatBuf = 2;
ADB_TalkDatBuf = trueblnr;
ADB_TalkDatBuf = true;
ADB_DatBuf[0] = 0x00;
ADB_DatBuf[1] = 0x00;
} else {

View File

@ -24,16 +24,16 @@
#define ALTKEYSM_H
#endif
LOCALVAR blnr AltKeysLockText = falseblnr;
LOCALVAR blnr AltKeysTrueCmnd = falseblnr;
LOCALVAR blnr AltKeysTrueOption = falseblnr;
LOCALVAR blnr AltKeysTrueShift = falseblnr;
LOCALVAR blnr AltKeysModOn = falseblnr;
LOCALVAR blnr AltKeysTextOn = falseblnr;
LOCALVAR bool AltKeysLockText = false;
LOCALVAR bool AltKeysTrueCmnd = false;
LOCALVAR bool AltKeysTrueOption = false;
LOCALVAR bool AltKeysTrueShift = false;
LOCALVAR bool AltKeysModOn = false;
LOCALVAR bool AltKeysTextOn = false;
LOCALPROC CheckAltKeyUseMode(void)
{
blnr NewAltKeysTextOn;
bool NewAltKeysTextOn;
AltKeysModOn = AltKeysTrueCmnd
|| AltKeysTrueOption || AltKeysTrueShift;
@ -47,7 +47,7 @@ LOCALPROC CheckAltKeyUseMode(void)
}
}
LOCALPROC Keyboard_UpdateKeyMap1(uint8_t key, blnr down)
LOCALPROC Keyboard_UpdateKeyMap1(uint8_t key, bool down)
{
if (MKC_Command == key) {
AltKeysTrueCmnd = down;
@ -64,8 +64,8 @@ LOCALPROC Keyboard_UpdateKeyMap1(uint8_t key, blnr down)
} else if (MKC_SemiColon == key) {
if (down && ! AltKeysModOn) {
if (AltKeysLockText) {
AltKeysLockText = falseblnr;
NeedWholeScreenDraw = trueblnr;
AltKeysLockText = false;
NeedWholeScreenDraw = true;
SpecialModeClr(SpclModeAltKeyText);
CheckAltKeyUseMode();
@ -78,9 +78,9 @@ LOCALPROC Keyboard_UpdateKeyMap1(uint8_t key, blnr down)
} else if (MKC_M == key) {
if (down) {
if (! AltKeysLockText) {
AltKeysLockText = trueblnr;
AltKeysLockText = true;
SpecialModeSet(SpclModeAltKeyText);
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
CheckAltKeyUseMode();
}
}
@ -176,13 +176,13 @@ LOCALPROC DisconnectKeyCodes1(uint32_t KeepMask)
DisconnectKeyCodes(KeepMask);
if (! (0 != (KeepMask & kKeepMaskCommand))) {
AltKeysTrueCmnd = falseblnr;
AltKeysTrueCmnd = false;
}
if (! (0 != (KeepMask & kKeepMaskOption))) {
AltKeysTrueOption = falseblnr;
AltKeysTrueOption = false;
}
if (! (0 != (KeepMask & kKeepMaskShift))) {
AltKeysTrueShift = falseblnr;
AltKeysTrueShift = false;
}
AltKeysModOn = AltKeysTrueCmnd
|| AltKeysTrueOption || AltKeysTrueShift;

View File

@ -54,7 +54,7 @@ LOCALVAR ASC_ChanR ASC_ChanA[4];
LOCALVAR uint16_t ASC_FIFO_Out = 0;
LOCALVAR uint16_t ASC_FIFO_InA = 0;
LOCALVAR uint16_t ASC_FIFO_InB = 0;
LOCALVAR blnr ASC_Playing = falseblnr;
LOCALVAR bool ASC_Playing = false;
#define ASC_dolog (dbglog_HAVE && 0)
@ -95,11 +95,11 @@ LOCALPROC ASC_ClearFIFO(void)
ASC_FIFO_Out = 0;
ASC_FIFO_InA = 0;
ASC_FIFO_InB = 0;
ASC_Playing = falseblnr;
ASC_Playing = false;
ASC_RecalcStatus();
}
GLOBALFUNC uint32_t ASC_Access(uint32_t Data, blnr WriteMem, CPTR addr)
GLOBALFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr)
{
if (addr < 0x800) {
if (WriteMem) {
@ -558,7 +558,7 @@ label_retry:
if (1 == SoundReg801) {
#if SoundEnabled
ui3p addr;
uint8_t * addr;
#endif
if (0 != (SoundReg802 & 2)) {
@ -569,7 +569,7 @@ label_retry:
{
SoundReg804 &= ~ 0x01;
SoundReg804 &= ~ 0x04;
ASC_Playing = trueblnr;
ASC_Playing = true;
#if ASC_dolog
dbglog_WriteNote("ASC : start stereo playing");
#endif
@ -593,10 +593,10 @@ label_retry:
for (i = 0; i < actL; i++) {
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) == 0) {
ASC_Playing = falseblnr;
ASC_Playing = false;
}
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) == 0) {
ASC_Playing = falseblnr;
ASC_Playing = false;
}
if (! ASC_Playing) {
#if SoundEnabled
@ -641,7 +641,7 @@ label_retry:
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200)
{
SoundReg804 &= ~ 0x01;
ASC_Playing = trueblnr;
ASC_Playing = true;
#if ASC_dolog
dbglog_WriteNote("ASC : start mono playing");
#endif
@ -650,7 +650,7 @@ label_retry:
for (i = 0; i < actL; i++) {
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) == 0) {
ASC_Playing = falseblnr;
ASC_Playing = false;
}
if (! ASC_Playing) {
#if SoundEnabled

View File

@ -20,5 +20,5 @@
#define ASCEMDEV_H
#endif
EXPORTFUNC uint32_t ASC_Access(uint32_t Data, blnr WriteMem, CPTR addr);
EXPORTFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr);
EXPORTPROC ASC_SubTick(int SubTick);

View File

@ -35,7 +35,7 @@ static struct bpf_insn insns[] =
BPF_STMT(BPF_RET + BPF_K, 0),
};
GLOBALVAR ui3p LT_TxBuffer = NULL;
GLOBALVAR uint8_t * LT_TxBuffer = NULL;
/* Transmit state */
GLOBALVAR uint16_t LT_TxBuffSz = 0;
@ -59,7 +59,7 @@ static unsigned char tx_buffer[20 + LT_TxBfMxSz] =
"\xFF\xFF\xFF\xFF\xFF\xFFssssss\x80\x9BppppSS";
/* Receive state */
GLOBALVAR ui3p LT_RxBuffer = NULL;
GLOBALVAR uint8_t * LT_RxBuffer = NULL;
/* When data pending, this is used */
GLOBALVAR uint32_t LT_RxBuffSz = 0;
/* When data pending, this is used */
@ -123,7 +123,7 @@ LOCALFUNC int get_ethernet(void)
/* Get a socket to routed for IPv4 */
fd = socket(PF_ROUTE, SOCK_RAW, AF_INET);
if (fd == -1) {
return falseblnr;
return false;
}
/* Allocate a message */
@ -131,7 +131,7 @@ LOCALFUNC int get_ethernet(void)
message = (struct rt_msghdr*)malloc(size);
if (! message) {
close(fd);
return falseblnr;
return false;
}
memset(message, 0, size);
addrs = (struct sockaddr_in*)(message + 1);
@ -151,7 +151,7 @@ LOCALFUNC int get_ethernet(void)
if (result < 0) {
close(fd);
free(message);
return falseblnr;
return false;
}
/* Read the result from the kernel */
@ -159,7 +159,7 @@ LOCALFUNC int get_ethernet(void)
if (result < 0) {
close(fd);
free(message);
return falseblnr;
return false;
}
/* Close the route socket */
@ -174,7 +174,7 @@ LOCALFUNC int get_ethernet(void)
if ((! sa_list[RTAX_IFP])
|| (sa_list[RTAX_IFP]->sa_family != AF_LINK))
{
return falseblnr;
return false;
}
int namelen = ((struct sockaddr_dl*)sa_list[RTAX_IFP])->sdl_nlen;
@ -195,7 +195,7 @@ LOCALFUNC int get_ethernet(void)
result = sysctlbyname("debug.bpf_maxdevices", &kp, &len, NULL, 0);
if (result == -1) {
return falseblnr;
return false;
}
max = *((int *)&kp);
@ -209,44 +209,44 @@ LOCALFUNC int get_ethernet(void)
}
if (fd <= 0) {
return falseblnr;
return false;
}
memset(&ifreq, 0, sizeof(struct ifreq));
strncpy(ifreq.ifr_name, device, IFNAMSIZ);
result = ioctl(fd, BIOCSETIF, &ifreq);
if (result) {
return falseblnr;
return false;
}
result = ioctl(fd, BIOCGBLEN, &device_buffer_size);
if (result) {
return falseblnr;
return false;
}
result = ioctl(fd, BIOCPROMISC, &enable);
if (result) {
return falseblnr;
return false;
}
result = ioctl(fd, BIOCSSEESENT, &enable);
if (result) {
return falseblnr;
return false;
}
result = ioctl(fd, BIOCSHDRCMPLT, &enable);
if (result) {
return falseblnr;
return false;
}
result = ioctl(fd, BIOCIMMEDIATE, &enable);
if (result) {
return falseblnr;
return false;
}
result = ioctl(fd, BIOCVERSION, &bpf_version);
if (result) {
return falseblnr;
return false;
}
bpf_program.bf_len = 4;
@ -254,10 +254,10 @@ LOCALFUNC int get_ethernet(void)
result = ioctl(fd, BIOCSETF, &bpf_program);
if (result) {
return falseblnr;
return false;
}
return trueblnr;
return true;
}
LOCALVAR unsigned char *RxBuffer = NULL;
@ -278,15 +278,15 @@ LOCALFUNC int InitLocalTalk(void)
*/
*((uint32_t*)(&tx_buffer[14])) = htonl(getpid());
LT_TxBuffer = (ui3p)&tx_buffer[20];
LT_TxBuffer = (uint8_t *)&tx_buffer[20];
RxBuffer = malloc(device_buffer_size);
if (NULL == RxBuffer) {
return falseblnr;
return false;
}
/* Initialized properly */
return trueblnr;
return true;
}
GLOBALOSGLUPROC LT_TransmitPacket(void)
@ -356,7 +356,7 @@ label_retry:
if (llap_length <= ethernet_length) {
/* Start the receiver */
LT_RxBuffer = (ui3p)start;
LT_RxBuffer = (uint8_t *)start;
LT_RxBuffSz = llap_length;
} else {
goto label_retry;

View File

@ -36,18 +36,18 @@
#define EnableMoveMouse 0
#endif
GLOBALVAR ui3p ROM = nullpr;
LOCALVAR blnr ROM_loaded = falseblnr;
GLOBALVAR uint8_t * ROM = nullpr;
LOCALVAR bool ROM_loaded = false;
GLOBALVAR uint32_t vSonyWritableMask = 0;
GLOBALVAR uint32_t vSonyInsertedMask = 0;
#if IncludeSonyRawMode
GLOBALVAR blnr vSonyRawMode = falseblnr;
GLOBALVAR bool vSonyRawMode = false;
#endif
#if IncludeSonyNew
GLOBALVAR blnr vSonyNewDiskWanted = falseblnr;
GLOBALVAR bool vSonyNewDiskWanted = false;
GLOBALVAR uint32_t vSonyNewDiskSize;
#endif
@ -65,12 +65,12 @@ GLOBALVAR uint32_t CurMacDelta = 0;
#endif
#if 0 != vMacScreenDepth
GLOBALVAR blnr UseColorMode = falseblnr;
GLOBALVAR blnr ColorModeWorks = falseblnr;
GLOBALVAR bool UseColorMode = false;
GLOBALVAR bool ColorModeWorks = false;
#endif
#if 0 != vMacScreenDepth
GLOBALVAR blnr ColorMappingChanged = falseblnr;
GLOBALVAR bool ColorMappingChanged = false;
#endif
#if (0 != vMacScreenDepth) && (vMacScreenDepth < 4)
@ -79,25 +79,25 @@ GLOBALVAR uint16_t CLUT_greens[CLUT_size];
GLOBALVAR uint16_t CLUT_blues[CLUT_size];
#endif
LOCALVAR blnr RequestMacOff = falseblnr;
LOCALVAR bool RequestMacOff = false;
GLOBALVAR blnr ForceMacOff = falseblnr;
GLOBALVAR bool ForceMacOff = false;
GLOBALVAR blnr WantMacInterrupt = falseblnr;
GLOBALVAR bool WantMacInterrupt = false;
GLOBALVAR blnr WantMacReset = falseblnr;
GLOBALVAR bool WantMacReset = false;
GLOBALVAR uint8_t SpeedValue = WantInitSpeedValue;
#if EnableAutoSlow
GLOBALVAR blnr WantNotAutoSlow = (WantInitNotAutoSlow != 0);
GLOBALVAR bool WantNotAutoSlow = (WantInitNotAutoSlow != 0);
#endif
GLOBALVAR uint16_t CurMouseV = 0;
GLOBALVAR uint16_t CurMouseH = 0;
#if EnableFSMouseMotion
LOCALVAR blnr HaveMouseMotion = falseblnr;
LOCALVAR bool HaveMouseMotion = false;
#endif
#if EnableAutoSlow
@ -123,17 +123,17 @@ LOCALVAR uint32_t PbufSize[NumPbufs];
#endif
#if IncludePbufs
LOCALFUNC blnr FirstFreePbuf(tPbuf *r)
LOCALFUNC bool FirstFreePbuf(tPbuf *r)
{
tPbuf i;
for (i = 0; i < NumPbufs; ++i) {
if (! PbufIsAllocated(i)) {
*r = i;
return trueblnr;
return true;
}
}
return falseblnr;
return false;
}
#endif
@ -182,7 +182,7 @@ GLOBALOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, uint32_t *Count)
}
#endif
LOCALFUNC blnr FirstFreeDisk(tDrive *Drive_No)
LOCALFUNC bool FirstFreeDisk(tDrive *Drive_No)
{
tDrive i;
@ -191,23 +191,23 @@ LOCALFUNC blnr FirstFreeDisk(tDrive *Drive_No)
if (nullpr != Drive_No) {
*Drive_No = i;
}
return trueblnr;
return true;
}
}
return falseblnr;
return false;
}
GLOBALOSGLUFUNC blnr AnyDiskInserted(void)
GLOBALOSGLUFUNC bool AnyDiskInserted(void)
{
#if 0
tDrive i;
for (i = 0; i < NumDrives; ++i) {
if (vSonyIsInserted(i)) {
return trueblnr;
return true;
}
}
return falseblnr;
return false;
#endif
return 0 != vSonyInsertedMask;
}
@ -217,7 +217,7 @@ GLOBALOSGLUPROC DiskRevokeWritable(tDrive Drive_No)
vSonyWritableMask &= ~ ((uint32_t)1 << Drive_No);
}
LOCALPROC DiskInsertNotify(tDrive Drive_No, blnr locked)
LOCALPROC DiskInsertNotify(tDrive Drive_No, bool locked)
{
vSonyInsertedMask |= ((uint32_t)1 << Drive_No);
if (! locked) {
@ -262,7 +262,7 @@ LOCALPROC DiskEjectedNotify(tDrive Drive_No)
#define ln2uiblockbitsn (3 + ln2uiblockn)
#define uiblockbitsn (8 * uiblockn)
LOCALFUNC blnr FindFirstChangeInLVecs(uibb *ptr1, uibb *ptr2,
LOCALFUNC bool FindFirstChangeInLVecs(uibb *ptr1, uibb *ptr2,
uimr L, uimr *j)
{
/*
@ -276,10 +276,10 @@ LOCALFUNC blnr FindFirstChangeInLVecs(uibb *ptr1, uibb *ptr2,
if (*p1++ != *p2++) {
--p1;
*j = p1 - ptr1;
return trueblnr;
return true;
}
}
return falseblnr;
return false;
}
LOCALPROC FindLastChangeInLVecs(uibb *ptr1, uibb *ptr2,
@ -346,7 +346,7 @@ Label_3:
*RightMask0 = RightMask;
}
LOCALVAR ui3p screencomparebuff = nullpr;
LOCALVAR uint8_t * screencomparebuff = nullpr;
LOCALVAR uimr NextDrawRow = 0;
@ -368,10 +368,10 @@ LOCALVAR uimr NextDrawRow = 0;
#endif
#if WantColorTransValid
LOCALVAR blnr ColorTransValid = falseblnr;
LOCALVAR bool ColorTransValid = false;
#endif
LOCALFUNC blnr ScreenFindChanges(ui3p screencurrentbuff,
LOCALFUNC bool ScreenFindChanges(uint8_t * screencurrentbuff,
int8_t TimeAdjust, int16_t *top, int16_t *left, int16_t *bottom, int16_t *right)
{
uimr j0;
@ -402,13 +402,13 @@ LOCALFUNC blnr ScreenFindChanges(ui3p screencurrentbuff,
#if 0 != vMacScreenDepth
if (UseColorMode) {
if (ColorMappingChanged) {
ColorMappingChanged = falseblnr;
ColorMappingChanged = false;
j0h = 0;
j1h = vMacScreenWidth;
j0v = 0;
j1v = vMacScreenHeight;
#if WantColorTransValid
ColorTransValid = falseblnr;
ColorTransValid = false;
#endif
} else {
if (! FindFirstChangeInLVecs(
@ -421,7 +421,7 @@ LOCALFUNC blnr ScreenFindChanges(ui3p screencurrentbuff,
&j0))
{
NextDrawRow = 0;
return falseblnr;
return false;
}
j0v = j0 / (vMacScreenBitWidth / uiblockbitsn);
j0h = j0 - j0v * (vMacScreenBitWidth / uiblockbitsn);
@ -501,13 +501,13 @@ Label_2c:
{
#if 0 != vMacScreenDepth
if (ColorMappingChanged) {
ColorMappingChanged = falseblnr;
ColorMappingChanged = false;
j0h = 0;
j1h = vMacScreenWidth;
j0v = 0;
j1v = vMacScreenHeight;
#if WantColorTransValid
ColorTransValid = falseblnr;
ColorTransValid = false;
#endif
} else
#endif
@ -522,7 +522,7 @@ Label_2c:
&j0))
{
NextDrawRow = 0;
return falseblnr;
return false;
}
j0v = j0 / (vMacScreenWidth / uiblockbitsn);
j0h = j0 - j0v * (vMacScreenWidth / uiblockbitsn);
@ -591,10 +591,10 @@ Label_2:
*bottom = j1v;
*right = j1h;
return trueblnr;
return true;
}
GLOBALVAR blnr EmVideoDisable = falseblnr;
GLOBALVAR bool EmVideoDisable = false;
GLOBALVAR int8_t EmLagTime = 0;
GLOBALVAR uint32_t OnTrueTime = 0;
@ -631,7 +631,7 @@ LOCALVAR int16_t ScreenChangedQuietBottom = 0;
LOCALVAR int16_t ScreenChangedQuietRight = 0;
#endif
GLOBALOSGLUPROC Screen_OutputFrame(ui3p screencurrentbuff)
GLOBALOSGLUPROC Screen_OutputFrame(uint8_t * screencurrentbuff)
{
int16_t top;
int16_t left;
@ -803,7 +803,7 @@ LOCALPROC SetLongs(uint32_t *p, long n)
}
LOCALVAR uimr ReserveAllocOffset;
LOCALVAR ui3p ReserveAllocBigBlock = nullpr;
LOCALVAR uint8_t * ReserveAllocBigBlock = nullpr;
#define PowOf2(p) ((uimr)1 << (p))
#define Pow2Mask(p) (PowOf2(p) - 1)
@ -813,8 +813,8 @@ LOCALVAR ui3p ReserveAllocBigBlock = nullpr;
#define CeilPow2Mult(i, p) FloorPow2Mult((i) + Pow2Mask(p), (p))
/* warning - CeilPow2Mult evaluates p twice */
GLOBALOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n,
uint8_t align, blnr FillOnes)
GLOBALOSGLUPROC ReserveAllocOneBlock(uint8_t * *p, uimr n,
uint8_t align, bool FillOnes)
{
ReserveAllocOffset = CeilPow2Mult(ReserveAllocOffset, align);
if (nullpr == ReserveAllocBigBlock) {
@ -839,8 +839,8 @@ LOCALVAR char *dbglog_bufp = nullpr;
LOCALPROC dbglog_ReserveAlloc(void)
{
ReserveAllocOneBlock((ui3p *)&dbglog_bufp, dbglog_bufsz,
5, falseblnr);
ReserveAllocOneBlock((uint8_t * *)&dbglog_bufp, dbglog_bufsz,
5, false);
}
#define dbglog_open dbglog_open0
@ -998,7 +998,7 @@ GLOBALOSGLUPROC EvtQOutDone(void)
++EvtQOut;
}
LOCALVAR blnr EvtQNeedRecover = falseblnr;
LOCALVAR bool EvtQNeedRecover = false;
/* events lost because of full queue */
LOCALFUNC EvtQEl * EvtQElPreviousIn(void)
@ -1015,7 +1015,7 @@ LOCALFUNC EvtQEl * EvtQElAlloc(void)
{
EvtQEl *p = NULL;
if (EvtQIn - EvtQOut >= EvtQSz) {
EvtQNeedRecover = trueblnr;
EvtQNeedRecover = true;
} else {
p = &EvtQA[EvtQIn & EvtQIMask];
@ -1027,13 +1027,13 @@ LOCALFUNC EvtQEl * EvtQElAlloc(void)
LOCALVAR uint32_t theKeys[4];
LOCALPROC Keyboard_UpdateKeyMap(uint8_t key, blnr down)
LOCALPROC Keyboard_UpdateKeyMap(uint8_t key, bool down)
{
uint8_t k = key & 127; /* just for safety */
uint8_t bit = 1 << (k & 7);
uint8_t *kp = (uint8_t *)theKeys;
uint8_t *kpi = &kp[k / 8];
blnr CurDown = ((*kpi & bit) != 0);
bool CurDown = ((*kpi & bit) != 0);
if (CurDown != down) {
EvtQEl *p = EvtQElAlloc();
if (NULL != p) {
@ -1052,9 +1052,9 @@ LOCALPROC Keyboard_UpdateKeyMap(uint8_t key, blnr down)
}
}
LOCALVAR blnr MouseButtonState = falseblnr;
LOCALVAR bool MouseButtonState = false;
LOCALPROC MouseButtonSet(blnr down)
LOCALPROC MouseButtonSet(bool down)
{
if (MouseButtonState != down) {
EvtQEl *p = EvtQElAlloc();
@ -1163,7 +1163,7 @@ LOCALPROC DisconnectKeyCodes(uint32_t KeepMask)
default: m = 0; break;
}
if (0 == (KeepMask & m)) {
Keyboard_UpdateKeyMap(key, falseblnr);
Keyboard_UpdateKeyMap(key, false);
}
}
bit <<= 1;
@ -1174,7 +1174,7 @@ LOCALPROC DisconnectKeyCodes(uint32_t KeepMask)
LOCALPROC EvtQTryRecoverFromFull(void)
{
MouseButtonSet(falseblnr);
MouseButtonSet(false);
DisconnectKeyCodes(0);
}
@ -1185,9 +1185,9 @@ LOCALVAR char *SavedLongMsg;
#if WantAbnormalReports
LOCALVAR uint16_t SavedIDMsg = 0;
#endif
LOCALVAR blnr SavedFatalMsg;
LOCALVAR bool SavedFatalMsg;
LOCALPROC MacMsg(char *briefMsg, char *longMsg, blnr fatal)
LOCALPROC MacMsg(char *briefMsg, char *longMsg, bool fatal)
{
if (nullpr != SavedBriefMsg) {
/*
@ -1205,7 +1205,7 @@ LOCALPROC MacMsg(char *briefMsg, char *longMsg, blnr fatal)
GLOBALOSGLUPROC WarnMsgAbnormalID(uint16_t id)
{
MacMsg(kStrReportAbnormalTitle,
kStrReportAbnormalMessage, falseblnr);
kStrReportAbnormalMessage, false);
if (0 != SavedIDMsg) {
/*

View File

@ -38,7 +38,7 @@ enum {
LOCALVAR uimr SpecialModes = 0;
LOCALVAR blnr NeedWholeScreenDraw = falseblnr;
LOCALVAR bool NeedWholeScreenDraw = false;
#define SpecialModeSet(i) SpecialModes |= (1 << (i))
#define SpecialModeClr(i) SpecialModes &= ~ (1 << (i))
@ -46,7 +46,7 @@ LOCALVAR blnr NeedWholeScreenDraw = falseblnr;
#define MacMsgDisplayed SpecialModeTst(SpclModeMessage)
LOCALVAR ui3p CntrlDisplayBuff = nullpr;
LOCALVAR uint8_t * CntrlDisplayBuff = nullpr;
LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
{
@ -57,11 +57,11 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
#endif
{
int i;
ui3p p0 = ((ui3p)CellData) + 16 * x;
uint8_t * p0 = ((uint8_t *)CellData) + 16 * x;
#if 0 != vMacScreenDepth
if (UseColorMode) {
ui3p p = CntrlDisplayBuff
uint8_t * p = CntrlDisplayBuff
+ ((h + 1) << vMacScreenDepth)
+ (v * 16 + 11) * vMacScreenByteWidth;
@ -69,7 +69,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
#if 1 == vMacScreenDepth
int k;
uint8_t t0 = *p0;
ui3p p2 = p;
uint8_t * p2 = p;
for (k = 2; --k >= 0; ) {
*p2++ = (((t0) & 0x80) ? 0xC0 : 0x00)
| (((t0) & 0x40) ? 0x30 : 0x00)
@ -81,7 +81,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
#elif 2 == vMacScreenDepth
int k;
uint8_t t0 = *p0;
ui3p p2 = p;
uint8_t * p2 = p;
for (k = 4; --k >= 0; ) {
*p2++ = (((t0) & 0x40) ? 0x0F : 0x00)
| (((t0) & 0x80) ? 0xF0 : 0x00);
@ -91,7 +91,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
#elif 3 == vMacScreenDepth
int k;
uint8_t t0 = *p0;
ui3p p2 = p;
uint8_t * p2 = p;
for (k = 8; --k >= 0; ) {
*p2++ = ((t0 >> k) & 0x01) ? 0xFF : 0x00;
/* black RRGGBBAA, white RRGGBBAA */
@ -100,7 +100,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
int k;
uint16_t v;
uint8_t t0 = *p0;
ui3p p2 = p;
uint8_t * p2 = p;
for (k = 8; --k >= 0; ) {
v = ((t0 >> k) & 0x01) ? 0x0000 : 0x7FFF;
/* black RRGGBBAA, white RRGGBBAA */
@ -112,7 +112,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
int k;
uint32_t v;
uint8_t t0 = *p0;
ui3p p2 = p;
uint8_t * p2 = p;
for (k = 8; --k >= 0; ) {
v = ((t0 >> k) & 0x01) ? 0x00000000 : 0x00FFFFFF;
/* black RRGGBBAA, white RRGGBBAA */
@ -129,7 +129,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
} else
#endif
{
ui3p p = CntrlDisplayBuff + (h + 1)
uint8_t * p = CntrlDisplayBuff + (h + 1)
+ (v * 16 + 11) * vMacScreenMonoByteWidth;
for (i = 16; --i >= 0; ) {
@ -387,12 +387,12 @@ LOCALPROC MacMsgDisplayOff(void)
#if WantAbnormalReports
SavedIDMsg = 0;
#endif
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
}
LOCALPROC MacMsgDisplayOn(void)
{
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
DisconnectKeyCodes1(kKeepMaskControl | kKeepMaskCapsLock);
/* command */
SpecialModeSet(SpclModeMessage);
@ -410,7 +410,7 @@ LOCALPROC MacMsgOverride(char *briefMsg, char *longMsg)
if (MacMsgDisplayed) {
MacMsgDisplayOff();
}
MacMsg(briefMsg, longMsg, falseblnr);
MacMsg(briefMsg, longMsg, false);
}
#if NeedDoMoreCommandsMsg
@ -432,12 +432,12 @@ LOCALPROC DoAboutMsg(void)
LOCALPROC NoRomMsgDisplayOff(void)
{
SpecialModeClr(SpclModeNoRom);
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
}
LOCALPROC NoRomMsgDisplayOn(void)
{
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
SpecialModeSet(SpclModeNoRom);
}
@ -453,7 +453,7 @@ LOCALPROC DrawNoRomMode(void)
#if UseControlKeys
LOCALVAR blnr LastControlKey = falseblnr;
LOCALVAR bool LastControlKey = false;
LOCALVAR int CurControlMode = 0;
LOCALVAR int ControlMessage = 0;
@ -514,7 +514,7 @@ LOCALPROC DoEnterControlMode(void)
{
CurControlMode = kCntrlModeBase;
ControlMessage = kCntrlMsgBaseStart;
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
DisconnectKeyCodes1(kKeepMaskControl | kKeepMaskCapsLock);
SpecialModeSet(SpclModeControl);
}
@ -523,10 +523,10 @@ LOCALPROC DoLeaveControlMode(void)
{
SpecialModeClr(SpclModeControl);
CurControlMode = kCntrlModeOff;
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
}
LOCALPROC Keyboard_UpdateControlKey(blnr down)
LOCALPROC Keyboard_UpdateControlKey(bool down)
{
if (down != LastControlKey) {
LastControlKey = down;
@ -559,8 +559,8 @@ LOCALPROC HTCEexportSubstCStr(char *s)
int n = ClStrSizeSubstCStr(s);
if (mnvm_noErr == PbufNew(n, &j)) {
blnr IsOk = falseblnr;
ui3p p = PbufLock(j);
bool IsOk = false;
uint8_t * p = PbufLock(j);
if (nullpr != p) {
L = 0;
@ -570,7 +570,7 @@ LOCALPROC HTCEexportSubstCStr(char *s)
for (i = 0; i < n; ++i) {
p[i] = Cell2MacAsciiMap[p[i]];
}
IsOk = trueblnr;
IsOk = true;
}
PbufUnlock(j);
@ -592,7 +592,7 @@ LOCALPROC HTCEexportSubstCStr(char *s)
}
if (mnvm_noErr == PbufNew(L, &j)) {
PbufTransfer(ps, j, 0, L, trueblnr);
PbufTransfer(ps, j, 0, L, true);
HTCEexport(j);
}
#endif
@ -632,7 +632,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
#if WantEnblCtrlRst
case MKC_R:
if (! AnyDiskInserted()) {
WantMacReset = trueblnr;
WantMacReset = true;
ControlMessage = kCntrlMsgHaveReset;
} else {
CurControlMode = kCntrlModeConfirmReset;
@ -642,7 +642,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
#endif
case MKC_Q:
if (! AnyDiskInserted()) {
ForceMacOff = trueblnr;
ForceMacOff = true;
} else {
CurControlMode = kCntrlModeConfirmQuit;
ControlMessage = kCntrlMsgConfirmQuitStart;
@ -656,7 +656,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
break;
#if NeedRequestInsertDisk
case MKC_O:
RequestInsertDisk = trueblnr;
RequestInsertDisk = true;
break;
#endif
#if EnableMagnify
@ -712,7 +712,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
case kCntrlModeConfirmReset:
switch (key) {
case MKC_Y:
WantMacReset = trueblnr;
WantMacReset = true;
CurControlMode = kCntrlModeBase;
ControlMessage = kCntrlMsgHaveReset;
break;
@ -731,7 +731,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
case kCntrlModeConfirmInterrupt:
switch (key) {
case MKC_Y:
WantMacInterrupt = trueblnr;
WantMacInterrupt = true;
CurControlMode = kCntrlModeBase;
ControlMessage = kCntrlMsgHaveInterrupted;
break;
@ -749,7 +749,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
case kCntrlModeConfirmQuit:
switch (key) {
case MKC_Y:
ForceMacOff = trueblnr;
ForceMacOff = true;
CurControlMode = kCntrlModeBase;
ControlMessage = kCntrlMsgBaseStart;
/* shouldn't see this message since quitting */
@ -813,7 +813,7 @@ LOCALPROC DoControlModeKey(uint8_t key)
}
break;
}
NeedWholeScreenDraw = trueblnr;
NeedWholeScreenDraw = true;
}
LOCALFUNC char * ControlMode2TitleStr(void)
@ -1026,9 +1026,9 @@ LOCALPROC DrawSpclMode(void)
}
}
LOCALFUNC ui3p GetCurDrawBuff(void)
LOCALFUNC uint8_t * GetCurDrawBuff(void)
{
ui3p p = screencomparebuff;
uint8_t * p = screencomparebuff;
if (0 != SpecialModes) {
MoveBytes((anyp)p, (anyp)CntrlDisplayBuff,
@ -1162,7 +1162,7 @@ LOCALFUNC uint8_t Keyboard_RemapMac(uint8_t key)
}
#endif /* WantKeyboard_RemapMac */
LOCALPROC Keyboard_UpdateKeyMap2(uint8_t key, blnr down)
LOCALPROC Keyboard_UpdateKeyMap2(uint8_t key, bool down)
{
#if UseControlKeys
if (MKC_CM == key) {
@ -1200,7 +1200,7 @@ LOCALPROC DisconnectKeyCodes2(void)
{
DisconnectKeyCodes1(kKeepMaskControl | kKeepMaskCapsLock);
#if UseControlKeys
Keyboard_UpdateControlKey(falseblnr);
Keyboard_UpdateControlKey(false);
#endif
}
@ -1213,7 +1213,7 @@ LOCALFUNC uint32_t Calc_Checksum(void)
{
long int i;
uint32_t CheckSum = 0;
ui3p p = 4 + ROM;
uint8_t * p = 4 + ROM;
for (i = (kCheckSumRom_Size - 4) >> 1; --i >= 0; ) {
CheckSum += do_get_mem_word(p);
@ -1274,28 +1274,28 @@ LOCALFUNC tMacErr ROM_IsValid(void)
#endif /* CheckRomCheckSum */
ROM_loaded = trueblnr;
SpeedStopped = falseblnr;
ROM_loaded = true;
SpeedStopped = false;
return mnvm_noErr;
}
LOCALFUNC blnr WaitForRom(void)
LOCALFUNC bool WaitForRom(void)
{
if (! ROM_loaded) {
NoRomMsgDisplayOn();
SpeedStopped = trueblnr;
SpeedStopped = true;
do {
WaitForNextTick();
if (ForceMacOff) {
return falseblnr;
return false;
}
} while (SpeedStopped);
NoRomMsgDisplayOff();
}
return trueblnr;
return true;
}

View File

@ -37,7 +37,7 @@
#if BigEndianUnaligned
#define do_get_mem_word(a) ((uint16_t)*((uint16_t *)(a)))
#else
LOCALINLINEFUNC uint16_t do_get_mem_word(ui3p a)
LOCALINLINEFUNC uint16_t do_get_mem_word(uint8_t * a)
{
#if LittleEndianUnaligned
uint16_t b = (*((uint16_t *)(a)));
@ -54,7 +54,7 @@ LOCALINLINEFUNC uint16_t do_get_mem_word(ui3p a)
#elif HaveSwapUi5r && LittleEndianUnaligned
#define do_get_mem_long(a) (SwapUi5r((uint32_t)*((uint32_t *)(a))))
#else
LOCALINLINEFUNC uint32_t do_get_mem_long(ui3p a)
LOCALINLINEFUNC uint32_t do_get_mem_long(uint8_t * a)
{
#if LittleEndianUnaligned
#if 0
@ -98,7 +98,7 @@ LOCALINLINEFUNC uint32_t do_get_mem_long(ui3p a)
#if BigEndianUnaligned
#define do_put_mem_word(a, v) ((*((uint16_t *)(a))) = (v))
#else
LOCALINLINEFUNC void do_put_mem_word(ui3p a, uint16_t v)
LOCALINLINEFUNC void do_put_mem_word(uint8_t * a, uint16_t v)
{
#if LittleEndianUnaligned
uint16_t b = ((v & 0x00FF) << 8) | ((v >> 8) & 0x00FF);
@ -116,7 +116,7 @@ LOCALINLINEFUNC void do_put_mem_word(ui3p a, uint16_t v)
#elif HaveSwapUi5r && LittleEndianUnaligned
#define do_put_mem_long(a, v) ((*((uint32_t *)(a))) = SwapUi5r(v))
#else
LOCALINLINEFUNC void do_put_mem_long(ui3p a, uint32_t v)
LOCALINLINEFUNC void do_put_mem_long(uint8_t * a, uint32_t v)
{
#if LittleEndianUnaligned
uint16_t b1 = v;