From b98c8a8646c971bb184ed169d4f589b9177f37e6 Mon Sep 17 00:00:00 2001 From: InvisibleUp Date: Tue, 11 Feb 2020 00:34:32 -0500 Subject: [PATCH] More type/my name standardization --- extras/trans.txt | 32 +- src/ADBEMDEV.c | 8 +- src/ADBSHARE.h | 36 +- src/ALTKEYSM.h | 30 +- src/ASCEMDEV.c | 18 +- src/ASCEMDEV.h | 2 +- src/BPFILTER.h | 44 +-- src/COMOSGLU.h | 108 +++--- src/CONTROLM.h | 82 ++--- src/ENDIANAC.h | 8 +- src/FPCPEMDV.h | 6 +- src/FPMATHEM.h | 14 +- src/GLOBGLUE.c | 72 ++-- src/GLOBGLUE.h | 32 +- src/INTLCHAR.h | 12 +- src/IWMEMDEV.c | 2 +- src/IWMEMDEV.h | 2 +- src/KBRDEMDV.c | 14 +- src/M68K/DISAM68K.c | 50 +-- src/M68K/M68KITAB.c | 280 +++++++-------- src/M68K/M68KITAB.h | 2 +- src/M68K/MINEM68K.c | 720 +++++++++++++++++++-------------------- src/PBUFSTDC.h | 10 +- src/PMUEMDEV.c | 14 +- src/PROGMAIN.c | 30 +- src/ROMEMDEV.c | 20 +- src/ROMEMDEV.h | 2 +- src/RTCEMDEV.c | 16 +- src/RTCEMDEV.h | 2 +- src/SCCEMDEV.c | 326 +++++++++--------- src/SCCEMDEV.h | 4 +- src/SCRNEMDV.c | 2 +- src/SCSIEMDV.c | 2 +- src/SCSIEMDV.h | 2 +- src/SGLUALSA.h | 226 ++++++------ src/SGLUDDSP.h | 14 +- src/SNDEMDEV.c | 2 +- src/SONYEMDV.c | 64 ++-- src/SYSDEPNS.h | 51 +-- src/UI/MACOSX/OSGLUOSX.c | 532 ++++++++++++++--------------- src/UI/MYOSGLUE.h | 46 +-- src/UI/OLDMAC/OSGLUMAC.c | 538 ++++++++++++++--------------- src/UI/OSGLUCCO.m | 416 +++++++++++----------- src/UI/OSGLUNDS.c | 148 ++++---- src/UI/UNIX/OSGLUXWN.c | 702 +++++++++++++++++++------------------- src/UI/WIN32/OSGLUWIN.c | 560 +++++++++++++++--------------- src/UI/XPLAT/OSGLUGTK.c | 222 ++++++------ src/UI/XPLAT/OSGLUSD2.c | 420 +++++++++++------------ src/UI/XPLAT/OSGLUSDL.c | 280 +++++++-------- src/VIA2EMDV.c | 34 +- src/VIA2EMDV.h | 2 +- src/VIAEMDEV.c | 34 +- src/VIAEMDEV.h | 2 +- src/VIDEMDEV.c | 74 ++-- src/VIDEMDEV.h | 2 +- 55 files changed, 3177 insertions(+), 3196 deletions(-) diff --git a/extras/trans.txt b/extras/trans.txt index 1bbecff..4840de1 100644 --- a/extras/trans.txt +++ b/extras/trans.txt @@ -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 � "{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}" 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 � "{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}" Unset SearchType -Compare "{my_project_d}"data:src:VIAEMDEV.c "{x}" +Compare "{project_d}"data:src:VIAEMDEV.c "{x}" diff --git a/src/ADBEMDEV.c b/src/ADBEMDEV.c index ac95ebd..e6a9e5f 100644 --- a/src/ADBEMDEV.c +++ b/src/ADBEMDEV.c @@ -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 diff --git a/src/ADBSHARE.h b/src/ADBSHARE.h index 6fc0560..519ce56 100644 --- a/src/ADBSHARE.h +++ b/src/ADBSHARE.h @@ -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 { diff --git a/src/ALTKEYSM.h b/src/ALTKEYSM.h index 6e0a824..55b6f7d 100644 --- a/src/ALTKEYSM.h +++ b/src/ALTKEYSM.h @@ -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; diff --git a/src/ASCEMDEV.c b/src/ASCEMDEV.c index d617280..4c94d6b 100644 --- a/src/ASCEMDEV.c +++ b/src/ASCEMDEV.c @@ -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 diff --git a/src/ASCEMDEV.h b/src/ASCEMDEV.h index 42a641f..342277b 100644 --- a/src/ASCEMDEV.h +++ b/src/ASCEMDEV.h @@ -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); diff --git a/src/BPFILTER.h b/src/BPFILTER.h index 7bf756a..36cf6cf 100644 --- a/src/BPFILTER.h +++ b/src/BPFILTER.h @@ -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; diff --git a/src/COMOSGLU.h b/src/COMOSGLU.h index bbba97e..5c149b0 100644 --- a/src/COMOSGLU.h +++ b/src/COMOSGLU.h @@ -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) { /* diff --git a/src/CONTROLM.h b/src/CONTROLM.h index e7ea79c..b7a0d6f 100644 --- a/src/CONTROLM.h +++ b/src/CONTROLM.h @@ -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; } diff --git a/src/ENDIANAC.h b/src/ENDIANAC.h index 52b6871..ca0c766 100644 --- a/src/ENDIANAC.h +++ b/src/ENDIANAC.h @@ -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; diff --git a/src/FPCPEMDV.h b/src/FPCPEMDV.h index 9da6a76..187e102 100644 --- a/src/FPCPEMDV.h +++ b/src/FPCPEMDV.h @@ -40,7 +40,7 @@ LOCALFUNC uint32_t myfp_GetFPIAR(void) return fpu_dat.FPIAR; } -LOCALFUNC blnr DecodeAddrModeRegister(uint32_t sz) +LOCALFUNC bool DecodeAddrModeRegister(uint32_t sz) { uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat; uint16_t themode = (Dat >> 3) & 7; @@ -64,12 +64,12 @@ LOCALFUNC blnr DecodeAddrModeRegister(uint32_t sz) return DecodeModeRegister(sz); break; default : - return falseblnr; + return false; break; } break; default : - return falseblnr; + return false; break; } } diff --git a/src/FPMATHEM.h b/src/FPMATHEM.h index d3fe5bb..3670937 100644 --- a/src/FPMATHEM.h +++ b/src/FPMATHEM.h @@ -5688,22 +5688,22 @@ LOCALFUNC uint32_t myfp_ToLong(myfpr *x) return floatx80_to_int32( *x ); } -LOCALFUNC blnr myfp_IsNan(myfpr *x) +LOCALFUNC bool myfp_IsNan(myfpr *x) { return floatx80_is_nan(*x); } -LOCALFUNC blnr myfp_IsInf(myfpr *x) +LOCALFUNC bool myfp_IsInf(myfpr *x) { return ( ( x->high & 0x7FFF ) == 0x7FFF ) && (0 == ((uint64_t) ( x->low<<1 ))); } -LOCALFUNC blnr myfp_IsZero(myfpr *x) +LOCALFUNC bool myfp_IsZero(myfpr *x) { return ( ( x->high & 0x7FFF ) == 0x0000 ) && (0 == ((uint64_t) ( x->low<<1 ))); } -LOCALFUNC blnr myfp_IsNeg(myfpr *x) +LOCALFUNC bool myfp_IsNeg(myfpr *x) { return ( ( x->high & 0x8000 ) != 0x0000 ); } @@ -6002,7 +6002,7 @@ LOCALPROC myfp_SinCos(myfpr *r_sin, myfpr *r_cos, myfpr *source) (void) fsincos(*source, r_sin, r_cos); } -LOCALFUNC blnr myfp_getCR(myfpr *r, uint16_t opmode) +LOCALFUNC bool myfp_getCR(myfpr *r, uint16_t opmode) { switch (opmode) { case 0x00: @@ -6144,9 +6144,9 @@ LOCALFUNC blnr myfp_getCR(myfpr *r, uint16_t opmode) } break; default: - return falseblnr; + return false; } - return trueblnr; + return true; } /* Floating point control register */ diff --git a/src/GLOBGLUE.c b/src/GLOBGLUE.c index ceb0a0c..69efe01 100644 --- a/src/GLOBGLUE.c +++ b/src/GLOBGLUE.c @@ -70,15 +70,15 @@ IMPORTPROC SetCyclesRemaining(uint32_t n); IMPORTPROC SetHeadATTel(ATTep p); IMPORTFUNC ATTep FindATTel(CPTR addr); -IMPORTFUNC uint32_t SCSI_Access(uint32_t Data, blnr WriteMem, CPTR addr); -IMPORTFUNC uint32_t SCC_Access(uint32_t Data, blnr WriteMem, CPTR addr); -IMPORTFUNC uint32_t IWM_Access(uint32_t Data, blnr WriteMem, CPTR addr); -IMPORTFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr); +IMPORTFUNC uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr); +IMPORTFUNC uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr); +IMPORTFUNC uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr); +IMPORTFUNC uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr); #if EmVIA2 -IMPORTFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr); +IMPORTFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr); #endif #if EmASC -IMPORTFUNC uint32_t ASC_Access(uint32_t Data, blnr WriteMem, CPTR addr); +IMPORTFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr); #endif IMPORTFUNC uint8_t get_vm_byte(CPTR addr); @@ -89,7 +89,7 @@ IMPORTPROC put_vm_byte(CPTR addr, uint8_t b); IMPORTPROC put_vm_word(CPTR addr, uint16_t w); IMPORTPROC put_vm_long(CPTR addr, uint32_t l); -GLOBALVAR uint32_t my_disk_icon_addr; +GLOBALVAR uint32_t disk_icon_addr; GLOBALPROC customreset(void) { @@ -103,7 +103,7 @@ GLOBALPROC customreset(void) Sony_Reset(); Extn_Reset(); #if CurEmMd <= kEmMd_Plus - WantMacReset = trueblnr; + WantMacReset = true; /* kludge, code in Finder appears to do RESET and not expect @@ -115,14 +115,14 @@ GLOBALPROC customreset(void) #endif } -GLOBALVAR ui3p RAM = nullpr; +GLOBALVAR uint8_t * RAM = nullpr; #if EmVidCard -GLOBALVAR ui3p VidROM = nullpr; +GLOBALVAR uint8_t * VidROM = nullpr; #endif #if IncludeVidMem -GLOBALVAR ui3p VidMem = nullpr; +GLOBALVAR uint8_t * VidMem = nullpr; #endif GLOBALVAR uint8_t Wires[kNumWires]; @@ -141,7 +141,7 @@ GLOBALPROC dbglog_StartLine(void) #endif #if dbglog_HAVE -GLOBALPROC dbglog_WriteMemArrow(blnr WriteMem) +GLOBALPROC dbglog_WriteMemArrow(bool WriteMem) { if (WriteMem) { dbglog_writeCStr(" <- "); @@ -153,7 +153,7 @@ GLOBALPROC dbglog_WriteMemArrow(blnr WriteMem) #if dbglog_HAVE GLOBALPROC dbglog_AddrAccess(char *s, uint32_t Data, - blnr WriteMem, uint32_t addr) + bool WriteMem, uint32_t addr) { dbglog_StartLine(); dbglog_writeCStr(s); @@ -167,7 +167,7 @@ GLOBALPROC dbglog_AddrAccess(char *s, uint32_t Data, #endif #if dbglog_HAVE -GLOBALPROC dbglog_Access(char *s, uint32_t Data, blnr WriteMem) +GLOBALPROC dbglog_Access(char *s, uint32_t Data, bool WriteMem) { dbglog_StartLine(); dbglog_writeCStr(s); @@ -187,7 +187,7 @@ GLOBALPROC dbglog_WriteNote(char *s) #endif #if dbglog_HAVE -GLOBALPROC dbglog_WriteSetBool(char *s, blnr v) +GLOBALPROC dbglog_WriteSetBool(char *s, bool v) { dbglog_StartLine(); dbglog_writeCStr(s); @@ -202,7 +202,7 @@ GLOBALPROC dbglog_WriteSetBool(char *s, blnr v) #endif #if WantAbnormalReports -LOCALVAR blnr GotOneAbnormal = falseblnr; +LOCALVAR bool GotOneAbnormal = false; #endif #ifndef ReportAbnormalInterrupt @@ -226,9 +226,9 @@ GLOBALPROC DoReportAbnormalID(uint16_t id if (! GotOneAbnormal) { WarnMsgAbnormalID(id); #if ReportAbnormalInterrupt - SetInterruptButton(trueblnr); + SetInterruptButton(true); #endif - GotOneAbnormal = trueblnr; + GotOneAbnormal = true; } } #endif @@ -303,11 +303,11 @@ GLOBALPROC DoReportAbnormalID(uint16_t id #if IncludeExtnPbufs LOCALFUNC tMacErr PbufTransferVM(CPTR Buffera, - tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite) + tPbuf i, uint32_t offset, uint32_t count, bool IsWrite) { tMacErr result; uint32_t contig; - ui3p Buffer; + uint8_t * Buffer; label_1: if (0 == count) { @@ -392,7 +392,7 @@ LOCALPROC ExtnParamBuffers_Access(CPTR p) uint32_t offset = get_vm_long(p + ExtnDat_params + 4); uint32_t count = get_vm_long(p + ExtnDat_params + 8); CPTR Buffera = get_vm_long(p + ExtnDat_params + 12); - blnr IsWrite = + bool IsWrite = (get_vm_word(p + ExtnDat_params + 16) != 0); result = PbufGetSize(Pbuf_No, &PbufCount); if (mnvm_noErr == result) { @@ -1300,7 +1300,7 @@ LOCALPROC get_fail_realblock(ATTep p) #endif GLOBALFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, - blnr WriteMem, blnr ByteSize, CPTR addr) + bool WriteMem, bool ByteSize, CPTR addr) { switch (p->MMDV) { case kMMDV_VIA1: @@ -1529,9 +1529,9 @@ GLOBALFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, return Data; } -GLOBALFUNC blnr MemAccessNtfy(ATTep pT) +GLOBALFUNC bool MemAccessNtfy(ATTep pT) { - blnr v = falseblnr; + bool v = false; switch (pT->Ntfy) { #if CurEmMd >= kEmMd_SE @@ -1541,7 +1541,7 @@ GLOBALFUNC blnr MemAccessNtfy(ATTep pT) MemOverlay = 0; SetUpMemBanks(); - v = trueblnr; + v = true; break; #endif @@ -1566,7 +1566,7 @@ GLOBALPROC Addr32_ChangeNtfy(void) } #endif -LOCALFUNC ATTep get_address_realblock1(blnr WriteMem, CPTR addr) +LOCALFUNC ATTep get_address_realblock1(bool WriteMem, CPTR addr) { ATTep p; @@ -1588,11 +1588,11 @@ Label_Retry: return p; } -GLOBALFUNC ui3p get_real_address0(uint32_t L, blnr WritableMem, CPTR addr, +GLOBALFUNC uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, uint32_t *actL) { uint32_t bankleft; - ui3p p; + uint8_t * p; ATTep q; q = get_address_realblock1(WritableMem, addr); @@ -1615,9 +1615,9 @@ GLOBALFUNC ui3p get_real_address0(uint32_t L, blnr WritableMem, CPTR addr, return p; } -GLOBALVAR blnr InterruptButton = falseblnr; +GLOBALVAR bool InterruptButton = false; -GLOBALPROC SetInterruptButton(blnr v) +GLOBALPROC SetInterruptButton(bool v) { if (InterruptButton != v) { InterruptButton = v; @@ -1656,7 +1656,7 @@ GLOBALPROC VIAorSCCinterruptChngNtfy(void) } } -GLOBALFUNC blnr AddrSpac_Init(void) +GLOBALFUNC bool AddrSpac_Init(void) { int i; @@ -1666,7 +1666,7 @@ GLOBALFUNC blnr AddrSpac_Init(void) MINEM68K_Init( &CurIPL); - return trueblnr; + return true; } GLOBALPROC Memory_Reset(void) @@ -1680,7 +1680,7 @@ EXPORTPROC PowerOff_ChangeNtfy(void); GLOBALPROC PowerOff_ChangeNtfy(void) { if (! VIA2_iB2) { - ForceMacOff = trueblnr; + ForceMacOff = true; } } #endif @@ -1696,7 +1696,7 @@ GLOBALVAR uint16_t MasterEvtQLock = 0; */ #endif -GLOBALFUNC blnr FindKeyEvent(int *VirtualKey, blnr *KeyDown) +GLOBALFUNC bool FindKeyEvent(int *VirtualKey, bool *KeyDown) { EvtQEl *p; @@ -1710,11 +1710,11 @@ GLOBALFUNC blnr FindKeyEvent(int *VirtualKey, blnr *KeyDown) *VirtualKey = p->u.press.key; *KeyDown = p->u.press.down; EvtQOutDone(); - return trueblnr; + return true; } } - return falseblnr; + return false; } /* task management */ diff --git a/src/GLOBGLUE.h b/src/GLOBGLUE.h index 8a1d035..2b40bfa 100644 --- a/src/GLOBGLUE.h +++ b/src/GLOBGLUE.h @@ -36,7 +36,7 @@ #define RAMSafetyMarginFudge 4 #define kRAM_Size (kRAMa_Size + kRAMb_Size) -EXPORTVAR(ui3p, RAM) +EXPORTVAR(uint8_t *, RAM) /* allocated by MYOSGLUE to be at least kRAM_Size + RAMSafetyMarginFudge @@ -45,11 +45,11 @@ EXPORTVAR(ui3p, RAM) */ #if EmVidCard -EXPORTVAR(ui3p, VidROM) +EXPORTVAR(uint8_t *, VidROM) #endif #if IncludeVidMem -EXPORTVAR(ui3p, VidMem) +EXPORTVAR(uint8_t *, VidMem) #endif EXPORTPROC MemOverlay_ChangeNtfy(void); @@ -67,7 +67,7 @@ typedef uint32_t CPTR; mapping of address space to real memory */ -EXPORTFUNC ui3p get_real_address0(uint32_t L, blnr WritableMem, CPTR addr, +EXPORTFUNC uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, uint32_t *actL); /* @@ -105,7 +105,7 @@ EXPORTFUNC ui3p get_real_address0(uint32_t L, blnr WritableMem, CPTR addr, real memory, i.e. memory mapped devices */ -EXPORTFUNC blnr AddrSpac_Init(void); +EXPORTFUNC bool AddrSpac_Init(void); #define uint32_t_FromSByte(x) ((uint32_t)(int32_t)(int8_t)(uint8_t)(x)) @@ -124,13 +124,13 @@ EXPORTPROC dbglog_StartLine(void); #endif #if dbglog_HAVE -EXPORTPROC dbglog_WriteMemArrow(blnr WriteMem); +EXPORTPROC dbglog_WriteMemArrow(bool WriteMem); EXPORTPROC dbglog_WriteNote(char *s); -EXPORTPROC dbglog_WriteSetBool(char *s, blnr v); +EXPORTPROC dbglog_WriteSetBool(char *s, bool v); EXPORTPROC dbglog_AddrAccess(char *s, - uint32_t Data, blnr WriteMem, uint32_t addr); -EXPORTPROC dbglog_Access(char *s, uint32_t Data, blnr WriteMem); + uint32_t Data, bool WriteMem, uint32_t addr); +EXPORTPROC dbglog_Access(char *s, uint32_t Data, bool WriteMem); #endif #if ! WantAbnormalReports @@ -150,8 +150,8 @@ EXPORTPROC DoReportAbnormalID(uint16_t id EXPORTPROC VIAorSCCinterruptChngNtfy(void); -EXPORTVAR(blnr, InterruptButton) -EXPORTPROC SetInterruptButton(blnr v); +EXPORTVAR(bool, InterruptButton) +EXPORTPROC SetInterruptButton(bool v); enum { kICT_SubTick, @@ -202,7 +202,7 @@ EXPORTVAR(uint8_t, Wires[kNumWires]) #if HaveMasterEvtQLock EXPORTVAR(uint16_t, MasterEvtQLock) #endif -EXPORTFUNC blnr FindKeyEvent(int *VirtualKey, blnr *KeyDown); +EXPORTFUNC bool FindKeyEvent(int *VirtualKey, bool *KeyDown); /* minivmac extensions */ @@ -236,7 +236,7 @@ enum { #define kcom_callcheck 0x5B17 -EXPORTVAR(uint32_t, my_disk_icon_addr) +EXPORTVAR(uint32_t, disk_icon_addr) EXPORTPROC Memory_Reset(void); @@ -250,7 +250,7 @@ struct ATTer { uint32_t cmpvalu; uint32_t Access; uint32_t usemask; /* Should be one less than a power of two. */ - ui3p usebase; + uint8_t * usebase; uint8_t MMDV; uint8_t Ntfy; uint16_t Pad0; @@ -272,5 +272,5 @@ typedef ATTer *ATTep; #define kATTA_ntfymask (1 << kATTA_ntfybit) EXPORTFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, - blnr WriteMem, blnr ByteSize, CPTR addr); -EXPORTFUNC blnr MemAccessNtfy(ATTep pT); + bool WriteMem, bool ByteSize, CPTR addr); +EXPORTFUNC bool MemAccessNtfy(ATTep pT); diff --git a/src/INTLCHAR.h b/src/INTLCHAR.h index 6305b5b..6250fc4 100644 --- a/src/INTLCHAR.h +++ b/src/INTLCHAR.h @@ -1643,20 +1643,20 @@ LOCALVAR const uint16_t Cell2UnicodeMap[] = { }; #endif -LOCALVAR blnr SpeedStopped = falseblnr; +LOCALVAR bool SpeedStopped = false; -LOCALVAR blnr RunInBackground = (WantInitRunInBackground != 0); +LOCALVAR bool RunInBackground = (WantInitRunInBackground != 0); #if VarFullScreen -LOCALVAR blnr WantFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool WantFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr WantMagnify = (WantInitMagnify != 0); +LOCALVAR bool WantMagnify = (WantInitMagnify != 0); #endif #if NeedRequestInsertDisk -LOCALVAR blnr RequestInsertDisk = falseblnr; +LOCALVAR bool RequestInsertDisk = false; #endif #ifndef NeedRequestIthDisk @@ -1668,7 +1668,7 @@ LOCALVAR uint8_t RequestIthDisk = 0; #endif #if UseControlKeys -LOCALVAR blnr ControlKeyPressed = falseblnr; +LOCALVAR bool ControlKeyPressed = false; #endif #ifndef kStrCntrlKyName diff --git a/src/IWMEMDEV.c b/src/IWMEMDEV.c index aa062fa..f8e96bf 100644 --- a/src/IWMEMDEV.c +++ b/src/IWMEMDEV.c @@ -149,7 +149,7 @@ LOCALPROC IWM_Write_Reg(uint8_t in) } } -GLOBALFUNC uint32_t IWM_Access(uint32_t Data, blnr WriteMem, CPTR addr) +GLOBALFUNC uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr) { switch (addr) { case kph0L : diff --git a/src/IWMEMDEV.h b/src/IWMEMDEV.h index 66f9ebc..33ac134 100644 --- a/src/IWMEMDEV.h +++ b/src/IWMEMDEV.h @@ -22,4 +22,4 @@ EXPORTPROC IWM_Reset(void); -EXPORTFUNC uint32_t IWM_Access(uint32_t Data, blnr WriteMem, CPTR addr); +EXPORTFUNC uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr); diff --git a/src/KBRDEMDV.c b/src/KBRDEMDV.c index 064b2e3..ecc2c65 100644 --- a/src/KBRDEMDV.c +++ b/src/KBRDEMDV.c @@ -53,13 +53,13 @@ enum { LOCALVAR int KybdState = kKybdStateIdle; -LOCALVAR blnr HaveKeyBoardResult = falseblnr; +LOCALVAR bool HaveKeyBoardResult = false; LOCALVAR uint8_t KeyBoardResult; LOCALPROC GotKeyBoardData(uint8_t v) { if (KybdState != kKybdStateIdle) { - HaveKeyBoardResult = trueblnr; + HaveKeyBoardResult = true; KeyBoardResult = v; } else { KYBD_ShiftOutData(v); @@ -69,10 +69,10 @@ LOCALPROC GotKeyBoardData(uint8_t v) LOCALVAR uint8_t InstantCommandData = 0x7B; -LOCALFUNC blnr AttemptToFinishInquiry(void) +LOCALFUNC bool AttemptToFinishInquiry(void) { int i; - blnr KeyDown; + bool KeyDown; uint8_t Keyboard_Data; if (FindKeyEvent(&i, &KeyDown)) { @@ -89,9 +89,9 @@ LOCALFUNC blnr AttemptToFinishInquiry(void) } } GotKeyBoardData(Keyboard_Data); - return trueblnr; + return true; } else { - return falseblnr; + return false; } } @@ -161,7 +161,7 @@ GLOBALPROC DoKybd_ReceiveEndCommand(void) #ifdef _VIA_Debug fprintf(stderr, "HaveKeyBoardResult: %d\n", KeyBoardResult); #endif - HaveKeyBoardResult = falseblnr; + HaveKeyBoardResult = false; KYBD_ShiftOutData(KeyBoardResult); VIA1_iCB2 = 1; } diff --git a/src/M68K/DISAM68K.c b/src/M68K/DISAM68K.c index 463ee54..798975f 100644 --- a/src/M68K/DISAM68K.c +++ b/src/M68K/DISAM68K.c @@ -39,7 +39,7 @@ LOCALVAR uint32_t Disasm_pc; (if pc points to memory mapped device) */ -LOCALVAR ui3p Disasm_pcp; +LOCALVAR uint8_t * Disasm_pcp; LOCALVAR uint32_t Disasm_pc_blockmask; LOCALVAR uint8_t Disasm_pcp_dummy[2] = { 0, 0 @@ -1692,24 +1692,24 @@ LOCALPROCUSEDONCE DisasmBitField(void) } #endif -LOCALFUNC blnr IsValidAddrMode(void) +LOCALFUNC bool IsValidAddrMode(void) { return (Disasm_mode != 7) || (Disasm_reg < 5); } -LOCALFUNC blnr IsValidDstAddrMode(void) +LOCALFUNC bool IsValidDstAddrMode(void) { return (Disasm_md6 != 7) || (Disasm_rg9 < 2); } -LOCALFUNC blnr IsValidDataAltAddrMode(void) +LOCALFUNC bool IsValidDataAltAddrMode(void) { - blnr IsOk; + bool IsOk; switch (Disasm_mode) { case 1: default: /* keep compiler happy */ - IsOk = falseblnr; + IsOk = false; break; case 0: case 2: @@ -1717,7 +1717,7 @@ LOCALFUNC blnr IsValidDataAltAddrMode(void) case 4: case 5: case 6: - IsOk = trueblnr; + IsOk = true; break; case 7: IsOk = Disasm_reg < 2; @@ -1727,14 +1727,14 @@ LOCALFUNC blnr IsValidDataAltAddrMode(void) return IsOk; } -LOCALFUNC blnr IsValidDataAddrMode(void) +LOCALFUNC bool IsValidDataAddrMode(void) { - blnr IsOk; + bool IsOk; switch (Disasm_mode) { case 1: default: /* keep compiler happy */ - IsOk = falseblnr; + IsOk = false; break; case 0: case 2: @@ -1742,7 +1742,7 @@ LOCALFUNC blnr IsValidDataAddrMode(void) case 4: case 5: case 6: - IsOk = trueblnr; + IsOk = true; break; case 7: IsOk = Disasm_reg < 5; @@ -1752,9 +1752,9 @@ LOCALFUNC blnr IsValidDataAddrMode(void) return IsOk; } -LOCALFUNC blnr IsValidControlAddrMode(void) +LOCALFUNC bool IsValidControlAddrMode(void) { - blnr IsOk; + bool IsOk; switch (Disasm_mode) { case 0: @@ -1762,12 +1762,12 @@ LOCALFUNC blnr IsValidControlAddrMode(void) case 3: case 4: default: /* keep compiler happy */ - IsOk = falseblnr; + IsOk = false; break; case 2: case 5: case 6: - IsOk = trueblnr; + IsOk = true; break; case 7: IsOk = Disasm_reg < 4; @@ -1777,9 +1777,9 @@ LOCALFUNC blnr IsValidControlAddrMode(void) return IsOk; } -LOCALFUNC blnr IsValidControlAltAddrMode(void) +LOCALFUNC bool IsValidControlAltAddrMode(void) { - blnr IsOk; + bool IsOk; switch (Disasm_mode) { case 0: @@ -1787,12 +1787,12 @@ LOCALFUNC blnr IsValidControlAltAddrMode(void) case 3: case 4: default: /* keep compiler happy */ - IsOk = falseblnr; + IsOk = false; break; case 2: case 5: case 6: - IsOk = trueblnr; + IsOk = true; break; case 7: IsOk = Disasm_reg < 2; @@ -1802,22 +1802,22 @@ LOCALFUNC blnr IsValidControlAltAddrMode(void) return IsOk; } -LOCALFUNC blnr IsValidAltMemAddrMode(void) +LOCALFUNC bool IsValidAltMemAddrMode(void) { - blnr IsOk; + bool IsOk; switch (Disasm_mode) { case 0: case 1: default: /* keep compiler happy */ - IsOk = falseblnr; + IsOk = false; break; case 2: case 3: case 4: case 5: case 6: - IsOk = trueblnr; + IsOk = true; break; case 7: IsOk = Disasm_reg < 2; @@ -2861,7 +2861,7 @@ LOCALPROCUSEDONCE DisasmSavedPCs(void) uint32_t i; #endif #if 0 - blnr Skipped = falseblnr; + bool Skipped = false; #endif uint32_t j = SavedPCsOut; @@ -2881,7 +2881,7 @@ LOCALPROCUSEDONCE DisasmSavedPCs(void) j = SavedPCsIn - NumSavedPCs; dbglog_writeReturn(); #if 0 - Skipped = trueblnr; + Skipped = true; #endif } diff --git a/src/M68K/M68KITAB.c b/src/M68K/M68KITAB.c index 2f78338..bdaac3a 100644 --- a/src/M68K/M68KITAB.c +++ b/src/M68K/M68KITAB.c @@ -252,7 +252,7 @@ LOCALFUNC uint16_t OpEADestCalcCyc(WorkR *p, uint8_t m, uint8_t r) } #endif -LOCALPROC SetDcoArgFields(WorkR *p, blnr src, +LOCALPROC SetDcoArgFields(WorkR *p, bool src, uint8_t CurAMd, uint8_t CurArgDat) { if (src) { @@ -264,12 +264,12 @@ LOCALPROC SetDcoArgFields(WorkR *p, blnr src, } } -LOCALFUNC blnr CheckValidAddrMode(WorkR *p, - uint8_t m, uint8_t r, uint8_t v, blnr src) +LOCALFUNC bool CheckValidAddrMode(WorkR *p, + uint8_t m, uint8_t r, uint8_t v, bool src) { uint8_t CurAMd = 0; /* init to keep compiler happy */ uint8_t CurArgDat = 0; - blnr IsOk; + bool IsOk; switch (m) { case 0: @@ -476,12 +476,12 @@ LOCALFUNC blnr CheckValidAddrMode(WorkR *p, kAddrValidMaskAny | kAddrValidMaskData); break; default: - IsOk = falseblnr; + IsOk = false; break; } break; default: /* keep compiler happy */ - IsOk = falseblnr; + IsOk = false; break; } @@ -493,7 +493,7 @@ LOCALFUNC blnr CheckValidAddrMode(WorkR *p, } #if WantCycByPriOp -LOCALFUNC blnr LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r) +LOCALFUNC bool LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r) { uint16_t v; @@ -536,40 +536,40 @@ LOCALFUNC blnr LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r) } #endif -LOCALFUNC blnr IsValidAddrMode(WorkR *p) +LOCALFUNC bool IsValidAddrMode(WorkR *p) { return CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidAny, falseblnr); + mode(p), reg(p), kAddrValidAny, false); } -LOCALFUNC blnr CheckDataAltAddrMode(WorkR *p) +LOCALFUNC bool CheckDataAltAddrMode(WorkR *p) { return CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidDataAlt, falseblnr); + mode(p), reg(p), kAddrValidDataAlt, false); } -LOCALFUNC blnr CheckDataAddrMode(WorkR *p) +LOCALFUNC bool CheckDataAddrMode(WorkR *p) { return CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidData, falseblnr); + mode(p), reg(p), kAddrValidData, false); } -LOCALFUNC blnr CheckControlAddrMode(WorkR *p) +LOCALFUNC bool CheckControlAddrMode(WorkR *p) { return CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidControl, falseblnr); + mode(p), reg(p), kAddrValidControl, false); } -LOCALFUNC blnr CheckControlAltAddrMode(WorkR *p) +LOCALFUNC bool CheckControlAltAddrMode(WorkR *p) { return CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidControlAlt, falseblnr); + mode(p), reg(p), kAddrValidControlAlt, false); } -LOCALFUNC blnr CheckAltMemAddrMode(WorkR *p) +LOCALFUNC bool CheckAltMemAddrMode(WorkR *p) { return CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidAltMem, falseblnr); + mode(p), reg(p), kAddrValidAltMem, false); } LOCALPROC FindOpSizeFromb76(WorkR *p) @@ -645,9 +645,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) } #endif if (CheckValidAddrMode(p, 1, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindMoveP0 + b76(p); } @@ -672,12 +672,12 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) } #endif p->MainClass = kIKindBTstL + b76(p); - SetDcoArgFields(p, trueblnr, kAMdRegL, rg9(p)); - SetDcoArgFields(p, falseblnr, kAMdRegL, reg(p)); + SetDcoArgFields(p, true, kAMdRegL, rg9(p)); + SetDcoArgFields(p, false, kAMdRegL, reg(p)); } else { p->opsize = 1; p->MainClass = kIKindBTstB + b76(p); - SetDcoArgFields(p, trueblnr, kAMdRegB, rg9(p)); + SetDcoArgFields(p, true, kAMdRegB, rg9(p)); if (b76(p) == 0) { /* BTst */ if (CheckDataAddrMode(p)) { #if WantCycByPriOp @@ -721,16 +721,16 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) break; } #endif - SetDcoArgFields(p, trueblnr, kAMdImmedB, 0); - SetDcoArgFields(p, falseblnr, kAMdRegL, reg(p)); + SetDcoArgFields(p, true, kAMdImmedB, 0); + SetDcoArgFields(p, false, kAMdRegL, reg(p)); p->MainClass = kIKindBTstL + b76(p); } else { p->opsize = 1; - SetDcoArgFields(p, trueblnr, kAMdImmedB, 0); + SetDcoArgFields(p, true, kAMdImmedB, 0); p->MainClass = kIKindBTstB + b76(p); if (b76(p) == 0) { /* BTst */ if (CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidDataNoCn, falseblnr)) + mode(p), reg(p), kAddrValidDataNoCn, false)) { #if WantCycByPriOp p->Cycles = @@ -814,9 +814,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) } #endif FindOpSizeFromb76(p); - if (CheckValidAddrMode(p, 7, 4, kAddrValidAny, trueblnr)) + if (CheckValidAddrMode(p, 7, 4, kAddrValidAny, true)) if (CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidDataNoCn, falseblnr)) + mode(p), reg(p), kAddrValidDataNoCn, false)) { #if WantCycByPriOp if (0 == mode(p)) { @@ -887,9 +887,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 7, 4, - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -921,9 +921,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 7, 4, - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -955,9 +955,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 7, 4, - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -989,9 +989,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 7, 4, - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -1023,9 +1023,9 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 7, 4, - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -1069,9 +1069,9 @@ LOCALPROCUSEDONCE DeCode1(WorkR *p) p->MainClass = kIKindIllegal; } else { if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, md6(p), rg9(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); @@ -1088,9 +1088,9 @@ LOCALPROCUSEDONCE DeCode2(WorkR *p) p->opsize = 4; if (md6(p) == 1) { /* MOVEA */ if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 1, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); @@ -1101,9 +1101,9 @@ LOCALPROCUSEDONCE DeCode2(WorkR *p) } } else { if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, md6(p), rg9(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); @@ -1120,9 +1120,9 @@ LOCALPROCUSEDONCE DeCode3(WorkR *p) p->opsize = 2; if (md6(p) == 1) { /* MOVEA */ if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 1, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); @@ -1133,9 +1133,9 @@ LOCALPROCUSEDONCE DeCode3(WorkR *p) } } else { if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, md6(p), rg9(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); @@ -1204,9 +1204,9 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) /* Chk.L 0100ddd100mmmrrr */ p->opsize = 4; if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidData, falseblnr)) + kAddrValidData, false)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { #if WantCycByPriOp p->Cycles += OpEACalcCyc(p, mode(p), reg(p)); @@ -1224,9 +1224,9 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) /* Chk.W 0100ddd110mmmrrr */ p->opsize = 2; if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidData, falseblnr)) + kAddrValidData, false)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { #if WantCycByPriOp p->Cycles = (10 * kCycleScale + RdAvgXtraCyc); @@ -1240,7 +1240,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) #if Use68020 if ((0 == mode(p)) && (4 == rg9(p))) { /* EXTB.L */ - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p)); p->MainClass = kIKindEXTBL; } else @@ -1412,7 +1412,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) #if Use68020 if (mode(p) == 1) { /* Link.L 0100100000001rrr */ - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p) + 8); p->MainClass = kIKindLinkL; } else @@ -1444,7 +1444,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) (4 * kCycleScale + RdAvgXtraCyc); #endif p->MainClass = kIKindSwap; - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p)); } else #if Use68020 @@ -1473,7 +1473,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegW, reg(p)); p->MainClass = kIKindEXTW; } else { @@ -1486,7 +1486,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) p->Cycles += MoveAvgN * 4 * kCycleScale + MoveAvgN * WrAvgXtraCyc; #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdAPreDecL, reg(p) + 8); p->MainClass = kIKindMOVEMRmMW; } else { @@ -1511,7 +1511,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p)); p->MainClass = kIKindEXTL; } else { @@ -1524,7 +1524,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) #endif p->opsize = 4; if (mode(p) == 4) { - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdAPreDecL, reg(p) + 8); p->MainClass = kIKindMOVEMRmML; } else { @@ -1601,7 +1601,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) + MoveAvgN * RdAvgXtraCyc; } #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdAPosIncL, reg(p) + 8); if (b76(p) == 2) { p->MainClass = kIKindMOVEMApRW; @@ -1665,7 +1665,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) + 4 * RdAvgXtraCyc + 3 * WrAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdDat4, (p->opcode & 15) + 32); p->MainClass = kIKindTrap; break; @@ -1676,7 +1676,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) + 2 * RdAvgXtraCyc + 2 * WrAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p) + 8); if (reg(p) == 6) { p->MainClass = kIKindLinkA6; @@ -1690,7 +1690,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) p->Cycles = (12 * kCycleScale + 3 * RdAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p) + 8); if (reg(p) == 6) { p->MainClass = kIKindUnlkA6; @@ -1704,7 +1704,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p) + 8); p->MainClass = kIKindMoveRUSP; break; @@ -1714,7 +1714,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) p->Cycles = (4 * kCycleScale + RdAvgXtraCyc); #endif - SetDcoArgFields(p, falseblnr, + SetDcoArgFields(p, false, kAMdRegL, reg(p) + 8); p->MainClass = kIKindMoveUSPR; break; @@ -1937,7 +1937,7 @@ LOCALPROCUSEDONCE DeCode5(WorkR *p) */ #endif #endif - SetDcoArgFields(p, falseblnr, kAMdRegW, reg(p)); + SetDcoArgFields(p, false, kAMdRegW, reg(p)); if (1 == ((p->opcode >> 8) & 15)) { p->MainClass = kIKindDBF; } else { @@ -1976,9 +1976,9 @@ LOCALPROCUSEDONCE DeCode5(WorkR *p) } else { if (mode(p) == 1) { p->opsize = b8(p) * 2 + 2; - SetDcoArgFields(p, trueblnr, kAMdDat4, + SetDcoArgFields(p, true, kAMdDat4, octdat(rg9(p))); - SetDcoArgFields(p, falseblnr, kAMdRegL, + SetDcoArgFields(p, false, kAMdRegL, reg(p) + 8); /* always long, regardless of opsize */ if (b8(p) == 0) { @@ -1996,10 +1996,10 @@ LOCALPROCUSEDONCE DeCode5(WorkR *p) } } else { FindOpSizeFromb76(p); - SetDcoArgFields(p, trueblnr, kAMdDat4, + SetDcoArgFields(p, true, kAMdDat4, octdat(rg9(p))); if (CheckValidAddrMode(p, - mode(p), reg(p), kAddrValidDataAlt, falseblnr)) + mode(p), reg(p), kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -2131,9 +2131,9 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) if (b76(p) == 3) { p->opsize = 2; if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidData, trueblnr)) + kAddrValidData, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { if (b8(p) == 0) { /* DivU 1000ddd011mmmrrr */ @@ -2175,9 +2175,9 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidData, trueblnr)) + kAddrValidData, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp if (4 == p->opsize) { @@ -2212,17 +2212,17 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) p->opsize = 1; if (mode(p) == 0) { if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindSbcd; } } else { if (CheckValidAddrMode(p, 4, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 4, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindSbcd; } @@ -2234,11 +2234,11 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) if (mode(p) == 0) { p->opsize = 2; if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { p->opsize = 1; if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindPack; } @@ -2246,11 +2246,11 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) } else { p->opsize = 2; if (CheckValidAddrMode(p, 4, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { p->opsize = 1; if (CheckValidAddrMode(p, 4, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindPack; } @@ -2262,11 +2262,11 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) if (mode(p) == 0) { p->opsize = 1; if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { p->opsize = 2; if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindUnpk; } @@ -2274,11 +2274,11 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) } else { p->opsize = 1; if (CheckValidAddrMode(p, 4, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { p->opsize = 2; if (CheckValidAddrMode(p, 4, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindUnpk; } @@ -2299,9 +2299,9 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAltMem, falseblnr)) + kAddrValidAltMem, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2328,10 +2328,10 @@ LOCALPROCUSEDONCE DeCode9(WorkR *p) } #endif p->opsize = b8(p) * 2 + 2; - SetDcoArgFields(p, falseblnr, kAMdRegL, rg9(p) + 8); + SetDcoArgFields(p, false, kAMdRegL, rg9(p) + 8); /* always long, regardless of opsize */ if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { #if WantCycByPriOp if (4 == p->opsize) { @@ -2358,9 +2358,9 @@ LOCALPROCUSEDONCE DeCode9(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp if (4 == p->opsize) { @@ -2384,9 +2384,9 @@ LOCALPROCUSEDONCE DeCode9(WorkR *p) /* p->MainClass = kIKindSubXd; */ FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2400,9 +2400,9 @@ LOCALPROCUSEDONCE DeCode9(WorkR *p) /* p->MainClass = kIKindSubXm; */ FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 4, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 4, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2422,9 +2422,9 @@ LOCALPROCUSEDONCE DeCode9(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), - reg(p), kAddrValidAltMem, falseblnr)) + reg(p), kAddrValidAltMem, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2460,10 +2460,10 @@ LOCALPROCUSEDONCE DeCodeB(WorkR *p) } #endif p->opsize = b8(p) * 2 + 2; - SetDcoArgFields(p, falseblnr, kAMdRegL, rg9(p) + 8); + SetDcoArgFields(p, false, kAMdRegL, rg9(p) + 8); /* always long, regardless of opsize */ if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { #if WantCycByPriOp p->Cycles = (6 * kCycleScale + RdAvgXtraCyc); @@ -2479,9 +2479,9 @@ LOCALPROCUSEDONCE DeCodeB(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 3, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 3, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2499,9 +2499,9 @@ LOCALPROCUSEDONCE DeCodeB(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidDataAlt, falseblnr)) + kAddrValidDataAlt, false)) { #if WantCycByPriOp if (0 != mode(p)) { @@ -2529,9 +2529,9 @@ LOCALPROCUSEDONCE DeCodeB(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2549,9 +2549,9 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) if (b76(p) == 3) { p->opsize = 2; if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidData, trueblnr)) + kAddrValidData, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp #if WantCloserCyc @@ -2580,9 +2580,9 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidData, trueblnr)) + kAddrValidData, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp if (4 == p->opsize) { @@ -2617,17 +2617,17 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) p->opsize = 1; if (mode(p) == 0) { if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindAbcd; } } else { if (CheckValidAddrMode(p, 4, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 4, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindAbcd; } @@ -2641,17 +2641,17 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) p->opsize = 4; if (mode(p) == 0) { if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindExg; } } else { if (CheckValidAddrMode(p, 1, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 1, reg(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindExg; } @@ -2668,9 +2668,9 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) + RdAvgXtraCyc); #endif if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 1, reg(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { p->MainClass = kIKindExg; } @@ -2686,9 +2686,9 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) #endif FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAltMem, falseblnr)) + kAddrValidAltMem, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2710,10 +2710,10 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p) if (b76(p) == 3) { /* ADDA 1101dddm11mmmrrr */ p->opsize = b8(p) * 2 + 2; - SetDcoArgFields(p, falseblnr, kAMdRegL, rg9(p) + 8); + SetDcoArgFields(p, false, kAMdRegL, rg9(p) + 8); /* always long, regardless of opsize */ if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) { #if WantCycByPriOp if (4 == p->opsize) { @@ -2735,9 +2735,9 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p) /* ADD 1101ddd0ssmmmrrr */ FindOpSizeFromb76(p); if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp if (4 == p->opsize) { @@ -2761,9 +2761,9 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p) /* p->MainClass = kIKindAddXd; */ FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2776,9 +2776,9 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p) /* p->MainClass = kIKindAddXm; */ FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 4, reg(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 4, rg9(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2793,9 +2793,9 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p) /* ADD 1101ddd1ssmmmrrr */ FindOpSizeFromb76(p); if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, mode(p), reg(p), - kAddrValidAltMem, falseblnr)) + kAddrValidAltMem, false)) { #if WantCycByPriOp p->Cycles = (4 == p->opsize) @@ -2833,7 +2833,7 @@ LOCALPROCUSEDONCE DeCodeE(WorkR *p) p->DecOp.y.v[0].AMd = mode(p); p->DecOp.y.v[0].ArgDat = (p->opcode >> 8) & 7; if (0 == mode(p)) { - SetDcoArgFields(p, falseblnr, kAMdRegL, reg(p)); + SetDcoArgFields(p, false, kAMdRegL, reg(p)); p->MainClass = kIKindBitField; } else { switch ((p->opcode >> 8) & 7) { @@ -2868,7 +2868,7 @@ LOCALPROCUSEDONCE DeCodeE(WorkR *p) p->Cycles += OpEACalcCyc(p, mode(p), reg(p)); #endif p->MainClass = rolops(p, rg9(p)); - SetDcoArgFields(p, trueblnr, kAMdDat4, 1); + SetDcoArgFields(p, true, kAMdDat4, 1); } } } else { @@ -2876,7 +2876,7 @@ LOCALPROCUSEDONCE DeCodeE(WorkR *p) if (mode(p) < 4) { /* 1110cccdss0ttddd */ if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp p->Cycles = ((4 == p->opsize) @@ -2888,14 +2888,14 @@ LOCALPROCUSEDONCE DeCodeE(WorkR *p) ; #endif p->MainClass = rolops(p, mode(p) & 3); - SetDcoArgFields(p, trueblnr, kAMdDat4, octdat(rg9(p))); + SetDcoArgFields(p, true, kAMdDat4, octdat(rg9(p))); } } else { /* 1110rrrdss1ttddd */ if (CheckValidAddrMode(p, 0, rg9(p), - kAddrValidAny, trueblnr)) + kAddrValidAny, true)) if (CheckValidAddrMode(p, 0, reg(p), - kAddrValidAny, falseblnr)) + kAddrValidAny, false)) { #if WantCycByPriOp #if WantCloserCyc diff --git a/src/M68K/M68KITAB.h b/src/M68K/M68KITAB.h index 69bf5be..198eb0f 100644 --- a/src/M68K/M68KITAB.h +++ b/src/M68K/M68KITAB.h @@ -268,7 +268,7 @@ struct DecOpR { /* expected size : 8 bytes */ DecOpXR x; DecOpYR y; -} my_align_8; +} align_8; typedef struct DecOpR DecOpR; #define GetDcoCycles(p) ((p)->x.Cycles) diff --git a/src/M68K/MINEM68K.c b/src/M68K/MINEM68K.c index 021fb13..fd5ef6a 100644 --- a/src/M68K/MINEM68K.c +++ b/src/M68K/MINEM68K.c @@ -94,7 +94,7 @@ struct MATCr { uint32_t cmpmask; uint32_t cmpvalu; uint32_t usemask; - ui3p usebase; + uint8_t * usebase; }; typedef struct MATCr MATCr; typedef MATCr *MATCp; @@ -142,7 +142,7 @@ enum { kNumLazyFlagsKinds }; -typedef void (my_reg_call *ArgSetDstP)(uint32_t f); +typedef void (reg_call *ArgSetDstP)(uint32_t f); #define FasterAlignedL 0 /* @@ -160,9 +160,9 @@ LOCALVAR struct regstruct { uint32_t regs[16]; /* Data and Address registers */ - ui3p pc_p; - ui3p pc_pHi; - int32_tr MaxCyclesToGo; + uint8_t * pc_p; + uint8_t * pc_pHi; + int32_t MaxCyclesToGo; #if WantCloserCyc DecOpR *CurDecOp; @@ -183,7 +183,7 @@ LOCALVAR struct regstruct ArgSetDstP ArgSetDst; uint32_t SrcVal; - ui3p pc_pLo; + uint8_t * pc_pLo; uint32_t pc; /* Program Counter */ MATCr MATCrdB; @@ -221,10 +221,10 @@ LOCALVAR struct regstruct uint32_t ArgKind; #endif - blnr TracePending; - blnr ExternalInterruptPending; + bool TracePending; + bool ExternalInterruptPending; #if 0 - blnr ResetPending; + bool ResetPending; #endif uint8_t *fIPL; #ifdef r_regs @@ -269,21 +269,21 @@ register struct regstruct *g_regs asm (r_regs); #endif #ifdef r_pc_p -register ui3p g_pc_p asm (r_pc_p); +register uint8_t * g_pc_p asm (r_pc_p); #define V_pc_p g_pc_p #else #define V_pc_p V_regs.pc_p #endif #ifdef r_MaxCyclesToGo -register int32_tr g_MaxCyclesToGo asm (r_MaxCyclesToGo); +register int32_t g_MaxCyclesToGo asm (r_MaxCyclesToGo); #define V_MaxCyclesToGo g_MaxCyclesToGo #else #define V_MaxCyclesToGo V_regs.MaxCyclesToGo #endif #ifdef r_pc_pHi -register ui3p g_pc_pHi asm (r_pc_pHi); +register uint8_t * g_pc_pHi asm (r_pc_pHi); #define V_pc_pHi g_pc_pHi #else #define V_pc_pHi V_regs.pc_pHi @@ -309,7 +309,7 @@ LOCALVAR uint32_t DumpTable[kNumIKinds]; #if USE_PCLIMIT FORWARDPROC Recalc_PC_Block(void); -FORWARDFUNC uint32_t my_reg_call Recalc_PC_BlockReturnUi5r(uint32_t v); +FORWARDFUNC uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v); #endif LOCALINLINEFUNC uint16_t nextiword(void) @@ -319,7 +319,7 @@ LOCALINLINEFUNC uint16_t nextiword(void) V_pc_p += 2; #if USE_PCLIMIT - if (my_cond_rare(V_pc_p >= V_pc_pHi)) { + if (cond_rare(V_pc_p >= V_pc_pHi)) { Recalc_PC_Block(); } #endif @@ -333,7 +333,7 @@ LOCALINLINEFUNC uint32_t nextiSByte(void) V_pc_p += 2; #if USE_PCLIMIT - if (my_cond_rare(V_pc_p >= V_pc_pHi)) { + if (cond_rare(V_pc_p >= V_pc_pHi)) { return Recalc_PC_BlockReturnUi5r(r); } #endif @@ -348,7 +348,7 @@ LOCALINLINEFUNC uint32_t nextiSWord(void) V_pc_p += 2; #if USE_PCLIMIT - if (my_cond_rare(V_pc_p >= V_pc_pHi)) { + if (cond_rare(V_pc_p >= V_pc_pHi)) { return Recalc_PC_BlockReturnUi5r(r); } #endif @@ -365,7 +365,7 @@ LOCALINLINEFUNC uint32_t nextilong(void) #if USE_PCLIMIT /* could be two words in different blocks */ - if (my_cond_rare(V_pc_p >= V_pc_pHi)) { + if (cond_rare(V_pc_p >= V_pc_pHi)) { r = nextilong_ext(); } #endif @@ -378,7 +378,7 @@ LOCALINLINEPROC BackupPC(void) V_pc_p -= 2; #if USE_PCLIMIT - if (my_cond_rare(V_pc_p < V_regs.pc_pLo)) { + if (cond_rare(V_pc_p < V_regs.pc_pLo)) { Recalc_PC_Block(); } #endif @@ -767,12 +767,12 @@ LOCALPROC BreakPointAction(void) #endif -LOCALINLINEPROC DecodeNextInstruction(func_pointer_t *d, uint16_tr *Cycles, +LOCALINLINEPROC DecodeNextInstruction(func_pointer_t *d, uint16_t *Cycles, DecOpYR *y) { uint32_t opcode; DecOpR *p; - uint16_tr MainClas; + uint16_t MainClas; opcode = nextiword(); @@ -790,7 +790,7 @@ LOCALINLINEPROC DecodeNextInstruction(func_pointer_t *d, uint16_tr *Cycles, *d = OpDispatch[MainClas]; } -LOCALINLINEPROC UnDecodeNextInstruction(uint16_tr Cycles) +LOCALINLINEPROC UnDecodeNextInstruction(uint16_t Cycles) { V_MaxCyclesToGo += Cycles; @@ -800,7 +800,7 @@ LOCALINLINEPROC UnDecodeNextInstruction(uint16_tr Cycles) { uint32_t opcode = do_get_mem_word(V_pc_p); DecOpR *p = &V_regs.disp_table[opcode]; - uint16_tr MainClas = p->x.MainClas; + uint16_t MainClas = p->x.MainClas; DumpTable[MainClas] --; } @@ -809,7 +809,7 @@ LOCALINLINEPROC UnDecodeNextInstruction(uint16_tr Cycles) LOCALPROC m68k_go_MaxCycles(void) { - uint16_tr Cycles; + uint16_t Cycles; DecOpYR y; func_pointer_t d; @@ -846,18 +846,18 @@ LOCALPROC m68k_go_MaxCycles(void) DecodeNextInstruction(&d, &Cycles, &y); - } while (((int32_tr)(V_MaxCyclesToGo -= Cycles)) > 0); + } while (((int32_t)(V_MaxCyclesToGo -= Cycles)) > 0); /* abort instruction that have started to decode */ UnDecodeNextInstruction(Cycles); } -FORWARDFUNC uint32_t my_reg_call get_byte_ext(CPTR addr); +FORWARDFUNC uint32_t reg_call get_byte_ext(CPTR addr); -LOCALFUNC uint32_t my_reg_call get_byte(CPTR addr) +LOCALFUNC uint32_t reg_call get_byte(CPTR addr) { - ui3p m = (addr & V_regs.MATCrdB.usemask) + V_regs.MATCrdB.usebase; + uint8_t * m = (addr & V_regs.MATCrdB.usemask) + V_regs.MATCrdB.usebase; if ((addr & V_regs.MATCrdB.cmpmask) == V_regs.MATCrdB.cmpvalu) { return uint32_t_FromSByte(*m); @@ -866,11 +866,11 @@ LOCALFUNC uint32_t my_reg_call get_byte(CPTR addr) } } -FORWARDPROC my_reg_call put_byte_ext(CPTR addr, uint32_t b); +FORWARDPROC reg_call put_byte_ext(CPTR addr, uint32_t b); -LOCALPROC my_reg_call put_byte(CPTR addr, uint32_t b) +LOCALPROC reg_call put_byte(CPTR addr, uint32_t b) { - ui3p m = (addr & V_regs.MATCwrB.usemask) + V_regs.MATCwrB.usebase; + uint8_t * m = (addr & V_regs.MATCwrB.usemask) + V_regs.MATCwrB.usebase; if ((addr & V_regs.MATCwrB.cmpmask) == V_regs.MATCwrB.cmpvalu) { *m = b; } else { @@ -878,11 +878,11 @@ LOCALPROC my_reg_call put_byte(CPTR addr, uint32_t b) } } -FORWARDFUNC uint32_t my_reg_call get_word_ext(CPTR addr); +FORWARDFUNC uint32_t reg_call get_word_ext(CPTR addr); -LOCALFUNC uint32_t my_reg_call get_word(CPTR addr) +LOCALFUNC uint32_t reg_call get_word(CPTR addr) { - ui3p m = (addr & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; + uint8_t * m = (addr & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; if ((addr & V_regs.MATCrdW.cmpmask) == V_regs.MATCrdW.cmpvalu) { return uint32_t_FromSWord(do_get_mem_word(m)); } else { @@ -890,11 +890,11 @@ LOCALFUNC uint32_t my_reg_call get_word(CPTR addr) } } -FORWARDPROC my_reg_call put_word_ext(CPTR addr, uint32_t w); +FORWARDPROC reg_call put_word_ext(CPTR addr, uint32_t w); -LOCALPROC my_reg_call put_word(CPTR addr, uint32_t w) +LOCALPROC reg_call put_word(CPTR addr, uint32_t w) { - ui3p m = (addr & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; + uint8_t * m = (addr & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; if ((addr & V_regs.MATCwrW.cmpmask) == V_regs.MATCwrW.cmpvalu) { do_put_mem_word(m, w); } else { @@ -902,13 +902,13 @@ LOCALPROC my_reg_call put_word(CPTR addr, uint32_t w) } } -FORWARDFUNC uint32_t my_reg_call get_long_misaligned_ext(CPTR addr); +FORWARDFUNC uint32_t reg_call get_long_misaligned_ext(CPTR addr); -LOCALFUNC uint32_t my_reg_call get_long_misaligned(CPTR addr) +LOCALFUNC uint32_t reg_call get_long_misaligned(CPTR addr) { CPTR addr2 = addr + 2; - ui3p m = (addr & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; - ui3p m2 = (addr2 & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; + uint8_t * m = (addr & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; + uint8_t * m2 = (addr2 & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; if (((addr & V_regs.MATCrdW.cmpmask) == V_regs.MATCrdW.cmpvalu) && ((addr2 & V_regs.MATCrdW.cmpmask) == V_regs.MATCrdW.cmpvalu)) { @@ -924,14 +924,14 @@ LOCALFUNC uint32_t my_reg_call get_long_misaligned(CPTR addr) } #if FasterAlignedL -FORWARDFUNC uint32_t my_reg_call get_long_ext(CPTR addr); +FORWARDFUNC uint32_t reg_call get_long_ext(CPTR addr); #endif #if FasterAlignedL -LOCALFUNC uint32_t my_reg_call get_long(CPTR addr) +LOCALFUNC uint32_t reg_call get_long(CPTR addr) { if (0 == (addr & 0x03)) { - ui3p m = (addr & V_regs.MATCrdL.usemask) + uint8_t * m = (addr & V_regs.MATCrdL.usemask) + V_regs.MATCrdL.usebase; if ((addr & V_regs.MATCrdL.cmpmask) == V_regs.MATCrdL.cmpvalu) { return uint32_t_FromSLong(do_get_mem_long(m)); @@ -946,13 +946,13 @@ LOCALFUNC uint32_t my_reg_call get_long(CPTR addr) #define get_long get_long_misaligned #endif -FORWARDPROC my_reg_call put_long_misaligned_ext(CPTR addr, uint32_t l); +FORWARDPROC reg_call put_long_misaligned_ext(CPTR addr, uint32_t l); -LOCALPROC my_reg_call put_long_misaligned(CPTR addr, uint32_t l) +LOCALPROC reg_call put_long_misaligned(CPTR addr, uint32_t l) { CPTR addr2 = addr + 2; - ui3p m = (addr & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; - ui3p m2 = (addr2 & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; + uint8_t * m = (addr & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; + uint8_t * m2 = (addr2 & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; if (((addr & V_regs.MATCwrW.cmpmask) == V_regs.MATCwrW.cmpvalu) && ((addr2 & V_regs.MATCwrW.cmpmask) == V_regs.MATCwrW.cmpvalu)) { @@ -964,14 +964,14 @@ LOCALPROC my_reg_call put_long_misaligned(CPTR addr, uint32_t l) } #if FasterAlignedL -FORWARDPROC my_reg_call put_long_ext(CPTR addr, uint32_t l); +FORWARDPROC reg_call put_long_ext(CPTR addr, uint32_t l); #endif #if FasterAlignedL -LOCALPROC my_reg_call put_long(CPTR addr, uint32_t l) +LOCALPROC reg_call put_long(CPTR addr, uint32_t l) { if (0 == (addr & 0x03)) { - ui3p m = (addr & V_regs.MATCwrL.usemask) + uint8_t * m = (addr & V_regs.MATCwrL.usemask) + V_regs.MATCwrL.usebase; if ((addr & V_regs.MATCwrL.cmpmask) == V_regs.MATCwrL.cmpvalu) { do_put_mem_long(m, l); @@ -986,7 +986,7 @@ LOCALPROC my_reg_call put_long(CPTR addr, uint32_t l) #define put_long put_long_misaligned #endif -LOCALFUNC uint32_t my_reg_call get_disp_ea(uint32_t base) +LOCALFUNC uint32_t reg_call get_disp_ea(uint32_t base) { uint16_t dp = nextiword(); int regno = (dp >> 12) & 0x0F; @@ -1096,12 +1096,12 @@ LOCALFUNC uint32_t my_reg_call get_disp_ea(uint32_t base) } } -LOCALFUNC uint32_t my_reg_call DecodeAddr_Indirect(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_Indirect(uint8_t ArgDat) { return V_regs.regs[ArgDat]; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_APosIncB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_APosIncB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1111,7 +1111,7 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_APosIncB(uint8_tr ArgDat) return a; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_APosIncW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_APosIncW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1121,7 +1121,7 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_APosIncW(uint8_tr ArgDat) return a; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_APosIncL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_APosIncL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1131,7 +1131,7 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_APosIncL(uint8_tr ArgDat) return a; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_APreDecB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_APreDecB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 1; @@ -1141,7 +1141,7 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_APreDecB(uint8_tr ArgDat) return a; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_APreDecW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_APreDecW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1151,7 +1151,7 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_APreDecW(uint8_tr ArgDat) return a; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_APreDecL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_APreDecL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 4; @@ -1161,29 +1161,29 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_APreDecL(uint8_tr ArgDat) return a; } -LOCALFUNC uint32_t my_reg_call DecodeAddr_ADisp(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_ADisp(uint8_t ArgDat) { return V_regs.regs[ArgDat] + nextiSWord(); } -LOCALFUNC uint32_t my_reg_call DecodeAddr_AIndex(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_AIndex(uint8_t ArgDat) { return get_disp_ea(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeAddr_AbsW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_AbsW(uint8_t ArgDat) { UnusedParam(ArgDat); return nextiSWord(); } -LOCALFUNC uint32_t my_reg_call DecodeAddr_AbsL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_AbsL(uint8_t ArgDat) { UnusedParam(ArgDat); return nextilong(); } -LOCALFUNC uint32_t my_reg_call DecodeAddr_PCDisp(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_PCDisp(uint8_t ArgDat) { CPTR pc = m68k_getpc(); @@ -1191,13 +1191,13 @@ LOCALFUNC uint32_t my_reg_call DecodeAddr_PCDisp(uint8_tr ArgDat) return pc + nextiSWord(); } -LOCALFUNC uint32_t my_reg_call DecodeAddr_PCIndex(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeAddr_PCIndex(uint8_t ArgDat) { UnusedParam(ArgDat); return get_disp_ea(m68k_getpc()); } -typedef uint32_t (my_reg_call *DecodeAddrP)(uint8_tr ArgDat); +typedef uint32_t (reg_call *DecodeAddrP)(uint8_t ArgDat); LOCALVAR const DecodeAddrP DecodeAddrDispatch[kNumAMds] = { (DecodeAddrP)nullpr /* kAMdRegB */, @@ -1243,37 +1243,37 @@ LOCALINLINEFUNC uint32_t DecodeAddrSrcDst(DecArgR *f) return (DecodeAddrDispatch[f->AMd])(f->ArgDat); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_RegB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_RegB(uint8_t ArgDat) { return uint32_t_FromSByte(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_RegW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_RegW(uint8_t ArgDat) { return uint32_t_FromSWord(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_RegL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_RegL(uint8_t ArgDat) { return uint32_t_FromSLong(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_IndirectB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_IndirectB(uint8_t ArgDat) { return get_byte(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_IndirectW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_IndirectW(uint8_t ArgDat) { return get_word(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_IndirectL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_IndirectL(uint8_t ArgDat) { return get_long(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosIncB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosIncB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1283,7 +1283,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosIncB(uint8_tr ArgDat) return get_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosIncW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosIncW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1293,7 +1293,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosIncW(uint8_tr ArgDat) return get_word(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosIncL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosIncL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1303,7 +1303,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosIncL(uint8_tr ArgDat) return get_long(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosInc7B(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosInc7B(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1313,7 +1313,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APosInc7B(uint8_tr ArgDat) return get_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDecB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDecB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 1; @@ -1323,7 +1323,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDecB(uint8_tr ArgDat) return get_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDecW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDecW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1333,7 +1333,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDecW(uint8_tr ArgDat) return get_word(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDecL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDecL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 4; @@ -1343,7 +1343,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDecL(uint8_tr ArgDat) return get_long(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDec7B(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDec7B(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1353,120 +1353,120 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_APreDec7B(uint8_tr ArgDat) return get_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_ADispB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ADispB(uint8_t ArgDat) { return get_byte(DecodeAddr_ADisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_ADispW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ADispW(uint8_t ArgDat) { return get_word(DecodeAddr_ADisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_ADispL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ADispL(uint8_t ArgDat) { return get_long(DecodeAddr_ADisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AIndexB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AIndexB(uint8_t ArgDat) { return get_byte(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AIndexW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AIndexW(uint8_t ArgDat) { return get_word(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AIndexL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AIndexL(uint8_t ArgDat) { return get_long(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AbsWB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsWB(uint8_t ArgDat) { return get_byte(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AbsWW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsWW(uint8_t ArgDat) { return get_word(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AbsWL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsWL(uint8_t ArgDat) { return get_long(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AbsLB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsLB(uint8_t ArgDat) { return get_byte(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AbsLW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsLW(uint8_t ArgDat) { return get_word(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_AbsLL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsLL(uint8_t ArgDat) { return get_long(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_PCDispB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCDispB(uint8_t ArgDat) { return get_byte(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_PCDispW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCDispW(uint8_t ArgDat) { return get_word(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_PCDispL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCDispL(uint8_t ArgDat) { return get_long(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_PCIndexB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCIndexB(uint8_t ArgDat) { return get_byte(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_PCIndexW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCIndexW(uint8_t ArgDat) { return get_word(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_PCIndexL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCIndexL(uint8_t ArgDat) { return get_long(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_ImmedB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ImmedB(uint8_t ArgDat) { UnusedParam(ArgDat); return nextiSByte(); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_ImmedW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ImmedW(uint8_t ArgDat) { UnusedParam(ArgDat); return nextiSWord(); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_ImmedL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ImmedL(uint8_t ArgDat) { UnusedParam(ArgDat); return uint32_t_FromSLong(nextilong()); } -LOCALFUNC uint32_t my_reg_call DecodeGetSrcDst_Dat4(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSrcDst_Dat4(uint8_t ArgDat) { return ArgDat; } -typedef uint32_t (my_reg_call *DecodeGetSrcDstP)(uint8_tr ArgDat); +typedef uint32_t (reg_call *DecodeGetSrcDstP)(uint8_t ArgDat); LOCALVAR const DecodeGetSrcDstP DecodeGetSrcDstDispatch[kNumAMds] = { DecodeGetSrcDst_RegB /* kAMdRegB */, @@ -1512,7 +1512,7 @@ LOCALINLINEFUNC uint32_t DecodeGetSrcDst(DecArgR *f) return (DecodeGetSrcDstDispatch[f->AMd])(f->ArgDat); } -LOCALPROC my_reg_call DecodeSetSrcDst_RegB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_RegB(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1523,7 +1523,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_RegB(uint32_t v, uint8_tr ArgDat) #endif } -LOCALPROC my_reg_call DecodeSetSrcDst_RegW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_RegW(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1534,27 +1534,27 @@ LOCALPROC my_reg_call DecodeSetSrcDst_RegW(uint32_t v, uint8_tr ArgDat) #endif } -LOCALPROC my_reg_call DecodeSetSrcDst_RegL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_RegL(uint32_t v, uint8_t ArgDat) { V_regs.regs[ArgDat] = v; } -LOCALPROC my_reg_call DecodeSetSrcDst_IndirectB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_IndirectB(uint32_t v, uint8_t ArgDat) { put_byte(V_regs.regs[ArgDat], v); } -LOCALPROC my_reg_call DecodeSetSrcDst_IndirectW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_IndirectW(uint32_t v, uint8_t ArgDat) { put_word(V_regs.regs[ArgDat], v); } -LOCALPROC my_reg_call DecodeSetSrcDst_IndirectL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_IndirectL(uint32_t v, uint8_t ArgDat) { put_long(V_regs.regs[ArgDat], v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APosIncB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APosIncB(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1564,7 +1564,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APosIncB(uint32_t v, uint8_tr ArgDat) put_byte(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APosIncW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APosIncW(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1574,7 +1574,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APosIncW(uint32_t v, uint8_tr ArgDat) put_word(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APosIncL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APosIncL(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1584,7 +1584,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APosIncL(uint32_t v, uint8_tr ArgDat) put_long(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APosInc7B(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APosInc7B(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1594,7 +1594,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APosInc7B(uint32_t v, uint8_tr ArgDat) put_byte(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APreDecB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APreDecB(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 1; @@ -1604,7 +1604,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APreDecB(uint32_t v, uint8_tr ArgDat) put_byte(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APreDecW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APreDecW(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1614,7 +1614,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APreDecW(uint32_t v, uint8_tr ArgDat) put_word(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APreDecL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APreDecL(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 4; @@ -1624,7 +1624,7 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APreDecL(uint32_t v, uint8_tr ArgDat) put_long(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_APreDec7B(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_APreDec7B(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1634,100 +1634,100 @@ LOCALPROC my_reg_call DecodeSetSrcDst_APreDec7B(uint32_t v, uint8_tr ArgDat) put_byte(a, v); } -LOCALPROC my_reg_call DecodeSetSrcDst_ADispB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_ADispB(uint32_t v, uint8_t ArgDat) { put_byte(V_regs.regs[ArgDat] + nextiSWord(), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_ADispW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_ADispW(uint32_t v, uint8_t ArgDat) { put_word(V_regs.regs[ArgDat] + nextiSWord(), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_ADispL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_ADispL(uint32_t v, uint8_t ArgDat) { put_long(V_regs.regs[ArgDat] + nextiSWord(), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AIndexB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AIndexB(uint32_t v, uint8_t ArgDat) { put_byte(get_disp_ea(V_regs.regs[ArgDat]), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AIndexW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AIndexW(uint32_t v, uint8_t ArgDat) { put_word(get_disp_ea(V_regs.regs[ArgDat]), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AIndexL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AIndexL(uint32_t v, uint8_t ArgDat) { put_long(get_disp_ea(V_regs.regs[ArgDat]), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AbsWB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AbsWB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_AbsW(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AbsWW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AbsWW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_AbsW(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AbsWL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AbsWL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_AbsW(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AbsLB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AbsLB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_AbsL(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AbsLW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AbsLW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_AbsL(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_AbsLL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_AbsLL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_AbsL(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_PCDispB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_PCDispB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_PCDisp(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_PCDispW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_PCDispW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_PCDisp(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_PCDispL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_PCDispL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_PCDisp(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_PCIndexB(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_PCIndexB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_PCIndex(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_PCIndexW(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_PCIndexW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_PCIndex(ArgDat), v); } -LOCALPROC my_reg_call DecodeSetSrcDst_PCIndexL(uint32_t v, uint8_tr ArgDat) +LOCALPROC reg_call DecodeSetSrcDst_PCIndexL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_PCIndex(ArgDat), v); } -typedef void (my_reg_call *DecodeSetSrcDstP)(uint32_t v, uint8_tr ArgDat); +typedef void (reg_call *DecodeSetSrcDstP)(uint32_t v, uint8_t ArgDat); LOCALVAR const DecodeSetSrcDstP DecodeSetSrcDstDispatch[kNumAMds] = { DecodeSetSrcDst_RegB /* kAMdRegB */, @@ -1773,7 +1773,7 @@ LOCALINLINEPROC DecodeSetSrcDst(uint32_t v, DecArgR *f) (DecodeSetSrcDstDispatch[f->AMd])(v, f->ArgDat); } -LOCALPROC my_reg_call ArgSetDstRegBValue(uint32_t v) +LOCALPROC reg_call ArgSetDstRegBValue(uint32_t v) { uint32_t *p = V_regs.ArgAddr.rga; @@ -1784,7 +1784,7 @@ LOCALPROC my_reg_call ArgSetDstRegBValue(uint32_t v) #endif } -LOCALPROC my_reg_call ArgSetDstRegWValue(uint32_t v) +LOCALPROC reg_call ArgSetDstRegWValue(uint32_t v) { uint32_t *p = V_regs.ArgAddr.rga; @@ -1795,29 +1795,29 @@ LOCALPROC my_reg_call ArgSetDstRegWValue(uint32_t v) #endif } -LOCALPROC my_reg_call ArgSetDstRegLValue(uint32_t v) +LOCALPROC reg_call ArgSetDstRegLValue(uint32_t v) { uint32_t *p = V_regs.ArgAddr.rga; *p = v; } -LOCALPROC my_reg_call ArgSetDstMemBValue(uint32_t v) +LOCALPROC reg_call ArgSetDstMemBValue(uint32_t v) { put_byte(V_regs.ArgAddr.mem, v); } -LOCALPROC my_reg_call ArgSetDstMemWValue(uint32_t v) +LOCALPROC reg_call ArgSetDstMemWValue(uint32_t v) { put_word(V_regs.ArgAddr.mem, v); } -LOCALPROC my_reg_call ArgSetDstMemLValue(uint32_t v) +LOCALPROC reg_call ArgSetDstMemLValue(uint32_t v) { put_long(V_regs.ArgAddr.mem, v); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_RegB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1827,7 +1827,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_RegB(uint8_tr ArgDat) return uint32_t_FromSByte(*p); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_RegW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1837,7 +1837,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_RegW(uint8_tr ArgDat) return uint32_t_FromSWord(*p); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_RegL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1847,7 +1847,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_RegL(uint8_tr ArgDat) return uint32_t_FromSLong(*p); } -LOCALFUNC uint32_t my_reg_call getarg_byte(uint32_t a) +LOCALFUNC uint32_t reg_call getarg_byte(uint32_t a) { V_regs.ArgAddr.mem = a; V_regs.ArgSetDst = ArgSetDstMemBValue; @@ -1855,7 +1855,7 @@ LOCALFUNC uint32_t my_reg_call getarg_byte(uint32_t a) return get_byte(a); } -LOCALFUNC uint32_t my_reg_call getarg_word(uint32_t a) +LOCALFUNC uint32_t reg_call getarg_word(uint32_t a) { V_regs.ArgAddr.mem = a; V_regs.ArgSetDst = ArgSetDstMemWValue; @@ -1863,7 +1863,7 @@ LOCALFUNC uint32_t my_reg_call getarg_word(uint32_t a) return get_word(a); } -LOCALFUNC uint32_t my_reg_call getarg_long(uint32_t a) +LOCALFUNC uint32_t reg_call getarg_long(uint32_t a) { V_regs.ArgAddr.mem = a; V_regs.ArgSetDst = ArgSetDstMemLValue; @@ -1871,22 +1871,22 @@ LOCALFUNC uint32_t my_reg_call getarg_long(uint32_t a) return get_long(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_IndirectB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_IndirectB(uint8_t ArgDat) { return getarg_byte(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_IndirectW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_IndirectW(uint8_t ArgDat) { return getarg_word(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_IndirectL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_IndirectL(uint8_t ArgDat) { return getarg_long(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosIncB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosIncB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1896,7 +1896,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosIncB(uint8_tr ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosIncW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosIncW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1906,7 +1906,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosIncW(uint8_tr ArgDat) return getarg_word(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosIncL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosIncL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1916,7 +1916,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosIncL(uint8_tr ArgDat) return getarg_long(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosInc7B(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosInc7B(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p; @@ -1926,7 +1926,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APosInc7B(uint8_tr ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDecB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDecB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 1; @@ -1936,7 +1936,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDecB(uint8_tr ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDecW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDecW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1946,7 +1946,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDecW(uint8_tr ArgDat) return getarg_word(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDecL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDecL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 4; @@ -1956,7 +1956,7 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDecL(uint8_tr ArgDat) return getarg_long(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDec7B(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDec7B(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1966,100 +1966,100 @@ LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_APreDec7B(uint8_tr ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_ADispB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_ADispB(uint8_t ArgDat) { return getarg_byte(V_regs.regs[ArgDat] + nextiSWord()); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_ADispW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_ADispW(uint8_t ArgDat) { return getarg_word(V_regs.regs[ArgDat] + nextiSWord()); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_ADispL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_ADispL(uint8_t ArgDat) { return getarg_long(V_regs.regs[ArgDat] + nextiSWord()); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AIndexB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AIndexB(uint8_t ArgDat) { return getarg_byte(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AIndexW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AIndexW(uint8_t ArgDat) { return getarg_word(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AIndexL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AIndexL(uint8_t ArgDat) { return getarg_long(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AbsWB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsWB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AbsWW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsWW(uint8_t ArgDat) { return getarg_word(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AbsWL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsWL(uint8_t ArgDat) { return getarg_long(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AbsLB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsLB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AbsLW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsLW(uint8_t ArgDat) { return getarg_word(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_AbsLL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsLL(uint8_t ArgDat) { return getarg_long(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_PCDispB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCDispB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_PCDispW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCDispW(uint8_t ArgDat) { return getarg_word(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_PCDispL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCDispL(uint8_t ArgDat) { return getarg_long(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_PCIndexB(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCIndexB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_PCIndexW(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCIndexW(uint8_t ArgDat) { return getarg_word(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t my_reg_call DecodeGetSetSrcDst_PCIndexL(uint8_tr ArgDat) +LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCIndexL(uint8_t ArgDat) { return getarg_long(DecodeAddr_PCIndex(ArgDat)); } -typedef uint32_t (my_reg_call *DecodeGetSetSrcDstP)(uint8_tr ArgDat); +typedef uint32_t (reg_call *DecodeGetSetSrcDstP)(uint8_t ArgDat); LOCALVAR const DecodeGetSetSrcDstP DecodeGetSetSrcDstDispatch[kNumAMds] = @@ -2155,19 +2155,19 @@ LOCALINLINEFUNC uint32_t DecodeGetSrcGetDstValue(void) typedef void (*cond_actP)(void); -LOCALPROC my_reg_call cctrue_T(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_T(cond_actP t_act, cond_actP f_act) { UnusedParam(f_act); t_act(); } -LOCALPROC my_reg_call cctrue_F(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_F(cond_actP t_act, cond_actP f_act) { UnusedParam(t_act); f_act(); } -LOCALPROC my_reg_call cctrue_HI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_HI(cond_actP t_act, cond_actP f_act) { if (0 == (CFLG | ZFLG)) { t_act(); @@ -2176,7 +2176,7 @@ LOCALPROC my_reg_call cctrue_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_LS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_LS(cond_actP t_act, cond_actP f_act) { if (0 != (CFLG | ZFLG)) { t_act(); @@ -2185,7 +2185,7 @@ LOCALPROC my_reg_call cctrue_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CC(cond_actP t_act, cond_actP f_act) { if (0 == (CFLG)) { t_act(); @@ -2194,7 +2194,7 @@ LOCALPROC my_reg_call cctrue_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CS(cond_actP t_act, cond_actP f_act) { if (0 != (CFLG)) { t_act(); @@ -2203,7 +2203,7 @@ LOCALPROC my_reg_call cctrue_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_NE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_NE(cond_actP t_act, cond_actP f_act) { if (0 == (ZFLG)) { t_act(); @@ -2212,7 +2212,7 @@ LOCALPROC my_reg_call cctrue_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_EQ(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_EQ(cond_actP t_act, cond_actP f_act) { if (0 != (ZFLG)) { t_act(); @@ -2221,7 +2221,7 @@ LOCALPROC my_reg_call cctrue_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_VC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_VC(cond_actP t_act, cond_actP f_act) { if (0 == (VFLG)) { t_act(); @@ -2230,7 +2230,7 @@ LOCALPROC my_reg_call cctrue_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_VS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_VS(cond_actP t_act, cond_actP f_act) { if (0 != (VFLG)) { t_act(); @@ -2239,7 +2239,7 @@ LOCALPROC my_reg_call cctrue_VS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_PL(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_PL(cond_actP t_act, cond_actP f_act) { if (0 == (NFLG)) { t_act(); @@ -2248,7 +2248,7 @@ LOCALPROC my_reg_call cctrue_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_MI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_MI(cond_actP t_act, cond_actP f_act) { if (0 != (NFLG)) { t_act(); @@ -2257,7 +2257,7 @@ LOCALPROC my_reg_call cctrue_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_GE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_GE(cond_actP t_act, cond_actP f_act) { if (0 == (NFLG ^ VFLG)) { t_act(); @@ -2266,7 +2266,7 @@ LOCALPROC my_reg_call cctrue_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_LT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_LT(cond_actP t_act, cond_actP f_act) { if (0 != (NFLG ^ VFLG)) { t_act(); @@ -2275,7 +2275,7 @@ LOCALPROC my_reg_call cctrue_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_GT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_GT(cond_actP t_act, cond_actP f_act) { if (0 == (ZFLG | (NFLG ^ VFLG))) { t_act(); @@ -2284,7 +2284,7 @@ LOCALPROC my_reg_call cctrue_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_LE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_LE(cond_actP t_act, cond_actP f_act) { if (0 != (ZFLG | (NFLG ^ VFLG))) { t_act(); @@ -2312,7 +2312,7 @@ LOCALFUNC uint32_t Ui5rASR(uint32_t x, uint32_t s) #if UseLazyCC -LOCALPROC my_reg_call cctrue_TstL_HI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_HI(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) > ((uint32_t)0)) { t_act(); @@ -2321,7 +2321,7 @@ LOCALPROC my_reg_call cctrue_TstL_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_LS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_LS(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) <= ((uint32_t)0)) { t_act(); @@ -2331,7 +2331,7 @@ LOCALPROC my_reg_call cctrue_TstL_LS(cond_actP t_act, cond_actP f_act) } #if 0 /* always true */ -LOCALPROC my_reg_call cctrue_TstL_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_CC(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) >= ((uint32_t)0)) { t_act(); @@ -2342,7 +2342,7 @@ LOCALPROC my_reg_call cctrue_TstL_CC(cond_actP t_act, cond_actP f_act) #endif #if 0 /* always false */ -LOCALPROC my_reg_call cctrue_TstL_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_CS(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) < ((uint32_t)0)) { t_act(); @@ -2352,7 +2352,7 @@ LOCALPROC my_reg_call cctrue_TstL_CS(cond_actP t_act, cond_actP f_act) } #endif -LOCALPROC my_reg_call cctrue_TstL_NE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_NE(cond_actP t_act, cond_actP f_act) { if (V_regs.LazyFlagArgDst != 0) { t_act(); @@ -2361,7 +2361,7 @@ LOCALPROC my_reg_call cctrue_TstL_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_EQ(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_EQ(cond_actP t_act, cond_actP f_act) { if (V_regs.LazyFlagArgDst == 0) { t_act(); @@ -2370,7 +2370,7 @@ LOCALPROC my_reg_call cctrue_TstL_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_PL(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_PL(cond_actP t_act, cond_actP f_act) { if (((int32_t)(V_regs.LazyFlagArgDst)) >= 0) { t_act(); @@ -2379,7 +2379,7 @@ LOCALPROC my_reg_call cctrue_TstL_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_MI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_MI(cond_actP t_act, cond_actP f_act) { if (((int32_t)(V_regs.LazyFlagArgDst)) < 0) { t_act(); @@ -2388,7 +2388,7 @@ LOCALPROC my_reg_call cctrue_TstL_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_GE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_GE(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) >= ((int32_t)0)) { t_act(); @@ -2397,7 +2397,7 @@ LOCALPROC my_reg_call cctrue_TstL_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_LT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_LT(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) < ((int32_t)0)) { t_act(); @@ -2406,7 +2406,7 @@ LOCALPROC my_reg_call cctrue_TstL_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_GT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_GT(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) > ((int32_t)0)) { t_act(); @@ -2415,7 +2415,7 @@ LOCALPROC my_reg_call cctrue_TstL_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_TstL_LE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_TstL_LE(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) <= ((int32_t)0)) { t_act(); @@ -2424,7 +2424,7 @@ LOCALPROC my_reg_call cctrue_TstL_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_HI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_HI(cond_actP t_act, cond_actP f_act) { if (((uint8_t)V_regs.LazyFlagArgDst) > ((uint8_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2433,7 +2433,7 @@ LOCALPROC my_reg_call cctrue_CmpB_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_LS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_LS(cond_actP t_act, cond_actP f_act) { if (((uint8_t)V_regs.LazyFlagArgDst) <= ((uint8_t)V_regs.LazyFlagArgSrc)) { @@ -2443,7 +2443,7 @@ LOCALPROC my_reg_call cctrue_CmpB_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_CC(cond_actP t_act, cond_actP f_act) { if (((uint8_t)V_regs.LazyFlagArgDst) >= ((uint8_t)V_regs.LazyFlagArgSrc)) { @@ -2453,7 +2453,7 @@ LOCALPROC my_reg_call cctrue_CmpB_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_CS(cond_actP t_act, cond_actP f_act) { if (((uint8_t)V_regs.LazyFlagArgDst) < ((uint8_t)V_regs.LazyFlagArgSrc)) { @@ -2463,7 +2463,7 @@ LOCALPROC my_reg_call cctrue_CmpB_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_NE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_NE(cond_actP t_act, cond_actP f_act) { if (((uint8_t)V_regs.LazyFlagArgDst) != ((uint8_t)V_regs.LazyFlagArgSrc)) { @@ -2473,7 +2473,7 @@ LOCALPROC my_reg_call cctrue_CmpB_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_EQ(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_EQ(cond_actP t_act, cond_actP f_act) { if (((uint8_t)V_regs.LazyFlagArgDst) == ((uint8_t)V_regs.LazyFlagArgSrc)) { @@ -2483,7 +2483,7 @@ LOCALPROC my_reg_call cctrue_CmpB_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_PL(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_PL(cond_actP t_act, cond_actP f_act) { if (((int8_t)(V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc)) >= 0) { t_act(); @@ -2492,7 +2492,7 @@ LOCALPROC my_reg_call cctrue_CmpB_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_MI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_MI(cond_actP t_act, cond_actP f_act) { if (((int8_t)(V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc)) < 0) { t_act(); @@ -2501,7 +2501,7 @@ LOCALPROC my_reg_call cctrue_CmpB_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_GE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_GE(cond_actP t_act, cond_actP f_act) { if (((int8_t)V_regs.LazyFlagArgDst) >= ((int8_t)V_regs.LazyFlagArgSrc)) { @@ -2511,7 +2511,7 @@ LOCALPROC my_reg_call cctrue_CmpB_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_LT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_LT(cond_actP t_act, cond_actP f_act) { if (((int8_t)V_regs.LazyFlagArgDst) < ((int8_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2520,7 +2520,7 @@ LOCALPROC my_reg_call cctrue_CmpB_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_GT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_GT(cond_actP t_act, cond_actP f_act) { if (((int8_t)V_regs.LazyFlagArgDst) > ((int8_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2529,7 +2529,7 @@ LOCALPROC my_reg_call cctrue_CmpB_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpB_LE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpB_LE(cond_actP t_act, cond_actP f_act) { if (((int8_t)V_regs.LazyFlagArgDst) <= ((int8_t)V_regs.LazyFlagArgSrc)) { @@ -2539,7 +2539,7 @@ LOCALPROC my_reg_call cctrue_CmpB_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_HI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_HI(cond_actP t_act, cond_actP f_act) { if (((uint16_t)V_regs.LazyFlagArgDst) > ((uint16_t)V_regs.LazyFlagArgSrc)) { @@ -2549,7 +2549,7 @@ LOCALPROC my_reg_call cctrue_CmpW_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_LS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_LS(cond_actP t_act, cond_actP f_act) { if (((uint16_t)V_regs.LazyFlagArgDst) <= ((uint16_t)V_regs.LazyFlagArgSrc)) { @@ -2559,7 +2559,7 @@ LOCALPROC my_reg_call cctrue_CmpW_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_CC(cond_actP t_act, cond_actP f_act) { if (((uint16_t)V_regs.LazyFlagArgDst) >= ((uint16_t)V_regs.LazyFlagArgSrc)) { @@ -2569,7 +2569,7 @@ LOCALPROC my_reg_call cctrue_CmpW_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_CS(cond_actP t_act, cond_actP f_act) { if (((uint16_t)V_regs.LazyFlagArgDst) < ((uint16_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2578,7 +2578,7 @@ LOCALPROC my_reg_call cctrue_CmpW_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_NE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_NE(cond_actP t_act, cond_actP f_act) { if (((uint16_t)V_regs.LazyFlagArgDst) != ((uint16_t)V_regs.LazyFlagArgSrc)) { @@ -2588,7 +2588,7 @@ LOCALPROC my_reg_call cctrue_CmpW_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_EQ(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_EQ(cond_actP t_act, cond_actP f_act) { if (((uint16_t)V_regs.LazyFlagArgDst) == ((uint16_t)V_regs.LazyFlagArgSrc)) { @@ -2598,7 +2598,7 @@ LOCALPROC my_reg_call cctrue_CmpW_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_PL(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_PL(cond_actP t_act, cond_actP f_act) { if (((int16_t)(V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc)) >= 0) { t_act(); @@ -2607,7 +2607,7 @@ LOCALPROC my_reg_call cctrue_CmpW_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_MI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_MI(cond_actP t_act, cond_actP f_act) { if (((int16_t)(V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc)) < 0) { t_act(); @@ -2616,7 +2616,7 @@ LOCALPROC my_reg_call cctrue_CmpW_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_GE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_GE(cond_actP t_act, cond_actP f_act) { if (((int16_t)V_regs.LazyFlagArgDst) >= ((int16_t)V_regs.LazyFlagArgSrc)) { @@ -2626,7 +2626,7 @@ LOCALPROC my_reg_call cctrue_CmpW_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_LT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_LT(cond_actP t_act, cond_actP f_act) { if (((int16_t)V_regs.LazyFlagArgDst) < ((int16_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2635,7 +2635,7 @@ LOCALPROC my_reg_call cctrue_CmpW_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_GT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_GT(cond_actP t_act, cond_actP f_act) { if (((int16_t)V_regs.LazyFlagArgDst) > ((int16_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2644,7 +2644,7 @@ LOCALPROC my_reg_call cctrue_CmpW_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpW_LE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpW_LE(cond_actP t_act, cond_actP f_act) { if (((int16_t)V_regs.LazyFlagArgDst) <= ((int16_t)V_regs.LazyFlagArgSrc)) { @@ -2654,7 +2654,7 @@ LOCALPROC my_reg_call cctrue_CmpW_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_HI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_HI(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) > ((uint32_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2663,7 +2663,7 @@ LOCALPROC my_reg_call cctrue_CmpL_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_LS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_LS(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) <= ((uint32_t)V_regs.LazyFlagArgSrc)) { @@ -2673,7 +2673,7 @@ LOCALPROC my_reg_call cctrue_CmpL_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_CC(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) >= ((uint32_t)V_regs.LazyFlagArgSrc)) { @@ -2683,7 +2683,7 @@ LOCALPROC my_reg_call cctrue_CmpL_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_CS(cond_actP t_act, cond_actP f_act) { if (((uint32_t)V_regs.LazyFlagArgDst) < ((uint32_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2692,7 +2692,7 @@ LOCALPROC my_reg_call cctrue_CmpL_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_NE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_NE(cond_actP t_act, cond_actP f_act) { if (V_regs.LazyFlagArgDst != V_regs.LazyFlagArgSrc) { t_act(); @@ -2701,7 +2701,7 @@ LOCALPROC my_reg_call cctrue_CmpL_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_EQ(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_EQ(cond_actP t_act, cond_actP f_act) { if (V_regs.LazyFlagArgDst == V_regs.LazyFlagArgSrc) { t_act(); @@ -2710,7 +2710,7 @@ LOCALPROC my_reg_call cctrue_CmpL_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_PL(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_PL(cond_actP t_act, cond_actP f_act) { if ((((int32_t)(V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc)) >= 0)) { @@ -2720,7 +2720,7 @@ LOCALPROC my_reg_call cctrue_CmpL_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_MI(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_MI(cond_actP t_act, cond_actP f_act) { if ((((int32_t)(V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc)) < 0)) { t_act(); @@ -2729,7 +2729,7 @@ LOCALPROC my_reg_call cctrue_CmpL_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_GE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_GE(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) >= ((int32_t)V_regs.LazyFlagArgSrc)) { @@ -2739,7 +2739,7 @@ LOCALPROC my_reg_call cctrue_CmpL_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_LT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_LT(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) < ((int32_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2748,7 +2748,7 @@ LOCALPROC my_reg_call cctrue_CmpL_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_GT(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_GT(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) > ((int32_t)V_regs.LazyFlagArgSrc)) { t_act(); @@ -2757,7 +2757,7 @@ LOCALPROC my_reg_call cctrue_CmpL_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_CmpL_LE(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_CmpL_LE(cond_actP t_act, cond_actP f_act) { if (((int32_t)V_regs.LazyFlagArgDst) <= ((int32_t)V_regs.LazyFlagArgSrc)) { @@ -2767,7 +2767,7 @@ LOCALPROC my_reg_call cctrue_CmpL_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_Asr_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_Asr_CC(cond_actP t_act, cond_actP f_act) { if (0 == ((V_regs.LazyFlagArgDst >> (V_regs.LazyFlagArgSrc - 1)) & 1)) @@ -2778,7 +2778,7 @@ LOCALPROC my_reg_call cctrue_Asr_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_Asr_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_Asr_CS(cond_actP t_act, cond_actP f_act) { if (0 != ((V_regs.LazyFlagArgDst >> (V_regs.LazyFlagArgSrc - 1)) & 1)) @@ -2789,7 +2789,7 @@ LOCALPROC my_reg_call cctrue_Asr_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslB_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslB_CC(cond_actP t_act, cond_actP f_act) { if (0 == ((V_regs.LazyFlagArgDst >> (8 - V_regs.LazyFlagArgSrc)) & 1)) @@ -2800,7 +2800,7 @@ LOCALPROC my_reg_call cctrue_AslB_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslB_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslB_CS(cond_actP t_act, cond_actP f_act) { if (0 != ((V_regs.LazyFlagArgDst >> (8 - V_regs.LazyFlagArgSrc)) & 1)) @@ -2811,7 +2811,7 @@ LOCALPROC my_reg_call cctrue_AslB_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslB_VC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslB_VC(cond_actP t_act, cond_actP f_act) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = uint32_t_FromSByte(V_regs.LazyFlagArgDst << cnt); @@ -2823,7 +2823,7 @@ LOCALPROC my_reg_call cctrue_AslB_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslB_VS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslB_VS(cond_actP t_act, cond_actP f_act) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = uint32_t_FromSByte(V_regs.LazyFlagArgDst << cnt); @@ -2835,7 +2835,7 @@ LOCALPROC my_reg_call cctrue_AslB_VS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslW_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslW_CC(cond_actP t_act, cond_actP f_act) { if (0 == ((V_regs.LazyFlagArgDst >> (16 - V_regs.LazyFlagArgSrc)) & 1)) @@ -2846,7 +2846,7 @@ LOCALPROC my_reg_call cctrue_AslW_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslW_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslW_CS(cond_actP t_act, cond_actP f_act) { if (0 != ((V_regs.LazyFlagArgDst >> (16 - V_regs.LazyFlagArgSrc)) & 1)) @@ -2857,7 +2857,7 @@ LOCALPROC my_reg_call cctrue_AslW_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslW_VC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslW_VC(cond_actP t_act, cond_actP f_act) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = uint32_t_FromSWord(V_regs.LazyFlagArgDst << cnt); @@ -2869,7 +2869,7 @@ LOCALPROC my_reg_call cctrue_AslW_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslW_VS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslW_VS(cond_actP t_act, cond_actP f_act) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = uint32_t_FromSWord(V_regs.LazyFlagArgDst << cnt); @@ -2881,7 +2881,7 @@ LOCALPROC my_reg_call cctrue_AslW_VS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslL_CC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslL_CC(cond_actP t_act, cond_actP f_act) { if (0 == ((V_regs.LazyFlagArgDst >> (32 - V_regs.LazyFlagArgSrc)) & 1)) @@ -2892,7 +2892,7 @@ LOCALPROC my_reg_call cctrue_AslL_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslL_CS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslL_CS(cond_actP t_act, cond_actP f_act) { if (0 != ((V_regs.LazyFlagArgDst >> (32 - V_regs.LazyFlagArgSrc)) & 1)) @@ -2903,7 +2903,7 @@ LOCALPROC my_reg_call cctrue_AslL_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslL_VC(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslL_VC(cond_actP t_act, cond_actP f_act) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = uint32_t_FromSLong(V_regs.LazyFlagArgDst << cnt); @@ -2915,7 +2915,7 @@ LOCALPROC my_reg_call cctrue_AslL_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC my_reg_call cctrue_AslL_VS(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_AslL_VS(cond_actP t_act, cond_actP f_act) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = uint32_t_FromSLong(V_regs.LazyFlagArgDst << cnt); @@ -2927,7 +2927,7 @@ LOCALPROC my_reg_call cctrue_AslL_VS(cond_actP t_act, cond_actP f_act) } } -FORWARDPROC my_reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act); +FORWARDPROC reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act); #endif /* UseLazyCC */ @@ -2937,7 +2937,7 @@ FORWARDPROC my_reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act); #define CCdispSz kNumLazyFlagsKinds #endif -typedef void (my_reg_call *cctrueP)(cond_actP t_act, cond_actP f_act); +typedef void (reg_call *cctrueP)(cond_actP t_act, cond_actP f_act); LOCALVAR const cctrueP cctrueDispatch[CCdispSz + 1] = { cctrue_T /* kLazyFlagsDefault T */, @@ -3937,7 +3937,7 @@ LOCALPROC NeedDefaultLazyFlagsZSet(void) #endif #if UseLazyCC -LOCALPROC my_reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act) +LOCALPROC reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act) { NeedDefaultLazyAllFlags(); cctrue(t_act, f_act); @@ -4039,13 +4039,13 @@ LOCALIPROC DoCodeTst(void) LOCALIPROC DoCodeBraB(void) { int32_t offset = (int32_t)(int8_t)(uint8_t)(V_regs.CurDecOpY.v[1].ArgDat); - ui3p s = V_pc_p + offset; + uint8_t * s = V_pc_p + offset; V_pc_p = s; #if USE_PCLIMIT - if (my_cond_rare(s >= V_pc_pHi) - || my_cond_rare(s < V_regs.pc_pLo)) + if (cond_rare(s >= V_pc_pHi) + || cond_rare(s < V_regs.pc_pLo)) { Recalc_PC_Block(); } @@ -4056,13 +4056,13 @@ LOCALIPROC DoCodeBraW(void) { int32_t offset = (int32_t)(int16_t)(uint16_t)do_get_mem_word(V_pc_p); /* note that pc not incremented here */ - ui3p s = V_pc_p + offset; + uint8_t * s = V_pc_p + offset; V_pc_p = s; #if USE_PCLIMIT - if (my_cond_rare(s >= V_pc_pHi) - || my_cond_rare(s < V_regs.pc_pLo)) + if (cond_rare(s >= V_pc_pHi) + || cond_rare(s < V_regs.pc_pLo)) { Recalc_PC_Block(); } @@ -4098,7 +4098,7 @@ LOCALPROC SkipiWord(void) V_pc_p += 2; #if USE_PCLIMIT - if (my_cond_rare(V_pc_p >= V_pc_pHi)) { + if (cond_rare(V_pc_p >= V_pc_pHi)) { Recalc_PC_Block(); } #endif @@ -4382,7 +4382,7 @@ LOCALPROCUSEDONCE DumpAJump(CPTR toaddr) } #endif -LOCALPROC my_reg_call m68k_setpc(CPTR newpc) +LOCALPROC reg_call m68k_setpc(CPTR newpc) { #if WantDumpAJump DumpAJump(newpc); @@ -4396,8 +4396,8 @@ LOCALPROC my_reg_call m68k_setpc(CPTR newpc) #endif V_pc_p = V_regs.pc_pLo + (newpc - V_regs.pc); - if (my_cond_rare(V_pc_p >= V_pc_pHi) - || my_cond_rare(V_pc_p < V_regs.pc_pLo)) + if (cond_rare(V_pc_p >= V_pc_pHi) + || cond_rare(V_pc_p < V_regs.pc_pLo)) { Recalc_PC_Block(); } @@ -4483,7 +4483,7 @@ LOCALIPROC DoCodeCmpA(void) HaveSetUpFlags(); } -LOCALFUNC uint16_tr m68k_getCR(void) +LOCALFUNC uint16_t m68k_getCR(void) { NeedDefaultLazyAllFlags(); @@ -4491,7 +4491,7 @@ LOCALFUNC uint16_tr m68k_getCR(void) | (VFLG << 1) | CFLG; } -LOCALPROC my_reg_call m68k_setCR(uint16_tr newcr) +LOCALPROC reg_call m68k_setCR(uint16_t newcr) { XFLG = (newcr >> 4) & 1; NFLG = (newcr >> 3) & 1; @@ -4504,7 +4504,7 @@ LOCALPROC my_reg_call m68k_setCR(uint16_tr newcr) } -LOCALFUNC uint16_tr m68k_getSR(void) +LOCALFUNC uint16_t m68k_getSR(void) { return m68k_getCR() | (V_regs.t1 << 15) @@ -4535,11 +4535,11 @@ LOCALPROC NeedToGetOut(void) LOCALPROC SetExternalInterruptPending(void) { - V_regs.ExternalInterruptPending = trueblnr; + V_regs.ExternalInterruptPending = true; NeedToGetOut(); } -LOCALPROC my_reg_call m68k_setSR(uint16_tr newsr) +LOCALPROC reg_call m68k_setSR(uint16_t newsr) { CPTR *pnewstk; CPTR *poldstk = (V_regs.s != 0) ? ( @@ -4583,19 +4583,19 @@ LOCALPROC my_reg_call m68k_setSR(uint16_tr newsr) if (V_regs.t1 != 0) { NeedToGetOut(); } else { - /* V_regs.TracePending = falseblnr; */ + /* V_regs.TracePending = false; */ } m68k_setCR(newsr); } -LOCALPROC my_reg_call ExceptionTo(CPTR newpc +LOCALPROC reg_call ExceptionTo(CPTR newpc #if Use68020 , int nr #endif ) { - uint16_tr saveSR = m68k_getSR(); + uint16_t saveSR = m68k_getSR(); if (0 == V_regs.s) { V_regs.usp = m68k_areg(7); @@ -4634,10 +4634,10 @@ LOCALPROC my_reg_call ExceptionTo(CPTR newpc V_regs.t0 = 0; V_regs.m = 0; #endif - V_regs.TracePending = falseblnr; + V_regs.TracePending = false; } -LOCALPROC my_reg_call Exception(int nr) +LOCALPROC reg_call Exception(int nr) { ExceptionTo(get_long(4 * nr #if Use68020 @@ -4657,7 +4657,7 @@ LOCALIPROC DoCodeA(void) Exception(0xA); } -LOCALFUNC uint16_tr nextiword_nm(void) +LOCALFUNC uint16_t nextiword_nm(void) /* NOT sign extended */ { return nextiword(); @@ -4719,7 +4719,7 @@ LOCALIPROC DoCodeMOVEMApRL(void) *dstp = p; } -LOCALPROC my_reg_call SetCCRforAddX(uint32_t dstvalue, uint32_t srcvalue, +LOCALPROC reg_call SetCCRforAddX(uint32_t dstvalue, uint32_t srcvalue, uint32_t result) { ZFLG &= Bool2Bit(result == 0); @@ -4801,7 +4801,7 @@ LOCALIPROC DoCodeAddXL(void) } } -LOCALPROC my_reg_call SetCCRforSubX(uint32_t dstvalue, uint32_t srcvalue, +LOCALPROC reg_call SetCCRforSubX(uint32_t dstvalue, uint32_t srcvalue, uint32_t result) { ZFLG &= Bool2Bit(result == 0); @@ -4882,7 +4882,7 @@ LOCALIPROC DoCodeSubXL(void) } } -LOCALPROC my_reg_call DoCodeNullShift(uint32_t dstvalue) +LOCALPROC reg_call DoCodeNullShift(uint32_t dstvalue) { V_regs.LazyFlagKind = kLazyFlagsTstL; V_regs.LazyFlagArgDst = dstvalue; @@ -4905,7 +4905,7 @@ LOCALPROC DoCodeOverAsl(uint32_t dstvalue) ArgSetDstValue(0); } -LOCALPROC my_reg_call DoCodeMaxAsr(uint32_t dstvalue) +LOCALPROC reg_call DoCodeMaxAsr(uint32_t dstvalue) { XFLG = CFLG = dstvalue & 1; VFLG = Bool2Bit(0 != dstvalue); @@ -5158,7 +5158,7 @@ LOCALIPROC DoCodeAsrL(void) } } -LOCALPROC my_reg_call DoCodeMaxLslShift(uint32_t dstvalue) +LOCALPROC reg_call DoCodeMaxLslShift(uint32_t dstvalue) { XFLG = CFLG = dstvalue & 1; ZFLG = 1; @@ -5370,7 +5370,7 @@ LOCALFUNC uint32_t DecodeGetSrcSetDstValueDfltFlags_nm(void) return DecodeGetSrcSetDstValue(); } -LOCALPROC my_reg_call DoCodeNullXShift(uint32_t dstvalue) +LOCALPROC reg_call DoCodeNullXShift(uint32_t dstvalue) { CFLG = XFLG; @@ -6027,7 +6027,7 @@ LOCALIPROC DoCodeNegL(void) ArgSetDstValue(result); } -LOCALPROC my_reg_call SetCCRforNegX(uint32_t dstvalue, uint32_t result) +LOCALPROC reg_call SetCCRforNegX(uint32_t dstvalue, uint32_t result) { ZFLG &= Bool2Bit(result == 0); @@ -6951,13 +6951,13 @@ LOCALIPROC DoCodeBraL(void) { /* Bra 0110ccccnnnnnnnn */ int32_t offset = ((int32_t)(uint32_t)nextilong()) - 4; - ui3p s = V_pc_p + offset; + uint8_t * s = V_pc_p + offset; V_pc_p = s; #if USE_PCLIMIT - if (my_cond_rare(s >= V_pc_pHi) - || my_cond_rare(s < V_regs.pc_pLo)) + if (cond_rare(s >= V_pc_pHi) + || cond_rare(s < V_regs.pc_pLo)) { Recalc_PC_Block(); } @@ -6971,7 +6971,7 @@ LOCALPROC SkipiLong(void) V_pc_p += 4; #if USE_PCLIMIT - if (my_cond_rare(V_pc_p >= V_pc_pHi)) { + if (cond_rare(V_pc_p >= V_pc_pHi)) { Recalc_PC_Block(); } #endif @@ -6990,15 +6990,15 @@ LOCALIPROC DoCodeBccL(void) LOCALIPROC DoCodeBsrL(void) { int32_t offset = ((int32_t)(uint32_t)nextilong()) - 4; - ui3p s = V_pc_p + offset; + uint8_t * s = V_pc_p + offset; m68k_areg(7) -= 4; put_long(m68k_areg(7), m68k_getpc()); V_pc_p = s; #if USE_PCLIMIT - if (my_cond_rare(s >= V_pc_pHi) - || my_cond_rare(s < V_regs.pc_pLo)) + if (cond_rare(s >= V_pc_pHi) + || cond_rare(s < V_regs.pc_pLo)) { Recalc_PC_Block(); } @@ -7302,14 +7302,14 @@ LOCALPROC Ui6r_Negate(uint64_t0 *v) #endif #if Use68020 -LOCALFUNC blnr my_reg_call Ui6r_IsZero(uint64_t0 *v) +LOCALFUNC bool reg_call Ui6r_IsZero(uint64_t0 *v) { return (v->hi == 0) && (v->lo == 0); } #endif #if Use68020 -LOCALFUNC blnr my_reg_call Ui6r_IsNeg(uint64_t0 *v) +LOCALFUNC bool reg_call Ui6r_IsNeg(uint64_t0 *v) { return ((int32_t)v->hi) < 0; } @@ -7336,7 +7336,7 @@ LOCALPROC mul_unsigned(uint32_t src1, uint32_t src2, uint64_t0 *dst) #endif #if Use68020 -LOCALFUNC blnr div_unsigned(uint64_t0 *src, uint32_t div, +LOCALFUNC bool div_unsigned(uint64_t0 *src, uint32_t div, uint32_t *quot, uint32_t *rem) { int i; @@ -7346,7 +7346,7 @@ LOCALFUNC blnr div_unsigned(uint64_t0 *src, uint32_t div, uint32_t src_lo = src->lo; if (div <= src_hi) { - return trueblnr; + return true; } for (i = 0 ; i < 32 ; i++) { cbit = src_hi & 0x80000000ul; @@ -7363,7 +7363,7 @@ LOCALFUNC blnr div_unsigned(uint64_t0 *src, uint32_t div, } *quot = q; *rem = src_hi; - return falseblnr; + return false; } #endif @@ -7383,9 +7383,9 @@ LOCALIPROC DoCodeMulL(void) int32_t src1 = (int32_t)srcvalue; int32_t src2 = (int32_t)dstvalue; - blnr s1 = src1 < 0; - blnr s2 = src2 < 0; - blnr sr = s1 != s2; + bool s1 = src1 < 0; + bool s2 = src2 < 0; + bool sr = s1 != s2; /* ReportAbnormal("MULS.L"); */ /* used by Sys 7.5.5 boot extensions */ @@ -7467,9 +7467,9 @@ LOCALIPROC DoCodeDivL(void) } if (0 != (extra & 0x0800)) { /* signed variant */ - blnr sr; - blnr s2; - blnr s1 = ((int32_t)src < 0); + bool sr; + bool s2; + bool s1 = ((int32_t)src < 0); v2.lo = (int32_t)m68k_dreg(rDq); if (extra & 0x0400) { @@ -7968,9 +7968,9 @@ LOCALIPROC DoBitField(void) #endif #if EmMMU | EmFPU -LOCALFUNC blnr DecodeModeRegister(uint32_t sz) +LOCALFUNC bool DecodeModeRegister(uint32_t sz) { - blnr IsOk; + bool IsOk; uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat; uint16_t themode = (Dat >> 3) & 7; uint16_t thereg = Dat & 7; @@ -7979,17 +7979,17 @@ LOCALFUNC blnr DecodeModeRegister(uint32_t sz) case 0 : V_regs.ArgKind = AKRegister; V_regs.ArgAddr.rga = &V_regs.regs[thereg]; - IsOk = trueblnr; + IsOk = true; break; case 1 : V_regs.ArgKind = AKRegister; V_regs.ArgAddr.rga = &V_regs.regs[thereg + 8]; - IsOk = trueblnr; + IsOk = true; break; case 2 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = m68k_areg(thereg); - IsOk = trueblnr; + IsOk = true; break; case 3 : V_regs.ArgKind = AKMemory; @@ -7999,7 +7999,7 @@ LOCALFUNC blnr DecodeModeRegister(uint32_t sz) } else { m68k_areg(thereg) += sz; } - IsOk = trueblnr; + IsOk = true; break; case 4 : V_regs.ArgKind = AKMemory; @@ -8009,41 +8009,41 @@ LOCALFUNC blnr DecodeModeRegister(uint32_t sz) m68k_areg(thereg) -= sz; } V_regs.ArgAddr.mem = m68k_areg(thereg); - IsOk = trueblnr; + IsOk = true; break; case 5 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = m68k_areg(thereg) + nextiSWord(); - IsOk = trueblnr; + IsOk = true; break; case 6 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = get_disp_ea(m68k_areg(thereg)); - IsOk = trueblnr; + IsOk = true; break; case 7 : switch (thereg) { case 0 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = nextiSWord(); - IsOk = trueblnr; + IsOk = true; break; case 1 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = nextilong(); - IsOk = trueblnr; + IsOk = true; break; case 2 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = m68k_getpc(); V_regs.ArgAddr.mem += nextiSWord(); - IsOk = trueblnr; + IsOk = true; break; case 3 : V_regs.ArgKind = AKMemory; V_regs.ArgAddr.mem = get_disp_ea(m68k_getpc()); - IsOk = trueblnr; + IsOk = true; break; case 4 : V_regs.ArgKind = AKMemory; @@ -8052,15 +8052,15 @@ LOCALFUNC blnr DecodeModeRegister(uint32_t sz) ++V_regs.ArgAddr.mem; } m68k_setpc(V_regs.ArgAddr.mem + sz); - IsOk = trueblnr; + IsOk = true; break; default: - IsOk = falseblnr; + IsOk = false; break; } break; default: - IsOk = falseblnr; + IsOk = false; break; } @@ -8214,21 +8214,21 @@ LOCALPROC Em_Swap(void) { #ifdef r_pc_p { - ui3p t = g_pc_p; + uint8_t * t = g_pc_p; g_pc_p = regs.pc_p; regs.pc_p = t; } #endif #ifdef r_MaxCyclesToGo { - int32_tr t = g_MaxCyclesToGo; + int32_t t = g_MaxCyclesToGo; g_MaxCyclesToGo = regs.MaxCyclesToGo; regs.MaxCyclesToGo = t; } #endif #ifdef r_pc_pHi { - ui3p t = g_pc_pHi; + uint8_t * t = g_pc_pHi; g_pc_pHi = regs.pc_pHi; regs.pc_pHi = t; } @@ -8256,9 +8256,9 @@ LOCALPROC Em_Swap(void) #endif #if HaveGlbReg -LOCALFUNC blnr LocalMemAccessNtfy(ATTep pT) +LOCALFUNC bool LocalMemAccessNtfy(ATTep pT) { - blnr v; + bool v; Em_Exit(); v = MemAccessNtfy(pT); @@ -8272,7 +8272,7 @@ LOCALFUNC blnr LocalMemAccessNtfy(ATTep pT) #if HaveGlbReg LOCALFUNC uint32_t LocalMMDV_Access(ATTep p, uint32_t Data, - blnr WriteMem, blnr ByteSize, CPTR addr) + bool WriteMem, bool ByteSize, CPTR addr) { uint32_t v; @@ -8332,10 +8332,10 @@ LOCALPROC SetUpMATC( CurMATC->usebase = p->usebase; } -LOCALFUNC uint32_t my_reg_call get_byte_ext(CPTR addr) +LOCALFUNC uint32_t reg_call get_byte_ext(CPTR addr) { ATTep p; - ui3p m; + uint8_t * m; uint32_t AccFlags; uint32_t Data; @@ -8349,7 +8349,7 @@ Label_Retry: Data = *m; } else if (0 != (AccFlags & kATTA_mmdvmask)) { - Data = LocalMMDV_Access(p, 0, falseblnr, trueblnr, addr); + Data = LocalMMDV_Access(p, 0, false, true, addr); } else if (0 != (AccFlags & kATTA_ntfymask)) { if (LocalMemAccessNtfy(p)) { goto Label_Retry; @@ -8363,10 +8363,10 @@ Label_Retry: return uint32_t_FromSByte(Data); } -LOCALPROC my_reg_call put_byte_ext(CPTR addr, uint32_t b) +LOCALPROC reg_call put_byte_ext(CPTR addr, uint32_t b) { ATTep p; - ui3p m; + uint8_t * m; uint32_t AccFlags; Label_Retry: @@ -8379,7 +8379,7 @@ Label_Retry: *m = b; } else if (0 != (AccFlags & kATTA_mmdvmask)) { (void) LocalMMDV_Access(p, b & 0x00FF, - trueblnr, trueblnr, addr); + true, true, addr); } else if (0 != (AccFlags & kATTA_ntfymask)) { if (LocalMemAccessNtfy(p)) { goto Label_Retry; @@ -8391,7 +8391,7 @@ Label_Retry: } } -LOCALFUNC uint32_t my_reg_call get_word_ext(CPTR addr) +LOCALFUNC uint32_t reg_call get_word_ext(CPTR addr) { uint32_t Data; @@ -8402,7 +8402,7 @@ LOCALFUNC uint32_t my_reg_call get_word_ext(CPTR addr) | (lo & 0x000000FF); } else { ATTep p; - ui3p m; + uint8_t * m; uint32_t AccFlags; Label_Retry: @@ -8415,7 +8415,7 @@ Label_Retry: m = p->usebase + (addr & p->usemask); Data = do_get_mem_word(m); } else if (0 != (AccFlags & kATTA_mmdvmask)) { - Data = LocalMMDV_Access(p, 0, falseblnr, falseblnr, addr); + Data = LocalMMDV_Access(p, 0, false, false, addr); } else if (0 != (AccFlags & kATTA_ntfymask)) { if (LocalMemAccessNtfy(p)) { goto Label_Retry; @@ -8430,14 +8430,14 @@ Label_Retry: return uint32_t_FromSWord(Data); } -LOCALPROC my_reg_call put_word_ext(CPTR addr, uint32_t w) +LOCALPROC reg_call put_word_ext(CPTR addr, uint32_t w) { if (0 != (addr & 0x01)) { put_byte(addr, w >> 8); put_byte(addr + 1, w); } else { ATTep p; - ui3p m; + uint8_t * m; uint32_t AccFlags; Label_Retry: @@ -8451,7 +8451,7 @@ Label_Retry: do_put_mem_word(m, w); } else if (0 != (AccFlags & kATTA_mmdvmask)) { (void) LocalMMDV_Access(p, w & 0x0000FFFF, - trueblnr, falseblnr, addr); + true, false, addr); } else if (0 != (AccFlags & kATTA_ntfymask)) { if (LocalMemAccessNtfy(p)) { goto Label_Retry; @@ -8464,7 +8464,7 @@ Label_Retry: } } -LOCALFUNC uint32_t my_reg_call get_long_misaligned_ext(CPTR addr) +LOCALFUNC uint32_t reg_call get_long_misaligned_ext(CPTR addr) { uint32_t hi = get_word(addr); uint32_t lo = get_word(addr + 2); @@ -8474,14 +8474,14 @@ LOCALFUNC uint32_t my_reg_call get_long_misaligned_ext(CPTR addr) return uint32_t_FromSLong(Data); } -LOCALPROC my_reg_call put_long_misaligned_ext(CPTR addr, uint32_t l) +LOCALPROC reg_call put_long_misaligned_ext(CPTR addr, uint32_t l) { put_word(addr, l >> 16); put_word(addr + 2, l); } #if FasterAlignedL -LOCALFUNC uint32_t my_reg_call get_long_ext(CPTR addr) +LOCALFUNC uint32_t reg_call get_long_ext(CPTR addr) { uint32_t Data; @@ -8492,7 +8492,7 @@ LOCALFUNC uint32_t my_reg_call get_long_ext(CPTR addr) | (lo & 0x0000FFFF); } else { ATTep p; - ui3p m; + uint8_t * m; uint32_t AccFlags; Label_Retry: @@ -8506,9 +8506,9 @@ Label_Retry: Data = do_get_mem_long(m); } else if (0 != (AccFlags & kATTA_mmdvmask)) { uint32_t hi = LocalMMDV_Access(p, 0, - falseblnr, falseblnr, addr); + false, false, addr); uint32_t lo = LocalMMDV_Access(p, 0, - falseblnr, falseblnr, addr + 2); + false, false, addr + 2); Data = ((hi << 16) & 0xFFFF0000) | (lo & 0x0000FFFF); } else if (0 != (AccFlags & kATTA_ntfymask)) { @@ -8527,14 +8527,14 @@ Label_Retry: #endif #if FasterAlignedL -LOCALPROC my_reg_call put_long_ext(CPTR addr, uint32_t l) +LOCALPROC reg_call put_long_ext(CPTR addr, uint32_t l) { if (0 != (addr & 0x03)) { put_word(addr, l >> 16); put_word(addr + 2, l); } else { ATTep p; - ui3p m; + uint8_t * m; uint32_t AccFlags; Label_Retry: @@ -8548,9 +8548,9 @@ Label_Retry: do_put_mem_long(m, l); } else if (0 != (AccFlags & kATTA_mmdvmask)) { (void) LocalMMDV_Access(p, (l >> 16) & 0x0000FFFF, - trueblnr, falseblnr, addr); + true, false, addr); (void) LocalMMDV_Access(p, l & 0x0000FFFF, - trueblnr, falseblnr, addr + 2); + true, false, addr + 2); } else if (0 != (AccFlags & kATTA_ntfymask)) { if (LocalMemAccessNtfy(p)) { goto Label_Retry; @@ -8571,7 +8571,7 @@ LOCALPROC Recalc_PC_Block(void) Label_Retry: p = LocalFindATTel(curpc); - if (my_cond_rare(0 == (p->Access & kATTA_readreadymask))) { + if (cond_rare(0 == (p->Access & kATTA_readreadymask))) { if (0 != (p->Access & kATTA_ntfymask)) { if (LocalMemAccessNtfy(p)) { goto Label_Retry; @@ -8598,7 +8598,7 @@ Label_Retry: } } -LOCALFUNC uint32_t my_reg_call Recalc_PC_BlockReturnUi5r(uint32_t v) +LOCALFUNC uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v) { /* Used to prevent compiler from saving @@ -8641,7 +8641,7 @@ LOCALPROC DoCheckExternalInterruptPending(void) LOCALPROC do_trace(void) { - V_regs.TracePending = trueblnr; + V_regs.TracePending = true; NeedToGetOut(); } @@ -8664,7 +8664,7 @@ GLOBALPROC m68k_go_nCycles(uint32_t n) Exception(9); } if (V_regs.ExternalInterruptPending) { - V_regs.ExternalInterruptPending = falseblnr; + V_regs.ExternalInterruptPending = false; DoCheckExternalInterruptPending(); } if (V_regs.t1 != 0) { @@ -8860,15 +8860,15 @@ GLOBALPROC m68k_reset(void) V_MaxCyclesToGo = 0; V_regs.MoreCyclesToGo = 0; V_regs.ResidualCycles = 0; - V_pc_p = (ui3p)nullpr; - V_pc_pHi = (ui3p)nullpr; - V_regs.pc_pLo = (ui3p)nullpr; + V_pc_p = (uint8_t *)nullpr; + V_pc_pHi = (uint8_t *)nullpr; + V_regs.pc_pLo = (uint8_t *)nullpr; do_put_mem_word(V_regs.fakeword, 0x4AFC); /* illegal instruction opcode */ #if 0 - V_regs.ResetPending = trueblnr; + V_regs.ResetPending = true; NeedToGetOut(); #else /* Sets the MC68000 reset jump vector... */ @@ -8888,8 +8888,8 @@ GLOBALPROC m68k_reset(void) V_regs.LazyFlagKind = kLazyFlagsDefault; V_regs.LazyXFlagKind = kLazyFlagsDefault; - V_regs.ExternalInterruptPending = falseblnr; - V_regs.TracePending = falseblnr; + V_regs.ExternalInterruptPending = false; + V_regs.TracePending = false; V_regs.intmask = 7; #if Use68020 @@ -8907,8 +8907,8 @@ GLOBALPROC m68k_reset(void) #if SmallGlobals GLOBALPROC MINEM68K_ReserveAlloc(void) { - ReserveAllocOneBlock((ui3p *)®s.disp_table, - disp_table_sz * 8, 6, falseblnr); + ReserveAllocOneBlock((uint8_t * *)®s.disp_table, + disp_table_sz * 8, 6, false); } #endif diff --git a/src/PBUFSTDC.h b/src/PBUFSTDC.h index fd6baa9..8d3b9fa 100644 --- a/src/PBUFSTDC.h +++ b/src/PBUFSTDC.h @@ -97,9 +97,9 @@ LOCALPROC UnInitPbufs(void) #endif #if IncludePbufs -LOCALFUNC ui3p PbufLock(tPbuf i) +LOCALFUNC uint8_t * PbufLock(tPbuf i) { - return (ui3p)PbufDat[i]; + return (uint8_t *)PbufDat[i]; } #endif @@ -108,10 +108,10 @@ LOCALFUNC ui3p PbufLock(tPbuf i) #endif #if IncludePbufs -GLOBALOSGLUPROC PbufTransfer(ui3p Buffer, - tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite) +GLOBALOSGLUPROC PbufTransfer(uint8_t * Buffer, + tPbuf i, uint32_t offset, uint32_t count, bool IsWrite) { - void *p = ((ui3p)PbufDat[i]) + offset; + void *p = ((uint8_t *)PbufDat[i]) + offset; if (IsWrite) { (void) memcpy(p, Buffer, count); } else { diff --git a/src/PMUEMDEV.c b/src/PMUEMDEV.c index d4d08b4..9176166 100644 --- a/src/PMUEMDEV.c +++ b/src/PMUEMDEV.c @@ -45,7 +45,7 @@ enum { #define PMU_BuffSz 8 LOCALVAR uint8_t PMU_BuffA[PMU_BuffSz]; -LOCALVAR ui3p PMU_p; +LOCALVAR uint8_t * PMU_p; LOCALVAR uint8_t PMU_rem; LOCALVAR uint8_t PMU_i; @@ -313,7 +313,7 @@ LOCALPROC SetPMUbus(uint8_t v) VIA1_iA7 = v & 0x01; } -LOCALVAR blnr PMU_Sending = falseblnr; +LOCALVAR bool PMU_Sending = false; LOCALPROC PmuCheckCommandCompletion(void) { @@ -329,7 +329,7 @@ LOCALPROC PmuCheckCommandCompletion(void) PMUState = kPMUStateSendLength; } PMU_i = 0; - PMU_Sending = trueblnr; + PMU_Sending = true; ICT_add(kICT_PMU_Task, 20400UL * kCycleScale / 64 * ClockMult); } @@ -339,7 +339,7 @@ LOCALPROC PmuCheckCommandCompletion(void) GLOBALPROC PmuToReady_ChangeNtfy(void) { if (PMU_Sending) { - PMU_Sending = falseblnr; + PMU_Sending = false; ReportAbnormalID(0x0E0C, "PmuToReady_ChangeNtfy while PMU_Sending"); PmuFromReady = 0; @@ -398,7 +398,7 @@ GLOBALPROC PmuToReady_ChangeNtfy(void) } else { PMU_SendNext = PMU_BuffL; PMUState = kPMUStateSendBuffer; - PMU_Sending = trueblnr; + PMU_Sending = true; ICT_add(kICT_PMU_Task, 20400UL * kCycleScale / 64 * ClockMult); } @@ -423,7 +423,7 @@ GLOBALPROC PmuToReady_ChangeNtfy(void) PMU_SendNext = *PMU_p++; --PMU_rem; ++PMU_i; - PMU_Sending = trueblnr; + PMU_Sending = true; ICT_add(kICT_PMU_Task, 20400UL * kCycleScale / 64 * ClockMult); } @@ -435,7 +435,7 @@ GLOBALPROC PmuToReady_ChangeNtfy(void) GLOBALPROC PMU_DoTask(void) { if (PMU_Sending) { - PMU_Sending = falseblnr; + PMU_Sending = false; SetPMUbus(PMU_SendNext); PmuFromReady = 0; } diff --git a/src/PROGMAIN.c b/src/PROGMAIN.c index 26a14d0..9a46e88 100644 --- a/src/PROGMAIN.c +++ b/src/PROGMAIN.c @@ -90,19 +90,19 @@ LOCALPROC DoMacReset(void) LOCALPROC InterruptReset_Update(void) { - SetInterruptButton(falseblnr); + SetInterruptButton(false); /* in case has been set. so only stays set for 60th of a second. */ if (WantMacInterrupt) { - SetInterruptButton(trueblnr); - WantMacInterrupt = falseblnr; + SetInterruptButton(true); + WantMacInterrupt = false; } if (WantMacReset) { DoMacReset(); - WantMacReset = falseblnr; + WantMacReset = false; } } @@ -222,20 +222,20 @@ LOCALPROC ExtraTimeEndNotify(void) GLOBALPROC EmulationReserveAlloc(void) { ReserveAllocOneBlock(&RAM, - kRAM_Size + RAMSafetyMarginFudge, 5, falseblnr); + kRAM_Size + RAMSafetyMarginFudge, 5, false); #if EmVidCard - ReserveAllocOneBlock(&VidROM, kVidROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&VidROM, kVidROM_Size, 5, false); #endif #if IncludeVidMem ReserveAllocOneBlock(&VidMem, - kVidMemRAM_Size + RAMSafetyMarginFudge, 5, trueblnr); + kVidMemRAM_Size + RAMSafetyMarginFudge, 5, true); #endif #if SmallGlobals MINEM68K_ReserveAlloc(); #endif } -LOCALFUNC blnr InitEmulation(void) +LOCALFUNC bool InitEmulation(void) { #if EmRTC if (RTC_Init()) @@ -247,9 +247,9 @@ LOCALFUNC blnr InitEmulation(void) if (AddrSpac_Init()) { EmulatedHardwareZap(); - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC ICT_DoTask(int taskid) @@ -425,9 +425,9 @@ LOCALPROC DoEmulateOneTick(void) } } -LOCALFUNC blnr MoreSubTicksToDo(void) +LOCALFUNC bool MoreSubTicksToDo(void) { - blnr v = falseblnr; + bool v = false; if (ExtraTimeNotOver() && (ExtraSubTicksToDo > 0)) { #if EnableAutoSlow @@ -439,7 +439,7 @@ LOCALFUNC blnr MoreSubTicksToDo(void) } else #endif { - v = trueblnr; + v = true; } } @@ -524,7 +524,7 @@ LOCALPROC RunEmulatedTicksToTrueTime(void) if (ExtraTimeNotOver() && (--n > 0)) { /* lagging, catch up */ - EmVideoDisable = trueblnr; + EmVideoDisable = true; do { DoEmulateOneTick(); @@ -532,7 +532,7 @@ LOCALPROC RunEmulatedTicksToTrueTime(void) } while (ExtraTimeNotOver() && (--n > 0)); - EmVideoDisable = falseblnr; + EmVideoDisable = false; } EmLagTime = n; diff --git a/src/ROMEMDEV.c b/src/ROMEMDEV.c index 03da006..a199aa9 100644 --- a/src/ROMEMDEV.c +++ b/src/ROMEMDEV.c @@ -53,7 +53,7 @@ INCBIN(SonyDriver, "PATCHES/SONY.bin"); #endif #if UseSonyPatch -LOCALVAR const uint8_t my_disk_icon[] = { +LOCALVAR const uint8_t disk_icon[] = { 0x7F, 0xFF, 0xFF, 0xF0, 0x81, 0x00, 0x01, 0x08, 0x81, 0x00, 0x71, 0x04, @@ -146,7 +146,7 @@ LOCALVAR const uint8_t my_disk_icon[] = { #if UseSonyPatch LOCALPROC Sony_Install(void) { - ui3p pto = Sony_DriverBase + ROM; + uint8_t * pto = Sony_DriverBase + ROM; MoveBytes((anyp)gSonyDriverData, (anyp)pto, gSonyDriverSize); #if CurEmMd <= kEmMd_Twiggy @@ -168,13 +168,13 @@ LOCALPROC Sony_Install(void) do_put_mem_long(pto, kExtn_Block_Base); /* pokeaddr */ pto += 4; - my_disk_icon_addr = (pto - ROM) + kROM_Base; - MoveBytes((anyp)my_disk_icon, (anyp)pto, sizeof(my_disk_icon)); - pto += sizeof(my_disk_icon); + disk_icon_addr = (pto - ROM) + kROM_Base; + MoveBytes((anyp)disk_icon, (anyp)pto, sizeof(disk_icon)); + pto += sizeof(disk_icon); #if UseLargeScreenHack { - ui3p patchp = pto; + uint8_t * patchp = pto; #include "SCRNHACK.h" } @@ -200,8 +200,8 @@ LOCALPROC Sony_Install(void) LOCALPROC ROMscrambleForMTB(void) { int32_t j; - ui3p p = ROM; - ui3p p2 = ROM + (1 << ln2mtb); + uint8_t * p = ROM; + uint8_t * p2 = ROM + (1 << ln2mtb); for (j = kROM_Size / (1 << ln2mtb) / 2; --j >= 0; ) { int32_t i; @@ -219,7 +219,7 @@ LOCALPROC ROMscrambleForMTB(void) } #endif -GLOBALFUNC blnr ROM_Init(void) +GLOBALFUNC bool ROM_Init(void) { #if DisableRomCheck @@ -273,5 +273,5 @@ GLOBALFUNC blnr ROM_Init(void) ROMscrambleForMTB(); #endif - return trueblnr; + return true; } diff --git a/src/ROMEMDEV.h b/src/ROMEMDEV.h index 181f72d..f8e9df8 100644 --- a/src/ROMEMDEV.h +++ b/src/ROMEMDEV.h @@ -20,4 +20,4 @@ #define ROMEMDEV_H #endif -EXPORTFUNC blnr ROM_Init(void); +EXPORTFUNC bool ROM_Init(void); diff --git a/src/RTCEMDEV.c b/src/RTCEMDEV.c index 49f703e..b2066d5 100644 --- a/src/RTCEMDEV.c +++ b/src/RTCEMDEV.c @@ -145,14 +145,14 @@ GLOBALPROC DumpRTC(void) } #endif -GLOBALFUNC blnr RTC_Init(void) +GLOBALFUNC bool RTC_Init(void) { int Counter; uint32_t secs; RTC.Mode = RTC.ShiftData = RTC.Counter = 0; RTC.DataOut = RTC.DataNextOut = 0; - RTC.WrProtect = falseblnr; + RTC.WrProtect = false; secs = CurMacDateInSeconds; LastRealDate = secs; @@ -301,7 +301,7 @@ GLOBALFUNC blnr RTC_Init(void) #endif /* RTCinitPRAM */ - return trueblnr; + return true; } #ifdef RTC_OneSecond_PulseNtfy @@ -331,7 +331,7 @@ GLOBALPROC RTC_Interrupt(void) } } -LOCALFUNC uint8_t RTC_Access_PRAM_Reg(uint8_t Data, blnr WriteReg, uint8_t t) +LOCALFUNC uint8_t RTC_Access_PRAM_Reg(uint8_t Data, bool WriteReg, uint8_t t) { if (WriteReg) { if (! RTC.WrProtect) { @@ -346,7 +346,7 @@ LOCALFUNC uint8_t RTC_Access_PRAM_Reg(uint8_t Data, blnr WriteReg, uint8_t t) return Data; } -LOCALFUNC uint8_t RTC_Access_Reg(uint8_t Data, blnr WriteReg, uint8_t TheCmd) +LOCALFUNC uint8_t RTC_Access_Reg(uint8_t Data, bool WriteReg, uint8_t TheCmd) { uint8_t t = (TheCmd & 0x7C) >> 2; if (t < 8) { @@ -398,7 +398,7 @@ LOCALPROC RTC_DoCmd(void) { if ((RTC.ShiftData & 0x80) != 0x00) { /* Read Command */ RTC.ShiftData = - RTC_Access_Reg(0, falseblnr, RTC.ShiftData); + RTC_Access_Reg(0, false, RTC.ShiftData); RTC.DataNextOut = 1; } else { /* Write Command */ RTC.SavedCmd = RTC.ShiftData; @@ -408,7 +408,7 @@ LOCALPROC RTC_DoCmd(void) break; case 1: /* This Byte is data for RTC Write */ (void) RTC_Access_Reg(RTC.ShiftData, - trueblnr, RTC.SavedCmd); + true, RTC.SavedCmd); RTC.Mode = 0; break; #if HaveXPRAM @@ -435,7 +435,7 @@ LOCALPROC RTC_DoCmd(void) break; case 3: /* This Byte is data for an Extended RTC Write */ (void) RTC_Access_PRAM_Reg(RTC.ShiftData, - trueblnr, RTC.Sector); + true, RTC.Sector); RTC.Mode = 0; break; #endif diff --git a/src/RTCEMDEV.h b/src/RTCEMDEV.h index cb98b27..6818c38 100644 --- a/src/RTCEMDEV.h +++ b/src/RTCEMDEV.h @@ -20,7 +20,7 @@ #define RTCEMDEV_H #endif -EXPORTFUNC blnr RTC_Init(void); +EXPORTFUNC bool RTC_Init(void); EXPORTPROC RTC_Interrupt(void); EXPORTPROC RTCunEnabled_ChangeNtfy(void); diff --git a/src/SCCEMDEV.c b/src/SCCEMDEV.c index b1723df..b86fbd3 100644 --- a/src/SCCEMDEV.c +++ b/src/SCCEMDEV.c @@ -76,12 +76,12 @@ #define SCC_B_Ext 1 /* External/Status Change */ typedef struct { - blnr TxEnable; - blnr RxEnable; - blnr TxIE; /* Transmit Interrupt Enable */ - blnr TxUnderrun; - blnr SyncHunt; - blnr TxIP; /* Transmit Interrupt Pending */ + bool TxEnable; + bool RxEnable; + bool TxIE; /* Transmit Interrupt Enable */ + bool TxUnderrun; + bool SyncHunt; + bool TxIP; /* Transmit Interrupt Pending */ #if EmLocalTalk uint8_t RxBuff; #endif @@ -91,49 +91,49 @@ typedef struct { though should behave as went false for an instant when write to transmit buffer */ - blnr TxBufferEmpty; + bool TxBufferEmpty; #endif #if EmLocalTalk || SCC_TrackMore - blnr ExtIE; + bool ExtIE; #endif #if SCC_TrackMore - blnr WaitRqstEnbl; + bool WaitRqstEnbl; #endif #if SCC_TrackMore - blnr WaitRqstSlct; + bool WaitRqstSlct; #endif #if SCC_TrackMore - blnr WaitRqstRT; + bool WaitRqstRT; #endif #if SCC_TrackMore - blnr PrtySpclCond; + bool PrtySpclCond; #endif #if SCC_TrackMore - blnr PrtyEnable; + bool PrtyEnable; #endif #if SCC_TrackMore - blnr PrtyEven; + bool PrtyEven; #endif #if SCC_TrackMore - blnr RxCRCEnbl; + bool RxCRCEnbl; #endif #if SCC_TrackMore - blnr TxCRCEnbl; + bool TxCRCEnbl; #endif #if SCC_TrackMore - blnr RTSctrl; + bool RTSctrl; #endif #if SCC_TrackMore - blnr SndBrkCtrl; + bool SndBrkCtrl; #endif #if SCC_TrackMore - blnr DTRctrl; + bool DTRctrl; #endif #if EmLocalTalk || SCC_TrackMore - blnr AddrSrchMd; + bool AddrSrchMd; #endif #if SCC_TrackMore - blnr SyncChrLdInhb; + bool SyncChrLdInhb; #endif #if SCC_TrackMore uint8_t ClockRate; @@ -160,7 +160,7 @@ typedef struct { uint8_t RxIntMode; #endif #if EmLocalTalk || SCC_TrackMore - blnr FirstChar; + bool FirstChar; #endif #if EmLocalTalk || SCC_TrackMore uint8_t SyncMode; @@ -169,13 +169,13 @@ typedef struct { uint8_t StopBits; #endif #if 0 /* AllSent always true */ - blnr AllSent; + bool AllSent; #endif #if 0 /* CTS always false */ - blnr CTS; /* input pin, unattached, so false? */ + bool CTS; /* input pin, unattached, so false? */ #endif #if 0 /* DCD always false */ - blnr DCD; /* Data Carrier Detect */ + bool DCD; /* Data Carrier Detect */ /* input pin for mouse interrupts. but since not emulating mouse this way, leave false. @@ -183,44 +183,44 @@ typedef struct { #endif #if EmLocalTalk /* otherwise RxChrAvail always false */ - blnr RxChrAvail; + bool RxChrAvail; #endif #if 0 /* RxOverrun always false */ - blnr RxOverrun; + bool RxOverrun; #endif #if 0 /* CRCFramingErr always false */ - blnr CRCFramingErr; + bool CRCFramingErr; #endif #if EmLocalTalk /* otherwise EndOfFrame always false */ - blnr EndOfFrame; + bool EndOfFrame; #endif #if 0 /* ParityErr always false */ - blnr ParityErr; + bool ParityErr; #endif #if 0 /* ZeroCount always false */ - blnr ZeroCount; + bool ZeroCount; #endif #if 0 /* BreakAbort always false */ - blnr BreakAbort; + bool BreakAbort; #endif #if 0 /* SyncHuntIE usually false */ - blnr SyncHuntIE; + bool SyncHuntIE; #endif #if SCC_TrackMore /* don't care about CTS_IE */ - blnr CTS_IE; + bool CTS_IE; #endif #if SCC_TrackMore - blnr CRCPreset; + bool CRCPreset; #endif #if SCC_TrackMore - blnr BRGEnbl; + bool BRGEnbl; #endif #if 0 /* don't care about DCD_IE, always true */ - blnr DCD_IE; + bool DCD_IE; #endif #if SCC_TrackMore /* don't care about BreakAbortIE */ - blnr BreakAbortIE; + bool BreakAbortIE; #endif #if SCC_TrackMore /* don't care about Baud */ uint8_t BaudLo; @@ -233,12 +233,12 @@ typedef struct { int SCC_Interrupt_Type; int PointerBits; uint8_t InterruptVector; - blnr MIE; /* master interrupt enable */ + bool MIE; /* master interrupt enable */ #if SCC_TrackMore - blnr NoVectorSlct; + bool NoVectorSlct; #endif #if 0 /* StatusHiLo always false */ - blnr StatusHiLo; + bool StatusHiLo; #endif } SCC_Ty; @@ -254,7 +254,7 @@ static int rx_data_offset = 0; /* when data pending, this is used */ #endif -EXPORTFUNC blnr SCC_InterruptsEnabled(void) +EXPORTFUNC bool SCC_InterruptsEnabled(void) { return SCC.MIE; } @@ -265,7 +265,7 @@ EXPORTFUNC blnr SCC_InterruptsEnabled(void) LOCALPROC CheckSCCInterruptFlag(void) { #if 0 /* ReceiveAInterrupt always false */ - blnr ReceiveAInterrupt = falseblnr + bool ReceiveAInterrupt = false /* also dependeds on WR1, bits 3 and 4, but this doesn't change that it's all false @@ -290,14 +290,14 @@ LOCALPROC CheckSCCInterruptFlag(void) ; #endif #if 0 - blnr TransmitAInterrupt = SCC.a[0].TxBufferEmpty; + bool TransmitAInterrupt = SCC.a[0].TxBufferEmpty; /* but probably looking for transitions not current value */ #endif #if 0 - blnr ExtStatusAInterrupt = 0 + bool ExtStatusAInterrupt = 0 #if 0 /* ZeroCount always false */ | SCC.a[0].ZeroCount #endif @@ -318,8 +318,8 @@ LOCALPROC CheckSCCInterruptFlag(void) uint8_t NewSCCInterruptRequest; #if EmLocalTalk - blnr ReceiveBInterrupt = falseblnr; - blnr RxSpclBInterrupt = falseblnr + bool ReceiveBInterrupt = false; + bool RxSpclBInterrupt = false /* otherwise EndOfFrame always false */ | SCC.a[1].EndOfFrame ; @@ -329,18 +329,18 @@ LOCALPROC CheckSCCInterruptFlag(void) switch (SCC.a[1].RxIntMode) { case 0: /* disabled */ - RxSpclBInterrupt = falseblnr; + RxSpclBInterrupt = false; break; case 1: /* Rx INT on 1st char or special condition */ if (SCC.a[1].RxChrAvail && SCC.a[1].FirstChar) { - ReceiveBInterrupt = trueblnr; + ReceiveBInterrupt = true; } break; case 2: /* INT on all Rx char or special condition */ if (SCC.a[1].RxChrAvail) { - ReceiveBInterrupt = trueblnr; + ReceiveBInterrupt = true; } break; case 3: @@ -402,25 +402,25 @@ LOCALPROC SCC_InitChannel(int chan) { /* anything not done by ResetChannel */ - SCC.a[chan].SyncHunt = trueblnr; + SCC.a[chan].SyncHunt = true; #if 0 /* DCD always false */ - SCC.a[chan].DCD = falseblnr; /* input pin, reset doesn't change */ + SCC.a[chan].DCD = false; /* input pin, reset doesn't change */ #endif #if 0 /* CTS always false */ - SCC.a[chan].CTS = falseblnr; /* input pin, reset doesn't change */ + SCC.a[chan].CTS = false; /* input pin, reset doesn't change */ #endif #if 0 /* AllSent always true */ - SCC.a[chan].AllSent = trueblnr; + SCC.a[chan].AllSent = true; #endif #if SCC_TrackMore /* don't care about Baud */ SCC.a[chan].BaudLo = 0; SCC.a[chan].BaudHi = 0; #endif #if 0 /* BreakAbort always false */ - SCC.a[chan].BreakAbort = falseblnr; + SCC.a[chan].BreakAbort = false; #endif #if SCC_TrackMore - SCC.a[chan].BRGEnbl = falseblnr; + SCC.a[chan].BRGEnbl = false; #endif #if SCC_TrackMore SCC.a[chan].TRxCsrc = 0; @@ -441,72 +441,72 @@ LOCALPROC SCC_ResetChannel(int chan) #endif #if EmLocalTalk /* otherwise RxChrAvail always false */ - SCC.a[chan].RxChrAvail = falseblnr; + SCC.a[chan].RxChrAvail = false; #endif #if 0 /* ZeroCount always false */ - SCC.a[chan].ZeroCount = falseblnr; + SCC.a[chan].ZeroCount = false; #endif #if EmLocalTalk /* otherwise TxBufferEmpty always true */ - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif - SCC.a[chan].TxUnderrun = trueblnr; + SCC.a[chan].TxUnderrun = true; /* RR 1 */ #if 0 /* ParityErr always false */ - SCC.a[chan].ParityErr = falseblnr; + SCC.a[chan].ParityErr = false; #endif #if 0 /* RxOverrun always false */ - SCC.a[chan].RxOverrun = falseblnr; + SCC.a[chan].RxOverrun = false; #endif #if 0 /* CRCFramingErr always false */ - SCC.a[chan].CRCFramingErr = falseblnr; + SCC.a[chan].CRCFramingErr = false; #endif #if EmLocalTalk /* otherwise EndOfFrame always false */ - SCC.a[chan].EndOfFrame = falseblnr; + SCC.a[chan].EndOfFrame = false; #endif /* RR 3 */ #if EmLocalTalk || SCC_TrackMore - SCC.a[chan].ExtIE = falseblnr; + SCC.a[chan].ExtIE = false; #endif #if SCC_TrackMore - SCC.a[chan].RxCRCEnbl = falseblnr; + SCC.a[chan].RxCRCEnbl = false; #endif #if SCC_TrackMore - SCC.a[chan].TxCRCEnbl = falseblnr; + SCC.a[chan].TxCRCEnbl = false; #endif #if SCC_TrackMore - SCC.a[chan].RTSctrl = falseblnr; + SCC.a[chan].RTSctrl = false; #endif #if SCC_TrackMore - SCC.a[chan].SndBrkCtrl = falseblnr; + SCC.a[chan].SndBrkCtrl = false; #endif #if SCC_TrackMore - SCC.a[chan].DTRctrl = falseblnr; + SCC.a[chan].DTRctrl = false; #endif #if EmLocalTalk || SCC_TrackMore - SCC.a[chan].AddrSrchMd = falseblnr; + SCC.a[chan].AddrSrchMd = false; #endif #if SCC_TrackMore - SCC.a[chan].SyncChrLdInhb = falseblnr; + SCC.a[chan].SyncChrLdInhb = false; #endif #if SCC_TrackMore - SCC.a[chan].WaitRqstEnbl = falseblnr; + SCC.a[chan].WaitRqstEnbl = false; #endif #if SCC_TrackMore - SCC.a[chan].WaitRqstSlct = falseblnr; + SCC.a[chan].WaitRqstSlct = false; #endif #if SCC_TrackMore - SCC.a[chan].WaitRqstRT = falseblnr; + SCC.a[chan].WaitRqstRT = false; #endif #if SCC_TrackMore - SCC.a[chan].PrtySpclCond = falseblnr; + SCC.a[chan].PrtySpclCond = false; #endif #if SCC_TrackMore - SCC.a[chan].PrtyEnable = falseblnr; + SCC.a[chan].PrtyEnable = false; #endif #if SCC_TrackMore - SCC.a[chan].PrtyEven = falseblnr; + SCC.a[chan].PrtyEven = false; #endif #if SCC_TrackMore SCC.a[chan].ClockRate = 0; @@ -524,7 +524,7 @@ LOCALPROC SCC_ResetChannel(int chan) SCC.a[chan].RxIntMode = 0; #endif #if EmLocalTalk || SCC_TrackMore - SCC.a[chan].FirstChar = falseblnr; + SCC.a[chan].FirstChar = false; #endif #if EmLocalTalk || SCC_TrackMore SCC.a[chan].SyncMode = 0; @@ -533,28 +533,28 @@ LOCALPROC SCC_ResetChannel(int chan) SCC.a[chan].StopBits = 0; #endif #if SCC_TrackMore - SCC.NoVectorSlct = falseblnr; + SCC.NoVectorSlct = false; #endif - SCC.a[chan].TxIP = falseblnr; + SCC.a[chan].TxIP = false; - SCC.a[chan].TxEnable = falseblnr; - SCC.a[chan].RxEnable = falseblnr; - SCC.a[chan].TxIE = falseblnr; + SCC.a[chan].TxEnable = false; + SCC.a[chan].RxEnable = false; + SCC.a[chan].TxIE = false; #if 0 /* don't care about DCD_IE, always true */ - SCC.a[chan].DCD_IE = trueblnr; + SCC.a[chan].DCD_IE = true; #endif #if SCC_TrackMore /* don't care about CTS_IE */ - SCC.a[chan].CTS_IE = trueblnr; + SCC.a[chan].CTS_IE = true; #endif #if SCC_TrackMore - SCC.a[chan].CRCPreset = falseblnr; + SCC.a[chan].CRCPreset = false; #endif #if 0 /* SyncHuntIE usually false */ - SCC.a[chan].SyncHuntIE = trueblnr; + SCC.a[chan].SyncHuntIE = true; #endif #if SCC_TrackMore /* don't care about BreakAbortIE */ - SCC.a[chan].BreakAbortIE = trueblnr; + SCC.a[chan].BreakAbortIE = true; #endif SCC.PointerBits = 0; @@ -576,10 +576,10 @@ GLOBALPROC SCC_Reset(void) SCCInterruptRequest = 0; SCC.PointerBits = 0; - SCC.MIE = falseblnr; + SCC.MIE = false; SCC.InterruptVector = 0; #if 0 /* StatusHiLo always false */ - SCC.StatusHiLo = falseblnr; + SCC.StatusHiLo = false; #endif SCC_InitChannel(1); @@ -592,7 +592,7 @@ GLOBALPROC SCC_Reset(void) #if EmLocalTalk -LOCALVAR blnr CTSpacketPending = falseblnr; +LOCALVAR bool CTSpacketPending = false; LOCALVAR uint8_t CTSpacketRxDA; LOCALVAR uint8_t CTSpacketRxSA; @@ -623,7 +623,7 @@ LOCALPROC process_transmit(void) } else { CTSpacketRxDA = LT_TxBuffer[1]; /* rx da = tx sa */ CTSpacketRxSA = LT_TxBuffer[0]; /* rx sa = tx da */ - CTSpacketPending = trueblnr; + CTSpacketPending = true; } } } else { @@ -645,7 +645,7 @@ LOCALVAR uint8_t CTSBuffer[4]; LOCALPROC GetCTSpacket(void) { /* Get a single buffer worth of packets at a time */ - ui3p device_buffer = CTSBuffer; + uint8_t * device_buffer = CTSBuffer; #if SCC_dolog dbglog_WriteNote("SCC receiving CTS packet"); @@ -659,7 +659,7 @@ LOCALPROC GetCTSpacket(void) LT_RxBuffer = device_buffer; LT_RxBuffSz = 3; - CTSpacketPending = falseblnr; + CTSpacketPending = false; } /* @@ -684,7 +684,7 @@ LOCALPROC rx_complete(void) */ LT_RxBuffer = nullpr; - SCC.a[1].EndOfFrame = trueblnr; + SCC.a[1].EndOfFrame = true; } LOCALPROC SCC_RxBuffAdvance(void) @@ -700,7 +700,7 @@ LOCALPROC SCC_RxBuffAdvance(void) if (nullpr == LT_RxBuffer) { value = 0x7E; - SCC.a[1].RxChrAvail = falseblnr; + SCC.a[1].RxChrAvail = false; } else { if (rx_data_offset < LT_RxBuffSz) { value = LT_RxBuffer[rx_data_offset]; @@ -721,7 +721,7 @@ LOCALPROC SCC_RxBuffAdvance(void) } /* LLAP/SDLC address */ -LOCALVAR uint8_t my_node_address = 0; +LOCALVAR uint8_t node_address = 0; LOCALPROC GetNextPacketForMe(void) { @@ -739,13 +739,13 @@ label_retry: /* Is this packet destined for me? */ dst = LT_RxBuffer[0]; src = LT_RxBuffer[1]; - if (src == my_node_address) { + if (src == node_address) { #if SCC_dolog dbglog_WriteNote("SCC ignore packet from myself"); #endif LT_RxBuffer = nullpr; goto label_retry; - } else if ((dst == my_node_address) + } else if ((dst == node_address) || (dst == 0xFF) || ! SCC.a[1].AddrSrchMd) { @@ -783,9 +783,9 @@ GLOBALPROC LocalTalkTick(void) if (nullpr != LT_RxBuffer) { rx_data_offset = 0; - SCC.a[1].EndOfFrame = falseblnr; - SCC.a[1].RxChrAvail = trueblnr; - SCC.a[1].SyncHunt = falseblnr; + SCC.a[1].EndOfFrame = false; + SCC.a[1].RxChrAvail = true; + SCC.a[1].SyncHunt = false; SCC_RxBuffAdvance(); /* We can update the rx interrupt if enabled */ @@ -818,7 +818,7 @@ LOCALPROC SCC_Int(void) /* Turn off Sync/Hunt Mode */ if (SCC.a[0].SyncHunt) { - SCC.a[0].SyncHunt = falseblnr; + SCC.a[0].SyncHunt = false; #ifdef _SCC_Debug2 vMac_Message("SCC_Int: Disable Sync/Hunt on A"); @@ -831,7 +831,7 @@ LOCALPROC SCC_Int(void) #endif } if (SCC.a[1].SyncHunt) { - SCC.a[1].SyncHunt = falseblnr; + SCC.a[1].SyncHunt = false; #ifdef _SCC_Debug2 vMac_Message("SCC_Int: Disable Sync/Hunt on B"); @@ -854,14 +854,14 @@ LOCALPROC SCC_Int(void) if ((ModemBytes > 0) && (ModemCount > ModemBytes - 1)) { - SCC.a[0].RxChrAvail = falseblnr; + SCC.a[0].RxChrAvail = false; ReadModem = ModemBytes = ModemCount = 0; } if (ReadModem) { ReadModem = 2; - SCC.a[0].RxChrAvail = trueblnr; + SCC.a[0].RxChrAvail = true; if (SCC.a[0].WR[0] & Bit5 && ! (SCC.a[0].WR[0] & (Bit4 | Bit3))) @@ -888,14 +888,14 @@ LOCALPROC SCC_Int(void) } if ((PrintBytes > 0) && (PrintCount > PrintBytes - 1)) { - SCC.a[1].RxChrAvail = falseblnr; + SCC.a[1].RxChrAvail = false; ReadPrint = PrintBytes = PrintCount = 0; } if (ReadPrint) { ReadPrint = 2; - SCC.a[1].RxChrAvail = trueblnr; + SCC.a[1].RxChrAvail = true; if (SCC.a[1].WR[0] & Bit5 && ! (SCC.a[1].WR[0] & (Bit4 | Bit3))) @@ -1138,7 +1138,7 @@ LOCALFUNC uint8_t SCC_GetRR8(int chan) if necessary */ value = SCC.a[1].RxBuff; - SCC.a[1].FirstChar = falseblnr; + SCC.a[1].FirstChar = false; SCC_RxBuffAdvance(); } else { value = 0x7E; @@ -1246,7 +1246,7 @@ LOCALPROC SCC_DbgLogChanCmnd(int chan, char *s) #endif #if SCC_dolog -LOCALPROC SCC_DbgLogChanChngBit(int chan, char *s, blnr v) +LOCALPROC SCC_DbgLogChanChngBit(int chan, char *s, bool v) { SCC_DbgLogChanStartLine(chan); dbglog_writeCStr(" "); @@ -1293,14 +1293,14 @@ LOCALPROC SCC_PutWR0(uint8_t Data, int chan) #if 0 /* It seems to work better without this */ if (SCC.a[chan].TxEnable) { /* Tx Enabled */ - SCC.a[chan].TxUnderrun = falseblnr; + SCC.a[chan].TxUnderrun = false; if (SCC.a[chan].WR[10] & Bit2) { /* Abort/Flag on Underrun */ /* Send Abort */ - SCC.a[chan].TxUnderrun = trueblnr; + SCC.a[chan].TxUnderrun = true; #if 0 /* TxBufferEmpty always true */ - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif /* Send Flag */ @@ -1323,26 +1323,26 @@ LOCALPROC SCC_PutWR0(uint8_t Data, int chan) SCC_DbgLogChanCmnd(chan, "Reset Ext/Status Ints"); #endif /* happens on boot always */ - SCC.a[chan].SyncHunt = falseblnr; + SCC.a[chan].SyncHunt = false; #if 0 /* only in sync mode */ - SCC.a[chan].TxUnderrun = falseblnr; + SCC.a[chan].TxUnderrun = false; #endif #if 0 /* ZeroCount always false */ - SCC.a[chan].ZeroCount = falseblnr; + SCC.a[chan].ZeroCount = false; #endif #if 0 /* BreakAbort always false */ - SCC.a[chan].BreakAbort = falseblnr; + SCC.a[chan].BreakAbort = false; #endif break; case 3: ReportAbnormalID(0x070C, "Send Abort (SDLC)"); #if EmLocalTalk - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif #if 0 - SCC.a[chan].TxUnderrun = trueblnr; + SCC.a[chan].TxUnderrun = true; #if 0 /* TxBufferEmpty always true */ - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif #endif break; @@ -1352,7 +1352,7 @@ LOCALPROC SCC_PutWR0(uint8_t Data, int chan) "Enable Int on next Rx char"); #endif #if EmLocalTalk || SCC_TrackMore - SCC.a[chan].FirstChar = trueblnr; + SCC.a[chan].FirstChar = true; #endif /* happens in MacCheck */ break; @@ -1362,7 +1362,7 @@ LOCALPROC SCC_PutWR0(uint8_t Data, int chan) #endif /* happens in MacCheck */ /* happens in Print to ImageWriter */ - SCC.a[chan].TxIP = falseblnr; + SCC.a[chan].TxIP = false; CheckSCCInterruptFlag(); break; case 6: @@ -1371,16 +1371,16 @@ LOCALPROC SCC_PutWR0(uint8_t Data, int chan) #endif /* happens on boot with appletalk on */ #if EmLocalTalk - SCC.a[chan].EndOfFrame = falseblnr; + SCC.a[chan].EndOfFrame = false; #endif #if 0 /* ParityErr always false */ - SCC.a[chan].ParityErr = falseblnr; + SCC.a[chan].ParityErr = false; #endif #if 0 /* RxOverrun always false */ - SCC.a[chan].RxOverrun = falseblnr; + SCC.a[chan].RxOverrun = false; #endif #if 0 /* CRCFramingErr always false */ - SCC.a[chan].CRCFramingErr = falseblnr; + SCC.a[chan].CRCFramingErr = false; #endif break; case 7: @@ -1403,7 +1403,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) { #if EmLocalTalk || SCC_TrackMore { - blnr NewExtIE = (Data & Bit0) != 0; + bool NewExtIE = (Data & Bit0) != 0; if (SCC.a[chan].ExtIE != NewExtIE) { SCC.a[chan].ExtIE = NewExtIE; #if SCC_dolog @@ -1419,7 +1419,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) #endif { - blnr NewTxIE = (Data & Bit1) != 0; + bool NewTxIE = (Data & Bit1) != 0; if (SCC.a[chan].TxIE != NewTxIE) { #if SCC_dolog SCC_DbgLogChanChngBit(chan, "Tx Int Enable", @@ -1434,7 +1434,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewPrtySpclCond = (Data & Bit2) != 0; + bool NewPrtySpclCond = (Data & Bit2) != 0; if (SCC.a[chan].PrtySpclCond != NewPrtySpclCond) { SCC.a[chan].PrtySpclCond = NewPrtySpclCond; #if SCC_dolog @@ -1468,7 +1468,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) "Rx INT on 1st char" " or special condition"); #endif - SCC.a[chan].FirstChar = trueblnr; + SCC.a[chan].FirstChar = true; /* happens on boot with appletalk on */ break; case 2: @@ -1491,7 +1491,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewWaitRqstRT = (Data & Bit5) != 0; + bool NewWaitRqstRT = (Data & Bit5) != 0; if (SCC.a[chan].WaitRqstRT != NewWaitRqstRT) { SCC.a[chan].WaitRqstRT = NewWaitRqstRT; #if SCC_dolog @@ -1506,7 +1506,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewWaitRqstSlct = (Data & Bit6) != 0; + bool NewWaitRqstSlct = (Data & Bit6) != 0; if (SCC.a[chan].WaitRqstSlct != NewWaitRqstSlct) { SCC.a[chan].WaitRqstSlct = NewWaitRqstSlct; #if SCC_dolog @@ -1520,7 +1520,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewWaitRqstEnbl = (Data & Bit7) != 0; + bool NewWaitRqstEnbl = (Data & Bit7) != 0; if (SCC.a[chan].WaitRqstEnbl != NewWaitRqstEnbl) { SCC.a[chan].WaitRqstEnbl = NewWaitRqstEnbl; #if SCC_dolog @@ -1636,7 +1636,7 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) #endif /* happens on boot with appletalk on */ if (! (SCC.a[chan].SyncHunt)) { - SCC.a[chan].SyncHunt = trueblnr; + SCC.a[chan].SyncHunt = true; #if 0 /* SyncHuntIE usually false */ if (SCC.a[chan].SyncHuntIE) { @@ -1650,7 +1650,7 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewRxCRCEnbl = (Data & Bit3) != 0; + bool NewRxCRCEnbl = (Data & Bit3) != 0; if (SCC.a[chan].RxCRCEnbl != NewRxCRCEnbl) { SCC.a[chan].RxCRCEnbl = NewRxCRCEnbl; #if SCC_dolog @@ -1664,7 +1664,7 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) #if EmLocalTalk || SCC_TrackMore { - blnr NewAddrSrchMd = (Data & Bit2) != 0; + bool NewAddrSrchMd = (Data & Bit2) != 0; if (SCC.a[chan].AddrSrchMd != NewAddrSrchMd) { SCC.a[chan].AddrSrchMd = NewAddrSrchMd; #if SCC_dolog @@ -1678,7 +1678,7 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewSyncChrLdInhb = (Data & Bit1) != 0; + bool NewSyncChrLdInhb = (Data & Bit1) != 0; if (SCC.a[chan].SyncChrLdInhb != NewSyncChrLdInhb) { SCC.a[chan].SyncChrLdInhb = NewSyncChrLdInhb; #if SCC_dolog @@ -1691,7 +1691,7 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) #endif { - blnr NewRxEnable = (Data & Bit0) != 0; + bool NewRxEnable = (Data & Bit0) != 0; if (SCC.a[chan].RxEnable != NewRxEnable) { SCC.a[chan].RxEnable = NewRxEnable; #if SCC_dolog @@ -1713,9 +1713,9 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) Go back into the idle state if we were waiting for EOF */ - SCC.a[chan].EndOfFrame = falseblnr; - SCC.a[chan].RxChrAvail = falseblnr; - SCC.a[chan].SyncHunt = trueblnr; + SCC.a[chan].EndOfFrame = false; + SCC.a[chan].RxChrAvail = false; + SCC.a[chan].SyncHunt = true; } else { /* look for a packet */ LocalTalkTick(); @@ -1735,7 +1735,7 @@ LOCALPROC SCC_PutWR4(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewPrtyEnable = (Data & Bit0) != 0; + bool NewPrtyEnable = (Data & Bit0) != 0; if (SCC.a[chan].PrtyEnable != NewPrtyEnable) { SCC.a[chan].PrtyEnable = NewPrtyEnable; #if SCC_dolog @@ -1748,7 +1748,7 @@ LOCALPROC SCC_PutWR4(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewPrtyEven = (Data & Bit1) != 0; + bool NewPrtyEven = (Data & Bit1) != 0; if (SCC.a[chan].PrtyEven != NewPrtyEven) { SCC.a[chan].PrtyEven = NewPrtyEven; #if SCC_dolog @@ -1815,7 +1815,7 @@ LOCALPROC SCC_PutWR4(uint8_t Data, int chan) #endif /* happens on boot with appletalk on */ #if EmLocalTalk - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif break; case 3: @@ -1867,7 +1867,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewTxCRCEnbl = (Data & Bit0) != 0; + bool NewTxCRCEnbl = (Data & Bit0) != 0; if (SCC.a[chan].TxCRCEnbl != NewTxCRCEnbl) { SCC.a[chan].TxCRCEnbl = NewTxCRCEnbl; #if SCC_dolog @@ -1881,7 +1881,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewRTSctrl = (Data & Bit1) != 0; + bool NewRTSctrl = (Data & Bit1) != 0; if (SCC.a[chan].RTSctrl != NewRTSctrl) { SCC.a[chan].RTSctrl = NewRTSctrl; #if SCC_dolog @@ -1902,7 +1902,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) } { - blnr NewTxEnable = (Data & Bit3) != 0; + bool NewTxEnable = (Data & Bit3) != 0; if (SCC.a[chan].TxEnable != NewTxEnable) { SCC.a[chan].TxEnable = NewTxEnable; #if SCC_dolog @@ -1918,7 +1918,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) #endif } else { #if EmLocalTalk - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif } } @@ -1926,7 +1926,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewSndBrkCtrl = (Data & Bit4) != 0; + bool NewSndBrkCtrl = (Data & Bit4) != 0; if (SCC.a[chan].SndBrkCtrl != NewSndBrkCtrl) { SCC.a[chan].SndBrkCtrl = NewSndBrkCtrl; #if SCC_dolog @@ -1969,7 +1969,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewDTRctrl = (Data & Bit7) != 0; + bool NewDTRctrl = (Data & Bit7) != 0; if (SCC.a[chan].DTRctrl != NewDTRctrl) { SCC.a[chan].DTRctrl = NewDTRctrl; #if SCC_dolog @@ -2007,7 +2007,7 @@ LOCALPROC SCC_PutWR6(uint8_t Data, int chan) #if EmLocalTalk if (0 != Data) { - my_node_address = Data; + node_address = Data; } #endif } @@ -2065,18 +2065,18 @@ LOCALPROC SCC_PutWR8(uint8_t Data, int chan) } #else #if 0 /* TxBufferEmpty always true */ - SCC.a[chan].TxBufferEmpty = trueblnr; + SCC.a[chan].TxBufferEmpty = true; #endif - SCC.a[chan].TxUnderrun = trueblnr; /* underrun ? */ + SCC.a[chan].TxUnderrun = true; /* underrun ? */ #endif - SCC.a[chan].TxIP = trueblnr; + SCC.a[chan].TxIP = true; CheckSCCInterruptFlag(); } else { ReportAbnormalID(0x071F, "write when Transmit Buffer not Enabled"); #if 0 /* TxBufferEmpty always true */ - SCC.a[chan].TxBufferEmpty = falseblnr; + SCC.a[chan].TxBufferEmpty = false; #endif } } @@ -2097,7 +2097,7 @@ LOCALPROC SCC_PutWR9(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewNoVectorSlct = (Data & Bit1) != 0; + bool NewNoVectorSlct = (Data & Bit1) != 0; if (SCC.NoVectorSlct != NewNoVectorSlct) { SCC.NoVectorSlct = NewNoVectorSlct; #if SCC_dolog @@ -2114,7 +2114,7 @@ LOCALPROC SCC_PutWR9(uint8_t Data, int chan) } { - blnr NewMIE = (Data & Bit3) != 0; + bool NewMIE = (Data & Bit3) != 0; /* has both values on boot always */ if (SCC.MIE != NewMIE) { SCC.MIE = NewMIE; @@ -2233,7 +2233,7 @@ LOCALPROC SCC_PutWR10(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewCRCPreset = (Data & Bit7) != 0; + bool NewCRCPreset = (Data & Bit7) != 0; if (SCC.a[chan].CRCPreset != NewCRCPreset) { SCC.a[chan].CRCPreset = NewCRCPreset; #if SCC_dolog @@ -2453,7 +2453,7 @@ LOCALPROC SCC_PutWR14(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewBRGEnbl = (Data & Bit0) != 0; + bool NewBRGEnbl = (Data & Bit0) != 0; if (SCC.a[chan].BRGEnbl != NewBRGEnbl) { SCC.a[chan].BRGEnbl = NewBRGEnbl; #if SCC_dolog @@ -2568,7 +2568,7 @@ LOCALPROC SCC_PutWR15(uint8_t Data, int chan) #if SCC_TrackMore /* don't care about CTS_IE */ { - blnr NewCTS_IE = (Data & Bit5) != 0; + bool NewCTS_IE = (Data & Bit5) != 0; if (SCC.a[chan].CTS_IE != NewCTS_IE) { SCC.a[chan].CTS_IE = NewCTS_IE; #if SCC_dolog @@ -2587,7 +2587,7 @@ LOCALPROC SCC_PutWR15(uint8_t Data, int chan) #if SCC_TrackMore { - blnr NewBreakAbortIE = (Data & Bit7) != 0; + bool NewBreakAbortIE = (Data & Bit7) != 0; if (SCC.a[chan].BreakAbortIE != NewBreakAbortIE) { SCC.a[chan].BreakAbortIE = NewBreakAbortIE; #if SCC_dolog @@ -2763,7 +2763,7 @@ LOCALPROC SCC_PutReg(uint8_t Data, int chan, uint8_t SCC_Reg) #endif } -GLOBALFUNC uint32_t SCC_Access(uint32_t Data, blnr WriteMem, CPTR addr) +GLOBALFUNC uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr) { #if EmLocalTalk /* diff --git a/src/SCCEMDEV.h b/src/SCCEMDEV.h index 87a093b..d5d4099 100644 --- a/src/SCCEMDEV.h +++ b/src/SCCEMDEV.h @@ -22,9 +22,9 @@ EXPORTPROC SCC_Reset(void); -EXPORTFUNC uint32_t SCC_Access(uint32_t Data, blnr WriteMem, CPTR addr); +EXPORTFUNC uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr); -EXPORTFUNC blnr SCC_InterruptsEnabled(void); +EXPORTFUNC bool SCC_InterruptsEnabled(void); #if EmLocalTalk EXPORTPROC LocalTalkTick(void); diff --git a/src/SCRNEMDV.c b/src/SCRNEMDV.c index 616e03a..b45225a 100644 --- a/src/SCRNEMDV.c +++ b/src/SCRNEMDV.c @@ -43,7 +43,7 @@ GLOBALPROC Screen_EndTickNotify(void) { - ui3p screencurrentbuff; + uint8_t * screencurrentbuff; #if IncludeVidMem screencurrentbuff = VidMem; diff --git a/src/SCSIEMDV.c b/src/SCSIEMDV.c index 334199f..c4ba948 100644 --- a/src/SCSIEMDV.c +++ b/src/SCSIEMDV.c @@ -141,7 +141,7 @@ LOCALPROC SCSI_Check(void) } } -GLOBALFUNC uint32_t SCSI_Access(uint32_t Data, blnr WriteMem, CPTR addr) +GLOBALFUNC uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr) { if (addr < (kSCSI_Size / 2)) { addr *= 2; diff --git a/src/SCSIEMDV.h b/src/SCSIEMDV.h index a507e2d..298f26b 100644 --- a/src/SCSIEMDV.h +++ b/src/SCSIEMDV.h @@ -22,4 +22,4 @@ EXPORTPROC SCSI_Reset(void); -EXPORTFUNC uint32_t SCSI_Access(uint32_t Data, blnr WriteMem, CPTR addr); +EXPORTFUNC uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr); diff --git a/src/SGLUALSA.h b/src/SGLUALSA.h index 3317244..1a8cbe0 100644 --- a/src/SGLUALSA.h +++ b/src/SGLUALSA.h @@ -237,16 +237,16 @@ static void *alsa_handle = NULL; -LOCALVAR blnr DidAlsaLib = falseblnr; +LOCALVAR bool DidAlsaLib = false; -LOCALFUNC blnr HaveAlsaLib(void) +LOCALFUNC bool HaveAlsaLib(void) { if (! DidAlsaLib) { alsa_handle = dlopen("libasound.so.2", RTLD_NOW); if (NULL == alsa_handle) { fprintf(stderr, "dlopen libasound failed\n"); } - DidAlsaLib = trueblnr; + DidAlsaLib = true; } return (alsa_handle != NULL); } @@ -466,9 +466,9 @@ typedef int (*snd_pcm_open_ProcPtr) (_snd_pcm_t **pcm, const char *name, _snd_pcm_stream_t stream, int mode); LOCALVAR snd_pcm_open_ProcPtr _snd_pcm_open = NULL; -LOCALVAR blnr Did_snd_pcm_open = falseblnr; +LOCALVAR bool Did_snd_pcm_open = false; -LOCALFUNC blnr Have_snd_pcm_open(void) +LOCALFUNC bool Have_snd_pcm_open(void) { if (! Did_snd_pcm_open) { if (HaveAlsaLib()) { @@ -478,16 +478,16 @@ LOCALFUNC blnr Have_snd_pcm_open(void) fprintf(stderr, "dlsym snd_pcm_open failed\n"); } } - Did_snd_pcm_open = trueblnr; + Did_snd_pcm_open = true; } return (_snd_pcm_open != NULL); } typedef int (*snd_pcm_close_ProcPtr)(_snd_pcm_t *pcm); LOCALVAR snd_pcm_close_ProcPtr _snd_pcm_close = NULL; -LOCALVAR blnr Did_snd_pcm_close = falseblnr; +LOCALVAR bool Did_snd_pcm_close = false; -LOCALFUNC blnr Have_snd_pcm_close(void) +LOCALFUNC bool Have_snd_pcm_close(void) { if (! Did_snd_pcm_close) { if (HaveAlsaLib()) { @@ -497,7 +497,7 @@ LOCALFUNC blnr Have_snd_pcm_close(void) fprintf(stderr, "dlsym snd_pcm_close failed\n"); } } - Did_snd_pcm_close = trueblnr; + Did_snd_pcm_close = true; } return (_snd_pcm_close != NULL); } @@ -506,9 +506,9 @@ typedef int (*snd_pcm_hw_params_malloc_ProcPtr) (_snd_pcm_hw_params_t **ptr); LOCALVAR snd_pcm_hw_params_malloc_ProcPtr _snd_pcm_hw_params_malloc = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_malloc = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_malloc = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_malloc(void) +LOCALFUNC bool Have_snd_pcm_hw_params_malloc(void) { if (! Did_snd_pcm_hw_params_malloc) { if (HaveAlsaLib()) { @@ -520,7 +520,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_malloc(void) "dlsym snd_pcm_hw_params_malloc failed\n"); } } - Did_snd_pcm_hw_params_malloc = trueblnr; + Did_snd_pcm_hw_params_malloc = true; } return (_snd_pcm_hw_params_malloc != NULL); } @@ -529,9 +529,9 @@ typedef void (*snd_pcm_hw_params_free_ProcPtr) (_snd_pcm_hw_params_t *obj); LOCALVAR snd_pcm_hw_params_free_ProcPtr _snd_pcm_hw_params_free = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_free = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_free = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_free(void) +LOCALFUNC bool Have_snd_pcm_hw_params_free(void) { if (! Did_snd_pcm_hw_params_free) { if (HaveAlsaLib()) { @@ -542,7 +542,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_free(void) "dlsym snd_pcm_hw_params_free failed\n"); } } - Did_snd_pcm_hw_params_free = trueblnr; + Did_snd_pcm_hw_params_free = true; } return (_snd_pcm_hw_params_free != NULL); } @@ -550,9 +550,9 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_free(void) typedef int (*snd_pcm_hw_params_any_ProcPtr) (_snd_pcm_t *pcm, _snd_pcm_hw_params_t *params); LOCALVAR snd_pcm_hw_params_any_ProcPtr _snd_pcm_hw_params_any = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_any = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_any = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_any(void) +LOCALFUNC bool Have_snd_pcm_hw_params_any(void) { if (! Did_snd_pcm_hw_params_any) { if (HaveAlsaLib()) { @@ -562,7 +562,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_any(void) fprintf(stderr, "dlsym snd_pcm_hw_params_any failed\n"); } } - Did_snd_pcm_hw_params_any = trueblnr; + Did_snd_pcm_hw_params_any = true; } return (_snd_pcm_hw_params_any != NULL); } @@ -572,9 +572,9 @@ typedef int (*snd_pcm_hw_params_set_access_ProcPtr) _snd_pcm_access_t _access); LOCALVAR snd_pcm_hw_params_set_access_ProcPtr _snd_pcm_hw_params_set_access = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_set_access = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_set_access = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_set_access(void) +LOCALFUNC bool Have_snd_pcm_hw_params_set_access(void) { if (! Did_snd_pcm_hw_params_set_access) { if (HaveAlsaLib()) { @@ -586,7 +586,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_access(void) "dlsym snd_pcm_hw_params_set_access failed\n"); } } - Did_snd_pcm_hw_params_set_access = trueblnr; + Did_snd_pcm_hw_params_set_access = true; } return (_snd_pcm_hw_params_set_access != NULL); } @@ -596,9 +596,9 @@ typedef int (*snd_pcm_hw_params_set_format_ProcPtr) _snd_pcm_format_t val); LOCALVAR snd_pcm_hw_params_set_format_ProcPtr _snd_pcm_hw_params_set_format = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_set_format = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_set_format = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_set_format(void) +LOCALFUNC bool Have_snd_pcm_hw_params_set_format(void) { if (! Did_snd_pcm_hw_params_set_format) { if (HaveAlsaLib()) { @@ -610,7 +610,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_format(void) "dlsym snd_pcm_hw_params_set_format failed\n"); } } - Did_snd_pcm_hw_params_set_format = trueblnr; + Did_snd_pcm_hw_params_set_format = true; } return (_snd_pcm_hw_params_set_format != NULL); } @@ -620,9 +620,9 @@ typedef int (*snd_pcm_hw_params_set_rate_near_ProcPtr) unsigned int *val, int *dir); LOCALVAR snd_pcm_hw_params_set_rate_near_ProcPtr _snd_pcm_hw_params_set_rate_near = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_set_rate_near = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_set_rate_near = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_set_rate_near(void) +LOCALFUNC bool Have_snd_pcm_hw_params_set_rate_near(void) { if (! Did_snd_pcm_hw_params_set_rate_near) { if (HaveAlsaLib()) { @@ -634,7 +634,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_rate_near(void) "dlsym snd_pcm_hw_params_set_rate_near failed\n"); } } - Did_snd_pcm_hw_params_set_rate_near = trueblnr; + Did_snd_pcm_hw_params_set_rate_near = true; } return (_snd_pcm_hw_params_set_rate_near != NULL); } @@ -644,9 +644,9 @@ typedef int (*snd_pcm_hw_params_set_channels_ProcPtr) unsigned int val); LOCALVAR snd_pcm_hw_params_set_channels_ProcPtr _snd_pcm_hw_params_set_channels = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_set_channels = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_set_channels = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_set_channels(void) +LOCALFUNC bool Have_snd_pcm_hw_params_set_channels(void) { if (! Did_snd_pcm_hw_params_set_channels) { if (HaveAlsaLib()) { @@ -658,7 +658,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_channels(void) "dlsym snd_pcm_hw_params_set_channels failed\n"); } } - Did_snd_pcm_hw_params_set_channels = trueblnr; + Did_snd_pcm_hw_params_set_channels = true; } return (_snd_pcm_hw_params_set_channels != NULL); } @@ -668,9 +668,9 @@ typedef int (*snd_pcm_hw_params_set_buffer_size_near_ProcPtr) _snd_pcm_uframes_t *val); LOCALVAR snd_pcm_hw_params_set_buffer_size_near_ProcPtr _snd_pcm_hw_params_set_buffer_size_near = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_set_buffer_size_near = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_set_buffer_size_near = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_set_buffer_size_near(void) +LOCALFUNC bool Have_snd_pcm_hw_params_set_buffer_size_near(void) { if (! Did_snd_pcm_hw_params_set_buffer_size_near) { if (HaveAlsaLib()) { @@ -684,7 +684,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_buffer_size_near(void) " failed\n"); } } - Did_snd_pcm_hw_params_set_buffer_size_near = trueblnr; + Did_snd_pcm_hw_params_set_buffer_size_near = true; } return (_snd_pcm_hw_params_set_buffer_size_near != NULL); } @@ -694,9 +694,9 @@ typedef int (*snd_pcm_hw_params_set_period_size_near_ProcPtr) _snd_pcm_uframes_t *val, int *dir); LOCALVAR snd_pcm_hw_params_set_period_size_near_ProcPtr _snd_pcm_hw_params_set_period_size_near = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params_set_period_size_near = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params_set_period_size_near = false; -LOCALFUNC blnr Have_snd_pcm_hw_params_set_period_size_near(void) +LOCALFUNC bool Have_snd_pcm_hw_params_set_period_size_near(void) { if (! Did_snd_pcm_hw_params_set_period_size_near) { if (HaveAlsaLib()) { @@ -710,7 +710,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_period_size_near(void) " failed\n"); } } - Did_snd_pcm_hw_params_set_period_size_near = trueblnr; + Did_snd_pcm_hw_params_set_period_size_near = true; } return (_snd_pcm_hw_params_set_period_size_near != NULL); } @@ -718,9 +718,9 @@ LOCALFUNC blnr Have_snd_pcm_hw_params_set_period_size_near(void) typedef int (*snd_pcm_hw_params_ProcPtr) (_snd_pcm_t *pcm, _snd_pcm_hw_params_t *params); LOCALVAR snd_pcm_hw_params_ProcPtr _snd_pcm_hw_params = NULL; -LOCALVAR blnr Did_snd_pcm_hw_params = falseblnr; +LOCALVAR bool Did_snd_pcm_hw_params = false; -LOCALFUNC blnr Have_snd_pcm_hw_params(void) +LOCALFUNC bool Have_snd_pcm_hw_params(void) { if (! Did_snd_pcm_hw_params) { if (HaveAlsaLib()) { @@ -730,7 +730,7 @@ LOCALFUNC blnr Have_snd_pcm_hw_params(void) fprintf(stderr, "dlsym snd_pcm_hw_params failed\n"); } } - Did_snd_pcm_hw_params = trueblnr; + Did_snd_pcm_hw_params = true; } return (_snd_pcm_hw_params != NULL); } @@ -739,9 +739,9 @@ typedef int (*snd_pcm_sw_params_malloc_ProcPtr) (_snd_pcm_sw_params_t **ptr); LOCALVAR snd_pcm_sw_params_malloc_ProcPtr _snd_pcm_sw_params_malloc = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params_malloc = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params_malloc = false; -LOCALFUNC blnr Have_snd_pcm_sw_params_malloc(void) +LOCALFUNC bool Have_snd_pcm_sw_params_malloc(void) { if (! Did_snd_pcm_sw_params_malloc) { if (HaveAlsaLib()) { @@ -753,7 +753,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_malloc(void) "dlsym snd_pcm_sw_params_malloc failed\n"); } } - Did_snd_pcm_sw_params_malloc = trueblnr; + Did_snd_pcm_sw_params_malloc = true; } return (_snd_pcm_sw_params_malloc != NULL); } @@ -762,9 +762,9 @@ typedef void (*snd_pcm_sw_params_free_ProcPtr) (_snd_pcm_sw_params_t *obj); LOCALVAR snd_pcm_sw_params_free_ProcPtr _snd_pcm_sw_params_free = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params_free = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params_free = false; -LOCALFUNC blnr Have_snd_pcm_sw_params_free(void) +LOCALFUNC bool Have_snd_pcm_sw_params_free(void) { if (! Did_snd_pcm_sw_params_free) { if (HaveAlsaLib()) { @@ -775,7 +775,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_free(void) "dlsym snd_pcm_sw_params_free failed\n"); } } - Did_snd_pcm_sw_params_free = trueblnr; + Did_snd_pcm_sw_params_free = true; } return (_snd_pcm_sw_params_free != NULL); } @@ -784,9 +784,9 @@ typedef int (*snd_pcm_sw_params_current_ProcPtr) (_snd_pcm_t *pcm, _snd_pcm_sw_params_t *params); LOCALVAR snd_pcm_sw_params_current_ProcPtr _snd_pcm_sw_params_current = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params_current = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params_current = false; -LOCALFUNC blnr Have_snd_pcm_sw_params_current(void) +LOCALFUNC bool Have_snd_pcm_sw_params_current(void) { if (! Did_snd_pcm_sw_params_current) { if (HaveAlsaLib()) { @@ -798,7 +798,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_current(void) "dlsym snd_pcm_sw_params_current failed\n"); } } - Did_snd_pcm_sw_params_current = trueblnr; + Did_snd_pcm_sw_params_current = true; } return (_snd_pcm_sw_params_current != NULL); } @@ -808,9 +808,9 @@ typedef int (*snd_pcm_sw_params_set_start_threshold_ProcPtr) _snd_pcm_uframes_t val); LOCALVAR snd_pcm_sw_params_set_start_threshold_ProcPtr _snd_pcm_sw_params_set_start_threshold = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params_set_start_threshold = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params_set_start_threshold = false; -LOCALFUNC blnr Have_snd_pcm_sw_params_set_start_threshold(void) +LOCALFUNC bool Have_snd_pcm_sw_params_set_start_threshold(void) { if (! Did_snd_pcm_sw_params_set_start_threshold) { if (HaveAlsaLib()) { @@ -824,7 +824,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_set_start_threshold(void) " failed\n"); } } - Did_snd_pcm_sw_params_set_start_threshold = trueblnr; + Did_snd_pcm_sw_params_set_start_threshold = true; } return (_snd_pcm_sw_params_set_start_threshold != NULL); } @@ -834,9 +834,9 @@ typedef int (*snd_pcm_sw_params_set_avail_min_ProcPtr) _snd_pcm_uframes_t val); LOCALVAR snd_pcm_sw_params_set_avail_min_ProcPtr _snd_pcm_sw_params_set_avail_min = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params_set_avail_min = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params_set_avail_min = false; -LOCALFUNC blnr Have_snd_pcm_sw_params_set_avail_min(void) +LOCALFUNC bool Have_snd_pcm_sw_params_set_avail_min(void) { if (! Did_snd_pcm_sw_params_set_avail_min) { if (HaveAlsaLib()) { @@ -848,7 +848,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_set_avail_min(void) "dlsym snd_pcm_sw_params_set_avail_min failed\n"); } } - Did_snd_pcm_sw_params_set_avail_min = trueblnr; + Did_snd_pcm_sw_params_set_avail_min = true; } return (_snd_pcm_sw_params_set_avail_min != NULL); } @@ -858,9 +858,9 @@ typedef int (*snd_pcm_sw_params_set_xfer_align_ProcPtr) _snd_pcm_uframes_t val); LOCALVAR snd_pcm_sw_params_set_xfer_align_ProcPtr _snd_pcm_sw_params_set_xfer_align = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params_set_xfer_align = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params_set_xfer_align = false; -LOCALFUNC blnr Have_snd_pcm_sw_params_set_xfer_align(void) +LOCALFUNC bool Have_snd_pcm_sw_params_set_xfer_align(void) { if (! Did_snd_pcm_sw_params_set_xfer_align) { if (HaveAlsaLib()) { @@ -872,7 +872,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_set_xfer_align(void) "dlsym snd_pcm_sw_params_set_xfer_align failed\n"); } } - Did_snd_pcm_sw_params_set_xfer_align = trueblnr; + Did_snd_pcm_sw_params_set_xfer_align = true; } return (_snd_pcm_sw_params_set_xfer_align != NULL); } @@ -880,9 +880,9 @@ LOCALFUNC blnr Have_snd_pcm_sw_params_set_xfer_align(void) typedef int (*snd_pcm_sw_params_ProcPtr) (_snd_pcm_t *pcm, _snd_pcm_sw_params_t *params); LOCALVAR snd_pcm_sw_params_ProcPtr _snd_pcm_sw_params = NULL; -LOCALVAR blnr Did_snd_pcm_sw_params = falseblnr; +LOCALVAR bool Did_snd_pcm_sw_params = false; -LOCALFUNC blnr Have_snd_pcm_sw_params(void) +LOCALFUNC bool Have_snd_pcm_sw_params(void) { if (! Did_snd_pcm_sw_params) { if (HaveAlsaLib()) { @@ -892,7 +892,7 @@ LOCALFUNC blnr Have_snd_pcm_sw_params(void) fprintf(stderr, "dlsym snd_pcm_sw_params failed\n"); } } - Did_snd_pcm_sw_params = trueblnr; + Did_snd_pcm_sw_params = true; } return (_snd_pcm_sw_params != NULL); } @@ -900,9 +900,9 @@ LOCALFUNC blnr Have_snd_pcm_sw_params(void) typedef int (*snd_pcm_nonblock_ProcPtr) (_snd_pcm_t *pcm, int nonblock); LOCALVAR snd_pcm_nonblock_ProcPtr _snd_pcm_nonblock = NULL; -LOCALVAR blnr Did_snd_pcm_nonblock = falseblnr; +LOCALVAR bool Did_snd_pcm_nonblock = false; -LOCALFUNC blnr Have_snd_pcm_nonblock(void) +LOCALFUNC bool Have_snd_pcm_nonblock(void) { if (! Did_snd_pcm_nonblock) { if (HaveAlsaLib()) { @@ -912,16 +912,16 @@ LOCALFUNC blnr Have_snd_pcm_nonblock(void) fprintf(stderr, "dlsym snd_pcm_nonblock failed\n"); } } - Did_snd_pcm_nonblock = trueblnr; + Did_snd_pcm_nonblock = true; } return (_snd_pcm_nonblock != NULL); } typedef _snd_pcm_state_t (*snd_pcm_state_ProcPtr)(_snd_pcm_t *pcm); LOCALVAR snd_pcm_state_ProcPtr _snd_pcm_state = NULL; -LOCALVAR blnr Did_snd_pcm_state = falseblnr; +LOCALVAR bool Did_snd_pcm_state = false; -LOCALFUNC blnr Have_snd_pcm_state(void) +LOCALFUNC bool Have_snd_pcm_state(void) { if (! Did_snd_pcm_state) { if (HaveAlsaLib()) { @@ -931,16 +931,16 @@ LOCALFUNC blnr Have_snd_pcm_state(void) fprintf(stderr, "dlsym snd_pcm_state failed\n"); } } - Did_snd_pcm_state = trueblnr; + Did_snd_pcm_state = true; } return (_snd_pcm_state != NULL); } typedef int (*snd_pcm_prepare_ProcPtr)(_snd_pcm_t *pcm); LOCALVAR snd_pcm_prepare_ProcPtr _snd_pcm_prepare = NULL; -LOCALVAR blnr Did_snd_pcm_prepare = falseblnr; +LOCALVAR bool Did_snd_pcm_prepare = false; -LOCALFUNC blnr Have_snd_pcm_prepare(void) +LOCALFUNC bool Have_snd_pcm_prepare(void) { if (! Did_snd_pcm_prepare) { if (HaveAlsaLib()) { @@ -950,16 +950,16 @@ LOCALFUNC blnr Have_snd_pcm_prepare(void) fprintf(stderr, "dlsym snd_pcm_prepare failed\n"); } } - Did_snd_pcm_prepare = trueblnr; + Did_snd_pcm_prepare = true; } return (_snd_pcm_prepare != NULL); } typedef int (*snd_pcm_start_ProcPtr)(_snd_pcm_t *pcm); LOCALVAR snd_pcm_start_ProcPtr _snd_pcm_start = NULL; -LOCALVAR blnr Did_snd_pcm_start = falseblnr; +LOCALVAR bool Did_snd_pcm_start = false; -LOCALFUNC blnr Have_snd_pcm_start(void) +LOCALFUNC bool Have_snd_pcm_start(void) { if (! Did_snd_pcm_start) { if (HaveAlsaLib()) { @@ -969,16 +969,16 @@ LOCALFUNC blnr Have_snd_pcm_start(void) fprintf(stderr, "dlsym snd_pcm_start failed\n"); } } - Did_snd_pcm_start = trueblnr; + Did_snd_pcm_start = true; } return (_snd_pcm_start != NULL); } typedef int (*snd_pcm_resume_ProcPtr)(_snd_pcm_t *pcm); LOCALVAR snd_pcm_resume_ProcPtr _snd_pcm_resume = NULL; -LOCALVAR blnr Did_snd_pcm_resume = falseblnr; +LOCALVAR bool Did_snd_pcm_resume = false; -LOCALFUNC blnr Have_snd_pcm_resume(void) +LOCALFUNC bool Have_snd_pcm_resume(void) { if (! Did_snd_pcm_resume) { if (HaveAlsaLib()) { @@ -988,7 +988,7 @@ LOCALFUNC blnr Have_snd_pcm_resume(void) fprintf(stderr, "dlsym snd_pcm_resume failed\n"); } } - Did_snd_pcm_resume = trueblnr; + Did_snd_pcm_resume = true; } return (_snd_pcm_resume != NULL); } @@ -996,9 +996,9 @@ LOCALFUNC blnr Have_snd_pcm_resume(void) typedef _snd_pcm_sframes_t (*snd_pcm_avail_update_ProcPtr) (_snd_pcm_t *pcm); LOCALVAR snd_pcm_avail_update_ProcPtr _snd_pcm_avail_update = NULL; -LOCALVAR blnr Did_snd_pcm_avail_update = falseblnr; +LOCALVAR bool Did_snd_pcm_avail_update = false; -LOCALFUNC blnr Have_snd_pcm_avail_update(void) +LOCALFUNC bool Have_snd_pcm_avail_update(void) { if (! Did_snd_pcm_avail_update) { if (HaveAlsaLib()) { @@ -1008,7 +1008,7 @@ LOCALFUNC blnr Have_snd_pcm_avail_update(void) fprintf(stderr, "dlsym snd_pcm_avail_update failed\n"); } } - Did_snd_pcm_avail_update = trueblnr; + Did_snd_pcm_avail_update = true; } return (_snd_pcm_avail_update != NULL); } @@ -1016,9 +1016,9 @@ LOCALFUNC blnr Have_snd_pcm_avail_update(void) typedef _snd_pcm_sframes_t (*snd_pcm_writei_ProcPtr) (_snd_pcm_t *pcm, const void *buffer, _snd_pcm_uframes_t size); LOCALVAR snd_pcm_writei_ProcPtr _snd_pcm_writei = NULL; -LOCALVAR blnr Did_snd_pcm_writei = falseblnr; +LOCALVAR bool Did_snd_pcm_writei = false; -LOCALFUNC blnr Have_snd_pcm_writei(void) +LOCALFUNC bool Have_snd_pcm_writei(void) { if (! Did_snd_pcm_writei) { if (HaveAlsaLib()) { @@ -1028,16 +1028,16 @@ LOCALFUNC blnr Have_snd_pcm_writei(void) fprintf(stderr, "dlsym snd_pcm_writei failed\n"); } } - Did_snd_pcm_writei = trueblnr; + Did_snd_pcm_writei = true; } return (_snd_pcm_writei != NULL); } typedef int (*snd_pcm_drop_ProcPtr)(_snd_pcm_t *pcm); LOCALVAR snd_pcm_drop_ProcPtr _snd_pcm_drop = NULL; -LOCALVAR blnr Did_snd_pcm_drop = falseblnr; +LOCALVAR bool Did_snd_pcm_drop = false; -LOCALFUNC blnr Have_snd_pcm_drop(void) +LOCALFUNC bool Have_snd_pcm_drop(void) { if (! Did_snd_pcm_drop) { if (HaveAlsaLib()) { @@ -1047,7 +1047,7 @@ LOCALFUNC blnr Have_snd_pcm_drop(void) fprintf(stderr, "dlsym snd_pcm_drop failed\n"); } } - Did_snd_pcm_drop = trueblnr; + Did_snd_pcm_drop = true; } return (_snd_pcm_drop != NULL); } @@ -1056,9 +1056,9 @@ LOCALFUNC blnr Have_snd_pcm_drop(void) typedef int (*snd_pcm_status_malloc_ProcPtr) (_snd_pcm_status_t **ptr); LOCALVAR snd_pcm_status_malloc_ProcPtr _snd_pcm_status_malloc = NULL; -LOCALVAR blnr Did_snd_pcm_status_malloc = falseblnr; +LOCALVAR bool Did_snd_pcm_status_malloc = false; -LOCALFUNC blnr Have_snd_pcm_status_malloc(void) +LOCALFUNC bool Have_snd_pcm_status_malloc(void) { if (! Did_snd_pcm_status_malloc) { if (HaveAlsaLib()) { @@ -1068,7 +1068,7 @@ LOCALFUNC blnr Have_snd_pcm_status_malloc(void) fprintf(stderr, "dlsym snd_pcm_status_malloc failed\n"); } } - Did_snd_pcm_status_malloc = trueblnr; + Did_snd_pcm_status_malloc = true; } return (_snd_pcm_status_malloc != NULL); } @@ -1078,9 +1078,9 @@ LOCALFUNC blnr Have_snd_pcm_status_malloc(void) typedef int (*snd_pcm_status_ProcPtr)(_snd_pcm_t *pcm, _snd_pcm_status_t *status); LOCALVAR snd_pcm_status_ProcPtr _snd_pcm_status = NULL; -LOCALVAR blnr Did_snd_pcm_status = falseblnr; +LOCALVAR bool Did_snd_pcm_status = false; -LOCALFUNC blnr Have_snd_pcm_status(void) +LOCALFUNC bool Have_snd_pcm_status(void) { if (! Did_snd_pcm_status) { if (HaveAlsaLib()) { @@ -1090,7 +1090,7 @@ LOCALFUNC blnr Have_snd_pcm_status(void) fprintf(stderr, "dlsym snd_pcm_status failed\n"); } } - Did_snd_pcm_status = trueblnr; + Did_snd_pcm_status = true; } return (_snd_pcm_status != NULL); } @@ -1101,9 +1101,9 @@ typedef _snd_pcm_uframes_t (*snd_pcm_status_get_avail_ProcPtr) (const _snd_pcm_status_t *obj); LOCALVAR snd_pcm_status_get_avail_ProcPtr _snd_pcm_status_get_avail = NULL; -LOCALVAR blnr Did_snd_pcm_status_get_avail = falseblnr; +LOCALVAR bool Did_snd_pcm_status_get_avail = false; -LOCALFUNC blnr Have_snd_pcm_status_get_avail(void) +LOCALFUNC bool Have_snd_pcm_status_get_avail(void) { if (! Did_snd_pcm_status_get_avail) { if (HaveAlsaLib()) { @@ -1115,7 +1115,7 @@ LOCALFUNC blnr Have_snd_pcm_status_get_avail(void) "dlsym snd_pcm_status_get_avail failed\n"); } } - Did_snd_pcm_status_get_avail = trueblnr; + Did_snd_pcm_status_get_avail = true; } return (_snd_pcm_status_get_avail != NULL); } @@ -1123,9 +1123,9 @@ LOCALFUNC blnr Have_snd_pcm_status_get_avail(void) typedef const char * (*snd_strerror_ProcPtr)(int errnum); LOCALVAR snd_strerror_ProcPtr _snd_strerror = NULL; -LOCALVAR blnr Did_snd_strerror = falseblnr; +LOCALVAR bool Did_snd_strerror = false; -LOCALFUNC blnr Have_snd_strerror(void) +LOCALFUNC bool Have_snd_strerror(void) { if (! Did_snd_strerror) { if (HaveAlsaLib()) { @@ -1135,7 +1135,7 @@ LOCALFUNC blnr Have_snd_strerror(void) fprintf(stderr, "dlsym snd_strerror failed\n"); } } - Did_snd_strerror = trueblnr; + Did_snd_strerror = true; } return (_snd_strerror != NULL); } @@ -1176,27 +1176,27 @@ LOCALVAR _snd_pcm_uframes_t buffer_size; LOCALVAR _snd_pcm_uframes_t period_size; -LOCALVAR blnr Sound_StartPend = falseblnr; +LOCALVAR bool Sound_StartPend = false; #if RaspbianWorkAround -LOCALVAR _snd_pcm_status_t *my_status = NULL; +LOCALVAR _snd_pcm_status_t *status = NULL; -LOCALFUNC blnr HaveStatusAlloc(void) +LOCALFUNC bool HaveStatusAlloc(void) { - if (NULL == my_status) { + if (NULL == status) { if (Have_snd_pcm_status_malloc()) if (Have_snd_pcm_status()) if (Have_snd_pcm_status_get_avail()) { - if (_snd_pcm_status_malloc(&my_status) < 0) { - my_status = NULL; /* just to make sure */ + if (_snd_pcm_status_malloc(&status) < 0) { + status = NULL; /* just to make sure */ } else { - /* snd_pcm_status_free(my_status); */ + /* snd_pcm_status_free(status); */ } } } - return NULL != my_status; + return NULL != status; } #endif @@ -1213,7 +1213,7 @@ label_retry: if (_SND_PCM_STATE_PREPARED == cur_state) { if (! Sound_StartPend) { if (TheFillOffset - ThePlayOffset >= kAllBuffLen) { - Sound_StartPend = trueblnr; + Sound_StartPend = true; } } if (Sound_StartPend) { @@ -1270,8 +1270,8 @@ label_retry: */ /* work around bug observed in Raspbian */ if (HaveStatusAlloc()) { - if (_snd_pcm_status(pcm_handle, my_status) >= 0) { - avail = _snd_pcm_status_get_avail(my_status); + if (_snd_pcm_status(pcm_handle, status) >= 0) { + avail = _snd_pcm_status_get_avail(status); } } } @@ -1331,7 +1331,7 @@ label_retry: goto label_retry; } } else if (Sound_StartPend) { - Sound_StartPend = falseblnr; + Sound_StartPend = false; if ((err = _snd_pcm_start(pcm_handle)) < 0) { fprintf(stderr, "pcm start error: %s\n", _snd_strerror(err)); @@ -1355,9 +1355,9 @@ LOCALPROC Sound_Stop(void) } } -LOCALFUNC blnr HaveAlsaRoutines(void) +LOCALFUNC bool HaveAlsaRoutines(void) { - blnr IsOk = falseblnr; + bool IsOk = false; if (Have_snd_pcm_open()) if (Have_snd_pcm_close()) @@ -1387,7 +1387,7 @@ LOCALFUNC blnr HaveAlsaRoutines(void) if (Have_snd_pcm_drop()) if (Have_snd_strerror()) { - IsOk = trueblnr; + IsOk = true; } return IsOk; @@ -1577,13 +1577,13 @@ label_done: ; } -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { if (HaveAlsaRoutines()) { Sound_Init0(); } - return trueblnr; /* keep going, even if no sound */ + return true; /* keep going, even if no sound */ } LOCALPROC Sound_UnInit(void) diff --git a/src/SGLUDDSP.h b/src/SGLUDDSP.h index 2b1ce67..6acb790 100644 --- a/src/SGLUDDSP.h +++ b/src/SGLUDDSP.h @@ -20,7 +20,7 @@ */ LOCALVAR int audio_fd = -1; -LOCALVAR blnr audio_started; +LOCALVAR bool audio_started; #if 4 == kLn2SoundSampSz LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p) @@ -62,7 +62,7 @@ label_retry: /* fprintf(stderr, "buffer used %d\n", (int)used); */ } else { if (PrivateBuffUsed >= kAllBuffLen - kOneBuffLen) { - audio_started = trueblnr; + audio_started = true; } else { info.bytes = 0; } @@ -123,7 +123,7 @@ LOCALPROC Sound_Start(void) { if (audio_fd >= 0) { Sound_Start0(); - audio_started = falseblnr; + audio_started = false; } } @@ -145,9 +145,9 @@ LOCALPROC Sound_Stop(void) #define DesiredFormat AFMT_U8 #endif -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { - blnr IsOk = falseblnr; + bool IsOk = false; audio_fd = open(AudioDevPath, O_WRONLY, 0); if (audio_fd < 0) { @@ -187,7 +187,7 @@ LOCALFUNC blnr Sound_Init(void) fprintf(stderr, "SNDCTL_DSP_SPEED fails\n"); } else { - IsOk = trueblnr; + IsOk = true; } if (! IsOk) { @@ -196,7 +196,7 @@ LOCALFUNC blnr Sound_Init(void) } } - return trueblnr; /* keep going, even if no sound */ + return true; /* keep going, even if no sound */ } LOCALPROC Sound_UnInit(void) diff --git a/src/SNDEMDEV.c b/src/SNDEMDEV.c index 004f158..8ee92d4 100644 --- a/src/SNDEMDEV.c +++ b/src/SNDEMDEV.c @@ -117,7 +117,7 @@ GLOBALPROC MacSound_SubTick(int SubTick) #endif kSnd_Main_Buffer; #ifndef ln2mtb - ui3p addr = addy + (2 * StartOffset) + RAM; + uint8_t * addr = addy + (2 * StartOffset) + RAM; #else CPTR addr = addy + (2 * StartOffset); #endif diff --git a/src/SONYEMDV.c b/src/SONYEMDV.c index 341f6a0..39c98f0 100644 --- a/src/SONYEMDV.c +++ b/src/SONYEMDV.c @@ -51,7 +51,7 @@ LOCALVAR uint32_t vSonyMountedMask = 0; #define vSonyIsMounted(Drive_No) \ ((vSonyMountedMask & ((uint32_t)1 << (Drive_No))) != 0) -LOCALFUNC blnr vSonyNextPendingInsert0(tDrive *Drive_No) +LOCALFUNC bool vSonyNextPendingInsert0(tDrive *Drive_No) { /* find next drive to Mount */ uint32_t MountPending = vSonyInsertedMask & (~ vSonyMountedMask); @@ -60,12 +60,12 @@ LOCALFUNC blnr vSonyNextPendingInsert0(tDrive *Drive_No) for (i = 0; i < NumDrives; ++i) { if ((MountPending & ((uint32_t)1 << i)) != 0) { *Drive_No = i; - return trueblnr; /* only one disk at a time */ + return true; /* only one disk at a time */ } } } - return falseblnr; + return false; } LOCALFUNC tMacErr CheckReadableDrive(tDrive Drive_No) @@ -83,7 +83,7 @@ LOCALFUNC tMacErr CheckReadableDrive(tDrive Drive_No) return result; } -LOCALFUNC tMacErr vSonyTransferVM(blnr IsWrite, +LOCALFUNC tMacErr vSonyTransferVM(bool IsWrite, CPTR Buffera, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -95,7 +95,7 @@ LOCALFUNC tMacErr vSonyTransferVM(blnr IsWrite, tMacErr result; uint32_t contig; uint32_t actual; - ui3p Buffer; + uint8_t * Buffer; uint32_t offset = Sony_Start; uint32_t n = Sony_Count; @@ -126,17 +126,17 @@ label_1: LOCALPROC MoveBytesVM(CPTR srcPtr, CPTR dstPtr, int32_t byteCount) { - ui3p src; - ui3p dst; + uint8_t * src; + uint8_t * dst; uint32_t contigSrc; uint32_t contigDst; uint32_t contig; label_1: if (0 != byteCount) { - src = get_real_address0(byteCount, falseblnr, srcPtr, + src = get_real_address0(byteCount, false, srcPtr, &contigSrc); - dst = get_real_address0(byteCount, trueblnr, dstPtr, + dst = get_real_address0(byteCount, true, dstPtr, &contigDst); if ((0 == contigSrc) || (0 == contigDst)) { ReportAbnormalID(0x0901, "MoveBytesVM fails"); @@ -195,7 +195,7 @@ LOCALFUNC tMacErr DC42BlockChecksum(tDrive Drive_No, n = remaining; } - result = vSonyTransfer(falseblnr, Buffer, Drive_No, offset, + result = vSonyTransfer(false, Buffer, Drive_No, offset, n, nullpr); if (mnvm_noErr != result) { return result; @@ -278,7 +278,7 @@ LOCALPROC Drive_UpdateChecksums(tDrive Drive_No) #endif /* write Checksums */ - vSonyTransfer(trueblnr, Buffer, Drive_No, + vSonyTransfer(true, Buffer, Drive_No, kDC42offset_dataChecksum, Sony_Count, nullpr); } #endif @@ -320,9 +320,9 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No) uint32_t TagSize0; uint8_t Temp[checkheadersize]; uint32_t Sony_Count = checkheadersize; - blnr gotFormat = falseblnr; + bool gotFormat = false; - result = vSonyTransfer(falseblnr, Temp, i, + result = vSonyTransfer(false, Temp, i, checkheaderoffset, Sony_Count, nullpr); if (mnvm_noErr == result) { #if Sony_SupportDC42 @@ -345,12 +345,12 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No) { if (0 == TagSize0) { /* no tags */ - gotFormat = trueblnr; + gotFormat = true; } else if ((DataSize0 >> 9) * 12 == TagSize0) { /* 12 byte tags */ - gotFormat = trueblnr; + gotFormat = true; } if (gotFormat) { #if Sony_VerifyChecksums /* mostly useful to check the Checksum code */ @@ -469,7 +469,7 @@ GLOBALPROC Sony_Update (void) } } -LOCALFUNC tMacErr Drive_Transfer(blnr IsWrite, CPTR Buffera, +LOCALFUNC tMacErr Drive_Transfer(bool IsWrite, CPTR Buffera, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -490,12 +490,12 @@ LOCALFUNC tMacErr Drive_Transfer(blnr IsWrite, CPTR Buffera, if (Sony_Start > DataSize) { result = mnvm_eofErr; } else { - blnr hit_eof = falseblnr; + bool hit_eof = false; uint32_t L = DataSize - Sony_Start; if (L >= Sony_Count) { L = Sony_Count; } else { - hit_eof = trueblnr; + hit_eof = true; } result = vSonyTransferVM(IsWrite, Buffera, Drive_No, ImageDataOffset[Drive_No] + Sony_Start, L, @@ -510,11 +510,11 @@ LOCALFUNC tMacErr Drive_Transfer(blnr IsWrite, CPTR Buffera, return result; } -LOCALVAR blnr QuitOnEject = falseblnr; +LOCALVAR bool QuitOnEject = false; GLOBALPROC Sony_SetQuitOnEject(void) { - QuitOnEject = trueblnr; + QuitOnEject = true; } LOCALFUNC tMacErr Drive_Eject(tDrive Drive_No) @@ -530,7 +530,7 @@ LOCALFUNC tMacErr Drive_Eject(tDrive Drive_No) result = vSonyEject(Drive_No); if (QuitOnEject != 0) { if (! AnyDiskInserted()) { - ForceMacOff = trueblnr; + ForceMacOff = true; } } } @@ -575,7 +575,7 @@ GLOBALPROC Sony_EjectAllDisks(void) GLOBALPROC Sony_Reset(void) { DelayUntilNextInsert = 0; - QuitOnEject = falseblnr; + QuitOnEject = false; MountCallBack = 0; } @@ -638,7 +638,7 @@ GLOBALPROC ExtnDisk_Access(CPTR p) uint32_t Sony_Start = get_vm_long(p + kParamDiskStart); uint32_t Sony_Count = get_vm_long(p + kParamDiskCount); - result = Drive_Transfer(falseblnr, Buffera, Drive_No, + result = Drive_Transfer(false, Buffera, Drive_No, Sony_Start, Sony_Count, &Sony_ActCount); put_vm_long(p + kParamDiskCount, Sony_ActCount); @@ -652,7 +652,7 @@ GLOBALPROC ExtnDisk_Access(CPTR p) uint32_t Sony_Start = get_vm_long(p + kParamDiskStart); uint32_t Sony_Count = get_vm_long(p + kParamDiskCount); - result = Drive_Transfer(trueblnr, Buffera, Drive_No, + result = Drive_Transfer(true, Buffera, Drive_No, Sony_Start, Sony_Count, &Sony_ActCount); put_vm_long(p + kParamDiskCount, Sony_ActCount); @@ -685,7 +685,7 @@ GLOBALPROC ExtnDisk_Access(CPTR p) result = mnvm_noErr; break; case kCmndDiskQuitOnEject: - QuitOnEject = trueblnr; + QuitOnEject = true; result = mnvm_noErr; break; case kCmndDiskFeatures: @@ -742,7 +742,7 @@ GLOBALPROC ExtnDisk_Access(CPTR p) if (Pbuf_No != NotAPbuf) { result = CheckPbuf(Pbuf_No); if (mnvm_noErr == result) { - vSonyNewDiskWanted = trueblnr; + vSonyNewDiskWanted = true; vSonyNewDiskSize = count; #if IncludeSonyNameNew if (vSonyNewDiskName != NotAPbuf) { @@ -756,7 +756,7 @@ GLOBALPROC ExtnDisk_Access(CPTR p) } else #endif { - vSonyNewDiskWanted = trueblnr; + vSonyNewDiskWanted = true; vSonyNewDiskSize = count; } } @@ -1036,7 +1036,7 @@ LOCALFUNC tMacErr Sony_Mount(CPTR p) #if Sony_SupportTags LOCALFUNC tMacErr Sony_PrimeTags(tDrive Drive_No, - uint32_t Sony_Start, uint32_t Sony_Count, blnr IsWrite) + uint32_t Sony_Start, uint32_t Sony_Count, bool IsWrite) { tMacErr result = mnvm_noErr; uint32_t TagOffset = ImageTagOffset[Drive_No]; @@ -1059,14 +1059,14 @@ LOCALFUNC tMacErr Sony_PrimeTags(tDrive Drive_No, /* only need to read the last block tags */ uint32_t count = 12; TagOffset += 12 * (n - 1); - result = vSonyTransferVM(falseblnr, 0x02FC, Drive_No, + result = vSonyTransferVM(false, 0x02FC, Drive_No, TagOffset, count, nullpr); } else { uint32_t count = 12; uint16_t BufTgFBkNum = get_vm_word(0x0302); do { put_vm_word(0x0302, BufTgFBkNum); - result = vSonyTransferVM(trueblnr, 0x02FC, Drive_No, + result = vSonyTransferVM(true, 0x02FC, Drive_No, TagOffset, count, nullpr); if (mnvm_noErr != result) { goto label_fail; @@ -1114,7 +1114,7 @@ LOCALFUNC tMacErr Sony_Prime(CPTR p) } else #endif { - blnr IsWrite = (0 != (IOTrap & 0x0001)); + bool IsWrite = (0 != (IOTrap & 0x0001)); uint8_t DiskInPlaceV = get_vm_byte(dvl + kDiskInPlace); if (DiskInPlaceV != 0x02) { @@ -1355,7 +1355,7 @@ LOCALFUNC tMacErr Sony_Control(CPTR p) if (get_vm_word(dvl + kQType) != 0) { put_vm_long(ParamBlk + kcsParam, - my_disk_icon_addr); + disk_icon_addr); result = mnvm_noErr; } else { result = mnvm_controlErr; diff --git a/src/SYSDEPNS.h b/src/SYSDEPNS.h index afa58ed..8a9dc55 100644 --- a/src/SYSDEPNS.h +++ b/src/SYSDEPNS.h @@ -24,13 +24,10 @@ #define SYSDEPNS_H #endif +#include +#include #include "CNFGGLOB.h" - -typedef uint8_t *ui3p; -typedef uint16_t *ui4p; -typedef uint32_t *ui5p; - /* Largest efficiently supported representation types. uimr should be @@ -40,27 +37,23 @@ typedef uint32_t *ui5p; typedef uint32_t uimr; typedef int32_t simr; -#define blnr uint8_t -#define trueblnr 1 -#define falseblnr 0 - #define nullpr ((void *) 0) -#define anyp ui3p +#define anyp uint8_t * /* pascal string, single byte characters */ -#define ps3p ui3p +#define ps3p uint8_t * #ifndef MayInline #define MayInline #endif -#ifndef my_reg_call -#define my_reg_call +#ifndef reg_call +#define reg_call #endif -#ifndef my_osglu_call -#define my_osglu_call +#ifndef osglu_call +#define osglu_call #endif #define LOCALVAR static @@ -97,10 +90,10 @@ typedef int32_t simr; #define LOCALFUNCUSEDONCE LOCALINLINEFUNC #define LOCALPROCUSEDONCE LOCALINLINEPROC -#define GLOBALOSGLUFUNC GLOBALFUNC my_osglu_call -#define EXPORTOSGLUFUNC EXPORTFUNC my_osglu_call -#define GLOBALOSGLUPROC GLOBALFUNC my_osglu_call void -#define EXPORTOSGLUPROC EXPORTFUNC my_osglu_call void +#define GLOBALOSGLUFUNC GLOBALFUNC osglu_call +#define EXPORTOSGLUFUNC EXPORTFUNC osglu_call +#define GLOBALOSGLUPROC GLOBALFUNC osglu_call void +#define EXPORTOSGLUPROC EXPORTFUNC osglu_call void /* For functions in operating system glue that are called by rest of program. @@ -119,24 +112,12 @@ typedef int32_t simr; #define LittleEndianUnaligned 0 #endif -#ifndef uint8_tr -#define uint8_tr uint8_t +#ifndef align_8 +#define align_8 #endif -#ifndef uint16_tr -#define uint16_tr uint16_t -#endif - -#ifndef int32_tr -#define int32_tr int32_t -#endif - -#ifndef my_align_8 -#define my_align_8 -#endif - -#ifndef my_cond_rare -#define my_cond_rare(x) (x) +#ifndef cond_rare +#define cond_rare(x) (x) #endif #ifndef Have_ASR diff --git a/src/UI/MACOSX/OSGLUOSX.c b/src/UI/MACOSX/OSGLUOSX.c index 8af10b2..130c379 100644 --- a/src/UI/MACOSX/OSGLUOSX.c +++ b/src/UI/MACOSX/OSGLUOSX.c @@ -45,14 +45,14 @@ LOCALVAR CFBundleRef AppServBunRef; -LOCALVAR blnr DidApplicationServicesBun = falseblnr; +LOCALVAR bool DidApplicationServicesBun = false; -LOCALFUNC blnr HaveApplicationServicesBun(void) +LOCALFUNC bool HaveApplicationServicesBun(void) { if (! DidApplicationServicesBun) { AppServBunRef = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.ApplicationServices")); - DidApplicationServicesBun = trueblnr; + DidApplicationServicesBun = true; } return (AppServBunRef != NULL); } @@ -61,14 +61,14 @@ LOCALFUNC blnr HaveApplicationServicesBun(void) LOCALVAR CFBundleRef HIToolboxBunRef; -LOCALVAR blnr DidHIToolboxBunRef = falseblnr; +LOCALVAR bool DidHIToolboxBunRef = false; -LOCALFUNC blnr HaveHIToolboxBunRef(void) +LOCALFUNC bool HaveHIToolboxBunRef(void) { if (! DidHIToolboxBunRef) { HIToolboxBunRef = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.HIToolbox")); - DidHIToolboxBunRef = trueblnr; + DidHIToolboxBunRef = true; } return (HIToolboxBunRef != NULL); } @@ -77,14 +77,14 @@ LOCALFUNC blnr HaveHIToolboxBunRef(void) LOCALVAR CFBundleRef AGLBunRef; -LOCALVAR blnr DidAGLBunRef = falseblnr; +LOCALVAR bool DidAGLBunRef = false; -LOCALFUNC blnr HaveAGLBunRef(void) +LOCALFUNC bool HaveAGLBunRef(void) { if (! DidAGLBunRef) { AGLBunRef = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.agl")); - DidAGLBunRef = trueblnr; + DidAGLBunRef = true; } return (AGLBunRef != NULL); } @@ -114,9 +114,9 @@ enum { typedef OSStatus (*SetSystemUIModeProcPtr) (SystemUIMode inMode, SystemUIOptions inOptions); LOCALVAR SetSystemUIModeProcPtr SetSystemUIMode = NULL; -LOCALVAR blnr DidSetSystemUIMode = falseblnr; +LOCALVAR bool DidSetSystemUIMode = false; -LOCALFUNC blnr HaveSetSystemUIMode(void) +LOCALFUNC bool HaveSetSystemUIMode(void) { if (! DidSetSystemUIMode) { if (HaveHIToolboxBunRef()) { @@ -125,7 +125,7 @@ LOCALFUNC blnr HaveSetSystemUIMode(void) CFBundleGetFunctionPointerForName( HIToolboxBunRef, CFSTR("SetSystemUIMode")); } - DidSetSystemUIMode = trueblnr; + DidSetSystemUIMode = true; } return (SetSystemUIMode != NULL); } @@ -138,9 +138,9 @@ typedef OSStatus (*LSCopyDisplayNameForRefProcPtr) (const FSRef *inRef, CFStringRef *outDisplayName); LOCALVAR LSCopyDisplayNameForRefProcPtr LSCopyDisplayNameForRef = NULL; -LOCALVAR blnr DidLSCopyDisplayNameForRef = falseblnr; +LOCALVAR bool DidLSCopyDisplayNameForRef = false; -LOCALFUNC blnr HaveLSCopyDisplayNameForRef(void) +LOCALFUNC bool HaveLSCopyDisplayNameForRef(void) { if (! DidLSCopyDisplayNameForRef) { if (HaveApplicationServicesBun()) { @@ -149,7 +149,7 @@ LOCALFUNC blnr HaveLSCopyDisplayNameForRef(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("LSCopyDisplayNameForRef")); } - DidLSCopyDisplayNameForRef = trueblnr; + DidLSCopyDisplayNameForRef = true; } return (LSCopyDisplayNameForRef != NULL); } @@ -159,9 +159,9 @@ LOCALFUNC blnr HaveLSCopyDisplayNameForRef(void) typedef GLboolean (*aglSetWindowRefProcPtr) (AGLContext ctx, WindowRef window); LOCALVAR aglSetWindowRefProcPtr aglSetWindowRef = NULL; -LOCALVAR blnr DidaglSetWindowRef = falseblnr; +LOCALVAR bool DidaglSetWindowRef = false; -LOCALFUNC blnr HaveaglSetWindowRef(void) +LOCALFUNC bool HaveaglSetWindowRef(void) { if (! DidaglSetWindowRef) { if (HaveAGLBunRef()) { @@ -170,7 +170,7 @@ LOCALFUNC blnr HaveaglSetWindowRef(void) CFBundleGetFunctionPointerForName( AGLBunRef, CFSTR("aglSetWindowRef")); } - DidaglSetWindowRef = trueblnr; + DidaglSetWindowRef = true; } return (aglSetWindowRef != NULL); } @@ -181,9 +181,9 @@ typedef CGrafPtr _AGLDrawable; typedef GLboolean (*aglSetDrawableProcPtr) (AGLContext ctx, _AGLDrawable draw); LOCALVAR aglSetDrawableProcPtr aglSetDrawable = NULL; -LOCALVAR blnr DidaglSetDrawable = falseblnr; +LOCALVAR bool DidaglSetDrawable = false; -LOCALFUNC blnr HaveaglSetDrawable(void) +LOCALFUNC bool HaveaglSetDrawable(void) { if (! DidaglSetDrawable) { if (HaveAGLBunRef()) { @@ -192,7 +192,7 @@ LOCALFUNC blnr HaveaglSetDrawable(void) CFBundleGetFunctionPointerForName( AGLBunRef, CFSTR("aglSetDrawable")); } - DidaglSetDrawable = trueblnr; + DidaglSetDrawable = true; } return (aglSetDrawable != NULL); } @@ -208,9 +208,9 @@ typedef CGDisplayErr CGDirectDisplayID * activeDspys, CGDisplayCount * dspyCnt); LOCALVAR CGGetActiveDisplayListProcPtr CGGetActiveDisplayList = NULL; -LOCALVAR blnr DidCGGetActiveDisplayList = falseblnr; +LOCALVAR bool DidCGGetActiveDisplayList = false; -LOCALFUNC blnr HaveCGGetActiveDisplayList(void) +LOCALFUNC bool HaveCGGetActiveDisplayList(void) { if (! DidCGGetActiveDisplayList) { if (HaveApplicationServicesBun()) { @@ -219,14 +219,14 @@ LOCALFUNC blnr HaveCGGetActiveDisplayList(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGGetActiveDisplayList")); } - DidCGGetActiveDisplayList = trueblnr; + DidCGGetActiveDisplayList = true; } return (CGGetActiveDisplayList != NULL); } #else -#define HaveCGGetActiveDisplayList() trueblnr +#define HaveCGGetActiveDisplayList() true #define CGGetActiveDisplayList CGGetActiveDisplayList #endif /* ! UsingCarbonLib */ @@ -237,9 +237,9 @@ LOCALFUNC blnr HaveCGGetActiveDisplayList(void) typedef CGRect (*CGDisplayBoundsProcPtr) (CGDirectDisplayID display); LOCALVAR CGDisplayBoundsProcPtr CGDisplayBounds = NULL; -LOCALVAR blnr DidCGDisplayBounds = falseblnr; +LOCALVAR bool DidCGDisplayBounds = false; -LOCALFUNC blnr HaveCGDisplayBounds(void) +LOCALFUNC bool HaveCGDisplayBounds(void) { if (! DidCGDisplayBounds) { if (HaveApplicationServicesBun()) { @@ -248,14 +248,14 @@ LOCALFUNC blnr HaveCGDisplayBounds(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGDisplayBounds")); } - DidCGDisplayBounds = trueblnr; + DidCGDisplayBounds = true; } return (CGDisplayBounds != NULL); } #else -#define HaveCGDisplayBounds() trueblnr +#define HaveCGDisplayBounds() true #define CGDisplayBounds CGDisplayBounds #endif /* ! UsingCarbonLib */ @@ -266,9 +266,9 @@ LOCALFUNC blnr HaveCGDisplayBounds(void) typedef size_t (*CGDisplayPixelsWideProcPtr) (CGDirectDisplayID display); LOCALVAR CGDisplayPixelsWideProcPtr CGDisplayPixelsWide = NULL; -LOCALVAR blnr DidCGDisplayPixelsWide = falseblnr; +LOCALVAR bool DidCGDisplayPixelsWide = false; -LOCALFUNC blnr HaveCGDisplayPixelsWide(void) +LOCALFUNC bool HaveCGDisplayPixelsWide(void) { if (! DidCGDisplayPixelsWide) { if (HaveApplicationServicesBun()) { @@ -277,14 +277,14 @@ LOCALFUNC blnr HaveCGDisplayPixelsWide(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGDisplayPixelsWide")); } - DidCGDisplayPixelsWide = trueblnr; + DidCGDisplayPixelsWide = true; } return (CGDisplayPixelsWide != NULL); } #else -#define HaveCGDisplayPixelsWide() trueblnr +#define HaveCGDisplayPixelsWide() true #define CGDisplayPixelsWide CGDisplayPixelsWide #endif /* ! UsingCarbonLib */ @@ -295,9 +295,9 @@ LOCALFUNC blnr HaveCGDisplayPixelsWide(void) typedef size_t (*CGDisplayPixelsHighProcPtr) (CGDirectDisplayID display); LOCALVAR CGDisplayPixelsHighProcPtr CGDisplayPixelsHigh = NULL; -LOCALVAR blnr DidCGDisplayPixelsHigh = falseblnr; +LOCALVAR bool DidCGDisplayPixelsHigh = false; -LOCALFUNC blnr HaveCGDisplayPixelsHigh(void) +LOCALFUNC bool HaveCGDisplayPixelsHigh(void) { if (! DidCGDisplayPixelsHigh) { if (HaveApplicationServicesBun()) { @@ -306,14 +306,14 @@ LOCALFUNC blnr HaveCGDisplayPixelsHigh(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGDisplayPixelsHigh")); } - DidCGDisplayPixelsHigh = trueblnr; + DidCGDisplayPixelsHigh = true; } return (CGDisplayPixelsHigh != NULL); } #else -#define HaveCGDisplayPixelsHigh() trueblnr +#define HaveCGDisplayPixelsHigh() true #define CGDisplayPixelsHigh CGDisplayPixelsHigh #endif /* ! UsingCarbonLib */ @@ -324,9 +324,9 @@ LOCALFUNC blnr HaveCGDisplayPixelsHigh(void) typedef CGDisplayErr (*CGDisplayHideCursorProcPtr) (CGDirectDisplayID display); LOCALVAR CGDisplayHideCursorProcPtr CGDisplayHideCursor = NULL; -LOCALVAR blnr DidCGDisplayHideCursor = falseblnr; +LOCALVAR bool DidCGDisplayHideCursor = false; -LOCALFUNC blnr HaveCGDisplayHideCursor(void) +LOCALFUNC bool HaveCGDisplayHideCursor(void) { if (! DidCGDisplayHideCursor) { if (HaveApplicationServicesBun()) { @@ -335,14 +335,14 @@ LOCALFUNC blnr HaveCGDisplayHideCursor(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGDisplayHideCursor")); } - DidCGDisplayHideCursor = trueblnr; + DidCGDisplayHideCursor = true; } return (CGDisplayHideCursor != NULL); } #else -#define HaveCGDisplayHideCursor() trueblnr +#define HaveCGDisplayHideCursor() true #define CGDisplayHideCursor CGDisplayHideCursor #endif /* ! UsingCarbonLib */ @@ -353,9 +353,9 @@ LOCALFUNC blnr HaveCGDisplayHideCursor(void) typedef CGDisplayErr (*CGDisplayShowCursorProcPtr) (CGDirectDisplayID display); LOCALVAR CGDisplayShowCursorProcPtr CGDisplayShowCursor = NULL; -LOCALVAR blnr DidCGDisplayShowCursor = falseblnr; +LOCALVAR bool DidCGDisplayShowCursor = false; -LOCALFUNC blnr HaveCGDisplayShowCursor(void) +LOCALFUNC bool HaveCGDisplayShowCursor(void) { if (! DidCGDisplayShowCursor) { if (HaveApplicationServicesBun()) { @@ -364,14 +364,14 @@ LOCALFUNC blnr HaveCGDisplayShowCursor(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGDisplayShowCursor")); } - DidCGDisplayShowCursor = trueblnr; + DidCGDisplayShowCursor = true; } return (CGDisplayShowCursor != NULL); } #else -#define HaveCGDisplayShowCursor() trueblnr +#define HaveCGDisplayShowCursor() true #define CGDisplayShowCursor CGDisplayShowCursor #endif /* ! UsingCarbonLib */ @@ -383,9 +383,9 @@ typedef CGDisplayErr (*CGDisplayMoveCursorToPointProcPtr) (CGDirectDisplayID display, CGPoint point); LOCALVAR CGDisplayMoveCursorToPointProcPtr CGDisplayMoveCursorToPoint = NULL; -LOCALVAR blnr DidCGDisplayMoveCursorToPoint = falseblnr; +LOCALVAR bool DidCGDisplayMoveCursorToPoint = false; -LOCALFUNC blnr HaveCGDisplayMoveCursorToPoint(void) +LOCALFUNC bool HaveCGDisplayMoveCursorToPoint(void) { if (! DidCGDisplayMoveCursorToPoint) { if (HaveApplicationServicesBun()) { @@ -394,7 +394,7 @@ LOCALFUNC blnr HaveCGDisplayMoveCursorToPoint(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGDisplayMoveCursorToPoint")); } - DidCGDisplayMoveCursorToPoint = trueblnr; + DidCGDisplayMoveCursorToPoint = true; } return (CGDisplayMoveCursorToPoint != NULL); } @@ -408,9 +408,9 @@ typedef CGEventErr (*CGWarpMouseCursorPositionProcPtr) (CGPoint newCursorPosition); LOCALVAR CGWarpMouseCursorPositionProcPtr CGWarpMouseCursorPosition = NULL; -LOCALVAR blnr DidCGWarpMouseCursorPosition = falseblnr; +LOCALVAR bool DidCGWarpMouseCursorPosition = false; -LOCALFUNC blnr HaveCGWarpMouseCursorPosition(void) +LOCALFUNC bool HaveCGWarpMouseCursorPosition(void) { if (! DidCGWarpMouseCursorPosition) { if (HaveApplicationServicesBun()) { @@ -419,14 +419,14 @@ LOCALFUNC blnr HaveCGWarpMouseCursorPosition(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGWarpMouseCursorPosition")); } - DidCGWarpMouseCursorPosition = trueblnr; + DidCGWarpMouseCursorPosition = true; } return (CGWarpMouseCursorPosition != NULL); } #else -#define HaveCGWarpMouseCursorPosition() trueblnr +#define HaveCGWarpMouseCursorPosition() true #define CGWarpMouseCursorPosition CGWarpMouseCursorPosition #endif /* ! UsingCarbonLib */ @@ -438,9 +438,9 @@ typedef CGEventErr (*CGSetLocalEventsSuppressionIntervalProcPtr) (CFTimeInterval seconds); LOCALVAR CGSetLocalEventsSuppressionIntervalProcPtr CGSetLocalEventsSuppressionInterval = NULL; -LOCALVAR blnr DidCGSetLocalEventsSuppressionInterval = falseblnr; +LOCALVAR bool DidCGSetLocalEventsSuppressionInterval = false; -LOCALFUNC blnr HaveCGSetLocalEventsSuppressionInterval(void) +LOCALFUNC bool HaveCGSetLocalEventsSuppressionInterval(void) { if (! DidCGSetLocalEventsSuppressionInterval) { if (HaveApplicationServicesBun()) { @@ -450,14 +450,14 @@ LOCALFUNC blnr HaveCGSetLocalEventsSuppressionInterval(void) AppServBunRef, CFSTR("CGSetLocalEventsSuppressionInterval")); } - DidCGSetLocalEventsSuppressionInterval = trueblnr; + DidCGSetLocalEventsSuppressionInterval = true; } return (CGSetLocalEventsSuppressionInterval != NULL); } #else -#define HaveCGSetLocalEventsSuppressionInterval() trueblnr +#define HaveCGSetLocalEventsSuppressionInterval() true #define CGSetLocalEventsSuppressionInterval \ CGSetLocalEventsSuppressionInterval @@ -474,9 +474,9 @@ typedef OSStatus (*CreateStandardAlertProcPtr) ( DialogRef * outAlert ); LOCALVAR CreateStandardAlertProcPtr CreateStandardAlert = NULL; -LOCALVAR blnr DidCreateStandardAlert = falseblnr; +LOCALVAR bool DidCreateStandardAlert = false; -LOCALFUNC blnr HaveCreateStandardAlert(void) +LOCALFUNC bool HaveCreateStandardAlert(void) { if (! DidCreateStandardAlert) { if (HaveHIToolboxBunRef()) { @@ -485,14 +485,14 @@ LOCALFUNC blnr HaveCreateStandardAlert(void) CFBundleGetFunctionPointerForName( HIToolboxBunRef, CFSTR("CreateStandardAlert")); } - DidCreateStandardAlert = trueblnr; + DidCreateStandardAlert = true; } return (CreateStandardAlert != NULL); } #else -#define HaveCreateStandardAlert() trueblnr +#define HaveCreateStandardAlert() true #define CreateStandardAlert CreateStandardAlert #endif /* ! UsingCarbonLib */ @@ -506,9 +506,9 @@ typedef OSStatus (*RunStandardAlertProcPtr) ( DialogItemIndex * outItemHit ); LOCALVAR RunStandardAlertProcPtr RunStandardAlert = NULL; -LOCALVAR blnr DidRunStandardAlert = falseblnr; +LOCALVAR bool DidRunStandardAlert = false; -LOCALFUNC blnr HaveRunStandardAlert(void) +LOCALFUNC bool HaveRunStandardAlert(void) { if (! DidRunStandardAlert) { if (HaveHIToolboxBunRef()) { @@ -517,14 +517,14 @@ LOCALFUNC blnr HaveRunStandardAlert(void) CFBundleGetFunctionPointerForName( HIToolboxBunRef, CFSTR("RunStandardAlert")); } - DidRunStandardAlert = trueblnr; + DidRunStandardAlert = true; } return (RunStandardAlert != NULL); } #else -#define HaveRunStandardAlert() trueblnr +#define HaveRunStandardAlert() true #define RunStandardAlert RunStandardAlert #endif /* ! UsingCarbonLib */ @@ -533,9 +533,9 @@ LOCALFUNC blnr HaveRunStandardAlert(void) typedef CGDirectDisplayID (*CGMainDisplayIDProcPtr)(void); LOCALVAR CGMainDisplayIDProcPtr CGMainDisplayID = NULL; -LOCALVAR blnr DidCGMainDisplayID = falseblnr; +LOCALVAR bool DidCGMainDisplayID = false; -LOCALFUNC blnr HaveCGMainDisplayID(void) +LOCALFUNC bool HaveCGMainDisplayID(void) { if (! DidCGMainDisplayID) { if (HaveApplicationServicesBun()) { @@ -544,7 +544,7 @@ LOCALFUNC blnr HaveCGMainDisplayID(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGMainDisplayID")); } - DidCGMainDisplayID = trueblnr; + DidCGMainDisplayID = true; } return (CGMainDisplayID != NULL); } @@ -560,9 +560,9 @@ typedef CGError ); LOCALVAR CGDisplayRegisterReconfigurationCallbackProcPtr CGDisplayRegisterReconfigurationCallback = NULL; -LOCALVAR blnr DidCGDisplayRegisterReconfigurationCallback = falseblnr; +LOCALVAR bool DidCGDisplayRegisterReconfigurationCallback = false; -LOCALFUNC blnr HaveCGDisplayRegisterReconfigurationCallback(void) +LOCALFUNC bool HaveCGDisplayRegisterReconfigurationCallback(void) { if (! DidCGDisplayRegisterReconfigurationCallback) { if (HaveApplicationServicesBun()) { @@ -572,7 +572,7 @@ LOCALFUNC blnr HaveCGDisplayRegisterReconfigurationCallback(void) AppServBunRef, CFSTR("CGDisplayRegisterReconfigurationCallback")); } - DidCGDisplayRegisterReconfigurationCallback = trueblnr; + DidCGDisplayRegisterReconfigurationCallback = true; } return (CGDisplayRegisterReconfigurationCallback != NULL); } @@ -585,9 +585,9 @@ typedef CGError ); LOCALVAR CGDisplayRemoveReconfigurationCallbackProcPtr CGDisplayRemoveReconfigurationCallback = NULL; -LOCALVAR blnr DidCGDisplayRemoveReconfigurationCallback = falseblnr; +LOCALVAR bool DidCGDisplayRemoveReconfigurationCallback = false; -LOCALFUNC blnr HaveCGDisplayRemoveReconfigurationCallback(void) +LOCALFUNC bool HaveCGDisplayRemoveReconfigurationCallback(void) { if (! DidCGDisplayRemoveReconfigurationCallback) { if (HaveApplicationServicesBun()) { @@ -597,7 +597,7 @@ LOCALFUNC blnr HaveCGDisplayRemoveReconfigurationCallback(void) AppServBunRef, CFSTR("CGDisplayRemoveReconfigurationCallback")); } - DidCGDisplayRemoveReconfigurationCallback = trueblnr; + DidCGDisplayRemoveReconfigurationCallback = true; } return (CGDisplayRemoveReconfigurationCallback != NULL); } @@ -606,9 +606,9 @@ LOCALFUNC blnr HaveCGDisplayRemoveReconfigurationCallback(void) typedef boolean_t (*CGCursorIsVisibleProcPtr)(void); LOCALVAR CGCursorIsVisibleProcPtr CGCursorIsVisible = NULL; -LOCALVAR blnr DidCGCursorIsVisible = falseblnr; +LOCALVAR bool DidCGCursorIsVisible = false; -LOCALFUNC blnr HaveCGCursorIsVisible(void) +LOCALFUNC bool HaveCGCursorIsVisible(void) { if (! DidCGCursorIsVisible) { if (HaveApplicationServicesBun()) { @@ -617,7 +617,7 @@ LOCALFUNC blnr HaveCGCursorIsVisible(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGCursorIsVisible")); } - DidCGCursorIsVisible = trueblnr; + DidCGCursorIsVisible = true; } return (CGCursorIsVisible != NULL); } @@ -676,7 +676,7 @@ LOCALPROC UniCharStrFromSubstCStr(int *L, UniChar *x, char *s) LOCALFUNC tMacErr MakeFSRefUniChar(FSRef *ParentRef, UniCharCount fileNameLength, const UniChar *fileName, - blnr *isFolder, FSRef *ChildRef) + bool *isFolder, FSRef *ChildRef) { tMacErr err; Boolean isFolder0; @@ -695,7 +695,7 @@ LOCALFUNC tMacErr MakeFSRefUniChar(FSRef *ParentRef, } LOCALFUNC tMacErr MakeFSRefC(FSRef *ParentRef, char *fileName, - blnr *isFolder, FSRef *ChildRef) + bool *isFolder, FSRef *ChildRef) { int L; UniChar x[ClStrMaxLength]; @@ -710,7 +710,7 @@ LOCALFUNC tMacErr OpenNamedFileInFolderRef(FSRef *ParentRef, char *fileName, short *refnum) { tMacErr err; - blnr isFolder; + bool isFolder; FSRef ChildRef; HFSUniStr255 forkName; @@ -732,7 +732,7 @@ LOCALFUNC tMacErr OpenWriteNamedFileInFolderRef(FSRef *ParentRef, char *fileName, short *refnum) { tMacErr err; - blnr isFolder; + bool isFolder; FSRef ChildRef; HFSUniStr255 forkName; int L; @@ -761,7 +761,7 @@ LOCALFUNC tMacErr FindNamedChildRef(FSRef *ParentRef, char *ChildName, FSRef *ChildRef) { tMacErr err; - blnr isFolder; + bool isFolder; if (CheckSavetMacErr(MakeFSRefC(ParentRef, ChildName, &isFolder, ChildRef))) @@ -779,7 +779,7 @@ LOCALFUNC tMacErr FindOrMakeNamedChildRef(FSRef *ParentRef, char *ChildName, FSRef *ChildRef) { tMacErr err; - blnr isFolder; + bool isFolder; int L; UniChar x[ClStrMaxLength]; @@ -812,7 +812,7 @@ LOCALPROC UnInitApplInfo(void) } } -LOCALFUNC blnr InitApplInfo(void) +LOCALFUNC bool InitApplInfo(void) { ProcessSerialNumber currentProcess = {0, kCurrentProcess}; FSRef fsRef; @@ -838,15 +838,15 @@ LOCALFUNC blnr InitApplInfo(void) if (HaveLSCopyDisplayNameForRef()) { if (noErr == LSCopyDisplayNameForRef(&fsRef, &AppName)) { - return trueblnr; + return true; } } if (noErr == CopyProcessName(¤tProcess, &AppName)) { - return trueblnr; + return true; } } - return falseblnr; + return false; } /* --- sending debugging info to file --- */ @@ -855,7 +855,7 @@ LOCALFUNC blnr InitApplInfo(void) LOCALVAR SInt16 dbglog_File = NotAfileRef; -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { tMacErr err; @@ -937,7 +937,7 @@ LOCALPROC UpdateTrueEmulatedTime(void) } } -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -947,7 +947,7 @@ GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) LOCALVAR CFAbsoluteTime ATimeBase; LOCALVAR uint32_t TimeSecBase; -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { uint32_t NewMacDateInSecond = TimeSecBase + (uint32_t)(CFAbsoluteTimeGetCurrent() - ATimeBase); @@ -962,9 +962,9 @@ LOCALFUNC blnr CheckDateTime(void) if (CurMacDateInSeconds != NewMacDateInSecond) { CurMacDateInSeconds = NewMacDateInSecond; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } @@ -976,7 +976,7 @@ LOCALFUNC blnr CheckDateTime(void) LOCALVAR SInt16 Drives[NumDrives]; /* open disk image files */ -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -1192,15 +1192,15 @@ LOCALVAR short vOffset; #endif #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif #if EnableMagnify @@ -1246,9 +1246,9 @@ LOCALPROC SetScrnRectFromCoords(Rect *r, #endif } -LOCALVAR ui3p ScalingBuff = nullpr; +LOCALVAR uint8_t * ScalingBuff = nullpr; -LOCALVAR ui3p CLUT_final; +LOCALVAR uint8_t * CLUT_final; #define CLUT_finalsz1 (256 * 8) @@ -1313,9 +1313,9 @@ LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left, if (! ColorTransValid) { int j; int k; - ui5p p4; + uint32_t * p4; - p4 = (ui5p)CLUT_final; + p4 = (uint32_t *)CLUT_final; for (i = 0; i < 256; ++i) { for (k = 1 << (3 - vMacScreenDepth); --k >= 0; ) { j = (i >> (k << vMacScreenDepth)) & (CLUT_size - 1); @@ -1324,7 +1324,7 @@ LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left, | ((long)CLUT_blues[j] & 0xFF00); } } - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateMappedColorCopy(top, left, bottom, right); @@ -1338,14 +1338,14 @@ LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left, { if (! ColorTransValid) { int k; - ui3p p4 = (ui3p)CLUT_final; + uint8_t * p4 = (uint8_t *)CLUT_final; for (i = 0; i < 256; ++i) { for (k = 8; --k >= 0; ) { *p4++ = ((i >> k) & 0x01) - 1; } } - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateBWLuminanceCopy(top, left, bottom, right); @@ -1499,13 +1499,13 @@ LOCALPROC DrawChangesAndClear(void) } -LOCALVAR blnr MouseIsOutside = falseblnr; +LOCALVAR bool MouseIsOutside = false; /* MouseIsOutside true if sure mouse outside our window. If in our window, or not sure, set false. */ -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool WantCursorHidden = false; LOCALPROC MousePositionNotify(Point NewMousePos) { @@ -1515,7 +1515,7 @@ LOCALPROC MousePositionNotify(Point NewMousePos) */ Rect r; - blnr ShouldHaveCursorHidden = ! MouseIsOutside; + bool ShouldHaveCursorHidden = ! MouseIsOutside; GetWindowBounds(gMainWindow, kWindowContentRgn, &r); @@ -1560,17 +1560,17 @@ LOCALPROC MousePositionNotify(Point NewMousePos) { if (NewMousePos.h < 0) { NewMousePos.h = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePos.h >= vMacScreenWidth) { NewMousePos.h = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePos.v < 0) { NewMousePos.v = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePos.v >= vMacScreenHeight) { NewMousePos.v = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } /* if (ShouldHaveCursorHidden || CurMouseButton) */ @@ -1600,8 +1600,8 @@ LOCALPROC CheckMouseState(void) MousePositionNotify(NewMousePos); } -LOCALVAR blnr gLackFocusFlag = falseblnr; -LOCALVAR blnr gWeAreActive = falseblnr; +LOCALVAR bool gLackFocusFlag = false; +LOCALVAR bool gWeAreActive = false; GLOBALOSGLUPROC DoneWithDrawingForTick(void) { @@ -1613,7 +1613,7 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void) DrawChangesAndClear(); } -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool CurSpeedStopped = true; /* --- keyboard --- */ @@ -1773,12 +1773,12 @@ LOCALPROC HideCursor(void) } } -LOCALVAR blnr HaveCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; ShowCursor(); } } @@ -1791,7 +1791,7 @@ LOCALPROC SetCursorArrow(void) } #if EnableMoveMouse -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { Point CurMousePos; Rect r; @@ -1857,7 +1857,7 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) } #endif - return trueblnr; + return true; } #endif @@ -1876,14 +1876,14 @@ LOCALPROC AdjustMouseMotionGrab(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } } else #endif { if (HaveMouseMotion) { (void) MoveMouse(CurMouseH, CurMouseV); - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -1914,14 +1914,14 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } #endif #if 0 -LOCALFUNC blnr InitMousePosition(void) +LOCALFUNC bool InitMousePosition(void) { /* Since there doesn't seem to be any nondeprecated @@ -1936,12 +1936,12 @@ LOCALFUNC blnr InitMousePosition(void) { CurMouseH = 16; CurMouseV = 16; - WantCursorHidden = trueblnr; + WantCursorHidden = true; (void) MoveMouse(CurMouseH, CurMouseV); } #endif - return trueblnr; + return true; } #endif @@ -1949,7 +1949,7 @@ LOCALFUNC blnr InitMousePosition(void) #include "DATE2SEC.h" -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { #if AutoLocation || AutoTimeZone MachineLocation loc; @@ -1987,7 +1987,7 @@ LOCALFUNC blnr InitLocationDat(void) OnTrueTime = TrueEmulatedTime; - return trueblnr; + return true; } LOCALPROC StartUpTimeAdjust(void) @@ -2107,20 +2107,20 @@ LOCALPROC Sound_WroteABlock(void) #endif } -LOCALFUNC blnr Sound_EndWrite0(uint16_t actL) +LOCALFUNC bool Sound_EndWrite0(uint16_t actL) { - blnr v; + bool v; TheWriteOffset += actL; if (0 != (TheWriteOffset & kOneBuffMask)) { - v = falseblnr; + v = false; } else { /* just finished a block */ Sound_WroteABlock(); - v = trueblnr; + v = true; } return v; @@ -2175,10 +2175,10 @@ struct SoundR { volatile uint16_t (*fFillOffset); volatile uint16_t (*fMinFilledSoundBuffs); - volatile blnr PlayingBuffBlock; + volatile bool PlayingBuffBlock; volatile trSoundSamp lastv; - volatile blnr wantplaying; - volatile blnr StartingBlocks; + volatile bool wantplaying; + volatile bool StartingBlocks; CmpSoundHeader /* ExtSoundHeader */ soundHeader; }; @@ -2210,7 +2210,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) { SoundR *datp = (SoundR *)(theCallBackCmd->param2); - blnr wantplaying0 = datp->wantplaying; + bool wantplaying0 = datp->wantplaying; trSoundSamp v0 = datp->lastv; #if dbglog_SoundStuff @@ -2224,7 +2224,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) #endif *datp->fPlayOffset += kOneBuffLen; - datp->PlayingBuffBlock = falseblnr; + datp->PlayingBuffBlock = false; } if ((! wantplaying0) && (kCenterSound == v0)) { @@ -2235,7 +2235,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) SndCommand playCmd; tpSoundSamp p; trSoundSamp v1 = v0; - blnr WantRamp = falseblnr; + bool WantRamp = false; uint16_t CurPlayOffset = *datp->fPlayOffset; uint16_t ToPlayLen = *datp->fFillOffset - CurPlayOffset; uint16_t FilledSoundBuffs = ToPlayLen >> kLnOneBuffLen; @@ -2250,7 +2250,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) #endif v1 = kCenterSound; - WantRamp = trueblnr; + WantRamp = true; } else if (datp->StartingBlocks) { #if dbglog_SoundStuff @@ -2258,7 +2258,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) #endif if ((ToPlayLen >> kLnOneBuffLen) < 12) { - datp->StartingBlocks = falseblnr; + datp->StartingBlocks = false; #if dbglog_SoundStuff dbglog_writeln("have enough samples to start"); #endif @@ -2268,20 +2268,20 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) v1 = ConvertSoundSampleFromNative(*p); } - WantRamp = trueblnr; + WantRamp = true; } else if (0 == FilledSoundBuffs) { #if dbglog_SoundStuff dbglog_writeln("playing under run"); #endif - WantRamp = trueblnr; + WantRamp = true; } else { /* play next sample */ p = datp->fTheSoundBuffer + (CurPlayOffset & kAllBuffMask); - datp->PlayingBuffBlock = trueblnr; + datp->PlayingBuffBlock = true; v1 = ConvertSoundSampleFromNative(*(p + kOneBuffLen - 1)); #if dbglog_SoundStuff @@ -2347,8 +2347,8 @@ LOCALPROC Sound_Start(void) SndCommand callBack; SndChannelPtr chan = NULL; - cur_audio.wantplaying = falseblnr; - cur_audio.StartingBlocks = falseblnr; + cur_audio.wantplaying = false; + cur_audio.StartingBlocks = false; Sound_Start0(); @@ -2356,10 +2356,10 @@ LOCALPROC Sound_Start(void) if (NULL != chan) { sndChannel = chan; - cur_audio.PlayingBuffBlock = falseblnr; + cur_audio.PlayingBuffBlock = false; cur_audio.lastv = kCenterSound; - cur_audio.StartingBlocks = trueblnr; - cur_audio.wantplaying = trueblnr; + cur_audio.StartingBlocks = true; + cur_audio.wantplaying = true; callBack.cmd = callBackCmd; callBack.param1 = 0; /* unused */ @@ -2383,13 +2383,13 @@ LOCALPROC Sound_Stop(void) uint16_t retry_limit = 50; /* half of a second */ SCStatus r; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; #if dbglog_SoundStuff dbglog_writeln("cleared wantplaying"); #endif label_retry: - r.scChannelBusy = falseblnr; /* what is this for? */ + r.scChannelBusy = false; /* what is this for? */ if (noErr != SndChannelStatus(sndChannel, sizeof(SCStatus), &r)) { @@ -2445,7 +2445,7 @@ label_retry: #define SOUND_SAMPLERATE rate22khz /* = 0x56EE8BA3 = (7833600 * 2 / 704) << 16 */ -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { #if dbglog_SoundStuff dbglog_writeln("enter Sound_Init"); @@ -2456,7 +2456,7 @@ LOCALFUNC blnr Sound_Init(void) cur_audio.fPlayOffset = &ThePlayOffset; cur_audio.fFillOffset = &TheFillOffset; cur_audio.fMinFilledSoundBuffs = &MinFilledSoundBuffs; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; /* Init basic per channel information */ cur_audio.soundHeader.sampleRate = SOUND_SAMPLERATE; @@ -2502,9 +2502,9 @@ LOCALFUNC blnr Sound_Init(void) start early. */ - return trueblnr; + return true; } - return falseblnr; + return false; } GLOBALOSGLUPROC Sound_EndWrite(uint16_t actL) @@ -2560,7 +2560,7 @@ LOCALPROC AdjustGLforSize(int h, int v) } } -LOCALVAR blnr WantScreensChangedCheck = falseblnr; +LOCALVAR bool WantScreensChangedCheck = false; LOCALPROC UpdateOpenGLContext(void) { @@ -2781,7 +2781,7 @@ LOCALPROC AdjustMachineGrab(void) #if MayFullScreen LOCALPROC UngrabMachine(void) { - GrabMachine = falseblnr; + GrabMachine = false; AdjustMachineGrab(); } #endif @@ -2789,13 +2789,13 @@ LOCALPROC UngrabMachine(void) LOCALPROC ClearWeAreActive(void) { if (gWeAreActive) { - gWeAreActive = falseblnr; + gWeAreActive = false; DisconnectKeyCodes2(); SavedModifiers &= alphaLock; - MouseButtonSet(falseblnr); + MouseButtonSet(false); #if MayFullScreen UngrabMachine(); @@ -2850,7 +2850,7 @@ LOCALPROC CheckSavedMacMsg(void) } } -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; +LOCALVAR bool gTrueBackgroundFlag = false; LOCALPROC BeginDialog(void) { @@ -2925,7 +2925,7 @@ LOCALPROC UnInitDrives(void) } } -LOCALFUNC tMacErr Sony_Insert0(SInt16 refnum, blnr locked) +LOCALFUNC tMacErr Sony_Insert0(SInt16 refnum, bool locked) { tDrive Drive_No; @@ -2944,12 +2944,12 @@ LOCALPROC ReportStandardOpenDiskError(tMacErr err) if (mnvm_noErr != err) { if (mnvm_tmfoErr == err) { MacMsg(kStrTooManyImagesTitle, - kStrTooManyImagesMessage, falseblnr); + kStrTooManyImagesMessage, false); } else if (mnvm_opWrErr == err) { MacMsg(kStrImageInUseTitle, - kStrImageInUseMessage, falseblnr); + kStrImageInUseMessage, false); } else { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } } @@ -2959,7 +2959,7 @@ LOCALFUNC tMacErr InsertADiskFromFSRef(FSRef *theRef) tMacErr err; HFSUniStr255 forkName; SInt16 refnum; - blnr locked = falseblnr; + bool locked = false; if (CheckSaveMacErr(FSGetDataForkName(&forkName))) { err = To_tMacErr(FSOpenFork(theRef, forkName.length, @@ -2968,7 +2968,7 @@ LOCALFUNC tMacErr InsertADiskFromFSRef(FSRef *theRef) case mnvm_permErr: case mnvm_wrPermErr: case mnvm_afpAccessDenied: - locked = trueblnr; + locked = true; err = To_tMacErr(FSOpenFork(theRef, forkName.length, forkName.unicode, fsRdPerm, &refnum)); break; @@ -3070,7 +3070,7 @@ LOCALFUNC tMacErr InsertADiskFromNameEtc(FSRef *ParentRef, char *fileName) { tMacErr err; - blnr isFolder; + bool isFolder; FSRef ChildRef; if (CheckSavetMacErr(MakeFSRefC(ParentRef, fileName, @@ -3171,7 +3171,7 @@ LOCALFUNC tMacErr MakeNewDisk0(FSRef *saveFileParent, */ if (CheckSavetMacErr(WriteZero(refnum, L))) { - err = Sony_Insert0(refnum, falseblnr); + err = Sony_Insert0(refnum, false); refnum = NotAfileRef; } if (NotAfileRef != refnum) { @@ -3371,7 +3371,7 @@ LOCALFUNC tMacErr LoadMacRomFromNameFolder(FSRef *ParentRef, char *fileName) { tMacErr err; - blnr isFolder; + bool isFolder; FSRef ChildRef; if (mnvm_noErr == (err = @@ -3406,7 +3406,7 @@ LOCALFUNC tMacErr LoadMacRomFromPrefDir(void) return err; } -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -3417,15 +3417,15 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { tMacErr err = mnvm_noErr; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - return falseblnr; + return false; } else { char s[16] = "disk?.dsk"; @@ -3437,14 +3437,14 @@ LOCALFUNC blnr Sony_InsertIth(int i) ReportStandardOpenDiskError(err); } /* stop on first error (including file not found) */ - return falseblnr; + return false; } } - return trueblnr; + return true; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { int i; @@ -3452,7 +3452,7 @@ LOCALFUNC blnr LoadInitialImages(void) /* stop on first error (including file not found) */ } - return trueblnr; + return true; } #if UseActvFile @@ -3481,7 +3481,7 @@ LOCALFUNC tMacErr OpenActvCodeFile(SInt16 *refnum) return err; } -LOCALFUNC tMacErr ActvCodeFileLoad(ui3p p) +LOCALFUNC tMacErr ActvCodeFileLoad(uint8_t * p) { tMacErr err; SInt16 refnum; @@ -3496,7 +3496,7 @@ LOCALFUNC tMacErr ActvCodeFileLoad(ui3p p) return err; } -LOCALFUNC tMacErr ActvCodeFileSave(ui3p p) +LOCALFUNC tMacErr ActvCodeFileSave(uint8_t * p) { tMacErr err; SInt16 refnum; @@ -3558,14 +3558,14 @@ LOCALPROC SetMacWindContRect(WindowRef mw, Rect *r) #endif #if MayNotFullScreen -LOCALFUNC blnr GetWindowTitleBounds(WindowRef mw, Rect *r) +LOCALFUNC bool GetWindowTitleBounds(WindowRef mw, Rect *r) { return (noErr == GetWindowBounds(mw, kWindowTitleBarRgn, r)); } #endif #if EnableRecreateW && MayNotFullScreen -LOCALFUNC blnr GetWindowContBounds(WindowRef mw, Rect *r) +LOCALFUNC bool GetWindowContBounds(WindowRef mw, Rect *r) { return (noErr == GetWindowBounds(mw, kWindowContentRgn, r)); } @@ -3579,7 +3579,7 @@ LOCALPROC GetGrayRgnBounds(Rect *r) #define openOnly 1 #define openPrint 2 -LOCALFUNC blnr GotRequiredParams(AppleEvent *theAppleEvent) +LOCALFUNC bool GotRequiredParams(AppleEvent *theAppleEvent) { DescType typeCode; Size actualSize; @@ -3588,15 +3588,15 @@ LOCALFUNC blnr GotRequiredParams(AppleEvent *theAppleEvent) theErr = AEGetAttributePtr(theAppleEvent, keyMissedKeywordAttr, typeWildCard, &typeCode, NULL, 0, &actualSize); if (errAEDescNotFound == theErr) { /* No more required params. */ - return trueblnr; + return true; } else if (noErr == theErr) { /* More required params! */ - return /* CheckSysCode(errAEEventNotHandled) */ falseblnr; + return /* CheckSysCode(errAEEventNotHandled) */ false; } else { /* Unexpected Error! */ - return /* CheckSysCode(theErr) */ falseblnr; + return /* CheckSysCode(theErr) */ false; } } -LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) +LOCALFUNC bool GotRequiredParams0(AppleEvent *theAppleEvent) { DescType typeCode; Size actualSize; @@ -3605,11 +3605,11 @@ LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) theErr = AEGetAttributePtr(theAppleEvent, keyMissedKeywordAttr, typeWildCard, &typeCode, NULL, 0, &actualSize); if (errAEDescNotFound == theErr) { /* No more required params. */ - return trueblnr; + return true; } else if (noErr == theErr) { /* More required params! */ - return trueblnr; /* errAEEventNotHandled; */ /*^*/ + return true; /* errAEEventNotHandled; */ /*^*/ } else { /* Unexpected Error! */ - return /* CheckSysCode(theErr) */ falseblnr; + return /* CheckSysCode(theErr) */ false; } } @@ -3662,15 +3662,15 @@ LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) UnusedParam(reply); UnusedParam(aRefCon); if (GotRequiredParams(theAppleEvent)) { - RequestMacOff = trueblnr; + RequestMacOff = true; } return /* GetASysResultCode() */ 0; } -LOCALFUNC blnr InstallEventHandler(AEEventClass theAEEventClass, +LOCALFUNC bool InstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, ProcPtr p, - long handlerRefcon, blnr isSysHandler) + long handlerRefcon, bool isSysHandler) { return noErr == (AEInstallEventHandler(theAEEventClass, theAEEventID, NewAEEventHandlerUPP((AEEventHandlerProcPtr)p), @@ -3681,13 +3681,13 @@ LOCALPROC InstallAppleEventHandlers(void) { if (noErr == AESetInteractionAllowed(kAEInteractWithLocal)) if (InstallEventHandler(kCoreEventClass, kAEOpenApplication, - (ProcPtr)DoOpenEvent, 0, falseblnr)) + (ProcPtr)DoOpenEvent, 0, false)) if (InstallEventHandler(kCoreEventClass, kAEOpenDocuments, - (ProcPtr)OpenOrPrintFiles, openOnly, falseblnr)) + (ProcPtr)OpenOrPrintFiles, openOnly, false)) if (InstallEventHandler(kCoreEventClass, kAEPrintDocuments, - (ProcPtr)OpenOrPrintFiles, openPrint, falseblnr)) + (ProcPtr)OpenOrPrintFiles, openPrint, false)) if (InstallEventHandler(kCoreEventClass, kAEQuitApplication, - (ProcPtr)DoQuitEvent, 0, falseblnr)) + (ProcPtr)DoQuitEvent, 0, false)) { } } @@ -3817,9 +3817,9 @@ LOCALPROC UnPrepareForDragging(void) } } -LOCALFUNC blnr PrepareForDragging(void) +LOCALFUNC bool PrepareForDragging(void) { - blnr IsOk = falseblnr; + bool IsOk = false; gGlobalTrackingHandler = NewDragTrackingHandlerUPP( GlobalTrackingHandler); @@ -3833,7 +3833,7 @@ LOCALFUNC blnr PrepareForDragging(void) if (noErr == InstallReceiveHandler( gGlobalReceiveHandler, gMainWindow, nil)) { - IsOk = trueblnr; + IsOk = true; } } } @@ -3874,7 +3874,7 @@ LOCALPROC HandleEventModifiers(EventRef theEvent) } } -LOCALVAR blnr IsOurMouseMove; +LOCALVAR bool IsOurMouseMove; static pascal OSStatus windowEventHandler( EventHandlerCallRef nextHandler, EventRef theEvent, @@ -3890,7 +3890,7 @@ static pascal OSStatus windowEventHandler( case kEventClassWindow: switch(eventKind) { case kEventWindowClose: - RequestMacOff = trueblnr; + RequestMacOff = true; result = noErr; break; case kEventWindowDrawContent: @@ -3898,14 +3898,14 @@ static pascal OSStatus windowEventHandler( result = noErr; break; case kEventWindowClickContentRgn: - MouseIsOutside = falseblnr; + MouseIsOutside = false; HandleEventLocation(theEvent); HandleEventModifiers(theEvent); - MouseButtonSet(trueblnr); + MouseButtonSet(true); result = noErr; break; case kEventWindowFocusAcquired: - gLackFocusFlag = falseblnr; + gLackFocusFlag = false; result = noErr; break; case kEventWindowFocusRelinquish: @@ -3919,7 +3919,7 @@ static pascal OSStatus windowEventHandler( && (window != gOldWindow)) { ClearWeAreActive(); - gLackFocusFlag = trueblnr; + gLackFocusFlag = true; } } result = noErr; @@ -3930,12 +3930,12 @@ static pascal OSStatus windowEventHandler( switch(eventKind) { case kEventMouseMoved: case kEventMouseDragged: - MouseIsOutside = falseblnr; + MouseIsOutside = false; #if 0 /* don't bother, CheckMouseState will take care of it, better */ HandleEventLocation(theEvent); HandleEventModifiers(theEvent); #endif - IsOurMouseMove = trueblnr; + IsOurMouseMove = true; result = noErr; break; } @@ -3945,10 +3945,10 @@ static pascal OSStatus windowEventHandler( return result; } -LOCALFUNC blnr CreateNewWindow(Rect *Bounds, WindowPtr *theWindow) +LOCALFUNC bool CreateNewWindow(Rect *Bounds, WindowPtr *theWindow) { WindowPtr ResultWin; - blnr IsOk = falseblnr; + bool IsOk = false; if (noErr == CreateNewWindow( @@ -4029,7 +4029,7 @@ LOCALFUNC blnr CreateNewWindow(Rect *Bounds, WindowPtr *theWindow) *theWindow = ResultWin; - IsOk = trueblnr; + IsOk = true; } return IsOk; @@ -4085,11 +4085,11 @@ enum { #if MayNotFullScreen LOCALVAR int CurWinIndx; -LOCALVAR blnr HavePositionWins[kNumMagStates]; +LOCALVAR bool HavePositionWins[kNumMagStates]; LOCALVAR Point WinPositionWins[kNumMagStates]; #endif -LOCALFUNC blnr CreateMainWindow(void) +LOCALFUNC bool CreateMainWindow(void) { #if MayNotFullScreen int WinIndx; @@ -4101,7 +4101,7 @@ LOCALFUNC blnr CreateMainWindow(void) short topPos; short NewWindowHeight = vMacScreenHeight; short NewWindowWidth = vMacScreenWidth; - blnr IsOk = falseblnr; + bool IsOk = false; #if VarFullScreen if (UseFullScreen) { @@ -4195,7 +4195,7 @@ LOCALFUNC blnr CreateMainWindow(void) if (! HavePositionWins[WinIndx]) { WinPositionWins[WinIndx].h = leftPos; WinPositionWins[WinIndx].v = topPos; - HavePositionWins[WinIndx] = trueblnr; + HavePositionWins[WinIndx] = true; NewWinRect = MainScrnBounds; } else { SetRect(&NewWinRect, 0, 0, NewWindowWidth, NewWindowHeight); @@ -4228,7 +4228,7 @@ LOCALFUNC blnr CreateMainWindow(void) AGL_NONE}; #if 0 != vMacScreenDepth - ColorModeWorks = trueblnr; + ColorModeWorks = true; #endif window_fmt = aglChoosePixelFormat(NULL, 0, window_attrib); @@ -4296,11 +4296,11 @@ LOCALFUNC blnr CreateMainWindow(void) &agSwapInterval)) { MacMsg("oops", "aglSetInteger failed", - falseblnr); + false); } else { /* MacMsg("good", "aglSetInteger ok", - falseblnr); + false); */ } } @@ -4338,7 +4338,7 @@ LOCALFUNC blnr CreateMainWindow(void) (void) PrepareForDragging(); - IsOk = trueblnr; + IsOk = true; } } } @@ -4372,10 +4372,10 @@ struct WState { uint16_t f_ViewVStart; #endif #if VarFullScreen - blnr f_UseFullScreen; + bool f_UseFullScreen; #endif #if EnableMagnify - blnr f_UseMagnify; + bool f_UseMagnify; #endif #if MayNotFullScreen int f_CurWinIndx; @@ -4451,7 +4451,7 @@ LOCALPROC SetWState(WState *r) #endif #if EnableRecreateW -LOCALFUNC blnr ReCreateMainWindow(void) +LOCALFUNC bool ReCreateMainWindow(void) { WState old_state; WState new_state; @@ -4513,7 +4513,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) WantMagnify = UseMagnify; #endif - return falseblnr; + return false; } else { GetWState(&new_state); SetWState(&old_state); @@ -4523,12 +4523,12 @@ LOCALFUNC blnr ReCreateMainWindow(void) if (HaveCursorHidden) { (void) MoveMouse(CurMouseH, CurMouseV); - WantCursorHidden = trueblnr; + WantCursorHidden = true; } else { - MouseIsOutside = falseblnr; /* don't know */ + MouseIsOutside = false; /* don't know */ } - return trueblnr; + return true; } } #endif @@ -4554,7 +4554,7 @@ LOCALPROC ZapWinStateVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -4588,7 +4588,7 @@ LOCALPROC ToggleWantFullScreen(void) if (kMagStateAuto != NewMagState) { WantMagnify = (kMagStateMagnifgy == NewMagState); } else { - WantMagnify = falseblnr; + WantMagnify = false; if (WantFullScreen && HaveCGDisplayPixelsWide() && HaveCGDisplayPixelsHigh()) @@ -4601,7 +4601,7 @@ LOCALPROC ToggleWantFullScreen(void) >= vMacScreenHeight * WindowScale) ) { - WantMagnify = trueblnr; + WantMagnify = true; } } } @@ -4700,7 +4700,7 @@ LOCALPROC DoNotInBackgroundTasks(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); @@ -4713,18 +4713,18 @@ LOCALPROC CheckForSavedTasks(void) #endif if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } if (! gWeAreActive) { if (! (gTrueBackgroundFlag || gLackFocusFlag)) { - gWeAreActive = trueblnr; + gWeAreActive = true; ReconnectKeyCodes3(); SetCursorArrow(); } @@ -4784,12 +4784,12 @@ LOCALPROC CheckForSavedTasks(void) } if (WantScreensChangedCheck) { - WantScreensChangedCheck = falseblnr; + WantScreensChangedCheck = false; UpdateOpenGLContext(); } if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -4817,12 +4817,12 @@ LOCALPROC CheckForSavedTasks(void) { MakeNewDisk(vSonyNewDiskSize, NULL); } - vSonyNewDiskWanted = falseblnr; + vSonyNewDiskWanted = false; /* must be done after may have gotten disk */ } #endif if (RequestInsertDisk) { - RequestInsertDisk = falseblnr; + RequestInsertDisk = false; InsertADisk0(); } } @@ -4863,10 +4863,10 @@ LOCALFUNC OSStatus ProcessCommand(MenuCommand inCommandID) DoAboutMsg(); break; case kHICommandQuit: - RequestMacOff = trueblnr; + RequestMacOff = true; break; case kHICommandOpen: - RequestInsertDisk = trueblnr; + RequestInsertDisk = true; break; case kCmdIdMoreCommands: DoMoreCommandsMsg(); @@ -4879,7 +4879,7 @@ LOCALFUNC OSStatus ProcessCommand(MenuCommand inCommandID) return result; } -LOCALFUNC OSStatus Keyboard_UpdateKeyMap3(EventRef theEvent, blnr down) +LOCALFUNC OSStatus Keyboard_UpdateKeyMap3(EventRef theEvent, bool down) { UInt32 uiKeyCode; @@ -4908,7 +4908,7 @@ static pascal OSStatus EventHandler(EventHandlerCallRef nextHandler, if (GrabMachine) { HandleEventLocation(theEvent); HandleEventModifiers(theEvent); - MouseButtonSet(trueblnr); + MouseButtonSet(true); result = noErr; } else #endif @@ -4920,7 +4920,7 @@ static pascal OSStatus EventHandler(EventHandlerCallRef nextHandler, case kEventMouseUp: HandleEventLocation(theEvent); HandleEventModifiers(theEvent); - MouseButtonSet(falseblnr); + MouseButtonSet(false); #if MayFullScreen if (GrabMachine) { result = noErr; @@ -4933,7 +4933,7 @@ static pascal OSStatus EventHandler(EventHandlerCallRef nextHandler, break; case kEventMouseMoved: case kEventMouseDragged: - IsOurMouseMove = falseblnr; + IsOurMouseMove = false; result = CallNextEventHandler( nextHandler, theEvent); /* @@ -4944,7 +4944,7 @@ static pascal OSStatus EventHandler(EventHandlerCallRef nextHandler, changes. */ if (! IsOurMouseMove) { - MouseIsOutside = trueblnr; + MouseIsOutside = true; #if 0 /* don't bother, CheckMouseState will take care of it, better */ HandleEventLocation(theEvent); HandleEventModifiers(theEvent); @@ -4956,11 +4956,11 @@ static pascal OSStatus EventHandler(EventHandlerCallRef nextHandler, case kEventClassApplication: switch (eventKind) { case kEventAppActivated: - gTrueBackgroundFlag = falseblnr; + gTrueBackgroundFlag = false; result = noErr; break; case kEventAppDeactivated: - gTrueBackgroundFlag = trueblnr; + gTrueBackgroundFlag = true; result = noErr; ClearWeAreActive(); break; @@ -4987,11 +4987,11 @@ static pascal OSStatus EventHandler(EventHandlerCallRef nextHandler, switch (eventKind) { case kEventRawKeyDown: result = Keyboard_UpdateKeyMap3( - theEvent, trueblnr); + theEvent, true); break; case kEventRawKeyUp: result = Keyboard_UpdateKeyMap3( - theEvent, falseblnr); + theEvent, false); break; case kEventRawKeyModifiersChanged: HandleEventModifiers(theEvent); @@ -5062,7 +5062,7 @@ LOCALPROC RemoveCommandKeysInMenu(MenuRef theMenu) } } -LOCALFUNC blnr InstallOurMenus(void) +LOCALFUNC bool InstallOurMenus(void) { MenuRef menu; Str255 s; @@ -5106,16 +5106,16 @@ LOCALFUNC blnr InstallOurMenus(void) DrawMenuBar(); - return trueblnr; + return true; } -LOCALFUNC blnr InstallOurAppearanceClient(void) +LOCALFUNC bool InstallOurAppearanceClient(void) { RegisterAppearanceClient(); /* maybe not needed ? */ - return trueblnr; + return true; } -LOCALVAR blnr DisplayRegistrationCallBackSuccessful = falseblnr; +LOCALVAR bool DisplayRegistrationCallBackSuccessful = false; static void DisplayRegisterReconfigurationCallback( CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, @@ -5160,7 +5160,7 @@ static void DisplayRegisterReconfigurationCallback( } #endif - WantScreensChangedCheck = trueblnr; + WantScreensChangedCheck = true; #if VarFullScreen if (WantFullScreen) { @@ -5170,7 +5170,7 @@ static void DisplayRegisterReconfigurationCallback( } } -LOCALFUNC blnr InstallOurEventHandlers(void) +LOCALFUNC bool InstallOurEventHandlers(void) { EventTypeSpec eventTypes[] = { {kEventClassMouse, kEventMouseDown}, @@ -5199,13 +5199,13 @@ LOCALFUNC blnr InstallOurEventHandlers(void) CGDisplayRegisterReconfigurationCallback( DisplayRegisterReconfigurationCallback, NULL)) { - DisplayRegistrationCallBackSuccessful = trueblnr; + DisplayRegistrationCallBackSuccessful = true; } } /* (void) SetMouseCoalescingEnabled(false, NULL); */ - return trueblnr; + return true; } LOCALPROC UnInstallOurEventHandlers(void) @@ -5304,51 +5304,51 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); ReserveAllocOneBlock(&ScalingBuff, vMacScreenNumPixels #if 0 != vMacScreenDepth * 4 #endif - , 5, falseblnr); - ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, falseblnr); + , 5, false); + ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, false); #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } return IsOk; } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { if (AllocMemory()) if (InitApplInfo()) @@ -5370,9 +5370,9 @@ LOCALFUNC blnr InitOSGLU(void) if (InitLocationDat()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } #if dbglog_HAVE && 0 diff --git a/src/UI/MYOSGLUE.h b/src/UI/MYOSGLUE.h index 96febc1..b0bb645 100644 --- a/src/UI/MYOSGLUE.h +++ b/src/UI/MYOSGLUE.h @@ -48,13 +48,13 @@ EXPORTOSGLUPROC dbglog_writeln(char *s); EXPORTOSGLUPROC dbglog_writelnNum(char *s, simr v); #endif -EXPORTOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n, uint8_t align, - blnr FillOnes); +EXPORTOSGLUPROC ReserveAllocOneBlock(uint8_t * *p, uimr n, uint8_t align, + bool FillOnes); EXPORTOSGLUPROC MoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount); -EXPORTVAR(ui3p, ROM) +EXPORTVAR(uint8_t *, ROM) /* error codes returned by Mini vMac extensions @@ -113,8 +113,8 @@ EXPORTOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, uint32_t *Count); EXPORTOSGLUFUNC tMacErr PbufNew(uint32_t count, tPbuf *r); EXPORTOSGLUPROC PbufDispose(tPbuf i); -EXPORTOSGLUPROC PbufTransfer(ui3p Buffer, - tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite); +EXPORTOSGLUPROC PbufTransfer(uint8_t * Buffer, + tPbuf i, uint32_t offset, uint32_t count, bool IsWrite); #endif @@ -126,21 +126,21 @@ EXPORTVAR(uint32_t, vSonyInsertedMask) #define vSonyIsInserted(Drive_No) \ ((vSonyInsertedMask & ((uint32_t)1 << (Drive_No))) != 0) -EXPORTOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +EXPORTOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount); EXPORTOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No); EXPORTOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count); -EXPORTOSGLUFUNC blnr AnyDiskInserted(void); +EXPORTOSGLUFUNC bool AnyDiskInserted(void); EXPORTOSGLUPROC DiskRevokeWritable(tDrive Drive_No); #if IncludeSonyRawMode -EXPORTVAR(blnr, vSonyRawMode) +EXPORTVAR(bool, vSonyRawMode) #endif #if IncludeSonyNew -EXPORTVAR(blnr, vSonyNewDiskWanted) +EXPORTVAR(bool, vSonyNewDiskWanted) EXPORTVAR(uint32_t, vSonyNewDiskSize) EXPORTOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No); #endif @@ -182,12 +182,12 @@ EXPORTVAR(uint32_t, CurMacDelta) #define vMacScreenMonoByteWidth ((long)vMacScreenWidth / 8) #if 0 != vMacScreenDepth -EXPORTVAR(blnr, UseColorMode) -EXPORTVAR(blnr, ColorModeWorks) +EXPORTVAR(bool, UseColorMode) +EXPORTVAR(bool, ColorModeWorks) #endif #if 0 != vMacScreenDepth -EXPORTVAR(blnr, ColorMappingChanged) +EXPORTVAR(bool, ColorMappingChanged) #endif #if (0 != vMacScreenDepth) && (vMacScreenDepth < 4) @@ -198,24 +198,24 @@ EXPORTVAR(uint16_t, CLUT_greens[CLUT_size]) EXPORTVAR(uint16_t, CLUT_blues[CLUT_size]) #endif -EXPORTVAR(blnr, EmVideoDisable) +EXPORTVAR(bool, EmVideoDisable) EXPORTVAR(int8_t, EmLagTime) -EXPORTOSGLUPROC Screen_OutputFrame(ui3p screencurrentbuff); +EXPORTOSGLUPROC Screen_OutputFrame(uint8_t * screencurrentbuff); EXPORTOSGLUPROC DoneWithDrawingForTick(void); -EXPORTVAR(blnr, ForceMacOff) +EXPORTVAR(bool, ForceMacOff) -EXPORTVAR(blnr, WantMacInterrupt) +EXPORTVAR(bool, WantMacInterrupt) -EXPORTVAR(blnr, WantMacReset) +EXPORTVAR(bool, WantMacReset) -EXPORTOSGLUFUNC blnr ExtraTimeNotOver(void); +EXPORTOSGLUFUNC bool ExtraTimeNotOver(void); EXPORTVAR(uint8_t, SpeedValue) #if EnableAutoSlow -EXPORTVAR(blnr, WantNotAutoSlow) +EXPORTVAR(bool, WantNotAutoSlow) #endif /* where emulated machine thinks mouse is */ @@ -238,12 +238,12 @@ EXPORTVAR(uint32_t, QuietSubTicks) #if 3 == kLn2SoundSampSz #define trSoundSamp uint8_t #define tbSoundSamp uint8_t -#define tpSoundSamp ui3p +#define tpSoundSamp uint8_t * #define kCenterSound 0x80 #elif 4 == kLn2SoundSampSz #define trSoundSamp uint16_t #define tbSoundSamp uint16_t -#define tpSoundSamp ui4p +#define tpSoundSamp uint16_t * #define kCenterSound 0x8000 #else #error "unsupported kLn2SoundSampSz" @@ -260,12 +260,12 @@ EXPORTOSGLUPROC Sound_EndWrite(uint16_t actL); #if EmLocalTalk #define LT_TxBfMxSz 1024 -EXPORTVAR(ui3p, LT_TxBuffer) +EXPORTVAR(uint8_t *, LT_TxBuffer) EXPORTVAR(uint16_t, LT_TxBuffSz) EXPORTOSGLUPROC LT_TransmitPacket(void); -EXPORTVAR(ui3p, LT_RxBuffer) +EXPORTVAR(uint8_t *, LT_RxBuffer) EXPORTVAR(uint32_t, LT_RxBuffSz) EXPORTOSGLUPROC LT_ReceivePacket(void); diff --git a/src/UI/OLDMAC/OSGLUMAC.c b/src/UI/OLDMAC/OSGLUMAC.c index 65539cc..e6877ab 100644 --- a/src/UI/OLDMAC/OSGLUMAC.c +++ b/src/UI/OLDMAC/OSGLUMAC.c @@ -86,75 +86,75 @@ #define DebugTrapAvailableChecks 0 #endif -LOCALFUNC blnr LowToolTrapAvailable(short trap_num) +LOCALFUNC bool LowToolTrapAvailable(short trap_num) { #if DebugTrapAvailableChecks if ((trap_num & 0x0800) == 0) { DebugStr("\pOSTrap in LowToolTrapAvailable"); - return falseblnr; + return false; } if ((trap_num & 0x07ff) >= 0x200) { DebugStr("\pHiToolTrap in LowToolTrapAvailable"); - return falseblnr; + return false; } #endif return GetToolTrapAddress(trap_num) != GetToolTrapAddress(_Unimplemented); } -LOCALFUNC blnr HiToolTrapAvailable(short trap_num) +LOCALFUNC bool HiToolTrapAvailable(short trap_num) { #if DebugTrapAvailableChecks if ((trap_num & 0x0800) == 0) { DebugStr("\pOSTrap in HiToolTrapAvailable"); - return falseblnr; + return false; } if (((trap_num & 0x07ff) < 0x200) || ((trap_num & 0x07ff) >= 0x400)) { DebugStr("\pLowToolTrap in HiToolTrapAvailable"); - return falseblnr; + return false; } #endif if (GetToolTrapAddress(_InitGraf) == GetToolTrapAddress(0xAA6E)) { - return falseblnr; + return false; } else { return GetToolTrapAddress(trap_num) != GetToolTrapAddress(_Unimplemented); } } -LOCALFUNC blnr OSTrapAvailable(short trap_num) +LOCALFUNC bool OSTrapAvailable(short trap_num) { #if DebugTrapAvailableChecks if ((trap_num & 0x0800) != 0) { DebugStr("\pToolTrap in ToolTrapAvailable"); - return falseblnr; + return false; } #endif return GetOSTrapAddress(trap_num) != GetToolTrapAddress(_Unimplemented); } -LOCALVAR blnr EnvrAttrWaitNextEventAvail; -LOCALVAR blnr HaveEnvrAttrWaitNextEventAvail = falseblnr; +LOCALVAR bool EnvrAttrWaitNextEventAvail; +LOCALVAR bool HaveEnvrAttrWaitNextEventAvail = false; -LOCALFUNC blnr HaveWaitNextEventAvail(void) +LOCALFUNC bool HaveWaitNextEventAvail(void) { if (! HaveEnvrAttrWaitNextEventAvail) { EnvrAttrWaitNextEventAvail = LowToolTrapAvailable(_WaitNextEvent); - HaveEnvrAttrWaitNextEventAvail = trueblnr; + HaveEnvrAttrWaitNextEventAvail = true; } return EnvrAttrWaitNextEventAvail; } -LOCALVAR blnr EnvrAttrGestaltAvail; -LOCALVAR blnr HaveEnvrAttrGestaltAvail = falseblnr; +LOCALVAR bool EnvrAttrGestaltAvail; +LOCALVAR bool HaveEnvrAttrGestaltAvail = false; -LOCALFUNC blnr HaveGestaltAvail(void) +LOCALFUNC bool HaveGestaltAvail(void) { if (! HaveEnvrAttrGestaltAvail) { EnvrAttrGestaltAvail = @@ -168,7 +168,7 @@ LOCALFUNC blnr HaveGestaltAvail(void) GetOSTrapAddress and GetToolTrapAddress are the same as GetTrapAddress on a 64k ROM. */ - HaveEnvrAttrGestaltAvail = trueblnr; + HaveEnvrAttrGestaltAvail = true; } return EnvrAttrGestaltAvail; } @@ -177,15 +177,15 @@ LOCALFUNC blnr HaveGestaltAvail(void) /* for PowerPC, assume always have these routines */ -#define HaveWaitNextEventAvail() trueblnr -#define HaveGestaltAvail() trueblnr +#define HaveWaitNextEventAvail() true +#define HaveGestaltAvail() true #endif -LOCALVAR blnr EnvrAttrAliasMgrAvail; -LOCALVAR blnr HaveEnvrAttrAliasMgrAvail = falseblnr; +LOCALVAR bool EnvrAttrAliasMgrAvail; +LOCALVAR bool HaveEnvrAttrAliasMgrAvail = false; -LOCALFUNC blnr HaveAliasMgrAvail(void) +LOCALFUNC bool HaveAliasMgrAvail(void) { if (! HaveEnvrAttrAliasMgrAvail) { long reply; @@ -194,15 +194,15 @@ LOCALFUNC blnr HaveAliasMgrAvail(void) HaveGestaltAvail() && (noErr == Gestalt(gestaltAliasMgrAttr, &reply)) && TestBit(reply, gestaltAliasMgrPresent); - HaveEnvrAttrAliasMgrAvail = trueblnr; + HaveEnvrAttrAliasMgrAvail = true; } return EnvrAttrAliasMgrAvail; } -LOCALVAR blnr EnvrAttrAppleEvtMgrAvail; -LOCALVAR blnr HaveEnvrAttrAppleEvtMgrAvail = falseblnr; +LOCALVAR bool EnvrAttrAppleEvtMgrAvail; +LOCALVAR bool HaveEnvrAttrAppleEvtMgrAvail = false; -LOCALFUNC blnr HaveAppleEvtMgrAvail(void) +LOCALFUNC bool HaveAppleEvtMgrAvail(void) { if (! HaveEnvrAttrAppleEvtMgrAvail) { long reply; @@ -211,17 +211,17 @@ LOCALFUNC blnr HaveAppleEvtMgrAvail(void) HaveGestaltAvail() && (noErr == Gestalt(gestaltAppleEventsAttr, &reply)) && TestBit(reply, gestaltAppleEventsPresent); - HaveEnvrAttrAppleEvtMgrAvail = trueblnr; + HaveEnvrAttrAppleEvtMgrAvail = true; } return EnvrAttrAppleEvtMgrAvail; } #if EnableDragDrop -LOCALVAR blnr EnvrAttrDragMgrAvail; -LOCALVAR blnr HaveEnvrAttrDragMgrAvail = falseblnr; +LOCALVAR bool EnvrAttrDragMgrAvail; +LOCALVAR bool HaveEnvrAttrDragMgrAvail = false; -LOCALFUNC blnr HaveDragMgrAvail(void) +LOCALFUNC bool HaveDragMgrAvail(void) { if (! HaveEnvrAttrDragMgrAvail) { long reply; @@ -230,7 +230,7 @@ LOCALFUNC blnr HaveDragMgrAvail(void) HaveGestaltAvail() && (noErr == Gestalt(gestaltDragMgrAttr, &reply)) && TestBit(reply, gestaltDragMgrPresent); - HaveEnvrAttrDragMgrAvail = trueblnr; + HaveEnvrAttrDragMgrAvail = true; } return EnvrAttrDragMgrAvail; } @@ -242,10 +242,10 @@ LOCALFUNC blnr HaveDragMgrAvail(void) #endif #if Windows85APIAvail -LOCALVAR blnr EnvrAttrHideShowMenuAvail; -LOCALVAR blnr HaveEnvrAttrHideShowMenuAvail = falseblnr; +LOCALVAR bool EnvrAttrHideShowMenuAvail; +LOCALVAR bool HaveEnvrAttrHideShowMenuAvail = false; -LOCALFUNC blnr HaveHideShowMenuAvail(void) +LOCALFUNC bool HaveHideShowMenuAvail(void) { if (! HaveEnvrAttrHideShowMenuAvail) { long reply; @@ -253,17 +253,17 @@ LOCALFUNC blnr HaveHideShowMenuAvail(void) EnvrAttrHideShowMenuAvail = HaveGestaltAvail() && (noErr == Gestalt(gestaltMenuMgrAttr, &reply)); - HaveEnvrAttrHideShowMenuAvail = trueblnr; + HaveEnvrAttrHideShowMenuAvail = true; } return EnvrAttrHideShowMenuAvail; } #endif #if AppearanceAvail -LOCALVAR blnr EnvrAttrAppearanceAvail; -LOCALVAR blnr HaveEnvrAttrAppearanceAvail = falseblnr; +LOCALVAR bool EnvrAttrAppearanceAvail; +LOCALVAR bool HaveEnvrAttrAppearanceAvail = false; -LOCALFUNC blnr HaveAppearanceAvail(void) +LOCALFUNC bool HaveAppearanceAvail(void) { if (! HaveEnvrAttrAppearanceAvail) { long reply; @@ -271,45 +271,45 @@ LOCALFUNC blnr HaveAppearanceAvail(void) EnvrAttrAppearanceAvail = HaveGestaltAvail() && (noErr == Gestalt(gestaltAppearanceAttr, &reply)); - HaveEnvrAttrAppearanceAvail = trueblnr; + HaveEnvrAttrAppearanceAvail = true; } return EnvrAttrAppearanceAvail; } #endif #if HaveCPUfamM68K -LOCALVAR blnr EnvrAttrSndMngrAvail; -LOCALVAR blnr HaveEnvrAttrSndMngrAvail = falseblnr; +LOCALVAR bool EnvrAttrSndMngrAvail; +LOCALVAR bool HaveEnvrAttrSndMngrAvail = false; -LOCALFUNC blnr HaveSndMngrAvail(void) +LOCALFUNC bool HaveSndMngrAvail(void) { if (! HaveEnvrAttrSndMngrAvail) { EnvrAttrSndMngrAvail = LowToolTrapAvailable(_SndNewChannel); - HaveEnvrAttrSndMngrAvail = trueblnr; + HaveEnvrAttrSndMngrAvail = true; } return EnvrAttrSndMngrAvail; } #endif #if NavigationAvail -LOCALVAR blnr EnvrAttrNavServicesAvail; -LOCALVAR blnr HaveEnvrAttrNavServicesAvail = falseblnr; +LOCALVAR bool EnvrAttrNavServicesAvail; +LOCALVAR bool HaveEnvrAttrNavServicesAvail = false; -LOCALFUNC blnr HaveNavServicesAvail(void) +LOCALFUNC bool HaveNavServicesAvail(void) { if (! HaveEnvrAttrNavServicesAvail) { EnvrAttrNavServicesAvail = NavServicesAvailable(); - HaveEnvrAttrNavServicesAvail = trueblnr; + HaveEnvrAttrNavServicesAvail = true; } return EnvrAttrNavServicesAvail; } #endif #if HaveCPUfamM68K -LOCALVAR blnr EnvrAttrFSSpecCallsAvail; -LOCALVAR blnr HaveEnvrAttrFSSpecCallsAvail = falseblnr; +LOCALVAR bool EnvrAttrFSSpecCallsAvail; +LOCALVAR bool HaveEnvrAttrFSSpecCallsAvail = false; -LOCALFUNC blnr HaveFSSpecCallsAvail(void) +LOCALFUNC bool HaveFSSpecCallsAvail(void) { if (! HaveEnvrAttrFSSpecCallsAvail) { long reply; @@ -318,17 +318,17 @@ LOCALFUNC blnr HaveFSSpecCallsAvail(void) HaveGestaltAvail() && (noErr == Gestalt(gestaltFSAttr, &reply)) && TestBit(reply, gestaltHasFSSpecCalls); - HaveEnvrAttrFSSpecCallsAvail = trueblnr; + HaveEnvrAttrFSSpecCallsAvail = true; } return EnvrAttrFSSpecCallsAvail; } #endif #if Windows85APIAvail -LOCALVAR blnr EnvrAttrNewWndMgrAvail; -LOCALVAR blnr HaveEnvrAttrNewWndMgrAvail = falseblnr; +LOCALVAR bool EnvrAttrNewWndMgrAvail; +LOCALVAR bool HaveEnvrAttrNewWndMgrAvail = false; -LOCALFUNC blnr HaveNewWndMgrAvail(void) +LOCALFUNC bool HaveNewWndMgrAvail(void) { if (! HaveEnvrAttrNewWndMgrAvail) { long reply; @@ -337,7 +337,7 @@ LOCALFUNC blnr HaveNewWndMgrAvail(void) HaveGestaltAvail() && (noErr == Gestalt(gestaltWindowMgrAttr, &reply)) && TestBit(reply, gestaltWindowMgrPresentBit); - HaveEnvrAttrNewWndMgrAvail = trueblnr; + HaveEnvrAttrNewWndMgrAvail = true; } return EnvrAttrNewWndMgrAvail; } @@ -351,7 +351,7 @@ LOCALFUNC blnr HaveNewWndMgrAvail(void) /* GLOBALVAR */ QDGlobals qd; #endif -LOCALFUNC blnr InitMacManagers(void) +LOCALFUNC bool InitMacManagers(void) { MaxApplZone(); @@ -370,7 +370,7 @@ LOCALFUNC blnr InitMacManagers(void) TEInit(); InitDialogs(NULL); InitCursor(); - return trueblnr; + return true; } @@ -417,7 +417,7 @@ LOCALFUNC tMacErr OpenNamedFileInFolder(Dir_R *d, if (CheckSaveMacErr( FSMakeFSSpec(d->VRefNum, d->DirId, fileName, &spec))) if (CheckSaveMacErr( - ResolveAliasFile(&spec, trueblnr, &isFolder, &isAlias))) + ResolveAliasFile(&spec, true, &isFolder, &isAlias))) if (CheckSaveMacErr( FSpOpenDF(&spec, fsRdPerm, refnum))) { @@ -693,7 +693,7 @@ LOCALFUNC tErr OpenNewFile_v3(Dir_R *d, StringPtr s, LOCALVAR short dbglog_File = NotAfileRef; LOCALVAR tErr dbglog_err = noErr; -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { tMacErr err; Dir_R d; @@ -893,15 +893,15 @@ LOCALPROC SetMacWindContRect(_WindowRef mw, Rect *r) #endif { #if MightNotHaveWindows85Avail - MoveWindow(mw, r->left, r->top, falseblnr); + MoveWindow(mw, r->left, r->top, false); SizeWindow(mw, r->right - r->left, r->bottom - r->top, - trueblnr); + true); #endif } InvalWholeWindow(mw); } -LOCALFUNC blnr GetWindowTitleBounds(_WindowRef mw, Rect *r) +LOCALFUNC bool GetWindowTitleBounds(_WindowRef mw, Rect *r) { #if Windows85APIAvail if (HaveNewWndMgrAvail()) { @@ -916,14 +916,14 @@ LOCALFUNC blnr GetWindowTitleBounds(_WindowRef mw, Rect *r) r->left += 4; r->right -= 4; #endif - return trueblnr; + return true; } } #define topLeft(r) (((Point *) &(r))[0]) #define botRight(r) (((Point *) &(r))[1]) -LOCALFUNC blnr GetWindowContBounds(_WindowRef mw, Rect *r) +LOCALFUNC bool GetWindowContBounds(_WindowRef mw, Rect *r) { #if Windows85APIAvail if (HaveNewWndMgrAvail()) { @@ -941,7 +941,7 @@ LOCALFUNC blnr GetWindowContBounds(_WindowRef mw, Rect *r) LocalToGlobal(&botRight(*r)); SetPort(oldPort); #endif - return trueblnr; + return true; } } @@ -960,15 +960,15 @@ LOCALVAR short vOffset; #endif #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif #if EnableMagnify @@ -1021,12 +1021,12 @@ LOCALPROC SetScrnRectFromCoords(Rect *r, #endif #if EnableMagnify -LOCALVAR ui3p ScalingBuff = nullpr; +LOCALVAR uint8_t * ScalingBuff = nullpr; #endif #if EnableMagnify -LOCALVAR ui3p ScalingTabl = nullpr; +LOCALVAR uint8_t * ScalingTabl = nullpr; #define ScalingTablsz (256 * WindowScale) #define ScrnMapr_DoMap UpdateScaledBWCopy @@ -1090,7 +1090,7 @@ LOCALPROC DefaultDrawScreenBuff(int16_t top, int16_t left, if (! ColorTransValid) { SetUpScalingTabl(); - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateScaledBWCopy(top, left, bottom, right); @@ -1285,7 +1285,7 @@ LOCALPROC CheckKeyBoardState(void) } } -LOCALVAR WantCmdOptOnReconnect = falseblnr; +LOCALVAR WantCmdOptOnReconnect = false; #define KeyMap_TestBit(m, key) \ ((((uint8_t *)m)[(key) / 8] & (1 << ((key) & 7))) != 0) @@ -1295,8 +1295,8 @@ LOCALPROC ReconnectKeyCodes3(void) { int i; int j; - blnr oldv; - blnr newv; + bool oldv; + bool newv; uint32_t NewKeys[4]; GetKeys(*(KeyMap *)NewKeys); @@ -1310,7 +1310,7 @@ LOCALPROC ReconnectKeyCodes3(void) /* and except for command/option on receive drop */ if (WantCmdOptOnReconnect) { - WantCmdOptOnReconnect = falseblnr; + WantCmdOptOnReconnect = false; for (i = 0; i < 16; ++i) { uint8_t v = ((uint8_t *)NewKeys)[i]; @@ -1319,7 +1319,7 @@ LOCALPROC ReconnectKeyCodes3(void) uint8_t k = i * 8 + j; if (MKC_CapsLock != k) { Keyboard_UpdateKeyMap2(Keyboard_RemapMac(k), - trueblnr); + true); } } } @@ -1333,13 +1333,13 @@ LOCALPROC ReconnectKeyCodes3(void) /* --- cursor hiding --- */ -LOCALVAR blnr HaveCursorHidden = falseblnr; -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; +LOCALVAR bool WantCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; ShowCursor(); } } @@ -1452,13 +1452,13 @@ pascal void CallCursorTask(void) = #define CrsrCouple 0x08CF /* true if the cursor is tied to the mouse */ -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { /* Move the cursor to the point h, v on the emulated screen. - if detect that this fails return falseblnr, - otherwise return trueblnr. + if detect that this fails return false, + otherwise return true. (on some platforms it is possible to move the curser, but there is no way to detect failure.) @@ -1467,7 +1467,7 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) Point CurMousePos; Point NewMousePos; uint32_t difftime; - blnr IsOk; + bool IsOk; long int StartTime = TickCount(); #if VarFullScreen @@ -1550,14 +1550,14 @@ LOCALPROC AdjustMouseMotionGrab(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } } else #endif { if (HaveMouseMotion) { (void) MoveMouse(CurMouseH, CurMouseV); - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -1588,7 +1588,7 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -1596,7 +1596,7 @@ LOCALPROC MouseConstrain(void) LOCALPROC MousePositionNotify(Point NewMousePos) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if VarFullScreen if (UseFullScreen) @@ -1613,7 +1613,7 @@ LOCALPROC MousePositionNotify(Point NewMousePos) #if MayNotFullScreen { if (! PtInRgn(NewMousePos, gMainWindow->visRgn)) { - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } } #endif @@ -1646,17 +1646,17 @@ LOCALPROC MousePositionNotify(Point NewMousePos) { if (NewMousePos.h < 0) { NewMousePos.h = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePos.h >= vMacScreenWidth) { NewMousePos.h = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePos.v < 0) { NewMousePos.v = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePos.v >= vMacScreenHeight) { NewMousePos.v = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } #if VarFullScreen @@ -1664,7 +1664,7 @@ LOCALPROC MousePositionNotify(Point NewMousePos) #endif #if MayFullScreen { - ShouldHaveCursorHidden = trueblnr; + ShouldHaveCursorHidden = true; } #endif @@ -1708,7 +1708,7 @@ LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - MouseButtonSet(falseblnr); + MouseButtonSet(false); ForceShowCursor(); } @@ -1780,7 +1780,7 @@ LOCALPROC UpdateTrueEmulatedTime(void) } } -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { /* Update CurMacDateInSeconds, the number @@ -1795,13 +1795,13 @@ LOCALFUNC blnr CheckDateTime(void) NewMacDateInSecond = _LMGetTime(); if (CurMacDateInSeconds != NewMacDateInSecond) { CurMacDateInSeconds = NewMacDateInSecond; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { #if AutoLocation || AutoTimeZone MachineLocation loc; @@ -1818,7 +1818,7 @@ LOCALFUNC blnr InitLocationDat(void) (void) CheckDateTime(); - return trueblnr; + return true; } /* --- sound --- */ @@ -1933,20 +1933,20 @@ LOCALPROC Sound_WroteABlock(void) #endif } -LOCALFUNC blnr Sound_EndWrite0(uint16_t actL) +LOCALFUNC bool Sound_EndWrite0(uint16_t actL) { - blnr v; + bool v; TheWriteOffset += actL; if (0 != (TheWriteOffset & kOneBuffMask)) { - v = falseblnr; + v = false; } else { /* just finished a block */ Sound_WroteABlock(); - v = trueblnr; + v = true; } return v; @@ -2001,10 +2001,10 @@ struct SoundR { volatile uint16_t (*fFillOffset); volatile uint16_t (*fMinFilledSoundBuffs); - volatile blnr PlayingBuffBlock; + volatile bool PlayingBuffBlock; volatile trSoundSamp lastv; - volatile blnr wantplaying; - volatile blnr StartingBlocks; + volatile bool wantplaying; + volatile bool StartingBlocks; CmpSoundHeader /* ExtSoundHeader */ soundHeader; }; @@ -2036,7 +2036,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) { SoundR *datp = (SoundR *)(theCallBackCmd->param2); - blnr wantplaying0 = datp->wantplaying; + bool wantplaying0 = datp->wantplaying; trSoundSamp v0 = datp->lastv; #if dbglog_SoundStuff @@ -2050,7 +2050,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) #endif *datp->fPlayOffset += kOneBuffLen; - datp->PlayingBuffBlock = falseblnr; + datp->PlayingBuffBlock = false; } if ((! wantplaying0) && (kCenterSound == v0)) { @@ -2061,7 +2061,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) SndCommand playCmd; tpSoundSamp p; trSoundSamp v1 = v0; - blnr WantRamp = falseblnr; + bool WantRamp = false; uint16_t CurPlayOffset = *datp->fPlayOffset; uint16_t ToPlayLen = *datp->fFillOffset - CurPlayOffset; uint16_t FilledSoundBuffs = ToPlayLen >> kLnOneBuffLen; @@ -2076,7 +2076,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) #endif v1 = kCenterSound; - WantRamp = trueblnr; + WantRamp = true; } else if (datp->StartingBlocks) { #if dbglog_SoundStuff @@ -2084,7 +2084,7 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) #endif if ((ToPlayLen >> kLnOneBuffLen) < 12) { - datp->StartingBlocks = falseblnr; + datp->StartingBlocks = false; #if dbglog_SoundStuff dbglog_writeln("have enough samples to start"); #endif @@ -2094,20 +2094,20 @@ Sound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd) v1 = ConvertSoundSampleFromNative(*p); } - WantRamp = trueblnr; + WantRamp = true; } else if (0 == FilledSoundBuffs) { #if dbglog_SoundStuff dbglog_writeln("playing under run"); #endif - WantRamp = trueblnr; + WantRamp = true; } else { /* play next sample */ p = datp->fTheSoundBuffer + (CurPlayOffset & kAllBuffMask); - datp->PlayingBuffBlock = trueblnr; + datp->PlayingBuffBlock = true; v1 = ConvertSoundSampleFromNative(*(p + kOneBuffLen - 1)); #if dbglog_SoundStuff @@ -2173,8 +2173,8 @@ LOCALPROC Sound_Start(void) SndCommand callBack; SndChannelPtr chan = NULL; - cur_audio.wantplaying = falseblnr; - cur_audio.StartingBlocks = falseblnr; + cur_audio.wantplaying = false; + cur_audio.StartingBlocks = false; Sound_Start0(); @@ -2182,10 +2182,10 @@ LOCALPROC Sound_Start(void) if (NULL != chan) { sndChannel = chan; - cur_audio.PlayingBuffBlock = falseblnr; + cur_audio.PlayingBuffBlock = false; cur_audio.lastv = kCenterSound; - cur_audio.StartingBlocks = trueblnr; - cur_audio.wantplaying = trueblnr; + cur_audio.StartingBlocks = true; + cur_audio.wantplaying = true; callBack.cmd = callBackCmd; callBack.param1 = 0; /* unused */ @@ -2212,13 +2212,13 @@ LOCALPROC Sound_Stop(void) uint16_t retry_limit = 50; /* half of a second */ SCStatus r; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; #if dbglog_SoundStuff dbglog_writeln("cleared wantplaying"); #endif label_retry: - r.scChannelBusy = falseblnr; /* what is this for? */ + r.scChannelBusy = false; /* what is this for? */ if (noErr != SndChannelStatus(sndChannel, sizeof(SCStatus), &r)) { @@ -2278,7 +2278,7 @@ label_retry: #define SOUND_SAMPLERATE rate22khz /* = 0x56EE8BA3 = (7833600 * 2 / 704) << 16 */ -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { #if dbglog_SoundStuff dbglog_writeln("enter Sound_Init"); @@ -2289,7 +2289,7 @@ LOCALFUNC blnr Sound_Init(void) cur_audio.fPlayOffset = &ThePlayOffset; cur_audio.fFillOffset = &TheFillOffset; cur_audio.fMinFilledSoundBuffs = &MinFilledSoundBuffs; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; /* Init basic per channel information */ cur_audio.soundHeader.sampleRate = SOUND_SAMPLERATE; @@ -2335,9 +2335,9 @@ LOCALFUNC blnr Sound_Init(void) start early. */ - return trueblnr; + return true; } - return falseblnr; + return false; } GLOBALOSGLUPROC Sound_EndWrite(uint16_t actL) @@ -2370,14 +2370,14 @@ LOCALPROC AdjustMachineGrab(void) #if MayFullScreen LOCALPROC UngrabMachine(void) { - GrabMachine = falseblnr; + GrabMachine = false; AdjustMachineGrab(); } #endif /* --- basic dialogs --- */ -LOCALPROC NativeStrFromCStr(ps3p r, char *s, blnr AddEllipsis) +LOCALPROC NativeStrFromCStr(ps3p r, char *s, bool AddEllipsis) { int i; int L; @@ -2407,16 +2407,16 @@ LOCALPROC NativeStrFromCStr(ps3p r, char *s, blnr AddEllipsis) LOCALVAR long NoEventsCounter = 0; #endif -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool gTrueBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; -LOCALVAR blnr ADialogIsUp = falseblnr; +LOCALVAR bool ADialogIsUp = false; LOCALPROC BeginDialog(void) { DisconnectKeyCodes3(); - ADialogIsUp = trueblnr; + ADialogIsUp = true; #if MayFullScreen UngrabMachine(); #endif @@ -2427,7 +2427,7 @@ LOCALPROC EndDialog(void) #if HogCPU NoEventsCounter = 0; #endif - ADialogIsUp = falseblnr; + ADialogIsUp = false; ReconnectKeyCodes3(); } @@ -2445,8 +2445,8 @@ LOCALPROC CheckSavedMacMsg(void) Str255 longMsgp; if (nullpr != SavedBriefMsg) { - NativeStrFromCStr(briefMsgp, SavedBriefMsg, falseblnr); - NativeStrFromCStr(longMsgp, SavedLongMsg, falseblnr); + NativeStrFromCStr(briefMsgp, SavedBriefMsg, false); + NativeStrFromCStr(longMsgp, SavedLongMsg, false); #if AppearanceAvail if (HaveAppearanceAvail()) { AlertStdAlertParamRec param; @@ -2565,7 +2565,7 @@ LOCALPROC _ShowMenuBar(void) GrayRgnSave = NULL; #if 0 if (controlStripHidden) { - controlStripHidden = falseblnr; + controlStripHidden = false; if (noErr == Gestalt(gestaltControlStripVersion, &result)) { @@ -2644,9 +2644,9 @@ LOCALPROC UnInitPbufs(void) #endif #if IncludePbufs -LOCALFUNC ui3p PbufLock(tPbuf i) +LOCALFUNC uint8_t * PbufLock(tPbuf i) { - ui3p p; + uint8_t * p; Handle h = PbufDat[i]; @@ -2654,7 +2654,7 @@ LOCALFUNC ui3p PbufLock(tPbuf i) p = nullpr; } else { HLock(h); - p = (ui3p)*h; + p = (uint8_t *)*h; } return p; @@ -2669,14 +2669,14 @@ LOCALPROC PbufUnlock(tPbuf i) #endif #if IncludePbufs -GLOBALOSGLUPROC PbufTransfer(ui3p Buffer, - tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite) +GLOBALOSGLUPROC PbufTransfer(uint8_t * Buffer, + tPbuf i, uint32_t offset, uint32_t count, bool IsWrite) { Handle h = PbufDat[i]; HLock(h); { - void *p = ((ui3p)*h) + offset; + void *p = ((uint8_t *)*h) + offset; if (IsWrite) { BlockMove(Buffer, p, count); } else { @@ -2782,7 +2782,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -2866,12 +2866,12 @@ GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { OSErr result; short vRefNum; - blnr DidEject = falseblnr; + bool DidEject = false; short refnum = Drives[Drive_No]; result = GetVRefNum(refnum, &vRefNum); if (noErr == result) { - DidEject = trueblnr; + DidEject = true; result = vSonyEject0(Drive_No); (void) FlushVol(NULL, vRefNum); } @@ -2888,7 +2888,7 @@ GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) { OSErr result; Str255 s; - blnr DidEject = falseblnr; + bool DidEject = false; short refnum = Drives[Drive_No]; #if HaveCPUfamM68K @@ -2900,7 +2900,7 @@ GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) if (noErr == result) { PStrFromHandle(s, h, 255); result = vSonyEject0(Drive_No); - DidEject = trueblnr; + DidEject = true; (void) FSDelete(s, vRefNum); } } @@ -2921,7 +2921,7 @@ GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) s, &spec); if (noErr == result) { result = vSonyEject0(Drive_No); - DidEject = trueblnr; + DidEject = true; (void) FSpDelete(&spec); } } @@ -2983,7 +2983,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetName(tDrive Drive_No, tPbuf *r) } #endif -LOCALFUNC tMacErr Sony_Insert0(short refnum, blnr locked, ps3p s) +LOCALFUNC tMacErr Sony_Insert0(short refnum, bool locked, ps3p s) { /* Given reference to open file, mount it as @@ -3022,12 +3022,12 @@ LOCALPROC ReportStandardOpenDiskError(tMacErr err) if (mnvm_noErr != err) { if (mnvm_tmfoErr == err) { MacMsg(kStrTooManyImagesTitle, - kStrTooManyImagesMessage, falseblnr); + kStrTooManyImagesMessage, false); } else if (mnvm_opWrErr == err) { MacMsg(kStrImageInUseTitle, - kStrImageInUseMessage, falseblnr); + kStrImageInUseMessage, false); } else { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } } @@ -3036,14 +3036,14 @@ LOCALFUNC tMacErr InsertADiskFromFileRef(FSSpec *spec) { short refnum; tMacErr err; - blnr locked = falseblnr; + bool locked = false; err = To_tMacErr(FSpOpenDF(spec, fsRdWrPerm, &refnum)); switch (err) { case mnvm_permErr: case mnvm_wrPermErr: case mnvm_afpAccessDenied: - locked = trueblnr; + locked = true; err = To_tMacErr(FSpOpenDF(spec, fsRdPerm, &refnum)); break; default: @@ -3062,7 +3062,7 @@ LOCALFUNC tMacErr InsertADiskFromNamevRef(ConstStr255Param fileName, { ParamBlockRec R; tMacErr err; - blnr locked = falseblnr; + bool locked = false; R.ioParam.ioCompletion = NULL; R.ioParam.ioNamePtr = (StringPtr)fileName; @@ -3075,7 +3075,7 @@ LOCALFUNC tMacErr InsertADiskFromNamevRef(ConstStr255Param fileName, case mnvm_permErr: case mnvm_wrPermErr: case mnvm_afpAccessDenied: - locked = trueblnr; + locked = true; R.ioParam.ioPermssn = fsRdPerm; err = To_tMacErr(PBOpen(&R, false)); break; @@ -3168,7 +3168,7 @@ LOCALFUNC tMacErr InsertADiskFromNamevRef1(ConstStr255Param fileName, #endif LOCALFUNC tMacErr InsertADiskOrAliasFromSpec(FSSpec *spec, - blnr MaybeROM, blnr MaybeAlias) + bool MaybeROM, bool MaybeAlias) { Boolean isFolder; Boolean isAlias; @@ -3204,7 +3204,7 @@ LOCALFUNC tMacErr InsertDisksFromDocList(AEDescList *docList) &keyword, &typeCode, (Ptr)&spec, sizeof(FSSpec), &actualSize))) if (CheckSavetMacErr(InsertADiskOrAliasFromSpec(&spec, - trueblnr, falseblnr))) + true, false))) { } if (mnvm_noErr != err) { @@ -3234,7 +3234,7 @@ LOCALFUNC tMacErr InsertADiskFromNameEtc(Dir_R *d, FSMakeFSSpec(d->VRefNum, d->DirId, fileName, &spec))) { err = InsertADiskOrAliasFromSpec(&spec, - falseblnr, trueblnr); + false, true); } } @@ -3385,7 +3385,7 @@ LOCALPROC InsertADisk0(void) if (reply.sfGood) { ReportStandardOpenDiskError( InsertADiskOrAliasFromSpec(&reply.sfFile, - trueblnr, falseblnr)); + true, false)); } } } @@ -3397,7 +3397,7 @@ LOCALPROC InsertADisk0(void) LOCALVAR Dir_R DatDir; #if AppIsBundle -LOCALFUNC blnr DirectorySpec2DirId(FSSpec *spec, long *dirID) +LOCALFUNC bool DirectorySpec2DirId(FSSpec *spec, long *dirID) { CInfoPBRec b; @@ -3408,15 +3408,15 @@ LOCALFUNC blnr DirectorySpec2DirId(FSSpec *spec, long *dirID) b.dirInfo.ioDrDirID = spec->parID; if (noErr == PBGetCatInfo(&b, false)) { *dirID = b.dirInfo.ioDrDirID; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } #endif #if AppIsBundle -LOCALFUNC blnr FindNamedChildDirId(short TrueParentVol, +LOCALFUNC bool FindNamedChildDirId(short TrueParentVol, long ParentDirId, StringPtr ChildName, short *TrueChildVol, long *ChildDirId) { @@ -3433,19 +3433,19 @@ LOCALFUNC blnr FindNamedChildDirId(short TrueParentVol, if (DirectorySpec2DirId(&temp_spec, ChildDirId)) { *TrueChildVol = temp_spec.vRefNum; - return trueblnr; + return true; } - return falseblnr; + return false; } #endif -LOCALFUNC blnr InitApplInfo(void) +LOCALFUNC bool InitApplInfo(void) { #if HaveCPUfamM68K if (! HaveFSSpecCallsAvail()) { if (noErr == GetVol(NULL, &DatDir.VRefNum)) { DatDir.DirId = 0; - return trueblnr; + return true; } } else #endif @@ -3461,11 +3461,11 @@ LOCALFUNC blnr InitApplInfo(void) if (noErr == PBGetFCBInfoSync(&pb)) { DatDir.VRefNum = pb.ioFCBVRefNum; DatDir.DirId = pb.ioFCBParID; - return trueblnr; + return true; } } - return falseblnr; + return false; } LOCALFUNC tMacErr DirFromWD_v2(short VRefNum, Dir_R *d) @@ -3663,7 +3663,7 @@ LOCALFUNC tMacErr LoadMacRomFromPrefDir(void) return err; } -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -3674,13 +3674,13 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { if ((i > 9) || ! FirstFreeDisk(nullpr)) { - return falseblnr; + return false; } else { Str255 s; tMacErr err = mnvm_noErr; @@ -3692,14 +3692,14 @@ LOCALFUNC blnr Sony_InsertIth(int i) if (mnvm_fnfErr != err) { ReportStandardOpenDiskError(err); } - return falseblnr; + return false; } - return trueblnr; + return true; } } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { int i; @@ -3707,7 +3707,7 @@ LOCALFUNC blnr LoadInitialImages(void) /* stop on first error (including file not found) */ } - return trueblnr; + return true; } #if IncludeSonyNew @@ -3755,7 +3755,7 @@ LOCALPROC MakeNewDiskFromNamevRef(ps3p Name, short vRefNum, if (CheckSaveMacErr(FSOpen(Name, vRefNum, &refNum))) { if (CheckSaveMacErr(SetEOF(refNum, L))) { if (CheckSavetMacErr(WriteZero(refNum, L))) { - err = Sony_Insert0(refNum, falseblnr, Name); + err = Sony_Insert0(refNum, false, Name); ReportStandardOpenDiskError(err); refNum = NotAfileRef; } @@ -3793,7 +3793,7 @@ LOCALPROC MakeNewDiskFromSpec(FSSpec *NewFileSpec, { if (CheckSaveMacErr(SetEOF(refNum, L))) { if (CheckSavetMacErr(WriteZero(refNum, L))) { - err = Sony_Insert0(refNum, falseblnr, NULL); + err = Sony_Insert0(refNum, false, NULL); ReportStandardOpenDiskError(err); refNum = NotAfileRef; } @@ -3916,9 +3916,9 @@ LOCALPROC MakeNewDisk(uint32_t L, Handle NewDiskName) } else #endif { - NativeStrFromCStr(Title, "untitled", falseblnr); + NativeStrFromCStr(Title, "untitled", false); } - NativeStrFromCStr(prompt, "Please select a file", falseblnr); + NativeStrFromCStr(prompt, "Please select a file", false); #if HaveCPUfamM68K if (! HaveFSSpecCallsAvail()) { @@ -3961,7 +3961,7 @@ LOCALPROC MakeNewDisk(uint32_t L, Handle NewDiskName) } else #endif { - NativeStrFromCStr(Title, "untitled", falseblnr); + NativeStrFromCStr(Title, "untitled", false); } if (mnvm_noErr == (err = FindOrMakeChildDirCStr(&OutDir, @@ -4142,7 +4142,7 @@ LOCALFUNC tMacErr OpenActvCodeFile(short *refnum) return err; } -LOCALFUNC tMacErr ActvCodeFileLoad(ui3p p) +LOCALFUNC tMacErr ActvCodeFileLoad(uint8_t * p) { tMacErr err; short refnum; @@ -4156,7 +4156,7 @@ LOCALFUNC tMacErr ActvCodeFileLoad(ui3p p) return err; } -LOCALFUNC tMacErr ActvCodeFileSave(ui3p p) +LOCALFUNC tMacErr ActvCodeFileSave(uint8_t * p) { tMacErr err; short refnum; @@ -4186,7 +4186,7 @@ LOCALFUNC tMacErr ActvCodeFileSave(ui3p p) #define openOnly 1 #define openPrint 2 -LOCALFUNC blnr GotRequiredParams(AppleEvent *theAppleEvent) +LOCALFUNC bool GotRequiredParams(AppleEvent *theAppleEvent) { DescType typeCode; Size actualSize; @@ -4195,15 +4195,15 @@ LOCALFUNC blnr GotRequiredParams(AppleEvent *theAppleEvent) theErr = AEGetAttributePtr(theAppleEvent, keyMissedKeywordAttr, typeWildCard, &typeCode, NULL, 0, &actualSize); if (errAEDescNotFound == theErr) { /* No more required params. */ - return trueblnr; + return true; } else if (noErr == theErr) { /* More required params! */ - return /* CheckSysCode(errAEEventNotHandled) */ falseblnr; + return /* CheckSysCode(errAEEventNotHandled) */ false; } else { /* Unexpected Error! */ - return /* CheckSysCode(theErr) */ falseblnr; + return /* CheckSysCode(theErr) */ false; } } -LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) +LOCALFUNC bool GotRequiredParams0(AppleEvent *theAppleEvent) { DescType typeCode; Size actualSize; @@ -4212,11 +4212,11 @@ LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) theErr = AEGetAttributePtr(theAppleEvent, keyMissedKeywordAttr, typeWildCard, &typeCode, NULL, 0, &actualSize); if (errAEDescNotFound == theErr) { /* No more required params. */ - return trueblnr; + return true; } else if (noErr == theErr) { /* More required params! */ - return trueblnr; /* errAEEventNotHandled; */ /*^*/ + return true; /* errAEEventNotHandled; */ /*^*/ } else { /* Unexpected Error! */ - return /* CheckSysCode(theErr) */ falseblnr; + return /* CheckSysCode(theErr) */ false; } } @@ -4268,7 +4268,7 @@ LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) UnusedParam(reply); UnusedParam(aRefCon); if (GotRequiredParams(theAppleEvent)) { - RequestMacOff = trueblnr; + RequestMacOff = true; } return /* GetASysResultCode() */ 0; @@ -4276,9 +4276,9 @@ LOCALFUNC blnr GotRequiredParams0(AppleEvent *theAppleEvent) #define NewAEEventHandlerUPP NewAEEventHandlerProc -LOCALFUNC blnr InstallEventHandler(AEEventClass theAEEventClass, +LOCALFUNC bool InstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, ProcPtr p, - long handlerRefcon, blnr isSysHandler) + long handlerRefcon, bool isSysHandler) { return noErr == (AEInstallEventHandler(theAEEventClass, theAEEventID, @@ -4294,13 +4294,13 @@ LOCALPROC InstallAppleEventHandlers(void) { if (noErr == AESetInteractionAllowed(kAEInteractWithLocal)) if (InstallEventHandler(kCoreEventClass, kAEOpenApplication, - (ProcPtr)DoOpenEvent, 0, falseblnr)) + (ProcPtr)DoOpenEvent, 0, false)) if (InstallEventHandler(kCoreEventClass, kAEOpenDocuments, - (ProcPtr)OpenOrPrintFiles, openOnly, falseblnr)) + (ProcPtr)OpenOrPrintFiles, openOnly, false)) if (InstallEventHandler(kCoreEventClass, kAEPrintDocuments, - (ProcPtr)OpenOrPrintFiles, openPrint, falseblnr)) + (ProcPtr)OpenOrPrintFiles, openPrint, false)) if (InstallEventHandler(kCoreEventClass, kAEQuitApplication, - (ProcPtr)DoQuitEvent, 0, falseblnr)) + (ProcPtr)DoQuitEvent, 0, false)) { } } @@ -4372,7 +4372,7 @@ static pascal OSErr GlobalReceiveHandler(WindowRef pWindow, { ReportStandardOpenDiskError( InsertADiskOrAliasFromSpec(&r.fileSpec, - trueblnr, trueblnr)); + true, true)); } } @@ -4381,7 +4381,7 @@ static pascal OSErr GlobalReceiveHandler(WindowRef pWindow, (void) SetFrontProcess(¤tProcess); - WantCmdOptOnReconnect = trueblnr; + WantCmdOptOnReconnect = true; } } @@ -4424,9 +4424,9 @@ LOCALPROC UnPrepareForDragging(void) #endif #if EnableDragDrop -LOCALFUNC blnr PrepareForDragging(void) +LOCALFUNC bool PrepareForDragging(void) { - blnr IsOk = falseblnr; + bool IsOk = false; gGlobalTrackingHandler = NewDragTrackingHandlerUPP( GlobalTrackingHandler); @@ -4440,7 +4440,7 @@ LOCALFUNC blnr PrepareForDragging(void) if (noErr == InstallReceiveHandler( gGlobalReceiveHandler, gMainWindow, nil)) { - IsOk = trueblnr; + IsOk = true; } } } @@ -4454,10 +4454,10 @@ LOCALFUNC blnr PrepareForDragging(void) #define ScaleBuffSzMult (WindowScale * WindowScale) #endif -LOCALFUNC blnr CreateNewWindow(Rect *Bounds, WindowPtr *theWindow) +LOCALFUNC bool CreateNewWindow(Rect *Bounds, WindowPtr *theWindow) { WindowPtr ResultWin; - blnr IsOk = falseblnr; + bool IsOk = false; ResultWin = NewWindow( 0L, Bounds, LMGetCurApName() /* "\pMini vMac" */, false, @@ -4466,7 +4466,7 @@ LOCALFUNC blnr CreateNewWindow(Rect *Bounds, WindowPtr *theWindow) if (ResultWin != NULL) { *theWindow = ResultWin; - IsOk = trueblnr; + IsOk = true; } return IsOk; @@ -4507,11 +4507,11 @@ enum { #if MayNotFullScreen LOCALVAR int CurWinIndx; -LOCALVAR blnr HavePositionWins[kNumMagStates]; +LOCALVAR bool HavePositionWins[kNumMagStates]; LOCALVAR Point WinPositionWins[kNumMagStates]; #endif -LOCALFUNC blnr CreateMainWindow(void) +LOCALFUNC bool CreateMainWindow(void) { /* Set up somewhere for us to draw the emulated screen and @@ -4534,7 +4534,7 @@ LOCALFUNC blnr CreateMainWindow(void) short topPos; short NewWindowHeight = vMacScreenHeight; short NewWindowWidth = vMacScreenWidth; - blnr IsOk = falseblnr; + bool IsOk = false; #if VarFullScreen if (UseFullScreen) { @@ -4628,7 +4628,7 @@ LOCALFUNC blnr CreateMainWindow(void) if (! HavePositionWins[WinIndx]) { WinPositionWins[WinIndx].h = leftPos; WinPositionWins[WinIndx].v = topPos; - HavePositionWins[WinIndx] = trueblnr; + HavePositionWins[WinIndx] = true; NewWinRect = MainScrnBounds; } else { SetRect(&NewWinRect, 0, 0, NewWindowWidth, NewWindowHeight); @@ -4686,7 +4686,7 @@ LOCALFUNC blnr CreateMainWindow(void) } #endif - IsOk = trueblnr; + IsOk = true; } return IsOk; @@ -4703,10 +4703,10 @@ struct WState { uint16_t f_ViewVStart; #endif #if VarFullScreen - blnr f_UseFullScreen; + bool f_UseFullScreen; #endif #if EnableMagnify - blnr f_UseMagnify; + bool f_UseMagnify; #endif #if MayNotFullScreen int f_CurWinIndx; @@ -4764,7 +4764,7 @@ LOCALPROC SetWState(WState *r) gGlobalReceiveHandler = r->f_gGlobalReceiveHandler; } -LOCALFUNC blnr ReCreateMainWindow(void) +LOCALFUNC bool ReCreateMainWindow(void) { /* Like CreateMainWindow (which it calls), except may be @@ -4775,8 +4775,8 @@ LOCALFUNC blnr ReCreateMainWindow(void) If there is existing window, and fail to create the new one, then existing window must be left alone, - in valid state. (and return falseblnr. otherwise, - if succeed, return trueblnr) + in valid state. (and return false. otherwise, + if succeed, return true) i.e. can allocate the new one before disposing of the old one. @@ -4816,7 +4816,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) UseMagnify = WantMagnify; #endif - ColorTransValid = falseblnr; + ColorTransValid = false; if (! CreateMainWindow()) { CloseMainWindow(); @@ -4838,7 +4838,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) WantMagnify = UseMagnify; #endif - return falseblnr; + return false; } else { GetWState(&new_state); SetWState(&old_state); @@ -4847,10 +4847,10 @@ LOCALFUNC blnr ReCreateMainWindow(void) if (HaveCursorHidden) { (void) MoveMouse(CurMouseH, CurMouseV); - WantCursorHidden = trueblnr; + WantCursorHidden = true; } - return trueblnr; + return true; } } @@ -4875,7 +4875,7 @@ LOCALPROC ZapWinStateVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -4909,7 +4909,7 @@ LOCALPROC ToggleWantFullScreen(void) if (kMagStateAuto != NewMagState) { WantMagnify = (kMagStateMagnifgy == NewMagState); } else { - WantMagnify = falseblnr; + WantMagnify = false; if (WantFullScreen) { Rect r; @@ -4920,7 +4920,7 @@ LOCALPROC ToggleWantFullScreen(void) >= vMacScreenHeight * WindowScale) ) { - WantMagnify = trueblnr; + WantMagnify = true; } } } @@ -4969,7 +4969,7 @@ LOCALPROC EnterSpeedStopped(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); @@ -4982,12 +4982,12 @@ LOCALPROC CheckForSavedTasks(void) #endif if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -5055,7 +5055,7 @@ LOCALPROC CheckForSavedTasks(void) } if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -5079,12 +5079,12 @@ LOCALPROC CheckForSavedTasks(void) { MakeNewDisk(vSonyNewDiskSize, NULL); } - vSonyNewDiskWanted = falseblnr; + vSonyNewDiskWanted = false; /* must be done after may have gotten disk */ } #endif if (RequestInsertDisk) { - RequestInsertDisk = falseblnr; + RequestInsertDisk = false; InsertADisk0(); } } @@ -5108,7 +5108,7 @@ LOCALPROC CheckForSavedTasks(void) } } -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -5181,11 +5181,11 @@ LOCALPROC MacOS_HandleMenu(short menuID, short menuItem) case kFileMenu: switch (menuItem) { case kFileOpenDiskImage: - RequestInsertDisk = trueblnr; + RequestInsertDisk = true; break; case kFileQuitItem: - RequestMacOff = trueblnr; + RequestMacOff = true; break; } break; @@ -5242,13 +5242,13 @@ LOCALPROC HandleMacEvent(EventRecord *theEvent) } if (whichWindow == gMainWindow) { MousePositionNotifyFromGlobal(theEvent->where); - MouseButtonSet(trueblnr); + MouseButtonSet(true); } break; case inGoAway: if (TrackGoAway(whichWindow, theEvent->where)) { - RequestMacOff = trueblnr; + RequestMacOff = true; } break; @@ -5260,7 +5260,7 @@ LOCALPROC HandleMacEvent(EventRecord *theEvent) break; case mouseUp: MousePositionNotifyFromGlobal(theEvent->where); - MouseButtonSet(falseblnr); + MouseButtonSet(false); break; case updateEvt: @@ -5283,9 +5283,9 @@ LOCALPROC HandleMacEvent(EventRecord *theEvent) case osEvt: if ((theEvent->message >> 24) & suspendResumeMessage) { if (theEvent->message & 1) { - gTrueBackgroundFlag = falseblnr; + gTrueBackgroundFlag = false; } else { - gTrueBackgroundFlag = trueblnr; + gTrueBackgroundFlag = true; } } break; @@ -5404,13 +5404,13 @@ LOCALPROC CheckForSystemEvents(void) } else { WindowPtr whichWindow; - blnr PrivateEvent = falseblnr; + bool PrivateEvent = false; switch (theEvent.what) { case keyDown: case autoKey: case keyUp: case mouseUp: - PrivateEvent = trueblnr; + PrivateEvent = true; break; case mouseDown: if ((inContent == @@ -5418,7 +5418,7 @@ LOCALPROC CheckForSystemEvents(void) && (whichWindow == gMainWindow) && (FrontWindow() == whichWindow)) { - PrivateEvent = trueblnr; + PrivateEvent = true; } break; } @@ -5518,7 +5518,7 @@ LOCALPROC AppendMenuCStr(MenuHandle menu, char *s) } LOCALPROC AppendMenuConvertCStr(MenuHandle menu, - char *s, blnr WantEllipsis) + char *s, bool WantEllipsis) { Str255 t; @@ -5535,11 +5535,11 @@ LOCALFUNC MenuHandle NewMenuFromConvertCStr(short menuID, char *s) { Str255 r; - NativeStrFromCStr(r, s, falseblnr); + NativeStrFromCStr(r, s, false); return NewMenu(menuID, r); } -LOCALFUNC blnr InstallOurMenus(void) +LOCALFUNC bool InstallOurMenus(void) { MenuHandle menu; Str255 s; @@ -5548,7 +5548,7 @@ LOCALFUNC blnr InstallOurMenus(void) menu = NewMenu(kAppleMenu, s); if (menu != NULL) { AppendMenuConvertCStr(menu, - kStrMenuItemAbout, trueblnr); + kStrMenuItemAbout, true); AppendMenuSep(menu); AppendResMenu(menu, 'DRVR'); InsertMenu(menu, 0); @@ -5557,11 +5557,11 @@ LOCALFUNC blnr InstallOurMenus(void) menu = NewMenuFromConvertCStr(kFileMenu, kStrMenuFile); if (menu != NULL) { AppendMenuConvertCStr(menu, - kStrMenuItemOpen, trueblnr); + kStrMenuItemOpen, true); { AppendMenuSep(menu); AppendMenuConvertCStr(menu, - kStrMenuItemQuit, falseblnr); + kStrMenuItemQuit, false); } InsertMenu(menu, 0); } @@ -5569,33 +5569,33 @@ LOCALFUNC blnr InstallOurMenus(void) menu = NewMenuFromConvertCStr(kSpecialMenu, kStrMenuSpecial); if (menu != NULL) { AppendMenuConvertCStr(menu, - kStrMenuItemMore, trueblnr); + kStrMenuItemMore, true); InsertMenu(menu, 0); } DrawMenuBar(); - return trueblnr; + return true; } #if AppearanceAvail -LOCALFUNC blnr InstallOurAppearanceClient(void) +LOCALFUNC bool InstallOurAppearanceClient(void) { if (HaveAppearanceAvail()) { RegisterAppearanceClient(); } - return trueblnr; + return true; } #endif -LOCALFUNC blnr InstallOurEventHandlers(void) +LOCALFUNC bool InstallOurEventHandlers(void) { InitKeyCodes(); if (HaveAppleEvtMgrAvail()) { InstallAppleEventHandlers(); } - return trueblnr; + return true; } LOCALPROC ZapOSGLUVars(void) @@ -5619,53 +5619,53 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif #if EnableMagnify ReserveAllocOneBlock(&ScalingBuff, - vMacScreenNumBytes * (ScaleBuffSzMult), 5, falseblnr); + vMacScreenNumBytes * (ScaleBuffSzMult), 5, false); ReserveAllocOneBlock(&ScalingTabl, - ScalingTablsz, 5, falseblnr); + ScalingTablsz, 5, false); #endif #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)NewPtr(n); + ReserveAllocBigBlock = (uint8_t *)NewPtr(n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } return IsOk; } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { /* run all the initializations @@ -5692,9 +5692,9 @@ LOCALFUNC blnr InitOSGLU(void) if (InitLocationDat()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) diff --git a/src/UI/OSGLUCCO.m b/src/UI/OSGLUCCO.m index 600cee3..a0f6116 100644 --- a/src/UI/OSGLUCCO.m +++ b/src/UI/OSGLUCCO.m @@ -72,14 +72,14 @@ typedef struct __CFError * CFErrorRef; LOCALVAR CFBundleRef AppServBunRef; -LOCALVAR blnr DidApplicationServicesBun = falseblnr; +LOCALVAR bool DidApplicationServicesBun = false; -LOCALFUNC blnr HaveApplicationServicesBun(void) +LOCALFUNC bool HaveApplicationServicesBun(void) { if (! DidApplicationServicesBun) { AppServBunRef = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.ApplicationServices")); - DidApplicationServicesBun = trueblnr; + DidApplicationServicesBun = true; } return (AppServBunRef != NULL); } @@ -88,14 +88,14 @@ LOCALFUNC blnr HaveApplicationServicesBun(void) LOCALVAR CFBundleRef HIToolboxBunRef; -LOCALVAR blnr DidHIToolboxBunRef = falseblnr; +LOCALVAR bool DidHIToolboxBunRef = false; -LOCALFUNC blnr HaveHIToolboxBunRef(void) +LOCALFUNC bool HaveHIToolboxBunRef(void) { if (! DidHIToolboxBunRef) { HIToolboxBunRef = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.HIToolbox")); - DidHIToolboxBunRef = trueblnr; + DidHIToolboxBunRef = true; } return (HIToolboxBunRef != NULL); } @@ -127,9 +127,9 @@ enum { typedef OSStatus (*SetSystemUIModeProcPtr) (SystemUIMode inMode, SystemUIOptions inOptions); LOCALVAR SetSystemUIModeProcPtr SetSystemUIMode = NULL; -LOCALVAR blnr DidSetSystemUIMode = falseblnr; +LOCALVAR bool DidSetSystemUIMode = false; -LOCALFUNC blnr HaveSetSystemUIMode(void) +LOCALFUNC bool HaveSetSystemUIMode(void) { if (! DidSetSystemUIMode) { if (HaveHIToolboxBunRef()) { @@ -138,7 +138,7 @@ LOCALFUNC blnr HaveSetSystemUIMode(void) CFBundleGetFunctionPointerForName( HIToolboxBunRef, CFSTR("SetSystemUIMode")); } - DidSetSystemUIMode = trueblnr; + DidSetSystemUIMode = true; } return (SetSystemUIMode != NULL); } @@ -154,9 +154,9 @@ typedef Boolean (*CFURLCopyResourcePropertyForKeyProcPtr) ( ); LOCALVAR CFURLCopyResourcePropertyForKeyProcPtr CFURLCopyResourcePropertyForKey = NULL; -LOCALVAR blnr DidCFURLCopyResourcePropertyForKey = falseblnr; +LOCALVAR bool DidCFURLCopyResourcePropertyForKey = false; -LOCALFUNC blnr HaveCFURLCopyResourcePropertyForKey(void) +LOCALFUNC bool HaveCFURLCopyResourcePropertyForKey(void) { if (! DidCFURLCopyResourcePropertyForKey) { if (HaveApplicationServicesBun()) { @@ -166,7 +166,7 @@ LOCALFUNC blnr HaveCFURLCopyResourcePropertyForKey(void) AppServBunRef, CFSTR("CFURLCopyResourcePropertyForKey")); } - DidCFURLCopyResourcePropertyForKey = trueblnr; + DidCFURLCopyResourcePropertyForKey = true; } return (CFURLCopyResourcePropertyForKey != NULL); } @@ -174,9 +174,9 @@ LOCALFUNC blnr HaveCFURLCopyResourcePropertyForKey(void) LOCALVAR const CFStringRef *kCFURLIsAliasFileKey = NULL; -LOCALVAR blnr DidkCFURLIsAliasFileKey = falseblnr; +LOCALVAR bool DidkCFURLIsAliasFileKey = false; -LOCALFUNC blnr HavekCFURLIsAliasFileKey(void) +LOCALFUNC bool HavekCFURLIsAliasFileKey(void) { if (! DidkCFURLIsAliasFileKey) { if (HaveApplicationServicesBun()) { @@ -185,7 +185,7 @@ LOCALFUNC blnr HavekCFURLIsAliasFileKey(void) CFBundleGetDataPointerForName( AppServBunRef, CFSTR("kCFURLIsAliasFileKey")); } - DidkCFURLIsAliasFileKey = trueblnr; + DidkCFURLIsAliasFileKey = true; } return (kCFURLIsAliasFileKey != NULL); } @@ -193,9 +193,9 @@ LOCALFUNC blnr HavekCFURLIsAliasFileKey(void) LOCALVAR const CFStringRef *kCFURLIsSymbolicLinkKey = NULL; -LOCALVAR blnr DidkCFURLIsSymbolicLinkKey = falseblnr; +LOCALVAR bool DidkCFURLIsSymbolicLinkKey = false; -LOCALFUNC blnr HavekCFURLIsSymbolicLinkKey(void) +LOCALFUNC bool HavekCFURLIsSymbolicLinkKey(void) { if (! DidkCFURLIsSymbolicLinkKey) { if (HaveApplicationServicesBun()) { @@ -204,7 +204,7 @@ LOCALFUNC blnr HavekCFURLIsSymbolicLinkKey(void) CFBundleGetDataPointerForName( AppServBunRef, CFSTR("kCFURLIsSymbolicLinkKey")); } - DidkCFURLIsSymbolicLinkKey = trueblnr; + DidkCFURLIsSymbolicLinkKey = true; } return (kCFURLIsSymbolicLinkKey != NULL); } @@ -214,9 +214,9 @@ typedef CFDataRef (*CFURLCreateBookmarkDataFromFileProcPtr) ( CFAllocatorRef allocator, CFURLRef fileURL, CFErrorRef *errorRef); LOCALVAR CFURLCreateBookmarkDataFromFileProcPtr CFURLCreateBookmarkDataFromFile = NULL; -LOCALVAR blnr DidCFURLCreateBookmarkDataFromFile = falseblnr; +LOCALVAR bool DidCFURLCreateBookmarkDataFromFile = false; -LOCALFUNC blnr HaveCFURLCreateBookmarkDataFromFile(void) +LOCALFUNC bool HaveCFURLCreateBookmarkDataFromFile(void) { if (! DidCFURLCreateBookmarkDataFromFile) { if (HaveApplicationServicesBun()) { @@ -225,7 +225,7 @@ LOCALFUNC blnr HaveCFURLCreateBookmarkDataFromFile(void) CFBundleGetFunctionPointerForName(AppServBunRef, CFSTR("CFURLCreateBookmarkDataFromFile")); } - DidCFURLCreateBookmarkDataFromFile = trueblnr; + DidCFURLCreateBookmarkDataFromFile = true; } return (CFURLCreateBookmarkDataFromFile != NULL); } @@ -240,9 +240,9 @@ typedef CFURLRef (*CFURLCreateByResolvingBookmarkDataProcPtr) ( Boolean* isStale, CFErrorRef* error); LOCALVAR CFURLCreateByResolvingBookmarkDataProcPtr CFURLCreateByResolvingBookmarkData = NULL; -LOCALVAR blnr DidCFURLCreateByResolvingBookmarkData = falseblnr; +LOCALVAR bool DidCFURLCreateByResolvingBookmarkData = false; -LOCALFUNC blnr HaveCFURLCreateByResolvingBookmarkData(void) +LOCALFUNC bool HaveCFURLCreateByResolvingBookmarkData(void) { if (! DidCFURLCreateByResolvingBookmarkData) { if (HaveApplicationServicesBun()) { @@ -251,7 +251,7 @@ LOCALFUNC blnr HaveCFURLCreateByResolvingBookmarkData(void) CFBundleGetFunctionPointerForName(AppServBunRef, CFSTR("CFURLCreateByResolvingBookmarkData")); } - DidCFURLCreateByResolvingBookmarkData = trueblnr; + DidCFURLCreateByResolvingBookmarkData = true; } return (CFURLCreateByResolvingBookmarkData != NULL); } @@ -260,9 +260,9 @@ LOCALFUNC blnr HaveCFURLCreateByResolvingBookmarkData(void) typedef boolean_t (*CGCursorIsVisibleProcPtr)(void); LOCALVAR CGCursorIsVisibleProcPtr CGCursorIsVisible = NULL; -LOCALVAR blnr DidCGCursorIsVisible = falseblnr; +LOCALVAR bool DidCGCursorIsVisible = false; -LOCALFUNC blnr HaveCGCursorIsVisible(void) +LOCALFUNC bool HaveCGCursorIsVisible(void) { if (! DidCGCursorIsVisible) { if (HaveApplicationServicesBun()) { @@ -271,7 +271,7 @@ LOCALFUNC blnr HaveCGCursorIsVisible(void) CFBundleGetFunctionPointerForName( AppServBunRef, CFSTR("CGCursorIsVisible")); } - DidCGCursorIsVisible = trueblnr; + DidCGCursorIsVisible = true; } return (CGCursorIsVisible != NULL); } @@ -303,10 +303,10 @@ LOCALVAR NSString *DataPath = nil; LOCALVAR FILE *dbglog_File = NULL; #endif -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { #if dbglog_ToStdErr - return trueblnr; + return true; #else NSString *myLogPath = [DataPath stringByAppendingPathComponent: @"dbglog.txt"]; @@ -380,14 +380,14 @@ LOCALFUNC NSString * NSStringCreateFromSubstCStr(char *s) } #if IncludeSonyNameNew -LOCALFUNC blnr MacRomanFileNameToNSString(tPbuf i, +LOCALFUNC bool MacRomanFileNameToNSString(tPbuf i, NSString **r) { - ui3p p; + uint8_t * p; void *Buffer = PbufDat[i]; uint32_t L = PbufSize[i]; - p = (ui3p)malloc(L /* + 1 */); + p = (uint8_t *)malloc(L /* + 1 */); if (p != NULL) { NSData *d; uint8_t *p0 = (uint8_t *)Buffer; @@ -437,10 +437,10 @@ LOCALFUNC blnr MacRomanFileNameToNSString(tPbuf i, [d release]; - return trueblnr; + return true; } - return falseblnr; + return false; } #endif @@ -466,7 +466,7 @@ LOCALFUNC tMacErr NSStringToRomanPbuf(NSString *string, tPbuf *r) if (NULL == s) { v = mnvm_miscErr; } else { - ui3p p = (ui3p)malloc(L); + uint8_t * p = (uint8_t *)malloc(L); if (NULL == p) { v = mnvm_miscErr; @@ -496,10 +496,10 @@ LOCALFUNC tMacErr NSStringToRomanPbuf(NSString *string, tPbuf *r) /* --- drives --- */ -LOCALFUNC blnr FindNamedChildPath(NSString *parentPath, +LOCALFUNC bool FindNamedChildPath(NSString *parentPath, char *ChildName, NSString **childPath) { - blnr v = falseblnr; + bool v = false; #if 0 NSString *ss = [NSString stringWithCString:s @@ -518,7 +518,7 @@ LOCALFUNC blnr FindNamedChildPath(NSString *parentPath, NSString *r = [parentPath stringByAppendingPathComponent: ss]; if (nil != r) { *childPath = r; - v = trueblnr; + v = true; } } @@ -626,13 +626,13 @@ LOCALFUNC NSString *ResolveAlias(NSString *filePath, return resolvedPath; } -LOCALFUNC blnr FindNamedChildDirPath(NSString *parentPath, +LOCALFUNC bool FindNamedChildDirPath(NSString *parentPath, char *ChildName, NSString **childPath) { NSString *r; BOOL isDir; Boolean isDirectory; - blnr v = falseblnr; + bool v = false; if (FindNamedChildPath(parentPath, ChildName, &r)) if ([[NSFileManager defaultManager] @@ -640,13 +640,13 @@ LOCALFUNC blnr FindNamedChildDirPath(NSString *parentPath, { if (isDir) { *childPath = r; - v = trueblnr; + v = true; } else { NSString *RslvPath = ResolveAlias(r, &isDirectory); if (nil != RslvPath) { if (isDirectory) { *childPath = RslvPath; - v = trueblnr; + v = true; } } } @@ -655,13 +655,13 @@ LOCALFUNC blnr FindNamedChildDirPath(NSString *parentPath, return v; } -LOCALFUNC blnr FindNamedChildFilePath(NSString *parentPath, +LOCALFUNC bool FindNamedChildFilePath(NSString *parentPath, char *ChildName, NSString **childPath) { NSString *r; BOOL isDir; Boolean isDirectory; - blnr v = falseblnr; + bool v = false; if (FindNamedChildPath(parentPath, ChildName, &r)) if ([[NSFileManager defaultManager] @@ -672,11 +672,11 @@ LOCALFUNC blnr FindNamedChildFilePath(NSString *parentPath, if (nil != RslvPath) { if (! isDirectory) { *childPath = RslvPath; - v = trueblnr; + v = true; } } else { *childPath = r; - v = trueblnr; + v = true; } } } @@ -708,7 +708,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -762,9 +762,9 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) */ #if HaveAdvisoryLocks -LOCALFUNC blnr LockFile(FILE *refnum) +LOCALFUNC bool LockFile(FILE *refnum) { - blnr IsOk = falseblnr; + bool IsOk = false; #if 0 struct flock fl; @@ -777,9 +777,9 @@ LOCALFUNC blnr LockFile(FILE *refnum) fl.l_whence = SEEK_SET; /* type of l_start */ if (-1 == fcntl(fd, F_SETLK, &fl)) { MacMsg(kStrImageInUseTitle, kStrImageInUseMessage, - falseblnr); + false); } else { - IsOk = trueblnr; + IsOk = true; } #else int fd = fileno(refnum); @@ -788,7 +788,7 @@ LOCALFUNC blnr LockFile(FILE *refnum) if (EWOULDBLOCK == errno) { /* already locked */ MacMsg(kStrImageInUseTitle, kStrImageInUseMessage, - falseblnr); + false); } else { /* @@ -796,10 +796,10 @@ LOCALFUNC blnr LockFile(FILE *refnum) for this volume. Don't prevent opening. */ - IsOk = trueblnr; + IsOk = true; } } else { - IsOk = trueblnr; + IsOk = true; } #endif @@ -831,7 +831,7 @@ LOCALPROC UnlockFile(FILE *refnum) } #endif -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { FILE *refnum = Drives[Drive_No]; @@ -866,13 +866,13 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } #if IncludeSonyNew GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) { - return vSonyEject0(Drive_No, trueblnr); + return vSonyEject0(Drive_No, true); } #endif @@ -904,15 +904,15 @@ GLOBALOSGLUFUNC tMacErr vSonyGetName(tDrive Drive_No, tPbuf *r) } #endif -LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(FILE *refnum, bool locked, NSString *filePath) { tDrive Drive_No; - blnr IsOk = falseblnr; + bool IsOk = false; if (! FirstFreeDisk(&Drive_No)) { MacMsg(kStrTooManyImagesTitle, kStrTooManyImagesMessage, - falseblnr); + false); } else { /* printf("Sony_Insert0 %d\n", (int)Drive_No); */ @@ -927,7 +927,7 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, DriveNames[Drive_No] = [filePath retain]; #endif - IsOk = trueblnr; + IsOk = true; } } @@ -938,35 +938,35 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, return IsOk; } -LOCALFUNC blnr Sony_Insert1(NSString *filePath, blnr silentfail) +LOCALFUNC bool Sony_Insert1(NSString *filePath, bool silentfail) { /* const char *drivepath = [filePath UTF8String]; */ const char *drivepath = [filePath fileSystemRepresentation]; - blnr locked = falseblnr; + bool locked = false; /* printf("Sony_Insert1 %s\n", drivepath); */ FILE *refnum = fopen(drivepath, "rb+"); if (NULL == refnum) { - locked = trueblnr; + locked = true; refnum = fopen(drivepath, "rb"); } if (NULL == refnum) { if (! silentfail) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } else { return Sony_Insert0(refnum, locked, filePath); } - return falseblnr; + return false; } -LOCALFUNC blnr Sony_Insert2(char *s) +LOCALFUNC bool Sony_Insert2(char *s) { NSString *sPath; if (! FindNamedChildFilePath(DataPath, s, &sPath)) { - return falseblnr; + return false; } else { - return Sony_Insert1(sPath, trueblnr); + return Sony_Insert1(sPath, true); } } @@ -999,14 +999,14 @@ LOCALFUNC tMacErr LoadMacRomPath(NSString *RomPath) return err; } -LOCALFUNC blnr Sony_Insert1a(NSString *filePath) +LOCALFUNC bool Sony_Insert1a(NSString *filePath) { - blnr v; + bool v; if (! ROM_loaded) { v = (mnvm_noErr == LoadMacRomPath(filePath)); } else { - v = Sony_Insert1(filePath, falseblnr); + v = Sony_Insert1(filePath, false); } return v; @@ -1025,12 +1025,12 @@ LOCALPROC Sony_ResolveInsert(NSString *filePath) } } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; @@ -1042,7 +1042,7 @@ LOCALFUNC blnr Sony_InsertIth(int i) return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { if (! AnyDiskInserted()) { int i; @@ -1052,11 +1052,11 @@ LOCALFUNC blnr LoadInitialImages(void) } } - return trueblnr; + return true; } #if IncludeSonyNew -LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L) +LOCALFUNC bool WriteZero(FILE *refnum, uint32_t L) { #define ZeroBufferSize 2048 uint32_t i; @@ -1067,25 +1067,25 @@ LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L) while (L > 0) { i = (L > ZeroBufferSize) ? ZeroBufferSize : L; if (fwrite(buffer, 1, i, refnum) != i) { - return falseblnr; + return false; } L -= i; } - return trueblnr; + return true; } #endif #if IncludeSonyNew LOCALPROC MakeNewDisk0(uint32_t L, NSString *sPath) { - blnr IsOk = falseblnr; + bool IsOk = false; const char *drivepath = [sPath fileSystemRepresentation]; FILE *refnum = fopen(drivepath, "wb+"); if (NULL == refnum) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } else { if (WriteZero(refnum, L)) { - IsOk = Sony_Insert0(refnum, falseblnr, sPath); + IsOk = Sony_Insert0(refnum, false, sPath); refnum = NULL; } if (refnum != NULL) { @@ -1159,7 +1159,7 @@ LOCALFUNC tMacErr LoadMacRomFromGlobalDir(void) return err; } -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -1169,7 +1169,7 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } @@ -1428,7 +1428,7 @@ LOCALPROC UpdateKeyboardModifiers(NSUInteger newMods) /* cursor hiding */ -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool WantCursorHidden = false; #if MayFullScreen LOCALVAR short hOffset; @@ -1438,19 +1438,19 @@ LOCALVAR short vOffset; #endif #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (0 != WantInitFullScreen); +LOCALVAR bool UseFullScreen = (0 != WantInitFullScreen); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (0 != WantInitMagnify); +LOCALVAR bool UseMagnify = (0 != WantInitMagnify); #endif -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; #if EnableMagnify #define MaxScale WindowScale @@ -1458,12 +1458,12 @@ LOCALVAR blnr CurSpeedStopped = trueblnr; #define MaxScale 1 #endif -LOCALVAR blnr HaveCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; ShowCursor(); } } @@ -1471,7 +1471,7 @@ LOCALPROC ForceShowCursor(void) /* cursor moving */ #if EnableMoveMouse -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { NSPoint p; CGPoint cgp; @@ -1523,7 +1523,7 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) } #endif - return trueblnr; + return true; } #endif @@ -1541,14 +1541,14 @@ LOCALPROC AdjustMouseMotionGrab(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } } else #endif { if (HaveMouseMotion) { (void) MoveMouse(CurMouseH, CurMouseV); - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -1578,7 +1578,7 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -1588,7 +1588,7 @@ LOCALPROC MouseConstrain(void) LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if VarFullScreen if (UseFullScreen) @@ -1628,17 +1628,17 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { if (NewMousePosh < 0) { NewMousePosh = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosh >= vMacScreenWidth) { NewMousePosh = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePosv < 0) { NewMousePosv = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosv >= vMacScreenHeight) { NewMousePosv = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } #if VarFullScreen @@ -1646,7 +1646,7 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) #endif #if MayFullScreen { - ShouldHaveCursorHidden = trueblnr; + ShouldHaveCursorHidden = true; } #endif @@ -1673,12 +1673,12 @@ LOCALPROC CheckMouseState(void) MousePositionNotify((int) p.x, (int) p.y); } -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; +LOCALVAR bool gTrueBackgroundFlag = false; -LOCALVAR ui3p ScalingBuff = nullpr; +LOCALVAR uint8_t * ScalingBuff = nullpr; -LOCALVAR ui3p CLUT_final; +LOCALVAR uint8_t * CLUT_final; #define CLUT_finalsz1 (256 * 8) @@ -1743,9 +1743,9 @@ LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left, if (! ColorTransValid) { int j; int k; - ui5p p4; + uint32_t * p4; - p4 = (ui5p)CLUT_final; + p4 = (uint32_t *)CLUT_final; for (i = 0; i < 256; ++i) { for (k = 1 << (3 - vMacScreenDepth); --k >= 0; ) { j = (i >> (k << vMacScreenDepth)) & (CLUT_size - 1); @@ -1754,7 +1754,7 @@ LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left, | ((long)CLUT_blues[j] & 0xFF00); } } - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateMappedColorCopy(top, left, bottom, right); @@ -1768,14 +1768,14 @@ LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left, { if (! ColorTransValid) { int k; - ui3p p4 = (ui3p)CLUT_final; + uint8_t * p4 = (uint8_t *)CLUT_final; for (i = 0; i < 256; ++i) { for (k = 8; --k >= 0; ) { *p4++ = ((i >> k) & 0x01) - 1; } } - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateBWLuminanceCopy(top, left, bottom, right); @@ -1925,7 +1925,7 @@ LOCALVAR NSTimeInterval NextTickChangeTime; LOCALVAR uint32_t NewMacDateInSeconds; -LOCALVAR blnr EmulationWasInterrupted = falseblnr; +LOCALVAR bool EmulationWasInterrupted = false; LOCALPROC UpdateTrueEmulatedTime(void) { @@ -1940,7 +1940,7 @@ LOCALPROC UpdateTrueEmulatedTime(void) ++TrueEmulatedTime; NextTickChangeTime = LatestTime + TickDuration; - EmulationWasInterrupted = trueblnr; + EmulationWasInterrupted = true; #if dbglog_TimeStuff dbglog_writelnNum("emulation interrupted", TrueEmulatedTime); @@ -1968,14 +1968,14 @@ LOCALPROC UpdateTrueEmulatedTime(void) LOCALVAR uint32_t DateDelta; -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { NewMacDateInSeconds = ((uint32_t)LatestTime) + DateDelta; if (CurMacDateInSeconds != NewMacDateInSeconds) { CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } @@ -1985,7 +1985,7 @@ LOCALPROC StartUpTimeAdjust(void) NextTickChangeTime = LatestTime; } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { NSTimeZone *Zone = [NSTimeZone localTimeZone]; uint32_t TzOffSet = (uint32_t)[Zone secondsFromGMT]; @@ -2002,7 +2002,7 @@ LOCALFUNC blnr InitLocationDat(void) | ((isdst ? 0x80 : 0) << 24); #endif - return trueblnr; + return true; } /* --- sound --- */ @@ -2117,20 +2117,20 @@ LOCALPROC Sound_WroteABlock(void) #endif } -LOCALFUNC blnr Sound_EndWrite0(uint16_t actL) +LOCALFUNC bool Sound_EndWrite0(uint16_t actL) { - blnr v; + bool v; TheWriteOffset += actL; if (0 != (TheWriteOffset & kOneBuffMask)) { - v = falseblnr; + v = false; } else { /* just finished a block */ Sound_WroteABlock(); - v = trueblnr; + v = true; } return v; @@ -2225,15 +2225,15 @@ struct SoundR { volatile trSoundTemp lastv; - blnr enabled; - blnr wantplaying; - blnr HaveStartedPlaying; + bool enabled; + bool wantplaying; + bool HaveStartedPlaying; AudioUnit outputAudioUnit; }; typedef struct SoundR SoundR; -LOCALPROC my_audio_callback(void *udata, void *stream, int len) +LOCALPROC audio_callback(void *udata, void *stream, int len) { uint16_t ToPlayLen; uint16_t FilledSoundBuffs; @@ -2250,7 +2250,7 @@ LOCALPROC my_audio_callback(void *udata, void *stream, int len) #endif #if dbglog_SoundStuff - dbglog_writeln("Enter my_audio_callback"); + dbglog_writeln("Enter audio_callback"); dbglog_writelnNum("len", len); #endif @@ -2289,7 +2289,7 @@ label_retry: dbglog_writeln("finished start transition"); #endif - datp->HaveStartedPlaying = trueblnr; + datp->HaveStartedPlaying = true; } } } @@ -2358,7 +2358,7 @@ LOCALFUNC OSStatus audioCallback( for (i = 0; i < n; i++) { abuf = &ioData->mBuffers[i]; - my_audio_callback(inRefCon, + audio_callback(inRefCon, abuf->mData, abuf->mDataByteSize); } @@ -2382,7 +2382,7 @@ LOCALPROC Sound_Stop(void) OSStatus result; uint16_t retry_limit = 50; /* half of a second */ - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; label_retry: if (kCenterTempSound == cur_audio.lastv) { @@ -2441,8 +2441,8 @@ LOCALPROC Sound_Start(void) Sound_Start0(); cur_audio.lastv = kCenterTempSound; - cur_audio.HaveStartedPlaying = falseblnr; - cur_audio.wantplaying = trueblnr; + cur_audio.HaveStartedPlaying = false; + cur_audio.wantplaying = true; if (noErr != (result = AudioOutputUnitStart( cur_audio.outputAudioUnit))) @@ -2450,7 +2450,7 @@ LOCALPROC Sound_Start(void) #if dbglog_HAVE dbglog_writeln("AudioOutputUnitStart fails"); #endif - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; } #if dbglog_SoundStuff @@ -2465,7 +2465,7 @@ LOCALPROC Sound_UnInit(void) OSStatus result; struct AURenderCallbackStruct callback; - cur_audio.enabled = falseblnr; + cur_audio.enabled = false; /* Remove the input callback */ callback.inputProc = 0; @@ -2497,7 +2497,7 @@ LOCALPROC Sound_UnInit(void) #define SOUND_SAMPLERATE 22255 /* = round(7833600 * 2 / 704) */ -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { OSStatus result = noErr; Component comp; @@ -2509,7 +2509,7 @@ LOCALFUNC blnr Sound_Init(void) cur_audio.fPlayOffset = &ThePlayOffset; cur_audio.fFillOffset = &TheFillOffset; cur_audio.fMinFilledSoundBuffs = &MinFilledSoundBuffs; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; @@ -2600,7 +2600,7 @@ LOCALFUNC blnr Sound_Init(void) } else { - cur_audio.enabled = trueblnr; + cur_audio.enabled = true; Sound_Start(); /* @@ -2610,7 +2610,7 @@ LOCALFUNC blnr Sound_Init(void) */ } - return trueblnr; /* keep going, even if no sound */ + return true; /* keep going, even if no sound */ } GLOBALOSGLUPROC Sound_EndWrite(uint16_t actL) @@ -2937,7 +2937,7 @@ LOCALPROC ReconnectKeyCodes3(void) LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - MouseButtonSet(falseblnr); + MouseButtonSet(false); } /* --- basic dialogs --- */ @@ -3046,7 +3046,7 @@ LOCALPROC BeginDialog(void) LOCALPROC EndDialog(void) { [Window makeKeyWindow]; - EmulationWasInterrupted = trueblnr; + EmulationWasInterrupted = true; } LOCALPROC InsertADisk0(void) @@ -3074,7 +3074,7 @@ LOCALPROC InsertADisk0(void) /* --- main window creation and disposal --- */ -LOCALFUNC blnr Screen_Init(void) +LOCALFUNC bool Screen_Init(void) { #if 0 if (noErr != Gestalt(gestaltSystemVersion, @@ -3094,7 +3094,7 @@ LOCALFUNC blnr Screen_Init(void) InitKeyCodes(); - return trueblnr; + return true; } #if MayFullScreen @@ -3109,7 +3109,7 @@ LOCALPROC AdjustMachineGrab(void) #if MayFullScreen LOCALPROC UngrabMachine(void) { - GrabMachine = falseblnr; + GrabMachine = false; AdjustMachineGrab(); } #endif @@ -3146,7 +3146,7 @@ LOCALPROC AdjustGLforSize(int h, int v) ScreenChangedAll(); } -LOCALVAR blnr WantScreensChangedCheck = falseblnr; +LOCALVAR bool WantScreensChangedCheck = false; LOCALPROC UpdateOpenGLContext(void) { @@ -3170,9 +3170,9 @@ LOCALPROC CloseOpenGLContext(void) } } -LOCALFUNC blnr GetOpnGLCntxt(void) +LOCALFUNC bool GetOpnGLCntxt(void) { - blnr v = falseblnr; + bool v = false; if (nil == NSOpnGLCntxt) { NSRect NewWinRect = [NSview frame]; @@ -3225,10 +3225,10 @@ LOCALFUNC blnr GetOpnGLCntxt(void) NewWinRect.size.height); #if 0 != vMacScreenDepth - ColorModeWorks = trueblnr; + ColorModeWorks = true; #endif } - v = trueblnr; + v = true; label_exit: return v; @@ -3362,18 +3362,18 @@ typedef NSUInteger (*modifierFlagsProcPtr) - (BOOL)windowShouldClose:(id)sender { - RequestMacOff = trueblnr; + RequestMacOff = true; return NO; } - (void)windowDidBecomeKey:(NSNotification *)aNotification { - gTrueBackgroundFlag = falseblnr; + gTrueBackgroundFlag = false; } - (void)windowDidResignKey:(NSNotification *)aNotification { - gTrueBackgroundFlag = trueblnr; + gTrueBackgroundFlag = true; } @end @@ -3478,13 +3478,13 @@ enum { #if MayNotFullScreen LOCALVAR int CurWinIndx; -LOCALVAR blnr HavePositionWins[kNumMagStates]; +LOCALVAR bool HavePositionWins[kNumMagStates]; LOCALVAR NSPoint WinPositionWins[kNumMagStates]; #endif LOCALVAR NSRect SavedScrnBounds; -LOCALFUNC blnr CreateMainWindow(void) +LOCALFUNC bool CreateMainWindow(void) { #if UseCGContextDrawImage CGColorSpaceRef cgColorspace; @@ -3496,7 +3496,7 @@ LOCALFUNC blnr CreateMainWindow(void) NSPoint botleftPos; int NewWindowHeight = vMacScreenHeight; int NewWindowWidth = vMacScreenWidth; - blnr v = falseblnr; + bool v = false; #if VarFullScreen if (UseFullScreen) { @@ -3610,7 +3610,7 @@ LOCALFUNC blnr CreateMainWindow(void) if (! HavePositionWins[WinIndx]) { WinPositionWins[WinIndx].x = botleftPos.x; WinPositionWins[WinIndx].y = botleftPos.y; - HavePositionWins[WinIndx] = trueblnr; + HavePositionWins[WinIndx] = true; NewWinRect = NSMakeRect(botleftPos.x, botleftPos.y, NewWindowWidth, NewWindowHeight); } else { @@ -3702,7 +3702,7 @@ LOCALFUNC blnr CreateMainWindow(void) BytesPerPixel = 4; #endif - v = trueblnr; + v = true; label_exit: @@ -3735,10 +3735,10 @@ struct WState { short f_vOffset; #endif #if VarFullScreen - blnr f_UseFullScreen; + bool f_UseFullScreen; #endif #if EnableMagnify - blnr f_UseMagnify; + bool f_UseMagnify; #endif #if MayNotFullScreen int f_CurWinIndx; @@ -3837,7 +3837,7 @@ LOCALPROC ReCreateMainWindow(void) { WState old_state; WState new_state; - blnr HadCursorHidden = HaveCursorHidden; + bool HadCursorHidden = HaveCursorHidden; #if VarFullScreen if (! UseFullScreen) @@ -3854,7 +3854,7 @@ LOCALPROC ReCreateMainWindow(void) #if MayFullScreen if (GrabMachine) { - GrabMachine = falseblnr; + GrabMachine = false; UngrabMachine(); } #endif @@ -3926,7 +3926,7 @@ LOCALPROC ZapWinStateVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -3960,7 +3960,7 @@ LOCALPROC ToggleWantFullScreen(void) if (kMagStateAuto != NewMagState) { WantMagnify = (kMagStateMagnifgy == NewMagState); } else { - WantMagnify = falseblnr; + WantMagnify = false; if (WantFullScreen) { NSRect MainScrnBounds = [[NSScreen mainScreen] frame]; @@ -3970,7 +3970,7 @@ LOCALPROC ToggleWantFullScreen(void) >= vMacScreenHeight * WindowScale) ) { - WantMagnify = trueblnr; + WantMagnify = true; } } } @@ -3985,7 +3985,7 @@ LOCALPROC LeaveBackground(void) { ReconnectKeyCodes3(); DisableKeyRepeat(); - EmulationWasInterrupted = trueblnr; + EmulationWasInterrupted = true; } LOCALPROC EnterBackground(void) @@ -4013,27 +4013,27 @@ LOCALPROC EnterSpeedStopped(void) } #if IncludeSonyNew && ! SaveDialogEnable -LOCALFUNC blnr FindOrMakeNamedChildDirPath(NSString *parentPath, +LOCALFUNC bool FindOrMakeNamedChildDirPath(NSString *parentPath, char *ChildName, NSString **childPath) { NSString *r; BOOL isDir; Boolean isDirectory; NSFileManager *fm = [NSFileManager defaultManager]; - blnr v = falseblnr; + bool v = false; if (FindNamedChildPath(parentPath, ChildName, &r)) { if ([fm fileExistsAtPath:r isDirectory: &isDir]) { if (isDir) { *childPath = r; - v = trueblnr; + v = true; } else { NSString *RslvPath = ResolveAlias(r, &isDirectory); if (nil != RslvPath) { if (isDirectory) { *childPath = RslvPath; - v = trueblnr; + v = true; } } } @@ -4049,7 +4049,7 @@ createDirectoryAtPath:withIntermediateDirectories:attributes:error: error:nil]) { *childPath = r; - v = trueblnr; + v = true; } } else if ([fm respondsToSelector: @@ -4060,7 +4060,7 @@ createDirectoryAtPath:withIntermediateDirectories:attributes:error: attributes:nil]) { *childPath = r; - v = trueblnr; + v = true; } } else { @@ -4162,19 +4162,19 @@ LOCALPROC MakeNewDiskAtDefault(uint32_t L) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); } if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -4192,7 +4192,7 @@ LOCALPROC CheckForSavedTasks(void) } if (EmulationWasInterrupted) { - EmulationWasInterrupted = falseblnr; + EmulationWasInterrupted = false; if (! gTrueBackgroundFlag) { CheckMouseState(); @@ -4212,7 +4212,7 @@ LOCALPROC CheckForSavedTasks(void) #endif if (WantScreensChangedCheck) { - WantScreensChangedCheck = falseblnr; + WantScreensChangedCheck = false; UpdateOpenGLContext(); @@ -4293,19 +4293,19 @@ LOCALPROC CheckForSavedTasks(void) { MakeNewDiskAtDefault(vSonyNewDiskSize); } - vSonyNewDiskWanted = falseblnr; + vSonyNewDiskWanted = false; /* must be done after may have gotten disk */ } #endif if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } if (! gTrueBackgroundFlag) { if (RequestInsertDisk) { - RequestInsertDisk = falseblnr; + RequestInsertDisk = false; InsertADisk0(); } } @@ -4370,7 +4370,7 @@ LOCALPROC CheckForSavedTasks(void) /* --- main program flow --- */ -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -4399,7 +4399,7 @@ LOCALPROC ProcessEventLocation(NSEvent *event) MousePositionNotify((int) p.x, (int) p.y); } -LOCALPROC ProcessKeyEvent(blnr down, NSEvent *event) +LOCALPROC ProcessKeyEvent(bool down, NSEvent *event) { uint8_t scancode = [event keyCode]; @@ -4430,7 +4430,7 @@ LOCALPROC ProcessOneSystemEvent(NSEvent *event) #endif ) { - MouseButtonSet(trueblnr); + MouseButtonSet(true); } else { /* doesn't belong to us */ [NSApp sendEvent: event]; @@ -4450,7 +4450,7 @@ LOCALPROC ProcessOneSystemEvent(NSEvent *event) /* doesn't belong to us */ [NSApp sendEvent: event]; } else { - MouseButtonSet(falseblnr); + MouseButtonSet(false); } break; @@ -4472,10 +4472,10 @@ LOCALPROC ProcessOneSystemEvent(NSEvent *event) } break; case NSKeyUp: - ProcessKeyEvent(falseblnr, event); + ProcessKeyEvent(false, event); break; case NSKeyDown: - ProcessKeyEvent(trueblnr, event); + ProcessKeyEvent(true, event); break; case NSFlagsChanged: ProcessEventModifiers(event); @@ -4595,7 +4595,7 @@ typedef Boolean (*SecTranslocateIsTranslocatedURL_t)( typedef CFURLRef (*SecTranslocateCreateOriginalPathForURL_t)( CFURLRef translocatedPath, CFErrorRef * error); -LOCALFUNC blnr setupWorkingDirectory(void) +LOCALFUNC bool setupWorkingDirectory(void) { NSString *myAppDir; NSString *contentsPath; @@ -4690,7 +4690,7 @@ LOCALFUNC blnr setupWorkingDirectory(void) } [DataPath retain]; - return trueblnr; + return true; } @interface ClassApplicationDelegate : NSObject @@ -4733,7 +4733,7 @@ LOCALFUNC blnr setupWorkingDirectory(void) - (void)applicationDidChangeScreenParameters: (NSNotification *)aNotification { - WantScreensChangedCheck = trueblnr; + WantScreensChangedCheck = true; } - (IBAction)performSpecialMoreCommands:(id)sender @@ -4743,7 +4743,7 @@ LOCALFUNC blnr setupWorkingDirectory(void) - (IBAction)performFileOpen:(id)sender { - RequestInsertDisk = trueblnr; + RequestInsertDisk = true; } - (IBAction)performApplicationAbout:(id)sender @@ -4755,7 +4755,7 @@ LOCALFUNC blnr setupWorkingDirectory(void) LOCALVAR ClassApplicationDelegate *ApplicationDelegate = nil; -LOCALFUNC blnr InitCocoaStuff(void) +LOCALFUNC bool InitCocoaStuff(void) { NSApplication *NSApp = [NSApplication sharedApplication]; /* @@ -4788,7 +4788,7 @@ LOCALFUNC blnr InitCocoaStuff(void) immediate halt. */ - return trueblnr; + return true; } LOCALPROC UnInitCocoaStuff(void) @@ -4822,53 +4822,53 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif ReserveAllocOneBlock(&ScalingBuff, vMacScreenNumPixels #if 0 != vMacScreenDepth * 4 #endif - , 5, falseblnr); - ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, falseblnr); + , 5, false); + ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, false); #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { #if 0 /* for testing start up error reporting */ - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); - return falseblnr; + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); + return false; #else uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -4883,9 +4883,9 @@ LOCALPROC UnallocMemory(void) } } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { - blnr IsOk = falseblnr; + bool IsOk = false; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (AllocMemory()) @@ -4913,7 +4913,7 @@ LOCALFUNC blnr InitOSGLU(void) if (CreateMainWindow()) if (WaitForRom()) { - IsOk = trueblnr; + IsOk = true; } [pool release]; diff --git a/src/UI/OSGLUNDS.c b/src/UI/OSGLUNDS.c index e364d58..49c1ebd 100644 --- a/src/UI/OSGLUNDS.c +++ b/src/UI/OSGLUNDS.c @@ -71,10 +71,10 @@ LOCALVAR int Display_bg2_Main = 0; LOCALVAR FILE *dbglog_File = NULL; #endif -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { #if dbglog_ToStdErr - return trueblnr; + return true; #else dbglog_File = fopen("dbglog.txt", "w"); return (NULL != dbglog_File); @@ -164,7 +164,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -208,7 +208,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) return err; /*& figure out what really to return &*/ } -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { FILE *refnum = Drives[Drive_No]; @@ -235,13 +235,13 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } #if IncludeSonyNew GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) { - return vSonyEject0(Drive_No, trueblnr); + return vSonyEject0(Drive_No, true); } #endif @@ -274,15 +274,15 @@ GLOBALOSGLUFUNC tMacErr vSonyGetName(tDrive Drive_No, tPbuf *r) } #endif -LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(FILE *refnum, bool locked, char *drivepath) { tDrive Drive_No; - blnr IsOk = falseblnr; + bool IsOk = false; if (! FirstFreeDisk(&Drive_No)) { MacMsg(kStrTooManyImagesTitle, kStrTooManyImagesMessage, - falseblnr); + false); } else { /* printf("Sony_Insert0 %d\n", (int)Drive_No); */ @@ -301,7 +301,7 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, } #endif - IsOk = trueblnr; + IsOk = true; } } @@ -312,19 +312,19 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, return IsOk; } -LOCALFUNC blnr Sony_Insert1(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1(char *drivepath, bool silentfail) { - blnr locked = falseblnr; + bool locked = false; /* printf("Sony_Insert1 %s\n", drivepath); */ FILE *refnum = fopen(drivepath, "rb+"); if (NULL == refnum) { - locked = trueblnr; + locked = true; refnum = fopen(drivepath, "rb"); CONSOLE_TRACE(); } if (NULL == refnum) { if (! silentfail) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); CONSOLE_TRACE(); } } else { @@ -332,17 +332,17 @@ LOCALFUNC blnr Sony_Insert1(char *drivepath, blnr silentfail) return Sony_Insert0(refnum, locked, drivepath); } - return falseblnr; + return false; } -#define Sony_Insert2(s) Sony_Insert1(s, trueblnr) +#define Sony_Insert2(s) Sony_Insert1(s, true) -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; @@ -354,7 +354,7 @@ LOCALFUNC blnr Sony_InsertIth(int i) return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { int i; @@ -364,11 +364,11 @@ LOCALFUNC blnr LoadInitialImages(void) /* stop on first error (including file not found) */ } - return trueblnr; + return true; } #if IncludeSonyNew -LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L) +LOCALFUNC bool WriteZero(FILE *refnum, uint32_t L) { #define ZeroBufferSize 2048 uint32_t i; @@ -379,24 +379,24 @@ LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L) while (L > 0) { i = (L > ZeroBufferSize) ? ZeroBufferSize : L; if (fwrite(buffer, 1, i, refnum) != i) { - return falseblnr; + return false; } L -= i; } - return trueblnr; + return true; } #endif #if IncludeSonyNew LOCALPROC MakeNewDisk(uint32_t L, char *drivepath) { - blnr IsOk = falseblnr; + bool IsOk = false; FILE *refnum = fopen(drivepath, "wb+"); if (NULL == refnum) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } else { if (WriteZero(refnum, L)) { - IsOk = Sony_Insert0(refnum, falseblnr, drivepath); + IsOk = Sony_Insert0(refnum, false, drivepath); refnum = NULL; } if (refnum != NULL) { @@ -451,7 +451,7 @@ LOCALFUNC tMacErr LoadMacRomFrom(char *path) return err; } -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -459,7 +459,7 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } /* --- video out --- */ @@ -470,14 +470,14 @@ LOCALVAR short vOffset; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool CurSpeedStopped = true; #if EnableMagnify #define MaxScale WindowScale @@ -554,7 +554,7 @@ LOCALPROC CheckMouseState(void) MotionY = 4; } - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; MousePositionSetDelta(MotionX, MotionY); MouseButtonSet(0 != (KeysHeld & KEY_A)); @@ -580,7 +580,7 @@ LOCALPROC AssignKeyToMKC(int UKey, int LKey, uint8_t MKC) } } -LOCALFUNC blnr KC2MKCInit(void) +LOCALFUNC bool KC2MKCInit(void) { int i; @@ -645,10 +645,10 @@ LOCALFUNC blnr KC2MKCInit(void) InitKeyCodes(); - return trueblnr; + return true; } -LOCALPROC DoKeyCode0(int i, blnr down) +LOCALPROC DoKeyCode0(int i, bool down) { uint8_t key = KC2MKC[i]; if (MKC_None != key) { @@ -658,7 +658,7 @@ LOCALPROC DoKeyCode0(int i, blnr down) } } -LOCALPROC DoKeyCode(int i, blnr down) +LOCALPROC DoKeyCode(int i, bool down) { if ((i >= 0) && (i < 256)) { DoKeyCode0(i, down); @@ -673,10 +673,10 @@ LOCALPROC DoKeyCode(int i, blnr down) is weird about those. */ -LOCALVAR blnr DS_Keystate_Menu = falseblnr; -LOCALVAR blnr DS_Keystate_Shift = falseblnr; +LOCALVAR bool DS_Keystate_Menu = false; +LOCALVAR bool DS_Keystate_Shift = false; -LOCALPROC DS_HandleKey(int32_t Key, blnr Down) +LOCALPROC DS_HandleKey(int32_t Key, bool Down) { if (Key == NOKEY) { return; @@ -700,13 +700,13 @@ LOCALPROC DS_HandleKey(int32_t Key, blnr Down) break; case DVK_SHIFT: - Keyboard_UpdateKeyMap2(MKC_formac_Shift, trueblnr); + Keyboard_UpdateKeyMap2(MKC_formac_Shift, true); break; default: if (Key > 0) { DoKeyCode(Key, Down); - Keyboard_UpdateKeyMap2(MKC_formac_Shift, falseblnr); + Keyboard_UpdateKeyMap2(MKC_formac_Shift, false); } break; } @@ -718,10 +718,10 @@ LOCALPROC DS_HandleKeyboard(void) KeyboardKey = keyboardUpdate(); if ((KeyboardKey == NOKEY) && (LastKeyboardKey != NOKEY)) { - DS_HandleKey(LastKeyboardKey, falseblnr); + DS_HandleKey(LastKeyboardKey, false); LastKeyboardKey = NOKEY; } else { - DS_HandleKey(KeyboardKey, trueblnr); + DS_HandleKey(KeyboardKey, true); LastKeyboardKey = KeyboardKey; } } @@ -735,7 +735,7 @@ LOCALVAR uint32_t TrueEmulatedTime = 0; #define TicksPerSecond 1000000 /* #define TicksPerSecond 1000 */ -LOCALVAR blnr HaveTimeDelta = falseblnr; +LOCALVAR bool HaveTimeDelta = false; LOCALVAR uint32_t TimeDelta; LOCALVAR uint32_t NewMacDateInSeconds; @@ -767,7 +767,7 @@ LOCALPROC GetCurrentTicks(void) CurMacDelta = ((uint32_t)(s->tm_gmtoff) & 0x00FFFFFF) | ((s->tm_isdst ? 0x80 : 0) << 24); #endif - HaveTimeDelta = trueblnr; + HaveTimeDelta = true; } NewMacDateInSeconds = t.tv_sec + TimeDelta; @@ -834,22 +834,22 @@ LOCALPROC UpdateTrueEmulatedTime(void) } } -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { if (CurMacDateInSeconds != NewMacDateInSeconds) { CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { GetCurrentTicks(); CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } /* --- basic dialogs --- */ @@ -883,7 +883,7 @@ LOCALPROC CheckSavedMacMsg(void) Also we need to map 2 banks of vram so we have enough space for our 512x512 surface. */ -LOCALFUNC blnr Screen_Init(void) +LOCALFUNC bool Screen_Init(void) { videoSetMode(MODE_5_2D); vramSetBankA(VRAM_A_MAIN_BG_0x06000000); @@ -894,7 +894,7 @@ LOCALFUNC blnr Screen_Init(void) BG_PALETTE[0] = RGB15(31, 31, 31); BG_PALETTE[1] = RGB15(0, 0, 0); - return trueblnr; + return true; } #if VarFullScreen @@ -925,19 +925,19 @@ LOCALPROC EnterSpeedStopped(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); } if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -958,8 +958,8 @@ LOCALPROC CheckForSavedTasks(void) if (vSonyNewDiskWanted) { #if IncludeSonyNameNew if (vSonyNewDiskName != NotAPbuf) { - ui3p NewDiskNameDat; - if (MacRomanTextToNativePtr(vSonyNewDiskName, trueblnr, + uint8_t * NewDiskNameDat; + if (MacRomanTextToNativePtr(vSonyNewDiskName, true, &NewDiskNameDat)) { MakeNewDisk(vSonyNewDiskSize, (char *)NewDiskNameDat); @@ -972,7 +972,7 @@ LOCALPROC CheckForSavedTasks(void) { MakeNewDiskAtDefault(vSonyNewDiskSize); } - vSonyNewDiskWanted = falseblnr; + vSonyNewDiskWanted = false; /* must be done after may have gotten disk */ } #endif @@ -982,7 +982,7 @@ LOCALPROC CheckForSavedTasks(void) } if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -996,7 +996,7 @@ LOCALPROC CheckForSavedTasks(void) /* --- main program flow --- */ -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -1254,42 +1254,42 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -1309,7 +1309,7 @@ LOCALPROC ZapOSGLUVars(void) DS_ClearVRAM(); } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { DS_SysInit(); @@ -1327,10 +1327,10 @@ LOCALFUNC blnr InitOSGLU(void) if (KC2MKCInit()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) diff --git a/src/UI/UNIX/OSGLUXWN.c b/src/UI/UNIX/OSGLUXWN.c index d29c5ae..95e8d1d 100644 --- a/src/UI/UNIX/OSGLUXWN.c +++ b/src/UI/UNIX/OSGLUXWN.c @@ -140,10 +140,10 @@ LOCALPROC MayFree(char *p) LOCALVAR FILE *dbglog_File = NULL; #endif -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { #if dbglog_ToStdErr - return trueblnr; + return true; #else dbglog_File = fopen("dbglog.txt", "w"); return (NULL != dbglog_File); @@ -263,7 +263,7 @@ LOCALPROC LoadXA(void) } #if EnableDragDrop -LOCALFUNC blnr NetSupportedContains(Atom x) +LOCALFUNC bool NetSupportedContains(Atom x) { /* Note that the window manager could be replaced at @@ -275,7 +275,7 @@ LOCALFUNC blnr NetSupportedContains(Atom x) unsigned long remain_byte; unsigned long i; unsigned char *s = 0; - blnr foundit = falseblnr; + bool foundit = false; Window rootwin = XRootWindow(x_display, DefaultScreen(x_display)); @@ -294,7 +294,7 @@ LOCALFUNC blnr NetSupportedContains(Atom x) for (i = 0; i < ret_item; ++i) { if (v[i] == x) { - foundit = trueblnr; + foundit = true; /* fprintf(stderr, "found the hint\n"); */ } } @@ -344,10 +344,10 @@ LOCALFUNC tMacErr NativeTextToMacRomanPbuf(char *x, tPbuf *r) if (NULL == x) { return mnvm_miscErr; } else { - ui3p p; + uint8_t * p; uint32_t L = strlen(x); - p = (ui3p)malloc(L); + p = (uint8_t *)malloc(L); if (NULL == p) { return mnvm_miscErr; } else { @@ -394,14 +394,14 @@ LOCALVAR const uint8_t MacRoman2NativeTab[] = { #endif #if IncludePbufs -LOCALFUNC blnr MacRomanTextToNativePtr(tPbuf i, blnr IsFileName, - ui3p *r) +LOCALFUNC bool MacRomanTextToNativePtr(tPbuf i, bool IsFileName, + uint8_t * *r) { - ui3p p; + uint8_t * p; void *Buffer = PbufDat[i]; uint32_t L = PbufSize[i]; - p = (ui3p)malloc(L + 1); + p = (uint8_t *)malloc(L + 1); if (p != NULL) { uint8_t *p0 = (uint8_t *)Buffer; uint8_t *p1 = (uint8_t *)p; @@ -445,9 +445,9 @@ LOCALFUNC blnr MacRomanTextToNativePtr(tPbuf i, blnr IsFileName, *p1 = 0; *r = p; - return trueblnr; + return true; } - return falseblnr; + return false; } #endif @@ -491,7 +491,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -545,9 +545,9 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) */ #if HaveAdvisoryLocks -LOCALFUNC blnr LockFile(FILE *refnum) +LOCALFUNC bool LockFile(FILE *refnum) { - blnr IsOk = falseblnr; + bool IsOk = false; #if 1 struct flock fl; @@ -560,18 +560,18 @@ LOCALFUNC blnr LockFile(FILE *refnum) fl.l_whence = SEEK_SET; /* type of l_start */ if (-1 == fcntl(fd, F_SETLK, &fl)) { MacMsg(kStrImageInUseTitle, kStrImageInUseMessage, - falseblnr); + false); } else { - IsOk = trueblnr; + IsOk = true; } #else int fd = fileno(refnum); if (-1 == flock(fd, LOCK_EX | LOCK_NB)) { MacMsg(kStrImageInUseTitle, kStrImageInUseMessage, - falseblnr); + false); } else { - IsOk = trueblnr; + IsOk = true; } #endif @@ -603,7 +603,7 @@ LOCALPROC UnlockFile(FILE *refnum) } #endif -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { FILE *refnum = Drives[Drive_No]; @@ -634,13 +634,13 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } #if IncludeSonyNew GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) { - return vSonyEject0(Drive_No, trueblnr); + return vSonyEject0(Drive_No, true); } #endif @@ -673,15 +673,15 @@ GLOBALOSGLUFUNC tMacErr vSonyGetName(tDrive Drive_No, tPbuf *r) } #endif -LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(FILE *refnum, bool locked, char *drivepath) { tDrive Drive_No; - blnr IsOk = falseblnr; + bool IsOk = false; if (! FirstFreeDisk(&Drive_No)) { MacMsg(kStrTooManyImagesTitle, kStrTooManyImagesMessage, - falseblnr); + false); } else { /* printf("Sony_Insert0 %d\n", (int)Drive_No); */ @@ -703,7 +703,7 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, } #endif - IsOk = trueblnr; + IsOk = true; } } @@ -714,23 +714,23 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, return IsOk; } -LOCALFUNC blnr Sony_Insert1(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1(char *drivepath, bool silentfail) { - blnr locked = falseblnr; + bool locked = false; /* printf("Sony_Insert1 %s\n", drivepath); */ FILE *refnum = fopen(drivepath, "rb+"); if (NULL == refnum) { - locked = trueblnr; + locked = true; refnum = fopen(drivepath, "rb"); } if (NULL == refnum) { if (! silentfail) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } else { return Sony_Insert0(refnum, locked, drivepath); } - return falseblnr; + return false; } LOCALFUNC tMacErr LoadMacRomFrom(char *path) @@ -763,9 +763,9 @@ LOCALFUNC tMacErr LoadMacRomFrom(char *path) return err; } -LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1a(char *drivepath, bool silentfail) { - blnr v; + bool v; if (! ROM_loaded) { v = (mnvm_noErr == LoadMacRomFrom(drivepath)); @@ -776,22 +776,22 @@ LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) return v; } -LOCALFUNC blnr Sony_Insert2(char *s) +LOCALFUNC bool Sony_Insert2(char *s) { char *d = #if CanGetAppPath (NULL == d_arg) ? app_parent : #endif d_arg; - blnr IsOk = falseblnr; + bool IsOk = false; if (NULL == d) { - IsOk = Sony_Insert1(s, trueblnr); + IsOk = Sony_Insert1(s, true); } else { char *t; if (mnvm_noErr == ChildPath(d, s, &t)) { - IsOk = Sony_Insert1(t, trueblnr); + IsOk = Sony_Insert1(t, true); free(t); } } @@ -799,12 +799,12 @@ LOCALFUNC blnr Sony_Insert2(char *s) return IsOk; } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; @@ -816,7 +816,7 @@ LOCALFUNC blnr Sony_InsertIth(int i) return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { if (! AnyDiskInserted()) { int i; @@ -826,11 +826,11 @@ LOCALFUNC blnr LoadInitialImages(void) } } - return trueblnr; + return true; } #if IncludeSonyNew -LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L) +LOCALFUNC bool WriteZero(FILE *refnum, uint32_t L) { #define ZeroBufferSize 2048 uint32_t i; @@ -841,24 +841,24 @@ LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L) while (L > 0) { i = (L > ZeroBufferSize) ? ZeroBufferSize : L; if (fwrite(buffer, 1, i, refnum) != i) { - return falseblnr; + return false; } L -= i; } - return trueblnr; + return true; } #endif #if IncludeSonyNew LOCALPROC MakeNewDisk0(uint32_t L, char *drivepath) { - blnr IsOk = falseblnr; + bool IsOk = false; FILE *refnum = fopen(drivepath, "wb+"); if (NULL == refnum) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } else { if (WriteZero(refnum, L)) { - IsOk = Sony_Insert0(refnum, falseblnr, drivepath); + IsOk = Sony_Insert0(refnum, false, drivepath); refnum = NULL; } if (refnum != NULL) { @@ -1006,7 +1006,7 @@ LOCALFUNC tMacErr LoadMacRomFromAppPar(void) } #endif -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -1020,14 +1020,14 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } #if UseActvFile #define ActvCodeFileName "act_1" -LOCALFUNC tMacErr ActvCodeFileLoad(ui3p p) +LOCALFUNC tMacErr ActvCodeFileLoad(uint8_t * p) { tMacErr err; char *s; @@ -1068,7 +1068,7 @@ LOCALFUNC tMacErr ActvCodeFileLoad(ui3p p) return err; } -LOCALFUNC tMacErr ActvCodeFileSave(ui3p p) +LOCALFUNC tMacErr ActvCodeFileSave(uint8_t * p) { tMacErr err; char *s; @@ -1109,10 +1109,10 @@ LOCALFUNC tMacErr ActvCodeFileSave(ui3p p) /* --- video out --- */ -LOCALVAR Window my_main_wind = 0; -LOCALVAR GC my_gc = NULL; -LOCALVAR blnr NeedFinishOpen1 = falseblnr; -LOCALVAR blnr NeedFinishOpen2 = falseblnr; +LOCALVAR Window main_wind = 0; +LOCALVAR GC gc = NULL; +LOCALVAR bool NeedFinishOpen1 = false; +LOCALVAR bool NeedFinishOpen2 = false; LOCALVAR XColor x_black; LOCALVAR XColor x_white; @@ -1123,25 +1123,25 @@ LOCALVAR short vOffset; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool gTrueBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; #ifndef UseColorImage #define UseColorImage (0 != vMacScreenDepth) #endif -LOCALVAR XImage *my_image = NULL; +LOCALVAR XImage *image = NULL; #if EnableMagnify -LOCALVAR XImage *my_Scaled_image = NULL; +LOCALVAR XImage *Scaled_image = NULL; #endif #if EnableMagnify @@ -1154,7 +1154,7 @@ LOCALVAR XImage *my_Scaled_image = NULL; #if WantScalingTabl -LOCALVAR ui3p ScalingTabl = nullpr; +LOCALVAR uint8_t * ScalingTabl = nullpr; #define ScalingTablsz1 (256 * MaxScale) @@ -1171,7 +1171,7 @@ LOCALVAR ui3p ScalingTabl = nullpr; #if WantScalingBuff -LOCALVAR ui3p ScalingBuff = nullpr; +LOCALVAR uint8_t * ScalingBuff = nullpr; #if UseColorImage @@ -1223,9 +1223,9 @@ LOCALPROC SetUpColorScalingTabl(void) int k; int a; uint32_t v; - ui5p p4; + uint32_t * p4; - p4 = (ui5p)ScalingTabl; + p4 = (uint32_t *)ScalingTabl; for (i = 0; i < 256; ++i) { for (k = 1 << (3 - vMacScreenDepth); --k >= 0; ) { j = (i >> (k << vMacScreenDepth)) & (CLUT_size - 1); @@ -1246,9 +1246,9 @@ LOCALPROC SetUpColorTabl(void) int i; int j; int k; - ui5p p4; + uint32_t * p4; - p4 = (ui5p)ScalingTabl; + p4 = (uint32_t *)ScalingTabl; for (i = 0; i < 256; ++i) { for (k = 1 << (3 - vMacScreenDepth); --k >= 0; ) { j = (i >> (k << vMacScreenDepth)) & (CLUT_size - 1); @@ -1267,9 +1267,9 @@ LOCALPROC SetUpBW2ColorScalingTabl(void) int k; int a; uint32_t v; - ui5p p4; + uint32_t * p4; - p4 = (ui5p)ScalingTabl; + p4 = (uint32_t *)ScalingTabl; for (i = 0; i < 256; ++i) { for (k = 8; --k >= 0; ) { if (0 != ((i >> k) & 1)) { @@ -1292,9 +1292,9 @@ LOCALPROC SetUpBW2ColorTabl(void) int i; int k; uint32_t v; - ui5p p4; + uint32_t * p4; - p4 = (ui5p)ScalingTabl; + p4 = (uint32_t *)ScalingTabl; for (i = 0; i < 256; ++i) { for (k = 8; --k >= 0; ) { if (0 != ((i >> k) & 1)) { @@ -1477,7 +1477,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, #if vMacScreenDepth < 4 if (! ColorTransValid) { SetUpColorScalingTabl(); - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateMappedScaledColorCopy(top, left, bottom, right); @@ -1489,7 +1489,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, { if (! ColorTransValid) { SetUpBW2ColorScalingTabl(); - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateMappedScaledBW2ColorCopy(top, left, bottom, right); @@ -1499,7 +1499,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, { if (! ColorTransValid) { SetUpScalingTabl(); - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateScaledBWCopy(top, left, bottom, right); @@ -1507,16 +1507,16 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, #endif /* UseColorImage */ { - char *saveData = my_Scaled_image->data; - my_Scaled_image->data = (char *)ScalingBuff; + char *saveData = Scaled_image->data; + Scaled_image->data = (char *)ScalingBuff; - XPutImage(x_display, my_main_wind, my_gc, my_Scaled_image, + XPutImage(x_display, main_wind, gc, Scaled_image, left * WindowScale, top * WindowScale, XDest, YDest, (right - left) * WindowScale, (bottom - top) * WindowScale); - my_Scaled_image->data = saveData; + Scaled_image->data = saveData; } } else #endif /* EnableMagnify */ @@ -1528,7 +1528,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, if (! ColorTransValid) { SetUpColorTabl(); - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateMappedColorCopy(top, left, bottom, right); @@ -1548,7 +1548,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, { if (! ColorTransValid) { SetUpBW2ColorTabl(); - ColorTransValid = trueblnr; + ColorTransValid = true; } UpdateMappedBW2ColorCopy(top, left, bottom, right); @@ -1562,14 +1562,14 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, #endif /* UseColorImage */ { - char *saveData = my_image->data; - my_image->data = the_data; + char *saveData = image->data; + image->data = the_data; - XPutImage(x_display, my_main_wind, my_gc, my_image, + XPutImage(x_display, main_wind, gc, image, left, top, XDest, YDest, right - left, bottom - top); - my_image->data = saveData; + image->data = saveData; } } @@ -1592,22 +1592,22 @@ LOCALPROC DrawChangesAndClear(void) /* cursor hiding */ -LOCALVAR blnr HaveCursorHidden = falseblnr; -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; +LOCALVAR bool WantCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; - if (my_main_wind) { - XUndefineCursor(x_display, my_main_wind); + HaveCursorHidden = false; + if (main_wind) { + XUndefineCursor(x_display, main_wind); } } } LOCALVAR Cursor blankCursor = None; -LOCALFUNC blnr CreateBlankCursor(Window rootwin) +LOCALFUNC bool CreateBlankCursor(Window rootwin) /* adapted from X11_CreateNullCursor in context.x11.c in quakeforge 0.5.5, copyright Id Software, Inc. @@ -1617,7 +1617,7 @@ LOCALFUNC blnr CreateBlankCursor(Window rootwin) Pixmap cursormask; XGCValues xgc; GC gc; - blnr IsOk = falseblnr; + bool IsOk = false; cursormask = XCreatePixmap(x_display, rootwin, 1, 1, 1); if (None == cursormask) { @@ -1636,7 +1636,7 @@ LOCALFUNC blnr CreateBlankCursor(Window rootwin) if (None == blankCursor) { WriteExtraErr("XCreatePixmapCursor failed."); } else { - IsOk = trueblnr; + IsOk = true; } } @@ -1654,7 +1654,7 @@ LOCALFUNC blnr CreateBlankCursor(Window rootwin) /* cursor moving */ #if EnableMoveMouse -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { int NewMousePosh; int NewMousePosv; @@ -1663,7 +1663,7 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) Window root_return; Window child_return; unsigned int mask_return; - blnr IsOk; + bool IsOk; int attempts = 0; #if VarFullScreen @@ -1694,8 +1694,8 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) #endif do { - XWarpPointer(x_display, None, my_main_wind, 0, 0, 0, 0, h, v); - XQueryPointer(x_display, my_main_wind, + XWarpPointer(x_display, None, main_wind, 0, 0, 0, 0, h, v); + XQueryPointer(x_display, main_wind, &root_return, &child_return, &root_x_return, &root_y_return, &NewMousePosh, &NewMousePosv, @@ -1716,7 +1716,7 @@ LOCALPROC StartSaveMouseMotion(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } } } @@ -1727,7 +1727,7 @@ LOCALPROC StopSaveMouseMotion(void) { if (HaveMouseMotion) { (void) MoveMouse(CurMouseH, CurMouseV); - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } #endif @@ -1758,7 +1758,7 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -1766,7 +1766,7 @@ LOCALPROC MouseConstrain(void) LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if VarFullScreen if (UseFullScreen) @@ -1806,17 +1806,17 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { if (NewMousePosh < 0) { NewMousePosh = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosh >= vMacScreenWidth) { NewMousePosh = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePosv < 0) { NewMousePosv = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosv >= vMacScreenHeight) { NewMousePosv = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } #if VarFullScreen @@ -1824,7 +1824,7 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) #endif #if MayFullScreen { - ShouldHaveCursorHidden = trueblnr; + ShouldHaveCursorHidden = true; } #endif @@ -1849,7 +1849,7 @@ LOCALPROC CheckMouseState(void) Window child_return; unsigned int mask_return; - XQueryPointer(x_display, my_main_wind, + XQueryPointer(x_display, main_wind, &root_return, &child_return, &root_x_return, &root_y_return, &NewMousePosh, &NewMousePosv, @@ -1874,7 +1874,7 @@ LOCALPROC KC2MKCAssignOne(KeySym ks, uint8_t key) #endif } -LOCALFUNC blnr KC2MKCInit(void) +LOCALFUNC bool KC2MKCInit(void) { int i; @@ -2144,7 +2144,7 @@ LOCALFUNC blnr KC2MKCInit(void) InitKeyCodes(); - return trueblnr; + return true; } LOCALPROC CheckTheCapsLock(void) @@ -2157,7 +2157,7 @@ LOCALPROC CheckTheCapsLock(void) Window child_return; unsigned int mask_return; - XQueryPointer(x_display, my_main_wind, + XQueryPointer(x_display, main_wind, &root_return, &child_return, &root_x_return, &root_y_return, &NewMousePosh, &NewMousePosv, @@ -2167,7 +2167,7 @@ LOCALPROC CheckTheCapsLock(void) (mask_return & LockMask) != 0); } -LOCALPROC DoKeyCode0(int i, blnr down) +LOCALPROC DoKeyCode0(int i, bool down) { uint8_t key = KC2MKC[i]; if (MKC_None != key) { @@ -2175,7 +2175,7 @@ LOCALPROC DoKeyCode0(int i, blnr down) } } -LOCALPROC DoKeyCode(int i, blnr down) +LOCALPROC DoKeyCode(int i, bool down) { if (i == TheCapsLockCode) { CheckTheCapsLock(); @@ -2185,17 +2185,17 @@ LOCALPROC DoKeyCode(int i, blnr down) } #if MayFullScreen && GrabKeysFullScreen -LOCALVAR blnr KeyboardIsGrabbed = falseblnr; +LOCALVAR bool KeyboardIsGrabbed = false; #endif #if MayFullScreen && GrabKeysFullScreen LOCALPROC GrabKeyboard(void) { if (! KeyboardIsGrabbed) { - (void) XGrabKeyboard(x_display, my_main_wind, + (void) XGrabKeyboard(x_display, main_wind, False, GrabModeAsync, GrabModeAsync, CurrentTime); - KeyboardIsGrabbed = trueblnr; + KeyboardIsGrabbed = true; } } #endif @@ -2203,14 +2203,14 @@ LOCALPROC GrabKeyboard(void) #if MayFullScreen && GrabKeysFullScreen LOCALPROC UnGrabKeyboard(void) { - if (KeyboardIsGrabbed && my_main_wind) { + if (KeyboardIsGrabbed && main_wind) { XUngrabKeyboard(x_display, CurrentTime); - KeyboardIsGrabbed = falseblnr; + KeyboardIsGrabbed = false; } } #endif -LOCALVAR blnr NoKeyRepeat = falseblnr; +LOCALVAR bool NoKeyRepeat = false; LOCALVAR int SaveKeyRepeat; LOCALPROC DisableKeyRepeat(void) @@ -2219,7 +2219,7 @@ LOCALPROC DisableKeyRepeat(void) XKeyboardControl k; if ((! NoKeyRepeat) && (x_display != NULL)) { - NoKeyRepeat = trueblnr; + NoKeyRepeat = true; XGetKeyboardControl(x_display, &r); SaveKeyRepeat = r.global_auto_repeat; @@ -2234,14 +2234,14 @@ LOCALPROC RestoreKeyRepeat(void) XKeyboardControl k; if (NoKeyRepeat && (x_display != NULL)) { - NoKeyRepeat = falseblnr; + NoKeyRepeat = false; k.auto_repeat_mode = SaveKeyRepeat; XChangeKeyboardControl(x_display, KBAutoRepeatMode, &k); } } -LOCALVAR blnr WantCmdOptOnReconnect = falseblnr; +LOCALVAR bool WantCmdOptOnReconnect = false; LOCALPROC GetTheDownKeys(void) { @@ -2258,7 +2258,7 @@ LOCALPROC GetTheDownKeys(void) if (0 != ((1 << j) & v)) { int k = i * 8 + j; if (k != TheCapsLockCode) { - DoKeyCode0(k, trueblnr); + DoKeyCode0(k, true); } } } @@ -2270,7 +2270,7 @@ LOCALPROC ReconnectKeyCodes3(void) CheckTheCapsLock(); if (WantCmdOptOnReconnect) { - WantCmdOptOnReconnect = falseblnr; + WantCmdOptOnReconnect = false; GetTheDownKeys(); } @@ -2279,7 +2279,7 @@ LOCALPROC ReconnectKeyCodes3(void) LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - MouseButtonSet(falseblnr); + MouseButtonSet(false); } /* --- time, date, location --- */ @@ -2292,7 +2292,7 @@ LOCALVAR uint32_t TrueEmulatedTime = 0; #define TicksPerSecond 1000000 -LOCALVAR blnr HaveTimeDelta = falseblnr; +LOCALVAR bool HaveTimeDelta = false; LOCALVAR uint32_t TimeDelta; LOCALVAR uint32_t NewMacDateInSeconds; @@ -2317,7 +2317,7 @@ LOCALPROC GetCurrentTicks(void) CurMacDelta = ((uint32_t)(s->tm_gmtoff) & 0x00FFFFFF) | ((s->tm_isdst ? 0x80 : 0) << 24); #endif - HaveTimeDelta = trueblnr; + HaveTimeDelta = true; } NewMacDateInSeconds = t.tv_sec + TimeDelta; @@ -2392,22 +2392,22 @@ LOCALPROC UpdateTrueEmulatedTime(void) } } -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { if (CurMacDateInSeconds != NewMacDateInSeconds) { CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { GetCurrentTicks(); CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } /* --- sound --- */ @@ -2475,20 +2475,20 @@ GLOBALOSGLUFUNC tpSoundSamp Sound_BeginWrite(uint16_t n, uint16_t *actL) return TheSoundBuffer + (TheWriteOffset & kAllBuffMask); } -LOCALFUNC blnr Sound_EndWrite0(uint16_t actL) +LOCALFUNC bool Sound_EndWrite0(uint16_t actL) { - blnr v; + bool v; TheWriteOffset += actL; if (0 != (TheWriteOffset & kOneBuffMask)) { - v = falseblnr; + v = false; } else { /* just finished a block */ TheFillOffset = TheWriteOffset; - v = trueblnr; + v = true; } return v; @@ -2539,7 +2539,7 @@ LOCALPROC CheckSavedMacMsg(void) /* --- clipboard --- */ #if IncludeHostTextClipExchange -LOCALVAR ui3p ClipBuffer = NULL; +LOCALVAR uint8_t * ClipBuffer = NULL; #endif #if IncludeHostTextClipExchange @@ -2558,11 +2558,11 @@ GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i) tMacErr err = mnvm_miscErr; FreeClipBuffer(); - if (MacRomanTextToNativePtr(i, falseblnr, + if (MacRomanTextToNativePtr(i, false, &ClipBuffer)) { XSetSelectionOwner(x_display, XA_CLIPBOARD, - my_main_wind, CurrentTime); + main_wind, CurrentTime); err = mnvm_noErr; } @@ -2573,14 +2573,14 @@ GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i) #endif #if IncludeHostTextClipExchange -LOCALFUNC blnr WaitForClipboardSelection(XEvent *xevent) +LOCALFUNC bool WaitForClipboardSelection(XEvent *xevent) { struct timespec rqt; struct timespec rmt; int i; for (i = 100; --i >= 0; ) { - while (XCheckTypedWindowEvent(x_display, my_main_wind, + while (XCheckTypedWindowEvent(x_display, main_wind, SelectionNotify, xevent)) { if (xevent->xselection.selection != XA_CLIPBOARD) { @@ -2591,7 +2591,7 @@ LOCALFUNC blnr WaitForClipboardSelection(XEvent *xevent) WriteExtraErr("Discarding unwanted SelectionNotify"); } else { /* this is our event */ - return trueblnr; + return true; } } @@ -2599,7 +2599,7 @@ LOCALFUNC blnr WaitForClipboardSelection(XEvent *xevent) rqt.tv_nsec = 10000000; (void) nanosleep(&rqt, &rmt); } - return falseblnr; + return false; } #endif @@ -2608,17 +2608,17 @@ LOCALPROC HTCEimport_do(void) { Window w = XGetSelectionOwner(x_display, XA_CLIPBOARD); - if (w == my_main_wind) { + if (w == main_wind) { /* We own the clipboard, already have ClipBuffer */ } else { FreeClipBuffer(); if (w != None) { XEvent xevent; - XDeleteProperty(x_display, my_main_wind, + XDeleteProperty(x_display, main_wind, XA_MinivMac_Clip); XConvertSelection(x_display, XA_CLIPBOARD, XA_STRING, - XA_MinivMac_Clip, my_main_wind, CurrentTime); + XA_MinivMac_Clip, main_wind, CurrentTime); if (WaitForClipboardSelection(&xevent)) { if (None == xevent.xselection.property) { @@ -2636,7 +2636,7 @@ LOCALPROC HTCEimport_do(void) unsigned char *s = NULL; if ((Success != XGetWindowProperty( - x_display, my_main_wind, XA_MinivMac_Clip, + x_display, main_wind, XA_MinivMac_Clip, 0, 65535, False, AnyPropertyType, &ret_type, &ret_format, &ret_item, &remain_byte, &s)) || (ret_type != XA_STRING) @@ -2647,10 +2647,10 @@ LOCALPROC HTCEimport_do(void) "XGetWindowProperty failed" " in HTCEimport_do"); } else { - ClipBuffer = (ui3p)malloc(ret_item + 1); + ClipBuffer = (uint8_t *)malloc(ret_item + 1); if (NULL == ClipBuffer) { MacMsg(kStrOutOfMemTitle, - kStrOutOfMemMessage, falseblnr); + kStrOutOfMemMessage, false); } else { MoveBytes((anyp)s, (anyp)ClipBuffer, ret_item); @@ -2659,7 +2659,7 @@ LOCALPROC HTCEimport_do(void) XFree(s); } } - XDeleteProperty(x_display, my_main_wind, + XDeleteProperty(x_display, main_wind, XA_MinivMac_Clip); } } @@ -2678,9 +2678,9 @@ GLOBALOSGLUFUNC tMacErr HTCEimport(tPbuf *r) #endif #if IncludeHostTextClipExchange -LOCALFUNC blnr HandleSelectionRequestClipboard(XEvent *theEvent) +LOCALFUNC bool HandleSelectionRequestClipboard(XEvent *theEvent) { - blnr RequestFilled = falseblnr; + bool RequestFilled = false; #if DbgEvents dbglog_writeln("Requested XA_CLIPBOARD"); @@ -2708,7 +2708,7 @@ LOCALFUNC blnr HandleSelectionRequestClipboard(XEvent *theEvent) (unsigned char *)a, sizeof(a) / sizeof(Atom)); - RequestFilled = trueblnr; + RequestFilled = true; } else if (theEvent->xselectionrequest.target == XA_STRING) { XChangeProperty(x_display, theEvent->xselectionrequest.requestor, @@ -2719,7 +2719,7 @@ LOCALFUNC blnr HandleSelectionRequestClipboard(XEvent *theEvent) (unsigned char *)ClipBuffer, strlen((char *)ClipBuffer)); - RequestFilled = trueblnr; + RequestFilled = true; } return RequestFilled; @@ -2740,7 +2740,7 @@ LOCALPROC ActivateWind(Time time) xevent.xany.type = ClientMessage; xevent.xclient.send_event = True; - xevent.xclient.window = my_main_wind; + xevent.xclient.window = main_wind; xevent.xclient.message_type = XA_NetActiveWindow; xevent.xclient.format = 32; xevent.xclient.data.l[0] = 1; @@ -2754,7 +2754,7 @@ LOCALPROC ActivateWind(Time time) } } - XRaiseWindow(x_display, my_main_wind); + XRaiseWindow(x_display, main_wind); /* In RedHat 7.1, _NET_ACTIVE_WINDOW supported, but XSendEvent of _NET_ACTIVE_WINDOW @@ -2764,7 +2764,7 @@ LOCALPROC ActivateWind(Time time) managers where it isn't needed. (Such as in Ubuntu 5.10) */ - XSetInputFocus(x_display, my_main_wind, + XSetInputFocus(x_display, main_wind, RevertToPointerRoot, time); /* And call this always too, just in case */ } @@ -2790,7 +2790,7 @@ LOCALPROC ParseOneUri(char *s) ++s; } } - (void) Sony_Insert1a(s, falseblnr); + (void) Sony_Insert1a(s, false); } } #endif @@ -2852,7 +2852,7 @@ LOCALVAR Window PendingDragWindow = None; #if EnableDragDrop LOCALPROC HandleSelectionNotifyDnd(XEvent *theEvent) { - blnr DropOk = falseblnr; + bool DropOk = false; #if DbgEvents dbglog_writeln("Got XA_DndSelection"); @@ -2867,7 +2867,7 @@ LOCALPROC HandleSelectionNotifyDnd(XEvent *theEvent) unsigned long remain_byte; unsigned char *s = NULL; - if ((Success != XGetWindowProperty(x_display, my_main_wind, + if ((Success != XGetWindowProperty(x_display, main_wind, XA_MinivMac_DndXchng, 0, 65535, False, XA_UriList, &ret_type, &ret_format, &ret_item, &remain_byte, &s)) @@ -2877,14 +2877,14 @@ LOCALPROC HandleSelectionNotifyDnd(XEvent *theEvent) "XGetWindowProperty failed in SelectionNotify"); } else { ParseUriList((char *)s); - DropOk = trueblnr; + DropOk = true; XFree(s); } } else { WriteExtraErr("Got Unknown SelectionNotify"); } - XDeleteProperty(x_display, my_main_wind, + XDeleteProperty(x_display, main_wind, XA_MinivMac_DndXchng); if (PendingDragWindow != None) { @@ -2898,7 +2898,7 @@ LOCALPROC HandleSelectionNotifyDnd(XEvent *theEvent) xevent.xclient.message_type = XA_DndFinished; xevent.xclient.format = 32; - xevent.xclient.data.l[0] = my_main_wind; + xevent.xclient.data.l[0] = main_wind; if (DropOk) { xevent.xclient.data.l[1] = 1; } @@ -2913,7 +2913,7 @@ LOCALPROC HandleSelectionNotifyDnd(XEvent *theEvent) if (DropOk && gTrueBackgroundFlag) { ActivateWind(theEvent->xselection.time); - WantCmdOptOnReconnect = trueblnr; + WantCmdOptOnReconnect = true; } } #endif @@ -2935,7 +2935,7 @@ LOCALPROC HandleClientMessageDndPosition(XEvent *theEvent) dbglog_writeln("Got XdndPosition"); #endif - XGetGeometry(x_display, my_main_wind, + XGetGeometry(x_display, main_wind, &rr, &xr, &yr, &wr, &hr, &bwr, &dr); memset (&xevent, 0, sizeof(xevent)); xevent.xany.type = ClientMessage; @@ -2969,14 +2969,14 @@ LOCALPROC HandleClientMessageDndDrop(XEvent *theEvent) #endif XConvertSelection(x_display, XA_DndSelection, XA_UriList, - XA_MinivMac_DndXchng, my_main_wind, timestamp); + XA_MinivMac_DndXchng, main_wind, timestamp); } #endif #define UseMotionEvents 1 #if UseMotionEvents -LOCALVAR blnr CaughtMouse = falseblnr; +LOCALVAR bool CaughtMouse = false; #endif #if MayNotFullScreen @@ -2992,7 +2992,7 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) WriteExtraErr("Got event for some other display"); } else switch(theEvent->type) { case KeyPress: - if (theEvent->xkey.window != my_main_wind) { + if (theEvent->xkey.window != main_wind) { WriteExtraErr("Got KeyPress for some other window"); } else { #if DbgEvents @@ -3000,11 +3000,11 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) #endif MousePositionNotify(theEvent->xkey.x, theEvent->xkey.y); - DoKeyCode(theEvent->xkey.keycode, trueblnr); + DoKeyCode(theEvent->xkey.keycode, true); } break; case KeyRelease: - if (theEvent->xkey.window != my_main_wind) { + if (theEvent->xkey.window != main_wind) { WriteExtraErr("Got KeyRelease for some other window"); } else { #if DbgEvents @@ -3012,12 +3012,12 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) #endif MousePositionNotify(theEvent->xkey.x, theEvent->xkey.y); - DoKeyCode(theEvent->xkey.keycode, falseblnr); + DoKeyCode(theEvent->xkey.keycode, false); } break; case ButtonPress: /* any mouse button, we don't care which */ - if (theEvent->xbutton.window != my_main_wind) { + if (theEvent->xbutton.window != main_wind) { WriteExtraErr("Got ButtonPress for some other window"); } else { /* @@ -3027,23 +3027,23 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) */ MousePositionNotify( theEvent->xbutton.x, theEvent->xbutton.y); - MouseButtonSet(trueblnr); + MouseButtonSet(true); } break; case ButtonRelease: /* any mouse button, we don't care which */ - if (theEvent->xbutton.window != my_main_wind) { + if (theEvent->xbutton.window != main_wind) { WriteExtraErr( "Got ButtonRelease for some other window"); } else { MousePositionNotify( theEvent->xbutton.x, theEvent->xbutton.y); - MouseButtonSet(falseblnr); + MouseButtonSet(false); } break; #if UseMotionEvents case MotionNotify: - if (theEvent->xmotion.window != my_main_wind) { + if (theEvent->xmotion.window != main_wind) { WriteExtraErr("Got MotionNotify for some other window"); } else { MousePositionNotify( @@ -3051,20 +3051,20 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) } break; case EnterNotify: - if (theEvent->xcrossing.window != my_main_wind) { + if (theEvent->xcrossing.window != main_wind) { WriteExtraErr("Got EnterNotify for some other window"); } else { #if DbgEvents dbglog_writeln("- event - EnterNotify"); #endif - CaughtMouse = trueblnr; + CaughtMouse = true; MousePositionNotify( theEvent->xcrossing.x, theEvent->xcrossing.y); } break; case LeaveNotify: - if (theEvent->xcrossing.window != my_main_wind) { + if (theEvent->xcrossing.window != main_wind) { WriteExtraErr("Got LeaveNotify for some other window"); } else { #if DbgEvents @@ -3073,12 +3073,12 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) MousePositionNotify( theEvent->xcrossing.x, theEvent->xcrossing.y); - CaughtMouse = falseblnr; + CaughtMouse = false; } break; #endif case Expose: - if (theEvent->xexpose.window != my_main_wind) { + if (theEvent->xexpose.window != main_wind) { WriteExtraErr( "Got SelectionRequest for some other window"); } else { @@ -3140,17 +3140,17 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) HaveChangedScreenBuff(y0, x0, y1, x1); } - NeedFinishOpen1 = falseblnr; + NeedFinishOpen1 = false; } break; #if IncludeHostTextClipExchange case SelectionRequest: - if (theEvent->xselectionrequest.owner != my_main_wind) { + if (theEvent->xselectionrequest.owner != main_wind) { WriteExtraErr( "Got SelectionRequest for some other window"); } else { XEvent xevent; - blnr RequestFilled = falseblnr; + bool RequestFilled = false; #if DbgEvents dbglog_writeln("- event - SelectionRequest"); @@ -3193,7 +3193,7 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) } break; case SelectionClear: - if (theEvent->xselectionclear.window != my_main_wind) { + if (theEvent->xselectionclear.window != main_wind) { WriteExtraErr( "Got SelectionClear for some other window"); } else { @@ -3213,7 +3213,7 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) #endif #if EnableDragDrop case SelectionNotify: - if (theEvent->xselection.requestor != my_main_wind) { + if (theEvent->xselection.requestor != main_wind) { WriteExtraErr( "Got SelectionNotify for some other window"); } else { @@ -3236,7 +3236,7 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) break; #endif case ClientMessage: - if (theEvent->xclient.window != my_main_wind) { + if (theEvent->xclient.window != main_wind) { WriteExtraErr( "Got ClientMessage for some other window"); } else { @@ -3273,20 +3273,20 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) but none of the other programs I looked at did. */ - RequestMacOff = trueblnr; + RequestMacOff = true; } } } break; case FocusIn: - if (theEvent->xfocus.window != my_main_wind) { + if (theEvent->xfocus.window != main_wind) { WriteExtraErr("Got FocusIn for some other window"); } else { #if DbgEvents dbglog_writeln("- event - FocusIn"); #endif - gTrueBackgroundFlag = falseblnr; + gTrueBackgroundFlag = false; #if UseMotionEvents CheckMouseState(); /* @@ -3298,14 +3298,14 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) } break; case FocusOut: - if (theEvent->xfocus.window != my_main_wind) { + if (theEvent->xfocus.window != main_wind) { WriteExtraErr("Got FocusOut for some other window"); } else { #if DbgEvents dbglog_writeln("- event - FocusOut"); #endif - gTrueBackgroundFlag = trueblnr; + gTrueBackgroundFlag = true; } break; default: @@ -3315,12 +3315,12 @@ LOCALPROC HandleTheEvent(XEvent *theEvent) /* --- main window creation and disposal --- */ -LOCALVAR int my_argc; -LOCALVAR char **my_argv; +LOCALVAR int argc; +LOCALVAR char **argv; LOCALVAR char *display_name = NULL; -LOCALFUNC blnr Screen_Init(void) +LOCALFUNC bool Screen_Init(void) { Window rootwin; int screen; @@ -3330,7 +3330,7 @@ LOCALFUNC blnr Screen_Init(void) x_display = XOpenDisplay(display_name); if (NULL == x_display) { fprintf(stderr, "Cannot connect to X server.\n"); - return falseblnr; + return false; } screen = DefaultScreen(x_display); @@ -3353,37 +3353,37 @@ LOCALFUNC blnr Screen_Init(void) } if (! CreateBlankCursor(rootwin)) { - return falseblnr; + return false; } #if ! UseColorImage - my_image = XCreateImage(x_display, Xvisual, 1, XYBitmap, 0, + image = XCreateImage(x_display, Xvisual, 1, XYBitmap, 0, NULL /* (char *)image_Mem1 */, vMacScreenWidth, vMacScreenHeight, 32, vMacScreenMonoByteWidth); - if (NULL == my_image) { + if (NULL == image) { fprintf(stderr, "XCreateImage failed.\n"); - return falseblnr; + return false; } #if 0 fprintf(stderr, "bitmap_bit_order = %d\n", - (int)my_image->bitmap_bit_order); - fprintf(stderr, "byte_order = %d\n", (int)my_image->byte_order); + (int)image->bitmap_bit_order); + fprintf(stderr, "byte_order = %d\n", (int)image->byte_order); #endif - my_image->bitmap_bit_order = MSBFirst; - my_image->byte_order = MSBFirst; + image->bitmap_bit_order = MSBFirst; + image->byte_order = MSBFirst; #endif #if UseColorImage - my_image = XCreateImage(x_display, Xvisual, 24, ZPixmap, 0, + image = XCreateImage(x_display, Xvisual, 24, ZPixmap, 0, NULL /* (char *)image_Mem1 */, vMacScreenWidth, vMacScreenHeight, 32, 4 * (uint32_t)vMacScreenWidth); - if (NULL == my_image) { + if (NULL == image) { fprintf(stderr, "XCreateImage Color failed.\n"); - return falseblnr; + return false; } #if 0 @@ -3394,70 +3394,70 @@ LOCALFUNC blnr Screen_Init(void) fprintf(stderr, "LSBFirst = %d\n", (int)LSBFirst); fprintf(stderr, "bitmap_bit_order = %d\n", - (int)my_image->bitmap_bit_order); + (int)image->bitmap_bit_order); fprintf(stderr, "byte_order = %d\n", - (int)my_image->byte_order); + (int)image->byte_order); fprintf(stderr, "bitmap_unit = %d\n", - (int)my_image->bitmap_unit); + (int)image->bitmap_unit); fprintf(stderr, "bits_per_pixel = %d\n", - (int)my_image->bits_per_pixel); + (int)image->bits_per_pixel); fprintf(stderr, "red_mask = %d\n", - (int)my_image->red_mask); + (int)image->red_mask); fprintf(stderr, "green_mask = %d\n", - (int)my_image->green_mask); + (int)image->green_mask); fprintf(stderr, "blue_mask = %d\n", - (int)my_image->blue_mask); + (int)image->blue_mask); #endif #endif /* UseColorImage */ #if EnableMagnify && (! UseColorImage) - my_Scaled_image = XCreateImage(x_display, Xvisual, + Scaled_image = XCreateImage(x_display, Xvisual, 1, XYBitmap, 0, NULL /* (char *)image_Mem1 */, vMacScreenWidth * WindowScale, vMacScreenHeight * WindowScale, 32, vMacScreenMonoByteWidth * WindowScale); - if (NULL == my_Scaled_image) { + if (NULL == Scaled_image) { fprintf(stderr, "XCreateImage failed.\n"); - return falseblnr; + return false; } - my_Scaled_image->bitmap_bit_order = MSBFirst; - my_Scaled_image->byte_order = MSBFirst; + Scaled_image->bitmap_bit_order = MSBFirst; + Scaled_image->byte_order = MSBFirst; #endif #if EnableMagnify && UseColorImage - my_Scaled_image = XCreateImage(x_display, Xvisual, + Scaled_image = XCreateImage(x_display, Xvisual, 24, ZPixmap, 0, NULL /* (char *)image_Mem1 */, vMacScreenWidth * WindowScale, vMacScreenHeight * WindowScale, 32, 4 * (uint32_t)vMacScreenWidth * WindowScale); - if (NULL == my_Scaled_image) { + if (NULL == Scaled_image) { fprintf(stderr, "XCreateImage Scaled failed.\n"); - return falseblnr; + return false; } #endif #if 0 != vMacScreenDepth - ColorModeWorks = trueblnr; + ColorModeWorks = true; #endif DisableKeyRepeat(); - return trueblnr; + return true; } LOCALPROC CloseMainWindow(void) { - if (my_gc != NULL) { - XFreeGC(x_display, my_gc); - my_gc = NULL; + if (gc != NULL) { + XFreeGC(x_display, gc); + gc = NULL; } - if (my_main_wind) { - XDestroyWindow(x_display, my_main_wind); - my_main_wind = 0; + if (main_wind) { + XDestroyWindow(x_display, main_wind); + main_wind = 0; } } @@ -3473,7 +3473,7 @@ enum { #if MayNotFullScreen LOCALVAR int CurWinIndx; -LOCALVAR blnr HavePositionWins[kNumMagStates]; +LOCALVAR bool HavePositionWins[kNumMagStates]; LOCALVAR int WinPositionWinsH[kNumMagStates]; LOCALVAR int WinPositionWinsV[kNumMagStates]; #endif @@ -3481,12 +3481,12 @@ LOCALVAR int WinPositionWinsV[kNumMagStates]; #if EnableRecreateW LOCALPROC ZapWState(void) { - my_main_wind = 0; - my_gc = NULL; + main_wind = 0; + gc = NULL; } #endif -LOCALFUNC blnr CreateMainWindow(void) +LOCALFUNC bool CreateMainWindow(void) { Window rootwin; int screen; @@ -3579,7 +3579,7 @@ LOCALFUNC blnr CreateMainWindow(void) if (! HavePositionWins[WinIndx]) { WinPositionWinsH[WinIndx] = leftPos; WinPositionWinsV[WinIndx] = topPos; - HavePositionWins[WinIndx] = trueblnr; + HavePositionWins[WinIndx] = true; } else { leftPos = WinPositionWinsH[WinIndx]; topPos = WinPositionWinsV[WinIndx]; @@ -3597,7 +3597,7 @@ LOCALFUNC blnr CreateMainWindow(void) xattr.background_pixel = x_black.pixel; xattr.border_pixel = x_white.pixel; - my_main_wind = XCreateWindow(x_display, rr, + main_wind = XCreateWindow(x_display, rr, 0, 0, wr, hr, 0, CopyFromParent, /* depth */ InputOutput, /* class */ @@ -3612,7 +3612,7 @@ LOCALFUNC blnr CreateMainWindow(void) #endif #if MayNotFullScreen { - my_main_wind = XCreateSimpleWindow(x_display, rootwin, + main_wind = XCreateSimpleWindow(x_display, rootwin, leftPos, topPos, NewWindowWidth, NewWindowHeight, 4, @@ -3621,9 +3621,9 @@ LOCALFUNC blnr CreateMainWindow(void) } #endif - if (! my_main_wind) { + if (! main_wind) { WriteExtraErr("XCreateSimpleWindow failed."); - return falseblnr; + return false; } else { char *win_name = (NULL != n_arg) ? n_arg : ( @@ -3631,7 +3631,7 @@ LOCALFUNC blnr CreateMainWindow(void) (NULL != app_name) ? app_name : #endif kStrAppName); - XSelectInput(x_display, my_main_wind, + XSelectInput(x_display, main_wind, ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask #if UseMotionEvents @@ -3639,15 +3639,15 @@ LOCALFUNC blnr CreateMainWindow(void) #endif | FocusChangeMask); - XStoreName(x_display, my_main_wind, win_name); - XSetIconName(x_display, my_main_wind, win_name); + XStoreName(x_display, main_wind, win_name); + XSetIconName(x_display, main_wind, win_name); { XClassHint *hints = XAllocClassHint(); if (hints) { hints->res_name = "minivmac"; hints->res_class = "minivmac"; - XSetClassHint(x_display, my_main_wind, hints); + XSetClassHint(x_display, main_wind, hints); XFree(hints); } } @@ -3658,29 +3658,29 @@ LOCALFUNC blnr CreateMainWindow(void) hints->input = True; hints->initial_state = NormalState; hints->flags = InputHint | StateHint; - XSetWMHints(x_display, my_main_wind, hints); + XSetWMHints(x_display, main_wind, hints); XFree(hints); } } - XSetCommand(x_display, my_main_wind, my_argv, my_argc); + XSetCommand(x_display, main_wind, argv, argc); /* let us handle a click on the close box */ - XSetWMProtocols(x_display, my_main_wind, &XA_DeleteW, 1); + XSetWMProtocols(x_display, main_wind, &XA_DeleteW, 1); #if EnableDragDrop - XChangeProperty (x_display, my_main_wind, XA_DndAware, + XChangeProperty (x_display, main_wind, XA_DndAware, XA_ATOM, 32, PropModeReplace, (unsigned char *) &xdnd_version, 1); #endif - my_gc = XCreateGC(x_display, my_main_wind, 0, NULL); - if (NULL == my_gc) { + gc = XCreateGC(x_display, main_wind, 0, NULL); + if (NULL == gc) { WriteExtraErr("XCreateGC failed."); - return falseblnr; + return false; } - XSetState(x_display, my_gc, x_black.pixel, x_white.pixel, + XSetState(x_display, gc, x_black.pixel, x_white.pixel, GXcopy, AllPlanes); #if VarFullScreen @@ -3707,7 +3707,7 @@ LOCALFUNC blnr CreateMainWindow(void) hints->height = NewWindowHeight; hints->flags = PMinSize | PMaxSize | PPosition | PSize; - XSetWMNormalHints(x_display, my_main_wind, hints); + XSetWMNormalHints(x_display, main_wind, hints); XFree(hints); } } @@ -3730,7 +3730,7 @@ LOCALFUNC blnr CreateMainWindow(void) CurWinIndx = WinIndx; #endif - XMapRaised(x_display, my_main_wind); + XMapRaised(x_display, main_wind); #if 0 XSync(x_display, 0); @@ -3754,19 +3754,19 @@ LOCALFUNC blnr CreateMainWindow(void) XNextEvent(x_display, &event); HandleTheEvent(&event); } while (! ((Expose == event.type) - && (event.xexpose.window == my_main_wind))); + && (event.xexpose.window == main_wind))); } #endif - NeedFinishOpen1 = trueblnr; - NeedFinishOpen2 = trueblnr; + NeedFinishOpen1 = true; + NeedFinishOpen2 = true; - return trueblnr; + return true; } } #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if MayFullScreen @@ -3795,8 +3795,8 @@ LOCALPROC UngrabMachine(void) #if EnableRecreateW struct WState { - Window f_my_main_wind; - GC f_my_gc; + Window f_main_wind; + GC f_gc; #if MayFullScreen short f_hOffset; short f_vOffset; @@ -3806,10 +3806,10 @@ struct WState { uint16_t f_ViewVStart; #endif #if VarFullScreen - blnr f_UseFullScreen; + bool f_UseFullScreen; #endif #if EnableMagnify - blnr f_UseMagnify; + bool f_UseMagnify; #endif }; typedef struct WState WState; @@ -3818,8 +3818,8 @@ typedef struct WState WState; #if EnableRecreateW LOCALPROC GetWState(WState *r) { - r->f_my_main_wind = my_main_wind; - r->f_my_gc = my_gc; + r->f_main_wind = main_wind; + r->f_gc = gc; #if MayFullScreen r->f_hOffset = hOffset; r->f_vOffset = vOffset; @@ -3840,8 +3840,8 @@ LOCALPROC GetWState(WState *r) #if EnableRecreateW LOCALPROC SetWState(WState *r) { - my_main_wind = r->f_my_main_wind; - my_gc = r->f_my_gc; + main_wind = r->f_main_wind; + gc = r->f_gc; #if MayFullScreen hOffset = r->f_hOffset; vOffset = r->f_vOffset; @@ -3860,22 +3860,22 @@ LOCALPROC SetWState(WState *r) #endif #if EnableRecreateW -LOCALVAR blnr WantRestoreCursPos = falseblnr; +LOCALVAR bool WantRestoreCursPos = false; LOCALVAR uint16_t RestoreMouseH; LOCALVAR uint16_t RestoreMouseV; #endif #if EnableRecreateW -LOCALFUNC blnr ReCreateMainWindow(void) +LOCALFUNC bool ReCreateMainWindow(void) { WState old_state; WState new_state; #if IncludeHostTextClipExchange - blnr OwnClipboard = falseblnr; + bool OwnClipboard = false; #endif if (HaveCursorHidden) { - WantRestoreCursPos = trueblnr; + WantRestoreCursPos = true; RestoreMouseH = CurMouseH; RestoreMouseV = CurMouseV; } @@ -3886,7 +3886,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) #if VarFullScreen if (! UseFullScreen) #endif - if (my_main_wind) + if (main_wind) if (! NeedFinishOpen2) { /* save old position */ @@ -3914,7 +3914,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) track how far window has moved. */ XSync(x_display, 0); - if (XTranslateCoordinates(x_display, my_main_wind, rootwin, + if (XTranslateCoordinates(x_display, main_wind, rootwin, 0, 0, &xr, &yr, &rr2)) { int newposh = @@ -3933,7 +3933,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) #if MayFullScreen if (GrabMachine) { - GrabMachine = falseblnr; + GrabMachine = false; UngrabMachine(); } #endif @@ -3948,7 +3948,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) UseFullScreen = WantFullScreen; #endif - ColorTransValid = falseblnr; + ColorTransValid = false; if (! CreateMainWindow()) { CloseMainWindow(); @@ -3962,17 +3962,17 @@ LOCALFUNC blnr ReCreateMainWindow(void) WantMagnify = UseMagnify; #endif - return falseblnr; + return false; } else { GetWState(&new_state); SetWState(&old_state); #if IncludeHostTextClipExchange - if (my_main_wind) { + if (main_wind) { if (XGetSelectionOwner(x_display, XA_CLIPBOARD) == - my_main_wind) + main_wind) { - OwnClipboard = trueblnr; + OwnClipboard = true; } } #endif @@ -3984,12 +3984,12 @@ LOCALFUNC blnr ReCreateMainWindow(void) #if IncludeHostTextClipExchange if (OwnClipboard) { XSetSelectionOwner(x_display, XA_CLIPBOARD, - my_main_wind, CurrentTime); + main_wind, CurrentTime); } #endif } - return trueblnr; + return true; } #endif @@ -4014,7 +4014,7 @@ LOCALPROC ZapWinStateVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -4048,7 +4048,7 @@ LOCALPROC ToggleWantFullScreen(void) if (kMagStateAuto != NewMagState) { WantMagnify = (kMagStateMagnifgy == NewMagState); } else { - WantMagnify = falseblnr; + WantMagnify = false; if (WantFullScreen) { Window rootwin; int xr; @@ -4067,7 +4067,7 @@ LOCALPROC ToggleWantFullScreen(void) && (hr >= vMacScreenHeight * WindowScale) ) { - WantMagnify = trueblnr; + WantMagnify = true; } } } @@ -4111,21 +4111,21 @@ LOCALPROC EnterSpeedStopped(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); } if (NeedFinishOpen2 && ! NeedFinishOpen1) { - NeedFinishOpen2 = falseblnr; + NeedFinishOpen2 = false; #if VarFullScreen if (UseFullScreen) #endif #if MayFullScreen { - XSetInputFocus(x_display, my_main_wind, + XSetInputFocus(x_display, main_wind, RevertToPointerRoot, CurrentTime); } #endif @@ -4142,7 +4142,7 @@ LOCALPROC CheckForSavedTasks(void) This doesn't work right in Red Hat 6, and may not be needed anymore, now that using PPosition hint. */ - XMoveWindow(x_display, my_main_wind, + XMoveWindow(x_display, main_wind, leftPos, topPos); /* Needed after XMapRaised, because some window @@ -4156,7 +4156,7 @@ LOCALPROC CheckForSavedTasks(void) apparently, XTranslateCoordinates can be inaccurate without this */ - XTranslateCoordinates(x_display, my_main_wind, rootwin, + XTranslateCoordinates(x_display, main_wind, rootwin, 0, 0, &SavedTransH, &SavedTransV, &rr); } #endif @@ -4168,9 +4168,9 @@ LOCALPROC CheckForSavedTasks(void) #endif { (void) MoveMouse(RestoreMouseH, RestoreMouseV); - WantCursorHidden = trueblnr; + WantCursorHidden = true; } - WantRestoreCursPos = falseblnr; + WantRestoreCursPos = false; } #endif } @@ -4182,12 +4182,12 @@ LOCALPROC CheckForSavedTasks(void) #endif if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -4235,8 +4235,8 @@ LOCALPROC CheckForSavedTasks(void) #if 0 ToggleWantFullScreen(); #else - XRaiseWindow(x_display, my_main_wind); - XSetInputFocus(x_display, my_main_wind, + XRaiseWindow(x_display, main_wind); + XSetInputFocus(x_display, main_wind, RevertToPointerRoot, CurrentTime); #endif } @@ -4277,8 +4277,8 @@ LOCALPROC CheckForSavedTasks(void) if (vSonyNewDiskWanted) { #if IncludeSonyNameNew if (vSonyNewDiskName != NotAPbuf) { - ui3p NewDiskNameDat; - if (MacRomanTextToNativePtr(vSonyNewDiskName, trueblnr, + uint8_t * NewDiskNameDat; + if (MacRomanTextToNativePtr(vSonyNewDiskName, true, &NewDiskNameDat)) { MakeNewDisk(vSonyNewDiskSize, (char *)NewDiskNameDat); @@ -4291,7 +4291,7 @@ LOCALPROC CheckForSavedTasks(void) { MakeNewDiskAtDefault(vSonyNewDiskSize); } - vSonyNewDiskWanted = falseblnr; + vSonyNewDiskWanted = false; /* must be done after may have gotten disk */ } #endif @@ -4301,7 +4301,7 @@ LOCALPROC CheckForSavedTasks(void) } if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -4317,51 +4317,51 @@ LOCALPROC CheckForSavedTasks(void) { HaveCursorHidden = ! HaveCursorHidden; if (HaveCursorHidden) { - XDefineCursor(x_display, my_main_wind, blankCursor); + XDefineCursor(x_display, main_wind, blankCursor); } else { - XUndefineCursor(x_display, my_main_wind); + XUndefineCursor(x_display, main_wind); } } } /* --- command line parsing --- */ -LOCALFUNC blnr ScanCommandLine(void) +LOCALFUNC bool ScanCommandLine(void) { char *pa; int i = 1; label_retry: - if (i < my_argc) { - pa = my_argv[i++]; + if (i < argc) { + pa = argv[i++]; if ('-' == pa[0]) { if ((0 == strcmp(pa, "--display")) || (0 == strcmp(pa, "-display"))) { - if (i < my_argc) { - display_name = my_argv[i++]; + if (i < argc) { + display_name = argv[i++]; goto label_retry; } } else if ((0 == strcmp(pa, "--rom")) || (0 == strcmp(pa, "-r"))) { - if (i < my_argc) { - rom_path = my_argv[i++]; + if (i < argc) { + rom_path = argv[i++]; goto label_retry; } } else if (0 == strcmp(pa, "-n")) { - if (i < my_argc) { - n_arg = my_argv[i++]; + if (i < argc) { + n_arg = argv[i++]; goto label_retry; } } else if (0 == strcmp(pa, "-d")) { - if (i < my_argc) { - d_arg = my_argv[i++]; + if (i < argc) { + d_arg = argv[i++]; goto label_retry; } } else @@ -4373,8 +4373,8 @@ label_retry: if ((0 == strcmp(pa, "--alsadev")) || (0 == strcmp(pa, "-alsadev"))) { - if (i < my_argc) { - alsadev_name = my_argv[i++]; + if (i < argc) { + alsadev_name = argv[i++]; goto label_retry; } } else @@ -4386,15 +4386,15 @@ label_retry: } else #endif { - MacMsg(kStrBadArgTitle, kStrBadArgMessage, falseblnr); + MacMsg(kStrBadArgTitle, kStrBadArgMessage, false); } } else { - (void) Sony_Insert1(pa, falseblnr); + (void) Sony_Insert1(pa, false); goto label_retry; } } - return trueblnr; + return true; } /* --- main program flow --- */ @@ -4410,7 +4410,7 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void) XFlush(x_display); } -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -4500,50 +4500,50 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif #if WantScalingBuff ReserveAllocOneBlock(&ScalingBuff, - ScalingBuffsz, 5, falseblnr); + ScalingBuffsz, 5, false); #endif #if WantScalingTabl ReserveAllocOneBlock(&ScalingTabl, - ScalingTablsz, 5, falseblnr); + ScalingTablsz, 5, false); #endif #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -4558,7 +4558,7 @@ LOCALPROC UnallocMemory(void) } #if HaveAppPathLink -LOCALFUNC blnr ReadLink_Alloc(char *path, char **r) +LOCALFUNC bool ReadLink_Alloc(char *path, char **r) { /* This should work to find size: @@ -4567,7 +4567,7 @@ LOCALFUNC blnr ReadLink_Alloc(char *path, char **r) if (lstat(path, &r) != -1) { r = r.st_size; - IsOk = trueblnr; + IsOk = true; } But observed to return 0 in Ubuntu 10.04 x86-64 @@ -4576,7 +4576,7 @@ LOCALFUNC blnr ReadLink_Alloc(char *path, char **r) char *s; int sz; char *p; - blnr IsOk = falseblnr; + bool IsOk = false; size_t s_alloc = 256; label_retry: @@ -4602,7 +4602,7 @@ label_retry: (void) memcpy(p, s, sz); p[sz] = 0; *r = p; - IsOk = trueblnr; + IsOk = true; } free(s); } @@ -4613,7 +4613,7 @@ label_retry: #endif #if HaveSysctlPath -LOCALFUNC blnr ReadKernProcPathname(char **r) +LOCALFUNC bool ReadKernProcPathname(char **r) { size_t s_alloc; char *s; @@ -4623,7 +4623,7 @@ LOCALFUNC blnr ReadKernProcPathname(char **r) KERN_PROC_PATHNAME, -1 }; - blnr IsOk = falseblnr; + bool IsOk = false; if (0 != sysctl(mib, sizeof(mib) / sizeof(int), NULL, &s_alloc, NULL, 0)) @@ -4640,7 +4640,7 @@ LOCALFUNC blnr ReadKernProcPathname(char **r) fprintf(stderr, "sysctl 2 failed.\n"); } else { *r = s; - IsOk = trueblnr; + IsOk = true; } if (! IsOk) { free(s); @@ -4653,10 +4653,10 @@ LOCALFUNC blnr ReadKernProcPathname(char **r) #endif #if CanGetAppPath -LOCALFUNC blnr Path2ParentAndName(char *path, +LOCALFUNC bool Path2ParentAndName(char *path, char **parent, char **name) { - blnr IsOk = falseblnr; + bool IsOk = false; char *t = strrchr(path, '/'); if (NULL == t) { @@ -4680,7 +4680,7 @@ LOCALFUNC blnr Path2ParentAndName(char *path, child[child_sz] = 0; *name = child; - IsOk = trueblnr; + IsOk = true; /* free(child); */ } } @@ -4697,7 +4697,7 @@ LOCALFUNC blnr Path2ParentAndName(char *path, #endif #if CanGetAppPath -LOCALFUNC blnr InitWhereAmI(void) +LOCALFUNC bool InitWhereAmI(void) { char *s; @@ -4725,7 +4725,7 @@ LOCALFUNC blnr InitWhereAmI(void) free(s); } - return trueblnr; /* keep going regardless */ + return true; /* keep going regardless */ } #endif @@ -4737,7 +4737,7 @@ LOCALPROC UninitWhereAmI(void) } #endif -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { if (AllocMemory()) #if CanGetAppPath @@ -4758,9 +4758,9 @@ LOCALFUNC blnr InitOSGLU(void) if (KC2MKCInit()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) @@ -4792,12 +4792,12 @@ LOCALPROC UnInitOSGLU(void) XFreeCursor(x_display, blankCursor); } - if (my_image != NULL) { - XDestroyImage(my_image); + if (image != NULL) { + XDestroyImage(image); } #if EnableMagnify - if (my_Scaled_image != NULL) { - XDestroyImage(my_Scaled_image); + if (Scaled_image != NULL) { + XDestroyImage(Scaled_image); } #endif @@ -4820,8 +4820,8 @@ LOCALPROC UnInitOSGLU(void) int main(int argc, char **argv) { - my_argc = argc; - my_argv = argv; + argc = argc; + argv = argv; ZapOSGLUVars(); if (InitOSGLU()) { diff --git a/src/UI/WIN32/OSGLUWIN.c b/src/UI/WIN32/OSGLUWIN.c index e10f4dd..6f493fd 100644 --- a/src/UI/WIN32/OSGLUWIN.c +++ b/src/UI/WIN32/OSGLUWIN.c @@ -59,9 +59,9 @@ typedef BOOL (WINAPI *SHGetSpecialFolderPathProcPtr) ( BOOL fCreate ); LOCALVAR SHGetSpecialFolderPathProcPtr MySHGetSpecialFolderPath = NULL; -LOCALVAR blnr DidSHGetSpecialFolderPath = falseblnr; +LOCALVAR bool DidSHGetSpecialFolderPath = false; -LOCALFUNC blnr HaveMySHGetSpecialFolderPath(void) +LOCALFUNC bool HaveMySHGetSpecialFolderPath(void) { if (! DidSHGetSpecialFolderPath) { HMODULE hLibModule = LoadLibrary(TEXT("shell32.dll")); @@ -77,7 +77,7 @@ LOCALFUNC blnr HaveMySHGetSpecialFolderPath(void) ); /* FreeLibrary(hLibModule); */ } - DidSHGetSpecialFolderPath = trueblnr; + DidSHGetSpecialFolderPath = true; } return (MySHGetSpecialFolderPath != NULL); } @@ -96,7 +96,7 @@ LOCALFUNC blnr HaveMySHGetSpecialFolderPath(void) #include "INTLCHAR.h" -LOCALPROC NativeStrFromCStr(LPTSTR r, char *s, blnr AddEllipsis) +LOCALPROC NativeStrFromCStr(LPTSTR r, char *s, bool AddEllipsis) { uint8_t ps[ClStrMaxLength]; int i; @@ -147,22 +147,22 @@ LOCALFUNC LPTSTR FindLastTerm(LPTSTR s, TCHAR delim) LOCALVAR HINSTANCE AppInstance; -LOCALFUNC blnr GetAppDir(LPTSTR pathName) +LOCALFUNC bool GetAppDir(LPTSTR pathName) /* be sure at least _MAX_PATH long! */ { if (GetModuleFileName(AppInstance, pathName, _MAX_PATH) == 0) { - /* MacMsg("error", "GetModuleFileName failed", falseblnr); */ + /* MacMsg("error", "GetModuleFileName failed", false); */ } else { LPTSTR p = FindLastTerm(pathName, (TCHAR)('\\')); if (p == nullpr) { - /* MacMsg("error", "strrchr failed", falseblnr); */ + /* MacMsg("error", "strrchr failed", false); */ } else { *--p = (TCHAR)('\0'); - return trueblnr; + return true; } } - return falseblnr; + return false; } /* --- sending debugging info to file --- */ @@ -171,7 +171,7 @@ LOCALFUNC blnr GetAppDir(LPTSTR pathName) LOCALVAR HANDLE dbglog_File = INVALID_HANDLE_VALUE; -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { TCHAR pathName[_MAX_PATH]; TCHAR Child0[] = TEXT("\\dbglog.txt"); @@ -334,10 +334,10 @@ LOCALPROC UnInitPbufs(void) #endif #if IncludePbufs -LOCALFUNC ui3p PbufLock(tPbuf i) +LOCALFUNC uint8_t * PbufLock(tPbuf i) { HGLOBAL h = PbufDat[i]; - return (ui3p)GlobalLock(h); + return (uint8_t *)GlobalLock(h); } #endif @@ -349,11 +349,11 @@ LOCALPROC PbufUnlock(tPbuf i) #endif #if IncludePbufs -GLOBALOSGLUPROC PbufTransfer(ui3p Buffer, - tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite) +GLOBALOSGLUPROC PbufTransfer(uint8_t * Buffer, + tPbuf i, uint32_t offset, uint32_t count, bool IsWrite) { HGLOBAL h = PbufDat[i]; - ui3p p0 = GlobalLock(h); + uint8_t * p0 = GlobalLock(h); if (p0 != NULL) { void *p = p0 + offset; if (IsWrite) { @@ -383,11 +383,11 @@ LOCALVAR unsigned long oldDisplayOrientation; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif #if MayFullScreen @@ -397,13 +397,13 @@ LOCALVAR short vOffset; /* cursor hiding */ -LOCALVAR blnr HaveCursorHidden = falseblnr; -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; +LOCALVAR bool WantCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; (void) ShowCursor(TRUE); SetCursor(LoadCursor(NULL, IDC_ARROW)); } @@ -411,11 +411,11 @@ LOCALPROC ForceShowCursor(void) /* cursor moving */ -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { POINT NewMousePos; uint32_t difftime; - blnr IsOk; + bool IsOk; DWORD StartTime = GetTickCount(); LONG x = h; LONG y = v; @@ -453,7 +453,7 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) do { (void) SetCursorPos(x, y); if (! GetCursorPos(&NewMousePos)) { - IsOk = falseblnr; + IsOk = false; } else { IsOk = (x == NewMousePos.x) && (y == NewMousePos.y); } @@ -471,7 +471,7 @@ LOCALPROC StartSaveMouseMotion(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } } } @@ -482,14 +482,14 @@ LOCALPROC StopSaveMouseMotion(void) { if (HaveMouseMotion) { (void) MoveMouse(CurMouseH, CurMouseV); - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } #endif -LOCALVAR blnr MouseCaptured = falseblnr; +LOCALVAR bool MouseCaptured = false; -LOCALPROC MouseCaptureSet(blnr v) +LOCALPROC MouseCaptureSet(bool v) { if (v != MouseCaptured) { if (v) { @@ -501,7 +501,7 @@ LOCALPROC MouseCaptureSet(blnr v) } } -LOCALPROC SetCurMouseButton(blnr v) +LOCALPROC SetCurMouseButton(bool v) { MouseButtonSet(v); MouseCaptureSet(v); @@ -1591,7 +1591,7 @@ LOCALVAR uimr CurKyBdLytNm = 0; #endif #if ItnlKyBdFix -LOCALFUNC blnr tStrIsHex(TCHAR *s, int n, uimr *r) +LOCALFUNC bool tStrIsHex(TCHAR *s, int n, uimr *r) { short i; TCHAR c1; @@ -1608,20 +1608,20 @@ LOCALFUNC blnr tStrIsHex(TCHAR *s, int n, uimr *r) } else if ((c1 >= 'a') && (c1 <= 'f')) { v += c1 - ('a' - 10); } else { - return falseblnr; + return false; } } *r = v; - return trueblnr; + return true; } #endif #if ItnlKyBdFix -LOCALFUNC blnr GetKeyboardLayoutHex(uimr *r) +LOCALFUNC bool GetKeyboardLayoutHex(uimr *r) { TCHAR s[KL_NAMELENGTH]; - blnr IsOk = falseblnr; + bool IsOk = false; if (! GetKeyboardLayoutName(s)) { /* ReportWinLastError(); */ @@ -1677,7 +1677,7 @@ LOCALPROC AssignOneMacKey(uint8_t WinKey, uint8_t MacKey) WinKey2Mac[WinKey] = MacKey; } -LOCALFUNC blnr InitWinKey2Mac(void) +LOCALFUNC bool InitWinKey2Mac(void) { int i; @@ -1828,10 +1828,10 @@ LOCALFUNC blnr InitWinKey2Mac(void) InitCheckKeyboardLayout(); #endif - return trueblnr; + return true; } -LOCALPROC DoKeyCode(int i, blnr down) +LOCALPROC DoKeyCode(int i, bool down) { uint8_t key = WinKey2Mac[ #if ItnlKyBdFix @@ -1854,7 +1854,7 @@ LOCALPROC DoKeyCode(int i, blnr down) #endif /* EnableGrabSpecialKeys */ #if EnableGrabSpecialKeys -LOCALVAR blnr HaveSetSysParam = falseblnr; +LOCALVAR bool HaveSetSysParam = false; #endif LOCALPROC CheckTheCapsLock(void) @@ -1863,8 +1863,8 @@ LOCALPROC CheckTheCapsLock(void) } #if EnableGrabSpecialKeys -LOCALVAR blnr VK_LWIN_pressed = falseblnr; -LOCALVAR blnr VK_RWIN_pressed = falseblnr; +LOCALVAR bool VK_LWIN_pressed = false; +LOCALVAR bool VK_RWIN_pressed = false; #endif #if EnableGrabSpecialKeys @@ -1874,21 +1874,21 @@ LOCALPROC CheckForLostKeyUps(void) /* check for lost key ups */ if (VK_LWIN_pressed) { if ((GetAsyncKeyState(VK_LWIN) & 0x8000) == 0) { - DoKeyCode(VK_LWIN, falseblnr); - VK_LWIN_pressed = falseblnr; + DoKeyCode(VK_LWIN, false); + VK_LWIN_pressed = false; } } if (VK_RWIN_pressed) { if ((GetAsyncKeyState(VK_RWIN) & 0x8000) == 0) { - DoKeyCode(VK_RWIN, falseblnr); - VK_RWIN_pressed = falseblnr; + DoKeyCode(VK_RWIN, false); + VK_RWIN_pressed = false; } } } } #endif -LOCALPROC DoVKcode0(int i, blnr down) +LOCALPROC DoVKcode0(int i, bool down) { #if EnableGrabSpecialKeys if (HaveSetSysParam) { @@ -1903,7 +1903,7 @@ LOCALPROC DoVKcode0(int i, blnr down) DoKeyCode(i, down); } -LOCALPROC DoVKcode(int i, uint8_t flags, blnr down) +LOCALPROC DoVKcode(int i, uint8_t flags, bool down) { switch (i) { #if MKC_formac_Control != MKC_formac_RControl @@ -1991,7 +1991,7 @@ LOCALPROC DoVKcode(int i, uint8_t flags, blnr down) } } -LOCALVAR blnr WantCmdOptOnReconnect = falseblnr; +LOCALVAR bool WantCmdOptOnReconnect = false; LOCALPROC ReconnectKeyCodes3(void) { @@ -2000,14 +2000,14 @@ LOCALPROC ReconnectKeyCodes3(void) CheckTheCapsLock(); if (WantCmdOptOnReconnect) { - WantCmdOptOnReconnect = falseblnr; + WantCmdOptOnReconnect = false; for (i = 0; i < 256; ++i) { if ((GetKeyState(i) & 0x8000) != 0) { if ((VK_CAPITAL != i) && (VK_RETURN != i)) { - DoVKcode0(i, trueblnr); + DoVKcode0(i, true); } } } @@ -2017,7 +2017,7 @@ LOCALPROC ReconnectKeyCodes3(void) LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - SetCurMouseButton(falseblnr); + SetCurMouseButton(false); } #if EnableGrabSpecialKeys @@ -2055,12 +2055,12 @@ LRESULT CALLBACK LowLevelKeyboardProc( switch (wParam) { case WM_KEYDOWN: case WM_SYSKEYDOWN: - DoVKcode(p->vkCode, p->flags, trueblnr); + DoVKcode(p->vkCode, p->flags, true); return 1; break; case WM_KEYUP: case WM_SYSKEYUP: - DoVKcode(p->vkCode, p->flags, falseblnr); + DoVKcode(p->vkCode, p->flags, false); return 1; break; } @@ -2100,7 +2100,7 @@ LOCALPROC GrabSpecialKeys(void) /* this works on Windows 95/98 */ SystemParametersInfo(_SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0); - HaveSetSysParam = trueblnr; + HaveSetSysParam = true; } } } @@ -2116,7 +2116,7 @@ LOCALPROC UnGrabSpecialKeys(void) if (HaveSetSysParam) { SystemParametersInfo(_SPI_SETSCREENSAVERRUNNING, FALSE, &nPreviousState, 0); - HaveSetSysParam = falseblnr; + HaveSetSysParam = false; } } #endif @@ -2132,7 +2132,7 @@ LOCALPROC UnGrabSpecialKeys(void) #endif /* EnableChangePriority */ #if EnableChangePriority -LOCALVAR blnr PriorityRaised = falseblnr; +LOCALVAR bool PriorityRaised = false; #endif #if EnableChangePriority @@ -2150,10 +2150,10 @@ LOCALPROC RaisePriority(void) not recursive: MacMsg("SetPriorityClass failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } - PriorityRaised = trueblnr; + PriorityRaised = true; } } #endif @@ -2171,10 +2171,10 @@ LOCALPROC LowerPriority(void) not recursive: MacMsg("SetPriorityClass failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } - PriorityRaised = falseblnr; + PriorityRaised = false; } } #endif @@ -2210,7 +2210,7 @@ LOCALPROC InitNextTime(void) IncrNextTime(); } -LOCALFUNC blnr UpdateTrueEmulatedTime(void) +LOCALFUNC bool UpdateTrueEmulatedTime(void) { DWORD LatestTime; int32_t TimeDiff; @@ -2237,7 +2237,7 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void) TimeDiff = (LatestTime - NextIntTime); } while (TimeDiff >= 0); } - return trueblnr; + return true; } else if (TimeDiff < -256) { /* clock goofed if ever get here, reset */ #if dbglog_TimeStuff @@ -2247,7 +2247,7 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void) InitNextTime(); } } - return falseblnr; + return false; } LOCALVAR uint32_t TimeSecBase; @@ -2255,7 +2255,7 @@ LOCALVAR DWORD TimeMilliBase; #include "DATE2SEC.h" -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { uint32_t NewMacDateInSecond; @@ -2264,13 +2264,13 @@ LOCALFUNC blnr CheckDateTime(void) if (CurMacDateInSeconds != NewMacDateInSecond) { CurMacDateInSeconds = NewMacDateInSecond; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } -LOCALFUNC blnr Init60thCheck(void) +LOCALFUNC bool Init60thCheck(void) { SYSTEMTIME s; #if AutoTimeZone @@ -2304,7 +2304,7 @@ LOCALFUNC blnr Init60thCheck(void) (void) CheckDateTime(); - return trueblnr; + return true; } #ifndef TimeResolution @@ -2317,7 +2317,7 @@ LOCALFUNC blnr Init60thCheck(void) */ #if (TimeResolution != 0) -LOCALVAR blnr HaveSetTimeResolution = falseblnr; +LOCALVAR bool HaveSetTimeResolution = false; #endif #if (TimeResolution != 0) @@ -2325,7 +2325,7 @@ LOCALPROC Timer_Suspend(void) { if (HaveSetTimeResolution) { (void) timeEndPeriod(TimeResolution); - HaveSetTimeResolution = falseblnr; + HaveSetTimeResolution = false; } } #endif @@ -2344,7 +2344,7 @@ LOCALPROC Timer_Resume(void) if (timeBeginPeriod(TimeResolution) == TIMERR_NOERROR) { - HaveSetTimeResolution = trueblnr; + HaveSetTimeResolution = true; } } } @@ -2384,7 +2384,7 @@ LOCALPROC Timer_Resume(void) LOCALVAR tpSoundSamp TheSoundBuffer = nullpr; LOCALVAR uint16_t ThePlayOffset; LOCALVAR uint16_t TheFillOffset; -LOCALVAR blnr wantplaying; +LOCALVAR bool wantplaying; LOCALVAR uint16_t MinFilledSoundBuffs; LOCALVAR uint16_t TheWriteOffset; @@ -2443,7 +2443,7 @@ LOCALPROC Sound_Start(void) not recursive: MacMsg("waveOutOpen failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } else { p = TheSoundBuffer; @@ -2462,7 +2462,7 @@ LOCALPROC Sound_Start(void) not recursive: MacMsg("waveOutPrepareHeader failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } else { pwh->dwFlags |= WHDR_DONE; @@ -2475,7 +2475,7 @@ LOCALPROC Sound_Start(void) ThePlayOffset = 0; TheWriteOffset = 0; MinFilledSoundBuffs = kSoundBuffers; - wantplaying = falseblnr; + wantplaying = false; } } } @@ -2485,7 +2485,7 @@ LOCALPROC Sound_Stop(void) MMRESULT mmr; int i; - wantplaying = falseblnr; + wantplaying = false; if (hWaveOut != NULL) { DWORD StartTime = GetTickCount(); for (i = 0; i < kSoundBuffers; ++i) { @@ -2502,7 +2502,7 @@ LOCALPROC Sound_Stop(void) not recursive: MacMsg("waveOutUnprepareHeader failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } } @@ -2512,7 +2512,7 @@ LOCALPROC Sound_Stop(void) /* MacMsg("waveOutClose failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } hWaveOut = NULL; @@ -2563,7 +2563,7 @@ label_retry: not recursive: MacMsg("waveOutWrite failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ } ThePlayOffset = PrevPlayOffset; @@ -2591,7 +2591,7 @@ LOCALPROC Sound_FilledBlocks(void) while (0 != ((TheWriteOffset - TheFillOffset) >> kLnOneBuffLen)) { uint16_t CurFillBuffer = (TheFillOffset >> kLnOneBuffLen) & kSoundBuffMask; - blnr IsOk = falseblnr; + bool IsOk = false; ConvertSoundBlockToNative((tpSoundSamp) whdr[CurFillBuffer].lpData); @@ -2600,7 +2600,7 @@ LOCALPROC Sound_FilledBlocks(void) MMRESULT mmr = waveOutWrite(hWaveOut, &whdr[CurFillBuffer], sizeof(WAVEHDR)); if (mmr == MMSYSERR_NOERROR) { - IsOk = trueblnr; + IsOk = true; } } @@ -2609,7 +2609,7 @@ LOCALPROC Sound_FilledBlocks(void) not recursive: MacMsg("waveOutWrite failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); */ whdr[CurFillBuffer].dwFlags |= WHDR_DONE; } @@ -2627,7 +2627,7 @@ LOCALPROC Sound_WroteABlock(void) /* just wait */ } else { Sound_FilledBlocks(); - wantplaying = trueblnr; + wantplaying = true; Sound_BeginPlaying(); } } @@ -2716,7 +2716,7 @@ LOCALPROC UnGrabTheMachine(void) #endif #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if MayFullScreen @@ -2738,7 +2738,7 @@ LOCALPROC MyBeginDialog(void) { DisconnectKeyCodes3(); #if MayFullScreen - GrabMachine = falseblnr; + GrabMachine = false; UnGrabTheMachine(); #endif ForceShowCursor(); @@ -2755,8 +2755,8 @@ LOCALPROC CheckSavedMacMsg(void) TCHAR briefMsg0[ClStrMaxLength + 1]; TCHAR longMsg0[ClStrMaxLength + 1]; - NativeStrFromCStr(briefMsg0, SavedBriefMsg, falseblnr); - NativeStrFromCStr(longMsg0, SavedLongMsg, falseblnr); + NativeStrFromCStr(briefMsg0, SavedBriefMsg, false); + NativeStrFromCStr(longMsg0, SavedLongMsg, false); MessageBox(MainWnd, longMsg0, briefMsg0, MB_APPLMODAL | MB_OK | (SavedFatalMsg ? MB_ICONSTOP : 0)); @@ -2785,7 +2785,7 @@ enum { #endif #if EnableScalingBuff -LOCALVAR ui3p ScalingBuff = NULL; +LOCALVAR uint8_t * ScalingBuff = NULL; #endif LOCALVAR HDC MainWndDC = NULL; @@ -2795,15 +2795,15 @@ LOCALVAR int32_t CmdShow; LOCALVAR TCHAR WndTitle[_MAX_PATH]; LOCALVAR const TCHAR WndClassName[] = TEXT("minivmac"); -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool gTrueBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; LOCALPROC GetWndTitle(void) { TCHAR pathName[_MAX_PATH]; WIN32_FIND_DATA fd; - blnr IsOk = falseblnr; + bool IsOk = false; if (GetModuleFileName(AppInstance, pathName, _MAX_PATH) != 0) { HANDLE hf = FindFirstFile(pathName, &fd); @@ -2817,7 +2817,7 @@ LOCALPROC GetWndTitle(void) } _tcscpy(WndTitle, fd.cFileName); - IsOk = trueblnr; + IsOk = true; FindClose(hf); } } @@ -2854,13 +2854,13 @@ enum { #if MayNotFullScreen LOCALVAR int CurWinIndx; -LOCALVAR blnr HavePositionWins[kNumMagStates]; +LOCALVAR bool HavePositionWins[kNumMagStates]; LOCALVAR POINT WinPositionWins[kNumMagStates]; #endif #if MayNotFullScreen LOCALPROC AppendConvertMenuItem(HMENU hMenu, - UINT uIDNewItem, char *s, blnr AddEllipsis) + UINT uIDNewItem, char *s, bool AddEllipsis) { TCHAR ts[ClStrMaxLength + 1]; @@ -2878,7 +2878,7 @@ LOCALPROC AppendSubmenuConvertName(HMENU hMenu, TCHAR ts[ClStrMaxLength + 1]; MENUITEMINFO mii; - NativeStrFromCStr(ts, s, falseblnr); + NativeStrFromCStr(ts, s, false); #if 0 (void) InsertMenu(hMenu, 0xFFFFFFFF, @@ -2902,7 +2902,7 @@ LOCALPROC AppendSubmenuConvertName(HMENU hMenu, #define kStrMenuFile_win kStrMenuFile #endif -LOCALFUNC blnr ReCreateMainWindow(void) +LOCALFUNC bool ReCreateMainWindow(void) { #if MayNotFullScreen HMENU m; @@ -2999,7 +2999,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) if (! HavePositionWins[WinIndx]) { WinPositionWins[WinIndx].x = DfltWndX; WinPositionWins[WinIndx].y = DfltWndY; - HavePositionWins[WinIndx] = trueblnr; + HavePositionWins[WinIndx] = true; } NewWinR.left = WinPositionWins[WinIndx].x; @@ -3050,22 +3050,22 @@ LOCALFUNC blnr ReCreateMainWindow(void) m = CreateMenu(); if (m != NULL) { AppendConvertMenuItem(m, ID_FILE_INSERTDISK1, - kStrMenuItemOpen, trueblnr); + kStrMenuItemOpen, true); (void) AppendMenu(m, MF_SEPARATOR, 0, NULL); AppendConvertMenuItem(m, ID_FILE_QUIT, - kStrMenuItemQuit, falseblnr); + kStrMenuItemQuit, false); AppendSubmenuConvertName(mb, m, kStrMenuFile_win); } m = CreateMenu(); if (m != NULL) { AppendConvertMenuItem(m, ID_SPECIAL_MORECOMMANDS, - kStrMenuItemMore, trueblnr); + kStrMenuItemMore, true); AppendSubmenuConvertName(mb, m, kStrMenuSpecial); } m = CreateMenu(); if (m != NULL) { AppendConvertMenuItem(m, ID_HELP_ABOUT, - kStrMenuItemAbout, trueblnr); + kStrMenuItemAbout, true); AppendSubmenuConvertName(mb, m, kStrMenuHelp); } } @@ -3085,17 +3085,17 @@ LOCALFUNC blnr ReCreateMainWindow(void) if (NewMainWindow == NULL) { MacMsg("CreateWindow failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); - return falseblnr; + " and cannot continue.", true); + return false; } NewMainWndDC = GetDC(NewMainWindow); if (NewMainWndDC == NULL) { MacMsg("GetDC failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); + " and cannot continue.", true); DestroyWindow(NewMainWindow); - return falseblnr; + return false; } } else { NewMainWndDC = OldMainWndDC; @@ -3106,7 +3106,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) } #if 0 != vMacScreenDepth - ColorModeWorks = trueblnr; + ColorModeWorks = true; #endif { @@ -3126,7 +3126,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) } #if MayFullScreen - GrabMachine = falseblnr; + GrabMachine = false; UnGrabTheMachine(); #endif @@ -3141,7 +3141,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) MainWnd = NewMainWindow; MainWndDC = NewMainWndDC; - gTrueBackgroundFlag = falseblnr; + gTrueBackgroundFlag = false; #if VarFullScreen UseFullScreen = WantFullScreen; #endif @@ -3204,8 +3204,8 @@ LOCALFUNC blnr ReCreateMainWindow(void) { MacMsg("CreateWindow failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); - return falseblnr; + " and cannot continue.", true); + return false; } lppal->palNumEntries = 2; @@ -3225,24 +3225,24 @@ LOCALFUNC blnr ReCreateMainWindow(void) free(lppal); MacMsg("CreateWindow failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); - return falseblnr; + " and cannot continue.", true); + return false; } if (SelectPalette(MainWndDC, hpal, FALSE) == NULL) { free(lppal); MacMsg("CreateWindow failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); - return falseblnr; + " and cannot continue.", true); + return false; } if (RealizePalette(MainWndDC) == GDI_ERROR) { free(lppal); MacMsg("CreateWindow failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); - return falseblnr; + " and cannot continue.", true); + return false; } free(lppal); @@ -3258,14 +3258,14 @@ LOCALFUNC blnr ReCreateMainWindow(void) if (HaveCursorHidden) { (void) MoveMouse(CurMouseH, CurMouseV); - WantCursorHidden = trueblnr; + WantCursorHidden = true; } - return trueblnr; + return true; } #if UseWinCE -LOCALFUNC blnr AlreadyRunningCheck(void) +LOCALFUNC bool AlreadyRunningCheck(void) { /* Adapted from example program from Microsoft eMbedded Visual C++ @@ -3274,7 +3274,7 @@ LOCALFUNC blnr AlreadyRunningCheck(void) /* If it is already running, then focus on the window */ HWND hWnd = FindWindow(WndClassName, WndTitle); if (hWnd == NULL) { - return falseblnr; + return false; } else { /* Set focus to foremost child window. @@ -3282,7 +3282,7 @@ LOCALFUNC blnr AlreadyRunningCheck(void) windows to the foreground and activate them. */ SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); - return trueblnr; + return true; } } #endif @@ -3732,10 +3732,10 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void) DrawChangesAndClear(); } -LOCALFUNC blnr InitTheCursor(void) +LOCALFUNC bool InitTheCursor(void) { SetCursor(LoadCursor(NULL, IDC_ARROW)); - return trueblnr; + return true; } #if EnableFSMouseMotion @@ -3764,7 +3764,7 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -3772,7 +3772,7 @@ LOCALPROC MouseConstrain(void) LOCALPROC MousePositionNotify(LONG NewMousePosx, LONG NewMousePosy) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if VarFullScreen if (UseFullScreen) @@ -3812,17 +3812,17 @@ LOCALPROC MousePositionNotify(LONG NewMousePosx, LONG NewMousePosy) { if (NewMousePosx < 0) { NewMousePosx = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosx > vMacScreenWidth) { NewMousePosx = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePosy < 0) { NewMousePosy = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosy > vMacScreenHeight) { NewMousePosy = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } #if VarFullScreen @@ -3830,7 +3830,7 @@ LOCALPROC MousePositionNotify(LONG NewMousePosx, LONG NewMousePosy) #endif #if MayFullScreen { - ShouldHaveCursorHidden = trueblnr; + ShouldHaveCursorHidden = true; } #endif @@ -3959,15 +3959,15 @@ LOCALVAR const uint8_t MacRoman2NativeTab[] = { }; #if IncludePbufs -LOCALFUNC blnr MacRomanTextToNativeHand(tPbuf Pbuf_no, - blnr IsFileName, HGLOBAL *r) +LOCALFUNC bool MacRomanTextToNativeHand(tPbuf Pbuf_no, + bool IsFileName, HGLOBAL *r) { HGLOBAL h; uint32_t i; uint32_t rn = 0; HGLOBAL bh = PbufDat[Pbuf_no]; uint32_t L = PbufSize[Pbuf_no]; - blnr IsOk = falseblnr; + bool IsOk = false; if (IsFileName) { if (L > 255) { @@ -4023,7 +4023,7 @@ LOCALFUNC blnr MacRomanTextToNativeHand(tPbuf Pbuf_no, *p1++ = (TCHAR) 0; /* null character */ *r = h; - IsOk = trueblnr; + IsOk = true; (void) GlobalUnlock(h); } @@ -4044,7 +4044,7 @@ GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i) HGLOBAL h; tMacErr err = mnvm_miscErr; - if (MacRomanTextToNativeHand(i, falseblnr, &h)) { + if (MacRomanTextToNativeHand(i, false, &h)) { if (! OpenClipboard(MainWnd)) { /* ReportGetLastError(); */ } else { @@ -4131,7 +4131,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -4212,7 +4212,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) return result; } -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { HANDLE refnum = Drives[Drive_No]; @@ -4249,13 +4249,13 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } #if IncludeSonyNew GLOBALOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No) { - return vSonyEject0(Drive_No, trueblnr); + return vSonyEject0(Drive_No, true); } #endif @@ -4271,9 +4271,9 @@ LOCALPROC UnInitDrives(void) } #if NeedDriveNames -LOCALFUNC blnr LPTSTRtoHand(LPTSTR s, HGLOBAL *r) +LOCALFUNC bool LPTSTRtoHand(LPTSTR s, HGLOBAL *r) { - blnr IsOk = falseblnr; + bool IsOk = false; size_t L = _tcslen(s); HGLOBAL h = GlobalAlloc(GMEM_DDESHARE, @@ -4282,7 +4282,7 @@ LOCALFUNC blnr LPTSTRtoHand(LPTSTR s, HGLOBAL *r) LPTSTR p = GlobalLock(h); if (p != NULL) { _tcscpy(p, s); - IsOk = trueblnr; + IsOk = true; (void) GlobalUnlock(h); } if (! IsOk) { @@ -4322,7 +4322,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetName(tDrive Drive_No, tPbuf *r) } #endif -LOCALFUNC blnr Sony_Insert0(HANDLE refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(HANDLE refnum, bool locked, LPTSTR drivepath) { tDrive Drive_No; @@ -4334,8 +4334,8 @@ LOCALFUNC blnr Sony_Insert0(HANDLE refnum, blnr locked, if (! FirstFreeDisk(&Drive_No)) { (void) CloseHandle(refnum); MacMsg(kStrTooManyImagesTitle, - kStrTooManyImagesMessage, falseblnr); - return falseblnr; + kStrTooManyImagesMessage, false); + return false; } else { Drives[Drive_No] = refnum; DiskInsertNotify(Drive_No, locked); @@ -4350,13 +4350,13 @@ LOCALFUNC blnr Sony_Insert0(HANDLE refnum, blnr locked, DriveNames[Drive_No] = h; } #endif - return trueblnr; + return true; } } -LOCALFUNC blnr Sony_Insert1(LPTSTR drivepath, blnr SilentOnMissing) +LOCALFUNC bool Sony_Insert1(LPTSTR drivepath, bool SilentOnMissing) { - blnr locked = falseblnr; + bool locked = false; HANDLE refnum = CreateFile( drivepath, /* pointer to name of the file */ GENERIC_READ + GENERIC_WRITE, /* access (read-write) mode */ @@ -4368,7 +4368,7 @@ LOCALFUNC blnr Sony_Insert1(LPTSTR drivepath, blnr SilentOnMissing) ); if (refnum == INVALID_HANDLE_VALUE) { if (ERROR_ACCESS_DENIED == GetLastError()) { - locked = trueblnr; + locked = true; refnum = CreateFile( drivepath, /* pointer to name of the file */ GENERIC_READ, /* access (read-write) mode */ @@ -4384,22 +4384,22 @@ LOCALFUNC blnr Sony_Insert1(LPTSTR drivepath, blnr SilentOnMissing) DWORD err = GetLastError(); if (ERROR_SHARING_VIOLATION == err) { MacMsg(kStrImageInUseTitle, - kStrImageInUseMessage, falseblnr); + kStrImageInUseMessage, false); } else if ((ERROR_FILE_NOT_FOUND == err) && SilentOnMissing) { /* ignore it */ } else { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } else { return Sony_Insert0(refnum, locked, drivepath); } - return falseblnr; + return false; } -LOCALFUNC blnr LoadMacRomFromPath(LPTSTR drivepath) +LOCALFUNC bool LoadMacRomFromPath(LPTSTR drivepath) { HANDLE refnum = INVALID_HANDLE_VALUE; - blnr IsOk = falseblnr; + bool IsOk = false; refnum = CreateFile( drivepath, /* pointer to name of the file */ @@ -4412,7 +4412,7 @@ LOCALFUNC blnr LoadMacRomFromPath(LPTSTR drivepath) ); if (refnum == INVALID_HANDLE_VALUE) { - /* MacMsg(kStrNoROMTitle, kStrNoROMMessage, trueblnr); */ + /* MacMsg(kStrNoROMTitle, kStrNoROMMessage, true); */ } else { DWORD BytesRead; @@ -4441,8 +4441,8 @@ LOCALFUNC blnr LoadMacRomFromPath(LPTSTR drivepath) #endif #if EnableShellLinks -LOCALVAR blnr COMinited = falseblnr; -LOCALVAR blnr COMinitedOK; +LOCALVAR bool COMinited = false; +LOCALVAR bool COMinitedOK; #endif #if EnableShellLinks @@ -4455,25 +4455,25 @@ LOCALPROC UninitCOM(void) #endif #if EnableShellLinks -LOCALFUNC blnr NeedCOM(void) +LOCALFUNC bool NeedCOM(void) { HRESULT hres; if (! COMinited) { - COMinitedOK = falseblnr; + COMinitedOK = false; hres = CoInitialize(NULL); if (SUCCEEDED(hres)) { - COMinitedOK = trueblnr; + COMinitedOK = true; } - COMinited = trueblnr; + COMinited = true; } return COMinitedOK; } #endif #if EnableShellLinks -LOCALFUNC blnr ResolveShortcut(LPTSTR FilePath, blnr *directory) +LOCALFUNC bool ResolveShortcut(LPTSTR FilePath, bool *directory) /* adapted from Microsoft example code */ { HRESULT hres; @@ -4481,7 +4481,7 @@ LOCALFUNC blnr ResolveShortcut(LPTSTR FilePath, blnr *directory) IPersistFile* ppf; TCHAR szGotPath[MAX_PATH]; WIN32_FIND_DATA wfd; - blnr IsOk = falseblnr; + bool IsOk = false; if (NeedCOM()) { hres = CoCreateInstance(&CLSID_ShellLink, NULL, @@ -4532,7 +4532,7 @@ LOCALFUNC blnr ResolveShortcut(LPTSTR FilePath, blnr *directory) *directory = (0 != (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); } - IsOk = trueblnr; + IsOk = true; } } } @@ -4547,26 +4547,26 @@ LOCALFUNC blnr ResolveShortcut(LPTSTR FilePath, blnr *directory) #endif #if EnableShellLinks -LOCALFUNC blnr FileIsLink(LPTSTR drivepath) +LOCALFUNC bool FileIsLink(LPTSTR drivepath) { LPTSTR p = FindLastTerm(drivepath, (TCHAR)('.')); if (p != nullpr) { if (_tcscmp(p, TEXT("lnk")) == 0) { - return trueblnr; + return true; } } - return falseblnr; + return false; } #endif -LOCALFUNC blnr InsertDiskOrAlias(LPTSTR drivepath, - blnr MaybeROM, blnr MaybeAlias) +LOCALFUNC bool InsertDiskOrAlias(LPTSTR drivepath, + bool MaybeROM, bool MaybeAlias) { #if EnableShellLinks if (MaybeAlias && FileIsLink(drivepath)) { if (! ResolveShortcut(drivepath, NULL)) { - return falseblnr; + return false; } } #endif @@ -4574,22 +4574,22 @@ LOCALFUNC blnr InsertDiskOrAlias(LPTSTR drivepath, if (MaybeROM && ! ROM_loaded) { return LoadMacRomFromPath(drivepath); } else { - return Sony_Insert1(drivepath, falseblnr); + return Sony_Insert1(drivepath, false); } } -LOCALFUNC blnr FileExists(LPTSTR pathName, blnr *directory) +LOCALFUNC bool FileExists(LPTSTR pathName, bool *directory) { WIN32_FIND_DATA fd; HANDLE hf = FindFirstFile(pathName, &fd); - blnr IsOk = falseblnr; + bool IsOk = false; if (hf != INVALID_HANDLE_VALUE) { if (NULL != directory) { *directory = (0 != (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); } - IsOk = trueblnr; + IsOk = true; FindClose(hf); } @@ -4597,7 +4597,7 @@ LOCALFUNC blnr FileExists(LPTSTR pathName, blnr *directory) } LOCALFUNC tMacErr ResolveNamedChild0(LPTSTR pathName, - LPTSTR Child, blnr *directory) + LPTSTR Child, bool *directory) { size_t newlen; size_t oldlen = _tcslen(pathName); @@ -4632,27 +4632,27 @@ LOCALFUNC tMacErr ResolveNamedChild0(LPTSTR pathName, } LOCALFUNC tMacErr ResolveNamedChild(LPTSTR pathName, - char *Child, blnr *directory) + char *Child, bool *directory) { TCHAR Child0[ClStrMaxLength + 1]; - NativeStrFromCStr(Child0, Child, falseblnr); + NativeStrFromCStr(Child0, Child, false); return ResolveNamedChild0(pathName, Child0, directory); } -LOCALFUNC blnr ResolveNamedChildDir(LPTSTR pathName, char *Child) +LOCALFUNC bool ResolveNamedChildDir(LPTSTR pathName, char *Child) { - blnr directory; + bool directory; return (mnvm_noErr == ResolveNamedChild( pathName, Child, &directory)) && directory; } -LOCALFUNC blnr ResolveNamedChildFile(LPTSTR pathName, char *Child) +LOCALFUNC bool ResolveNamedChildFile(LPTSTR pathName, char *Child) { - blnr directory; + bool directory; return (mnvm_noErr == ResolveNamedChild( pathName, Child, &directory)) @@ -4660,17 +4660,17 @@ LOCALFUNC blnr ResolveNamedChildFile(LPTSTR pathName, char *Child) } #if (IncludeSonyNew && ! SaveDialogEnable) -LOCALFUNC blnr MakeNamedChildDir(LPTSTR pathName, char *Child) +LOCALFUNC bool MakeNamedChildDir(LPTSTR pathName, char *Child) { - blnr directory; - blnr IsOk = falseblnr; + bool directory; + bool IsOk = false; tMacErr err = ResolveNamedChild(pathName, Child, &directory); if (mnvm_noErr == err) { IsOk = directory; } else if (mnvm_fnfErr == err) { if (CreateDirectory(pathName, NULL)) { - IsOk = trueblnr; + IsOk = true; } } @@ -4678,17 +4678,17 @@ LOCALFUNC blnr MakeNamedChildDir(LPTSTR pathName, char *Child) } #endif -LOCALFUNC blnr GetAppDataPath(LPTSTR lpszPath, +LOCALFUNC bool GetAppDataPath(LPTSTR lpszPath, BOOL fCreate) { - blnr IsOk = falseblnr; + bool IsOk = false; if (HaveMySHGetSpecialFolderPath()) if (MySHGetSpecialFolderPath( NULL /* HWND hwndOwner */, lpszPath, _CSIDL_APPDATA, fCreate)) { - IsOk = trueblnr; + IsOk = true; } /* if not available, could perhaps @@ -4709,7 +4709,7 @@ LOCALFUNC blnr GetAppDataPath(LPTSTR lpszPath, #if UseWinCE /* Are we in control mode? */ /* Needed because you can't hold down a key with the virtual keyboard */ -LOCALVAR blnr CtrlMode = falseblnr; +LOCALVAR bool CtrlMode = false; #endif LOCALPROC InsertADisk0(void) @@ -4724,7 +4724,7 @@ LOCALPROC InsertADisk0(void) size_t cbString; TCHAR chReplace; TCHAR szFilter[256]; - blnr IsOk; + bool IsOk; szDirName[0] = (TCHAR)('\0'); szFile[0] = (TCHAR)('\0'); @@ -4769,38 +4769,38 @@ LOCALPROC InsertADisk0(void) if (szFile[0]) { char wMsg[1024]; sprintf(wMsg, "Couldn't open %ls", szFile); - MacMsg("error", wMsg, falseblnr); + MacMsg("error", wMsg, false); } #endif } else { (void) InsertDiskOrAlias(ofn.lpstrFile, - trueblnr, falseblnr); + true, false); } #if UseWinCE - CtrlMode = falseblnr; + CtrlMode = false; #endif } -LOCALFUNC blnr LoadInitialImageFromName(char *ImageName) +LOCALFUNC bool LoadInitialImageFromName(char *ImageName) { TCHAR ImageFile[_MAX_PATH]; if (GetAppDir(ImageFile)) if (ResolveNamedChildFile(ImageFile, ImageName)) - if (Sony_Insert1(ImageFile, trueblnr)) + if (Sony_Insert1(ImageFile, true)) { - return trueblnr; + return true; } - return falseblnr; + return false; } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; @@ -4813,7 +4813,7 @@ LOCALFUNC blnr Sony_InsertIth(int i) return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { if (! AnyDiskInserted()) { int i; @@ -4823,11 +4823,11 @@ LOCALFUNC blnr LoadInitialImages(void) } } - return trueblnr; + return true; } #if IncludeSonyNew -LOCALFUNC blnr WriteZero(HANDLE refnum, uint32_t L) +LOCALFUNC bool WriteZero(HANDLE refnum, uint32_t L) { if (SetFilePointer( refnum, /* handle of file */ @@ -4836,7 +4836,7 @@ LOCALFUNC blnr WriteZero(HANDLE refnum, uint32_t L) FILE_BEGIN /* how to move */ ) != 0) { - return falseblnr; + return false; } else { #define ZeroBufferSize 2048 uint32_t i; @@ -4855,11 +4855,11 @@ LOCALFUNC blnr WriteZero(HANDLE refnum, uint32_t L) nullpr) /* address of structure for data */ || ((uint32_t)BytesWritten != i)) { - return falseblnr; + return false; } L -= i; } - return trueblnr; + return true; } } #endif @@ -4869,10 +4869,10 @@ LOCALFUNC blnr WriteZero(HANDLE refnum, uint32_t L) #if IncludeSonyNew LOCALPROC MakeNewDisk0(uint32_t L, LPTSTR pathName) { - blnr IsOk = falseblnr; + bool IsOk = false; HANDLE newrefNum; - IsOk = falseblnr; + IsOk = false; newrefNum = CreateFile( pathName, /* pointer to name of the file */ GENERIC_READ + GENERIC_WRITE, /* access (read-write) mode */ @@ -4900,7 +4900,7 @@ LOCALPROC MakeNewDisk0(uint32_t L, LPTSTR pathName) /* report error */ } else { IsOk = - Sony_Insert0(newrefNum, falseblnr, pathName); + Sony_Insert0(newrefNum, false, pathName); newrefNum = INVALID_HANDLE_VALUE; } if (INVALID_HANDLE_VALUE != newrefNum) { @@ -4918,7 +4918,7 @@ LOCALPROC MakeNewDisk(uint32_t L, HGLOBAL NewDiskNameDat) { #if SaveDialogEnable OPENFILENAME ofn; - blnr IsOk = falseblnr; + bool IsOk = false; TCHAR szFile[MaxSavePathSize]; TCHAR szFileTitle[MaxSavePathSize]; @@ -4936,7 +4936,7 @@ LOCALPROC MakeNewDisk(uint32_t L, HGLOBAL NewDiskNameDat) } else #endif { - NativeStrFromCStr(szFile, "untitled", falseblnr); + NativeStrFromCStr(szFile, "untitled", false); } ofn.lStructSize = sizeof(OPENFILENAME); @@ -4966,7 +4966,7 @@ LOCALPROC MakeNewDisk(uint32_t L, HGLOBAL NewDiskNameDat) if (GetAppDir(pathName)) if (MakeNamedChildDir(pathName, "out")) { - blnr directory; + bool directory; LPTSTR p = GlobalLock(NewDiskNameDat); if (p != NULL) { @@ -4992,15 +4992,15 @@ LOCALPROC MakeNewDisk(uint32_t L, HGLOBAL NewDiskNameDat) } #endif -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { TCHAR ROMFile[_MAX_PATH]; - blnr IsOk = falseblnr; + bool IsOk = false; if (GetAppDir(ROMFile)) if (ResolveNamedChildFile(ROMFile, RomFileName)) { - IsOk = trueblnr; + IsOk = true; } if (! IsOk) { @@ -5009,7 +5009,7 @@ LOCALFUNC blnr LoadMacRom(void) if (ResolveNamedChildDir(ROMFile, "mnvm_rom")) if (ResolveNamedChildFile(ROMFile, RomFileName)) { - IsOk = trueblnr; + IsOk = true; } } @@ -5018,7 +5018,7 @@ LOCALFUNC blnr LoadMacRom(void) IsOk = LoadMacRomFromPath(ROMFile); } - return trueblnr; + return true; } #if InstallFileIcons @@ -5041,7 +5041,7 @@ LOCALPROC SetRegKey(HKEY hKeyRoot, LOCALPROC RegisterShellFileType(LPTSTR AppPath, LPTSTR strFilterExt, LPTSTR strFileTypeId, LPTSTR strFileTypeName, - LPTSTR strIconId, blnr CanOpen) + LPTSTR strIconId, bool CanOpen) { TCHAR strRegKey[_MAX_PATH]; TCHAR strRegValue[_MAX_PATH + 2]; @@ -5068,7 +5068,7 @@ LOCALPROC RegisterShellFileType(LPTSTR AppPath, LPTSTR strFilterExt, } } -LOCALFUNC blnr RegisterInRegistry(void) +LOCALFUNC bool RegisterInRegistry(void) { TCHAR AppPath[_MAX_PATH]; @@ -5078,17 +5078,17 @@ LOCALFUNC blnr RegisterInRegistry(void) #endif RegisterShellFileType(AppPath, TEXT(".rom"), TEXT("minivmac.rom"), - TEXT("Mini vMac ROM Image"), TEXT("1"), falseblnr); + TEXT("Mini vMac ROM Image"), TEXT("1"), false); RegisterShellFileType(AppPath, TEXT(".dsk"), TEXT("minivmac.dsk"), - TEXT("Mini vMac Disk Image"), TEXT("2"), trueblnr); + TEXT("Mini vMac Disk Image"), TEXT("2"), true); - return trueblnr; + return true; } #endif LOCALVAR LPTSTR CommandLine; -LOCALFUNC blnr ScanCommandLine(void) +LOCALFUNC bool ScanCommandLine(void) { TCHAR *p = CommandLine; TCHAR *p1; @@ -5141,17 +5141,17 @@ LOCALFUNC blnr ScanCommandLine(void) #endif { MacMsg(kStrBadArgTitle, kStrBadArgMessage, - falseblnr); + false); } } else { (void) InsertDiskOrAlias(fileName, - falseblnr, trueblnr); + false, true); } } } } - return trueblnr; + return true; } #if EnableRecreateW @@ -5195,7 +5195,7 @@ LOCALPROC ZapWinStateVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -5229,7 +5229,7 @@ LOCALPROC ToggleWantFullScreen(void) if (kMagStateAuto != NewMagState) { WantMagnify = (kMagStateMagnifgy == NewMagState); } else { - WantMagnify = falseblnr; + WantMagnify = false; if (WantFullScreen) { if ((GetSystemMetrics(SM_CXSCREEN) >= vMacScreenWidth * WindowScale) @@ -5237,7 +5237,7 @@ LOCALPROC ToggleWantFullScreen(void) >= vMacScreenHeight * WindowScale) ) { - WantMagnify = trueblnr; + WantMagnify = true; } } } @@ -5257,7 +5257,7 @@ LOCALPROC DragFunc(HDROP hDrop) for (i = 0; i < n; ++i) { if (DragQueryFile(hDrop, i, NULL, 0) < _MAX_PATH - 1) { (void) DragQueryFile(hDrop, i, a, _MAX_PATH); - (void) InsertDiskOrAlias(a, trueblnr, trueblnr); + (void) InsertDiskOrAlias(a, true, true); } } @@ -5268,12 +5268,12 @@ LOCALPROC DragFunc(HDROP hDrop) /* error message here ? */ } - WantCmdOptOnReconnect = trueblnr; + WantCmdOptOnReconnect = true; } } #endif -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { #if SoundEnabled SoundCheckVeryOften(); @@ -5328,7 +5328,7 @@ LOCALPROC CheckForSavedTasks(void) */ if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); @@ -5341,12 +5341,12 @@ LOCALPROC CheckForSavedTasks(void) #endif if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -5406,7 +5406,7 @@ LOCALPROC CheckForSavedTasks(void) #if IncludeSonyNameNew if (vSonyNewDiskName != NotAPbuf) { HGLOBAL NewDiskNameDat; - if (MacRomanTextToNativeHand(vSonyNewDiskName, trueblnr, + if (MacRomanTextToNativeHand(vSonyNewDiskName, true, &NewDiskNameDat)) { MakeNewDisk(vSonyNewDiskSize, NewDiskNameDat); @@ -5419,12 +5419,12 @@ LOCALPROC CheckForSavedTasks(void) { MakeNewDisk(vSonyNewDiskSize, NULL); } - vSonyNewDiskWanted = falseblnr; + vSonyNewDiskWanted = false; /* must be done after may have gotten disk */ } #endif if (RequestInsertDisk) { - RequestInsertDisk = falseblnr; + RequestInsertDisk = false; InsertADisk0(); } } @@ -5453,14 +5453,14 @@ LOCALPROC CheckForSavedTasks(void) } if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } } #if UseWinCE /* Sip Status ON/OFF */ -LOCALVAR blnr SipOn = falseblnr; +LOCALVAR bool SipOn = false; #endif LRESULT CALLBACK Win32WMProc(HWND hwnd, @@ -5499,7 +5499,7 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, case WM_KEYDOWN: case WM_SYSKEYDOWN: #if UseWinCE - SipOn = falseblnr; + SipOn = false; { SIPINFO r; @@ -5520,17 +5520,17 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, { break; } else if (wparam == VK_CONTROL && CtrlMode) { - DoVKcode0(wparam, falseblnr); - CtrlMode = falseblnr; + DoVKcode0(wparam, false); + CtrlMode = false; break; } else if (wparam == VK_CONTROL) { - DoVKcode0(wparam, trueblnr); - CtrlMode = trueblnr; + DoVKcode0(wparam, true); + CtrlMode = true; break; } #endif if (! TestBit(lparam, 30)) { /* ignore repeats */ - DoVKcode(wparam, lparam >> 24, trueblnr); + DoVKcode(wparam, lparam >> 24, true); } #if UseWinCE @@ -5545,7 +5545,7 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, case WM_KEYUP: case WM_SYSKEYUP: #if UseWinCE - SipOn = falseblnr; + SipOn = false; { SIPINFO r; @@ -5605,7 +5605,7 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, break; } #endif - DoVKcode(wparam, lparam >> 24, falseblnr); + DoVKcode(wparam, lparam >> 24, false); #if UseWinCE return TRUE; @@ -5624,12 +5624,12 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, #endif case WM_CLOSE: - RequestMacOff = trueblnr; + RequestMacOff = true; break; #if ! UseWinCE case WM_QUERYENDSESSION: if (AnyDiskInserted()) { - RequestMacOff = trueblnr; + RequestMacOff = true; return FALSE; } else { return TRUE; @@ -5645,10 +5645,10 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, switch(LOWORD(wparam)) { case ID_FILE_INSERTDISK1: - RequestInsertDisk = trueblnr; + RequestInsertDisk = true; break; case ID_FILE_QUIT: - RequestMacOff = trueblnr; + RequestMacOff = true; break; case ID_SPECIAL_MORECOMMANDS: DoMoreCommandsMsg(); @@ -5669,12 +5669,12 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: MousePositionNotify(LOWORD (lparam), HIWORD (lparam)); - SetCurMouseButton(trueblnr); + SetCurMouseButton(true); break; case WM_LBUTTONUP: case WM_RBUTTONUP: MousePositionNotify(LOWORD (lparam), HIWORD (lparam)); - SetCurMouseButton(falseblnr); + SetCurMouseButton(false); break; case WM_MOUSEMOVE: #if UseWinCE @@ -5707,7 +5707,7 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd, return 0; } -LOCALFUNC blnr RegisterOurClass(void) +LOCALFUNC bool RegisterOurClass(void) { WNDCLASS wc; @@ -5729,10 +5729,10 @@ LOCALFUNC blnr RegisterOurClass(void) if (! RegisterClass(&wc)) { MacMsg("RegisterClass failed", "Sorry, Mini vMac encountered errors" - " and cannot continue.", trueblnr); - return falseblnr; + " and cannot continue.", true); + return false; } else { - return trueblnr; + return true; } } @@ -5801,7 +5801,7 @@ label_retry: } #if UseWinCE -LOCALFUNC blnr Init_ChangeOrientation(void) +LOCALFUNC bool Init_ChangeOrientation(void) { DEVMODE dm; @@ -5829,11 +5829,11 @@ LOCALFUNC blnr Init_ChangeOrientation(void) DISP_CHANGE_SUCCESSFUL) { MacMsg ("warning", - "Couldn't switch to Landscape mode.", falseblnr); + "Couldn't switch to Landscape mode.", false); } */ - return trueblnr; + return true; } #endif @@ -5865,21 +5865,21 @@ LOCALVAR HINSTANCE hCoreDLL = NULL; #endif #if UseWinCE -LOCALFUNC blnr InitHotKeys(void) +LOCALFUNC bool InitHotKeys(void) { UnregisterFunc1Proc procUndergisterFunc; int i; hCoreDLL = LoadLibrary(TEXT("coredll.dll")); if (! hCoreDLL) { - MacMsg ("Fatal", "Could not load coredll.dll", trueblnr); + MacMsg ("Fatal", "Could not load coredll.dll", true); } else { procUndergisterFunc = (UnregisterFunc1Proc) GetProcAddress(hCoreDLL, TEXT("UnregisterFunc1")); if (! procUndergisterFunc) { MacMsg ("Fatal", - "Could not get UnregisterFunc1 procedure", trueblnr); + "Could not get UnregisterFunc1 procedure", true); } else { for (i = 0xc1; i <= 0xcf; ++i) { procUndergisterFunc(MOD_WIN, i); @@ -5887,7 +5887,7 @@ LOCALFUNC blnr InitHotKeys(void) } } } - return trueblnr; + return true; } #endif @@ -5915,12 +5915,12 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif #if EnableScalingBuff { @@ -5938,37 +5938,37 @@ LOCALPROC ReserveAllocAll(void) n = vMacScreenNumBytes; } #endif - ReserveAllocOneBlock(&ScalingBuff, n, 5, falseblnr); + ReserveAllocOneBlock(&ScalingBuff, n, 5, false); } #endif #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; ReserveAllocBigBlock = - (ui3p)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, n); + (uint8_t *)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -5979,12 +5979,12 @@ LOCALPROC UnallocMemory(void) { if (nullpr != ReserveAllocBigBlock) { if (GlobalFree(ReserveAllocBigBlock) != NULL) { - MacMsg("error", "GlobalFree failed", falseblnr); + MacMsg("error", "GlobalFree failed", false); } } } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { if (AllocMemory()) #if dbglog_HAVE @@ -6009,9 +6009,9 @@ LOCALFUNC blnr InitOSGLU(void) if (Init60thCheck()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) @@ -6019,7 +6019,7 @@ LOCALPROC UnInitOSGLU(void) #if (TimeResolution != 0) Timer_Suspend(); #endif - MouseCaptureSet(falseblnr); + MouseCaptureSet(false); if (MacMsgDisplayed) { MacMsgDisplayOff(); diff --git a/src/UI/XPLAT/OSGLUGTK.c b/src/UI/XPLAT/OSGLUGTK.c index b483663..515bed5 100644 --- a/src/UI/XPLAT/OSGLUGTK.c +++ b/src/UI/XPLAT/OSGLUGTK.c @@ -56,10 +56,10 @@ GLOBALOSGLUPROC MoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount) LOCALVAR FILE *dbglog_File = NULL; #endif -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { #if dbglog_ToStdErr - return trueblnr; + return true; #else dbglog_File = fopen("dbglog.txt", "w"); return (NULL != dbglog_File); @@ -106,7 +106,7 @@ LOCALPROC WriteExtraErr(char *s) /* --- text translation --- */ -LOCALPROC NativeStrFromCStr(char *r, char *s, blnr AddEllipsis) +LOCALPROC NativeStrFromCStr(char *r, char *s, bool AddEllipsis) { uint8_t ps[ClStrMaxLength]; int i; @@ -149,7 +149,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -177,7 +177,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) return mnvm_noErr; /*& figure out what really to return &*/ } -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { DiskEjectedNotify(Drive_No); @@ -190,7 +190,7 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } LOCALPROC UnInitDrives(void) @@ -204,7 +204,7 @@ LOCALPROC UnInitDrives(void) } } -LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(FILE *refnum, bool locked, char *drivepath) { tDrive Drive_No; @@ -212,34 +212,34 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, if (! FirstFreeDisk(&Drive_No)) { fclose(refnum); MacMsg(kStrTooManyImagesTitle, - kStrTooManyImagesMessage, falseblnr); - return falseblnr; + kStrTooManyImagesMessage, false); + return false; } else { /* printf("Sony_Insert0 %d\n", (int)Drive_No); */ Drives[Drive_No] = refnum; DiskInsertNotify(Drive_No, locked); - return trueblnr; + return true; } } -LOCALFUNC blnr Sony_Insert1(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1(char *drivepath, bool silentfail) { - blnr locked = falseblnr; + bool locked = false; /* printf("Sony_Insert1 %s\n", drivepath); */ FILE *refnum = fopen(drivepath, "rb+"); if (NULL == refnum) { - locked = trueblnr; + locked = true; refnum = fopen(drivepath, "rb"); } if (NULL == refnum) { if (! silentfail) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } else { return Sony_Insert0(refnum, locked, drivepath); } - return falseblnr; + return false; } LOCALFUNC tMacErr LoadMacRomFrom(char *path) @@ -272,9 +272,9 @@ LOCALFUNC tMacErr LoadMacRomFrom(char *path) return err; } -LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1a(char *drivepath, bool silentfail) { - blnr v; + bool v; if (! ROM_loaded) { v = (mnvm_noErr == LoadMacRomFrom(drivepath)); @@ -285,24 +285,24 @@ LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) return v; } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; s[4] = '0' + i; - v = Sony_Insert1(s, trueblnr); + v = Sony_Insert1(s, true); } return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { int i; @@ -310,14 +310,14 @@ LOCALFUNC blnr LoadInitialImages(void) /* stop on first error (including file not found) */ } - return trueblnr; + return true; } /* --- ROM --- */ LOCALVAR char *rom_path = NULL; -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -327,16 +327,16 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; + return true; } /* --- video out --- */ static GtkWidget *drawing_area; -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool gTrueBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; LOCALPROC HaveChangedScreenBuff(int16_t top, int16_t left, int16_t bottom, int16_t right) @@ -391,8 +391,8 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void) /* --- mouse --- */ -LOCALVAR blnr HaveCursorHidden = falseblnr; -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; +LOCALVAR bool WantCursorHidden = false; static GdkCursor *blank_cursor; static GtkWidget *window = NULL; @@ -400,7 +400,7 @@ static GtkWidget *window = NULL; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; if (window) { gdk_window_set_cursor(window->window, NULL); @@ -412,22 +412,22 @@ LOCALPROC ForceShowCursor(void) LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; { if (NewMousePosh < 0) { NewMousePosh = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosh >= vMacScreenWidth) { NewMousePosh = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePosv < 0) { NewMousePosv = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosv >= vMacScreenHeight) { NewMousePosv = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } @@ -494,7 +494,7 @@ LOCALPROC KC2MKCAssignOne(guint keyval, uint8_t key) #endif } -LOCALFUNC blnr KC2MKCInit(void) +LOCALFUNC bool KC2MKCInit(void) { int i; @@ -748,7 +748,7 @@ LOCALFUNC blnr KC2MKCInit(void) InitKeyCodes(); - return trueblnr; + return true; } LOCALPROC CheckTheCapsLock(void) @@ -761,7 +761,7 @@ LOCALPROC CheckTheCapsLock(void) (mask & GDK_LOCK_MASK) != 0); } -LOCALPROC DoKeyCode(guint keycode, blnr down) +LOCALPROC DoKeyCode(guint keycode, bool down) { if (GDK_Caps_Lock == keycode) { CheckTheCapsLock(); @@ -782,7 +782,7 @@ LOCALVAR uint32_t TrueEmulatedTime = 0; #define TicksPerSecond 1000000 -LOCALVAR blnr HaveTimeDelta = falseblnr; +LOCALVAR bool HaveTimeDelta = false; LOCALVAR uint32_t TimeDelta; LOCALVAR uint32_t NewMacDateInSeconds; @@ -813,7 +813,7 @@ LOCALPROC GetCurrentTicks(void) CurMacDelta = ((uint32_t)(s->tm_gmtoff) & 0x00FFFFFF) | ((s->tm_isdst ? 0x80 : 0) << 24); #endif - HaveTimeDelta = trueblnr; + HaveTimeDelta = true; } NewMacDateInSeconds = t.tv_sec + TimeDelta; @@ -879,22 +879,22 @@ LOCALPROC UpdateTrueEmulatedTime(void) } } -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { if (CurMacDateInSeconds != NewMacDateInSeconds) { CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { GetCurrentTicks(); CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } /* --- basic dialogs --- */ @@ -905,8 +905,8 @@ LOCALPROC CheckSavedMacMsg(void) char briefMsg0[ClStrMaxLength + 1]; char longMsg0[ClStrMaxLength + 1]; - NativeStrFromCStr(briefMsg0, SavedBriefMsg, falseblnr); - NativeStrFromCStr(longMsg0, SavedLongMsg, falseblnr); + NativeStrFromCStr(briefMsg0, SavedBriefMsg, false); + NativeStrFromCStr(longMsg0, SavedLongMsg, false); fprintf(stderr, "%s\n", briefMsg0); fprintf(stderr, "%s\n", longMsg0); @@ -915,12 +915,12 @@ LOCALPROC CheckSavedMacMsg(void) } } -LOCALVAR blnr CaughtMouse = falseblnr; +LOCALVAR bool CaughtMouse = false; /* --- main window creation and disposal --- */ -LOCALVAR int my_argc; -LOCALVAR char **my_argv; +LOCALVAR int argc; +LOCALVAR char **argv; /* Create a new backing pixmap of the appropriate size */ static gboolean configure_event(GtkWidget *widget, @@ -967,7 +967,7 @@ static gboolean button_press_event(GtkWidget *widget, gpointer user_data) { MousePositionNotify(event->x, event->y); - MouseButtonSet(trueblnr); + MouseButtonSet(true); return TRUE; } @@ -977,7 +977,7 @@ static gboolean button_release_event(GtkWidget *widget, gpointer user_data) { MousePositionNotify(event->x, event->y); - MouseButtonSet(falseblnr); + MouseButtonSet(false); return TRUE; } @@ -1008,7 +1008,7 @@ static gboolean enter_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) { - CaughtMouse = trueblnr; + CaughtMouse = true; MousePositionNotify(event->x, event->y); MouseButtonSet((event->state & GDK_BUTTON1_MASK) != 0); @@ -1023,7 +1023,7 @@ static gboolean leave_notify_event(GtkWidget *widget, MousePositionNotify(event->x, event->y); MouseButtonSet((event->state & GDK_BUTTON1_MASK) != 0); - CaughtMouse = falseblnr; + CaughtMouse = false; return TRUE; } @@ -1031,7 +1031,7 @@ static gboolean leave_notify_event(GtkWidget *widget, static gboolean delete_event(GtkWidget *widget, GdkEventMotion *event) { - RequestMacOff = trueblnr; + RequestMacOff = true; return TRUE; } @@ -1042,7 +1042,7 @@ LOCALPROC ReconnectKeyCodes3(void) #if 0 if (WantCmdOptOnReconnect) { - WantCmdOptOnReconnect = falseblnr; + WantCmdOptOnReconnect = false; GetTheDownKeys(); } @@ -1052,21 +1052,21 @@ LOCALPROC ReconnectKeyCodes3(void) LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - MouseButtonSet(falseblnr); + MouseButtonSet(false); } -LOCALVAR blnr ADialogIsUp = falseblnr; +LOCALVAR bool ADialogIsUp = false; LOCALPROC BeginDialog(void) { DisconnectKeyCodes3(); - ADialogIsUp = trueblnr; + ADialogIsUp = true; ForceShowCursor(); } LOCALPROC EndDialog(void) { - ADialogIsUp = falseblnr; + ADialogIsUp = false; ReconnectKeyCodes3(); } @@ -1104,7 +1104,7 @@ static void InsertADisk0(void) char ts[ClStrMaxLength + 1]; GtkWidget *dialog; - NativeStrFromCStr(ts, kStrMenuItemOpen, falseblnr); + NativeStrFromCStr(ts, kStrMenuItemOpen, false); BeginDialog(); dialog = gtk_file_chooser_dialog_new(ts, @@ -1120,7 +1120,7 @@ static void InsertADisk0(void) filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - (void) Sony_Insert1a(filename, falseblnr); + (void) Sony_Insert1a(filename, false); g_free(filename); } @@ -1130,19 +1130,19 @@ static void InsertADisk0(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); } if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -1180,7 +1180,7 @@ LOCALPROC CheckForSavedTasks(void) } if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -1198,7 +1198,7 @@ LOCALPROC CheckForSavedTasks(void) if (gTrueBackgroundFlag || ADialogIsUp) { } else { if (RequestInsertDisk) { - RequestInsertDisk = falseblnr; + RequestInsertDisk = false; InsertADisk0(); } } @@ -1213,48 +1213,48 @@ LOCALPROC CheckForSavedTasks(void) /* --- command line parsing --- */ -LOCALFUNC blnr ScanCommandLine(void) +LOCALFUNC bool ScanCommandLine(void) { int i; - for (i = 1; i < my_argc; ++i) { - if ('-' == my_argv[i][0]) { + for (i = 1; i < argc; ++i) { + if ('-' == argv[i][0]) { #if 0 - if ((0 == strcmp(my_argv[i], "--display")) || - (0 == strcmp(my_argv[i], "-display"))) + if ((0 == strcmp(argv[i], "--display")) || + (0 == strcmp(argv[i], "-display"))) { ++i; - if (i < my_argc) { - display_name = my_argv[i]; + if (i < argc) { + display_name = argv[i]; } } else #endif - if ((0 == strcmp(my_argv[i], "--rom")) || - (0 == strcmp(my_argv[i], "-r"))) + if ((0 == strcmp(argv[i], "--rom")) || + (0 == strcmp(argv[i], "-r"))) { ++i; - if (i < my_argc) { - rom_path = my_argv[i]; + if (i < argc) { + rom_path = argv[i]; } } else #if 0 - if (0 == strcmp(my_argv[i], "-l")) { + if (0 == strcmp(argv[i], "-l")) { SpeedValue = 0; } else #endif { - MacMsg(kStrBadArgTitle, kStrBadArgMessage, falseblnr); + MacMsg(kStrBadArgTitle, kStrBadArgMessage, false); } } else { - (void) Sony_Insert1(my_argv[i], falseblnr); + (void) Sony_Insert1(argv[i], false); } } - return trueblnr; + return true; } /* --- main program flow --- */ -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -1344,7 +1344,7 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEvent *event, gpointer data) { - gTrueBackgroundFlag = falseblnr; + gTrueBackgroundFlag = false; CheckMouseState(); @@ -1355,7 +1355,7 @@ static gboolean focus_out_event(GtkWidget *widget, GdkEvent *event, gpointer data) { - gTrueBackgroundFlag = trueblnr; + gTrueBackgroundFlag = true; return FALSE; } @@ -1384,7 +1384,7 @@ static gboolean key_press_event(GtkWidget *widget, } } #endif - DoKeyCode(event->hardware_keycode, trueblnr); + DoKeyCode(event->hardware_keycode, true); return TRUE; } @@ -1398,7 +1398,7 @@ static gboolean key_release_event(GtkWidget *widget, fprintf(stderr, "keyval %d\n", event->keyval); fprintf(stderr, "hardware_keycode %d\n", event->hardware_keycode); #endif - DoKeyCode(event->hardware_keycode, falseblnr); + DoKeyCode(event->hardware_keycode, false); return TRUE; } @@ -1423,7 +1423,7 @@ static void drag_data_received(GtkWidget *widget, file = g_filename_from_uri(uris[i], NULL, NULL); /* file = gnome_vfs_get_local_path_from_uri(uris[i]); */ if (file != NULL) { - (void) Sony_Insert1a(file, falseblnr); + (void) Sony_Insert1a(file, false); handled = TRUE; g_free(file); } @@ -1448,16 +1448,16 @@ static void do_about_item(GtkAction *action, gpointer user_data) static void do_quit_item(GtkAction *action, gpointer user_data) { - RequestMacOff = trueblnr; + RequestMacOff = true; } static void do_open_item(GtkAction *action, gpointer user_data) { - RequestInsertDisk = trueblnr; + RequestInsertDisk = true; } LOCALPROC AppendConvertMenuItem(GtkWidget *the_menu, - GCallback c_handler, gpointer gobject, char *s, blnr AddEllipsis) + GCallback c_handler, gpointer gobject, char *s, bool AddEllipsis) { char ts[ClStrMaxLength + 1]; GtkWidget *the_item; @@ -1475,7 +1475,7 @@ LOCALPROC AppendSubmenuConvertName(GtkWidget *menubar, char ts[ClStrMaxLength + 1]; GtkWidget *the_item; - NativeStrFromCStr(ts, s, falseblnr); + NativeStrFromCStr(ts, s, false); the_item = gtk_menu_item_new_with_label(ts); gtk_menu_item_set_submenu(GTK_MENU_ITEM(the_item), the_menu); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), the_item); @@ -1506,7 +1506,7 @@ LOCALPROC ZapOSGLUVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -1517,36 +1517,36 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -1560,7 +1560,7 @@ LOCALPROC UnallocMemory(void) } } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { if (AllocMemory()) #if dbglog_HAVE @@ -1574,9 +1574,9 @@ LOCALFUNC blnr InitOSGLU(void) if (KC2MKCInit()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) @@ -1638,27 +1638,27 @@ int main(int argc, char *argv[]) the_menu = gtk_menu_new(); AppendConvertMenuItem(the_menu, - G_CALLBACK(do_open_item), NULL, kStrMenuItemOpen, trueblnr); + G_CALLBACK(do_open_item), NULL, kStrMenuItemOpen, true); the_item = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(the_menu), the_item); AppendConvertMenuItem(the_menu, - G_CALLBACK(do_quit_item), NULL, kStrMenuItemQuit, falseblnr); + G_CALLBACK(do_quit_item), NULL, kStrMenuItemQuit, false); AppendSubmenuConvertName(menubar, the_menu, kStrMenuFile); the_menu = gtk_menu_new(); AppendConvertMenuItem(the_menu, G_CALLBACK(do_more_commands_item), - NULL, kStrMenuItemMore, trueblnr); + NULL, kStrMenuItemMore, true); AppendSubmenuConvertName(menubar, the_menu, kStrMenuSpecial); the_menu = gtk_menu_new(); AppendConvertMenuItem(the_menu, - G_CALLBACK(do_about_item), NULL, kStrMenuItemAbout, trueblnr); + G_CALLBACK(do_about_item), NULL, kStrMenuItemAbout, true); AppendSubmenuConvertName(menubar, the_menu, kStrMenuHelp); @@ -1748,8 +1748,8 @@ int main(int argc, char *argv[]) g_idle_add(MainEventLoop0, NULL); - my_argc = argc; - my_argv = argv; + argc = argc; + argv = argv; ZapOSGLUVars(); if (InitOSGLU()) { diff --git a/src/UI/XPLAT/OSGLUSD2.c b/src/UI/XPLAT/OSGLUSD2.c index 3fdeb81..c60bf63 100644 --- a/src/UI/XPLAT/OSGLUSD2.c +++ b/src/UI/XPLAT/OSGLUSD2.c @@ -111,10 +111,10 @@ LOCALPROC MayFree(char *p) LOCALVAR FILE *dbglog_File = NULL; #endif -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { #if dbglog_ToStdErr || dbglog_ToSDL_Log - return trueblnr; + return true; #else if (NULL == app_parent) { dbglog_File = fopen("dbglog.txt", "w"); @@ -241,7 +241,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -285,7 +285,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) return err; /*& figure out what really to return &*/ } -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { FilePtr refnum = Drives[Drive_No]; @@ -299,7 +299,7 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } LOCALPROC UnInitDrives(void) @@ -313,15 +313,15 @@ LOCALPROC UnInitDrives(void) } } -LOCALFUNC blnr Sony_Insert0(FilePtr refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(FilePtr refnum, bool locked, char *drivepath) { tDrive Drive_No; - blnr IsOk = falseblnr; + bool IsOk = false; if (! FirstFreeDisk(&Drive_No)) { MacMsg(kStrTooManyImagesTitle, kStrTooManyImagesMessage, - falseblnr); + false); } else { /* printf("Sony_Insert0 %d\n", (int)Drive_No); */ @@ -329,7 +329,7 @@ LOCALFUNC blnr Sony_Insert0(FilePtr refnum, blnr locked, Drives[Drive_No] = refnum; DiskInsertNotify(Drive_No, locked); - IsOk = trueblnr; + IsOk = true; } } @@ -340,23 +340,23 @@ LOCALFUNC blnr Sony_Insert0(FilePtr refnum, blnr locked, return IsOk; } -LOCALFUNC blnr Sony_Insert1(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1(char *drivepath, bool silentfail) { - blnr locked = falseblnr; + bool locked = false; /* printf("Sony_Insert1 %s\n", drivepath); */ FilePtr refnum = FileOpen(drivepath, "rb+"); if (NULL == refnum) { - locked = trueblnr; + locked = true; refnum = FileOpen(drivepath, "rb"); } if (NULL == refnum) { if (! silentfail) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } else { return Sony_Insert0(refnum, locked, drivepath); } - return falseblnr; + return false; } LOCALFUNC tMacErr LoadMacRomFrom(char *path) @@ -394,9 +394,9 @@ LOCALFUNC tMacErr LoadMacRomFrom(char *path) return err; } -LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1a(char *drivepath, bool silentfail) { - blnr v; + bool v; if (! ROM_loaded) { v = (mnvm_noErr == LoadMacRomFrom(drivepath)); @@ -407,22 +407,22 @@ LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) return v; } -LOCALFUNC blnr Sony_Insert2(char *s) +LOCALFUNC bool Sony_Insert2(char *s) { char *d = #if CanGetAppPath (NULL == d_arg) ? app_parent : #endif d_arg; - blnr IsOk = falseblnr; + bool IsOk = false; if (NULL == d) { - IsOk = Sony_Insert1(s, trueblnr); + IsOk = Sony_Insert1(s, true); } else { char *t; if (mnvm_noErr == ChildPath(d, s, &t)) { - IsOk = Sony_Insert1(t, trueblnr); + IsOk = Sony_Insert1(t, true); free(t); } } @@ -430,12 +430,12 @@ LOCALFUNC blnr Sony_Insert2(char *s) return IsOk; } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; @@ -447,7 +447,7 @@ LOCALFUNC blnr Sony_InsertIth(int i) return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { if (! AnyDiskInserted()) { int i; @@ -457,7 +457,7 @@ LOCALFUNC blnr LoadInitialImages(void) } } - return trueblnr; + return true; } /* --- ROM --- */ @@ -520,7 +520,7 @@ LOCALFUNC tMacErr LoadMacRomFromAppPar(void) } #endif -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -534,7 +534,7 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } /* --- video out --- */ @@ -545,20 +545,20 @@ LOCALVAR int vOffset; #endif #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif #ifndef UseSDLscaling #define UseSDLscaling 0 #endif -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool gTrueBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; #if EnableMagnify && ! UseSDLscaling #define MaxScale WindowScale @@ -567,14 +567,14 @@ LOCALVAR blnr CurSpeedStopped = trueblnr; #endif -LOCALVAR SDL_Window *my_main_wind = NULL; -LOCALVAR SDL_Renderer *my_renderer = NULL; -LOCALVAR SDL_Texture *my_texture = NULL; -LOCALVAR SDL_PixelFormat *my_format = NULL; +LOCALVAR SDL_Window *main_wind = NULL; +LOCALVAR SDL_Renderer *renderer = NULL; +LOCALVAR SDL_Texture *texture = NULL; +LOCALVAR SDL_PixelFormat *format = NULL; -LOCALVAR ui3p ScalingBuff = nullpr; +LOCALVAR uint8_t * ScalingBuff = nullpr; -LOCALVAR ui3p CLUT_final; +LOCALVAR uint8_t * CLUT_final; #define CLUT_finalsz (256 * 8 * 4 * MaxScale) /* @@ -808,13 +808,13 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } #endif - if (0 != SDL_LockTexture(my_texture, NULL, &pixels, &pitch)) { + if (0 != SDL_LockTexture(texture, NULL, &pixels, &pitch)) { return; } { - int bpp = my_format->BytesPerPixel; + int bpp = format->BytesPerPixel; uint32_t ExpectedPitch = vMacScreenWidth * bpp; #if EnableMagnify && ! UseSDLscaling @@ -827,7 +827,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, if (UseColorMode) { #if vMacScreenDepth < 4 for (i = 0; i < CLUT_size; ++i) { - CLUT_pixel[i] = SDL_MapRGB(my_format, + CLUT_pixel[i] = SDL_MapRGB(format, CLUT_reds[i] >> 8, CLUT_greens[i] >> 8, CLUT_blues[i] >> 8); @@ -836,9 +836,9 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } else #endif { - BWLUT_pixel[1] = SDL_MapRGB(my_format, 0, 0, 0); + BWLUT_pixel[1] = SDL_MapRGB(format, 0, 0, 0); /* black */ - BWLUT_pixel[0] = SDL_MapRGB(my_format, 255, 255, 255); + BWLUT_pixel[0] = SDL_MapRGB(format, 255, 255, 255); /* white */ } @@ -901,7 +901,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } } - ScalingBuff = (ui3p)pixels; + ScalingBuff = (uint8_t *)pixels; #if (0 != vMacScreenDepth) && (vMacScreenDepth < 4) if (UseColorMode) { @@ -1007,7 +1007,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, p = the_data + ((i0 * vMacScreenWidth + j0) << 1); { uint16_t t0 = do_get_mem_word(p); - pixel = SDL_MapRGB(my_format, + pixel = SDL_MapRGB(format, ((t0 & 0x7C00) >> 7) | ((t0 & 0x7000) >> 12), ((t0 & 0x03E0) >> 2) @@ -1017,7 +1017,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } #elif 5 == vMacScreenDepth p = the_data + ((i0 * vMacScreenWidth + j0) << 2); - pixel = SDL_MapRGB(my_format, + pixel = SDL_MapRGB(format, p[1], p[2], p[3]); @@ -1058,7 +1058,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } - SDL_UnlockTexture(my_texture); + SDL_UnlockTexture(texture); src_rect.x = left2; src_rect.y = top2; @@ -1070,9 +1070,9 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, dst_rect.w = DestWidth; dst_rect.h = DestHeight; - /* SDL_RenderClear(my_renderer); */ - SDL_RenderCopy(my_renderer, my_texture, &src_rect, &dst_rect); - SDL_RenderPresent(my_renderer); + /* SDL_RenderClear(renderer); */ + SDL_RenderCopy(renderer, texture, &src_rect, &dst_rect); + SDL_RenderPresent(renderer); #if MayFullScreen label_exit: @@ -1103,13 +1103,13 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void) /* cursor hiding */ -LOCALVAR blnr HaveCursorHidden = falseblnr; -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; +LOCALVAR bool WantCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; (void) SDL_ShowCursor(SDL_ENABLE); } } @@ -1121,7 +1121,7 @@ LOCALPROC ForceShowCursor(void) #endif #if EnableMoveMouse && HaveWorkingWarp -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { #if VarFullScreen if (UseFullScreen) @@ -1150,9 +1150,9 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) } #endif - SDL_WarpMouseInWindow(my_main_wind, h, v); + SDL_WarpMouseInWindow(main_wind, h, v); - return trueblnr; + return true; } #endif @@ -1160,7 +1160,7 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if VarFullScreen if (UseFullScreen) @@ -1200,17 +1200,17 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { if (NewMousePosh < 0) { NewMousePosh = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosh >= vMacScreenWidth) { NewMousePosh = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePosv < 0) { NewMousePosv = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosv >= vMacScreenHeight) { NewMousePosv = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } #if VarFullScreen @@ -1218,7 +1218,7 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) #endif #if MayFullScreen { - ShouldHaveCursorHidden = trueblnr; + ShouldHaveCursorHidden = true; } #endif @@ -1236,7 +1236,7 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) #if EnableFSMouseMotion && ! HaveWorkingWarp LOCALPROC MousePositionNotifyRelative(int deltah, int deltav) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if EnableMagnify if (UseMagnify) { @@ -1419,7 +1419,7 @@ LOCALFUNC uint8_t SDLScan2MacKeyCode(SDL_Scancode i) return v; } -LOCALPROC DoKeyCode(SDL_Keysym *r, blnr down) +LOCALPROC DoKeyCode(SDL_Keysym *r, bool down) { uint8_t v = SDLScan2MacKeyCode(r->scancode); if (MKC_None != v) { @@ -1442,7 +1442,7 @@ LOCALPROC ReconnectKeyCodes3(void) LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - MouseButtonSet(falseblnr); + MouseButtonSet(false); } /* --- time, date, location --- */ @@ -1477,7 +1477,7 @@ LOCALPROC InitNextTime(void) LOCALVAR uint32_t NewMacDateInSeconds; -LOCALFUNC blnr UpdateTrueEmulatedTime(void) +LOCALFUNC bool UpdateTrueEmulatedTime(void) { Uint32 LatestTime; int32_t TimeDiff; @@ -1508,7 +1508,7 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void) TimeDiff = (LatestTime - NextIntTime); } while (TimeDiff >= 0); } - return trueblnr; + return true; } else { if (TimeDiff < -256) { #if dbglog_TimeStuff @@ -1519,17 +1519,17 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void) } } } - return falseblnr; + return false; } -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { if (CurMacDateInSeconds != NewMacDateInSeconds) { CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } @@ -1539,14 +1539,14 @@ LOCALPROC StartUpTimeAdjust(void) InitNextTime(); } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { LastTime = SDL_GetTicks(); InitNextTime(); NewMacDateInSeconds = LastTime / 1000; CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } /* --- sound --- */ @@ -1665,20 +1665,20 @@ LOCALPROC Sound_WroteABlock(void) #endif } -LOCALFUNC blnr Sound_EndWrite0(uint16_t actL) +LOCALFUNC bool Sound_EndWrite0(uint16_t actL) { - blnr v; + bool v; TheWriteOffset += actL; if (0 != (TheWriteOffset & kOneBuffMask)) { - v = falseblnr; + v = false; } else { /* just finished a block */ Sound_WroteABlock(); - v = trueblnr; + v = true; } return v; @@ -1773,12 +1773,12 @@ struct SoundR { volatile trSoundTemp lastv; - blnr wantplaying; - blnr HaveStartedPlaying; + bool wantplaying; + bool HaveStartedPlaying; }; typedef struct SoundR SoundR; -static void my_audio_callback(void *udata, Uint8 *stream, int len) +static void audio_callback(void *udata, Uint8 *stream, int len) { uint16_t ToPlayLen; uint16_t FilledSoundBuffs; @@ -1795,7 +1795,7 @@ static void my_audio_callback(void *udata, Uint8 *stream, int len) #endif #if dbglog_SoundStuff - dbglog_writeln("Enter my_audio_callback"); + dbglog_writeln("Enter audio_callback"); dbglog_writelnNum("len", len); #endif @@ -1834,7 +1834,7 @@ label_retry: dbglog_writeln("finished start transition"); #endif - datp->HaveStartedPlaying = trueblnr; + datp->HaveStartedPlaying = true; } } } @@ -1886,7 +1886,7 @@ label_retry: LOCALVAR SoundR cur_audio; -LOCALVAR blnr HaveSoundOut = falseblnr; +LOCALVAR bool HaveSoundOut = false; LOCALPROC Sound_Stop(void) { @@ -1897,7 +1897,7 @@ LOCALPROC Sound_Stop(void) if (cur_audio.wantplaying && HaveSoundOut) { uint16_t retry_limit = 50; /* half of a second */ - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; label_retry: if (kCenterTempSound == cur_audio.lastv) { @@ -1940,8 +1940,8 @@ LOCALPROC Sound_Start(void) if ((! cur_audio.wantplaying) && HaveSoundOut) { Sound_Start0(); cur_audio.lastv = kCenterTempSound; - cur_audio.HaveStartedPlaying = falseblnr; - cur_audio.wantplaying = trueblnr; + cur_audio.HaveStartedPlaying = false; + cur_audio.wantplaying = true; SDL_PauseAudio(0); } @@ -1956,7 +1956,7 @@ LOCALPROC Sound_UnInit(void) #define SOUND_SAMPLERATE 22255 /* = round(7833600 * 2 / 704) */ -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { SDL_AudioSpec desired; @@ -1966,7 +1966,7 @@ LOCALFUNC blnr Sound_Init(void) cur_audio.fPlayOffset = &ThePlayOffset; cur_audio.fFillOffset = &TheFillOffset; cur_audio.fMinFilledSoundBuffs = &MinFilledSoundBuffs; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; desired.freq = SOUND_SAMPLERATE; @@ -1980,14 +1980,14 @@ LOCALFUNC blnr Sound_Init(void) desired.channels = 1; desired.samples = 1024; - desired.callback = my_audio_callback; + desired.callback = audio_callback; desired.userdata = (void *)&cur_audio; /* Open the audio device */ if (SDL_OpenAudio(&desired, NULL) < 0) { fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); } else { - HaveSoundOut = trueblnr; + HaveSoundOut = true; Sound_Start(); /* @@ -1997,7 +1997,7 @@ LOCALFUNC blnr Sound_Init(void) */ } - return trueblnr; /* keep going, even if no sound */ + return true; /* keep going, even if no sound */ } GLOBALOSGLUPROC Sound_EndWrite(uint16_t actL) @@ -2032,7 +2032,7 @@ LOCALPROC CheckSavedMacMsg(void) SDL_MESSAGEBOX_ERROR, SavedBriefMsg, SavedLongMsg, - my_main_wind + main_wind )) { fprintf(stderr, "%s\n", briefMsg0); @@ -2607,7 +2607,7 @@ GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i) { tMacErr err; char *p; - ui3p s = PbufDat[i]; + uint8_t * s = PbufDat[i]; uimr L = PbufSize[i]; uimr sz = MacRoman2UniCodeSize(s, L); @@ -3098,14 +3098,14 @@ GLOBALOSGLUFUNC tMacErr HTCEimport(tPbuf *r) #define UseMotionEvents 1 #if UseMotionEvents -LOCALVAR blnr CaughtMouse = falseblnr; +LOCALVAR bool CaughtMouse = false; #endif LOCALPROC HandleTheEvent(SDL_Event *event) { switch (event->type) { case SDL_QUIT: - RequestMacOff = trueblnr; + RequestMacOff = true; break; case SDL_WINDOWEVENT: switch (event->window.event) { @@ -3146,7 +3146,7 @@ LOCALPROC HandleTheEvent(SDL_Event *event) MousePositionNotify( event->button.x, event->button.y); } - MouseButtonSet(trueblnr); + MouseButtonSet(true); break; case SDL_MOUSEBUTTONUP: #if EnableFSMouseMotion && ! HaveWorkingWarp @@ -3158,36 +3158,36 @@ LOCALPROC HandleTheEvent(SDL_Event *event) MousePositionNotify( event->button.x, event->button.y); } - MouseButtonSet(falseblnr); + MouseButtonSet(false); break; case SDL_KEYDOWN: - DoKeyCode(&event->key.keysym, trueblnr); + DoKeyCode(&event->key.keysym, true); break; case SDL_KEYUP: - DoKeyCode(&event->key.keysym, falseblnr); + DoKeyCode(&event->key.keysym, false); break; case SDL_MOUSEWHEEL: if (event->wheel.x < 0) { - Keyboard_UpdateKeyMap2(MKC_Left, trueblnr); - Keyboard_UpdateKeyMap2(MKC_Left, falseblnr); + Keyboard_UpdateKeyMap2(MKC_Left, true); + Keyboard_UpdateKeyMap2(MKC_Left, false); } else if (event->wheel.x > 0) { - Keyboard_UpdateKeyMap2(MKC_Right, trueblnr); - Keyboard_UpdateKeyMap2(MKC_Right, falseblnr); + Keyboard_UpdateKeyMap2(MKC_Right, true); + Keyboard_UpdateKeyMap2(MKC_Right, false); } if (event->wheel.y < 0) { - Keyboard_UpdateKeyMap2(MKC_Down, trueblnr); - Keyboard_UpdateKeyMap2(MKC_Down, falseblnr); + Keyboard_UpdateKeyMap2(MKC_Down, true); + Keyboard_UpdateKeyMap2(MKC_Down, false); } else if(event->wheel.y > 0) { - Keyboard_UpdateKeyMap2(MKC_Up, trueblnr); - Keyboard_UpdateKeyMap2(MKC_Up, falseblnr); + Keyboard_UpdateKeyMap2(MKC_Up, true); + Keyboard_UpdateKeyMap2(MKC_Up, false); } break; case SDL_DROPFILE: { char *s = event->drop.file; - (void) Sony_Insert1a(s, falseblnr); - SDL_RaiseWindow(my_main_wind); + (void) Sony_Insert1a(s, false); + SDL_RaiseWindow(main_wind); SDL_free(s); } break; @@ -3220,12 +3220,12 @@ LOCALPROC HandleTheEvent(SDL_Event *event) /* --- main window creation and disposal --- */ -LOCALVAR int my_argc; -LOCALVAR char **my_argv; +LOCALVAR int argc; +LOCALVAR char **argv; -LOCALFUNC blnr Screen_Init(void) +LOCALFUNC bool Screen_Init(void) { - blnr v = falseblnr; + bool v = false; InitKeyCodes(); @@ -3233,21 +3233,21 @@ LOCALFUNC blnr Screen_Init(void) { fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); } else { - v = trueblnr; + v = true; } return v; } #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if MayFullScreen LOCALPROC GrabTheMachine(void) { #if GrabKeysFullScreen - SDL_SetWindowGrab(my_main_wind, SDL_TRUE); + SDL_SetWindowGrab(main_wind, SDL_TRUE); #endif #if EnableFSMouseMotion @@ -3262,11 +3262,11 @@ LOCALPROC GrabTheMachine(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } #else if (0 == SDL_SetRelativeMouseMode(SDL_ENABLE)) { - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } #endif @@ -3286,13 +3286,13 @@ LOCALPROC UngrabMachine(void) SDL_SetRelativeMouseMode(SDL_DISABLE); #endif - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } #endif /* EnableFSMouseMotion */ #if GrabKeysFullScreen - SDL_SetWindowGrab(my_main_wind, SDL_FALSE); + SDL_SetWindowGrab(main_wind, SDL_FALSE); #endif } #endif @@ -3321,7 +3321,7 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } @@ -3339,19 +3339,19 @@ enum { #if MayNotFullScreen LOCALVAR int CurWinIndx; -LOCALVAR blnr HavePositionWins[kNumMagStates]; +LOCALVAR bool HavePositionWins[kNumMagStates]; LOCALVAR int WinPositionsX[kNumMagStates]; LOCALVAR int WinPositionsY[kNumMagStates]; #endif -LOCALFUNC blnr CreateMainWindow(void) +LOCALFUNC bool CreateMainWindow(void) { int NewWindowX; int NewWindowY; int NewWindowHeight = vMacScreenHeight; int NewWindowWidth = vMacScreenWidth; Uint32 flags = 0 /* SDL_WINDOW_HIDDEN */; - blnr v = falseblnr; + bool v = false; #if EnableMagnify && 1 if (UseMagnify) { @@ -3407,7 +3407,7 @@ LOCALFUNC blnr CreateMainWindow(void) SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); #endif - if (NULL == (my_main_wind = SDL_CreateWindow( + if (NULL == (main_wind = SDL_CreateWindow( (NULL != n_arg) ? n_arg : kStrAppName, NewWindowX, NewWindowY, NewWindowWidth, NewWindowHeight, @@ -3416,8 +3416,8 @@ LOCALFUNC blnr CreateMainWindow(void) fprintf(stderr, "SDL_CreateWindow fails: %s\n", SDL_GetError()); } else - if (NULL == (my_renderer = SDL_CreateRenderer( - my_main_wind, -1, + if (NULL == (renderer = SDL_CreateRenderer( + main_wind, -1, 0 /* SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC */ /* SDL_RENDERER_ACCELERATED not needed @@ -3430,8 +3430,8 @@ LOCALFUNC blnr CreateMainWindow(void) fprintf(stderr, "SDL_CreateRenderer fails: %s\n", SDL_GetError()); } else - if (NULL == (my_texture = SDL_CreateTexture( - my_renderer, + if (NULL == (texture = SDL_CreateTexture( + renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, #if UseSDLscaling @@ -3444,15 +3444,15 @@ LOCALFUNC blnr CreateMainWindow(void) fprintf(stderr, "SDL_CreateTexture fails: %s\n", SDL_GetError()); } else - if (NULL == (my_format = SDL_AllocFormat(SDL_PIXELFORMAT_ARGB8888))) + if (NULL == (format = SDL_AllocFormat(SDL_PIXELFORMAT_ARGB8888))) { fprintf(stderr, "SDL_AllocFormat fails: %s\n", SDL_GetError()); } else { - /* SDL_ShowWindow(my_main_wind); */ + /* SDL_ShowWindow(main_wind); */ - SDL_RenderClear(my_renderer); + SDL_RenderClear(renderer); #if 0 SDL_DisplayMode info; @@ -3461,7 +3461,7 @@ LOCALFUNC blnr CreateMainWindow(void) fprintf(stderr, "SDL_GetCurrentDisplayMode fails: %s\n", SDL_GetError()); - return falseblnr; + return false; } #endif @@ -3473,7 +3473,7 @@ LOCALFUNC blnr CreateMainWindow(void) int wr; int hr; - SDL_GL_GetDrawableSize(my_main_wind, &wr, &hr); + SDL_GL_GetDrawableSize(main_wind, &wr, &hr); ViewHSize = wr; ViewVSize = hr; @@ -3510,10 +3510,10 @@ LOCALFUNC blnr CreateMainWindow(void) #endif #if 0 != vMacScreenDepth - ColorModeWorks = trueblnr; + ColorModeWorks = true; #endif - v = trueblnr; + v = true; } return v; @@ -3521,34 +3521,34 @@ LOCALFUNC blnr CreateMainWindow(void) LOCALPROC CloseMainWindow(void) { - if (NULL != my_format) { - SDL_FreeFormat(my_format); - my_format = NULL; + if (NULL != format) { + SDL_FreeFormat(format); + format = NULL; } - if (NULL != my_texture) { - SDL_DestroyTexture(my_texture); - my_texture = NULL; + if (NULL != texture) { + SDL_DestroyTexture(texture); + texture = NULL; } - if (NULL != my_renderer) { - SDL_DestroyRenderer(my_renderer); - my_renderer = NULL; + if (NULL != renderer) { + SDL_DestroyRenderer(renderer); + renderer = NULL; } - if (NULL != my_main_wind) { - SDL_DestroyWindow(my_main_wind); - my_main_wind = NULL; + if (NULL != main_wind) { + SDL_DestroyWindow(main_wind); + main_wind = NULL; } } #if EnableRecreateW LOCALPROC ZapWState(void) { - my_main_wind = NULL; - my_renderer = NULL; - my_texture = NULL; - my_format = NULL; + main_wind = NULL; + renderer = NULL; + texture = NULL; + format = NULL; } #endif @@ -3563,18 +3563,18 @@ struct WState { int f_vOffset; #endif #if VarFullScreen - blnr f_UseFullScreen; + bool f_UseFullScreen; #endif #if EnableMagnify - blnr f_UseMagnify; + bool f_UseMagnify; #endif #if MayNotFullScreen int f_CurWinIndx; #endif - SDL_Window *f_my_main_wind; - SDL_Renderer *f_my_renderer; - SDL_Texture *f_my_texture; - SDL_PixelFormat *f_my_format; + SDL_Window *f_main_wind; + SDL_Renderer *f_renderer; + SDL_Texture *f_texture; + SDL_PixelFormat *f_format; }; typedef struct WState WState; #endif @@ -3599,10 +3599,10 @@ LOCALPROC GetWState(WState *r) #if MayNotFullScreen r->f_CurWinIndx = CurWinIndx; #endif - r->f_my_main_wind = my_main_wind; - r->f_my_renderer = my_renderer; - r->f_my_texture = my_texture; - r->f_my_format = my_format; + r->f_main_wind = main_wind; + r->f_renderer = renderer; + r->f_texture = texture; + r->f_format = format; } #endif @@ -3626,10 +3626,10 @@ LOCALPROC SetWState(WState *r) #if MayNotFullScreen CurWinIndx = r->f_CurWinIndx; #endif - my_main_wind = r->f_my_main_wind; - my_renderer = r->f_my_renderer; - my_texture = r->f_my_texture; - my_format = r->f_my_format; + main_wind = r->f_main_wind; + renderer = r->f_renderer; + texture = r->f_texture; + format = r->f_format; } #endif @@ -3648,12 +3648,12 @@ LOCALVAR int WinMagStates[kNumWinStates]; #endif #if EnableRecreateW -LOCALFUNC blnr ReCreateMainWindow(void) +LOCALFUNC bool ReCreateMainWindow(void) { WState old_state; WState new_state; #if HaveWorkingWarp - blnr HadCursorHidden = HaveCursorHidden; + bool HadCursorHidden = HaveCursorHidden; #endif #if VarFullScreen && EnableMagnify int OldWinState = @@ -3670,10 +3670,10 @@ LOCALFUNC blnr ReCreateMainWindow(void) #endif #if MayNotFullScreen { - SDL_GetWindowPosition(my_main_wind, + SDL_GetWindowPosition(main_wind, &WinPositionsX[CurWinIndx], &WinPositionsY[CurWinIndx]); - HavePositionWins[CurWinIndx] = trueblnr; + HavePositionWins[CurWinIndx] = true; } #endif @@ -3681,7 +3681,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) #if MayFullScreen if (GrabMachine) { - GrabMachine = falseblnr; + GrabMachine = false; UngrabMachine(); } #endif @@ -3722,7 +3722,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) #endif } - return trueblnr; + return true; } #endif @@ -3733,7 +3733,7 @@ LOCALPROC ZapWinStateVars(void) int i; for (i = 0; i < kNumMagStates; ++i) { - HavePositionWins[i] = falseblnr; + HavePositionWins[i] = false; } } #endif @@ -3767,7 +3767,7 @@ LOCALPROC ToggleWantFullScreen(void) if (kMagStateAuto != NewMagState) { WantMagnify = (kMagStateMagnifgy == NewMagState); } else { - WantMagnify = falseblnr; + WantMagnify = false; if (WantFullScreen) { SDL_Rect r; @@ -3776,7 +3776,7 @@ LOCALPROC ToggleWantFullScreen(void) && (r.h >= vMacScreenHeight * WindowScale) ) { - WantMagnify = trueblnr; + WantMagnify = true; } } } @@ -3821,7 +3821,7 @@ LOCALPROC EnterSpeedStopped(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); @@ -3834,12 +3834,12 @@ LOCALPROC CheckForSavedTasks(void) #endif if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -3906,7 +3906,7 @@ LOCALPROC CheckForSavedTasks(void) #endif if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -3928,34 +3928,34 @@ LOCALPROC CheckForSavedTasks(void) /* --- command line parsing --- */ -LOCALFUNC blnr ScanCommandLine(void) +LOCALFUNC bool ScanCommandLine(void) { char *pa; int i = 1; label_retry: - if (i < my_argc) { - pa = my_argv[i++]; + if (i < argc) { + pa = argv[i++]; if ('-' == pa[0]) { if ((0 == strcmp(pa, "--rom")) || (0 == strcmp(pa, "-r"))) { - if (i < my_argc) { - rom_path = my_argv[i++]; + if (i < argc) { + rom_path = argv[i++]; goto label_retry; } } else if (0 == strcmp(pa, "-n")) { - if (i < my_argc) { - n_arg = my_argv[i++]; + if (i < argc) { + n_arg = argv[i++]; goto label_retry; } } else if (0 == strcmp(pa, "-d")) { - if (i < my_argc) { - d_arg = my_argv[i++]; + if (i < argc) { + d_arg = argv[i++]; goto label_retry; } } else @@ -3965,24 +3965,24 @@ label_retry: goto label_retry; } else { - MacMsg(kStrBadArgTitle, kStrBadArgMessage, falseblnr); + MacMsg(kStrBadArgTitle, kStrBadArgMessage, false); #if dbglog_HAVE dbglog_writeln("bad command line argument"); dbglog_writeln(pa); #endif } } else { - (void) Sony_Insert1(pa, falseblnr); + (void) Sony_Insert1(pa, false); goto label_retry; } } - return trueblnr; + return true; } /* --- main program flow --- */ -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -4065,43 +4065,43 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif - ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, falseblnr); + ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, false); #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -4116,13 +4116,13 @@ LOCALPROC UnallocMemory(void) } #if CanGetAppPath -LOCALFUNC blnr InitWhereAmI(void) +LOCALFUNC bool InitWhereAmI(void) { app_parent = SDL_GetBasePath(); pref_dir = SDL_GetPrefPath("gryphel", "minivmac"); - return trueblnr; /* keep going regardless */ + return true; /* keep going regardless */ } #endif @@ -4135,7 +4135,7 @@ LOCALPROC UninitWhereAmI(void) } #endif -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { if (AllocMemory()) #if CanGetAppPath @@ -4155,9 +4155,9 @@ LOCALFUNC blnr InitOSGLU(void) if (CreateMainWindow()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) @@ -4201,8 +4201,8 @@ LOCALPROC UnInitOSGLU(void) int main(int argc, char **argv) { - my_argc = argc; - my_argv = argv; + argc = argc; + argv = argv; ZapOSGLUVars(); if (InitOSGLU()) { diff --git a/src/UI/XPLAT/OSGLUSDL.c b/src/UI/XPLAT/OSGLUSDL.c index 04f42b8..d8a921b 100644 --- a/src/UI/XPLAT/OSGLUSDL.c +++ b/src/UI/XPLAT/OSGLUSDL.c @@ -52,10 +52,10 @@ GLOBALOSGLUPROC MoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount) LOCALVAR FILE *dbglog_File = NULL; #endif -LOCALFUNC blnr dbglog_open0(void) +LOCALFUNC bool dbglog_open0(void) { #if dbglog_ToStdErr - return trueblnr; + return true; #else dbglog_File = fopen("dbglog.txt", "w"); return (NULL != dbglog_File); @@ -131,7 +131,7 @@ LOCALPROC InitDrives(void) } } -GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, +GLOBALOSGLUFUNC tMacErr vSonyTransfer(bool IsWrite, uint8_t * Buffer, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -175,7 +175,7 @@ GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count) return err; /*& figure out what really to return &*/ } -LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) +LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, bool deleteit) { FILE *refnum = Drives[Drive_No]; @@ -189,7 +189,7 @@ LOCALFUNC tMacErr vSonyEject0(tDrive Drive_No, blnr deleteit) GLOBALOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No) { - return vSonyEject0(Drive_No, falseblnr); + return vSonyEject0(Drive_No, false); } LOCALPROC UnInitDrives(void) @@ -203,15 +203,15 @@ LOCALPROC UnInitDrives(void) } } -LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, +LOCALFUNC bool Sony_Insert0(FILE *refnum, bool locked, char *drivepath) { tDrive Drive_No; - blnr IsOk = falseblnr; + bool IsOk = false; if (! FirstFreeDisk(&Drive_No)) { MacMsg(kStrTooManyImagesTitle, kStrTooManyImagesMessage, - falseblnr); + false); } else { /* printf("Sony_Insert0 %d\n", (int)Drive_No); */ @@ -219,7 +219,7 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, Drives[Drive_No] = refnum; DiskInsertNotify(Drive_No, locked); - IsOk = trueblnr; + IsOk = true; } } @@ -230,23 +230,23 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked, return IsOk; } -LOCALFUNC blnr Sony_Insert1(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1(char *drivepath, bool silentfail) { - blnr locked = falseblnr; + bool locked = false; /* printf("Sony_Insert1 %s\n", drivepath); */ FILE *refnum = fopen(drivepath, "rb+"); if (NULL == refnum) { - locked = trueblnr; + locked = true; refnum = fopen(drivepath, "rb"); } if (NULL == refnum) { if (! silentfail) { - MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, falseblnr); + MacMsg(kStrOpenFailTitle, kStrOpenFailMessage, false); } } else { return Sony_Insert0(refnum, locked, drivepath); } - return falseblnr; + return false; } LOCALFUNC tMacErr LoadMacRomFrom(char *path) @@ -280,9 +280,9 @@ LOCALFUNC tMacErr LoadMacRomFrom(char *path) } #if 0 /* no drag and drop to make use of this */ -LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) +LOCALFUNC bool Sony_Insert1a(char *drivepath, bool silentfail) { - blnr v; + bool v; if (! ROM_loaded) { v = (mnvm_noErr == LoadMacRomFrom(drivepath)); @@ -294,17 +294,17 @@ LOCALFUNC blnr Sony_Insert1a(char *drivepath, blnr silentfail) } #endif -LOCALFUNC blnr Sony_Insert2(char *s) +LOCALFUNC bool Sony_Insert2(char *s) { - return Sony_Insert1(s, trueblnr); + return Sony_Insert1(s, true); } -LOCALFUNC blnr Sony_InsertIth(int i) +LOCALFUNC bool Sony_InsertIth(int i) { - blnr v; + bool v; if ((i > 9) || ! FirstFreeDisk(nullpr)) { - v = falseblnr; + v = false; } else { char s[] = "disk?.dsk"; @@ -316,7 +316,7 @@ LOCALFUNC blnr Sony_InsertIth(int i) return v; } -LOCALFUNC blnr LoadInitialImages(void) +LOCALFUNC bool LoadInitialImages(void) { if (! AnyDiskInserted()) { int i; @@ -326,14 +326,14 @@ LOCALFUNC blnr LoadInitialImages(void) } } - return trueblnr; + return true; } /* --- ROM --- */ LOCALVAR char *rom_path = NULL; -LOCALFUNC blnr LoadMacRom(void) +LOCALFUNC bool LoadMacRom(void) { tMacErr err; @@ -343,22 +343,22 @@ LOCALFUNC blnr LoadMacRom(void) { } - return trueblnr; /* keep launching Mini vMac, regardless */ + return true; /* keep launching Mini vMac, regardless */ } /* --- video out --- */ #if VarFullScreen -LOCALVAR blnr UseFullScreen = (WantInitFullScreen != 0); +LOCALVAR bool UseFullScreen = (WantInitFullScreen != 0); #endif #if EnableMagnify -LOCALVAR blnr UseMagnify = (WantInitMagnify != 0); +LOCALVAR bool UseMagnify = (WantInitMagnify != 0); #endif -LOCALVAR blnr gBackgroundFlag = falseblnr; -LOCALVAR blnr gTrueBackgroundFlag = falseblnr; -LOCALVAR blnr CurSpeedStopped = trueblnr; +LOCALVAR bool gBackgroundFlag = false; +LOCALVAR bool gTrueBackgroundFlag = false; +LOCALVAR bool CurSpeedStopped = true; #if EnableMagnify #define MaxScale WindowScale @@ -367,11 +367,11 @@ LOCALVAR blnr CurSpeedStopped = trueblnr; #endif -LOCALVAR SDL_Surface *my_surface = nullpr; +LOCALVAR SDL_Surface *surface = nullpr; -LOCALVAR ui3p ScalingBuff = nullpr; +LOCALVAR uint8_t * ScalingBuff = nullpr; -LOCALVAR ui3p CLUT_final; +LOCALVAR uint8_t * CLUT_final; #define CLUT_finalsz (256 * 8 * 4 * MaxScale) /* @@ -526,15 +526,15 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } #endif - if (SDL_MUSTLOCK(my_surface)) { - if (SDL_LockSurface(my_surface) < 0) { + if (SDL_MUSTLOCK(surface)) { + if (SDL_LockSurface(surface) < 0) { return; } } { - int bpp = my_surface->format->BytesPerPixel; + int bpp = surface->format->BytesPerPixel; uint32_t ExpectedPitch = vMacScreenWidth * bpp; #if EnableMagnify @@ -547,7 +547,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, if (UseColorMode) { #if vMacScreenDepth < 4 for (i = 0; i < CLUT_size; ++i) { - CLUT_pixel[i] = SDL_MapRGB(my_surface->format, + CLUT_pixel[i] = SDL_MapRGB(surface->format, CLUT_reds[i] >> 8, CLUT_greens[i] >> 8, CLUT_blues[i] >> 8); @@ -556,14 +556,14 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } else #endif { - BWLUT_pixel[1] = SDL_MapRGB(my_surface->format, 0, 0, 0); + BWLUT_pixel[1] = SDL_MapRGB(surface->format, 0, 0, 0); /* black */ - BWLUT_pixel[0] = SDL_MapRGB(my_surface->format, 255, 255, 255); + BWLUT_pixel[0] = SDL_MapRGB(surface->format, 255, 255, 255); /* white */ } if ((0 == ((bpp - 1) & bpp)) /* a power of 2 */ - && (my_surface->pitch == ExpectedPitch) + && (surface->pitch == ExpectedPitch) #if (vMacScreenDepth > 3) && ! UseColorMode #endif @@ -621,7 +621,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } } - ScalingBuff = (ui3p)my_surface->pixels; + ScalingBuff = (uint8_t *)surface->pixels; #if (0 != vMacScreenDepth) && (vMacScreenDepth < 4) if (UseColorMode) { @@ -701,8 +701,8 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, for (j = left2; j < right2; ++j) { int i0 = i; int j0 = j; - Uint8 *bufp = (Uint8 *)my_surface->pixels - + i * my_surface->pitch + j * bpp; + Uint8 *bufp = (Uint8 *)surface->pixels + + i * surface->pitch + j * bpp; #if EnableMagnify if (UseMagnify) { @@ -727,7 +727,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, p = the_data + ((i0 * vMacScreenWidth + j0) << 1); { uint16_t t0 = do_get_mem_word(p); - pixel = SDL_MapRGB(my_surface->format, + pixel = SDL_MapRGB(surface->format, ((t0 & 0x7C00) >> 7) | ((t0 & 0x7000) >> 12), ((t0 & 0x03E0) >> 2) @@ -737,7 +737,7 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } #elif 5 == vMacScreenDepth p = the_data + ((i0 * vMacScreenWidth + j0) << 2); - pixel = SDL_MapRGB(my_surface->format, + pixel = SDL_MapRGB(surface->format, p[1], p[2], p[3]); @@ -778,11 +778,11 @@ LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left, } - if (SDL_MUSTLOCK(my_surface)) { - SDL_UnlockSurface(my_surface); + if (SDL_MUSTLOCK(surface)) { + SDL_UnlockSurface(surface); } - SDL_UpdateRect(my_surface, left2, top2, + SDL_UpdateRect(surface, left2, top2, right2 - left2, bottom2 - top2); } @@ -809,20 +809,20 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void) /* cursor hiding */ -LOCALVAR blnr HaveCursorHidden = falseblnr; -LOCALVAR blnr WantCursorHidden = falseblnr; +LOCALVAR bool HaveCursorHidden = false; +LOCALVAR bool WantCursorHidden = false; LOCALPROC ForceShowCursor(void) { if (HaveCursorHidden) { - HaveCursorHidden = falseblnr; + HaveCursorHidden = false; (void) SDL_ShowCursor(SDL_ENABLE); } } /* cursor moving */ -LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) +LOCALFUNC bool MoveMouse(int16_t h, int16_t v) { #if EnableMagnify if (UseMagnify) { @@ -833,14 +833,14 @@ LOCALFUNC blnr MoveMouse(int16_t h, int16_t v) SDL_WarpMouse(h, v); - return trueblnr; + return true; } /* cursor state */ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { - blnr ShouldHaveCursorHidden = trueblnr; + bool ShouldHaveCursorHidden = true; #if EnableMagnify if (UseMagnify) { @@ -860,17 +860,17 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) { if (NewMousePosh < 0) { NewMousePosh = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosh >= vMacScreenWidth) { NewMousePosh = vMacScreenWidth - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } if (NewMousePosv < 0) { NewMousePosv = 0; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } else if (NewMousePosv >= vMacScreenHeight) { NewMousePosv = vMacScreenHeight - 1; - ShouldHaveCursorHidden = falseblnr; + ShouldHaveCursorHidden = false; } #if VarFullScreen @@ -878,7 +878,7 @@ LOCALPROC MousePositionNotify(int NewMousePosh, int NewMousePosv) #endif #if MayFullScreen { - ShouldHaveCursorHidden = trueblnr; + ShouldHaveCursorHidden = true; } #endif @@ -1066,7 +1066,7 @@ LOCALFUNC uint8_t SDLKey2MacKeyCode(SDLKey i) return v; } -LOCALPROC DoKeyCode(SDL_keysym *r, blnr down) +LOCALPROC DoKeyCode(SDL_keysym *r, bool down) { uint8_t v = SDLKey2MacKeyCode(r->sym); if (MKC_None != v) { @@ -1089,7 +1089,7 @@ LOCALPROC ReconnectKeyCodes3(void) LOCALPROC DisconnectKeyCodes3(void) { DisconnectKeyCodes2(); - MouseButtonSet(falseblnr); + MouseButtonSet(false); } /* --- time, date, location --- */ @@ -1124,7 +1124,7 @@ LOCALPROC InitNextTime(void) LOCALVAR uint32_t NewMacDateInSeconds; -LOCALFUNC blnr UpdateTrueEmulatedTime(void) +LOCALFUNC bool UpdateTrueEmulatedTime(void) { Uint32 LatestTime; int32_t TimeDiff; @@ -1155,7 +1155,7 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void) TimeDiff = (LatestTime - NextIntTime); } while (TimeDiff >= 0); } - return trueblnr; + return true; } else { if (TimeDiff < -256) { #if dbglog_TimeStuff @@ -1166,17 +1166,17 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void) } } } - return falseblnr; + return false; } -LOCALFUNC blnr CheckDateTime(void) +LOCALFUNC bool CheckDateTime(void) { if (CurMacDateInSeconds != NewMacDateInSeconds) { CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } else { - return falseblnr; + return false; } } @@ -1186,14 +1186,14 @@ LOCALPROC StartUpTimeAdjust(void) InitNextTime(); } -LOCALFUNC blnr InitLocationDat(void) +LOCALFUNC bool InitLocationDat(void) { LastTime = SDL_GetTicks(); InitNextTime(); NewMacDateInSeconds = LastTime / 1000; CurMacDateInSeconds = NewMacDateInSeconds; - return trueblnr; + return true; } /* --- sound --- */ @@ -1312,20 +1312,20 @@ LOCALPROC Sound_WroteABlock(void) #endif } -LOCALFUNC blnr Sound_EndWrite0(uint16_t actL) +LOCALFUNC bool Sound_EndWrite0(uint16_t actL) { - blnr v; + bool v; TheWriteOffset += actL; if (0 != (TheWriteOffset & kOneBuffMask)) { - v = falseblnr; + v = false; } else { /* just finished a block */ Sound_WroteABlock(); - v = trueblnr; + v = true; } return v; @@ -1420,12 +1420,12 @@ struct SoundR { volatile trSoundTemp lastv; - blnr wantplaying; - blnr HaveStartedPlaying; + bool wantplaying; + bool HaveStartedPlaying; }; typedef struct SoundR SoundR; -static void my_audio_callback(void *udata, Uint8 *stream, int len) +static void audio_callback(void *udata, Uint8 *stream, int len) { uint16_t ToPlayLen; uint16_t FilledSoundBuffs; @@ -1442,7 +1442,7 @@ static void my_audio_callback(void *udata, Uint8 *stream, int len) #endif #if dbglog_SoundStuff - dbglog_writeln("Enter my_audio_callback"); + dbglog_writeln("Enter audio_callback"); dbglog_writelnNum("len", len); #endif @@ -1481,7 +1481,7 @@ label_retry: dbglog_writeln("finished start transition"); #endif - datp->HaveStartedPlaying = trueblnr; + datp->HaveStartedPlaying = true; } } } @@ -1533,7 +1533,7 @@ label_retry: LOCALVAR SoundR cur_audio; -LOCALVAR blnr HaveSoundOut = falseblnr; +LOCALVAR bool HaveSoundOut = false; LOCALPROC Sound_Stop(void) { @@ -1544,7 +1544,7 @@ LOCALPROC Sound_Stop(void) if (cur_audio.wantplaying && HaveSoundOut) { uint16_t retry_limit = 50; /* half of a second */ - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; label_retry: if (kCenterTempSound == cur_audio.lastv) { @@ -1587,8 +1587,8 @@ LOCALPROC Sound_Start(void) if ((! cur_audio.wantplaying) && HaveSoundOut) { Sound_Start0(); cur_audio.lastv = kCenterTempSound; - cur_audio.HaveStartedPlaying = falseblnr; - cur_audio.wantplaying = trueblnr; + cur_audio.HaveStartedPlaying = false; + cur_audio.wantplaying = true; SDL_PauseAudio(0); } @@ -1603,7 +1603,7 @@ LOCALPROC Sound_UnInit(void) #define SOUND_SAMPLERATE 22255 /* = round(7833600 * 2 / 704) */ -LOCALFUNC blnr Sound_Init(void) +LOCALFUNC bool Sound_Init(void) { SDL_AudioSpec desired; @@ -1613,7 +1613,7 @@ LOCALFUNC blnr Sound_Init(void) cur_audio.fPlayOffset = &ThePlayOffset; cur_audio.fFillOffset = &TheFillOffset; cur_audio.fMinFilledSoundBuffs = &MinFilledSoundBuffs; - cur_audio.wantplaying = falseblnr; + cur_audio.wantplaying = false; desired.freq = SOUND_SAMPLERATE; @@ -1627,14 +1627,14 @@ LOCALFUNC blnr Sound_Init(void) desired.channels = 1; desired.samples = 1024; - desired.callback = my_audio_callback; + desired.callback = audio_callback; desired.userdata = (void *)&cur_audio; /* Open the audio device */ if (SDL_OpenAudio(&desired, NULL) < 0) { fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); } else { - HaveSoundOut = trueblnr; + HaveSoundOut = true; Sound_Start(); /* @@ -1644,7 +1644,7 @@ LOCALFUNC blnr Sound_Init(void) */ } - return trueblnr; /* keep going, even if no sound */ + return true; /* keep going, even if no sound */ } GLOBALOSGLUPROC Sound_EndWrite(uint16_t actL) @@ -1687,7 +1687,7 @@ LOCALPROC CheckSavedMacMsg(void) #define UseMotionEvents 1 #if UseMotionEvents -LOCALVAR blnr CaughtMouse = falseblnr; +LOCALVAR bool CaughtMouse = false; #endif /* --- event handling for main window --- */ @@ -1696,7 +1696,7 @@ LOCALPROC HandleTheEvent(SDL_Event *event) { switch (event->type) { case SDL_QUIT: - RequestMacOff = trueblnr; + RequestMacOff = true; break; case SDL_ACTIVEEVENT: switch (event->active.state) { @@ -1721,18 +1721,18 @@ LOCALPROC HandleTheEvent(SDL_Event *event) /* any mouse button, we don't care which */ MousePositionNotify( event->button.x, event->button.y); - MouseButtonSet(trueblnr); + MouseButtonSet(true); break; case SDL_MOUSEBUTTONUP: MousePositionNotify( event->button.x, event->button.y); - MouseButtonSet(falseblnr); + MouseButtonSet(false); break; case SDL_KEYDOWN: - DoKeyCode(&event->key.keysym, trueblnr); + DoKeyCode(&event->key.keysym, true); break; case SDL_KEYUP: - DoKeyCode(&event->key.keysym, falseblnr); + DoKeyCode(&event->key.keysym, false); break; #if 0 case Expose: /* SDL doesn't have an expose event */ @@ -1763,12 +1763,12 @@ LOCALPROC HandleTheEvent(SDL_Event *event) /* --- main window creation and disposal --- */ -LOCALVAR int my_argc; -LOCALVAR char **my_argv; +LOCALVAR int argc; +LOCALVAR char **argv; -LOCALFUNC blnr Screen_Init(void) +LOCALFUNC bool Screen_Init(void) { - blnr v = falseblnr; + bool v = false; InitKeyCodes(); @@ -1777,14 +1777,14 @@ LOCALFUNC blnr Screen_Init(void) fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); } else { SDL_WM_SetCaption(kStrAppName, NULL); - v = trueblnr; + v = true; } return v; } #if MayFullScreen -LOCALVAR blnr GrabMachine = falseblnr; +LOCALVAR bool GrabMachine = false; #endif #if MayFullScreen @@ -1804,7 +1804,7 @@ LOCALPROC GrabTheMachine(void) { SavedMouseH = ViewHStart + (ViewHSize / 2); SavedMouseV = ViewVStart + (ViewVSize / 2); - HaveMouseMotion = trueblnr; + HaveMouseMotion = true; } #endif } @@ -1816,7 +1816,7 @@ LOCALPROC UngrabMachine(void) #if EnableFSMouseMotion if (HaveMouseMotion) { (void) MoveMouse(CurMouseH, CurMouseV); - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } #endif @@ -1850,18 +1850,18 @@ LOCALPROC MouseConstrain(void) SavedMouseH += shiftdh; SavedMouseV += shiftdv; if (! MoveMouse(SavedMouseH, SavedMouseV)) { - HaveMouseMotion = falseblnr; + HaveMouseMotion = false; } } } #endif -LOCALFUNC blnr CreateMainWindow(void) +LOCALFUNC bool CreateMainWindow(void) { int NewWindowHeight = vMacScreenHeight; int NewWindowWidth = vMacScreenWidth; Uint32 flags = SDL_SWSURFACE; - blnr v = falseblnr; + bool v = false; #if EnableMagnify && 1 if (UseMagnify) { @@ -1884,34 +1884,34 @@ LOCALFUNC blnr CreateMainWindow(void) ViewHSize = vMacScreenWidth; ViewVSize = vMacScreenHeight; - my_surface = SDL_SetVideoMode(NewWindowWidth, NewWindowHeight, + surface = SDL_SetVideoMode(NewWindowWidth, NewWindowHeight, #if 0 != vMacScreenDepth 32, #else /* 32 */ /* 24 */ /* 16 */ 8, #endif flags); - if (NULL == my_surface) { + if (NULL == surface) { fprintf(stderr, "SDL_SetVideoMode fails: %s\n", SDL_GetError()); } else { #if 0 != vMacScreenDepth - ColorModeWorks = trueblnr; + ColorModeWorks = true; #endif - v = trueblnr; + v = true; } return v; } #if EnableRecreateW -LOCALFUNC blnr ReCreateMainWindow(void) +LOCALFUNC bool ReCreateMainWindow(void) { ForceShowCursor(); /* hide/show cursor api is per window */ #if MayFullScreen if (GrabMachine) { - GrabMachine = falseblnr; + GrabMachine = false; UngrabMachine(); } #endif @@ -1929,7 +1929,7 @@ LOCALFUNC blnr ReCreateMainWindow(void) (void) MoveMouse(CurMouseH, CurMouseV); } - return trueblnr; + return true; } #endif @@ -1979,7 +1979,7 @@ LOCALPROC EnterSpeedStopped(void) LOCALPROC CheckForSavedTasks(void) { if (EvtQNeedRecover) { - EvtQNeedRecover = falseblnr; + EvtQNeedRecover = false; /* attempt cleanup, EvtQNeedRecover may get set again */ EvtQTryRecoverFromFull(); @@ -1992,12 +1992,12 @@ LOCALPROC CheckForSavedTasks(void) #endif if (RequestMacOff) { - RequestMacOff = falseblnr; + RequestMacOff = false; if (AnyDiskInserted()) { MacMsgOverride(kStrQuitWarningTitle, kStrQuitWarningMessage); } else { - ForceMacOff = trueblnr; + ForceMacOff = true; } } @@ -2064,7 +2064,7 @@ LOCALPROC CheckForSavedTasks(void) #endif if (NeedWholeScreenDraw) { - NeedWholeScreenDraw = falseblnr; + NeedWholeScreenDraw = false; ScreenChangedAll(); } @@ -2086,38 +2086,38 @@ LOCALPROC CheckForSavedTasks(void) /* --- command line parsing --- */ -LOCALFUNC blnr ScanCommandLine(void) +LOCALFUNC bool ScanCommandLine(void) { char *pa; int i = 1; label_retry: - if (i < my_argc) { - pa = my_argv[i++]; + if (i < argc) { + pa = argv[i++]; if ('-' == pa[0]) { if ((0 == strcmp(pa, "--rom")) || (0 == strcmp(pa, "-r"))) { - if (i < my_argc) { - rom_path = my_argv[i++]; + if (i < argc) { + rom_path = argv[i++]; goto label_retry; } } else { - MacMsg(kStrBadArgTitle, kStrBadArgMessage, falseblnr); + MacMsg(kStrBadArgTitle, kStrBadArgMessage, false); } } else { - (void) Sony_Insert1(pa, falseblnr); + (void) Sony_Insert1(pa, false); goto label_retry; } } - return trueblnr; + return true; } /* --- main program flow --- */ -GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void) +GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) { UpdateTrueEmulatedTime(); return TrueEmulatedTime == OnTrueTime; @@ -2200,43 +2200,43 @@ LOCALPROC ReserveAllocAll(void) #if dbglog_HAVE dbglog_ReserveAlloc(); #endif - ReserveAllocOneBlock(&ROM, kROM_Size, 5, falseblnr); + ReserveAllocOneBlock(&ROM, kROM_Size, 5, false); ReserveAllocOneBlock(&screencomparebuff, - vMacScreenNumBytes, 5, trueblnr); + vMacScreenNumBytes, 5, true); #if UseControlKeys ReserveAllocOneBlock(&CntrlDisplayBuff, - vMacScreenNumBytes, 5, falseblnr); + vMacScreenNumBytes, 5, false); #endif - ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, falseblnr); + ReserveAllocOneBlock(&CLUT_final, CLUT_finalsz, 5, false); #if SoundEnabled - ReserveAllocOneBlock((ui3p *)&TheSoundBuffer, - dbhBufferSize, 5, falseblnr); + ReserveAllocOneBlock((uint8_t * *)&TheSoundBuffer, + dbhBufferSize, 5, false); #endif EmulationReserveAlloc(); } -LOCALFUNC blnr AllocMemory(void) +LOCALFUNC bool AllocMemory(void) { uimr n; - blnr IsOk = falseblnr; + bool IsOk = false; ReserveAllocOffset = 0; ReserveAllocBigBlock = nullpr; ReserveAllocAll(); n = ReserveAllocOffset; - ReserveAllocBigBlock = (ui3p)calloc(1, n); + ReserveAllocBigBlock = (uint8_t *)calloc(1, n); if (NULL == ReserveAllocBigBlock) { - MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, trueblnr); + MacMsg(kStrOutOfMemTitle, kStrOutOfMemMessage, true); } else { ReserveAllocOffset = 0; ReserveAllocAll(); if (n != ReserveAllocOffset) { /* oops, program error */ } else { - IsOk = trueblnr; + IsOk = true; } } @@ -2250,7 +2250,7 @@ LOCALPROC UnallocMemory(void) } } -LOCALFUNC blnr InitOSGLU(void) +LOCALFUNC bool InitOSGLU(void) { if (AllocMemory()) #if dbglog_HAVE @@ -2267,9 +2267,9 @@ LOCALFUNC blnr InitOSGLU(void) if (CreateMainWindow()) if (WaitForRom()) { - return trueblnr; + return true; } - return falseblnr; + return false; } LOCALPROC UnInitOSGLU(void) @@ -2308,8 +2308,8 @@ LOCALPROC UnInitOSGLU(void) int main(int argc, char **argv) { - my_argc = argc; - my_argv = argv; + argc = argc; + argv = argv; ZapOSGLUVars(); if (InitOSGLU()) { diff --git a/src/VIA2EMDV.c b/src/VIA2EMDV.c index cdffba7..098c37a 100644 --- a/src/VIA2EMDV.c +++ b/src/VIA2EMDV.c @@ -575,7 +575,7 @@ LOCALPROC VIA2_CheckInterruptFlag(void) LOCALVAR uint8_t VIA2_T1_Active = 0; LOCALVAR uint8_t VIA2_T2_Active = 0; -LOCALVAR blnr VIA2_T1IntReady = falseblnr; +LOCALVAR bool VIA2_T1IntReady = false; LOCALPROC VIA2_Clear(void) { @@ -588,7 +588,7 @@ LOCALPROC VIA2_Clear(void) VIA2_D.SR = VIA2_D.ACR = 0x00; VIA2_D.PCR = VIA2_D.IFR = VIA2_D.IER = 0x00; VIA2_T1_Active = VIA2_T2_Active = 0x00; - VIA2_T1IntReady = falseblnr; + VIA2_T1IntReady = false; } GLOBALPROC VIA2_Zap(void) @@ -670,7 +670,7 @@ GLOBALFUNC uint8_t VIA2_ShiftOutData(void) #define CyclesPerViaTime (10 * ClockMult) #define CyclesScaledPerViaTime (kCycleScale * CyclesPerViaTime) -LOCALVAR blnr VIA2_T1Running = trueblnr; +LOCALVAR bool VIA2_T1Running = true; LOCALVAR iCountt VIA2_T1LastTime = 0; GLOBALPROC VIA2_DoTimer1Check(void) @@ -722,7 +722,7 @@ GLOBALPROC VIA2_DoTimer1Check(void) VIA2_T1LastTime = NewTime; } - VIA2_T1IntReady = falseblnr; + VIA2_T1IntReady = false; if ((VIA2_D.IFR & (1 << kIntT1)) == 0) { if (((VIA2_D.ACR & 0x40) != 0) || (VIA2_T1_Active == 1)) { uint32_t NewTemp = VIA2_D.T1C_F; /* Get Timer 1 Counter */ @@ -739,7 +739,7 @@ GLOBALPROC VIA2_DoTimer1Check(void) * CyclesPerViaTime; } ICT_add(kICT_VIA2_Timer1Check, NewTimer); - VIA2_T1IntReady = trueblnr; + VIA2_T1IntReady = true; } } } @@ -748,11 +748,11 @@ GLOBALPROC VIA2_DoTimer1Check(void) LOCALPROC CheckT1IntReady(void) { if (VIA2_T1Running) { - blnr NewT1IntReady = falseblnr; + bool NewT1IntReady = false; if ((VIA2_D.IFR & (1 << kIntT1)) == 0) { if (((VIA2_D.ACR & 0x40) != 0) || (VIA2_T1_Active == 1)) { - NewT1IntReady = trueblnr; + NewT1IntReady = true; } } @@ -777,8 +777,8 @@ GLOBALFUNC uint16_t VIA2_GetT1InvertTime(void) return v; } -LOCALVAR blnr VIA2_T2Running = trueblnr; -LOCALVAR blnr VIA2_T2C_ShortTime = falseblnr; +LOCALVAR bool VIA2_T2Running = true; +LOCALVAR bool VIA2_T2C_ShortTime = false; LOCALVAR iCountt VIA2_T2LastTime = 0; GLOBALPROC VIA2_DoTimer2Check(void) @@ -794,7 +794,7 @@ GLOBALPROC VIA2_DoTimer2Check(void) if ((deltaTime > (0x00010000UL * CyclesScaledPerViaTime)) || ((Temp <= deltaTemp) && (Temp != 0))) { - VIA2_T2C_ShortTime = falseblnr; + VIA2_T2C_ShortTime = false; VIA2_T2_Active = 0; VIA2_SetInterruptFlag(kIntT2); #if VIA2_dolog && 1 @@ -837,7 +837,7 @@ GLOBALPROC VIA2_DoTimer2Check(void) #define kIER 0x0E #define kORA 0x0F -GLOBALFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr) +GLOBALFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr) { switch (addr) { case kORB : @@ -950,8 +950,8 @@ GLOBALFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr) if ((VIA2_D.T2C_F < (128UL << 16)) && (VIA2_D.T2C_F != 0)) { - VIA2_T2C_ShortTime = trueblnr; - VIA2_T2Running = trueblnr; + VIA2_T2C_ShortTime = true; + VIA2_T2Running = true; /* Running too many instructions during a short timer interval can crash when @@ -1171,23 +1171,23 @@ GLOBALPROC VIA2_ExtraTimeBegin(void) { if (VIA2_T1Running) { VIA2_DoTimer1Check(); /* run up to this moment */ - VIA2_T1Running = falseblnr; + VIA2_T1Running = false; } if (VIA2_T2Running & (! VIA2_T2C_ShortTime)) { VIA2_DoTimer2Check(); /* run up to this moment */ - VIA2_T2Running = falseblnr; + VIA2_T2Running = false; } } GLOBALPROC VIA2_ExtraTimeEnd(void) { if (! VIA2_T1Running) { - VIA2_T1Running = trueblnr; + VIA2_T1Running = true; VIA2_T1LastTime = GetCuriCount(); VIA2_DoTimer1Check(); } if (! VIA2_T2Running) { - VIA2_T2Running = trueblnr; + VIA2_T2Running = true; VIA2_T2LastTime = GetCuriCount(); VIA2_DoTimer2Check(); } diff --git a/src/VIA2EMDV.h b/src/VIA2EMDV.h index 07f6a96..ddd780e 100644 --- a/src/VIA2EMDV.h +++ b/src/VIA2EMDV.h @@ -23,7 +23,7 @@ EXPORTPROC VIA2_Zap(void); EXPORTPROC VIA2_Reset(void); -EXPORTFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr); +EXPORTFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr); EXPORTPROC VIA2_ExtraTimeBegin(void); EXPORTPROC VIA2_ExtraTimeEnd(void); diff --git a/src/VIAEMDEV.c b/src/VIAEMDEV.c index 95ad75a..0791da9 100644 --- a/src/VIAEMDEV.c +++ b/src/VIAEMDEV.c @@ -575,7 +575,7 @@ LOCALPROC VIA1_CheckInterruptFlag(void) LOCALVAR uint8_t VIA1_T1_Active = 0; LOCALVAR uint8_t VIA1_T2_Active = 0; -LOCALVAR blnr VIA1_T1IntReady = falseblnr; +LOCALVAR bool VIA1_T1IntReady = false; LOCALPROC VIA1_Clear(void) { @@ -588,7 +588,7 @@ LOCALPROC VIA1_Clear(void) VIA1_D.SR = VIA1_D.ACR = 0x00; VIA1_D.PCR = VIA1_D.IFR = VIA1_D.IER = 0x00; VIA1_T1_Active = VIA1_T2_Active = 0x00; - VIA1_T1IntReady = falseblnr; + VIA1_T1IntReady = false; } GLOBALPROC VIA1_Zap(void) @@ -670,7 +670,7 @@ GLOBALFUNC uint8_t VIA1_ShiftOutData(void) #define CyclesPerViaTime (10 * ClockMult) #define CyclesScaledPerViaTime (kCycleScale * CyclesPerViaTime) -LOCALVAR blnr VIA1_T1Running = trueblnr; +LOCALVAR bool VIA1_T1Running = true; LOCALVAR iCountt VIA1_T1LastTime = 0; GLOBALPROC VIA1_DoTimer1Check(void) @@ -722,7 +722,7 @@ GLOBALPROC VIA1_DoTimer1Check(void) VIA1_T1LastTime = NewTime; } - VIA1_T1IntReady = falseblnr; + VIA1_T1IntReady = false; if ((VIA1_D.IFR & (1 << kIntT1)) == 0) { if (((VIA1_D.ACR & 0x40) != 0) || (VIA1_T1_Active == 1)) { uint32_t NewTemp = VIA1_D.T1C_F; /* Get Timer 1 Counter */ @@ -739,7 +739,7 @@ GLOBALPROC VIA1_DoTimer1Check(void) * CyclesPerViaTime; } ICT_add(kICT_VIA1_Timer1Check, NewTimer); - VIA1_T1IntReady = trueblnr; + VIA1_T1IntReady = true; } } } @@ -748,11 +748,11 @@ GLOBALPROC VIA1_DoTimer1Check(void) LOCALPROC CheckT1IntReady(void) { if (VIA1_T1Running) { - blnr NewT1IntReady = falseblnr; + bool NewT1IntReady = false; if ((VIA1_D.IFR & (1 << kIntT1)) == 0) { if (((VIA1_D.ACR & 0x40) != 0) || (VIA1_T1_Active == 1)) { - NewT1IntReady = trueblnr; + NewT1IntReady = true; } } @@ -777,8 +777,8 @@ GLOBALFUNC uint16_t VIA1_GetT1InvertTime(void) return v; } -LOCALVAR blnr VIA1_T2Running = trueblnr; -LOCALVAR blnr VIA1_T2C_ShortTime = falseblnr; +LOCALVAR bool VIA1_T2Running = true; +LOCALVAR bool VIA1_T2C_ShortTime = false; LOCALVAR iCountt VIA1_T2LastTime = 0; GLOBALPROC VIA1_DoTimer2Check(void) @@ -794,7 +794,7 @@ GLOBALPROC VIA1_DoTimer2Check(void) if ((deltaTime > (0x00010000UL * CyclesScaledPerViaTime)) || ((Temp <= deltaTemp) && (Temp != 0))) { - VIA1_T2C_ShortTime = falseblnr; + VIA1_T2C_ShortTime = false; VIA1_T2_Active = 0; VIA1_SetInterruptFlag(kIntT2); #if VIA1_dolog && 1 @@ -837,7 +837,7 @@ GLOBALPROC VIA1_DoTimer2Check(void) #define kIER 0x0E #define kORA 0x0F -GLOBALFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr) +GLOBALFUNC uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr) { switch (addr) { case kORB : @@ -950,8 +950,8 @@ GLOBALFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr) if ((VIA1_D.T2C_F < (128UL << 16)) && (VIA1_D.T2C_F != 0)) { - VIA1_T2C_ShortTime = trueblnr; - VIA1_T2Running = trueblnr; + VIA1_T2C_ShortTime = true; + VIA1_T2Running = true; /* Running too many instructions during a short timer interval can crash when @@ -1171,23 +1171,23 @@ GLOBALPROC VIA1_ExtraTimeBegin(void) { if (VIA1_T1Running) { VIA1_DoTimer1Check(); /* run up to this moment */ - VIA1_T1Running = falseblnr; + VIA1_T1Running = false; } if (VIA1_T2Running & (! VIA1_T2C_ShortTime)) { VIA1_DoTimer2Check(); /* run up to this moment */ - VIA1_T2Running = falseblnr; + VIA1_T2Running = false; } } GLOBALPROC VIA1_ExtraTimeEnd(void) { if (! VIA1_T1Running) { - VIA1_T1Running = trueblnr; + VIA1_T1Running = true; VIA1_T1LastTime = GetCuriCount(); VIA1_DoTimer1Check(); } if (! VIA1_T2Running) { - VIA1_T2Running = trueblnr; + VIA1_T2Running = true; VIA1_T2LastTime = GetCuriCount(); VIA1_DoTimer2Check(); } diff --git a/src/VIAEMDEV.h b/src/VIAEMDEV.h index 0edc82a..89d322f 100644 --- a/src/VIAEMDEV.h +++ b/src/VIAEMDEV.h @@ -23,7 +23,7 @@ EXPORTPROC VIA1_Zap(void); EXPORTPROC VIA1_Reset(void); -EXPORTFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr); +EXPORTFUNC uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr); EXPORTPROC VIA1_ExtraTimeBegin(void); EXPORTPROC VIA1_ExtraTimeEnd(void); diff --git a/src/VIDEMDEV.c b/src/VIDEMDEV.c index 6be55eb..98d7db9 100644 --- a/src/VIDEMDEV.c +++ b/src/VIDEMDEV.c @@ -88,7 +88,7 @@ LOCALPROC ChecksumSlotROM(void) /* Calculate CRC */ /* assuming check sum field initialized to zero */ int i; - ui3p p = VidROM; + uint8_t * p = VidROM; uint32_t crc = 0; for (i = kVidROM_Size; --i >= 0; ) { @@ -97,7 +97,7 @@ LOCALPROC ChecksumSlotROM(void) do_put_mem_long(p - 12, crc); } -LOCALVAR ui3p pPatch; +LOCALVAR uint8_t * pPatch; LOCALPROC PatchAByte(uint8_t v) { @@ -123,21 +123,21 @@ LOCALPROC PatchAOSLstEntry0(uint8_t Id, uint32_t Offset) } #endif -LOCALPROC PatchAOSLstEntry(uint8_t Id, ui3p Offset) +LOCALPROC PatchAOSLstEntry(uint8_t Id, uint8_t * Offset) { PatchALong((Id << 24) | ((Offset - pPatch) & 0x00FFFFFF)); } -LOCALFUNC ui3p ReservePatchOSLstEntry(void) +LOCALFUNC uint8_t * ReservePatchOSLstEntry(void) { - ui3p v = pPatch; + uint8_t * v = pPatch; pPatch += 4; return v; } -LOCALPROC PatchAReservedOSLstEntry(ui3p p, uint8_t Id) +LOCALPROC PatchAReservedOSLstEntry(uint8_t * p, uint8_t Id) { - ui3p pPatchSave = pPatch; + uint8_t * pPatchSave = pPatch; pPatch = p; PatchAOSLstEntry(Id, pPatchSave); pPatch = pPatchSave; @@ -153,35 +153,35 @@ LOCALPROC PatchAnEndOfLst(void) PatchADatLstEntry(0xFF /* endOfList */, 0x00000000); } -GLOBALFUNC blnr Vid_Init(void) +GLOBALFUNC bool Vid_Init(void) { int i; uint32_t UsedSoFar; - ui3p pAt_sRsrcDir; - ui3p pTo_sRsrc_Board; - ui3p pTo_BoardType; - ui3p pTo_BoardName; - ui3p pTo_VenderInfo; - ui3p pTo_VendorID; - ui3p pTo_RevLevel; - ui3p pTo_PartNum; - ui3p pTo_sRsrc_Video; - ui3p pTo_VideoType; - ui3p pTo_VideoName; - ui3p pTo_MinorBase; - ui3p pTo_MinorLength; + uint8_t * pAt_sRsrcDir; + uint8_t * pTo_sRsrc_Board; + uint8_t * pTo_BoardType; + uint8_t * pTo_BoardName; + uint8_t * pTo_VenderInfo; + uint8_t * pTo_VendorID; + uint8_t * pTo_RevLevel; + uint8_t * pTo_PartNum; + uint8_t * pTo_sRsrc_Video; + uint8_t * pTo_VideoType; + uint8_t * pTo_VideoName; + uint8_t * pTo_MinorBase; + uint8_t * pTo_MinorLength; #if 0 - ui3p pTo_MajorBase; - ui3p pTo_MajorLength; + uint8_t * pTo_MajorBase; + uint8_t * pTo_MajorLength; #endif - ui3p pTo_VidDrvrDir; - ui3p pTo_sMacOS68020; - ui3p pTo_OneBitMode; - ui3p pTo_OneVidParams; + uint8_t * pTo_VidDrvrDir; + uint8_t * pTo_sMacOS68020; + uint8_t * pTo_OneBitMode; + uint8_t * pTo_OneVidParams; #if 0 != vMacScreenDepth - ui3p pTo_ColorBitMode = nullpr; - ui3p pTo_ColorVidParams; + uint8_t * pTo_ColorBitMode = nullpr; + uint8_t * pTo_ColorVidParams; #endif pPatch = VidROM; @@ -314,7 +314,7 @@ GLOBALFUNC blnr Vid_Init(void) PatchAReservedOSLstEntry(pTo_sMacOS68020, 0x02 /* sMacOS68020 */); PatchALong(4 + sizeof(VidDrvr_contents) + 8); - MoveBytes((ui3p)VidDrvr_contents, + MoveBytes((uint8_t *)VidDrvr_contents, pPatch, sizeof(VidDrvr_contents)); pPatch += sizeof(VidDrvr_contents); PatchAWord(kcom_callcheck); @@ -391,7 +391,7 @@ GLOBALFUNC blnr Vid_Init(void) UsedSoFar = (pPatch - VidROM) + 20; if (UsedSoFar > kVidROM_Size) { ReportAbnormalID(0x0A01, "kVidROM_Size to small"); - return falseblnr; + return false; } for (i = kVidROM_Size - UsedSoFar; --i >= 0; ) { @@ -419,7 +419,7 @@ GLOBALFUNC blnr Vid_Init(void) CLUT_blues[CLUT_size - 1] = 0; #endif - return trueblnr; + return true; } IMPORTPROC Vid_VBLinterrupt_PulseNotify(void); @@ -448,7 +448,7 @@ LOCALFUNC tMacErr Vid_SetMode(uint16_t v) #else if (UseColorMode != ((v != 128) && ColorModeWorks)) { UseColorMode = ! UseColorMode; - ColorMappingChanged = trueblnr; + ColorMappingChanged = true; } #endif return mnvm_noErr; @@ -457,7 +457,7 @@ LOCALFUNC tMacErr Vid_SetMode(uint16_t v) GLOBALFUNC uint16_t Vid_Reset(void) { #if 0 != vMacScreenDepth - UseColorMode = falseblnr; + UseColorMode = false; #endif return 128; } @@ -486,7 +486,7 @@ GLOBALFUNC uint16_t Vid_Reset(void) #define VidBaseAddr 0xF9900000 /* appears to be completely ignored */ -LOCALVAR blnr UseGrayTones = falseblnr; +LOCALVAR bool UseGrayTones = false; LOCALPROC FillScreenWithGrayPattern(void) { @@ -665,7 +665,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p) } csTable += 8; } - ColorMappingChanged = trueblnr; + ColorMappingChanged = true; } else if (csStart + csCount < csStart) { /* overflow */ @@ -699,7 +699,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p) } csTable += 8; } - ColorMappingChanged = trueblnr; + ColorMappingChanged = true; result = mnvm_noErr; } } else diff --git a/src/VIDEMDEV.h b/src/VIDEMDEV.h index 02406f3..eb935ed 100644 --- a/src/VIDEMDEV.h +++ b/src/VIDEMDEV.h @@ -20,7 +20,7 @@ #define VIDEMDEV_H #endif -EXPORTFUNC blnr Vid_Init(void); +EXPORTFUNC bool Vid_Init(void); EXPORTFUNC uint16_t Vid_Reset(void); EXPORTPROC Vid_Update(void);