diff --git a/cfg/CNFGGLOB.h b/cfg/CNFGGLOB.h index 29694b1..5e65da9 100644 --- a/cfg/CNFGGLOB.h +++ b/cfg/CNFGGLOB.h @@ -10,7 +10,6 @@ #include -#define MayInline inline #define SmallGlobals 0 #define cIncludeUnused 0 #define UnusedParam(p) (void) p diff --git a/src/GLOBGLUE.c b/src/GLOBGLUE.c index 6b94a71..0a60fe3 100644 --- a/src/GLOBGLUE.c +++ b/src/GLOBGLUE.c @@ -55,56 +55,56 @@ uint8_t RequestIthDisk = 0; bool ControlKeyPressed = false; -IMPORTPROC m68k_reset(void); -IMPORTPROC IWM_Reset(void); -IMPORTPROC SCC_Reset(void); -IMPORTPROC SCSI_Reset(void); -IMPORTPROC VIA1_Reset(void); +extern void m68k_reset(void); +extern void IWM_Reset(void); +extern void SCC_Reset(void); +extern void SCSI_Reset(void); +extern void VIA1_Reset(void); #if EmVIA2 -IMPORTPROC VIA2_Reset(void); +extern void VIA2_Reset(void); #endif -IMPORTPROC Sony_Reset(void); +extern void Sony_Reset(void); -IMPORTPROC ExtnDisk_Access(CPTR p); -IMPORTPROC ExtnSony_Access(CPTR p); +extern void ExtnDisk_Access(CPTR p); +extern void ExtnSony_Access(CPTR p); #if EmVidCard -IMPORTPROC ExtnVideo_Access(CPTR p); +extern void ExtnVideo_Access(CPTR p); #endif -IMPORTPROC Sony_SetQuitOnEject(void); +extern void Sony_SetQuitOnEject(void); -IMPORTPROC m68k_IPLchangeNtfy(void); -IMPORTPROC MINEM68K_Init( +extern void m68k_IPLchangeNtfy(void); +extern void MINEM68K_Init( uint8_t *fIPL); -IMPORTFUNC uint32_t GetCyclesRemaining(void); -IMPORTPROC SetCyclesRemaining(uint32_t n); +extern uint32_t GetCyclesRemaining(void); +extern void SetCyclesRemaining(uint32_t n); -IMPORTPROC SetHeadATTel(ATTep p); -IMPORTFUNC ATTep FindATTel(CPTR addr); +extern void SetHeadATTel(ATTep p); +extern ATTep FindATTel(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); +extern uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr); #if EmVIA2 -IMPORTFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr); #endif #if EmASC -IMPORTFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr); #endif -IMPORTFUNC uint8_t get_vm_byte(CPTR addr); -IMPORTFUNC uint16_t get_vm_word(CPTR addr); -IMPORTFUNC uint32_t get_vm_long(CPTR addr); +extern uint8_t get_vm_byte(CPTR addr); +extern uint16_t get_vm_word(CPTR addr); +extern uint32_t get_vm_long(CPTR addr); -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); +extern void put_vm_byte(CPTR addr, uint8_t b); +extern void put_vm_word(CPTR addr, uint16_t w); +extern void put_vm_long(CPTR addr, uint32_t l); -GLOBALVAR uint32_t disk_icon_addr; + uint32_t disk_icon_addr; -GLOBALPROC customreset(void) +void customreset(void) { IWM_Reset(); SCC_Reset(); @@ -128,25 +128,25 @@ GLOBALPROC customreset(void) #endif } -GLOBALVAR uint8_t * RAM = nullpr; + uint8_t * RAM = nullpr; #if EmVidCard -GLOBALVAR uint8_t * VidROM = nullpr; + uint8_t * VidROM = nullpr; #endif #if IncludeVidMem -GLOBALVAR uint8_t * VidMem = nullpr; + uint8_t * VidMem = nullpr; #endif -GLOBALVAR uint8_t Wires[kNumWires]; + uint8_t Wires[kNumWires]; #if WantDisasm -IMPORTPROC m68k_WantDisasmContext(void); +extern void m68k_WantDisasmContext(void); #endif #if WantDisasm -GLOBALPROC dbglog_StartLine(void) +void dbglog_StartLine(void) { m68k_WantDisasmContext(); dbglog_writeCStr(" "); @@ -154,7 +154,7 @@ GLOBALPROC dbglog_StartLine(void) #endif #if dbglog_HAVE -GLOBALPROC dbglog_WriteMemArrow(bool WriteMem) +void dbglog_WriteMemArrow(bool WriteMem) { if (WriteMem) { dbglog_writeCStr(" <- "); @@ -165,7 +165,7 @@ GLOBALPROC dbglog_WriteMemArrow(bool WriteMem) #endif #if dbglog_HAVE -GLOBALPROC dbglog_AddrAccess(char *s, uint32_t Data, +void dbglog_AddrAccess(char *s, uint32_t Data, bool WriteMem, uint32_t addr) { dbglog_StartLine(); @@ -180,7 +180,7 @@ GLOBALPROC dbglog_AddrAccess(char *s, uint32_t Data, #endif #if dbglog_HAVE -GLOBALPROC dbglog_Access(char *s, uint32_t Data, bool WriteMem) +void dbglog_Access(char *s, uint32_t Data, bool WriteMem) { dbglog_StartLine(); dbglog_writeCStr(s); @@ -191,7 +191,7 @@ GLOBALPROC dbglog_Access(char *s, uint32_t Data, bool WriteMem) #endif #if dbglog_HAVE -GLOBALPROC dbglog_WriteNote(char *s) +void dbglog_WriteNote(char *s) { dbglog_StartLine(); dbglog_writeCStr(s); @@ -200,7 +200,7 @@ GLOBALPROC dbglog_WriteNote(char *s) #endif #if dbglog_HAVE -GLOBALPROC dbglog_WriteSetBool(char *s, bool v) +void dbglog_WriteSetBool(char *s, bool v) { dbglog_StartLine(); dbglog_writeCStr(s); @@ -215,7 +215,7 @@ GLOBALPROC dbglog_WriteSetBool(char *s, bool v) #endif #if WantAbnormalReports -LOCALVAR bool GotOneAbnormal = false; +static bool GotOneAbnormal = false; #endif #ifndef ReportAbnormalInterrupt @@ -223,7 +223,7 @@ LOCALVAR bool GotOneAbnormal = false; #endif #if WantAbnormalReports -GLOBALPROC DoReportAbnormalID(uint16_t id +void DoReportAbnormalID(uint16_t id #if dbglog_HAVE , char *s #endif @@ -249,7 +249,7 @@ GLOBALPROC DoReportAbnormalID(uint16_t id #if IncludeExtnPbufs -LOCALFUNC MacErr_t PbufTransferVM(CPTR Buffera, +static MacErr_t PbufTransferVM(CPTR Buffera, tPbuf i, uint32_t offset, uint32_t count, bool IsWrite) { MacErr_t result; @@ -287,7 +287,7 @@ label_1: #endif #if IncludeExtnPbufs -LOCALPROC ExtnParamBuffers_Access(CPTR p) +static void ExtnParamBuffers_Access(CPTR p) { MacErr_t result = mnvm_controlErr; @@ -368,7 +368,7 @@ LOCALPROC ExtnParamBuffers_Access(CPTR p) #endif #if IncludeExtnHostTextClipExchange -LOCALPROC ExtnHostTextClipExchange_Access(CPTR p) +static void ExtnHostTextClipExchange_Access(CPTR p) { MacErr_t result = mnvm_controlErr; @@ -420,7 +420,7 @@ LOCALPROC ExtnHostTextClipExchange_Access(CPTR p) #define kParamFindExtnTheExtn 8 #define kParamFindExtnTheId 12 -LOCALPROC ExtnFind_Access(CPTR p) +static void ExtnFind_Access(CPTR p) { MacErr_t result = mnvm_controlErr; @@ -507,9 +507,9 @@ LOCALPROC ExtnFind_Access(CPTR p) #define kDSK_Params_Lo 1 #define kDSK_QuitOnEject 3 /* obsolete */ -LOCALVAR uint16_t ParamAddrHi; +static uint16_t ParamAddrHi; -LOCALPROC Extn_Access(uint32_t Data, CPTR addr) +static void Extn_Access(uint32_t Data, CPTR addr) { switch (addr) { case kDSK_Params_Hi: @@ -564,7 +564,7 @@ LOCALPROC Extn_Access(uint32_t Data, CPTR addr) } } -GLOBALPROC Extn_Reset(void) +void Extn_Reset(void) { ParamAddrHi = (uint16_t) - 1; } @@ -594,11 +594,11 @@ enum { }; -LOCALVAR ATTer ATTListA[MaxATTListN]; -LOCALVAR uint16_t LastATTel; +static ATTer ATTListA[MaxATTListN]; +static uint16_t LastATTel; -LOCALPROC AddToATTList(ATTep p) +static void AddToATTList(ATTep p) { uint16_t NewLast = LastATTel + 1; if (NewLast >= MaxATTListN) { @@ -609,12 +609,12 @@ LOCALPROC AddToATTList(ATTep p) } } -LOCALPROC InitATTList(void) +static void InitATTList(void) { LastATTel = 0; } -LOCALPROC FinishATTList(void) +static void FinishATTList(void) { { /* add guard */ @@ -665,7 +665,7 @@ LOCALPROC FinishATTList(void) } #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -LOCALPROC SetUp_RAM24(void) +static void SetUp_RAM24(void) { ATTer r; uint32_t bankbit = 0x00100000 << (((VIA2_iA7 << 1) | VIA2_iA6) << 1); @@ -710,7 +710,7 @@ LOCALPROC SetUp_RAM24(void) #endif #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -LOCALPROC SetUp_io(void) +static void SetUp_io(void) { ATTer r; @@ -818,7 +818,7 @@ LOCALPROC SetUp_io(void) #endif #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -LOCALPROC SetUp_address24(void) +static void SetUp_address24(void) { ATTer r; @@ -881,7 +881,7 @@ LOCALPROC SetUp_address24(void) #endif #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -LOCALPROC SetUp_address32(void) +static void SetUp_address32(void) { ATTer r; @@ -1000,7 +1000,7 @@ LOCALPROC SetUp_address32(void) #endif #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -LOCALPROC SetUp_address(void) +static void SetUp_address(void) { if (Addr32) { SetUp_address32(); @@ -1021,7 +1021,7 @@ LOCALPROC SetUp_address(void) #ifndef ln2mtb #define AddToATTListWithMTB AddToATTList #else -LOCALPROC AddToATTListWithMTB(ATTep p) +static void AddToATTListWithMTB(ATTep p) { /* Test of memory mapping system. @@ -1043,7 +1043,7 @@ LOCALPROC AddToATTListWithMTB(ATTep p) #endif #if (CurEmMd != kEmMd_II) && (CurEmMd != kEmMd_IIx) -LOCALPROC SetUp_RAM24(void) +static void SetUp_RAM24(void) { ATTer r; @@ -1078,7 +1078,7 @@ LOCALPROC SetUp_RAM24(void) #endif #if (CurEmMd != kEmMd_II) && (CurEmMd != kEmMd_IIx) -LOCALPROC SetUp_address(void) +static void SetUp_address(void) { ATTer r; @@ -1183,7 +1183,7 @@ LOCALPROC SetUp_address(void) } #endif -LOCALPROC SetUpMemBanks(void) +static void SetUpMemBanks(void) { InitATTList(); @@ -1193,7 +1193,7 @@ LOCALPROC SetUpMemBanks(void) } #if 0 -LOCALPROC get_fail_realblock(ATTep p) +static void get_fail_realblock(ATTep p) { p->cmpmask = 0; p->cmpvalu = 0xFFFFFFFF; @@ -1203,7 +1203,7 @@ LOCALPROC get_fail_realblock(ATTep p) } #endif -GLOBALFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, + uint32_t MMDV_Access(ATTep p, uint32_t Data, bool WriteMem, bool ByteSize, CPTR addr) { switch (p->MMDV) { @@ -1433,7 +1433,7 @@ GLOBALFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, return Data; } -GLOBALFUNC bool MemAccessNtfy(ATTep pT) + bool MemAccessNtfy(ATTep pT) { bool v = false; @@ -1454,7 +1454,7 @@ GLOBALFUNC bool MemAccessNtfy(ATTep pT) return v; } -GLOBALPROC MemOverlay_ChangeNtfy(void) +void MemOverlay_ChangeNtfy(void) { #if CurEmMd <= kEmMd_Plus SetUpMemBanks(); @@ -1464,13 +1464,13 @@ GLOBALPROC MemOverlay_ChangeNtfy(void) } #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -GLOBALPROC Addr32_ChangeNtfy(void) +void Addr32_ChangeNtfy(void) { SetUpMemBanks(); } #endif -LOCALFUNC ATTep get_address_realblock1(bool WriteMem, CPTR addr) +static ATTep get_address_realblock1(bool WriteMem, CPTR addr) { ATTep p; @@ -1492,7 +1492,7 @@ Label_Retry: return p; } -GLOBALFUNC uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, + uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, uint32_t *actL) { uint32_t bankleft; @@ -1519,9 +1519,9 @@ GLOBALFUNC uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, return p; } -GLOBALVAR bool InterruptButton = false; + bool InterruptButton = false; -GLOBALPROC SetInterruptButton(bool v) +void SetInterruptButton(bool v) { if (InterruptButton != v) { InterruptButton = v; @@ -1529,9 +1529,9 @@ GLOBALPROC SetInterruptButton(bool v) } } -LOCALVAR uint8_t CurIPL = 0; +static uint8_t CurIPL = 0; -GLOBALPROC VIAorSCCinterruptChngNtfy(void) +void VIAorSCCinterruptChngNtfy(void) { #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) uint8_t NewIPL; @@ -1560,7 +1560,7 @@ GLOBALPROC VIAorSCCinterruptChngNtfy(void) } } -GLOBALFUNC bool AddrSpac_Init(void) + bool AddrSpac_Init(void) { int i; @@ -1573,15 +1573,15 @@ GLOBALFUNC bool AddrSpac_Init(void) return true; } -GLOBALPROC Memory_Reset(void) +void Memory_Reset(void) { MemOverlay = 1; SetUpMemBanks(); } #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -EXPORTPROC PowerOff_ChangeNtfy(void); -GLOBALPROC PowerOff_ChangeNtfy(void) +extern void PowerOff_ChangeNtfy(void); +void PowerOff_ChangeNtfy(void) { if (! VIA2_iB2) { ForceMacOff = true; @@ -1592,7 +1592,7 @@ GLOBALPROC PowerOff_ChangeNtfy(void) /* user event queue utilities */ #if HaveMasterEvtQLock -GLOBALVAR uint16_t MasterEvtQLock = 0; + uint16_t MasterEvtQLock = 0; /* Takes a few ticks to process button event because of debounce code of Mac. So have this mechanism @@ -1600,7 +1600,7 @@ GLOBALVAR uint16_t MasterEvtQLock = 0; */ #endif -GLOBALFUNC bool FindKeyEvent(int *VirtualKey, bool *KeyDown) + bool FindKeyEvent(int *VirtualKey, bool *KeyDown) { EvtQEl *p; @@ -1627,28 +1627,28 @@ GLOBALFUNC bool FindKeyEvent(int *VirtualKey, bool *KeyDown) #include #endif -GLOBALVAR uimr ICTactive; -GLOBALVAR iCountt ICTwhen[kNumICTs]; + uimr ICTactive; + iCountt ICTwhen[kNumICTs]; -GLOBALPROC ICT_Zap(void) +void ICT_Zap(void) { ICTactive = 0; } -LOCALPROC InsertICT(int taskid, iCountt when) +static void InsertICT(int taskid, iCountt when) { ICTwhen[taskid] = when; ICTactive |= (1 << taskid); } -GLOBALVAR iCountt NextiCount = 0; + iCountt NextiCount = 0; -GLOBALFUNC iCountt GetCuriCount(void) + iCountt GetCuriCount(void) { return NextiCount - GetCyclesRemaining(); } -GLOBALPROC ICT_add(int taskid, uint32_t n) +void ICT_add(int taskid, uint32_t n) { /* n must be > 0 */ int32_t x = GetCyclesRemaining(); diff --git a/src/GLOBGLUE.h b/src/GLOBGLUE.h index ff1f43f..c2f4584 100644 --- a/src/GLOBGLUE.h +++ b/src/GLOBGLUE.h @@ -45,7 +45,7 @@ extern bool ControlKeyPressed; #define RAMSafetyMarginFudge 4 #define kRAM_Size (kRAMa_Size + kRAMb_Size) -EXPORTVAR(uint8_t *, RAM) +extern uint8_t * RAM; /* allocated by MYOSGLUE to be at least kRAM_Size + RAMSafetyMarginFudge @@ -54,17 +54,17 @@ EXPORTVAR(uint8_t *, RAM) */ #if EmVidCard -EXPORTVAR(uint8_t *, VidROM) +extern uint8_t * VidROM; #endif #if IncludeVidMem -EXPORTVAR(uint8_t *, VidMem) +extern uint8_t * VidMem; #endif -EXPORTPROC MemOverlay_ChangeNtfy(void); +extern void MemOverlay_ChangeNtfy(void); #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -EXPORTPROC Addr32_ChangeNtfy(void); +extern void Addr32_ChangeNtfy(void); #endif /* @@ -76,7 +76,7 @@ typedef uint32_t CPTR; mapping of address space to real memory */ -EXPORTFUNC uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, +extern uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, uint32_t *actL); /* @@ -114,7 +114,7 @@ EXPORTFUNC uint8_t * get_real_address0(uint32_t L, bool WritableMem, CPTR addr, real memory, i.e. memory mapped devices */ -EXPORTFUNC bool AddrSpac_Init(void); +extern bool AddrSpac_Init(void); #define uint32_t_FromSByte(x) ((uint32_t)(int32_t)(int8_t)(uint8_t)(x)) @@ -127,19 +127,19 @@ EXPORTFUNC bool AddrSpac_Init(void); #if WantDisasm -EXPORTPROC dbglog_StartLine(void); +extern void dbglog_StartLine(void); #else #define dbglog_StartLine() #endif #if dbglog_HAVE -EXPORTPROC dbglog_WriteMemArrow(bool WriteMem); +extern void dbglog_WriteMemArrow(bool WriteMem); -EXPORTPROC dbglog_WriteNote(char *s); -EXPORTPROC dbglog_WriteSetBool(char *s, bool v); -EXPORTPROC dbglog_AddrAccess(char *s, +extern void dbglog_WriteNote(char *s); +extern void dbglog_WriteSetBool(char *s, bool v); +extern void dbglog_AddrAccess(char *s, uint32_t Data, bool WriteMem, uint32_t addr); -EXPORTPROC dbglog_Access(char *s, uint32_t Data, bool WriteMem); +extern void dbglog_Access(char *s, uint32_t Data, bool WriteMem); #endif #if ! WantAbnormalReports @@ -150,17 +150,17 @@ EXPORTPROC dbglog_Access(char *s, uint32_t Data, bool WriteMem); #else #define ReportAbnormalID(id, s) DoReportAbnormalID(id) #endif -EXPORTPROC DoReportAbnormalID(uint16_t id +extern void DoReportAbnormalID(uint16_t id #if dbglog_HAVE , char *s #endif ); #endif /* WantAbnormalReports */ -EXPORTPROC VIAorSCCinterruptChngNtfy(void); +extern void VIAorSCCinterruptChngNtfy(void); -EXPORTVAR(bool, InterruptButton) -EXPORTPROC SetInterruptButton(bool v); +extern bool InterruptButton; +extern void SetInterruptButton(bool v); enum { kICT_SubTick, @@ -184,17 +184,17 @@ enum { kNumICTs }; -EXPORTPROC ICT_add(int taskid, uint32_t n); +extern void ICT_add(int taskid, uint32_t n); #define iCountt uint32_t -EXPORTFUNC iCountt GetCuriCount(void); -EXPORTPROC ICT_Zap(void); +extern iCountt GetCuriCount(void); +extern void ICT_Zap(void); -EXPORTVAR(uimr, ICTactive) -EXPORTVAR(iCountt, ICTwhen[kNumICTs]) -EXPORTVAR(iCountt, NextiCount) +extern uimr ICTactive; +extern iCountt ICTwhen[kNumICTs]; +extern iCountt NextiCount; -EXPORTVAR(uint8_t, Wires[kNumWires]) +extern uint8_t Wires[kNumWires]; #define kLn2CycleScale 6 #define kCycleScale (1 << kLn2CycleScale) @@ -209,9 +209,9 @@ EXPORTVAR(uint8_t, Wires[kNumWires]) #define HaveMasterEvtQLock EmClassicKbrd #if HaveMasterEvtQLock -EXPORTVAR(uint16_t, MasterEvtQLock) +extern uint16_t MasterEvtQLock; #endif -EXPORTFUNC bool FindKeyEvent(int *VirtualKey, bool *KeyDown); +extern bool FindKeyEvent(int *VirtualKey, bool *KeyDown); /* minivmac extensions */ @@ -245,13 +245,13 @@ enum { #define kcom_callcheck 0x5B17 -EXPORTVAR(uint32_t, disk_icon_addr) +extern uint32_t disk_icon_addr; -EXPORTPROC Memory_Reset(void); +extern void Memory_Reset(void); -EXPORTPROC Extn_Reset(void); +extern void Extn_Reset(void); -EXPORTPROC customreset(void); +extern void customreset(void); struct ATTer { struct ATTer *Next; @@ -280,8 +280,8 @@ typedef ATTer *ATTep; #define kATTA_mmdvmask (1 << kATTA_mmdvbit) #define kATTA_ntfymask (1 << kATTA_ntfybit) -EXPORTFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, +extern uint32_t MMDV_Access(ATTep p, uint32_t Data, bool WriteMem, bool ByteSize, CPTR addr); -EXPORTFUNC bool MemAccessNtfy(ATTep pT); +extern bool MemAccessNtfy(ATTep pT); #endif diff --git a/src/HW/ADB/ADBEMDEV.c b/src/HW/ADB/ADBEMDEV.c index aa35536..713d335 100644 --- a/src/HW/ADB/ADBEMDEV.c +++ b/src/HW/ADB/ADBEMDEV.c @@ -35,15 +35,15 @@ ReportAbnormalID unused 0x0C06 - 0x0CFF */ -IMPORTPROC ADB_ShiftOutData(uint8_t v); -IMPORTFUNC uint8_t ADB_ShiftInData(void); +extern void ADB_ShiftOutData(uint8_t v); +extern uint8_t ADB_ShiftInData(void); #include "HW/ADB/ADBSHARE.h" -LOCALVAR bool ADB_ListenDatBuf; -LOCALVAR uint8_t ADB_IndexDatBuf; +static bool ADB_ListenDatBuf; +static uint8_t ADB_IndexDatBuf; -GLOBALPROC ADB_DoNewState(void) +void ADB_DoNewState(void) { uint8_t state = ADB_st1 * 2 + ADB_st0; #ifdef _VIA_Debug @@ -157,7 +157,7 @@ GLOBALPROC ADB_DoNewState(void) } } -GLOBALPROC ADBstate_ChangeNtfy(void) +void ADBstate_ChangeNtfy(void) { #ifdef _VIA_Debug fprintf(stderr, "ADBstate_ChangeNtfy: %d, %d, %d\n", @@ -179,14 +179,14 @@ GLOBALPROC ADBstate_ChangeNtfy(void) */ } -GLOBALPROC ADB_DataLineChngNtfy(void) +void ADB_DataLineChngNtfy(void) { #ifdef _VIA_Debug fprintf(stderr, "ADB_DataLineChngNtfy: %d\n", ADB_Data); #endif } -GLOBALPROC ADB_Update(void) +void ADB_Update(void) { uint8_t state = ADB_st1 * 2 + ADB_st0; diff --git a/src/HW/ADB/ADBEMDEV.h b/src/HW/ADB/ADBEMDEV.h index 8216334..e92a784 100644 --- a/src/HW/ADB/ADBEMDEV.h +++ b/src/HW/ADB/ADBEMDEV.h @@ -21,7 +21,7 @@ #endif -EXPORTPROC ADBstate_ChangeNtfy(void); -EXPORTPROC ADB_DoNewState(void); -EXPORTPROC ADB_DataLineChngNtfy(void); -EXPORTPROC ADB_Update(void); +extern void ADBstate_ChangeNtfy(void); +extern void ADB_DoNewState(void); +extern void ADB_DataLineChngNtfy(void); +extern void ADB_Update(void); diff --git a/src/HW/ADB/ADBSHARE.h b/src/HW/ADB/ADBSHARE.h index 519ce56..5cb027c 100644 --- a/src/HW/ADB/ADBSHARE.h +++ b/src/HW/ADB/ADBSHARE.h @@ -32,18 +32,18 @@ #define ADB_MaxSzDatBuf 8 -LOCALVAR uint8_t ADB_SzDatBuf; -LOCALVAR bool ADB_TalkDatBuf = false; -LOCALVAR uint8_t ADB_DatBuf[ADB_MaxSzDatBuf]; -LOCALVAR uint8_t ADB_CurCmd = 0; -LOCALVAR uint8_t NotSoRandAddr = 1; +static uint8_t ADB_SzDatBuf; +static bool ADB_TalkDatBuf = false; +static uint8_t ADB_DatBuf[ADB_MaxSzDatBuf]; +static uint8_t ADB_CurCmd = 0; +static uint8_t NotSoRandAddr = 1; -LOCALVAR uint8_t MouseADBAddress; -LOCALVAR bool SavedCurMouseButton = false; -LOCALVAR uint16_t MouseADBDeltaH = 0; -LOCALVAR uint16_t MouseADBDeltaV = 0; +static uint8_t MouseADBAddress; +static bool SavedCurMouseButton = false; +static uint16_t MouseADBDeltaH = 0; +static uint16_t MouseADBDeltaV = 0; -LOCALPROC ADB_DoMouseTalk(void) +static void ADB_DoMouseTalk(void) { switch (ADB_CurCmd & 3) { case 0: @@ -118,7 +118,7 @@ LOCALPROC ADB_DoMouseTalk(void) } } -LOCALPROC ADB_DoMouseListen(void) +static void ADB_DoMouseListen(void) { switch (ADB_CurCmd & 3) { case 3: @@ -137,9 +137,9 @@ LOCALPROC ADB_DoMouseListen(void) } } -LOCALVAR uint8_t KeyboardADBAddress; +static uint8_t KeyboardADBAddress; -LOCALFUNC bool CheckForADBkeyEvt(uint8_t *NextADBkeyevt) +static bool CheckForADBkeyEvt(uint8_t *NextADBkeyevt) { int i; bool KeyDown; @@ -177,7 +177,7 @@ LOCALFUNC bool CheckForADBkeyEvt(uint8_t *NextADBkeyevt) } } -LOCALPROC ADB_DoKeyboardTalk(void) +static void ADB_DoKeyboardTalk(void) { switch (ADB_CurCmd & 3) { case 0: @@ -210,7 +210,7 @@ LOCALPROC ADB_DoKeyboardTalk(void) } } -LOCALPROC ADB_DoKeyboardListen(void) +static void ADB_DoKeyboardListen(void) { switch (ADB_CurCmd & 3) { case 3: @@ -229,7 +229,7 @@ LOCALPROC ADB_DoKeyboardListen(void) } } -LOCALFUNC bool CheckForADBanyEvt(void) +static bool CheckForADBanyEvt(void) { EvtQEl *p = EvtQOutP(); if (nullpr != p) { @@ -247,7 +247,7 @@ LOCALFUNC bool CheckForADBanyEvt(void) return (0 != MouseADBDeltaH) && (0 != MouseADBDeltaV); } -LOCALPROC ADB_DoTalk(void) +static void ADB_DoTalk(void) { uint8_t Address = ADB_CurCmd >> 4; if (Address == MouseADBAddress) { @@ -257,7 +257,7 @@ LOCALPROC ADB_DoTalk(void) } } -LOCALPROC ADB_EndListen(void) +static void ADB_EndListen(void) { uint8_t Address = ADB_CurCmd >> 4; if (Address == MouseADBAddress) { @@ -267,13 +267,13 @@ LOCALPROC ADB_EndListen(void) } } -LOCALPROC ADB_DoReset(void) +static void ADB_DoReset(void) { MouseADBAddress = 3; KeyboardADBAddress = 2; } -LOCALPROC ADB_Flush(void) +static void ADB_Flush(void) { uint8_t Address = ADB_CurCmd >> 4; diff --git a/src/HW/DISK/IWMEMDEV.c b/src/HW/DISK/IWMEMDEV.c index c11b4c2..c26d996 100644 --- a/src/HW/DISK/IWMEMDEV.c +++ b/src/HW/DISK/IWMEMDEV.c @@ -81,7 +81,7 @@ typedef struct IWM_Ty IWM; -GLOBALPROC IWM_Reset(void) +void IWM_Reset(void) { IWM.DataIn = IWM.Handshake = IWM.Status = IWM.Mode = IWM.DataOut = IWM.Lines = 0; @@ -89,7 +89,7 @@ GLOBALPROC IWM_Reset(void) typedef enum {On, Off} Mode_Ty; -LOCALPROC IWM_Set_Lines(uint8_t line, Mode_Ty the_mode) +static void IWM_Set_Lines(uint8_t line, Mode_Ty the_mode) { if (the_mode == Off) { IWM.Lines &= (0xFF - line); @@ -98,7 +98,7 @@ LOCALPROC IWM_Set_Lines(uint8_t line, Mode_Ty the_mode) } } -LOCALFUNC uint8_t IWM_Read_Reg(void) +static uint8_t IWM_Read_Reg(void) { switch ((IWM.Lines & (kq6 + kq7)) >> 6) { case 0 : @@ -136,7 +136,7 @@ LOCALFUNC uint8_t IWM_Read_Reg(void) } } -LOCALPROC IWM_Write_Reg(uint8_t in) +static void IWM_Write_Reg(uint8_t in) { if (((IWM.Lines & kmtr) >> 4) == 0) { #ifdef _IWM_Debug @@ -147,7 +147,7 @@ LOCALPROC IWM_Write_Reg(uint8_t in) } } -GLOBALFUNC uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr) + uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr) { switch (addr) { case kph0L : diff --git a/src/HW/DISK/IWMEMDEV.h b/src/HW/DISK/IWMEMDEV.h index f4a63ae..e2c6278 100644 --- a/src/HW/DISK/IWMEMDEV.h +++ b/src/HW/DISK/IWMEMDEV.h @@ -17,8 +17,8 @@ #ifndef IWMEVDEV_H #define IWMEVDEV_H -EXPORTPROC IWM_Reset(void); +extern void IWM_Reset(void); -EXPORTFUNC uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t IWM_Access(uint32_t Data, bool WriteMem, CPTR addr); #endif \ No newline at end of file diff --git a/src/HW/DISK/SONYEMDV.c b/src/HW/DISK/SONYEMDV.c index e213298..120fd95 100644 --- a/src/HW/DISK/SONYEMDV.c +++ b/src/HW/DISK/SONYEMDV.c @@ -44,14 +44,14 @@ */ -LOCALVAR uint32_t vSonyMountedMask = 0; +static uint32_t vSonyMountedMask = 0; #define vSonyIsLocked(Drive_No) \ ((vSonyWritableMask & ((uint32_t)1 << (Drive_No))) == 0) #define vSonyIsMounted(Drive_No) \ ((vSonyMountedMask & ((uint32_t)1 << (Drive_No))) != 0) -LOCALFUNC bool vSonyNextPendingInsert0(tDrive *Drive_No) +static bool vSonyNextPendingInsert0(tDrive *Drive_No) { /* find next drive to Mount */ uint32_t MountPending = vSonyInsertedMask & (~ vSonyMountedMask); @@ -68,7 +68,7 @@ LOCALFUNC bool vSonyNextPendingInsert0(tDrive *Drive_No) return false; } -LOCALFUNC MacErr_t CheckReadableDrive(tDrive Drive_No) +static MacErr_t CheckReadableDrive(tDrive Drive_No) { MacErr_t result; @@ -83,7 +83,7 @@ LOCALFUNC MacErr_t CheckReadableDrive(tDrive Drive_No) return result; } -LOCALFUNC MacErr_t vSonyTransferVM(bool IsWrite, +static MacErr_t vSonyTransferVM(bool IsWrite, CPTR Buffera, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -124,7 +124,7 @@ label_1: return result; } -LOCALPROC MoveBytesVM(CPTR srcPtr, CPTR dstPtr, int32_t byteCount) +static void MoveBytesVM(CPTR srcPtr, CPTR dstPtr, int32_t byteCount) { uint8_t * src; uint8_t * dst; @@ -151,13 +151,13 @@ label_1: } } -LOCALVAR uint32_t ImageDataOffset[NumDrives]; +static uint32_t ImageDataOffset[NumDrives]; /* size of any header in disk image file */ -LOCALVAR uint32_t ImageDataSize[NumDrives]; +static uint32_t ImageDataSize[NumDrives]; /* size of disk image file contents */ #if Sony_SupportTags -LOCALVAR uint32_t ImageTagOffset[NumDrives]; +static uint32_t ImageTagOffset[NumDrives]; /* offset to disk image file tags */ #endif @@ -176,7 +176,7 @@ LOCALVAR uint32_t ImageTagOffset[NumDrives]; #define ChecksumBlockSize 1024 #if Sony_SupportDC42 && Sony_WantChecksumsUpdated -LOCALFUNC MacErr_t DC42BlockChecksum(tDrive Drive_No, +static MacErr_t DC42BlockChecksum(tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *r) { MacErr_t result; @@ -230,7 +230,7 @@ LOCALFUNC MacErr_t DC42BlockChecksum(tDrive Drive_No, #endif #if Sony_WantChecksumsUpdated -LOCALPROC Drive_UpdateChecksums(tDrive Drive_No) +static void Drive_UpdateChecksums(tDrive Drive_No) { if (! vSonyIsLocked(Drive_No)) { uint32_t DataOffset = ImageDataOffset[Drive_No]; @@ -291,7 +291,7 @@ LOCALPROC Drive_UpdateChecksums(tDrive Drive_No) #define Sony_SupportOtherFormats Sony_SupportDC42 -LOCALFUNC MacErr_t vSonyNextPendingInsert(tDrive *Drive_No) +static MacErr_t vSonyNextPendingInsert(tDrive *Drive_No) { tDrive i; MacErr_t result; @@ -432,12 +432,12 @@ LOCALFUNC MacErr_t vSonyNextPendingInsert(tDrive *Drive_No) if call PostEvent too frequently, insert events seem to get lost */ -LOCALVAR uint16_t DelayUntilNextInsert; +static uint16_t DelayUntilNextInsert; -LOCALVAR CPTR MountCallBack = 0; +static CPTR MountCallBack = 0; /* This checks to see if a disk (image) has been inserted */ -GLOBALPROC Sony_Update (void) +void Sony_Update (void) { if (DelayUntilNextInsert != 0) { --DelayUntilNextInsert; @@ -469,7 +469,7 @@ GLOBALPROC Sony_Update (void) } } -LOCALFUNC MacErr_t Drive_Transfer(bool IsWrite, CPTR Buffera, +static MacErr_t Drive_Transfer(bool IsWrite, CPTR Buffera, tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount) { @@ -510,14 +510,14 @@ LOCALFUNC MacErr_t Drive_Transfer(bool IsWrite, CPTR Buffera, return result; } -LOCALVAR bool QuitOnEject = false; +static bool QuitOnEject = false; -GLOBALPROC Sony_SetQuitOnEject(void) +void Sony_SetQuitOnEject(void) { QuitOnEject = true; } -LOCALFUNC MacErr_t Drive_Eject(tDrive Drive_No) +static MacErr_t Drive_Eject(tDrive Drive_No) { MacErr_t result; @@ -539,7 +539,7 @@ LOCALFUNC MacErr_t Drive_Eject(tDrive Drive_No) } #if IncludeSonyNew -LOCALFUNC MacErr_t Drive_EjectDelete(tDrive Drive_No) +static MacErr_t Drive_EjectDelete(tDrive Drive_No) { MacErr_t result; @@ -557,7 +557,7 @@ LOCALFUNC MacErr_t Drive_EjectDelete(tDrive Drive_No) } #endif -GLOBALPROC Sony_EjectAllDisks(void) +void Sony_EjectAllDisks(void) { tDrive i; @@ -572,7 +572,7 @@ GLOBALPROC Sony_EjectAllDisks(void) } } -GLOBALPROC Sony_Reset(void) +void Sony_Reset(void) { DelayUntilNextInsert = 0; QuitOnEject = false; @@ -617,7 +617,7 @@ GLOBALPROC Sony_Reset(void) #define kParamDiskBuffer 16 #define kParamDiskDrive_No 20 -GLOBALPROC ExtnDisk_Access(CPTR p) +void ExtnDisk_Access(CPTR p) { MacErr_t result = mnvm_controlErr; @@ -929,10 +929,10 @@ typedef struct DriverDat_R DriverDat_R; #define Sony_dolog (dbglog_HAVE && 0) #if Sony_SupportTags -LOCALVAR CPTR TheTagBuffer; +static CPTR TheTagBuffer; #endif -LOCALFUNC uint32_t DriveVarsLocation(tDrive Drive_No) +static uint32_t DriveVarsLocation(tDrive Drive_No) { CPTR SonyVars = get_vm_long(SonyVarsPtr); @@ -944,7 +944,7 @@ LOCALFUNC uint32_t DriveVarsLocation(tDrive Drive_No) } } -LOCALFUNC MacErr_t Sony_Mount(CPTR p) +static MacErr_t Sony_Mount(CPTR p) { uint32_t data = get_vm_long(p + ExtnDat_params + 0); MacErr_t result = mnvm_miscErr; @@ -1035,7 +1035,7 @@ LOCALFUNC MacErr_t Sony_Mount(CPTR p) } #if Sony_SupportTags -LOCALFUNC MacErr_t Sony_PrimeTags(tDrive Drive_No, +static MacErr_t Sony_PrimeTags(tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count, bool IsWrite) { MacErr_t result = mnvm_noErr; @@ -1084,7 +1084,7 @@ label_fail: #endif /* Handles I/O to disks */ -LOCALFUNC MacErr_t Sony_Prime(CPTR p) +static MacErr_t Sony_Prime(CPTR p) { MacErr_t result; uint32_t Sony_Count; @@ -1240,7 +1240,7 @@ label_fail: } /* Implements control csCodes for the Sony driver */ -LOCALFUNC MacErr_t Sony_Control(CPTR p) +static MacErr_t Sony_Control(CPTR p) { MacErr_t result; CPTR ParamBlk = get_vm_long(p + ExtnDat_params + 0); @@ -1429,7 +1429,7 @@ LOCALFUNC MacErr_t Sony_Control(CPTR p) } /* Handles the DriveStatus call */ -LOCALFUNC MacErr_t Sony_Status(CPTR p) +static MacErr_t Sony_Status(CPTR p) { MacErr_t result; CPTR ParamBlk = get_vm_long(p + ExtnDat_params + 0); @@ -1473,7 +1473,7 @@ LOCALFUNC MacErr_t Sony_Status(CPTR p) return result; } -LOCALFUNC MacErr_t Sony_Close(CPTR p) +static MacErr_t Sony_Close(CPTR p) { #if 0 CPTR ParamBlk = get_vm_long(p + ExtnDat_params + 0); @@ -1483,7 +1483,7 @@ LOCALFUNC MacErr_t Sony_Close(CPTR p) return mnvm_closErr; /* Can't Close Driver */ } -LOCALFUNC MacErr_t Sony_OpenA(CPTR p) +static MacErr_t Sony_OpenA(CPTR p) { #if Sony_dolog dbglog_WriteNote("Sony : OpenA"); @@ -1504,7 +1504,7 @@ LOCALFUNC MacErr_t Sony_OpenA(CPTR p) } } -LOCALFUNC MacErr_t Sony_OpenB(CPTR p) +static MacErr_t Sony_OpenB(CPTR p) { int16_t i; CPTR dvl; @@ -1579,7 +1579,7 @@ LOCALFUNC MacErr_t Sony_OpenB(CPTR p) return mnvm_noErr; } -LOCALFUNC MacErr_t Sony_OpenC(CPTR p) +static MacErr_t Sony_OpenC(CPTR p) { #if Sony_dolog dbglog_WriteNote("Sony : OpenC"); @@ -1602,7 +1602,7 @@ LOCALFUNC MacErr_t Sony_OpenC(CPTR p) #define kCmndSonyOpenC 7 #define kCmndSonyMount 8 -GLOBALPROC ExtnSony_Access(CPTR p) +void ExtnSony_Access(CPTR p) { MacErr_t result; diff --git a/src/HW/DISK/SONYEMDV.h b/src/HW/DISK/SONYEMDV.h index 3de4841..5afe601 100644 --- a/src/HW/DISK/SONYEMDV.h +++ b/src/HW/DISK/SONYEMDV.h @@ -20,12 +20,12 @@ #define SONYEMDV_H #endif -EXPORTPROC ExtnDisk_Access(CPTR p); -EXPORTPROC ExtnSony_Access(CPTR p); +extern void ExtnDisk_Access(CPTR p); +extern void ExtnSony_Access(CPTR p); -EXPORTPROC Sony_SetQuitOnEject(void); +extern void Sony_SetQuitOnEject(void); -EXPORTPROC Sony_EjectAllDisks(void); -EXPORTPROC Sony_Reset(void); +extern void Sony_EjectAllDisks(void); +extern void Sony_Reset(void); -EXPORTPROC Sony_Update(void); +extern void Sony_Update(void); diff --git a/src/HW/KBRD/KBRDEMDV.c b/src/HW/KBRD/KBRDEMDV.c index a4345b9..25660da 100644 --- a/src/HW/KBRD/KBRDEMDV.c +++ b/src/HW/KBRD/KBRDEMDV.c @@ -39,8 +39,8 @@ ReportAbnormalID unused 0x0B03 - 0x0BFF */ -IMPORTPROC KYBD_ShiftOutData(uint8_t v); -IMPORTFUNC uint8_t KYBD_ShiftInData(void); +extern void KYBD_ShiftOutData(uint8_t v); +extern uint8_t KYBD_ShiftInData(void); enum { kKybdStateIdle, @@ -51,12 +51,12 @@ enum { kKybdStates }; -LOCALVAR int KybdState = kKybdStateIdle; +static int KybdState = kKybdStateIdle; -LOCALVAR bool HaveKeyBoardResult = false; -LOCALVAR uint8_t KeyBoardResult; +static bool HaveKeyBoardResult = false; +static uint8_t KeyBoardResult; -LOCALPROC GotKeyBoardData(uint8_t v) +static void GotKeyBoardData(uint8_t v) { if (KybdState != kKybdStateIdle) { HaveKeyBoardResult = true; @@ -67,9 +67,9 @@ LOCALPROC GotKeyBoardData(uint8_t v) } } -LOCALVAR uint8_t InstantCommandData = 0x7B; +static uint8_t InstantCommandData = 0x7B; -LOCALFUNC bool AttemptToFinishInquiry(void) +static bool AttemptToFinishInquiry(void) { int i; bool KeyDown; @@ -103,9 +103,9 @@ LOCALFUNC bool AttemptToFinishInquiry(void) to keep connection. */ -LOCALVAR int InquiryCommandTimer = 0; +static int InquiryCommandTimer = 0; -GLOBALPROC DoKybd_ReceiveCommand(void) +void DoKybd_ReceiveCommand(void) { if (KybdState != kKybdStateRecievingCommand) { ReportAbnormalID(0x0B01, @@ -147,7 +147,7 @@ GLOBALPROC DoKybd_ReceiveCommand(void) } } -GLOBALPROC DoKybd_ReceiveEndCommand(void) +void DoKybd_ReceiveEndCommand(void) { if (KybdState != kKybdStateRecievingEndCommand) { ReportAbnormalID(0x0B02, @@ -168,7 +168,7 @@ GLOBALPROC DoKybd_ReceiveEndCommand(void) } } -GLOBALPROC Kybd_DataLineChngNtfy(void) +void Kybd_DataLineChngNtfy(void) { switch (KybdState) { case kKybdStateIdle: @@ -199,7 +199,7 @@ GLOBALPROC Kybd_DataLineChngNtfy(void) } } -GLOBALPROC KeyBoard_Update(void) +void KeyBoard_Update(void) { if (InquiryCommandTimer != 0) { if (AttemptToFinishInquiry()) { diff --git a/src/HW/KBRD/KBRDEMDV.h b/src/HW/KBRD/KBRDEMDV.h index 2ca2f13..7fa1754 100644 --- a/src/HW/KBRD/KBRDEMDV.h +++ b/src/HW/KBRD/KBRDEMDV.h @@ -21,7 +21,7 @@ #endif -EXPORTPROC Kybd_DataLineChngNtfy(void); -EXPORTPROC DoKybd_ReceiveEndCommand(void); -EXPORTPROC DoKybd_ReceiveCommand(void); -EXPORTPROC KeyBoard_Update(void); +extern void Kybd_DataLineChngNtfy(void); +extern void DoKybd_ReceiveEndCommand(void); +extern void DoKybd_ReceiveCommand(void); +extern void KeyBoard_Update(void); diff --git a/src/HW/M68K/DISAM68K.c b/src/HW/M68K/DISAM68K.c index 03a1e43..ada1535 100644 --- a/src/HW/M68K/DISAM68K.c +++ b/src/HW/M68K/DISAM68K.c @@ -31,7 +31,7 @@ #include "HW/M68K/DISAM68K.h" -LOCALVAR uint32_t Disasm_pc; +static uint32_t Disasm_pc; /* don't use get_vm_byte/get_vm_word/get_vm_long @@ -39,15 +39,15 @@ LOCALVAR uint32_t Disasm_pc; (if pc points to memory mapped device) */ -LOCALVAR uint8_t * Disasm_pcp; -LOCALVAR uint32_t Disasm_pc_blockmask; -LOCALVAR uint8_t Disasm_pcp_dummy[2] = { +static uint8_t * Disasm_pcp; +static uint32_t Disasm_pc_blockmask; +static uint8_t Disasm_pcp_dummy[2] = { 0, 0 }; -IMPORTFUNC ATTep FindATTel(CPTR addr); +extern ATTep FindATTel(CPTR addr); -LOCALPROC Disasm_Find_pcp(void) +static void Disasm_Find_pcp(void) { ATTep p; @@ -63,7 +63,7 @@ LOCALPROC Disasm_Find_pcp(void) } } -LOCALFUNC uint16_t Disasm_nextiword(void) +static uint16_t Disasm_nextiword(void) /* NOT sign extended */ { uint16_t r = do_get_mem_word(Disasm_pcp); @@ -75,12 +75,12 @@ LOCALFUNC uint16_t Disasm_nextiword(void) return r; } -LOCALINLINEFUNC uint8_t Disasm_nextibyte(void) +static uint8_t Disasm_nextibyte(void) { return (uint8_t) Disasm_nextiword(); } -LOCALFUNC uint32_t Disasm_nextilong(void) +static uint32_t Disasm_nextilong(void) { uint32_t hi = Disasm_nextiword(); uint32_t lo = Disasm_nextiword(); @@ -90,7 +90,7 @@ LOCALFUNC uint32_t Disasm_nextilong(void) return r; } -LOCALPROC Disasm_setpc(CPTR newpc) +static void Disasm_setpc(CPTR newpc) { if (newpc != Disasm_pc) { Disasm_pc = newpc; @@ -99,9 +99,9 @@ LOCALPROC Disasm_setpc(CPTR newpc) } } -LOCALVAR uint32_t Disasm_opcode; +static uint32_t Disasm_opcode; -LOCALVAR uint32_t Disasm_opsize; +static uint32_t Disasm_opsize; #define Disasm_b76 ((Disasm_opcode >> 6) & 3) #define Disasm_b8 ((Disasm_opcode >> 8) & 1) @@ -110,7 +110,7 @@ LOCALVAR uint32_t Disasm_opsize; #define Disasm_md6 ((Disasm_opcode >> 6) & 7) #define Disasm_rg9 ((Disasm_opcode >> 9) & 7) -LOCALPROC DisasmOpSizeFromb76(void) +static void DisasmOpSizeFromb76(void) { Disasm_opsize = 1 << Disasm_b76; switch (Disasm_opsize) { @@ -126,7 +126,7 @@ LOCALPROC DisasmOpSizeFromb76(void) } } -LOCALPROC DisasmModeRegister(uint32_t themode, uint32_t thereg) +static void DisasmModeRegister(uint32_t themode, uint32_t thereg) { switch (themode) { case 0 : @@ -212,12 +212,12 @@ LOCALPROC DisasmModeRegister(uint32_t themode, uint32_t thereg) } } -LOCALPROC DisasmStartOne(char *s) +static void DisasmStartOne(char *s) { dbglog_writeCStr(s); } -LOCALPROC Disasm_xxxxxxxxssmmmrrr(char *s) +static void Disasm_xxxxxxxxssmmmrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -226,7 +226,7 @@ LOCALPROC Disasm_xxxxxxxxssmmmrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmEaD_xxxxdddxssmmmrrr(char *s) +static void DisasmEaD_xxxxdddxssmmmrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -238,7 +238,7 @@ LOCALPROC DisasmEaD_xxxxdddxssmmmrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmI_xxxxxxxxssmmmrrr(char *s) +static void DisasmI_xxxxxxxxssmmmrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -255,7 +255,7 @@ LOCALPROC DisasmI_xxxxxxxxssmmmrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmsAA_xxxxdddxssxxxrrr(char *s) +static void DisasmsAA_xxxxdddxssxxxrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -265,7 +265,7 @@ LOCALPROC DisasmsAA_xxxxdddxssxxxrrr(char *s) dbglog_writeReturn(); } -LOCALFUNC uint32_t Disasm_octdat(uint32_t x) +static uint32_t Disasm_octdat(uint32_t x) { if (x == 0) { return 8; @@ -274,7 +274,7 @@ LOCALFUNC uint32_t Disasm_octdat(uint32_t x) } } -LOCALPROC Disasm_xxxxnnnxssmmmrrr(char *s) +static void Disasm_xxxxnnnxssmmmrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -286,7 +286,7 @@ LOCALPROC Disasm_xxxxnnnxssmmmrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmDEa_xxxxdddxssmmmrrr(char *s) +static void DisasmDEa_xxxxdddxssmmmrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -297,7 +297,7 @@ LOCALPROC DisasmDEa_xxxxdddxssmmmrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmEaA_xxxxdddsxxmmmrrr(char *s) +static void DisasmEaA_xxxxdddsxxmmmrrr(char *s) { DisasmStartOne(s); @@ -314,7 +314,7 @@ LOCALPROC DisasmEaA_xxxxdddsxxmmmrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmDD_xxxxdddxssxxxrrr(char *s) +static void DisasmDD_xxxxdddxssxxxrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -325,7 +325,7 @@ LOCALPROC DisasmDD_xxxxdddxssxxxrrr(char *s) dbglog_writeReturn(); } -LOCALPROC DisasmAAs_xxxxdddxssxxxrrr(char *s) +static void DisasmAAs_xxxxdddxssxxxrrr(char *s) { DisasmStartOne(s); DisasmOpSizeFromb76(); @@ -336,31 +336,31 @@ LOCALPROC DisasmAAs_xxxxdddxssxxxrrr(char *s) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmTst(void) +static void DisasmTst(void) { /* Tst 01001010ssmmmrrr */ Disasm_xxxxxxxxssmmmrrr("TST"); } -LOCALPROCUSEDONCE DisasmCompare(void) +static void DisasmCompare(void) { /* Cmp 1011ddd0ssmmmrrr */ DisasmEaD_xxxxdddxssmmmrrr("CMP"); } -LOCALPROCUSEDONCE DisasmCmpI(void) +static void DisasmCmpI(void) { /* CMPI 00001100ssmmmrrr */ DisasmI_xxxxxxxxssmmmrrr("CMP"); } -LOCALPROCUSEDONCE DisasmCmpM(void) +static void DisasmCmpM(void) { /* CmpM 1011ddd1ss001rrr */ DisasmsAA_xxxxdddxssxxxrrr("CMP"); } -LOCALPROC DisasmCC(void) +static void DisasmCC(void) { switch ((Disasm_opcode >> 8) & 15) { case 0: dbglog_writeCStr("T"); break; @@ -383,7 +383,7 @@ LOCALPROC DisasmCC(void) } } -LOCALPROCUSEDONCE DisasmBcc(void) +static void DisasmBcc(void) { /* Bcc 0110ccccnnnnnnnn */ uint32_t src = ((uint32_t)Disasm_opcode) & 255; @@ -414,7 +414,7 @@ LOCALPROCUSEDONCE DisasmBcc(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmDBcc(void) +static void DisasmDBcc(void) { /* DBcc 0101cccc11001ddd */ @@ -432,7 +432,7 @@ LOCALPROCUSEDONCE DisasmDBcc(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmSwap(void) +static void DisasmSwap(void) { /* Swap 0100100001000rrr */ @@ -441,7 +441,7 @@ LOCALPROCUSEDONCE DisasmSwap(void) dbglog_writeReturn(); } -LOCALPROC DisasmMove(void) /* MOVE */ +static void DisasmMove(void) /* MOVE */ { DisasmModeRegister(Disasm_mode, Disasm_reg); dbglog_writeCStr(", "); @@ -449,42 +449,42 @@ LOCALPROC DisasmMove(void) /* MOVE */ dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveL(void) +static void DisasmMoveL(void) { DisasmStartOne("MOVE.L "); Disasm_opsize = 4; DisasmMove(); } -LOCALPROCUSEDONCE DisasmMoveW(void) +static void DisasmMoveW(void) { DisasmStartOne("MOVE.W "); Disasm_opsize = 2; DisasmMove(); } -LOCALPROCUSEDONCE DisasmMoveB(void) +static void DisasmMoveB(void) { DisasmStartOne("MOVE.B "); Disasm_opsize = 1; DisasmMove(); } -LOCALPROCUSEDONCE DisasmMoveAL(void) +static void DisasmMoveAL(void) { DisasmStartOne("MOVEA.L "); Disasm_opsize = 4; DisasmMove(); } -LOCALPROCUSEDONCE DisasmMoveAW(void) +static void DisasmMoveAW(void) { DisasmStartOne("MOVEA.W "); Disasm_opsize = 2; DisasmMove(); } -LOCALPROCUSEDONCE DisasmMoveQ(void) +static void DisasmMoveQ(void) { /* MoveQ 0111ddd0nnnnnnnn */ DisasmStartOne("MOVEQ #"); @@ -494,49 +494,49 @@ LOCALPROCUSEDONCE DisasmMoveQ(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmAddEaR(void) +static void DisasmAddEaR(void) { DisasmEaD_xxxxdddxssmmmrrr("ADD"); } -LOCALPROCUSEDONCE DisasmAddQ(void) +static void DisasmAddQ(void) { /* AddQ 0101nnn0ssmmmrrr */ Disasm_xxxxnnnxssmmmrrr("ADDQ"); } -LOCALPROCUSEDONCE DisasmAddI(void) +static void DisasmAddI(void) { DisasmI_xxxxxxxxssmmmrrr("ADDI"); } -LOCALPROCUSEDONCE DisasmAddREa(void) +static void DisasmAddREa(void) { DisasmDEa_xxxxdddxssmmmrrr("ADD"); } -LOCALPROCUSEDONCE DisasmSubEaR(void) +static void DisasmSubEaR(void) { DisasmEaD_xxxxdddxssmmmrrr("SUB"); } -LOCALPROCUSEDONCE DisasmSubQ(void) +static void DisasmSubQ(void) { /* SubQ 0101nnn1ssmmmrrr */ Disasm_xxxxnnnxssmmmrrr("SUBQ"); } -LOCALPROCUSEDONCE DisasmSubI(void) +static void DisasmSubI(void) { DisasmI_xxxxxxxxssmmmrrr("SUBI"); } -LOCALPROCUSEDONCE DisasmSubREa(void) +static void DisasmSubREa(void) { DisasmDEa_xxxxdddxssmmmrrr("SUB"); } -LOCALPROCUSEDONCE DisasmLea(void) +static void DisasmLea(void) { /* Lea 0100aaa111mmmrrr */ DisasmStartOne("LEA "); @@ -546,7 +546,7 @@ LOCALPROCUSEDONCE DisasmLea(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmPEA(void) +static void DisasmPEA(void) { /* PEA 0100100001mmmrrr */ DisasmStartOne("PEA "); @@ -554,14 +554,14 @@ LOCALPROCUSEDONCE DisasmPEA(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmALine(void) +static void DisasmALine(void) { DisasmStartOne("$"); dbglog_writeHex(Disasm_opcode); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmBsr(void) +static void DisasmBsr(void) { uint32_t src = ((uint32_t)Disasm_opcode) & 255; uint32_t s = Disasm_pc; @@ -584,7 +584,7 @@ LOCALPROCUSEDONCE DisasmBsr(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmJsr(void) +static void DisasmJsr(void) { /* Jsr 0100111010mmmrrr */ DisasmStartOne("JSR "); @@ -592,14 +592,14 @@ LOCALPROCUSEDONCE DisasmJsr(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmLinkA6(void) +static void DisasmLinkA6(void) { DisasmStartOne("LINK A6, "); dbglog_writeHex(Disasm_nextiword()); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMOVEMRmM(void) +static void DisasmMOVEMRmM(void) { /* MOVEM reg to mem 0100100011s100rrr */ int16_t z; @@ -631,7 +631,7 @@ LOCALPROCUSEDONCE DisasmMOVEMRmM(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMOVEMApR(void) +static void DisasmMOVEMApR(void) { /* MOVEM mem to reg 0100110011s011rrr */ int16_t z; @@ -663,20 +663,20 @@ LOCALPROCUSEDONCE DisasmMOVEMApR(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmUnlkA6(void) +static void DisasmUnlkA6(void) { DisasmStartOne("UNLINK A6"); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmRts(void) +static void DisasmRts(void) { /* Rts 0100111001110101 */ DisasmStartOne("RTS"); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmJmp(void) +static void DisasmJmp(void) { /* JMP 0100111011mmmrrr */ DisasmStartOne("JMP "); @@ -684,19 +684,19 @@ LOCALPROCUSEDONCE DisasmJmp(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmClr(void) +static void DisasmClr(void) { /* Clr 01000010ssmmmrrr */ Disasm_xxxxxxxxssmmmrrr("CLR"); } -LOCALPROCUSEDONCE DisasmAddA(void) +static void DisasmAddA(void) { /* ADDA 1101dddm11mmmrrr */ DisasmEaA_xxxxdddsxxmmmrrr("ADDA"); } -LOCALPROCUSEDONCE DisasmAddQA(void) +static void DisasmAddQA(void) { /* 0101nnn0ss001rrr */ DisasmStartOne("ADDQA #"); @@ -706,7 +706,7 @@ LOCALPROCUSEDONCE DisasmAddQA(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmSubQA(void) +static void DisasmSubQA(void) { /* 0101nnn1ss001rrr */ DisasmStartOne("SUBQA #"); @@ -716,13 +716,13 @@ LOCALPROCUSEDONCE DisasmSubQA(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmSubA(void) +static void DisasmSubA(void) { /* SUBA 1001dddm11mmmrrr */ DisasmEaA_xxxxdddsxxmmmrrr("SUBA"); } -LOCALPROCUSEDONCE DisasmCmpA(void) +static void DisasmCmpA(void) { DisasmStartOne("CMPA "); Disasm_opsize = Disasm_b8 * 2 + 2; @@ -732,27 +732,27 @@ LOCALPROCUSEDONCE DisasmCmpA(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmAddXd(void) +static void DisasmAddXd(void) { DisasmDD_xxxxdddxssxxxrrr("ADDX"); } -LOCALPROCUSEDONCE DisasmAddXm(void) +static void DisasmAddXm(void) { DisasmAAs_xxxxdddxssxxxrrr("ADDX"); } -LOCALPROCUSEDONCE DisasmSubXd(void) +static void DisasmSubXd(void) { DisasmDD_xxxxdddxssxxxrrr("SUBX"); } -LOCALPROCUSEDONCE DisasmSubXm(void) +static void DisasmSubXm(void) { DisasmAAs_xxxxdddxssxxxrrr("SUBX"); } -LOCALPROC DisasmBinOp1(uint32_t x) +static void DisasmBinOp1(uint32_t x) { if (! Disasm_b8) { switch (x) { @@ -793,7 +793,7 @@ LOCALPROC DisasmBinOp1(uint32_t x) } } -LOCALPROCUSEDONCE DisasmRolopNM(void) +static void DisasmRolopNM(void) { DisasmBinOp1(Disasm_rg9); dbglog_writeCStr(" "); @@ -802,7 +802,7 @@ LOCALPROCUSEDONCE DisasmRolopNM(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmRolopND(void) +static void DisasmRolopND(void) { /* 1110cccdss0ttddd */ DisasmBinOp1(Disasm_mode & 3); @@ -814,7 +814,7 @@ LOCALPROCUSEDONCE DisasmRolopND(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmRolopDD(void) +static void DisasmRolopDD(void) { /* 1110rrrdss1ttddd */ DisasmBinOp1(Disasm_mode & 3); @@ -826,7 +826,7 @@ LOCALPROCUSEDONCE DisasmRolopDD(void) dbglog_writeReturn(); } -LOCALPROC DisasmBinBitOp1(void) +static void DisasmBinBitOp1(void) { switch (Disasm_b76) { case 0: @@ -847,7 +847,7 @@ LOCALPROC DisasmBinBitOp1(void) } } -LOCALPROCUSEDONCE DisasmBitOpDD(void) +static void DisasmBitOpDD(void) { /* dynamic bit, Opcode = 0000ddd1tt000rrr */ DisasmBinBitOp1(); @@ -859,7 +859,7 @@ LOCALPROCUSEDONCE DisasmBitOpDD(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmBitOpDM(void) +static void DisasmBitOpDM(void) { /* dynamic bit, Opcode = 0000ddd1ttmmmrrr */ DisasmBinBitOp1(); @@ -871,7 +871,7 @@ LOCALPROCUSEDONCE DisasmBitOpDM(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmBitOpND(void) +static void DisasmBitOpND(void) { /* static bit 00001010tt000rrr */ DisasmBinBitOp1(); @@ -883,7 +883,7 @@ LOCALPROCUSEDONCE DisasmBitOpND(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmBitOpNM(void) +static void DisasmBitOpNM(void) { /* static bit 00001010ttmmmrrr */ DisasmBinBitOp1(); @@ -895,58 +895,58 @@ LOCALPROCUSEDONCE DisasmBitOpNM(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmAndI(void) +static void DisasmAndI(void) { DisasmI_xxxxxxxxssmmmrrr("ANDI"); } -LOCALPROCUSEDONCE DisasmAndDEa(void) +static void DisasmAndDEa(void) { /* And 1100ddd1ssmmmrrr */ DisasmDEa_xxxxdddxssmmmrrr("AND"); } -LOCALPROCUSEDONCE DisasmAndEaD(void) +static void DisasmAndEaD(void) { /* And 1100ddd0ssmmmrrr */ DisasmEaD_xxxxdddxssmmmrrr("AND"); } -LOCALPROCUSEDONCE DisasmOrI(void) +static void DisasmOrI(void) { DisasmI_xxxxxxxxssmmmrrr("ORI"); } -LOCALPROCUSEDONCE DisasmOrDEa(void) +static void DisasmOrDEa(void) { /* OR 1000ddd1ssmmmrrr */ DisasmDEa_xxxxdddxssmmmrrr("OR"); } -LOCALPROCUSEDONCE DisasmOrEaD(void) +static void DisasmOrEaD(void) { /* OR 1000ddd0ssmmmrrr */ DisasmEaD_xxxxdddxssmmmrrr("OR"); } -LOCALPROCUSEDONCE DisasmEorI(void) +static void DisasmEorI(void) { DisasmI_xxxxxxxxssmmmrrr("EORI"); } -LOCALPROCUSEDONCE DisasmEor(void) +static void DisasmEor(void) { /* Eor 1011ddd1ssmmmrrr */ DisasmDEa_xxxxdddxssmmmrrr("EOR"); } -LOCALPROCUSEDONCE DisasmNot(void) +static void DisasmNot(void) { /* Not 01000110ssmmmrrr */ Disasm_xxxxxxxxssmmmrrr("NOT"); } -LOCALPROCUSEDONCE DisasmScc(void) +static void DisasmScc(void) { /* Scc 0101cccc11mmmrrr */ Disasm_opsize = 1; @@ -957,33 +957,33 @@ LOCALPROCUSEDONCE DisasmScc(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmEXTL(void) +static void DisasmEXTL(void) { DisasmStartOne("EXT.L D"); dbglog_writeHex(Disasm_reg); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmEXTW(void) +static void DisasmEXTW(void) { DisasmStartOne("EXT.W D"); dbglog_writeHex(Disasm_reg); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmNeg(void) +static void DisasmNeg(void) { /* Neg 01000100ssmmmrrr */ Disasm_xxxxxxxxssmmmrrr("NEG"); } -LOCALPROCUSEDONCE DisasmNegX(void) +static void DisasmNegX(void) { /* NegX 01000000ssmmmrrr */ Disasm_xxxxxxxxssmmmrrr("NEGX"); } -LOCALPROCUSEDONCE DisasmMulU(void) +static void DisasmMulU(void) { /* MulU 1100ddd011mmmrrr */ Disasm_opsize = 2; @@ -995,7 +995,7 @@ LOCALPROCUSEDONCE DisasmMulU(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMulS(void) +static void DisasmMulS(void) { /* MulS 1100ddd111mmmrrr */ Disasm_opsize = 2; @@ -1007,7 +1007,7 @@ LOCALPROCUSEDONCE DisasmMulS(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmDivU(void) +static void DisasmDivU(void) { /* DivU 1000ddd011mmmrrr */ @@ -1020,7 +1020,7 @@ LOCALPROCUSEDONCE DisasmDivU(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmDivS(void) +static void DisasmDivS(void) { /* DivS 1000ddd111mmmrrr */ @@ -1033,7 +1033,7 @@ LOCALPROCUSEDONCE DisasmDivS(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmExgdd(void) +static void DisasmExgdd(void) { /* Exg 1100ddd101000rrr */ @@ -1045,7 +1045,7 @@ LOCALPROCUSEDONCE DisasmExgdd(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmExgaa(void) +static void DisasmExgaa(void) { /* Exg 1100ddd101001rrr */ @@ -1057,7 +1057,7 @@ LOCALPROCUSEDONCE DisasmExgaa(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmExgda(void) +static void DisasmExgda(void) { /* Exg 1100ddd110001rrr */ @@ -1069,7 +1069,7 @@ LOCALPROCUSEDONCE DisasmExgda(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveCCREa(void) +static void DisasmMoveCCREa(void) { /* Move from CCR 0100001011mmmrrr */ Disasm_opsize = 2; @@ -1078,7 +1078,7 @@ LOCALPROCUSEDONCE DisasmMoveCCREa(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveEaCR(void) +static void DisasmMoveEaCR(void) { /* 0100010011mmmrrr */ Disasm_opsize = 2; @@ -1088,7 +1088,7 @@ LOCALPROCUSEDONCE DisasmMoveEaCR(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveSREa(void) +static void DisasmMoveSREa(void) { /* Move from SR 0100000011mmmrrr */ Disasm_opsize = 2; @@ -1097,7 +1097,7 @@ LOCALPROCUSEDONCE DisasmMoveSREa(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveEaSR(void) +static void DisasmMoveEaSR(void) { /* 0100011011mmmrrr */ Disasm_opsize = 2; @@ -1107,7 +1107,7 @@ LOCALPROCUSEDONCE DisasmMoveEaSR(void) dbglog_writeReturn(); } -LOCALPROC DisasmBinOpStatusCCR(void) +static void DisasmBinOpStatusCCR(void) { switch (Disasm_rg9) { case 0 : @@ -1133,7 +1133,7 @@ LOCALPROC DisasmBinOpStatusCCR(void) dbglog_writeReturn(); } -LOCALPROC disasmreglist(int16_t direction, uint32_t m1, uint32_t r1) +static void disasmreglist(int16_t direction, uint32_t m1, uint32_t r1) { int16_t z; uint32_t regmask; @@ -1176,19 +1176,19 @@ LOCALPROC disasmreglist(int16_t direction, uint32_t m1, uint32_t r1) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMOVEMrm(void) +static void DisasmMOVEMrm(void) { /* MOVEM reg to mem 010010001ssmmmrrr */ disasmreglist(0, Disasm_mode, Disasm_reg); } -LOCALPROCUSEDONCE DisasmMOVEMmr(void) +static void DisasmMOVEMmr(void) { /* MOVEM mem to reg 0100110011smmmrrr */ disasmreglist(1, Disasm_mode, Disasm_reg); } -LOCALPROC DisasmByteBinOp(char *s, uint32_t m1, uint32_t r1, uint32_t m2, uint32_t r2) +static void DisasmByteBinOp(char *s, uint32_t m1, uint32_t r1, uint32_t m2, uint32_t r2) { DisasmStartOne(s); dbglog_writeCStr(" "); @@ -1199,51 +1199,51 @@ LOCALPROC DisasmByteBinOp(char *s, uint32_t m1, uint32_t r1, uint32_t m2, uint32 dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmAbcdr(void) +static void DisasmAbcdr(void) { /* ABCD 1100ddd100000rrr */ DisasmByteBinOp("ABCD", 0, Disasm_reg, 0, Disasm_rg9); } -LOCALPROCUSEDONCE DisasmAbcdm(void) +static void DisasmAbcdm(void) { /* ABCD 1100ddd100001rrr */ DisasmByteBinOp("ABCD", 4, Disasm_reg, 4, Disasm_rg9); } -LOCALPROCUSEDONCE DisasmSbcdr(void) +static void DisasmSbcdr(void) { /* SBCD 1000xxx100000xxx */ DisasmByteBinOp("ABCD", 0, Disasm_reg, 0, Disasm_rg9); } -LOCALPROCUSEDONCE DisasmSbcdm(void) +static void DisasmSbcdm(void) { /* SBCD 1000xxx100001xxx */ DisasmByteBinOp("ABCD", 4, Disasm_reg, 4, Disasm_rg9); } -LOCALPROCUSEDONCE DisasmNbcd(void) +static void DisasmNbcd(void) { /* Nbcd 0100100000mmmrrr */ Disasm_xxxxxxxxssmmmrrr("NBCD"); } -LOCALPROCUSEDONCE DisasmRte(void) +static void DisasmRte(void) { /* Rte 0100111001110011 */ DisasmStartOne("RTE"); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmNop(void) +static void DisasmNop(void) { /* Nop 0100111001110001 */ DisasmStartOne("NOP"); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveP(void) +static void DisasmMoveP(void) { /* MoveP 0000ddd1mm001aaa */ @@ -1268,13 +1268,13 @@ LOCALPROCUSEDONCE DisasmMoveP(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmIllegal(void) +static void DisasmIllegal(void) { DisasmStartOne("ILLEGAL"); dbglog_writeReturn(); } -LOCALPROC DisasmCheck(void) +static void DisasmCheck(void) { DisasmStartOne("CHK"); if (2 == Disasm_opsize) { @@ -1290,14 +1290,14 @@ LOCALPROC DisasmCheck(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmChkW(void) +static void DisasmChkW(void) { /* Chk.W 0100ddd110mmmrrr */ Disasm_opsize = 2; DisasmCheck(); } -LOCALPROCUSEDONCE DisasmTrap(void) +static void DisasmTrap(void) { /* Trap 010011100100vvvv */ DisasmStartOne("TRAP "); @@ -1305,21 +1305,21 @@ LOCALPROCUSEDONCE DisasmTrap(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmTrapV(void) +static void DisasmTrapV(void) { /* TrapV 0100111001110110 */ DisasmStartOne("TRAPV"); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmRtr(void) +static void DisasmRtr(void) { /* Rtr 0100111001110111 */ DisasmStartOne("RTR"); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmLink(void) +static void DisasmLink(void) { DisasmStartOne("LINK A"); dbglog_writeHex(Disasm_reg); @@ -1328,14 +1328,14 @@ LOCALPROCUSEDONCE DisasmLink(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmUnlk(void) +static void DisasmUnlk(void) { DisasmStartOne("UNLINK A"); dbglog_writeHex(Disasm_reg); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveRUSP(void) +static void DisasmMoveRUSP(void) { /* MOVE USP 0100111001100aaa */ DisasmStartOne("MOVE A"); @@ -1344,7 +1344,7 @@ LOCALPROCUSEDONCE DisasmMoveRUSP(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmMoveUSPR(void) +static void DisasmMoveUSPR(void) { /* MOVE USP 0100111001101aaa */ DisasmStartOne("MOVE USP, A"); @@ -1352,7 +1352,7 @@ LOCALPROCUSEDONCE DisasmMoveUSPR(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmTas(void) +static void DisasmTas(void) { /* Tas 0100101011mmmrrr */ Disasm_opsize = 1; @@ -1362,14 +1362,14 @@ LOCALPROCUSEDONCE DisasmTas(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmFLine(void) +static void DisasmFLine(void) { DisasmStartOne("$"); dbglog_writeHex(Disasm_opcode); dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmCallMorRtm(void) +static void DisasmCallMorRtm(void) { DisasmStartOne("CALLM #"); dbglog_writeHex(Disasm_nextibyte()); @@ -1378,7 +1378,7 @@ LOCALPROCUSEDONCE DisasmCallMorRtm(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmStop(void) +static void DisasmStop(void) { /* Stop 0100111001110010 */ DisasmStartOne("STOP #"); @@ -1386,7 +1386,7 @@ LOCALPROCUSEDONCE DisasmStop(void) dbglog_writeReturn(); } -LOCALPROCUSEDONCE DisasmReset(void) +static void DisasmReset(void) { /* Reset 0100111001100000 */ DisasmStartOne("RESET"); @@ -1394,7 +1394,7 @@ LOCALPROCUSEDONCE DisasmReset(void) } #if Use68020 -LOCALPROCUSEDONCE DisasmEXTBL(void) +static void DisasmEXTBL(void) { /* EXTB.L */ DisasmStartOne("EXTB.L D"); @@ -1404,7 +1404,7 @@ LOCALPROCUSEDONCE DisasmEXTBL(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmTRAPcc(void) +static void DisasmTRAPcc(void) { /* TRAPcc 0101cccc11111sss */ @@ -1433,7 +1433,7 @@ LOCALPROCUSEDONCE DisasmTRAPcc(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmChkL(void) +static void DisasmChkL(void) { /* Chk.L 0100ddd100mmmrrr */ Disasm_opsize = 4; @@ -1442,7 +1442,7 @@ LOCALPROCUSEDONCE DisasmChkL(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmBkpt(void) +static void DisasmBkpt(void) { /* BKPT 0100100001001rrr */ DisasmStartOne("BKPT #"); @@ -1452,7 +1452,7 @@ LOCALPROCUSEDONCE DisasmBkpt(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmDivL(void) +static void DisasmDivL(void) { /* DIVU 0100110001mmmrrr 0rrr0s0000000rrr */ /* DIVS 0100110001mmmrrr 0rrr1s0000000rrr */ @@ -1492,7 +1492,7 @@ LOCALPROCUSEDONCE DisasmDivL(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmMulL(void) +static void DisasmMulL(void) { /* MULU 0100110000mmmrrr 0rrr0s0000000rrr */ /* MULS 0100110000mmmrrr 0rrr1s0000000rrr */ @@ -1531,7 +1531,7 @@ LOCALPROCUSEDONCE DisasmMulL(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmRtd(void) +static void DisasmRtd(void) { /* Rtd 0100111001110100 */ DisasmStartOne("RTD #"); @@ -1541,7 +1541,7 @@ LOCALPROCUSEDONCE DisasmRtd(void) #endif #if Use68020 -LOCALPROC DisasmControlReg(uint16_t i) +static void DisasmControlReg(uint16_t i) { switch (i) { case 0x0000: @@ -1576,7 +1576,7 @@ LOCALPROC DisasmControlReg(uint16_t i) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmMoveC(void) +static void DisasmMoveC(void) { /* MOVEC 010011100111101m */ DisasmStartOne("MOVEC "); @@ -1618,7 +1618,7 @@ LOCALPROCUSEDONCE DisasmMoveC(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmLinkL(void) +static void DisasmLinkL(void) { /* Link.L 0100100000001rrr */ DisasmStartOne("LINK.L A"); @@ -1630,7 +1630,7 @@ LOCALPROCUSEDONCE DisasmLinkL(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmPack(void) +static void DisasmPack(void) { DisasmStartOne("PACK ???"); dbglog_writeReturn(); @@ -1639,7 +1639,7 @@ LOCALPROCUSEDONCE DisasmPack(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmUnpk(void) +static void DisasmUnpk(void) { DisasmStartOne("UNPK ???"); dbglog_writeReturn(); @@ -1648,7 +1648,7 @@ LOCALPROCUSEDONCE DisasmUnpk(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmCHK2orCMP2(void) +static void DisasmCHK2orCMP2(void) { DisasmStartOne("CHK2/CMP2 ???"); dbglog_writeReturn(); @@ -1657,7 +1657,7 @@ LOCALPROCUSEDONCE DisasmCHK2orCMP2(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmCAS2(void) +static void DisasmCAS2(void) { DisasmStartOne("CAS2 ???"); dbglog_writeReturn(); @@ -1666,7 +1666,7 @@ LOCALPROCUSEDONCE DisasmCAS2(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmCAS(void) +static void DisasmCAS(void) { DisasmStartOne("CAS ???"); dbglog_writeReturn(); @@ -1675,7 +1675,7 @@ LOCALPROCUSEDONCE DisasmCAS(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmMOVES(void) +static void DisasmMOVES(void) { DisasmStartOne("MOVES ???"); dbglog_writeReturn(); @@ -1684,7 +1684,7 @@ LOCALPROCUSEDONCE DisasmMOVES(void) #endif #if Use68020 -LOCALPROCUSEDONCE DisasmBitField(void) +static void DisasmBitField(void) { DisasmStartOne("BitField ???"); dbglog_writeReturn(); @@ -1692,17 +1692,17 @@ LOCALPROCUSEDONCE DisasmBitField(void) } #endif -LOCALFUNC bool IsValidAddrMode(void) +static bool IsValidAddrMode(void) { return (Disasm_mode != 7) || (Disasm_reg < 5); } -LOCALFUNC bool IsValidDstAddrMode(void) +static bool IsValidDstAddrMode(void) { return (Disasm_md6 != 7) || (Disasm_rg9 < 2); } -LOCALFUNC bool IsValidDataAltAddrMode(void) +static bool IsValidDataAltAddrMode(void) { bool IsOk; @@ -1727,7 +1727,7 @@ LOCALFUNC bool IsValidDataAltAddrMode(void) return IsOk; } -LOCALFUNC bool IsValidDataAddrMode(void) +static bool IsValidDataAddrMode(void) { bool IsOk; @@ -1752,7 +1752,7 @@ LOCALFUNC bool IsValidDataAddrMode(void) return IsOk; } -LOCALFUNC bool IsValidControlAddrMode(void) +static bool IsValidControlAddrMode(void) { bool IsOk; @@ -1777,7 +1777,7 @@ LOCALFUNC bool IsValidControlAddrMode(void) return IsOk; } -LOCALFUNC bool IsValidControlAltAddrMode(void) +static bool IsValidControlAltAddrMode(void) { bool IsOk; @@ -1802,7 +1802,7 @@ LOCALFUNC bool IsValidControlAltAddrMode(void) return IsOk; } -LOCALFUNC bool IsValidAltMemAddrMode(void) +static bool IsValidAltMemAddrMode(void) { bool IsOk; @@ -1827,7 +1827,7 @@ LOCALFUNC bool IsValidAltMemAddrMode(void) return IsOk; } -LOCALPROCUSEDONCE DisasmCode0(void) +static void DisasmCode0(void) { if (Disasm_b8 == 1) { if (Disasm_mode == 1) { @@ -1970,7 +1970,7 @@ LOCALPROCUSEDONCE DisasmCode0(void) } } -LOCALPROCUSEDONCE DisasmCode1(void) +static void DisasmCode1(void) { if ((Disasm_mode == 1) || ! IsValidAddrMode()) { DisasmIllegal(); @@ -1983,7 +1983,7 @@ LOCALPROCUSEDONCE DisasmCode1(void) } } -LOCALPROCUSEDONCE DisasmCode2(void) +static void DisasmCode2(void) { if (Disasm_md6 == 1) { /* MOVEA */ if (IsValidAddrMode()) { @@ -2000,7 +2000,7 @@ LOCALPROCUSEDONCE DisasmCode2(void) } } -LOCALPROCUSEDONCE DisasmCode3(void) +static void DisasmCode3(void) { if (Disasm_md6 == 1) { /* MOVEA */ if (IsValidAddrMode()) { @@ -2017,7 +2017,7 @@ LOCALPROCUSEDONCE DisasmCode3(void) } } -LOCALPROCUSEDONCE DisasmCode4(void) +static void DisasmCode4(void) { if (Disasm_b8 != 0) { switch (Disasm_b76) { @@ -2391,7 +2391,7 @@ LOCALPROCUSEDONCE DisasmCode4(void) } } -LOCALPROCUSEDONCE DisasmCode5(void) +static void DisasmCode5(void) { if (Disasm_b76 == 3) { if (Disasm_mode == 1) { @@ -2440,7 +2440,7 @@ LOCALPROCUSEDONCE DisasmCode5(void) } } -LOCALPROCUSEDONCE DisasmCode6(void) +static void DisasmCode6(void) { uint32_t cond = (Disasm_opcode >> 8) & 15; @@ -2456,7 +2456,7 @@ LOCALPROCUSEDONCE DisasmCode6(void) } } -LOCALPROCUSEDONCE DisasmCode7(void) +static void DisasmCode7(void) { if (Disasm_b8 == 0) { DisasmMoveQ(); @@ -2465,7 +2465,7 @@ LOCALPROCUSEDONCE DisasmCode7(void) } } -LOCALPROCUSEDONCE DisasmCode8(void) +static void DisasmCode8(void) { if (Disasm_b76 == 3) { if (Disasm_b8 == 0) { @@ -2528,7 +2528,7 @@ LOCALPROCUSEDONCE DisasmCode8(void) } } -LOCALPROCUSEDONCE DisasmCode9(void) +static void DisasmCode9(void) { if (Disasm_b76 == 3) { /* SUBA 1001dddm11mmmrrr */ @@ -2564,12 +2564,12 @@ LOCALPROCUSEDONCE DisasmCode9(void) } } -LOCALPROCUSEDONCE DisasmCodeA(void) +static void DisasmCodeA(void) { DisasmALine(); } -LOCALPROCUSEDONCE DisasmCodeB(void) +static void DisasmCodeB(void) { if (Disasm_b76 == 3) { /* CMPA 1011ddds11mmmrrr */ @@ -2600,7 +2600,7 @@ LOCALPROCUSEDONCE DisasmCodeB(void) } } -LOCALPROCUSEDONCE DisasmCodeC(void) +static void DisasmCodeC(void) { if (Disasm_b76 == 3) { if (Disasm_b8 == 0) { @@ -2667,7 +2667,7 @@ LOCALPROCUSEDONCE DisasmCodeC(void) } } -LOCALPROCUSEDONCE DisasmCodeD(void) +static void DisasmCodeD(void) { if (Disasm_b76 == 3) { /* ADDA 1101dddm11mmmrrr */ @@ -2701,7 +2701,7 @@ LOCALPROCUSEDONCE DisasmCodeD(void) } } -LOCALPROCUSEDONCE DisasmCodeE(void) +static void DisasmCodeE(void) { if (Disasm_b76 == 3) { if ((Disasm_opcode & 0x0800) != 0) { @@ -2768,12 +2768,12 @@ LOCALPROCUSEDONCE DisasmCodeE(void) } } -LOCALPROCUSEDONCE DisasmCodeF(void) +static void DisasmCodeF(void) { DisasmFLine(); } -LOCALPROC m68k_Disasm_one(void) +static void m68k_Disasm_one(void) { Disasm_opcode = Disasm_nextiword(); @@ -2833,13 +2833,13 @@ LOCALPROC m68k_Disasm_one(void) #define Ln2SavedPCs 4 #define NumSavedPCs (1 << Ln2SavedPCs) #define SavedPCsMask (NumSavedPCs - 1) -LOCALVAR uint32_t SavedPCs[NumSavedPCs]; -LOCALVAR uint32_t SavedPCsIn = 0; -LOCALVAR uint32_t SavedPCsOut = 0; +static uint32_t SavedPCs[NumSavedPCs]; +static uint32_t SavedPCsIn = 0; +static uint32_t SavedPCsOut = 0; #define DisasmIncludeCycles 0 -LOCALPROCUSEDONCE DisasmOneAndBack(uint32_t pc) +static void DisasmOneAndBack(uint32_t pc) { #if DisasmIncludeCycles dbglog_writeHex(GetCuriCount()); @@ -2851,7 +2851,7 @@ LOCALPROCUSEDONCE DisasmOneAndBack(uint32_t pc) m68k_Disasm_one(); } -LOCALPROCUSEDONCE DisasmSavedPCs(void) +static void DisasmSavedPCs(void) { uint32_t n = SavedPCsIn - SavedPCsOut; @@ -2920,9 +2920,9 @@ LOCALPROCUSEDONCE DisasmSavedPCs(void) } } -LOCALVAR uint32_t DisasmCounter = 0; +static uint32_t DisasmCounter = 0; -GLOBALPROC DisasmOneOrSave(uint32_t pc) +void DisasmOneOrSave(uint32_t pc) { if (0 != DisasmCounter) { DisasmOneAndBack(pc); @@ -2933,7 +2933,7 @@ GLOBALPROC DisasmOneOrSave(uint32_t pc) } } -GLOBALPROC m68k_WantDisasmContext(void) +void m68k_WantDisasmContext(void) { DisasmSavedPCs(); DisasmCounter = /* 256 */ 128; diff --git a/src/HW/M68K/DISAM68K.h b/src/HW/M68K/DISAM68K.h index c0a2e58..c5afb9b 100644 --- a/src/HW/M68K/DISAM68K.h +++ b/src/HW/M68K/DISAM68K.h @@ -21,7 +21,7 @@ #ifndef DIS1M68K_H #define DIS1M68K_H -EXPORTPROC DisasmOneOrSave(uint32_t pc); -EXPORTPROC m68k_WantDisasmContext(void); +extern void DisasmOneOrSave(uint32_t pc); +extern void m68k_WantDisasmContext(void); #endif diff --git a/src/HW/M68K/FPCPEMDV.c b/src/HW/M68K/FPCPEMDV.c index 1f891c2..74f1527 100644 --- a/src/HW/M68K/FPCPEMDV.c +++ b/src/HW/M68K/FPCPEMDV.c @@ -28,23 +28,23 @@ */ -LOCALVAR struct fpustruct +static struct fpustruct { myfpr fp[8]; CPTR FPIAR; /* Floating point instruction address register */ } fpu_dat; -LOCALPROC myfp_SetFPIAR(uint32_t v) +static void myfp_SetFPIAR(uint32_t v) { fpu_dat.FPIAR = v; } -LOCALFUNC uint32_t myfp_GetFPIAR(void) +static uint32_t myfp_GetFPIAR(void) { return fpu_dat.FPIAR; } -LOCALFUNC bool DecodeAddrModeRegister(uint32_t sz) +static bool DecodeAddrModeRegister(uint32_t sz) { uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat; uint16_t themode = (Dat >> 3) & 7; @@ -78,7 +78,7 @@ LOCALFUNC bool DecodeAddrModeRegister(uint32_t sz) } } -LOCALPROC read_long_double(uint32_t addr, myfpr *r) +static void read_long_double(uint32_t addr, myfpr *r) { uint16_t v2; uint32_t v1; @@ -92,7 +92,7 @@ LOCALPROC read_long_double(uint32_t addr, myfpr *r) myfp_FromExtendedFormat(r, v2, v1, v0); } -LOCALPROC write_long_double(uint32_t addr, myfpr *xx) +static void write_long_double(uint32_t addr, myfpr *xx) { uint16_t v2; uint32_t v1; @@ -106,7 +106,7 @@ LOCALPROC write_long_double(uint32_t addr, myfpr *xx) put_long(addr + 8, v0); } -LOCALPROC read_double(uint32_t addr, myfpr *r) +static void read_double(uint32_t addr, myfpr *r) { uint32_t v1; uint32_t v0; @@ -117,7 +117,7 @@ LOCALPROC read_double(uint32_t addr, myfpr *r) myfp_FromDoubleFormat(r, v1, v0); } -LOCALPROC write_double(uint32_t addr, myfpr *dd) +static void write_double(uint32_t addr, myfpr *dd) { uint32_t v1; uint32_t v0; @@ -129,19 +129,19 @@ LOCALPROC write_double(uint32_t addr, myfpr *dd) } #if 0 -LOCALPROC read_single(uint32_t addr, myfpr *r) +static void read_single(uint32_t addr, myfpr *r) { myfp_FromSingleFormat(r, get_long(addr)); } -LOCALPROC write_single(uint32_t addr, myfpr *ff) +static void write_single(uint32_t addr, myfpr *ff) { put_long(addr, myfp_ToSingleFormat(ff)); } #endif -LOCALFUNC int CheckFPCondition(uint16_t predicate) +static int CheckFPCondition(uint16_t predicate) { int condition_true = 0; @@ -417,13 +417,13 @@ LOCALIPROC DoCodeFPU_Scc(void) } } -LOCALPROC DoCodeF_InvalidPlusWord(void) +static void DoCodeF_InvalidPlusWord(void) { BackupPC(); DoCodeFPU_dflt(); } -LOCALFUNC int CountCSIAlist(uint16_t word2) +static int CountCSIAlist(uint16_t word2) { uint16_t regselect = (word2 >> 10) & 0x7; int num = 0; @@ -441,7 +441,7 @@ LOCALFUNC int CountCSIAlist(uint16_t word2) return num; } -LOCALPROC DoCodeFPU_Move_EA_CSIA(uint16_t word2) +static void DoCodeFPU_Move_EA_CSIA(uint16_t word2) { int n; uint32_t ea_value[3]; @@ -485,7 +485,7 @@ LOCALPROC DoCodeFPU_Move_EA_CSIA(uint16_t word2) } } -LOCALPROC DoCodeFPU_MoveM_CSIA_EA(uint16_t word2) +static void DoCodeFPU_MoveM_CSIA_EA(uint16_t word2) { int n; uint32_t ea_value[3]; @@ -529,7 +529,7 @@ LOCALPROC DoCodeFPU_MoveM_CSIA_EA(uint16_t word2) } } -LOCALPROC DoCodeFPU_MoveM_EA_list(uint16_t word2) +static void DoCodeFPU_MoveM_EA_list(uint16_t word2) { int i; uint32_t myaddr; @@ -582,7 +582,7 @@ LOCALPROC DoCodeFPU_MoveM_EA_list(uint16_t word2) } } -LOCALPROC DoCodeFPU_MoveM_list_EA(uint16_t word2) +static void DoCodeFPU_MoveM_list_EA(uint16_t word2) { /* FMOVEM.X , */ @@ -643,7 +643,7 @@ LOCALPROC DoCodeFPU_MoveM_list_EA(uint16_t word2) } } -LOCALPROC DoCodeFPU_MoveCR(uint16_t word2) +static void DoCodeFPU_MoveCR(uint16_t word2) { /* FMOVECR */ uint16_t opcode = ((uint16_t)(V_regs.CurDecOpY.v[0].AMd) << 8) @@ -667,13 +667,13 @@ LOCALPROC DoCodeFPU_MoveCR(uint16_t word2) } } -LOCALPROC SaveResultAndFPSR(myfpr *DestReg, myfpr *result) +static void SaveResultAndFPSR(myfpr *DestReg, myfpr *result) { *DestReg = *result; myfp_SetConditionCodeByteFromResult(result); } -LOCALPROC DoCodeFPU_GenOp(uint16_t word2, myfpr *source) +static void DoCodeFPU_GenOp(uint16_t word2, myfpr *source) { myfpr result; myfpr t0; @@ -988,14 +988,14 @@ LOCALPROC DoCodeFPU_GenOp(uint16_t word2, myfpr *source) } } -LOCALPROC DoCodeFPU_GenOpReg(uint16_t word2) +static void DoCodeFPU_GenOpReg(uint16_t word2) { uint16_t regselect = (word2 >> 10) & 0x7; DoCodeFPU_GenOp(word2, &fpu_dat.fp[regselect]); } -LOCALPROC DoCodeFPU_GenOpEA(uint16_t word2) +static void DoCodeFPU_GenOpEA(uint16_t word2) { myfpr source; @@ -1096,7 +1096,7 @@ LOCALPROC DoCodeFPU_GenOpEA(uint16_t word2) } } -LOCALPROC DoCodeFPU_Move_FP_EA(uint16_t word2) +static void DoCodeFPU_Move_FP_EA(uint16_t word2) { /* FMOVE FP?, */ diff --git a/src/HW/M68K/FPMATHEM.h b/src/HW/M68K/FPMATHEM.h index 3670937..a4a2c80 100644 --- a/src/HW/M68K/FPMATHEM.h +++ b/src/HW/M68K/FPMATHEM.h @@ -160,7 +160,7 @@ enum { | and exception flags. *----------------------------------------------------------------------------*/ -LOCALVAR int8_t float_rounding_mode = float_round_nearest_even; +static int8_t float_rounding_mode = float_round_nearest_even; /*---------------------------------------------------------------------------- @@ -174,14 +174,14 @@ enum { float_flag_underflow = 16, float_flag_inexact = 32 }; -LOCALVAR int8_t float_exception_flags = 0; +static int8_t float_exception_flags = 0; /*---------------------------------------------------------------------------- | Software IEC/IEEE extended double-precision rounding precision. Valid | values are 32, 64, and 80. *----------------------------------------------------------------------------*/ -LOCALVAR int8_t floatx80_rounding_precision = 80; +static int8_t floatx80_rounding_precision = 80; /*---------------------------------------------------------------------------- | Primitive arithmetic functions, including multi-word arithmetic, and @@ -209,7 +209,7 @@ Arithmetic Package, Release 2b. | The result is stored in the location pointed to by `zPtr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shift32RightJamming( uint32_t a, int16_t count, uint32_t *zPtr ) +static void shift32RightJamming( uint32_t a, int16_t count, uint32_t *zPtr ) { uint32_t z; @@ -235,7 +235,7 @@ LOCALINLINEPROC shift32RightJamming( uint32_t a, int16_t count, uint32_t *zPtr ) | The result is stored in the location pointed to by `zPtr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shift64RightJamming( uint64_t a, int16_t count, uint64_t *zPtr ) +static void shift64RightJamming( uint64_t a, int16_t count, uint64_t *zPtr ) { uint64_t z; @@ -269,7 +269,7 @@ LOCALINLINEPROC shift64RightJamming( uint64_t a, int16_t count, uint64_t *zPtr ) | described above, and is returned at the location pointed to by `z1Ptr'.) *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shift64ExtraRightJamming( +static void shift64ExtraRightJamming( uint64_t a0, uint64_t a1, int16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z0, z1; @@ -305,7 +305,7 @@ LOCALINLINEPROC shift64ExtraRightJamming( | which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shift128Right( +static void shift128Right( uint64_t a0, uint64_t a1, int16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z0, z1; @@ -339,7 +339,7 @@ LOCALINLINEPROC shift128Right( | the locations pointed to by `z0Ptr' and `z1Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shift128RightJamming( +static void shift128RightJamming( uint64_t a0, uint64_t a1, int16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z0, z1; @@ -389,7 +389,7 @@ LOCALINLINEPROC shift128RightJamming( | `z2Ptr'.) *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shift128ExtraRightJamming( +static void shift128ExtraRightJamming( uint64_t a0, uint64_t a1, uint64_t a2, @@ -445,7 +445,7 @@ LOCALINLINEPROC shift128ExtraRightJamming( | pieces which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC shortShift128Left( +static void shortShift128Left( uint64_t a0, uint64_t a1, int16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { @@ -462,7 +462,7 @@ LOCALINLINEPROC shortShift128Left( | are stored at the locations pointed to by `z0Ptr' and `z1Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC add128( +static void add128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z1; @@ -480,7 +480,7 @@ LOCALINLINEPROC add128( | `z1Ptr', and `z2Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC add192( +static void add192( uint64_t a0, uint64_t a1, uint64_t a2, @@ -516,7 +516,7 @@ LOCALINLINEPROC add192( | `z1Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC +static void sub128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1, uint64_t *z0Ptr, uint64_t *z1Ptr ) { @@ -534,7 +534,7 @@ LOCALINLINEPROC | pointed to by `z0Ptr', `z1Ptr', and `z2Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC +static void sub192( uint64_t a0, uint64_t a1, @@ -576,13 +576,13 @@ LOCALINLINEPROC #endif #if HaveUi5to6Mul -LOCALINLINEPROC Ui5to6Mul( uint32_t src1, uint32_t src2, uint64_t *z) +static void Ui5to6Mul( uint32_t src1, uint32_t src2, uint64_t *z) { *z = ((uint64_t) src1) * src2; } #else -LOCALINLINEPROC Ui6fromHiLo(uint32_t hi, uint32_t lo, uint64_t *z) +static void Ui6fromHiLo(uint32_t hi, uint32_t lo, uint64_t *z) { *z = (((uint64_t)(hi)) << 32) + lo; #if 0 @@ -591,7 +591,7 @@ LOCALINLINEPROC Ui6fromHiLo(uint32_t hi, uint32_t lo, uint64_t *z) #endif } -LOCALPROC Ui5to6Mul( uint32_t src1, uint32_t src2, uint64_t *z) +static void Ui5to6Mul( uint32_t src1, uint32_t src2, uint64_t *z) { uint16_t src1_lo = uint32_t_lo(src1); uint16_t src2_lo = uint32_t_lo(src2); @@ -614,7 +614,7 @@ LOCALPROC Ui5to6Mul( uint32_t src1, uint32_t src2, uint64_t *z) #endif -LOCALINLINEPROC mul64To128( uint64_t a, uint64_t b, uint64_t *z0Ptr, uint64_t *z1Ptr ) +static void mul64To128( uint64_t a, uint64_t b, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint32_t aHigh, aLow, bHigh, bLow; uint64_t z0, zMiddleA, zMiddleB, z1; @@ -646,7 +646,7 @@ LOCALINLINEPROC mul64To128( uint64_t a, uint64_t b, uint64_t *z0Ptr, uint64_t *z | `z2Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC +static void mul128By64To192( uint64_t a0, uint64_t a1, @@ -674,7 +674,7 @@ LOCALINLINEPROC | the locations pointed to by `z0Ptr', `z1Ptr', `z2Ptr', and `z3Ptr'. *----------------------------------------------------------------------------*/ -LOCALINLINEPROC +static void mul128To256( uint64_t a0, uint64_t a1, @@ -724,7 +724,7 @@ LOCALINLINEPROC Assuming other 64 bit operations available, like compare, subtract, shift. */ -LOCALFUNC uint64_t Ui6Div(uint64_t num, uint64_t den) +static uint64_t Ui6Div(uint64_t num, uint64_t den) { uint64_t bit = 1; uint64_t res = 0; @@ -747,7 +747,7 @@ LOCALFUNC uint64_t Ui6Div(uint64_t num, uint64_t den) } #endif -LOCALFUNC uint64_t estimateDiv128To64( uint64_t a0, uint64_t a1, uint64_t b ) +static uint64_t estimateDiv128To64( uint64_t a0, uint64_t a1, uint64_t b ) { uint64_t b0, b1; uint64_t rem0, rem1, term0, term1; @@ -779,7 +779,7 @@ LOCALFUNC uint64_t estimateDiv128To64( uint64_t a0, uint64_t a1, uint64_t b ) | value. *----------------------------------------------------------------------------*/ -LOCALFUNC uint32_t estimateSqrt32( int16_t aExp, uint32_t a ) +static uint32_t estimateSqrt32( int16_t aExp, uint32_t a ) { static const uint16_t sqrtOddAdjustments[] = { 0x0004, 0x0022, 0x005D, 0x00B1, 0x011D, 0x019F, 0x0236, 0x02E0, @@ -813,7 +813,7 @@ LOCALFUNC uint32_t estimateSqrt32( int16_t aExp, uint32_t a ) | `a'. If `a' is zero, 32 is returned. *----------------------------------------------------------------------------*/ -LOCALFUNC int8_t countLeadingZeros32( uint32_t a ) +static int8_t countLeadingZeros32( uint32_t a ) { static const int8_t countLeadingZerosHigh[] = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, @@ -854,7 +854,7 @@ LOCALFUNC int8_t countLeadingZeros32( uint32_t a ) | `a'. If `a' is zero, 64 is returned. *----------------------------------------------------------------------------*/ -LOCALFUNC int8_t countLeadingZeros64( uint64_t a ) +static int8_t countLeadingZeros64( uint64_t a ) { int8_t shiftCount; @@ -876,7 +876,7 @@ LOCALFUNC int8_t countLeadingZeros64( uint64_t a ) | Otherwise, returns 0. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) +static flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) { return ( a0 == b0 ) && ( a1 == b1 ); @@ -889,7 +889,7 @@ LOCALINLINEFUNC flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) | Otherwise, returns 0. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) +static flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) { return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 <= b1 ) ); @@ -902,7 +902,7 @@ LOCALINLINEFUNC flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) | returns 0. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) +static flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) { return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 < b1 ) ); @@ -916,7 +916,7 @@ LOCALINLINEFUNC flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALINLINEFUNC flag ne128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) +static flag ne128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 ) { return ( a0 != b0 ) || ( a1 != b1 ); @@ -958,7 +958,7 @@ enum { | Underflow tininess-detection mode, statically initialized to default value. | (The declaration in `softfloat.h' must match the `int8_t' type here.) *----------------------------------------------------------------------------*/ -LOCALVAR int8_t float_detect_tininess = float_tininess_after_rounding; +static int8_t float_detect_tininess = float_tininess_after_rounding; /*---------------------------------------------------------------------------- | Routine to raise any or all of the software IEC/IEEE floating-point @@ -971,7 +971,7 @@ LOCALVAR int8_t float_detect_tininess = float_tininess_after_rounding; | should be simply `float_exception_flags |= flags;'. *----------------------------------------------------------------------------*/ -LOCALFUNC void float_raise( int8_t flags ) +static void float_raise( int8_t flags ) { float_exception_flags |= flags; @@ -999,7 +999,7 @@ typedef struct { | NaN; otherwise returns 0. *----------------------------------------------------------------------------*/ -LOCALFUNC flag floatx80_is_nan( floatx80 a ) +static flag floatx80_is_nan( floatx80 a ) { return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (uint64_t) ( a.low<<1 ); @@ -1011,7 +1011,7 @@ LOCALFUNC flag floatx80_is_nan( floatx80 a ) | signaling NaN; otherwise returns 0. *----------------------------------------------------------------------------*/ -LOCALFUNC flag floatx80_is_signaling_nan( floatx80 a ) +static flag floatx80_is_signaling_nan( floatx80 a ) { uint64_t aLow; @@ -1029,7 +1029,7 @@ LOCALFUNC flag floatx80_is_signaling_nan( floatx80 a ) | invalid exception is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC commonNaNT floatx80ToCommonNaN( floatx80 a ) +static commonNaNT floatx80ToCommonNaN( floatx80 a ) { commonNaNT z; @@ -1046,7 +1046,7 @@ LOCALFUNC commonNaNT floatx80ToCommonNaN( floatx80 a ) | double-precision floating-point format. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 commonNaNToFloatx80( commonNaNT a ) +static floatx80 commonNaNToFloatx80( commonNaNT a ) { floatx80 z; @@ -1062,7 +1062,7 @@ LOCALFUNC floatx80 commonNaNToFloatx80( commonNaNT a ) | `b' is a signaling NaN, the invalid exception is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b ) +static floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b ) { flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; @@ -1104,7 +1104,7 @@ LOCALFUNC floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b ) | otherwise returns 0. *----------------------------------------------------------------------------*/ -LOCALFUNC flag float128_is_nan( float128 a ) +static flag float128_is_nan( float128 a ) { return @@ -1118,7 +1118,7 @@ LOCALFUNC flag float128_is_nan( float128 a ) | signaling NaN; otherwise returns 0. *----------------------------------------------------------------------------*/ -LOCALFUNC flag float128_is_signaling_nan( float128 a ) +static flag float128_is_signaling_nan( float128 a ) { return @@ -1133,7 +1133,7 @@ LOCALFUNC flag float128_is_signaling_nan( float128 a ) | exception is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC commonNaNT float128ToCommonNaN( float128 a ) +static commonNaNT float128ToCommonNaN( float128 a ) { commonNaNT z; @@ -1149,7 +1149,7 @@ LOCALFUNC commonNaNT float128ToCommonNaN( float128 a ) | precision floating-point format. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 commonNaNToFloat128( commonNaNT a ) +static float128 commonNaNToFloat128( commonNaNT a ) { float128 z; @@ -1165,7 +1165,7 @@ LOCALFUNC float128 commonNaNToFloat128( commonNaNT a ) | `b' is a signaling NaN, the invalid exception is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 propagateFloat128NaN( float128 a, float128 b ) +static float128 propagateFloat128NaN( float128 a, float128 b ) { flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; @@ -1220,7 +1220,7 @@ Package, Release 2b. | positive or negative integer is returned. *----------------------------------------------------------------------------*/ -LOCALFUNC int32_t roundAndPackInt32( flag zSign, uint64_t absZ ) +static int32_t roundAndPackInt32( flag zSign, uint64_t absZ ) { int8_t roundingMode; flag roundNearestEven; @@ -1263,7 +1263,7 @@ LOCALFUNC int32_t roundAndPackInt32( flag zSign, uint64_t absZ ) | value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC uint64_t extractFloatx80Frac( floatx80 a ) +static uint64_t extractFloatx80Frac( floatx80 a ) { return a.low; @@ -1275,7 +1275,7 @@ LOCALINLINEFUNC uint64_t extractFloatx80Frac( floatx80 a ) | value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC int32_t extractFloatx80Exp( floatx80 a ) +static int32_t extractFloatx80Exp( floatx80 a ) { return a.high & 0x7FFF; @@ -1287,7 +1287,7 @@ LOCALINLINEFUNC int32_t extractFloatx80Exp( floatx80 a ) | `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag extractFloatx80Sign( floatx80 a ) +static flag extractFloatx80Sign( floatx80 a ) { return a.high>>15; @@ -1301,7 +1301,7 @@ LOCALINLINEFUNC flag extractFloatx80Sign( floatx80 a ) | `zSigPtr', respectively. *----------------------------------------------------------------------------*/ -LOCALPROC +static void normalizeFloatx80Subnormal( uint64_t aSig, int32_t *zExpPtr, uint64_t *zSigPtr ) { int8_t shiftCount; @@ -1317,7 +1317,7 @@ LOCALPROC | extended double-precision floating-point value, returning the result. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC floatx80 packFloatx80( flag zSign, int32_t zExp, uint64_t zSig ) +static floatx80 packFloatx80( flag zSign, int32_t zExp, uint64_t zSig ) { floatx80 z; @@ -1351,7 +1351,7 @@ LOCALINLINEFUNC floatx80 packFloatx80( flag zSign, int32_t zExp, uint64_t zSig ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 +static floatx80 roundAndPackFloatx80( int8_t roundingPrecision, flag zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1 ) @@ -1519,7 +1519,7 @@ LOCALFUNC floatx80 | normalized. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 +static floatx80 normalizeRoundAndPackFloatx80( int8_t roundingPrecision, flag zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1 ) @@ -1546,7 +1546,7 @@ LOCALFUNC floatx80 | floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC uint64_t extractFloat128Frac1( float128 a ) +static uint64_t extractFloat128Frac1( float128 a ) { return a.low; @@ -1558,7 +1558,7 @@ LOCALINLINEFUNC uint64_t extractFloat128Frac1( float128 a ) | floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC uint64_t extractFloat128Frac0( float128 a ) +static uint64_t extractFloat128Frac0( float128 a ) { return a.high & LIT64( 0x0000FFFFFFFFFFFF ); @@ -1570,7 +1570,7 @@ LOCALINLINEFUNC uint64_t extractFloat128Frac0( float128 a ) | `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC int32_t extractFloat128Exp( float128 a ) +static int32_t extractFloat128Exp( float128 a ) { return ( a.high>>48 ) & 0x7FFF; @@ -1581,7 +1581,7 @@ LOCALINLINEFUNC int32_t extractFloat128Exp( float128 a ) | Returns the sign bit of the quadruple-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag extractFloat128Sign( float128 a ) +static flag extractFloat128Sign( float128 a ) { return a.high>>63; @@ -1598,7 +1598,7 @@ LOCALINLINEFUNC flag extractFloat128Sign( float128 a ) | location pointed to by `zSig1Ptr'. *----------------------------------------------------------------------------*/ -LOCALPROC +static void normalizeFloat128Subnormal( uint64_t aSig0, uint64_t aSig1, @@ -1642,7 +1642,7 @@ LOCALPROC | significand. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC float128 +static float128 packFloat128( flag zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1 ) { float128 z; @@ -1674,7 +1674,7 @@ LOCALINLINEFUNC float128 | overflow follows the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 +static float128 roundAndPackFloat128( flag zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1, uint64_t zSig2 ) { @@ -1774,7 +1774,7 @@ LOCALFUNC float128 | point exponent. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 +static float128 normalizeRoundAndPackFloat128( flag zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1 ) { @@ -1809,7 +1809,7 @@ LOCALFUNC float128 | Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 int32_to_floatx80( int32_t a ) +static floatx80 int32_to_floatx80( int32_t a ) { flag zSign; uint32_t absA; @@ -1835,7 +1835,7 @@ LOCALFUNC floatx80 int32_to_floatx80( int32_t a ) | overflows, the largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -LOCALFUNC int32_t floatx80_to_int32( floatx80 a ) +static int32_t floatx80_to_int32( floatx80 a ) { flag aSign; int32_t aExp, shiftCount; @@ -1863,7 +1863,7 @@ LOCALFUNC int32_t floatx80_to_int32( floatx80 a ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC int32_t floatx80_to_int32_round_to_zero( floatx80 a ) +static int32_t floatx80_to_int32_round_to_zero( floatx80 a ) { flag aSign; int32_t aExp, shiftCount; @@ -1908,7 +1908,7 @@ LOCALFUNC int32_t floatx80_to_int32_round_to_zero( floatx80 a ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 floatx80_to_float128( floatx80 a ) +static float128 floatx80_to_float128( floatx80 a ) { flag aSign; int16_t aExp; @@ -1934,7 +1934,7 @@ LOCALFUNC float128 floatx80_to_float128( floatx80 a ) | Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_round_to_int( floatx80 a ) +static floatx80 floatx80_round_to_int( floatx80 a ) { flag aSign; int32_t aExp; @@ -2008,7 +2008,7 @@ LOCALFUNC floatx80 floatx80_round_to_int( floatx80 a ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) +static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) { int32_t aExp, bExp, zExp; uint64_t aSig, bSig, zSig0, zSig1; @@ -2074,7 +2074,7 @@ LOCALFUNC floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) +static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) { int32_t aExp, bExp, zExp; uint64_t aSig, bSig, zSig0, zSig1; @@ -2140,7 +2140,7 @@ LOCALFUNC floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_add( floatx80 a, floatx80 b ) +static floatx80 floatx80_add( floatx80 a, floatx80 b ) { flag aSign, bSign; @@ -2161,7 +2161,7 @@ LOCALFUNC floatx80 floatx80_add( floatx80 a, floatx80 b ) | IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_sub( floatx80 a, floatx80 b ) +static floatx80 floatx80_sub( floatx80 a, floatx80 b ) { flag aSign, bSign; @@ -2182,7 +2182,7 @@ LOCALFUNC floatx80 floatx80_sub( floatx80 a, floatx80 b ) | IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_mul( floatx80 a, floatx80 b ) +static floatx80 floatx80_mul( floatx80 a, floatx80 b ) { flag aSign, bSign, zSign; int32_t aExp, bExp, zExp; @@ -2241,7 +2241,7 @@ LOCALFUNC floatx80 floatx80_mul( floatx80 a, floatx80 b ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_div( floatx80 a, floatx80 b ) +static floatx80 floatx80_div( floatx80 a, floatx80 b ) { flag aSign, bSign, zSign; int32_t aExp, bExp, zExp; @@ -2336,7 +2336,7 @@ LOCALFUNC floatx80 floatx80_div( floatx80 a, floatx80 b ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_rem( floatx80 a, floatx80 b ) +static floatx80 floatx80_rem( floatx80 a, floatx80 b ) { flag aSign, /* bSign, */ zSign; int32_t aExp, bExp, expDiff; @@ -2436,7 +2436,7 @@ LOCALFUNC floatx80 floatx80_rem( floatx80 a, floatx80 b ) | for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_sqrt( floatx80 a ) +static floatx80 floatx80_sqrt( floatx80 a ) { flag aSign; int32_t aExp, zExp; @@ -2508,7 +2508,7 @@ LOCALFUNC floatx80 floatx80_sqrt( floatx80 a ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC flag floatx80_eq( floatx80 a, floatx80 b ) +static flag floatx80_eq( floatx80 a, floatx80 b ) { if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) @@ -2540,7 +2540,7 @@ LOCALFUNC flag floatx80_eq( floatx80 a, floatx80 b ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC flag floatx80_le( floatx80 a, floatx80 b ) +static flag floatx80_le( floatx80 a, floatx80 b ) { flag aSign, bSign; @@ -2575,7 +2575,7 @@ LOCALFUNC flag floatx80_le( floatx80 a, floatx80 b ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC flag floatx80_lt( floatx80 a, floatx80 b ) +static flag floatx80_lt( floatx80 a, floatx80 b ) { flag aSign, bSign; @@ -2610,7 +2610,7 @@ LOCALFUNC flag floatx80_lt( floatx80 a, floatx80 b ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC flag floatx80_eq_signaling( floatx80 a, floatx80 b ) +static flag floatx80_eq_signaling( floatx80 a, floatx80 b ) { if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) @@ -2639,7 +2639,7 @@ LOCALFUNC flag floatx80_eq_signaling( floatx80 a, floatx80 b ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC flag floatx80_le_quiet( floatx80 a, floatx80 b ) +static flag floatx80_le_quiet( floatx80 a, floatx80 b ) { flag aSign, bSign; @@ -2677,7 +2677,7 @@ LOCALFUNC flag floatx80_le_quiet( floatx80 a, floatx80 b ) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC flag floatx80_lt_quiet( floatx80 a, floatx80 b ) +static flag floatx80_lt_quiet( floatx80 a, floatx80 b ) { flag aSign, bSign; @@ -2716,7 +2716,7 @@ LOCALFUNC flag floatx80_lt_quiet( floatx80 a, floatx80 b ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 float128_to_floatx80( float128 a ) +static floatx80 float128_to_floatx80( float128 a ) { flag aSign; int32_t aExp; @@ -2752,7 +2752,7 @@ LOCALFUNC floatx80 float128_to_floatx80( float128 a ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 addFloat128Sigs( float128 a, float128 b, flag zSign ) +static float128 addFloat128Sigs( float128 a, float128 b, flag zSign ) { int32_t aExp, bExp, zExp; uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2; @@ -2830,7 +2830,7 @@ LOCALFUNC float128 addFloat128Sigs( float128 a, float128 b, flag zSign ) | Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 subFloat128Sigs( float128 a, float128 b, flag zSign ) +static float128 subFloat128Sigs( float128 a, float128 b, flag zSign ) { int32_t aExp, bExp, zExp; uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1; @@ -2912,7 +2912,7 @@ LOCALFUNC float128 subFloat128Sigs( float128 a, float128 b, flag zSign ) | for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 float128_add( float128 a, float128 b ) +static float128 float128_add( float128 a, float128 b ) { flag aSign, bSign; @@ -2933,7 +2933,7 @@ LOCALFUNC float128 float128_add( float128 a, float128 b ) | Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 float128_sub( float128 a, float128 b ) +static float128 float128_sub( float128 a, float128 b ) { flag aSign, bSign; @@ -2954,7 +2954,7 @@ LOCALFUNC float128 float128_sub( float128 a, float128 b ) | Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 float128_mul( float128 a, float128 b ) +static float128 float128_mul( float128 a, float128 b ) { flag aSign, bSign, zSign; int32_t aExp, bExp, zExp; @@ -3018,7 +3018,7 @@ LOCALFUNC float128 float128_mul( float128 a, float128 b ) | the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float128 float128_div( float128 a, float128 b ) +static float128 float128_div( float128 a, float128 b ) { flag aSign, bSign, zSign; int32_t aExp, bExp, zExp; @@ -3107,7 +3107,7 @@ typedef unsigned int float32; | `zSigPtr', respectively. *----------------------------------------------------------------------------*/ -LOCALPROC +static void normalizeFloat32Subnormal( uint32_t aSig, int16_t *zExpPtr, uint32_t *zSigPtr ) { int8_t shiftCount; @@ -3122,7 +3122,7 @@ LOCALPROC | Returns the fraction bits of the single-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC uint32_t extractFloat32Frac( float32 a ) +static uint32_t extractFloat32Frac( float32 a ) { return a & 0x007FFFFF; @@ -3133,7 +3133,7 @@ LOCALINLINEFUNC uint32_t extractFloat32Frac( float32 a ) | Returns the exponent bits of the single-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC int16_t extractFloat32Exp( float32 a ) +static int16_t extractFloat32Exp( float32 a ) { return ( a>>23 ) & 0xFF; @@ -3144,7 +3144,7 @@ LOCALINLINEFUNC int16_t extractFloat32Exp( float32 a ) | Returns the sign bit of the single-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag extractFloat32Sign( float32 a ) +static flag extractFloat32Sign( float32 a ) { return a>>31; @@ -3156,7 +3156,7 @@ LOCALINLINEFUNC flag extractFloat32Sign( float32 a ) | NaN; otherwise returns 0. *----------------------------------------------------------------------------*/ -LOCALFUNC flag float32_is_signaling_nan( float32 a ) +static flag float32_is_signaling_nan( float32 a ) { return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF ); @@ -3169,7 +3169,7 @@ LOCALFUNC flag float32_is_signaling_nan( float32 a ) | exception is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC commonNaNT float32ToCommonNaN( float32 a ) +static commonNaNT float32ToCommonNaN( float32 a ) { commonNaNT z; @@ -3188,7 +3188,7 @@ LOCALFUNC commonNaNT float32ToCommonNaN( float32 a ) | Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 float32_to_floatx80( float32 a ) +static floatx80 float32_to_floatx80( float32 a ) { flag aSign; int16_t aExp; @@ -3221,7 +3221,7 @@ LOCALFUNC floatx80 float32_to_floatx80( float32 a ) | significand. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC float32 packFloat32( flag zSign, int16_t zExp, uint32_t zSig ) +static float32 packFloat32( flag zSign, int16_t zExp, uint32_t zSig ) { return ( ( (uint32_t) zSign )<<31 ) + ( ( (uint32_t) zExp )<<23 ) + zSig; @@ -3250,7 +3250,7 @@ LOCALINLINEFUNC float32 packFloat32( flag zSign, int16_t zExp, uint32_t zSig ) | Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float32 roundAndPackFloat32( flag zSign, int16_t zExp, uint32_t zSig ) +static float32 roundAndPackFloat32( flag zSign, int16_t zExp, uint32_t zSig ) { int8_t roundingMode; flag roundNearestEven; @@ -3307,7 +3307,7 @@ LOCALFUNC float32 roundAndPackFloat32( flag zSign, int16_t zExp, uint32_t zSig ) | precision floating-point format. *----------------------------------------------------------------------------*/ -LOCALFUNC float32 commonNaNToFloat32( commonNaNT a ) +static float32 commonNaNToFloat32( commonNaNT a ) { return ( ( (uint32_t) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 ); @@ -3321,7 +3321,7 @@ LOCALFUNC float32 commonNaNToFloat32( commonNaNT a ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float32 floatx80_to_float32( floatx80 a ) +static float32 floatx80_to_float32( floatx80 a ) { flag aSign; int32_t aExp; @@ -3349,7 +3349,7 @@ typedef uint64_t float64; | Returns the fraction bits of the double-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC uint64_t extractFloat64Frac( float64 a ) +static uint64_t extractFloat64Frac( float64 a ) { return a & LIT64( 0x000FFFFFFFFFFFFF ); @@ -3360,7 +3360,7 @@ LOCALINLINEFUNC uint64_t extractFloat64Frac( float64 a ) | Returns the exponent bits of the double-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC int16_t extractFloat64Exp( float64 a ) +static int16_t extractFloat64Exp( float64 a ) { return ( a>>52 ) & 0x7FF; @@ -3371,7 +3371,7 @@ LOCALINLINEFUNC int16_t extractFloat64Exp( float64 a ) | Returns the sign bit of the double-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC flag extractFloat64Sign( float64 a ) +static flag extractFloat64Sign( float64 a ) { return a>>63; @@ -3383,7 +3383,7 @@ LOCALINLINEFUNC flag extractFloat64Sign( float64 a ) | NaN; otherwise returns 0. *----------------------------------------------------------------------------*/ -LOCALFUNC flag float64_is_signaling_nan( float64 a ) +static flag float64_is_signaling_nan( float64 a ) { return @@ -3398,7 +3398,7 @@ LOCALFUNC flag float64_is_signaling_nan( float64 a ) | exception is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC commonNaNT float64ToCommonNaN( float64 a ) +static commonNaNT float64ToCommonNaN( float64 a ) { commonNaNT z; @@ -3417,7 +3417,7 @@ LOCALFUNC commonNaNT float64ToCommonNaN( float64 a ) | `zSigPtr', respectively. *----------------------------------------------------------------------------*/ -LOCALPROC +static void normalizeFloat64Subnormal( uint64_t aSig, int16_t *zExpPtr, uint64_t *zSigPtr ) { int8_t shiftCount; @@ -3435,7 +3435,7 @@ LOCALPROC | Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 float64_to_floatx80( float64 a ) +static floatx80 float64_to_floatx80( float64 a ) { flag aSign; int16_t aExp; @@ -3469,7 +3469,7 @@ LOCALFUNC floatx80 float64_to_floatx80( float64 a ) | significand. *----------------------------------------------------------------------------*/ -LOCALINLINEFUNC float64 packFloat64( flag zSign, int16_t zExp, uint64_t zSig ) +static float64 packFloat64( flag zSign, int16_t zExp, uint64_t zSig ) { return ( ( (uint64_t) zSign )<<63 ) + ( ( (uint64_t) zExp )<<52 ) + zSig; @@ -3498,7 +3498,7 @@ LOCALINLINEFUNC float64 packFloat64( flag zSign, int16_t zExp, uint64_t zSig ) | Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float64 roundAndPackFloat64( flag zSign, int16_t zExp, uint64_t zSig ) +static float64 roundAndPackFloat64( flag zSign, int16_t zExp, uint64_t zSig ) { int8_t roundingMode; flag roundNearestEven; @@ -3555,7 +3555,7 @@ LOCALFUNC float64 roundAndPackFloat64( flag zSign, int16_t zExp, uint64_t zSig ) | precision floating-point format. *----------------------------------------------------------------------------*/ -LOCALFUNC float64 commonNaNToFloat64( commonNaNT a ) +static float64 commonNaNToFloat64( commonNaNT a ) { return @@ -3572,7 +3572,7 @@ LOCALFUNC float64 commonNaNToFloat64( commonNaNT a ) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC float64 floatx80_to_float64( floatx80 a ) +static float64 floatx80_to_float64( floatx80 a ) { flag aSign; int32_t aExp; @@ -3610,7 +3610,7 @@ typedef uint64_t Bit64u; | is raised. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 propagateOneFloatx80NaN(floatx80 *a) +static floatx80 propagateOneFloatx80NaN(floatx80 *a) { if (floatx80_is_signaling_nan(*a)) float_raise(float_flag_invalid); @@ -3658,7 +3658,7 @@ enum { | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_mul128(floatx80 a, float128 b) +static floatx80 floatx80_mul128(floatx80 a, float128 b) { Bit32s aExp, bExp, zExp; Bit64u aSig, bSig0, bSig1, zSig0, zSig1, zSig2; @@ -3773,7 +3773,7 @@ inline floatx80 floatx80_abs(floatx80 *reg) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_chs(floatx80 *x) +static floatx80 floatx80_chs(floatx80 *x) { x->high ^= 0x8000; return *x; @@ -3797,7 +3797,7 @@ LOCALFUNC floatx80 floatx80_chs(floatx80 *x) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC Bit16s floatx80_to_int16(floatx80 a) +static Bit16s floatx80_to_int16(floatx80 a) { #if 0 if (floatx80_is_unsupported(a)) @@ -3828,7 +3828,7 @@ LOCALFUNC Bit16s floatx80_to_int16(floatx80 a) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC Bit16s floatx80_to_int16_round_to_zero(floatx80 a) +static Bit16s floatx80_to_int16_round_to_zero(floatx80 a) { #if 0 if (floatx80_is_unsupported(a)) @@ -3856,7 +3856,7 @@ LOCALFUNC Bit16s floatx80_to_int16_round_to_zero(floatx80 a) | the IEC/IEEE recommended logb(x) function. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_extract(floatx80 *a) +static floatx80 floatx80_extract(floatx80 *a) { Bit64u aSig = extractFloatx80Frac(*a); Bit32s aExp = extractFloatx80Exp(*a); @@ -3903,7 +3903,7 @@ LOCALFUNC floatx80 floatx80_extract(floatx80 *a) | Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_scale(floatx80 a, floatx80 b) +static floatx80 floatx80_scale(floatx80 a, floatx80 b) { int shiftCount; Bit32s scale; @@ -3984,7 +3984,7 @@ LOCALFUNC floatx80 floatx80_scale(floatx80 a, floatx80 b) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC float_class_t floatx80_class(floatx80 a) +static float_class_t floatx80_class(floatx80 a) { Bit32s aExp = extractFloatx80Exp(a); Bit64u aSig = extractFloatx80Frac(a); @@ -4023,7 +4023,7 @@ LOCALFUNC float_class_t floatx80_class(floatx80 a) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC int floatx80_compare(floatx80 a, floatx80 b) +static int floatx80_compare(floatx80 a, floatx80 b) { int aSign; int bSign; @@ -4092,7 +4092,7 @@ LOCALFUNC int floatx80_compare(floatx80 a, floatx80 b) *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC int floatx80_compare_quiet(floatx80 a, floatx80 b) +static int floatx80_compare_quiet(floatx80 a, floatx80 b) { int aSign; int bSign; @@ -4168,7 +4168,7 @@ LOCALFUNC int floatx80_compare_quiet(floatx80 a, floatx80 b) #define USE_estimateDiv128To64 /* executes single exponent reduction cycle */ -LOCALFUNC Bit64u remainder_kernel(Bit64u aSig0, Bit64u bSig, int expDiff, Bit64u *zSig0, Bit64u *zSig1) +static Bit64u remainder_kernel(Bit64u aSig0, Bit64u bSig, int expDiff, Bit64u *zSig0, Bit64u *zSig1) { Bit64u term0, term1; Bit64u aSig1 = 0; @@ -4185,7 +4185,7 @@ LOCALFUNC Bit64u remainder_kernel(Bit64u aSig0, Bit64u bSig, int expDiff, Bit64u return q; } -LOCALFUNC floatx80 do_fprem(floatx80 a, floatx80 b, Bit64u *q, int rounding_mode) +static floatx80 do_fprem(floatx80 a, floatx80 b, Bit64u *q, int rounding_mode) { Bit32s aExp, bExp, zExp, expDiff; Bit64u aSig0, aSig1, bSig; @@ -4296,7 +4296,7 @@ LOCALFUNC floatx80 do_fprem(floatx80 a, floatx80 b, Bit64u *q, int rounding_mode *----------------------------------------------------------------------------*/ #if cIncludeFPUUnused -LOCALFUNC floatx80 floatx80_ieee754_remainder(floatx80 a, floatx80 b, Bit64u *q) +static floatx80 floatx80_ieee754_remainder(floatx80 a, floatx80 b, Bit64u *q) { return do_fprem(a, b, q, float_round_nearest_even); } @@ -4311,7 +4311,7 @@ LOCALFUNC floatx80 floatx80_ieee754_remainder(floatx80 a, floatx80 b, Bit64u *q) | quotient of 'a' divided by 'b' to an integer. *----------------------------------------------------------------------------*/ -LOCALFUNC floatx80 floatx80_remainder(floatx80 a, floatx80 b, Bit64u *q) +static floatx80 floatx80_remainder(floatx80 a, floatx80 b, Bit64u *q) { return do_fprem(a, b, q, float_round_to_zero); } @@ -4394,7 +4394,7 @@ LOCALFUNC floatx80 floatx80_remainder(floatx80 a, floatx80 b, Bit64u *q) // f(x) ~ [ p(x) + x * q(x) ] // -LOCALFUNC float128 EvalPoly(float128 x, float128 *arr, unsigned n) +static float128 EvalPoly(float128 x, float128 *arr, unsigned n) { float128 r2; float128 x2 = float128_mul(x, x); @@ -4437,7 +4437,7 @@ LOCALFUNC float128 EvalPoly(float128 x, float128 *arr, unsigned n) // f(x) ~ [ p(x) + x * q(x) ] // -LOCALFUNC float128 EvenPoly(float128 x, float128 *arr, unsigned n) +static float128 EvenPoly(float128 x, float128 *arr, unsigned n) { return EvalPoly(float128_mul(x, x), arr, n); } @@ -4457,7 +4457,7 @@ LOCALFUNC float128 EvenPoly(float128 x, float128 *arr, unsigned n) // f(x) ~ x * [ p(x) + x * q(x) ] // -LOCALFUNC float128 OddPoly(float128 x, float128 *arr, unsigned n) +static float128 OddPoly(float128 x, float128 *arr, unsigned n) { return float128_mul(x, EvenPoly(x, arr, n)); } @@ -4498,7 +4498,7 @@ static float128 ln_arr[L2_ARR_SIZE] = PACK_FLOAT_128(0x3ffae1e1e1e1e1e1, 0xe1e1e1e1e1e1e1e2) /* 17 */ }; -LOCALFUNC float128 poly_ln(float128 x1) +static float128 poly_ln(float128 x1) { /* // @@ -4527,7 +4527,7 @@ LOCALFUNC float128 poly_ln(float128 x1) } /* required sqrt(2)/2 < x < sqrt(2) */ -LOCALFUNC float128 poly_l2(float128 x) +static float128 poly_l2(float128 x) { /* using float128 for approximation */ float128 x_p1 = float128_add(x, float128_one); @@ -4538,7 +4538,7 @@ LOCALFUNC float128 poly_l2(float128 x) return x; } -LOCALFUNC float128 poly_l2p1(float128 x) +static float128 poly_l2p1(float128 x) { /* using float128 for approximation */ float128 x_p2 = float128_add(x, float128_two); @@ -4573,7 +4573,7 @@ LOCALFUNC float128 poly_l2p1(float128 x) // 1-u 3 5 7 2n+1 // -LOCALFUNC floatx80 fyl2x(floatx80 a, floatx80 b) +static floatx80 fyl2x(floatx80 a, floatx80 b) { int aSign; int bSign; @@ -4696,7 +4696,7 @@ invalid: // 1-u 3 5 7 2n+1 // -LOCALFUNC floatx80 fyl2xp1(floatx80 a, floatx80 b) +static floatx80 fyl2xp1(floatx80 a, floatx80 b) { Bit32s aExp, bExp; Bit64u aSig, bSig, zSig0, zSig1, zSig2; @@ -4840,7 +4840,7 @@ static float128 exp_arr[EXP_ARR_SIZE] = }; /* required -1 < x < 1 */ -LOCALFUNC float128 poly_exp(float128 x) +static float128 poly_exp(float128 x) { /* // 2 3 4 5 6 7 8 9 @@ -4886,7 +4886,7 @@ LOCALFUNC float128 poly_exp(float128 x) // 1! 2! 3! 4! 5! n! // -LOCALFUNC floatx80 f2xm1(floatx80 a) +static floatx80 f2xm1(floatx80 a) { Bit64u zSig0, zSig1; float128 x; @@ -4967,7 +4967,7 @@ static const floatx80 floatx80_one = packFloatx80m(0, 0x3fff, LIT64(0x8000000000 /* reduce trigonometric function argument using 128-bit precision M_PI approximation */ -LOCALFUNC Bit64u argument_reduction_kernel(Bit64u aSig0, int Exp, Bit64u *zSig0, Bit64u *zSig1) +static Bit64u argument_reduction_kernel(Bit64u aSig0, int Exp, Bit64u *zSig0, Bit64u *zSig1) { Bit64u term0, term1, term2; Bit64u aSig1 = 0; @@ -4985,7 +4985,7 @@ LOCALFUNC Bit64u argument_reduction_kernel(Bit64u aSig0, int Exp, Bit64u *zSig0, return q; } -LOCALFUNC int reduce_trig_arg(int expDiff, int *zSign, Bit64u *aSig0, Bit64u *aSig1) +static int reduce_trig_arg(int expDiff, int *zSign, Bit64u *aSig0, Bit64u *aSig1) { Bit64u term0, term1, q = 0; @@ -5049,7 +5049,7 @@ static float128 cos_arr[COS_ARR_SIZE] = }; /* 0 <= x <= pi/4 */ -LOCALINLINEFUNC float128 poly_sin(float128 x) +static float128 poly_sin(float128 x) { // 3 5 7 9 11 13 15 // x x x x x x x @@ -5075,7 +5075,7 @@ LOCALINLINEFUNC float128 poly_sin(float128 x) } /* 0 <= x <= pi/4 */ -LOCALINLINEFUNC float128 poly_cos(float128 x) +static float128 poly_cos(float128 x) { // 2 4 6 8 10 12 14 // x x x x x x x @@ -5095,19 +5095,19 @@ LOCALINLINEFUNC float128 poly_cos(float128 x) return EvenPoly(x, cos_arr, COS_ARR_SIZE); } -LOCALINLINEPROC sincos_invalid(floatx80 *sin_a, floatx80 *cos_a, floatx80 a) +static void sincos_invalid(floatx80 *sin_a, floatx80 *cos_a, floatx80 a) { if (sin_a) *sin_a = a; if (cos_a) *cos_a = a; } -LOCALINLINEPROC sincos_tiny_argument(floatx80 *sin_a, floatx80 *cos_a, floatx80 a) +static void sincos_tiny_argument(floatx80 *sin_a, floatx80 *cos_a, floatx80 a) { if (sin_a) *sin_a = a; if (cos_a) *cos_a = floatx80_one; } -LOCALFUNC floatx80 sincos_approximation(int neg, float128 r, Bit64u quotient) +static floatx80 sincos_approximation(int neg, float128 r, Bit64u quotient) { floatx80 result; @@ -5148,7 +5148,7 @@ LOCALFUNC floatx80 sincos_approximation(int neg, float128 r, Bit64u quotient) // sin(x+2pi) = sin(x) // -LOCALFUNC int fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a) +static int fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a) { float128 r; Bit64u aSig0, aSig1 = 0; @@ -5267,7 +5267,7 @@ LOCALFUNC int fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a) // cos(x) // -LOCALFUNC int ftan(floatx80 *a) +static int ftan(floatx80 *a) { float128 r; float128 sin_r; @@ -5404,7 +5404,7 @@ static float128 atan_arr[FPATAN_ARR_SIZE] = }; /* |x| < 1/4 */ -LOCALFUNC float128 poly_atan(float128 x1) +static float128 poly_atan(float128 x1) { /* // 3 5 7 9 11 13 15 17 @@ -5475,7 +5475,7 @@ LOCALFUNC float128 poly_atan(float128 x1) // 3 5 7 9 2n+1 // -LOCALFUNC floatx80 fpatan(floatx80 a, floatx80 b) +static floatx80 fpatan(floatx80 a, floatx80 b) { float128 a128; float128 b128; @@ -5640,27 +5640,27 @@ approximation_completed: typedef floatx80 myfpr; -LOCALPROC myfp_FromExtendedFormat(myfpr *r, uint16_t v2, uint32_t v1, uint32_t v0) +static void myfp_FromExtendedFormat(myfpr *r, uint16_t v2, uint32_t v1, uint32_t v0) { r->high = v2; r->low = (((uint64_t)v1) << 32) | (v0 & 0xFFFFFFFF); } -LOCALPROC myfp_ToExtendedFormat(myfpr *dd, uint16_t *v2, uint32_t *v1, uint32_t *v0) +static void myfp_ToExtendedFormat(myfpr *dd, uint16_t *v2, uint32_t *v1, uint32_t *v0) { *v0 = ((uint64_t) dd->low) & 0xFFFFFFFF; *v1 = (((uint64_t) dd->low) >> 32) & 0xFFFFFFFF; *v2 = dd->high; } -LOCALPROC myfp_FromDoubleFormat(myfpr *r, uint32_t v1, uint32_t v0) +static void myfp_FromDoubleFormat(myfpr *r, uint32_t v1, uint32_t v0) { float64 t = (float64)((((uint64_t)v1) << 32) | (v0 & 0xFFFFFFFF)); *r = float64_to_floatx80(t); } -LOCALPROC myfp_ToDoubleFormat(myfpr *dd, uint32_t *v1, uint32_t *v0) +static void myfp_ToDoubleFormat(myfpr *dd, uint32_t *v1, uint32_t *v0) { float64 t = floatx80_to_float64(*dd); @@ -5668,101 +5668,101 @@ LOCALPROC myfp_ToDoubleFormat(myfpr *dd, uint32_t *v1, uint32_t *v0) *v1 = (((uint64_t) t) >> 32) & 0xFFFFFFFF; } -LOCALPROC myfp_FromSingleFormat(myfpr *r, uint32_t x) +static void myfp_FromSingleFormat(myfpr *r, uint32_t x) { *r = float32_to_floatx80(x); } -LOCALFUNC uint32_t myfp_ToSingleFormat(myfpr *ff) +static uint32_t myfp_ToSingleFormat(myfpr *ff) { return floatx80_to_float32(*ff); } -LOCALPROC myfp_FromLong(myfpr *r, uint32_t x) +static void myfp_FromLong(myfpr *r, uint32_t x) { *r = int32_to_floatx80( x ); } -LOCALFUNC uint32_t myfp_ToLong(myfpr *x) +static uint32_t myfp_ToLong(myfpr *x) { return floatx80_to_int32( *x ); } -LOCALFUNC bool myfp_IsNan(myfpr *x) +static bool myfp_IsNan(myfpr *x) { return floatx80_is_nan(*x); } -LOCALFUNC bool myfp_IsInf(myfpr *x) +static bool myfp_IsInf(myfpr *x) { return ( ( x->high & 0x7FFF ) == 0x7FFF ) && (0 == ((uint64_t) ( x->low<<1 ))); } -LOCALFUNC bool myfp_IsZero(myfpr *x) +static bool myfp_IsZero(myfpr *x) { return ( ( x->high & 0x7FFF ) == 0x0000 ) && (0 == ((uint64_t) ( x->low<<1 ))); } -LOCALFUNC bool myfp_IsNeg(myfpr *x) +static bool myfp_IsNeg(myfpr *x) { return ( ( x->high & 0x8000 ) != 0x0000 ); } -LOCALPROC myfp_Add(myfpr *r, const myfpr *a, const myfpr *b) +static void myfp_Add(myfpr *r, const myfpr *a, const myfpr *b) { *r = floatx80_add(*a, *b); } -LOCALPROC myfp_Sub(myfpr *r, const myfpr *a, const myfpr *b) +static void myfp_Sub(myfpr *r, const myfpr *a, const myfpr *b) { *r = floatx80_sub(*a, *b); } -LOCALPROC myfp_Mul(myfpr *r, const myfpr *a, const myfpr *b) +static void myfp_Mul(myfpr *r, const myfpr *a, const myfpr *b) { *r = floatx80_mul(*a, *b); } -LOCALPROC myfp_Div(myfpr *r, const myfpr *a, const myfpr *b) +static void myfp_Div(myfpr *r, const myfpr *a, const myfpr *b) { *r = floatx80_div(*a, *b); } -LOCALPROC myfp_Rem(myfpr *r, const myfpr *a, const myfpr *b) +static void myfp_Rem(myfpr *r, const myfpr *a, const myfpr *b) { *r = floatx80_rem(*a, *b); } -LOCALPROC myfp_Sqrt(myfpr *r, myfpr *x) +static void myfp_Sqrt(myfpr *r, myfpr *x) { *r = floatx80_sqrt(*x); } -LOCALPROC myfp_Mod(myfpr *r, myfpr *a, myfpr *b) +static void myfp_Mod(myfpr *r, myfpr *a, myfpr *b) { Bit64u q; *r = floatx80_remainder(*a, *b, &q); /* should save low byte of q */ } -LOCALPROC myfp_Scale(myfpr *r, myfpr *a, myfpr *b) +static void myfp_Scale(myfpr *r, myfpr *a, myfpr *b) { *r = floatx80_scale(*a, *b); } -LOCALPROC myfp_GetMan(myfpr *r, myfpr *x) +static void myfp_GetMan(myfpr *r, myfpr *x) { *r = *x; (void) floatx80_extract(r); } -LOCALPROC myfp_GetExp(myfpr *r, myfpr *x) +static void myfp_GetExp(myfpr *r, myfpr *x) { floatx80 t0 = *x; *r = floatx80_extract(&t0); } -LOCALPROC myfp_floor(myfpr *r, myfpr *x) +static void myfp_floor(myfpr *r, myfpr *x) { int8_t SaveRoundingMode = float_rounding_mode; @@ -5771,7 +5771,7 @@ LOCALPROC myfp_floor(myfpr *r, myfpr *x) float_rounding_mode = SaveRoundingMode; } -LOCALPROC myfp_IntRZ(myfpr *r, myfpr *x) +static void myfp_IntRZ(myfpr *r, myfpr *x) { int8_t SaveRoundingMode = float_rounding_mode; @@ -5780,38 +5780,38 @@ LOCALPROC myfp_IntRZ(myfpr *r, myfpr *x) float_rounding_mode = SaveRoundingMode; } -LOCALPROC myfp_Int(myfpr *r, myfpr *x) +static void myfp_Int(myfpr *r, myfpr *x) { *r = floatx80_round_to_int(*x); } -LOCALPROC myfp_RoundToSingle(myfpr *r, myfpr *x) +static void myfp_RoundToSingle(myfpr *r, myfpr *x) { float32 t0 = floatx80_to_float32(*x); *r = float32_to_floatx80(t0); } -LOCALPROC myfp_RoundToDouble(myfpr *r, myfpr *x) +static void myfp_RoundToDouble(myfpr *r, myfpr *x) { float64 t0 = floatx80_to_float64(*x); *r = float64_to_floatx80(t0); } -LOCALPROC myfp_Abs(myfpr *r, myfpr *x) +static void myfp_Abs(myfpr *r, myfpr *x) { *r = *x; r->high &= 0x7FFF; } -LOCALPROC myfp_Neg(myfpr *r, myfpr *x) +static void myfp_Neg(myfpr *r, myfpr *x) { *r = *x; r->high ^= 0x8000; } -LOCALPROC myfp_TwoToX(myfpr *r, myfpr *x) +static void myfp_TwoToX(myfpr *r, myfpr *x) { floatx80 t2; floatx80 t3; @@ -5824,7 +5824,7 @@ LOCALPROC myfp_TwoToX(myfpr *r, myfpr *x) *r = floatx80_scale(t5, t2); } -LOCALPROC myfp_TenToX(myfpr *r, myfpr *x) +static void myfp_TenToX(myfpr *r, myfpr *x) { floatx80 t1; const floatx80 t = /* 1.0 / log(2.0) */ @@ -5835,7 +5835,7 @@ LOCALPROC myfp_TenToX(myfpr *r, myfpr *x) myfp_TwoToX(r, &t1); } -LOCALPROC myfp_EToX(myfpr *r, myfpr *x) +static void myfp_EToX(myfpr *r, myfpr *x) { floatx80 t1; const floatx80 t = /* 1.0 / log(2.0) */ @@ -5844,7 +5844,7 @@ LOCALPROC myfp_EToX(myfpr *r, myfpr *x) myfp_TwoToX(r, &t1); } -LOCALPROC myfp_EToXM1(myfpr *r, myfpr *x) +static void myfp_EToXM1(myfpr *r, myfpr *x) { floatx80 t1; floatx80 t2; @@ -5867,54 +5867,54 @@ LOCALPROC myfp_EToXM1(myfpr *r, myfpr *x) } } -LOCALPROC myfp_Log2(myfpr *r, myfpr *x) +static void myfp_Log2(myfpr *r, myfpr *x) { *r = fyl2x(*x, floatx80_one); } -LOCALPROC myfp_LogN(myfpr *r, myfpr *x) +static void myfp_LogN(myfpr *r, myfpr *x) { const floatx80 t = /* log(2.0) */ packFloatx80m(0, 0x3ffe, LIT64(0xb17217f7d1cf79ac)); *r = fyl2x(*x, t); } -LOCALPROC myfp_Log10(myfpr *r, myfpr *x) +static void myfp_Log10(myfpr *r, myfpr *x) { const floatx80 t = /* log10(2.0) = ln(2) / ln(10), unknown accuracy */ packFloatx80m(0, 0x3ffd, LIT64(0x9a209a84fbcff798)); *r = fyl2x(*x, t); } -LOCALPROC myfp_LogNP1(myfpr *r, myfpr *x) +static void myfp_LogNP1(myfpr *r, myfpr *x) { const floatx80 t = /* log(2.0) */ packFloatx80m(0, 0x3ffe, LIT64(0xb17217f7d1cf79ac)); *r = fyl2xp1(*x, t); } -LOCALPROC myfp_Sin(myfpr *r, myfpr *x) +static void myfp_Sin(myfpr *r, myfpr *x) { (void) fsincos(*x, r, 0); } -LOCALPROC myfp_Cos(myfpr *r, myfpr *x) +static void myfp_Cos(myfpr *r, myfpr *x) { (void) fsincos(*x, 0, r); } -LOCALPROC myfp_Tan(myfpr *r, myfpr *x) +static void myfp_Tan(myfpr *r, myfpr *x) { *r = *x; (void) ftan(r); } -LOCALPROC myfp_ATan(myfpr *r, myfpr *x) +static void myfp_ATan(myfpr *r, myfpr *x) { *r = fpatan(floatx80_one, *x); } -LOCALPROC myfp_ASin(myfpr *r, myfpr *x) +static void myfp_ASin(myfpr *r, myfpr *x) { floatx80 x2 = floatx80_mul(*x, *x); floatx80 mx2 = floatx80_sub(floatx80_one, x2); @@ -5923,7 +5923,7 @@ LOCALPROC myfp_ASin(myfpr *r, myfpr *x) *r = fpatan(cx, *x); } -LOCALPROC myfp_ACos(myfpr *r, myfpr *x) +static void myfp_ACos(myfpr *r, myfpr *x) { floatx80 x2 = floatx80_mul(*x, *x); floatx80 mx2 = floatx80_sub(floatx80_one, x2); @@ -5941,7 +5941,7 @@ static const floatx80 floatx80_Two = static const floatx80 floatx80_Ten = packFloatx80m(0, 0x4002, LIT64(0xa000000000000000)); -LOCALPROC myfp_Sinh(myfpr *r, myfpr *x) +static void myfp_Sinh(myfpr *r, myfpr *x) { myfpr ex; myfpr nx; @@ -5955,7 +5955,7 @@ LOCALPROC myfp_Sinh(myfpr *r, myfpr *x) myfp_Div(r, &t1, &floatx80_Two); } -LOCALPROC myfp_Cosh(myfpr *r, myfpr *x) +static void myfp_Cosh(myfpr *r, myfpr *x) { myfpr ex; myfpr nx; @@ -5969,7 +5969,7 @@ LOCALPROC myfp_Cosh(myfpr *r, myfpr *x) myfp_Div(r, &t1, &floatx80_Two); } -LOCALPROC myfp_Tanh(myfpr *r, myfpr *x) +static void myfp_Tanh(myfpr *r, myfpr *x) { myfpr x2; myfpr ex2; @@ -5983,7 +5983,7 @@ LOCALPROC myfp_Tanh(myfpr *r, myfpr *x) myfp_Div(r, &ex2m1, &ex2p1); } -LOCALPROC myfp_ATanh(myfpr *r, myfpr *x) +static void myfp_ATanh(myfpr *r, myfpr *x) { myfpr onepx; myfpr onemx; @@ -5997,12 +5997,12 @@ LOCALPROC myfp_ATanh(myfpr *r, myfpr *x) myfp_Div(r, &ldv, &floatx80_Two); } -LOCALPROC myfp_SinCos(myfpr *r_sin, myfpr *r_cos, myfpr *source) +static void myfp_SinCos(myfpr *r_sin, myfpr *r_cos, myfpr *source) { (void) fsincos(*source, r_sin, r_cos); } -LOCALFUNC bool myfp_getCR(myfpr *r, uint16_t opmode) +static bool myfp_getCR(myfpr *r, uint16_t opmode) { switch (opmode) { case 0x00: @@ -6151,7 +6151,7 @@ LOCALFUNC bool myfp_getCR(myfpr *r, uint16_t opmode) /* Floating point control register */ -LOCALPROC myfp_SetFPCR(uint32_t v) +static void myfp_SetFPCR(uint32_t v) { switch ((v >> 4) & 0x03) { case 0: @@ -6189,7 +6189,7 @@ LOCALPROC myfp_SetFPCR(uint32_t v) } } -LOCALFUNC uint32_t myfp_GetFPCR(void) +static uint32_t myfp_GetFPCR(void) { uint32_t v = 0; @@ -6222,33 +6222,33 @@ LOCALFUNC uint32_t myfp_GetFPCR(void) return v; } -LOCALVAR struct myfp_envStruct +static struct myfp_envStruct { uint32_t FPSR; /* Floating point status register */ } myfp_env; -LOCALPROC myfp_SetFPSR(uint32_t v) +static void myfp_SetFPSR(uint32_t v) { myfp_env.FPSR = v; } -LOCALFUNC uint32_t myfp_GetFPSR(void) +static uint32_t myfp_GetFPSR(void) { return myfp_env.FPSR; } -LOCALFUNC uint8_t myfp_GetConditionCodeByte(void) +static uint8_t myfp_GetConditionCodeByte(void) { return (myfp_env.FPSR >> 24) & 0x0F; } -LOCALPROC myfp_SetConditionCodeByte(uint8_t v) +static void myfp_SetConditionCodeByte(uint8_t v) { myfp_env.FPSR = ((myfp_env.FPSR & 0x00FFFFFF) | (v << 24)); } -LOCALPROC myfp_SetConditionCodeByteFromResult(myfpr *result) +static void myfp_SetConditionCodeByteFromResult(myfpr *result) { /* Set condition codes here based on result */ diff --git a/src/HW/M68K/M68KITAB.c b/src/HW/M68K/M68KITAB.c index b866650..8bc2094 100644 --- a/src/HW/M68K/M68KITAB.c +++ b/src/HW/M68K/M68KITAB.c @@ -71,7 +71,7 @@ enum { #define kAvgCycPerInstr (10 * kCycleScale + (40 * kCycleScale / 64)) -LOCALFUNC uint8_t GetAMdRegSz(WorkR *p) +static uint8_t GetAMdRegSz(WorkR *p) { uint8_t CurAMd; @@ -91,7 +91,7 @@ LOCALFUNC uint8_t GetAMdRegSz(WorkR *p) return CurAMd; } -LOCALFUNC uint8_t GetAMdIndirectSz(WorkR *p) +static uint8_t GetAMdIndirectSz(WorkR *p) { uint8_t CurAMd; @@ -112,7 +112,7 @@ LOCALFUNC uint8_t GetAMdIndirectSz(WorkR *p) } #if WantCycByPriOp -LOCALFUNC uint16_t OpEACalcCyc(WorkR *p, uint8_t m, uint8_t r) +static uint16_t OpEACalcCyc(WorkR *p, uint8_t m, uint8_t r) { uint16_t v; @@ -188,7 +188,7 @@ LOCALFUNC uint16_t OpEACalcCyc(WorkR *p, uint8_t m, uint8_t r) #endif #if WantCycByPriOp -LOCALFUNC uint16_t OpEADestCalcCyc(WorkR *p, uint8_t m, uint8_t r) +static uint16_t OpEADestCalcCyc(WorkR *p, uint8_t m, uint8_t r) { uint16_t v; @@ -252,7 +252,7 @@ LOCALFUNC uint16_t OpEADestCalcCyc(WorkR *p, uint8_t m, uint8_t r) } #endif -LOCALPROC SetDcoArgFields(WorkR *p, bool src, +static void SetDcoArgFields(WorkR *p, bool src, uint8_t CurAMd, uint8_t CurArgDat) { if (src) { @@ -264,7 +264,7 @@ LOCALPROC SetDcoArgFields(WorkR *p, bool src, } } -LOCALFUNC bool CheckValidAddrMode(WorkR *p, +static bool CheckValidAddrMode(WorkR *p, uint8_t m, uint8_t r, uint8_t v, bool src) { uint8_t CurAMd = 0; /* init to keep compiler happy */ @@ -493,7 +493,7 @@ LOCALFUNC bool CheckValidAddrMode(WorkR *p, } #if WantCycByPriOp -LOCALFUNC bool LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r) +static bool LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r) { uint16_t v; @@ -536,43 +536,43 @@ LOCALFUNC bool LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r) } #endif -LOCALFUNC bool IsValidAddrMode(WorkR *p) +static bool IsValidAddrMode(WorkR *p) { return CheckValidAddrMode(p, mode(p), reg(p), kAddrValidAny, false); } -LOCALFUNC bool CheckDataAltAddrMode(WorkR *p) +static bool CheckDataAltAddrMode(WorkR *p) { return CheckValidAddrMode(p, mode(p), reg(p), kAddrValidDataAlt, false); } -LOCALFUNC bool CheckDataAddrMode(WorkR *p) +static bool CheckDataAddrMode(WorkR *p) { return CheckValidAddrMode(p, mode(p), reg(p), kAddrValidData, false); } -LOCALFUNC bool CheckControlAddrMode(WorkR *p) +static bool CheckControlAddrMode(WorkR *p) { return CheckValidAddrMode(p, mode(p), reg(p), kAddrValidControl, false); } -LOCALFUNC bool CheckControlAltAddrMode(WorkR *p) +static bool CheckControlAltAddrMode(WorkR *p) { return CheckValidAddrMode(p, mode(p), reg(p), kAddrValidControlAlt, false); } -LOCALFUNC bool CheckAltMemAddrMode(WorkR *p) +static bool CheckAltMemAddrMode(WorkR *p) { return CheckValidAddrMode(p, mode(p), reg(p), kAddrValidAltMem, false); } -LOCALPROC FindOpSizeFromb76(WorkR *p) +static void FindOpSizeFromb76(WorkR *p) { p->opsize = 1 << b76(p); #if 0 @@ -590,7 +590,7 @@ LOCALPROC FindOpSizeFromb76(WorkR *p) #endif } -LOCALFUNC uint8_t OpSizeOffset(WorkR *p) +static uint8_t OpSizeOffset(WorkR *p) { uint8_t v; @@ -611,7 +611,7 @@ LOCALFUNC uint8_t OpSizeOffset(WorkR *p) } -LOCALFUNC uint32_t octdat(uint32_t x) +static uint32_t octdat(uint32_t x) { if (x == 0) { return 8; @@ -620,7 +620,7 @@ LOCALFUNC uint32_t octdat(uint32_t x) } } -LOCALPROCUSEDONCE DeCode0(WorkR *p) +static void DeCode0(WorkR *p) { if (b8(p) == 1) { if (mode(p) == 1) { @@ -1059,7 +1059,7 @@ LOCALPROCUSEDONCE DeCode0(WorkR *p) } } -LOCALPROCUSEDONCE DeCode1(WorkR *p) +static void DeCode1(WorkR *p) { p->opsize = 1; if (md6(p) == 1) { /* MOVEA */ @@ -1083,7 +1083,7 @@ LOCALPROCUSEDONCE DeCode1(WorkR *p) } } -LOCALPROCUSEDONCE DeCode2(WorkR *p) +static void DeCode2(WorkR *p) { p->opsize = 4; if (md6(p) == 1) { /* MOVEA */ @@ -1115,7 +1115,7 @@ LOCALPROCUSEDONCE DeCode2(WorkR *p) } } -LOCALPROCUSEDONCE DeCode3(WorkR *p) +static void DeCode3(WorkR *p) { p->opsize = 2; if (md6(p) == 1) { /* MOVEA */ @@ -1155,7 +1155,7 @@ LOCALPROCUSEDONCE DeCode3(WorkR *p) #define MoveAvgN 3 #endif -LOCALFUNC uint16_t MoveMEACalcCyc(WorkR *p, uint8_t m, uint8_t r) +static uint16_t MoveMEACalcCyc(WorkR *p, uint8_t m, uint8_t r) { uint16_t v; @@ -1195,7 +1195,7 @@ LOCALFUNC uint16_t MoveMEACalcCyc(WorkR *p, uint8_t m, uint8_t r) #endif -LOCALPROCUSEDONCE DeCode4(WorkR *p) +static void DeCode4(WorkR *p) { if (b8(p) != 0) { switch (b76(p)) { @@ -1919,7 +1919,7 @@ LOCALPROCUSEDONCE DeCode4(WorkR *p) } } -LOCALPROCUSEDONCE DeCode5(WorkR *p) +static void DeCode5(WorkR *p) { if (b76(p) == 3) { p->DecOp.y.v[0].ArgDat = (p->opcode >> 8) & 15; @@ -2037,7 +2037,7 @@ LOCALPROCUSEDONCE DeCode5(WorkR *p) } } -LOCALPROCUSEDONCE DeCode6(WorkR *p) +static void DeCode6(WorkR *p) { uint32_t cond = (p->opcode >> 8) & 15; @@ -2111,7 +2111,7 @@ LOCALPROCUSEDONCE DeCode6(WorkR *p) } } -LOCALPROCUSEDONCE DeCode7(WorkR *p) +static void DeCode7(WorkR *p) { if (b8(p) == 0) { p->opsize = 4; @@ -2126,7 +2126,7 @@ LOCALPROCUSEDONCE DeCode7(WorkR *p) } } -LOCALPROCUSEDONCE DeCode8(WorkR *p) +static void DeCode8(WorkR *p) { if (b76(p) == 3) { p->opsize = 2; @@ -2318,7 +2318,7 @@ LOCALPROCUSEDONCE DeCode8(WorkR *p) } } -LOCALPROCUSEDONCE DeCode9(WorkR *p) +static void DeCode9(WorkR *p) { if (b76(p) == 3) { /* SUBA 1001dddm11mmmrrr */ @@ -2441,7 +2441,7 @@ LOCALPROCUSEDONCE DeCode9(WorkR *p) } } -LOCALPROCUSEDONCE DeCodeA(WorkR *p) +static void DeCodeA(WorkR *p) { #if WantCycByPriOp p->Cycles = (34 * kCycleScale @@ -2450,7 +2450,7 @@ LOCALPROCUSEDONCE DeCodeA(WorkR *p) p->MainClass = kIKindA; } -LOCALPROCUSEDONCE DeCodeB(WorkR *p) +static void DeCodeB(WorkR *p) { if (b76(p) == 3) { /* CMPA 1011ddds11mmmrrr */ @@ -2544,7 +2544,7 @@ LOCALPROCUSEDONCE DeCodeB(WorkR *p) } } -LOCALPROCUSEDONCE DeCodeC(WorkR *p) +static void DeCodeC(WorkR *p) { if (b76(p) == 3) { p->opsize = 2; @@ -2705,7 +2705,7 @@ LOCALPROCUSEDONCE DeCodeC(WorkR *p) } } -LOCALPROCUSEDONCE DeCodeD(WorkR *p) +static void DeCodeD(WorkR *p) { if (b76(p) == 3) { /* ADDA 1101dddm11mmmrrr */ @@ -2812,7 +2812,7 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p) } } -LOCALFUNC uint32_t rolops(WorkR *p, uint32_t x) +static uint32_t rolops(WorkR *p, uint32_t x) { uint32_t binop; @@ -2824,7 +2824,7 @@ LOCALFUNC uint32_t rolops(WorkR *p, uint32_t x) return kIKindAslB + 3 * binop + OpSizeOffset(p); } -LOCALPROCUSEDONCE DeCodeE(WorkR *p) +static void DeCodeE(WorkR *p) { if (b76(p) == 3) { if ((p->opcode & 0x0800) != 0) { @@ -2918,7 +2918,7 @@ LOCALPROCUSEDONCE DeCodeE(WorkR *p) } } -LOCALPROCUSEDONCE DeCodeF(WorkR *p) +static void DeCodeF(WorkR *p) { #if WantCycByPriOp p->Cycles = @@ -2975,7 +2975,7 @@ LOCALPROCUSEDONCE DeCodeF(WorkR *p) #endif } -LOCALPROC DeCodeOneOp(WorkR *p) +static void DeCodeOneOp(WorkR *p) { switch (p->opcode >> 12) { case 0x0: @@ -3048,7 +3048,7 @@ LOCALPROC DeCodeOneOp(WorkR *p) #endif } -GLOBALPROC M68KITAB_setup(DecOpR *p) +void M68KITAB_setup(DecOpR *p) { uint32_t i; WorkR r; diff --git a/src/HW/M68K/M68KITAB.h b/src/HW/M68K/M68KITAB.h index 56b2fd5..a40feda 100644 --- a/src/HW/M68K/M68KITAB.h +++ b/src/HW/M68K/M68KITAB.h @@ -270,6 +270,6 @@ typedef struct DecOpR DecOpR; #define SetDcoMainClas(p, xx) ((p)->x.MainClas = (xx)) #define SetDcoCycles(p, xx) ((p)->x.Cycles = (xx)) -EXPORTPROC M68KITAB_setup(DecOpR *p); +extern void M68KITAB_setup(DecOpR *p); #endif \ No newline at end of file diff --git a/src/HW/M68K/MINEM68K.c b/src/HW/M68K/MINEM68K.c index 6e5f6d1..b2e8034 100644 --- a/src/HW/M68K/MINEM68K.c +++ b/src/HW/M68K/MINEM68K.c @@ -156,7 +156,7 @@ typedef void (reg_call *ArgSetDstP)(uint32_t f); #define HaveGlbReg 0 #endif -LOCALVAR struct regstruct +static struct regstruct { uint32_t regs[16]; /* Data and Address registers */ @@ -304,15 +304,15 @@ uint8_t * g_pc_pHi asm (r_pc_pHi); #endif #if WantDumpTable -LOCALVAR uint32_t DumpTable[kNumIKinds]; +static uint32_t DumpTable[kNumIKinds]; #endif #if USE_PCLIMIT -FORWARDPROC Recalc_PC_Block(void); -FORWARDFUNC uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v); +static void Recalc_PC_Block(void); +static uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v); #endif -LOCALINLINEFUNC uint16_t nextiword(void) +static uint16_t nextiword(void) /* NOT sign extended */ { uint16_t r = do_get_mem_word(V_pc_p); @@ -327,7 +327,7 @@ LOCALINLINEFUNC uint16_t nextiword(void) return r; } -LOCALINLINEFUNC uint32_t nextiSByte(void) +static uint32_t nextiSByte(void) { uint32_t r = uint32_t_FromSByte(do_get_mem_byte(V_pc_p + 1)); V_pc_p += 2; @@ -341,7 +341,7 @@ LOCALINLINEFUNC uint32_t nextiSByte(void) return r; } -LOCALINLINEFUNC uint32_t nextiSWord(void) +static uint32_t nextiSWord(void) /* NOT sign extended */ { uint32_t r = uint32_t_FromSWord(do_get_mem_word(V_pc_p)); @@ -356,9 +356,9 @@ LOCALINLINEFUNC uint32_t nextiSWord(void) return r; } -FORWARDFUNC uint32_t nextilong_ext(void); +static uint32_t nextilong_ext(void); -LOCALINLINEFUNC uint32_t nextilong(void) +static uint32_t nextilong(void) { uint32_t r = do_get_mem_long(V_pc_p); V_pc_p += 4; @@ -373,7 +373,7 @@ LOCALINLINEFUNC uint32_t nextilong(void) return r; } -LOCALINLINEPROC BackupPC(void) +static void BackupPC(void) { V_pc_p -= 2; @@ -384,187 +384,187 @@ LOCALINLINEPROC BackupPC(void) #endif } -LOCALINLINEFUNC CPTR m68k_getpc(void) +static CPTR m68k_getpc(void) { return V_regs.pc + (V_pc_p - V_regs.pc_pLo); } -FORWARDPROC DoCodeTst(void); -FORWARDPROC DoCodeCmpB(void); -FORWARDPROC DoCodeCmpW(void); -FORWARDPROC DoCodeCmpL(void); -FORWARDPROC DoCodeBccB(void); -FORWARDPROC DoCodeBccW(void); -FORWARDPROC DoCodeBraB(void); -FORWARDPROC DoCodeBraW(void); -FORWARDPROC DoCodeDBcc(void); -FORWARDPROC DoCodeDBF(void); -FORWARDPROC DoCodeSwap(void); -FORWARDPROC DoCodeMoveL(void); -FORWARDPROC DoCodeMoveW(void); -FORWARDPROC DoCodeMoveB(void); -FORWARDPROC DoCodeMoveA(void); -FORWARDPROC DoCodeMoveQ(void); -FORWARDPROC DoCodeAddB(void); -FORWARDPROC DoCodeAddW(void); -FORWARDPROC DoCodeAddL(void); -FORWARDPROC DoCodeSubB(void); -FORWARDPROC DoCodeSubW(void); -FORWARDPROC DoCodeSubL(void); -FORWARDPROC DoCodeLea(void); -FORWARDPROC DoCodePEA(void); -FORWARDPROC DoCodeA(void); -FORWARDPROC DoCodeBsrB(void); -FORWARDPROC DoCodeBsrW(void); -FORWARDPROC DoCodeJsr(void); -FORWARDPROC DoCodeLinkA6(void); -FORWARDPROC DoCodeMOVEMRmML(void); -FORWARDPROC DoCodeMOVEMApRL(void); -FORWARDPROC DoCodeUnlkA6(void); -FORWARDPROC DoCodeRts(void); -FORWARDPROC DoCodeJmp(void); -FORWARDPROC DoCodeClr(void); -FORWARDPROC DoCodeAddA(void); -FORWARDPROC DoCodeSubA(void); -FORWARDPROC DoCodeCmpA(void); -FORWARDPROC DoCodeAddXB(void); -FORWARDPROC DoCodeAddXW(void); -FORWARDPROC DoCodeAddXL(void); -FORWARDPROC DoCodeSubXB(void); -FORWARDPROC DoCodeSubXW(void); -FORWARDPROC DoCodeSubXL(void); -FORWARDPROC DoCodeAslB(void); -FORWARDPROC DoCodeAslW(void); -FORWARDPROC DoCodeAslL(void); -FORWARDPROC DoCodeAsrB(void); -FORWARDPROC DoCodeAsrW(void); -FORWARDPROC DoCodeAsrL(void); -FORWARDPROC DoCodeLslB(void); -FORWARDPROC DoCodeLslW(void); -FORWARDPROC DoCodeLslL(void); -FORWARDPROC DoCodeLsrB(void); -FORWARDPROC DoCodeLsrW(void); -FORWARDPROC DoCodeLsrL(void); -FORWARDPROC DoCodeRxlB(void); -FORWARDPROC DoCodeRxlW(void); -FORWARDPROC DoCodeRxlL(void); -FORWARDPROC DoCodeRxrB(void); -FORWARDPROC DoCodeRxrW(void); -FORWARDPROC DoCodeRxrL(void); -FORWARDPROC DoCodeRolB(void); -FORWARDPROC DoCodeRolW(void); -FORWARDPROC DoCodeRolL(void); -FORWARDPROC DoCodeRorB(void); -FORWARDPROC DoCodeRorW(void); -FORWARDPROC DoCodeRorL(void); -FORWARDPROC DoCodeBTstB(void); -FORWARDPROC DoCodeBChgB(void); -FORWARDPROC DoCodeBClrB(void); -FORWARDPROC DoCodeBSetB(void); -FORWARDPROC DoCodeBTstL(void); -FORWARDPROC DoCodeBChgL(void); -FORWARDPROC DoCodeBClrL(void); -FORWARDPROC DoCodeBSetL(void); -FORWARDPROC DoCodeAnd(void); -FORWARDPROC DoCodeOr(void); -FORWARDPROC DoCodeEor(void); -FORWARDPROC DoCodeNot(void); -FORWARDPROC DoCodeScc(void); -FORWARDPROC DoCodeNegXB(void); -FORWARDPROC DoCodeNegXW(void); -FORWARDPROC DoCodeNegXL(void); -FORWARDPROC DoCodeNegB(void); -FORWARDPROC DoCodeNegW(void); -FORWARDPROC DoCodeNegL(void); -FORWARDPROC DoCodeEXTW(void); -FORWARDPROC DoCodeEXTL(void); -FORWARDPROC DoCodeMulU(void); -FORWARDPROC DoCodeMulS(void); -FORWARDPROC DoCodeDivU(void); -FORWARDPROC DoCodeDivS(void); -FORWARDPROC DoCodeExg(void); -FORWARDPROC DoCodeMoveEaCR(void); -FORWARDPROC DoCodeMoveSREa(void); -FORWARDPROC DoCodeMoveEaSR(void); -FORWARDPROC DoCodeOrISR(void); -FORWARDPROC DoCodeAndISR(void); -FORWARDPROC DoCodeEorISR(void); -FORWARDPROC DoCodeOrICCR(void); -FORWARDPROC DoCodeAndICCR(void); -FORWARDPROC DoCodeEorICCR(void); -FORWARDPROC DoCodeMOVEMApRW(void); -FORWARDPROC DoCodeMOVEMRmMW(void); -FORWARDPROC DoCodeMOVEMrmW(void); -FORWARDPROC DoCodeMOVEMrmL(void); -FORWARDPROC DoCodeMOVEMmrW(void); -FORWARDPROC DoCodeMOVEMmrL(void); -FORWARDPROC DoCodeAbcd(void); -FORWARDPROC DoCodeSbcd(void); -FORWARDPROC DoCodeNbcd(void); -FORWARDPROC DoCodeRte(void); -FORWARDPROC DoCodeNop(void); -FORWARDPROC DoCodeMoveP0(void); -FORWARDPROC DoCodeMoveP1(void); -FORWARDPROC DoCodeMoveP2(void); -FORWARDPROC DoCodeMoveP3(void); -FORWARDPROC op_illg(void); -FORWARDPROC DoCodeChk(void); -FORWARDPROC DoCodeTrap(void); -FORWARDPROC DoCodeTrapV(void); -FORWARDPROC DoCodeRtr(void); -FORWARDPROC DoCodeLink(void); -FORWARDPROC DoCodeUnlk(void); -FORWARDPROC DoCodeMoveRUSP(void); -FORWARDPROC DoCodeMoveUSPR(void); -FORWARDPROC DoCodeTas(void); -FORWARDPROC DoCodeFdefault(void); -FORWARDPROC DoCodeStop(void); -FORWARDPROC DoCodeReset(void); +static void DoCodeTst(void); +static void DoCodeCmpB(void); +static void DoCodeCmpW(void); +static void DoCodeCmpL(void); +static void DoCodeBccB(void); +static void DoCodeBccW(void); +static void DoCodeBraB(void); +static void DoCodeBraW(void); +static void DoCodeDBcc(void); +static void DoCodeDBF(void); +static void DoCodeSwap(void); +static void DoCodeMoveL(void); +static void DoCodeMoveW(void); +static void DoCodeMoveB(void); +static void DoCodeMoveA(void); +static void DoCodeMoveQ(void); +static void DoCodeAddB(void); +static void DoCodeAddW(void); +static void DoCodeAddL(void); +static void DoCodeSubB(void); +static void DoCodeSubW(void); +static void DoCodeSubL(void); +static void DoCodeLea(void); +static void DoCodePEA(void); +static void DoCodeA(void); +static void DoCodeBsrB(void); +static void DoCodeBsrW(void); +static void DoCodeJsr(void); +static void DoCodeLinkA6(void); +static void DoCodeMOVEMRmML(void); +static void DoCodeMOVEMApRL(void); +static void DoCodeUnlkA6(void); +static void DoCodeRts(void); +static void DoCodeJmp(void); +static void DoCodeClr(void); +static void DoCodeAddA(void); +static void DoCodeSubA(void); +static void DoCodeCmpA(void); +static void DoCodeAddXB(void); +static void DoCodeAddXW(void); +static void DoCodeAddXL(void); +static void DoCodeSubXB(void); +static void DoCodeSubXW(void); +static void DoCodeSubXL(void); +static void DoCodeAslB(void); +static void DoCodeAslW(void); +static void DoCodeAslL(void); +static void DoCodeAsrB(void); +static void DoCodeAsrW(void); +static void DoCodeAsrL(void); +static void DoCodeLslB(void); +static void DoCodeLslW(void); +static void DoCodeLslL(void); +static void DoCodeLsrB(void); +static void DoCodeLsrW(void); +static void DoCodeLsrL(void); +static void DoCodeRxlB(void); +static void DoCodeRxlW(void); +static void DoCodeRxlL(void); +static void DoCodeRxrB(void); +static void DoCodeRxrW(void); +static void DoCodeRxrL(void); +static void DoCodeRolB(void); +static void DoCodeRolW(void); +static void DoCodeRolL(void); +static void DoCodeRorB(void); +static void DoCodeRorW(void); +static void DoCodeRorL(void); +static void DoCodeBTstB(void); +static void DoCodeBChgB(void); +static void DoCodeBClrB(void); +static void DoCodeBSetB(void); +static void DoCodeBTstL(void); +static void DoCodeBChgL(void); +static void DoCodeBClrL(void); +static void DoCodeBSetL(void); +static void DoCodeAnd(void); +static void DoCodeOr(void); +static void DoCodeEor(void); +static void DoCodeNot(void); +static void DoCodeScc(void); +static void DoCodeNegXB(void); +static void DoCodeNegXW(void); +static void DoCodeNegXL(void); +static void DoCodeNegB(void); +static void DoCodeNegW(void); +static void DoCodeNegL(void); +static void DoCodeEXTW(void); +static void DoCodeEXTL(void); +static void DoCodeMulU(void); +static void DoCodeMulS(void); +static void DoCodeDivU(void); +static void DoCodeDivS(void); +static void DoCodeExg(void); +static void DoCodeMoveEaCR(void); +static void DoCodeMoveSREa(void); +static void DoCodeMoveEaSR(void); +static void DoCodeOrISR(void); +static void DoCodeAndISR(void); +static void DoCodeEorISR(void); +static void DoCodeOrICCR(void); +static void DoCodeAndICCR(void); +static void DoCodeEorICCR(void); +static void DoCodeMOVEMApRW(void); +static void DoCodeMOVEMRmMW(void); +static void DoCodeMOVEMrmW(void); +static void DoCodeMOVEMrmL(void); +static void DoCodeMOVEMmrW(void); +static void DoCodeMOVEMmrL(void); +static void DoCodeAbcd(void); +static void DoCodeSbcd(void); +static void DoCodeNbcd(void); +static void DoCodeRte(void); +static void DoCodeNop(void); +static void DoCodeMoveP0(void); +static void DoCodeMoveP1(void); +static void DoCodeMoveP2(void); +static void DoCodeMoveP3(void); +static void op_illg(void); +static void DoCodeChk(void); +static void DoCodeTrap(void); +static void DoCodeTrapV(void); +static void DoCodeRtr(void); +static void DoCodeLink(void); +static void DoCodeUnlk(void); +static void DoCodeMoveRUSP(void); +static void DoCodeMoveUSPR(void); +static void DoCodeTas(void); +static void DoCodeFdefault(void); +static void DoCodeStop(void); +static void DoCodeReset(void); #if Use68020 -FORWARDPROC DoCodeCallMorRtm(void); -FORWARDPROC DoCodeBraL(void); -FORWARDPROC DoCodeBccL(void); -FORWARDPROC DoCodeBsrL(void); -FORWARDPROC DoCodeEXTBL(void); -FORWARDPROC DoCodeTRAPcc(void); -FORWARDPROC DoCodeBkpt(void); -FORWARDPROC DoCodeDivL(void); -FORWARDPROC DoCodeMulL(void); -FORWARDPROC DoCodeRtd(void); -FORWARDPROC DoCodeMoveCCREa(void); -FORWARDPROC DoMoveFromControl(void); -FORWARDPROC DoMoveToControl(void); -FORWARDPROC DoCodeLinkL(void); -FORWARDPROC DoCodePack(void); -FORWARDPROC DoCodeUnpk(void); -FORWARDPROC DoCHK2orCMP2(void); -FORWARDPROC DoCAS2(void); -FORWARDPROC DoCAS(void); -FORWARDPROC DoMOVES(void); -FORWARDPROC DoBitField(void); +static void DoCodeCallMorRtm(void); +static void DoCodeBraL(void); +static void DoCodeBccL(void); +static void DoCodeBsrL(void); +static void DoCodeEXTBL(void); +static void DoCodeTRAPcc(void); +static void DoCodeBkpt(void); +static void DoCodeDivL(void); +static void DoCodeMulL(void); +static void DoCodeRtd(void); +static void DoCodeMoveCCREa(void); +static void DoMoveFromControl(void); +static void DoMoveToControl(void); +static void DoCodeLinkL(void); +static void DoCodePack(void); +static void DoCodeUnpk(void); +static void DoCHK2orCMP2(void); +static void DoCAS2(void); +static void DoCAS(void); +static void DoMOVES(void); +static void DoBitField(void); #endif #if EmMMU -FORWARDPROC DoCodeMMU(void); +static void DoCodeMMU(void); #endif #if EmFPU -FORWARDPROC DoCodeFPU_md60(void); -FORWARDPROC DoCodeFPU_DBcc(void); -FORWARDPROC DoCodeFPU_Trapcc(void); -FORWARDPROC DoCodeFPU_Scc(void); -FORWARDPROC DoCodeFPU_FBccW(void); -FORWARDPROC DoCodeFPU_FBccL(void); -FORWARDPROC DoCodeFPU_Save(void); -FORWARDPROC DoCodeFPU_Restore(void); -FORWARDPROC DoCodeFPU_dflt(void); +static void DoCodeFPU_md60(void); +static void DoCodeFPU_DBcc(void); +static void DoCodeFPU_Trapcc(void); +static void DoCodeFPU_Scc(void); +static void DoCodeFPU_FBccW(void); +static void DoCodeFPU_FBccL(void); +static void DoCodeFPU_Save(void); +static void DoCodeFPU_Restore(void); +static void DoCodeFPU_dflt(void); #endif typedef void (*func_pointer_t)(void); -LOCALVAR const func_pointer_t OpDispatch[kNumIKinds + 1] = { +static const func_pointer_t OpDispatch[kNumIKinds + 1] = { DoCodeTst /* kIKindTst */, DoCodeCmpB /* kIKindCmpB */, DoCodeCmpW /* kIKindCmpW */, @@ -755,7 +755,7 @@ LOCALVAR const func_pointer_t OpDispatch[kNumIKinds + 1] = { #define BreakPointAddress 0xD198 -LOCALPROC BreakPointAction(void) +static void BreakPointAction(void) { dbglog_StartLine(); dbglog_writeCStr("breakpoint A0="); @@ -767,7 +767,7 @@ LOCALPROC BreakPointAction(void) #endif -LOCALINLINEPROC DecodeNextInstruction(func_pointer_t *d, uint16_t *Cycles, +static void DecodeNextInstruction(func_pointer_t *d, uint16_t *Cycles, DecOpYR *y) { uint32_t opcode; @@ -790,7 +790,7 @@ LOCALINLINEPROC DecodeNextInstruction(func_pointer_t *d, uint16_t *Cycles, *d = OpDispatch[MainClas]; } -LOCALINLINEPROC UnDecodeNextInstruction(uint16_t Cycles) +static void UnDecodeNextInstruction(uint16_t Cycles) { V_MaxCyclesToGo += Cycles; @@ -807,7 +807,7 @@ LOCALINLINEPROC UnDecodeNextInstruction(uint16_t Cycles) #endif } -LOCALPROC m68k_go_MaxCycles(void) +static void m68k_go_MaxCycles(void) { uint16_t Cycles; DecOpYR y; @@ -853,9 +853,9 @@ LOCALPROC m68k_go_MaxCycles(void) UnDecodeNextInstruction(Cycles); } -FORWARDFUNC uint32_t reg_call get_byte_ext(CPTR addr); +static uint32_t reg_call get_byte_ext(CPTR addr); -LOCALFUNC uint32_t reg_call get_byte(CPTR addr) +static uint32_t reg_call get_byte(CPTR addr) { uint8_t * m = (addr & V_regs.MATCrdB.usemask) + V_regs.MATCrdB.usebase; @@ -866,9 +866,9 @@ LOCALFUNC uint32_t reg_call get_byte(CPTR addr) } } -FORWARDPROC reg_call put_byte_ext(CPTR addr, uint32_t b); +static void reg_call put_byte_ext(CPTR addr, uint32_t b); -LOCALPROC reg_call put_byte(CPTR addr, uint32_t b) +static void reg_call put_byte(CPTR addr, uint32_t b) { uint8_t * m = (addr & V_regs.MATCwrB.usemask) + V_regs.MATCwrB.usebase; if ((addr & V_regs.MATCwrB.cmpmask) == V_regs.MATCwrB.cmpvalu) { @@ -878,9 +878,9 @@ LOCALPROC reg_call put_byte(CPTR addr, uint32_t b) } } -FORWARDFUNC uint32_t reg_call get_word_ext(CPTR addr); +static uint32_t reg_call get_word_ext(CPTR addr); -LOCALFUNC uint32_t reg_call get_word(CPTR addr) +static uint32_t reg_call get_word(CPTR addr) { uint8_t * m = (addr & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; if ((addr & V_regs.MATCrdW.cmpmask) == V_regs.MATCrdW.cmpvalu) { @@ -890,9 +890,9 @@ LOCALFUNC uint32_t reg_call get_word(CPTR addr) } } -FORWARDPROC reg_call put_word_ext(CPTR addr, uint32_t w); +static void reg_call put_word_ext(CPTR addr, uint32_t w); -LOCALPROC reg_call put_word(CPTR addr, uint32_t w) +static void reg_call put_word(CPTR addr, uint32_t w) { uint8_t * m = (addr & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; if ((addr & V_regs.MATCwrW.cmpmask) == V_regs.MATCwrW.cmpvalu) { @@ -902,9 +902,9 @@ LOCALPROC reg_call put_word(CPTR addr, uint32_t w) } } -FORWARDFUNC uint32_t reg_call get_long_misaligned_ext(CPTR addr); +static uint32_t reg_call get_long_misaligned_ext(CPTR addr); -LOCALFUNC uint32_t reg_call get_long_misaligned(CPTR addr) +static uint32_t reg_call get_long_misaligned(CPTR addr) { CPTR addr2 = addr + 2; uint8_t * m = (addr & V_regs.MATCrdW.usemask) + V_regs.MATCrdW.usebase; @@ -924,11 +924,11 @@ LOCALFUNC uint32_t reg_call get_long_misaligned(CPTR addr) } #if FasterAlignedL -FORWARDFUNC uint32_t reg_call get_long_ext(CPTR addr); +static uint32_t reg_call get_long_ext(CPTR addr); #endif #if FasterAlignedL -LOCALFUNC uint32_t reg_call get_long(CPTR addr) +static uint32_t reg_call get_long(CPTR addr) { if (0 == (addr & 0x03)) { uint8_t * m = (addr & V_regs.MATCrdL.usemask) @@ -946,9 +946,9 @@ LOCALFUNC uint32_t reg_call get_long(CPTR addr) #define get_long get_long_misaligned #endif -FORWARDPROC reg_call put_long_misaligned_ext(CPTR addr, uint32_t l); +static void reg_call put_long_misaligned_ext(CPTR addr, uint32_t l); -LOCALPROC reg_call put_long_misaligned(CPTR addr, uint32_t l) +static void reg_call put_long_misaligned(CPTR addr, uint32_t l) { CPTR addr2 = addr + 2; uint8_t * m = (addr & V_regs.MATCwrW.usemask) + V_regs.MATCwrW.usebase; @@ -964,11 +964,11 @@ LOCALPROC reg_call put_long_misaligned(CPTR addr, uint32_t l) } #if FasterAlignedL -FORWARDPROC reg_call put_long_ext(CPTR addr, uint32_t l); +static void reg_call put_long_ext(CPTR addr, uint32_t l); #endif #if FasterAlignedL -LOCALPROC reg_call put_long(CPTR addr, uint32_t l) +static void reg_call put_long(CPTR addr, uint32_t l) { if (0 == (addr & 0x03)) { uint8_t * m = (addr & V_regs.MATCwrL.usemask) @@ -986,7 +986,7 @@ LOCALPROC reg_call put_long(CPTR addr, uint32_t l) #define put_long put_long_misaligned #endif -LOCALFUNC uint32_t reg_call get_disp_ea(uint32_t base) +static 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 reg_call get_disp_ea(uint32_t base) } } -LOCALFUNC uint32_t reg_call DecodeAddr_Indirect(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_Indirect(uint8_t ArgDat) { return V_regs.regs[ArgDat]; } -LOCALFUNC uint32_t reg_call DecodeAddr_APosIncB(uint8_t ArgDat) +static 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 reg_call DecodeAddr_APosIncB(uint8_t ArgDat) return a; } -LOCALFUNC uint32_t reg_call DecodeAddr_APosIncW(uint8_t ArgDat) +static 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 reg_call DecodeAddr_APosIncW(uint8_t ArgDat) return a; } -LOCALFUNC uint32_t reg_call DecodeAddr_APosIncL(uint8_t ArgDat) +static 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 reg_call DecodeAddr_APosIncL(uint8_t ArgDat) return a; } -LOCALFUNC uint32_t reg_call DecodeAddr_APreDecB(uint8_t ArgDat) +static 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 reg_call DecodeAddr_APreDecB(uint8_t ArgDat) return a; } -LOCALFUNC uint32_t reg_call DecodeAddr_APreDecW(uint8_t ArgDat) +static 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 reg_call DecodeAddr_APreDecW(uint8_t ArgDat) return a; } -LOCALFUNC uint32_t reg_call DecodeAddr_APreDecL(uint8_t ArgDat) +static 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 reg_call DecodeAddr_APreDecL(uint8_t ArgDat) return a; } -LOCALFUNC uint32_t reg_call DecodeAddr_ADisp(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_ADisp(uint8_t ArgDat) { return V_regs.regs[ArgDat] + nextiSWord(); } -LOCALFUNC uint32_t reg_call DecodeAddr_AIndex(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_AIndex(uint8_t ArgDat) { return get_disp_ea(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeAddr_AbsW(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_AbsW(uint8_t ArgDat) { UnusedParam(ArgDat); return nextiSWord(); } -LOCALFUNC uint32_t reg_call DecodeAddr_AbsL(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_AbsL(uint8_t ArgDat) { UnusedParam(ArgDat); return nextilong(); } -LOCALFUNC uint32_t reg_call DecodeAddr_PCDisp(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_PCDisp(uint8_t ArgDat) { CPTR pc = m68k_getpc(); @@ -1191,7 +1191,7 @@ LOCALFUNC uint32_t reg_call DecodeAddr_PCDisp(uint8_t ArgDat) return pc + nextiSWord(); } -LOCALFUNC uint32_t reg_call DecodeAddr_PCIndex(uint8_t ArgDat) +static uint32_t reg_call DecodeAddr_PCIndex(uint8_t ArgDat) { UnusedParam(ArgDat); return get_disp_ea(m68k_getpc()); @@ -1199,7 +1199,7 @@ LOCALFUNC uint32_t reg_call DecodeAddr_PCIndex(uint8_t ArgDat) typedef uint32_t (reg_call *DecodeAddrP)(uint8_t ArgDat); -LOCALVAR const DecodeAddrP DecodeAddrDispatch[kNumAMds] = { +static const DecodeAddrP DecodeAddrDispatch[kNumAMds] = { (DecodeAddrP)nullpr /* kAMdRegB */, (DecodeAddrP)nullpr /* kAMdRegW */, (DecodeAddrP)nullpr /* kAMdRegL */, @@ -1238,42 +1238,42 @@ LOCALVAR const DecodeAddrP DecodeAddrDispatch[kNumAMds] = { (DecodeAddrP)nullpr /* kAMdDat4 */ }; -LOCALINLINEFUNC uint32_t DecodeAddrSrcDst(DecArgR *f) +static uint32_t DecodeAddrSrcDst(DecArgR *f) { return (DecodeAddrDispatch[f->AMd])(f->ArgDat); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_RegB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_RegB(uint8_t ArgDat) { return uint32_t_FromSByte(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_RegW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_RegW(uint8_t ArgDat) { return uint32_t_FromSWord(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_RegL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_RegL(uint8_t ArgDat) { return uint32_t_FromSLong(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_IndirectB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_IndirectB(uint8_t ArgDat) { return get_byte(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_IndirectW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_IndirectW(uint8_t ArgDat) { return get_word(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_IndirectL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_IndirectL(uint8_t ArgDat) { return get_long(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosIncB(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APosIncB(uint8_t ArgDat) return get_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosIncW(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APosIncW(uint8_t ArgDat) return get_word(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosIncL(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APosIncL(uint8_t ArgDat) return get_long(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APosInc7B(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APosInc7B(uint8_t ArgDat) return get_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDecB(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APreDecB(uint8_t ArgDat) return get_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDecW(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APreDecW(uint8_t ArgDat) return get_word(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDecL(uint8_t ArgDat) +static 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 reg_call DecodeGetSrcDst_APreDecL(uint8_t ArgDat) return get_long(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDec7B(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_APreDec7B(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1353,122 +1353,122 @@ LOCALFUNC uint32_t reg_call DecodeGetSrcDst_APreDec7B(uint8_t ArgDat) return get_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ADispB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_ADispB(uint8_t ArgDat) { return get_byte(DecodeAddr_ADisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ADispW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_ADispW(uint8_t ArgDat) { return get_word(DecodeAddr_ADisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ADispL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_ADispL(uint8_t ArgDat) { return get_long(DecodeAddr_ADisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AIndexB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AIndexB(uint8_t ArgDat) { return get_byte(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AIndexW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AIndexW(uint8_t ArgDat) { return get_word(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AIndexL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AIndexL(uint8_t ArgDat) { return get_long(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsWB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AbsWB(uint8_t ArgDat) { return get_byte(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsWW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AbsWW(uint8_t ArgDat) { return get_word(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsWL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AbsWL(uint8_t ArgDat) { return get_long(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsLB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AbsLB(uint8_t ArgDat) { return get_byte(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsLW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AbsLW(uint8_t ArgDat) { return get_word(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_AbsLL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_AbsLL(uint8_t ArgDat) { return get_long(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCDispB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_PCDispB(uint8_t ArgDat) { return get_byte(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCDispW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_PCDispW(uint8_t ArgDat) { return get_word(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCDispL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_PCDispL(uint8_t ArgDat) { return get_long(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCIndexB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_PCIndexB(uint8_t ArgDat) { return get_byte(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCIndexW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_PCIndexW(uint8_t ArgDat) { return get_word(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_PCIndexL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_PCIndexL(uint8_t ArgDat) { return get_long(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ImmedB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_ImmedB(uint8_t ArgDat) { UnusedParam(ArgDat); return nextiSByte(); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ImmedW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_ImmedW(uint8_t ArgDat) { UnusedParam(ArgDat); return nextiSWord(); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_ImmedL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_ImmedL(uint8_t ArgDat) { UnusedParam(ArgDat); return uint32_t_FromSLong(nextilong()); } -LOCALFUNC uint32_t reg_call DecodeGetSrcDst_Dat4(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSrcDst_Dat4(uint8_t ArgDat) { return ArgDat; } typedef uint32_t (reg_call *DecodeGetSrcDstP)(uint8_t ArgDat); -LOCALVAR const DecodeGetSrcDstP DecodeGetSrcDstDispatch[kNumAMds] = { +static const DecodeGetSrcDstP DecodeGetSrcDstDispatch[kNumAMds] = { DecodeGetSrcDst_RegB /* kAMdRegB */, DecodeGetSrcDst_RegW /* kAMdRegW */, DecodeGetSrcDst_RegL /* kAMdRegL */, @@ -1507,12 +1507,12 @@ LOCALVAR const DecodeGetSrcDstP DecodeGetSrcDstDispatch[kNumAMds] = { DecodeGetSrcDst_Dat4 /* kAMdDat4 */ }; -LOCALINLINEFUNC uint32_t DecodeGetSrcDst(DecArgR *f) +static uint32_t DecodeGetSrcDst(DecArgR *f) { return (DecodeGetSrcDstDispatch[f->AMd])(f->ArgDat); } -LOCALPROC reg_call DecodeSetSrcDst_RegB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_RegB(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1523,7 +1523,7 @@ LOCALPROC reg_call DecodeSetSrcDst_RegB(uint32_t v, uint8_t ArgDat) #endif } -LOCALPROC reg_call DecodeSetSrcDst_RegW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_RegW(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1534,27 +1534,27 @@ LOCALPROC reg_call DecodeSetSrcDst_RegW(uint32_t v, uint8_t ArgDat) #endif } -LOCALPROC reg_call DecodeSetSrcDst_RegL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_RegL(uint32_t v, uint8_t ArgDat) { V_regs.regs[ArgDat] = v; } -LOCALPROC reg_call DecodeSetSrcDst_IndirectB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_IndirectB(uint32_t v, uint8_t ArgDat) { put_byte(V_regs.regs[ArgDat], v); } -LOCALPROC reg_call DecodeSetSrcDst_IndirectW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_IndirectW(uint32_t v, uint8_t ArgDat) { put_word(V_regs.regs[ArgDat], v); } -LOCALPROC reg_call DecodeSetSrcDst_IndirectL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_IndirectL(uint32_t v, uint8_t ArgDat) { put_long(V_regs.regs[ArgDat], v); } -LOCALPROC reg_call DecodeSetSrcDst_APosIncB(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APosIncB(uint32_t v, uint8_t ArgDat) put_byte(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APosIncW(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APosIncW(uint32_t v, uint8_t ArgDat) put_word(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APosIncL(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APosIncL(uint32_t v, uint8_t ArgDat) put_long(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APosInc7B(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APosInc7B(uint32_t v, uint8_t ArgDat) put_byte(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APreDecB(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APreDecB(uint32_t v, uint8_t ArgDat) put_byte(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APreDecW(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APreDecW(uint32_t v, uint8_t ArgDat) put_word(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APreDecL(uint32_t v, uint8_t ArgDat) +static void 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 reg_call DecodeSetSrcDst_APreDecL(uint32_t v, uint8_t ArgDat) put_long(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_APreDec7B(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_APreDec7B(uint32_t v, uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1634,102 +1634,102 @@ LOCALPROC reg_call DecodeSetSrcDst_APreDec7B(uint32_t v, uint8_t ArgDat) put_byte(a, v); } -LOCALPROC reg_call DecodeSetSrcDst_ADispB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_ADispB(uint32_t v, uint8_t ArgDat) { put_byte(V_regs.regs[ArgDat] + nextiSWord(), v); } -LOCALPROC reg_call DecodeSetSrcDst_ADispW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_ADispW(uint32_t v, uint8_t ArgDat) { put_word(V_regs.regs[ArgDat] + nextiSWord(), v); } -LOCALPROC reg_call DecodeSetSrcDst_ADispL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_ADispL(uint32_t v, uint8_t ArgDat) { put_long(V_regs.regs[ArgDat] + nextiSWord(), v); } -LOCALPROC reg_call DecodeSetSrcDst_AIndexB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AIndexB(uint32_t v, uint8_t ArgDat) { put_byte(get_disp_ea(V_regs.regs[ArgDat]), v); } -LOCALPROC reg_call DecodeSetSrcDst_AIndexW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AIndexW(uint32_t v, uint8_t ArgDat) { put_word(get_disp_ea(V_regs.regs[ArgDat]), v); } -LOCALPROC reg_call DecodeSetSrcDst_AIndexL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AIndexL(uint32_t v, uint8_t ArgDat) { put_long(get_disp_ea(V_regs.regs[ArgDat]), v); } -LOCALPROC reg_call DecodeSetSrcDst_AbsWB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AbsWB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_AbsW(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_AbsWW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AbsWW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_AbsW(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_AbsWL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AbsWL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_AbsW(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_AbsLB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AbsLB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_AbsL(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_AbsLW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AbsLW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_AbsL(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_AbsLL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_AbsLL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_AbsL(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_PCDispB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_PCDispB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_PCDisp(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_PCDispW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_PCDispW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_PCDisp(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_PCDispL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_PCDispL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_PCDisp(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_PCIndexB(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_PCIndexB(uint32_t v, uint8_t ArgDat) { put_byte(DecodeAddr_PCIndex(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_PCIndexW(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_PCIndexW(uint32_t v, uint8_t ArgDat) { put_word(DecodeAddr_PCIndex(ArgDat), v); } -LOCALPROC reg_call DecodeSetSrcDst_PCIndexL(uint32_t v, uint8_t ArgDat) +static void reg_call DecodeSetSrcDst_PCIndexL(uint32_t v, uint8_t ArgDat) { put_long(DecodeAddr_PCIndex(ArgDat), v); } typedef void (reg_call *DecodeSetSrcDstP)(uint32_t v, uint8_t ArgDat); -LOCALVAR const DecodeSetSrcDstP DecodeSetSrcDstDispatch[kNumAMds] = { +static const DecodeSetSrcDstP DecodeSetSrcDstDispatch[kNumAMds] = { DecodeSetSrcDst_RegB /* kAMdRegB */, DecodeSetSrcDst_RegW /* kAMdRegW */, DecodeSetSrcDst_RegL /* kAMdRegL */, @@ -1768,12 +1768,12 @@ LOCALVAR const DecodeSetSrcDstP DecodeSetSrcDstDispatch[kNumAMds] = { (DecodeSetSrcDstP)nullpr /* kAMdDat4 */ }; -LOCALINLINEPROC DecodeSetSrcDst(uint32_t v, DecArgR *f) +static void DecodeSetSrcDst(uint32_t v, DecArgR *f) { (DecodeSetSrcDstDispatch[f->AMd])(v, f->ArgDat); } -LOCALPROC reg_call ArgSetDstRegBValue(uint32_t v) +static void reg_call ArgSetDstRegBValue(uint32_t v) { uint32_t *p = V_regs.ArgAddr.rga; @@ -1784,7 +1784,7 @@ LOCALPROC reg_call ArgSetDstRegBValue(uint32_t v) #endif } -LOCALPROC reg_call ArgSetDstRegWValue(uint32_t v) +static void reg_call ArgSetDstRegWValue(uint32_t v) { uint32_t *p = V_regs.ArgAddr.rga; @@ -1795,29 +1795,29 @@ LOCALPROC reg_call ArgSetDstRegWValue(uint32_t v) #endif } -LOCALPROC reg_call ArgSetDstRegLValue(uint32_t v) +static void reg_call ArgSetDstRegLValue(uint32_t v) { uint32_t *p = V_regs.ArgAddr.rga; *p = v; } -LOCALPROC reg_call ArgSetDstMemBValue(uint32_t v) +static void reg_call ArgSetDstMemBValue(uint32_t v) { put_byte(V_regs.ArgAddr.mem, v); } -LOCALPROC reg_call ArgSetDstMemWValue(uint32_t v) +static void reg_call ArgSetDstMemWValue(uint32_t v) { put_word(V_regs.ArgAddr.mem, v); } -LOCALPROC reg_call ArgSetDstMemLValue(uint32_t v) +static void reg_call ArgSetDstMemLValue(uint32_t v) { put_long(V_regs.ArgAddr.mem, v); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_RegB(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1827,7 +1827,7 @@ LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegB(uint8_t ArgDat) return uint32_t_FromSByte(*p); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_RegW(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1837,7 +1837,7 @@ LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegW(uint8_t ArgDat) return uint32_t_FromSWord(*p); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_RegL(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; @@ -1847,7 +1847,7 @@ LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_RegL(uint8_t ArgDat) return uint32_t_FromSLong(*p); } -LOCALFUNC uint32_t reg_call getarg_byte(uint32_t a) +static 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 reg_call getarg_byte(uint32_t a) return get_byte(a); } -LOCALFUNC uint32_t reg_call getarg_word(uint32_t a) +static 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 reg_call getarg_word(uint32_t a) return get_word(a); } -LOCALFUNC uint32_t reg_call getarg_long(uint32_t a) +static 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 reg_call getarg_long(uint32_t a) return get_long(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_IndirectB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_IndirectB(uint8_t ArgDat) { return getarg_byte(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_IndirectW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_IndirectW(uint8_t ArgDat) { return getarg_word(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_IndirectL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_IndirectL(uint8_t ArgDat) { return getarg_long(V_regs.regs[ArgDat]); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosIncB(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APosIncB(uint8_t ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosIncW(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APosIncW(uint8_t ArgDat) return getarg_word(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosIncL(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APosIncL(uint8_t ArgDat) return getarg_long(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APosInc7B(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APosInc7B(uint8_t ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDecB(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APreDecB(uint8_t ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDecW(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APreDecW(uint8_t ArgDat) return getarg_word(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDecL(uint8_t ArgDat) +static 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 reg_call DecodeGetSetSrcDst_APreDecL(uint8_t ArgDat) return getarg_long(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDec7B(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_APreDec7B(uint8_t ArgDat) { uint32_t *p = &V_regs.regs[ArgDat]; uint32_t a = *p - 2; @@ -1966,102 +1966,102 @@ LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_APreDec7B(uint8_t ArgDat) return getarg_byte(a); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_ADispB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_ADispB(uint8_t ArgDat) { return getarg_byte(V_regs.regs[ArgDat] + nextiSWord()); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_ADispW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_ADispW(uint8_t ArgDat) { return getarg_word(V_regs.regs[ArgDat] + nextiSWord()); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_ADispL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_ADispL(uint8_t ArgDat) { return getarg_long(V_regs.regs[ArgDat] + nextiSWord()); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AIndexB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AIndexB(uint8_t ArgDat) { return getarg_byte(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AIndexW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AIndexW(uint8_t ArgDat) { return getarg_word(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AIndexL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AIndexL(uint8_t ArgDat) { return getarg_long(get_disp_ea(V_regs.regs[ArgDat])); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsWB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AbsWB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsWW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AbsWW(uint8_t ArgDat) { return getarg_word(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsWL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AbsWL(uint8_t ArgDat) { return getarg_long(DecodeAddr_AbsW(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsLB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AbsLB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsLW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AbsLW(uint8_t ArgDat) { return getarg_word(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_AbsLL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_AbsLL(uint8_t ArgDat) { return getarg_long(DecodeAddr_AbsL(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCDispB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_PCDispB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCDispW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_PCDispW(uint8_t ArgDat) { return getarg_word(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCDispL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_PCDispL(uint8_t ArgDat) { return getarg_long(DecodeAddr_PCDisp(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCIndexB(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_PCIndexB(uint8_t ArgDat) { return getarg_byte(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCIndexW(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_PCIndexW(uint8_t ArgDat) { return getarg_word(DecodeAddr_PCIndex(ArgDat)); } -LOCALFUNC uint32_t reg_call DecodeGetSetSrcDst_PCIndexL(uint8_t ArgDat) +static uint32_t reg_call DecodeGetSetSrcDst_PCIndexL(uint8_t ArgDat) { return getarg_long(DecodeAddr_PCIndex(ArgDat)); } typedef uint32_t (reg_call *DecodeGetSetSrcDstP)(uint8_t ArgDat); -LOCALVAR const DecodeGetSetSrcDstP +static const DecodeGetSetSrcDstP DecodeGetSetSrcDstDispatch[kNumAMds] = { DecodeGetSetSrcDst_RegB /* kAMdRegB */, @@ -2102,50 +2102,50 @@ LOCALVAR const DecodeGetSetSrcDstP (DecodeGetSetSrcDstP)nullpr /* kAMdDat4 */ }; -LOCALINLINEFUNC uint32_t DecodeGetSetSrcDst(DecArgR *f) +static uint32_t DecodeGetSetSrcDst(DecArgR *f) { return (DecodeGetSetSrcDstDispatch[f->AMd])(f->ArgDat); } -LOCALINLINEFUNC uint32_t DecodeDst(void) +static uint32_t DecodeDst(void) { return DecodeAddrSrcDst(&V_regs.CurDecOpY.v[1]); } -LOCALINLINEFUNC uint32_t DecodeGetSetDstValue(void) +static uint32_t DecodeGetSetDstValue(void) { return DecodeGetSetSrcDst(&V_regs.CurDecOpY.v[1]); } -LOCALINLINEPROC ArgSetDstValue(uint32_t v) +static void ArgSetDstValue(uint32_t v) { V_regs.ArgSetDst(v); } -LOCALINLINEPROC DecodeSetDstValue(uint32_t v) +static void DecodeSetDstValue(uint32_t v) { DecodeSetSrcDst(v, &V_regs.CurDecOpY.v[1]); } -LOCALINLINEFUNC uint32_t DecodeGetSrcValue(void) +static uint32_t DecodeGetSrcValue(void) { return DecodeGetSrcDst(&V_regs.CurDecOpY.v[0]); } -LOCALINLINEFUNC uint32_t DecodeGetDstValue(void) +static uint32_t DecodeGetDstValue(void) { return DecodeGetSrcDst(&V_regs.CurDecOpY.v[1]); } -LOCALINLINEFUNC uint32_t DecodeGetSrcSetDstValue(void) +static uint32_t DecodeGetSrcSetDstValue(void) { V_regs.SrcVal = DecodeGetSrcValue(); return DecodeGetSetDstValue(); } -LOCALINLINEFUNC uint32_t DecodeGetSrcGetDstValue(void) +static uint32_t DecodeGetSrcGetDstValue(void) { V_regs.SrcVal = DecodeGetSrcValue(); @@ -2155,19 +2155,19 @@ LOCALINLINEFUNC uint32_t DecodeGetSrcGetDstValue(void) typedef void (*cond_actP)(void); -LOCALPROC reg_call cctrue_T(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_T(cond_actP t_act, cond_actP f_act) { UnusedParam(f_act); t_act(); } -LOCALPROC reg_call cctrue_F(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_F(cond_actP t_act, cond_actP f_act) { UnusedParam(t_act); f_act(); } -LOCALPROC reg_call cctrue_HI(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_HI(cond_actP t_act, cond_actP f_act) { if (0 == (CFLG | ZFLG)) { t_act(); @@ -2176,7 +2176,7 @@ LOCALPROC reg_call cctrue_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_LS(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_LS(cond_actP t_act, cond_actP f_act) { if (0 != (CFLG | ZFLG)) { t_act(); @@ -2185,7 +2185,7 @@ LOCALPROC reg_call cctrue_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CC(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_CC(cond_actP t_act, cond_actP f_act) { if (0 == (CFLG)) { t_act(); @@ -2194,7 +2194,7 @@ LOCALPROC reg_call cctrue_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CS(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_CS(cond_actP t_act, cond_actP f_act) { if (0 != (CFLG)) { t_act(); @@ -2203,7 +2203,7 @@ LOCALPROC reg_call cctrue_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_NE(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_NE(cond_actP t_act, cond_actP f_act) { if (0 == (ZFLG)) { t_act(); @@ -2212,7 +2212,7 @@ LOCALPROC reg_call cctrue_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_EQ(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_EQ(cond_actP t_act, cond_actP f_act) { if (0 != (ZFLG)) { t_act(); @@ -2221,7 +2221,7 @@ LOCALPROC reg_call cctrue_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_VC(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_VC(cond_actP t_act, cond_actP f_act) { if (0 == (VFLG)) { t_act(); @@ -2230,7 +2230,7 @@ LOCALPROC reg_call cctrue_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_VS(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_VS(cond_actP t_act, cond_actP f_act) { if (0 != (VFLG)) { t_act(); @@ -2239,7 +2239,7 @@ LOCALPROC reg_call cctrue_VS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_PL(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_PL(cond_actP t_act, cond_actP f_act) { if (0 == (NFLG)) { t_act(); @@ -2248,7 +2248,7 @@ LOCALPROC reg_call cctrue_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_MI(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_MI(cond_actP t_act, cond_actP f_act) { if (0 != (NFLG)) { t_act(); @@ -2257,7 +2257,7 @@ LOCALPROC reg_call cctrue_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_GE(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_GE(cond_actP t_act, cond_actP f_act) { if (0 == (NFLG ^ VFLG)) { t_act(); @@ -2266,7 +2266,7 @@ LOCALPROC reg_call cctrue_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_LT(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_LT(cond_actP t_act, cond_actP f_act) { if (0 != (NFLG ^ VFLG)) { t_act(); @@ -2275,7 +2275,7 @@ LOCALPROC reg_call cctrue_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_GT(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_GT(cond_actP t_act, cond_actP f_act) { if (0 == (ZFLG | (NFLG ^ VFLG))) { t_act(); @@ -2284,7 +2284,7 @@ LOCALPROC reg_call cctrue_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_LE(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_LE(cond_actP t_act, cond_actP f_act) { if (0 != (ZFLG | (NFLG ^ VFLG))) { t_act(); @@ -2296,7 +2296,7 @@ LOCALPROC reg_call cctrue_LE(cond_actP t_act, cond_actP f_act) #if Have_ASR #define Ui5rASR(x, s) ((uint32_t)(((int32_t)(x)) >> (s))) #else -LOCALFUNC uint32_t Ui5rASR(uint32_t x, uint32_t s) +static uint32_t Ui5rASR(uint32_t x, uint32_t s) { uint32_t v; @@ -2312,7 +2312,7 @@ LOCALFUNC uint32_t Ui5rASR(uint32_t x, uint32_t s) #if UseLazyCC -LOCALPROC reg_call cctrue_TstL_HI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_LS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_LS(cond_actP t_act, cond_actP f_act) } #if 0 /* always true */ -LOCALPROC reg_call cctrue_TstL_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_CC(cond_actP t_act, cond_actP f_act) #endif #if 0 /* always false */ -LOCALPROC reg_call cctrue_TstL_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_CS(cond_actP t_act, cond_actP f_act) } #endif -LOCALPROC reg_call cctrue_TstL_NE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_EQ(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_PL(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_MI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_GE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_LT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_GT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_TstL_LE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_TstL_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_HI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_LS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_NE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_EQ(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_PL(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_MI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_GE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_LT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_GT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpB_LE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpB_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_HI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_LS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_NE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_EQ(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_PL(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_MI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_GE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_LT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_GT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpW_LE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpW_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_HI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_HI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_LS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_LS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_NE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_NE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_EQ(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_EQ(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_PL(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_PL(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_MI(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_MI(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_GE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_GE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_LT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_LT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_GT(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_GT(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_CmpL_LE(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_CmpL_LE(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_Asr_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_Asr_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_Asr_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_Asr_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslB_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslB_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslB_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslB_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslB_VC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslB_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslB_VS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslB_VS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslW_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslW_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslW_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslW_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslW_VC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslW_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslW_VS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslW_VS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslL_CC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslL_CC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslL_CS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslL_CS(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslL_VC(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslL_VC(cond_actP t_act, cond_actP f_act) } } -LOCALPROC reg_call cctrue_AslL_VS(cond_actP t_act, cond_actP f_act) +static void 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 reg_call cctrue_AslL_VS(cond_actP t_act, cond_actP f_act) } } -FORWARDPROC reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act); +static void reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act); #endif /* UseLazyCC */ @@ -2939,7 +2939,7 @@ FORWARDPROC reg_call cctrue_Dflt(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] = { +static const cctrueP cctrueDispatch[CCdispSz + 1] = { cctrue_T /* kLazyFlagsDefault T */, cctrue_F /* kLazyFlagsDefault F */, cctrue_HI /* kLazyFlagsDefault HI */, @@ -3339,7 +3339,7 @@ LOCALVAR const cctrueP cctrueDispatch[CCdispSz + 1] = { }; #if UseLazyCC -LOCALINLINEPROC cctrue(cond_actP t_act, cond_actP f_act) +static void cctrue(cond_actP t_act, cond_actP f_act) { (cctrueDispatch[V_regs.LazyFlagKind * 16 + V_regs.CurDecOpY.v[0].ArgDat])(t_act, f_act); @@ -3347,28 +3347,28 @@ LOCALINLINEPROC cctrue(cond_actP t_act, cond_actP f_act) #endif -LOCALPROC NeedDefaultLazyXFlagSubB(void) +static void NeedDefaultLazyXFlagSubB(void) { XFLG = Bool2Bit(((uint8_t)V_regs.LazyXFlagArgDst) < ((uint8_t)V_regs.LazyXFlagArgSrc)); V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagSubW(void) +static void NeedDefaultLazyXFlagSubW(void) { XFLG = Bool2Bit(((uint16_t)V_regs.LazyXFlagArgDst) < ((uint16_t)V_regs.LazyXFlagArgSrc)); V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagSubL(void) +static void NeedDefaultLazyXFlagSubL(void) { XFLG = Bool2Bit(((uint32_t)V_regs.LazyXFlagArgDst) < ((uint32_t)V_regs.LazyXFlagArgSrc)); V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAddB(void) +static void NeedDefaultLazyXFlagAddB(void) { uint8_t src = (uint8_t)V_regs.LazyXFlagArgSrc; uint8_t dst = (uint8_t)V_regs.LazyXFlagArgDst; @@ -3378,7 +3378,7 @@ LOCALPROC NeedDefaultLazyXFlagAddB(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAddW(void) +static void NeedDefaultLazyXFlagAddW(void) { uint16_t src = (uint16_t)V_regs.LazyXFlagArgSrc; uint16_t dst = (uint16_t)V_regs.LazyXFlagArgDst; @@ -3388,7 +3388,7 @@ LOCALPROC NeedDefaultLazyXFlagAddW(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAddL(void) +static void NeedDefaultLazyXFlagAddL(void) { uint32_t src = (uint32_t)V_regs.LazyXFlagArgSrc; uint32_t dst = (uint32_t)V_regs.LazyXFlagArgDst; @@ -3398,28 +3398,28 @@ LOCALPROC NeedDefaultLazyXFlagAddL(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagNegB(void) +static void NeedDefaultLazyXFlagNegB(void) { XFLG = Bool2Bit(((uint8_t)0) < ((uint8_t)V_regs.LazyXFlagArgDst)); V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagNegW(void) +static void NeedDefaultLazyXFlagNegW(void) { XFLG = Bool2Bit(((uint16_t)0) < ((uint16_t)V_regs.LazyXFlagArgDst)); V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagNegL(void) +static void NeedDefaultLazyXFlagNegL(void) { XFLG = Bool2Bit(((uint32_t)0) < ((uint32_t)V_regs.LazyXFlagArgDst)); V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAsr(void) +static void NeedDefaultLazyXFlagAsr(void) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3429,34 +3429,34 @@ LOCALPROC NeedDefaultLazyXFlagAsr(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAslB(void) +static void NeedDefaultLazyXFlagAslB(void) { XFLG = (V_regs.LazyFlagArgDst >> (8 - V_regs.LazyFlagArgSrc)) & 1; V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAslW(void) +static void NeedDefaultLazyXFlagAslW(void) { XFLG = (V_regs.LazyFlagArgDst >> (16 - V_regs.LazyFlagArgSrc)) & 1; V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagAslL(void) +static void NeedDefaultLazyXFlagAslL(void) { XFLG = (V_regs.LazyFlagArgDst >> (32 - V_regs.LazyFlagArgSrc)) & 1; V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyXFlagDefault(void) +static void NeedDefaultLazyXFlagDefault(void) { } typedef void (*NeedLazyFlagP)(void); -LOCALVAR const NeedLazyFlagP +static const NeedLazyFlagP NeedLazyXFlagDispatch[kNumLazyFlagsKinds + 1] = { NeedDefaultLazyXFlagDefault /* kLazyFlagsDefault */, @@ -3488,7 +3488,7 @@ LOCALVAR const NeedLazyFlagP 0 }; -LOCALPROC NeedDefaultLazyXFlag(void) +static void NeedDefaultLazyXFlag(void) { #if ForceFlagsEval if (kLazyFlagsDefault != V_regs.LazyXFlagKind) { @@ -3500,7 +3500,7 @@ LOCALPROC NeedDefaultLazyXFlag(void) #endif } -LOCALPROC NeedDefaultLazyFlagsTstL(void) +static void NeedDefaultLazyFlagsTstL(void) { uint32_t dst = V_regs.LazyFlagArgDst; @@ -3512,7 +3512,7 @@ LOCALPROC NeedDefaultLazyFlagsTstL(void) NeedDefaultLazyXFlag(); } -LOCALPROC NeedDefaultLazyFlagsCmpB(void) +static void NeedDefaultLazyFlagsCmpB(void) { uint32_t src = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3530,7 +3530,7 @@ LOCALPROC NeedDefaultLazyFlagsCmpB(void) NeedDefaultLazyXFlag(); } -LOCALPROC NeedDefaultLazyFlagsCmpW(void) +static void NeedDefaultLazyFlagsCmpW(void) { uint32_t result0 = V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc; uint32_t result = uint32_t_FromSWord(result0); @@ -3550,7 +3550,7 @@ LOCALPROC NeedDefaultLazyFlagsCmpW(void) NeedDefaultLazyXFlag(); } -LOCALPROC NeedDefaultLazyFlagsCmpL(void) +static void NeedDefaultLazyFlagsCmpL(void) { uint32_t src = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3574,7 +3574,7 @@ LOCALPROC NeedDefaultLazyFlagsCmpL(void) NeedDefaultLazyXFlag(); } -LOCALPROC NeedDefaultLazyFlagsSubB(void) +static void NeedDefaultLazyFlagsSubB(void) { uint32_t src = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3593,7 +3593,7 @@ LOCALPROC NeedDefaultLazyFlagsSubB(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsSubW(void) +static void NeedDefaultLazyFlagsSubW(void) { uint32_t result0 = V_regs.LazyFlagArgDst - V_regs.LazyFlagArgSrc; uint32_t result = uint32_t_FromSWord(result0); @@ -3614,7 +3614,7 @@ LOCALPROC NeedDefaultLazyFlagsSubW(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsSubL(void) +static void NeedDefaultLazyFlagsSubL(void) { uint32_t src = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3639,7 +3639,7 @@ LOCALPROC NeedDefaultLazyFlagsSubL(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsAddB(void) +static void NeedDefaultLazyFlagsAddB(void) { uint32_t src = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3658,7 +3658,7 @@ LOCALPROC NeedDefaultLazyFlagsAddB(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsAddW(void) +static void NeedDefaultLazyFlagsAddW(void) { uint32_t src = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3678,7 +3678,7 @@ LOCALPROC NeedDefaultLazyFlagsAddW(void) } #if 0 -LOCALPROC NeedDefaultLazyFlagsAddCommon(uint32_t result) +static void NeedDefaultLazyFlagsAddCommon(uint32_t result) { ZFLG = Bool2Bit(result == 0); { @@ -3700,7 +3700,7 @@ LOCALPROC NeedDefaultLazyFlagsAddCommon(uint32_t result) } #endif -LOCALPROC NeedDefaultLazyFlagsAddL(void) +static void NeedDefaultLazyFlagsAddL(void) { #if 1 uint32_t src = V_regs.LazyFlagArgSrc; @@ -3740,7 +3740,7 @@ LOCALPROC NeedDefaultLazyFlagsAddL(void) #endif } -LOCALPROC NeedDefaultLazyFlagsNegCommon(uint32_t dstvalue, uint32_t result) +static void NeedDefaultLazyFlagsNegCommon(uint32_t dstvalue, uint32_t result) { flagtype flgs = Bool2Bit(uint32_t_MSBisSet(dstvalue)); flagtype flgn = Bool2Bit(uint32_t_MSBisSet(result)); @@ -3755,7 +3755,7 @@ LOCALPROC NeedDefaultLazyFlagsNegCommon(uint32_t dstvalue, uint32_t result) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsNegB(void) +static void NeedDefaultLazyFlagsNegB(void) { uint32_t dstvalue = V_regs.LazyFlagArgDst; uint32_t result = uint32_t_FromSByte(0 - dstvalue); @@ -3763,7 +3763,7 @@ LOCALPROC NeedDefaultLazyFlagsNegB(void) NeedDefaultLazyFlagsNegCommon(dstvalue, result); } -LOCALPROC NeedDefaultLazyFlagsNegW(void) +static void NeedDefaultLazyFlagsNegW(void) { uint32_t dstvalue = V_regs.LazyFlagArgDst; uint32_t result = uint32_t_FromSWord(0 - dstvalue); @@ -3771,7 +3771,7 @@ LOCALPROC NeedDefaultLazyFlagsNegW(void) NeedDefaultLazyFlagsNegCommon(dstvalue, result); } -LOCALPROC NeedDefaultLazyFlagsNegL(void) +static void NeedDefaultLazyFlagsNegL(void) { uint32_t dstvalue = V_regs.LazyFlagArgDst; uint32_t result = uint32_t_FromSLong(0 - dstvalue); @@ -3779,7 +3779,7 @@ LOCALPROC NeedDefaultLazyFlagsNegL(void) NeedDefaultLazyFlagsNegCommon(dstvalue, result); } -LOCALPROC NeedDefaultLazyFlagsAsr(void) +static void NeedDefaultLazyFlagsAsr(void) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3796,7 +3796,7 @@ LOCALPROC NeedDefaultLazyFlagsAsr(void) V_regs.LazyFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsAslB(void) +static void NeedDefaultLazyFlagsAslB(void) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3818,7 +3818,7 @@ LOCALPROC NeedDefaultLazyFlagsAslB(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsAslW(void) +static void NeedDefaultLazyFlagsAslW(void) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3840,7 +3840,7 @@ LOCALPROC NeedDefaultLazyFlagsAslW(void) V_regs.LazyXFlagKind = kLazyFlagsDefault; } -LOCALPROC NeedDefaultLazyFlagsAslL(void) +static void NeedDefaultLazyFlagsAslL(void) { uint32_t cnt = V_regs.LazyFlagArgSrc; uint32_t dst = V_regs.LazyFlagArgDst; @@ -3863,10 +3863,10 @@ LOCALPROC NeedDefaultLazyFlagsAslL(void) } #if UseLazyZ -FORWARDPROC NeedDefaultLazyFlagsZSet(void); +static void NeedDefaultLazyFlagsZSet(void); #endif -LOCALVAR const NeedLazyFlagP +static const NeedLazyFlagP NeedLazyFlagDispatch[kNumLazyFlagsKinds + 1] = { NeedDefaultLazyXFlag /* kLazyFlagsDefault */, @@ -3898,13 +3898,13 @@ LOCALVAR const NeedLazyFlagP 0 }; -LOCALPROC NeedDefaultLazyAllFlags0(void) +static void NeedDefaultLazyAllFlags0(void) { (NeedLazyFlagDispatch[V_regs.LazyFlagKind])(); } #if ForceFlagsEval -LOCALPROC NeedDefaultLazyAllFlags(void) +static void NeedDefaultLazyAllFlags(void) { if (kLazyFlagsDefault != V_regs.LazyFlagKind) { ReportAbnormalID(0x0104, @@ -3925,7 +3925,7 @@ LOCALPROC NeedDefaultLazyAllFlags(void) #endif #if UseLazyZ -LOCALPROC NeedDefaultLazyFlagsZSet(void) +static void NeedDefaultLazyFlagsZSet(void) { flagtype SaveZFLG = ZFLG; @@ -3937,7 +3937,7 @@ LOCALPROC NeedDefaultLazyFlagsZSet(void) #endif #if UseLazyCC -LOCALPROC reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act) +static void reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act) { NeedDefaultLazyAllFlags(); cctrue(t_act, f_act); @@ -3945,7 +3945,7 @@ LOCALPROC reg_call cctrue_Dflt(cond_actP t_act, cond_actP f_act) #endif #if ! UseLazyCC -LOCALINLINEPROC cctrue(cond_actP t_act, cond_actP f_act) +static void cctrue(cond_actP t_act, cond_actP f_act) { NeedDefaultLazyAllFlags(); (cctrueDispatch[V_regs.CurDecOpY.v[0].ArgDat])(t_act, f_act); @@ -3953,7 +3953,7 @@ LOCALINLINEPROC cctrue(cond_actP t_act, cond_actP f_act) #endif -#define LOCALIPROC LOCALPROC /* LOCALPROCUSEDONCE */ +#define LOCALIPROC static void /* static void */ LOCALIPROC DoCodeCmpB(void) { @@ -4070,7 +4070,7 @@ LOCALIPROC DoCodeBraW(void) } #if WantCloserCyc -LOCALPROC DoCodeBccB_t(void) +static void DoCodeBccB_t(void) { V_MaxCyclesToGo -= (10 * kCycleScale + 2 * RdAvgXtraCyc); DoCodeBraB(); @@ -4079,7 +4079,7 @@ LOCALPROC DoCodeBccB_t(void) #define DoCodeBccB_t DoCodeBraB #endif -LOCALPROC DoCodeBccB_f(void) +static void DoCodeBccB_f(void) { #if WantCloserCyc V_MaxCyclesToGo -= (8 * kCycleScale + RdAvgXtraCyc); @@ -4093,7 +4093,7 @@ LOCALIPROC DoCodeBccB(void) cctrue(DoCodeBccB_t, DoCodeBccB_f); } -LOCALPROC SkipiWord(void) +static void SkipiWord(void) { V_pc_p += 2; @@ -4105,7 +4105,7 @@ LOCALPROC SkipiWord(void) } #if WantCloserCyc -LOCALPROC DoCodeBccW_t(void) +static void DoCodeBccW_t(void) { V_MaxCyclesToGo -= (10 * kCycleScale + 2 * RdAvgXtraCyc); DoCodeBraW(); @@ -4115,7 +4115,7 @@ LOCALPROC DoCodeBccW_t(void) #endif #if WantCloserCyc -LOCALPROC DoCodeBccW_f(void) +static void DoCodeBccW_f(void) { V_MaxCyclesToGo -= (12 * kCycleScale + 2 * RdAvgXtraCyc); SkipiWord(); @@ -4160,7 +4160,7 @@ LOCALIPROC DoCodeDBF(void) } #if WantCloserCyc -LOCALPROC DoCodeDBcc_t(void) +static void DoCodeDBcc_t(void) { V_MaxCyclesToGo -= (12 * kCycleScale + 2 * RdAvgXtraCyc); SkipiWord(); @@ -4369,7 +4369,7 @@ LOCALIPROC DoCodeBsrW(void) #endif #if WantDumpAJump -LOCALPROCUSEDONCE DumpAJump(CPTR toaddr) +static void DumpAJump(CPTR toaddr) { CPTR fromaddr = m68k_getpc(); if ((toaddr > fromaddr) || (toaddr < V_regs.pc)) @@ -4382,7 +4382,7 @@ LOCALPROCUSEDONCE DumpAJump(CPTR toaddr) } #endif -LOCALPROC reg_call m68k_setpc(CPTR newpc) +static void reg_call m68k_setpc(CPTR newpc) { #if WantDumpAJump DumpAJump(newpc); @@ -4483,7 +4483,7 @@ LOCALIPROC DoCodeCmpA(void) HaveSetUpFlags(); } -LOCALFUNC uint16_t m68k_getCR(void) +static uint16_t m68k_getCR(void) { NeedDefaultLazyAllFlags(); @@ -4491,7 +4491,7 @@ LOCALFUNC uint16_t m68k_getCR(void) | (VFLG << 1) | CFLG; } -LOCALPROC reg_call m68k_setCR(uint16_t newcr) +static void reg_call m68k_setCR(uint16_t newcr) { XFLG = (newcr >> 4) & 1; NFLG = (newcr >> 3) & 1; @@ -4504,7 +4504,7 @@ LOCALPROC reg_call m68k_setCR(uint16_t newcr) } -LOCALFUNC uint16_t m68k_getSR(void) +static uint16_t m68k_getSR(void) { return m68k_getCR() | (V_regs.t1 << 15) @@ -4518,7 +4518,7 @@ LOCALFUNC uint16_t m68k_getSR(void) | (V_regs.intmask << 8); } -LOCALPROC NeedToGetOut(void) +static void NeedToGetOut(void) { if (V_MaxCyclesToGo <= 0) { /* @@ -4533,13 +4533,13 @@ LOCALPROC NeedToGetOut(void) } } -LOCALPROC SetExternalInterruptPending(void) +static void SetExternalInterruptPending(void) { V_regs.ExternalInterruptPending = true; NeedToGetOut(); } -LOCALPROC reg_call m68k_setSR(uint16_t newsr) +static void reg_call m68k_setSR(uint16_t newsr) { CPTR *pnewstk; CPTR *poldstk = (V_regs.s != 0) ? ( @@ -4589,7 +4589,7 @@ LOCALPROC reg_call m68k_setSR(uint16_t newsr) m68k_setCR(newsr); } -LOCALPROC reg_call ExceptionTo(CPTR newpc +static void reg_call ExceptionTo(CPTR newpc #if Use68020 , int nr #endif @@ -4637,7 +4637,7 @@ LOCALPROC reg_call ExceptionTo(CPTR newpc V_regs.TracePending = false; } -LOCALPROC reg_call Exception(int nr) +static void reg_call Exception(int nr) { ExceptionTo(get_long(4 * nr #if Use68020 @@ -4657,7 +4657,7 @@ LOCALIPROC DoCodeA(void) Exception(0xA); } -LOCALFUNC uint16_t nextiword_nm(void) +static uint16_t nextiword_nm(void) /* NOT sign extended */ { return nextiword(); @@ -4719,7 +4719,7 @@ LOCALIPROC DoCodeMOVEMApRL(void) *dstp = p; } -LOCALPROC reg_call SetCCRforAddX(uint32_t dstvalue, uint32_t srcvalue, +static void reg_call SetCCRforAddX(uint32_t dstvalue, uint32_t srcvalue, uint32_t result) { ZFLG &= Bool2Bit(result == 0); @@ -4801,7 +4801,7 @@ LOCALIPROC DoCodeAddXL(void) } } -LOCALPROC reg_call SetCCRforSubX(uint32_t dstvalue, uint32_t srcvalue, +static void reg_call SetCCRforSubX(uint32_t dstvalue, uint32_t srcvalue, uint32_t result) { ZFLG &= Bool2Bit(result == 0); @@ -4882,7 +4882,7 @@ LOCALIPROC DoCodeSubXL(void) } } -LOCALPROC reg_call DoCodeNullShift(uint32_t dstvalue) +static void reg_call DoCodeNullShift(uint32_t dstvalue) { V_regs.LazyFlagKind = kLazyFlagsTstL; V_regs.LazyFlagArgDst = dstvalue; @@ -4892,7 +4892,7 @@ LOCALPROC reg_call DoCodeNullShift(uint32_t dstvalue) ArgSetDstValue(dstvalue); } -LOCALPROC DoCodeOverAsl(uint32_t dstvalue) +static void DoCodeOverAsl(uint32_t dstvalue) { XFLG = CFLG = 0; VFLG = Bool2Bit(0 != dstvalue); @@ -4905,7 +4905,7 @@ LOCALPROC DoCodeOverAsl(uint32_t dstvalue) ArgSetDstValue(0); } -LOCALPROC reg_call DoCodeMaxAsr(uint32_t dstvalue) +static void reg_call DoCodeMaxAsr(uint32_t dstvalue) { XFLG = CFLG = dstvalue & 1; VFLG = Bool2Bit(0 != dstvalue); @@ -5026,7 +5026,7 @@ LOCALIPROC DoCodeAslL(void) } } -LOCALPROC DoCodeOverShift(void) +static void DoCodeOverShift(void) { XFLG = CFLG = 0; ZFLG = 1; @@ -5039,7 +5039,7 @@ LOCALPROC DoCodeOverShift(void) ArgSetDstValue(0); } -LOCALPROC DoCodeOverShiftN(void) +static void DoCodeOverShiftN(void) { NFLG = 1; VFLG = 0; @@ -5053,7 +5053,7 @@ LOCALPROC DoCodeOverShiftN(void) ArgSetDstValue(~ 0); } -LOCALPROC DoCodeOverAShift(uint32_t dstvalue) +static void DoCodeOverAShift(uint32_t dstvalue) { if (uint32_t_MSBisSet(dstvalue)) { DoCodeOverShiftN(); @@ -5158,7 +5158,7 @@ LOCALIPROC DoCodeAsrL(void) } } -LOCALPROC reg_call DoCodeMaxLslShift(uint32_t dstvalue) +static void reg_call DoCodeMaxLslShift(uint32_t dstvalue) { XFLG = CFLG = dstvalue & 1; ZFLG = 1; @@ -5363,14 +5363,14 @@ LOCALIPROC DoCodeLsrL(void) } } -LOCALFUNC uint32_t DecodeGetSrcSetDstValueDfltFlags_nm(void) +static uint32_t DecodeGetSrcSetDstValueDfltFlags_nm(void) { NeedDefaultLazyAllFlags(); return DecodeGetSrcSetDstValue(); } -LOCALPROC reg_call DoCodeNullXShift(uint32_t dstvalue) +static void reg_call DoCodeNullXShift(uint32_t dstvalue) { CFLG = XFLG; @@ -5743,7 +5743,7 @@ LOCALIPROC DoCodeRorL(void) #if UseLazyZ -LOCALPROC WillSetZFLG(void) +static void WillSetZFLG(void) { if (kLazyFlagsZSet == V_regs.LazyFlagKind) { /* ok */ @@ -5758,7 +5758,7 @@ LOCALPROC WillSetZFLG(void) #define WillSetZFLG NeedDefaultLazyAllFlags #endif -LOCALINLINEFUNC uint32_t DecodeGetSrcGetDstValueSetZ(void) +static uint32_t DecodeGetSrcGetDstValueSetZ(void) { WillSetZFLG(); @@ -5781,7 +5781,7 @@ LOCALIPROC DoCodeBTstL(void) ZFLG = ((dstvalue >> srcvalue) ^ 1) & 1; } -LOCALINLINEFUNC uint32_t DecodeGetSrcSetDstValueSetZ(void) +static uint32_t DecodeGetSrcSetDstValueSetZ(void) { WillSetZFLG(); @@ -5927,7 +5927,7 @@ LOCALIPROC DoCodeNot(void) ArgSetDstValue(dstvalue); } -LOCALPROC DoCodeScc_t(void) +static void DoCodeScc_t(void) { #if WantCloserCyc if (kAMdRegB == V_regs.CurDecOpY.v[1].AMd) { @@ -5937,7 +5937,7 @@ LOCALPROC DoCodeScc_t(void) DecodeSetDstValue(0xff); } -LOCALPROC DoCodeScc_f(void) +static void DoCodeScc_f(void) { DecodeSetDstValue(0); } @@ -6027,7 +6027,7 @@ LOCALIPROC DoCodeNegL(void) ArgSetDstValue(result); } -LOCALPROC reg_call SetCCRforNegX(uint32_t dstvalue, uint32_t result) +static void reg_call SetCCRforNegX(uint32_t dstvalue, uint32_t result) { ZFLG &= Bool2Bit(result == 0); @@ -6268,7 +6268,7 @@ LOCALIPROC DoCodeMoveEaCR(void) m68k_setCR(DecodeGetDstValue()); } -LOCALPROC DoPrivilegeViolation(void) +static void DoPrivilegeViolation(void) { #if WantCloserCyc V_MaxCyclesToGo += GetDcoCycles(V_regs.CurDecOp); @@ -6753,7 +6753,7 @@ LOCALIPROC DoCodeMoveP3(void) put_byte(memp + 6, val); } -LOCALPROC op_illg(void) +static void op_illg(void) { BackupPC(); Exception(4); @@ -6898,7 +6898,7 @@ LOCALIPROC DoCodeFdefault(void) Exception(0xB); } -LOCALPROC m68k_setstopped(void) +static void m68k_setstopped(void) { /* not implemented. doesn't seemed to be used on Mac Plus */ Exception(4); /* fake an illegal instruction */ @@ -6918,7 +6918,7 @@ LOCALIPROC DoCodeStop(void) } } -FORWARDPROC local_customreset(void); +static void local_customreset(void); LOCALIPROC DoCodeReset(void) { @@ -6966,7 +6966,7 @@ LOCALIPROC DoCodeBraL(void) #endif #if Use68020 -LOCALPROC SkipiLong(void) +static void SkipiLong(void) { V_pc_p += 4; @@ -7027,7 +7027,7 @@ LOCALIPROC DoCodeEXTBL(void) #endif #if Use68020 -LOCALPROC DoCHK2orCMP2(void) +static void DoCHK2orCMP2(void) { /* CHK2 or CMP2 00000ss011mmmrrr */ uint32_t regv; @@ -7091,7 +7091,7 @@ LOCALPROC DoCHK2orCMP2(void) #endif #if Use68020 -LOCALPROC DoCAS(void) +static void DoCAS(void) { /* CAS 00001ss011mmmrrr */ uint32_t srcvalue; @@ -7161,7 +7161,7 @@ LOCALPROC DoCAS(void) #endif #if Use68020 -LOCALPROC DoCAS2(void) +static void DoCAS2(void) { /* CAS2 00001ss011111100 */ uint32_t extra = nextilong(); @@ -7243,7 +7243,7 @@ LOCALPROC DoCAS2(void) #endif #if Use68020 -LOCALPROC DoMOVES(void) +static void DoMOVES(void) { /* MoveS 00001110ssmmmrrr */ ReportAbnormalID(0x0112, "MoveS instruction"); @@ -7291,7 +7291,7 @@ typedef struct uint64_t0 uint64_t0; #endif #if Use68020 -LOCALPROC Ui6r_Negate(uint64_t0 *v) +static void Ui6r_Negate(uint64_t0 *v) { v->hi = ~ v->hi; v->lo = - v->lo; @@ -7302,21 +7302,21 @@ LOCALPROC Ui6r_Negate(uint64_t0 *v) #endif #if Use68020 -LOCALFUNC bool reg_call Ui6r_IsZero(uint64_t0 *v) +static bool reg_call Ui6r_IsZero(uint64_t0 *v) { return (v->hi == 0) && (v->lo == 0); } #endif #if Use68020 -LOCALFUNC bool reg_call Ui6r_IsNeg(uint64_t0 *v) +static bool reg_call Ui6r_IsNeg(uint64_t0 *v) { return ((int32_t)v->hi) < 0; } #endif #if Use68020 -LOCALPROC mul_unsigned(uint32_t src1, uint32_t src2, uint64_t0 *dst) +static void mul_unsigned(uint32_t src1, uint32_t src2, uint64_t0 *dst) { uint32_t src1_lo = uint32_t_lo(src1); uint32_t src2_lo = uint32_t_lo(src2); @@ -7336,7 +7336,7 @@ LOCALPROC mul_unsigned(uint32_t src1, uint32_t src2, uint64_t0 *dst) #endif #if Use68020 -LOCALFUNC bool div_unsigned(uint64_t0 *src, uint32_t div, +static bool div_unsigned(uint64_t0 *src, uint32_t div, uint32_t *quot, uint32_t *rem) { int i; @@ -7707,7 +7707,7 @@ LOCALIPROC DoCodeLinkL(void) #endif #if Use68020 -LOCALPROC DoCodeTRAPcc_t(void) +static void DoCodeTRAPcc_t(void) { ReportAbnormalID(0x011B, "TRAPcc trapping"); Exception(7); @@ -7716,7 +7716,7 @@ LOCALPROC DoCodeTRAPcc_t(void) #endif #if Use68020 -LOCALPROC DoCodeTRAPcc_f(void) +static void DoCodeTRAPcc_f(void) { } #endif @@ -7968,7 +7968,7 @@ LOCALIPROC DoBitField(void) #endif #if EmMMU | EmFPU -LOCALFUNC bool DecodeModeRegister(uint32_t sz) +static bool DecodeModeRegister(uint32_t sz) { bool IsOk; uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat; @@ -8069,7 +8069,7 @@ LOCALFUNC bool DecodeModeRegister(uint32_t sz) #endif #if EmMMU | EmFPU -LOCALFUNC uint32_t GetArgValueL(void) +static uint32_t GetArgValueL(void) { uint32_t v; @@ -8085,7 +8085,7 @@ LOCALFUNC uint32_t GetArgValueL(void) #endif #if EmMMU | EmFPU -LOCALFUNC uint32_t GetArgValueW(void) +static uint32_t GetArgValueW(void) { uint32_t v; @@ -8101,7 +8101,7 @@ LOCALFUNC uint32_t GetArgValueW(void) #endif #if EmMMU | EmFPU -LOCALFUNC uint32_t GetArgValueB(void) +static uint32_t GetArgValueB(void) { uint32_t v; @@ -8117,7 +8117,7 @@ LOCALFUNC uint32_t GetArgValueB(void) #endif #if EmMMU | EmFPU -LOCALPROC SetArgValueL(uint32_t v) +static void SetArgValueL(uint32_t v) { if (AKMemory == V_regs.ArgKind) { put_long(V_regs.ArgAddr.mem, v); @@ -8129,7 +8129,7 @@ LOCALPROC SetArgValueL(uint32_t v) #endif #if EmMMU | EmFPU -LOCALPROC SetArgValueW(uint32_t v) +static void SetArgValueW(uint32_t v) { if (AKMemory == V_regs.ArgKind) { put_word(V_regs.ArgAddr.mem, v); @@ -8142,7 +8142,7 @@ LOCALPROC SetArgValueW(uint32_t v) #endif #if EmMMU | EmFPU -LOCALPROC SetArgValueB(uint32_t v) +static void SetArgValueB(uint32_t v) { if (AKMemory == V_regs.ArgKind) { put_byte(V_regs.ArgAddr.mem, v); @@ -8203,7 +8203,7 @@ LOCALIPROC DoCodeMMU(void) #endif #if HaveGlbReg -LOCALPROC Em_Swap(void) +static void Em_Swap(void) { #ifdef r_pc_p { @@ -8249,7 +8249,7 @@ LOCALPROC Em_Swap(void) #endif #if HaveGlbReg -LOCALFUNC bool LocalMemAccessNtfy(ATTep pT) +static bool LocalMemAccessNtfy(ATTep pT) { bool v; @@ -8264,7 +8264,7 @@ LOCALFUNC bool LocalMemAccessNtfy(ATTep pT) #endif #if HaveGlbReg -LOCALFUNC uint32_t LocalMMDV_Access(ATTep p, uint32_t Data, +static uint32_t LocalMMDV_Access(ATTep p, uint32_t Data, bool WriteMem, bool ByteSize, CPTR addr) { uint32_t v; @@ -8279,14 +8279,14 @@ LOCALFUNC uint32_t LocalMMDV_Access(ATTep p, uint32_t Data, #define LocalMMDV_Access MMDV_Access #endif -LOCALPROC local_customreset(void) +static void local_customreset(void) { Em_Exit(); customreset(); Em_Enter(); } -LOCALFUNC ATTep LocalFindATTel(CPTR addr) +static ATTep LocalFindATTel(CPTR addr) { ATTep prev; ATTep p; @@ -8315,7 +8315,7 @@ LOCALFUNC ATTep LocalFindATTel(CPTR addr) return p; } -LOCALPROC SetUpMATC( +static void SetUpMATC( MATCp CurMATC, ATTep p) { @@ -8325,7 +8325,7 @@ LOCALPROC SetUpMATC( CurMATC->usebase = p->usebase; } -LOCALFUNC uint32_t reg_call get_byte_ext(CPTR addr) +static uint32_t reg_call get_byte_ext(CPTR addr) { ATTep p; uint8_t * m; @@ -8356,7 +8356,7 @@ Label_Retry: return uint32_t_FromSByte(Data); } -LOCALPROC reg_call put_byte_ext(CPTR addr, uint32_t b) +static void reg_call put_byte_ext(CPTR addr, uint32_t b) { ATTep p; uint8_t * m; @@ -8384,7 +8384,7 @@ Label_Retry: } } -LOCALFUNC uint32_t reg_call get_word_ext(CPTR addr) +static uint32_t reg_call get_word_ext(CPTR addr) { uint32_t Data; @@ -8423,7 +8423,7 @@ Label_Retry: return uint32_t_FromSWord(Data); } -LOCALPROC reg_call put_word_ext(CPTR addr, uint32_t w) +static void reg_call put_word_ext(CPTR addr, uint32_t w) { if (0 != (addr & 0x01)) { put_byte(addr, w >> 8); @@ -8457,7 +8457,7 @@ Label_Retry: } } -LOCALFUNC uint32_t reg_call get_long_misaligned_ext(CPTR addr) +static uint32_t reg_call get_long_misaligned_ext(CPTR addr) { uint32_t hi = get_word(addr); uint32_t lo = get_word(addr + 2); @@ -8467,14 +8467,14 @@ LOCALFUNC uint32_t reg_call get_long_misaligned_ext(CPTR addr) return uint32_t_FromSLong(Data); } -LOCALPROC reg_call put_long_misaligned_ext(CPTR addr, uint32_t l) +static void 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 reg_call get_long_ext(CPTR addr) +static uint32_t reg_call get_long_ext(CPTR addr) { uint32_t Data; @@ -8520,7 +8520,7 @@ Label_Retry: #endif #if FasterAlignedL -LOCALPROC reg_call put_long_ext(CPTR addr, uint32_t l) +static void reg_call put_long_ext(CPTR addr, uint32_t l) { if (0 != (addr & 0x03)) { put_word(addr, l >> 16); @@ -8557,7 +8557,7 @@ Label_Retry: } #endif -LOCALPROC Recalc_PC_Block(void) +static void Recalc_PC_Block(void) { ATTep p; CPTR curpc = m68k_getpc(); @@ -8591,7 +8591,7 @@ Label_Retry: } } -LOCALFUNC uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v) +static uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v) { /* Used to prevent compiler from saving @@ -8603,7 +8603,7 @@ LOCALFUNC uint32_t reg_call Recalc_PC_BlockReturnUi5r(uint32_t v) return v; } -LOCALFUNC uint32_t nextilong_ext(void) +static uint32_t nextilong_ext(void) { uint32_t r; @@ -8619,7 +8619,7 @@ LOCALFUNC uint32_t nextilong_ext(void) return r; } -LOCALPROC DoCheckExternalInterruptPending(void) +static void DoCheckExternalInterruptPending(void) { uint8_t level = *V_regs.fIPL; if ((level > V_regs.intmask) || (level == 7)) { @@ -8632,13 +8632,13 @@ LOCALPROC DoCheckExternalInterruptPending(void) } } -LOCALPROC do_trace(void) +static void do_trace(void) { V_regs.TracePending = true; NeedToGetOut(); } -GLOBALPROC m68k_go_nCycles(uint32_t n) +void m68k_go_nCycles(uint32_t n) { Em_Enter(); V_MaxCyclesToGo += (n + V_regs.ResidualCycles); @@ -8673,7 +8673,7 @@ GLOBALPROC m68k_go_nCycles(uint32_t n) Em_Exit(); } -GLOBALFUNC int32_t GetCyclesRemaining(void) + int32_t GetCyclesRemaining(void) { int32_t v; @@ -8684,7 +8684,7 @@ GLOBALFUNC int32_t GetCyclesRemaining(void) return v; } -GLOBALPROC SetCyclesRemaining(int32_t n) +void SetCyclesRemaining(int32_t n) { Em_Enter(); @@ -8698,7 +8698,7 @@ GLOBALPROC SetCyclesRemaining(int32_t n) Em_Exit(); } -GLOBALFUNC ATTep FindATTel(CPTR addr) + ATTep FindATTel(CPTR addr) { ATTep v; @@ -8709,7 +8709,7 @@ GLOBALFUNC ATTep FindATTel(CPTR addr) return v; } -GLOBALFUNC uint8_t get_vm_byte(CPTR addr) + uint8_t get_vm_byte(CPTR addr) { uint8_t v; @@ -8720,7 +8720,7 @@ GLOBALFUNC uint8_t get_vm_byte(CPTR addr) return v; } -GLOBALFUNC uint16_t get_vm_word(CPTR addr) + uint16_t get_vm_word(CPTR addr) { uint16_t v; @@ -8731,7 +8731,7 @@ GLOBALFUNC uint16_t get_vm_word(CPTR addr) return v; } -GLOBALFUNC uint32_t get_vm_long(CPTR addr) + uint32_t get_vm_long(CPTR addr) { uint32_t v; @@ -8742,28 +8742,28 @@ GLOBALFUNC uint32_t get_vm_long(CPTR addr) return v; } -GLOBALPROC put_vm_byte(CPTR addr, uint8_t b) +void put_vm_byte(CPTR addr, uint8_t b) { Em_Enter(); put_byte(addr, uint32_t_FromSByte(b)); Em_Exit(); } -GLOBALPROC put_vm_word(CPTR addr, uint16_t w) +void put_vm_word(CPTR addr, uint16_t w) { Em_Enter(); put_word(addr, uint32_t_FromSWord(w)); Em_Exit(); } -GLOBALPROC put_vm_long(CPTR addr, uint32_t l) +void put_vm_long(CPTR addr, uint32_t l) { Em_Enter(); put_long(addr, uint32_t_FromSLong(l)); Em_Exit(); } -GLOBALPROC SetHeadATTel(ATTep p) +void SetHeadATTel(ATTep p) { Em_Enter(); @@ -8790,7 +8790,7 @@ GLOBALPROC SetHeadATTel(ATTep p) Em_Exit(); } -GLOBALPROC DiskInsertedPsuedoException(CPTR newpc, uint32_t data) +void DiskInsertedPsuedoException(CPTR newpc, uint32_t data) { Em_Enter(); ExceptionTo(newpc @@ -8803,7 +8803,7 @@ GLOBALPROC DiskInsertedPsuedoException(CPTR newpc, uint32_t data) Em_Exit(); } -GLOBALPROC m68k_IPLchangeNtfy(void) +void m68k_IPLchangeNtfy(void) { Em_Enter(); { @@ -8817,7 +8817,7 @@ GLOBALPROC m68k_IPLchangeNtfy(void) } #if WantDumpTable -LOCALPROC InitDumpTable(void) +static void InitDumpTable(void) { int32_t i; @@ -8826,7 +8826,7 @@ LOCALPROC InitDumpTable(void) } } -LOCALPROC DumpATable(uint32_t *p, uint32_t n) +static void DumpATable(uint32_t *p, uint32_t n) { int32_t i; @@ -8836,14 +8836,14 @@ LOCALPROC DumpATable(uint32_t *p, uint32_t n) } } -EXPORTPROC DoDumpTable(void); -GLOBALPROC DoDumpTable(void) +extern void DoDumpTable(void); +void DoDumpTable(void) { DumpATable(DumpTable, kNumIKinds); } #endif -GLOBALPROC m68k_reset(void) +void m68k_reset(void) { Em_Enter(); @@ -8898,14 +8898,14 @@ GLOBALPROC m68k_reset(void) } #if SmallGlobals -GLOBALPROC MINEM68K_ReserveAlloc(void) +void MINEM68K_ReserveAlloc(void) { ReserveAllocOneBlock((uint8_t * *)®s.disp_table, disp_table_sz * 8, 6, false); } #endif -GLOBALPROC MINEM68K_Init( +void MINEM68K_Init( uint8_t *fIPL) { regs.fIPL = fIPL; diff --git a/src/HW/M68K/MINEM68K.h b/src/HW/M68K/MINEM68K.h index 8a341b1..c1d3c2d 100644 --- a/src/HW/M68K/MINEM68K.h +++ b/src/HW/M68K/MINEM68K.h @@ -17,20 +17,20 @@ #ifndef MINEM68K_H #define MINEM68K_H -EXPORTPROC MINEM68K_Init( +extern void MINEM68K_Init( uint8_t *fIPL); #if SmallGlobals -EXPORTPROC MINEM68K_ReserveAlloc(void); +extern void MINEM68K_ReserveAlloc(void); #endif -EXPORTPROC m68k_IPLchangeNtfy(void); -EXPORTPROC DiskInsertedPsuedoException(CPTR newpc, uint32_t data); -EXPORTPROC m68k_reset(void); +extern void m68k_IPLchangeNtfy(void); +extern void DiskInsertedPsuedoException(CPTR newpc, uint32_t data); +extern void m68k_reset(void); -EXPORTFUNC int32_t GetCyclesRemaining(void); -EXPORTPROC SetCyclesRemaining(int32_t n); +extern int32_t GetCyclesRemaining(void); +extern void SetCyclesRemaining(int32_t n); -EXPORTPROC m68k_go_nCycles(uint32_t n); +extern void m68k_go_nCycles(uint32_t n); /* general purpose access of address space @@ -38,15 +38,15 @@ EXPORTPROC m68k_go_nCycles(uint32_t n); memory mapped hardware.) */ -EXPORTFUNC uint8_t get_vm_byte(CPTR addr); -EXPORTFUNC uint16_t get_vm_word(CPTR addr); -EXPORTFUNC uint32_t get_vm_long(CPTR addr); +extern uint8_t get_vm_byte(CPTR addr); +extern uint16_t get_vm_word(CPTR addr); +extern uint32_t get_vm_long(CPTR addr); -EXPORTPROC put_vm_byte(CPTR addr, uint8_t b); -EXPORTPROC put_vm_word(CPTR addr, uint16_t w); -EXPORTPROC put_vm_long(CPTR addr, uint32_t l); +extern void put_vm_byte(CPTR addr, uint8_t b); +extern void put_vm_word(CPTR addr, uint16_t w); +extern void put_vm_long(CPTR addr, uint32_t l); -EXPORTPROC SetHeadATTel(ATTep p); -EXPORTFUNC ATTep FindATTel(CPTR addr); +extern void SetHeadATTel(ATTep p); +extern ATTep FindATTel(CPTR addr); #endif diff --git a/src/HW/MOUSE/MOUSEMDV.c b/src/HW/MOUSE/MOUSEMDV.c index b4c5e13..0484278 100644 --- a/src/HW/MOUSE/MOUSEMDV.c +++ b/src/HW/MOUSE/MOUSEMDV.c @@ -35,7 +35,7 @@ #include "HW/MOUSE/MOUSEMDV.h" -GLOBALPROC Mouse_Update(void) +void Mouse_Update(void) { #if HaveMasterEvtQLock if (0 != MasterEvtQLock) { @@ -119,7 +119,7 @@ GLOBALPROC Mouse_Update(void) #endif } -GLOBALPROC Mouse_EndTickNotify(void) +void Mouse_EndTickNotify(void) { if (Mouse_Enabled()) { /* tell platform specific code where the mouse went */ diff --git a/src/HW/MOUSE/MOUSEMDV.h b/src/HW/MOUSE/MOUSEMDV.h index a97bc5a..75e687d 100644 --- a/src/HW/MOUSE/MOUSEMDV.h +++ b/src/HW/MOUSE/MOUSEMDV.h @@ -20,5 +20,5 @@ #define MOUSEMDV_H #endif -EXPORTPROC Mouse_Update(void); -EXPORTPROC Mouse_EndTickNotify(void); +extern void Mouse_Update(void); +extern void Mouse_EndTickNotify(void); diff --git a/src/HW/POWERMAN/PMUEMDEV.c b/src/HW/POWERMAN/PMUEMDEV.c index 3502453..f3ceef9 100644 --- a/src/HW/POWERMAN/PMUEMDEV.c +++ b/src/HW/POWERMAN/PMUEMDEV.c @@ -44,27 +44,27 @@ enum { }; #define PMU_BuffSz 8 -LOCALVAR uint8_t PMU_BuffA[PMU_BuffSz]; -LOCALVAR uint8_t * PMU_p; -LOCALVAR uint8_t PMU_rem; -LOCALVAR uint8_t PMU_i; +static uint8_t PMU_BuffA[PMU_BuffSz]; +static uint8_t * PMU_p; +static uint8_t PMU_rem; +static uint8_t PMU_i; -LOCALVAR int PMUState = kPMUStateReadyForCommand; +static int PMUState = kPMUStateReadyForCommand; -LOCALVAR uint8_t PMU_CurCommand; -LOCALVAR uint8_t PMU_SendNext; -LOCALVAR uint8_t PMU_BuffL; +static uint8_t PMU_CurCommand; +static uint8_t PMU_SendNext; +static uint8_t PMU_BuffL; -LOCALPROC PmuStartSendResult(uint8_t ResultCode, uint8_t L) +static void PmuStartSendResult(uint8_t ResultCode, uint8_t L) { PMU_SendNext = ResultCode; PMU_BuffL = L; PMUState = kPMUStateSendLength; } -LOCALVAR uint8_t PARAMRAM[128]; +static uint8_t PARAMRAM[128]; -LOCALPROC PmuCheckCommandOp(void) +static void PmuCheckCommandOp(void) { switch (PMU_CurCommand) { case 0x10: /* kPMUpowerCntl - power plane/clock control */ @@ -262,7 +262,7 @@ LOCALPROC PmuCheckCommandOp(void) } } -LOCALPROC LocBuffSetUpNextChunk(void) +static void LocBuffSetUpNextChunk(void) { PMU_p = PMU_BuffA; PMU_rem = PMU_BuffL - PMU_i; @@ -271,7 +271,7 @@ LOCALPROC LocBuffSetUpNextChunk(void) } } -LOCALFUNC uint8_t GetPMUbus(void) +static uint8_t GetPMUbus(void) { uint8_t v; @@ -294,7 +294,7 @@ LOCALFUNC uint8_t GetPMUbus(void) return v; } -LOCALPROC SetPMUbus(uint8_t v) +static void SetPMUbus(uint8_t v) { VIA1_iA0 = v & 0x01; v >>= 1; @@ -313,9 +313,9 @@ LOCALPROC SetPMUbus(uint8_t v) VIA1_iA7 = v & 0x01; } -LOCALVAR bool PMU_Sending = false; +static bool PMU_Sending = false; -LOCALPROC PmuCheckCommandCompletion(void) +static void PmuCheckCommandCompletion(void) { if (PMU_i == PMU_BuffL) { PMUState = kPMUStateRecievedCommand; @@ -336,7 +336,7 @@ LOCALPROC PmuCheckCommandCompletion(void) } } -GLOBALPROC PmuToReady_ChangeNtfy(void) +void PmuToReady_ChangeNtfy(void) { if (PMU_Sending) { PMU_Sending = false; @@ -432,7 +432,7 @@ GLOBALPROC PmuToReady_ChangeNtfy(void) } } -GLOBALPROC PMU_DoTask(void) +void PMU_DoTask(void) { if (PMU_Sending) { PMU_Sending = false; diff --git a/src/HW/POWERMAN/PMUEMDEV.h b/src/HW/POWERMAN/PMUEMDEV.h index 22e5dfa..d463a89 100644 --- a/src/HW/POWERMAN/PMUEMDEV.h +++ b/src/HW/POWERMAN/PMUEMDEV.h @@ -20,5 +20,5 @@ #define PMUEMDEV_H #endif -EXPORTPROC PmuToReady_ChangeNtfy(void); -EXPORTPROC PMU_DoTask(void); +extern void PmuToReady_ChangeNtfy(void); +extern void PMU_DoTask(void); diff --git a/src/HW/RTC/RTCEMDEV.c b/src/HW/RTC/RTCEMDEV.c index c504a7b..6cbb720 100644 --- a/src/HW/RTC/RTCEMDEV.c +++ b/src/HW/RTC/RTCEMDEV.c @@ -76,11 +76,11 @@ typedef struct uint8_t PARAMRAM[PARAMRAMSize]; } RTC_Ty; -LOCALVAR RTC_Ty RTC; +static RTC_Ty RTC; /* RTC Functions */ -LOCALVAR uint32_t LastRealDate; +static uint32_t LastRealDate; #ifndef RTCinitPRAM #define RTCinitPRAM 1 @@ -127,9 +127,9 @@ LOCALVAR uint32_t LastRealDate; + (DiskCacheOn << 5) + (MouseScalingOn << 6)) #if dbglog_HAVE && 0 -EXPORTPROC DumpRTC(void); +extern void DumpRTC(void); -GLOBALPROC DumpRTC(void) +void DumpRTC(void) { int Counter; @@ -143,7 +143,7 @@ GLOBALPROC DumpRTC(void) } #endif -GLOBALFUNC bool RTC_Init(void) + bool RTC_Init(void) { int Counter; uint32_t secs; @@ -300,10 +300,10 @@ if ((0 == vMacScreenDepth) || (vMacScreenDepth >= 4)) { } #ifdef RTC_OneSecond_PulseNtfy -IMPORTPROC RTC_OneSecond_PulseNtfy(void); +extern void RTC_OneSecond_PulseNtfy(void); #endif -GLOBALPROC RTC_Interrupt(void) +void RTC_Interrupt(void) { uint32_t Seconds = 0; uint32_t NewRealDate = CurMacDateInSeconds; @@ -326,7 +326,7 @@ GLOBALPROC RTC_Interrupt(void) } } -LOCALFUNC uint8_t RTC_Access_PRAM_Reg(uint8_t Data, bool WriteReg, uint8_t t) +static uint8_t RTC_Access_PRAM_Reg(uint8_t Data, bool WriteReg, uint8_t t) { if (WriteReg) { if (! RTC.WrProtect) { @@ -341,7 +341,7 @@ LOCALFUNC uint8_t RTC_Access_PRAM_Reg(uint8_t Data, bool WriteReg, uint8_t t) return Data; } -LOCALFUNC uint8_t RTC_Access_Reg(uint8_t Data, bool WriteReg, uint8_t TheCmd) +static uint8_t RTC_Access_Reg(uint8_t Data, bool WriteReg, uint8_t TheCmd) { uint8_t t = (TheCmd & 0x7C) >> 2; if (t < 8) { @@ -377,7 +377,7 @@ LOCALFUNC uint8_t RTC_Access_Reg(uint8_t Data, bool WriteReg, uint8_t TheCmd) return Data; } -LOCALPROC RTC_DoCmd(void) +static void RTC_DoCmd(void) { switch (RTC.Mode) { case 0: /* This Byte is a RTC Command */ @@ -437,7 +437,7 @@ LOCALPROC RTC_DoCmd(void) } } -GLOBALPROC RTCunEnabled_ChangeNtfy(void) +void RTCunEnabled_ChangeNtfy(void) { if (RTCunEnabled) { /* abort anything going on */ @@ -455,7 +455,7 @@ GLOBALPROC RTCunEnabled_ChangeNtfy(void) } } -GLOBALPROC RTCclock_ChangeNtfy(void) +void RTCclock_ChangeNtfy(void) { if (! RTCunEnabled) { if (RTCclock) { @@ -480,7 +480,7 @@ GLOBALPROC RTCclock_ChangeNtfy(void) } } -GLOBALPROC RTCdataLine_ChangeNtfy(void) +void RTCdataLine_ChangeNtfy(void) { #if dbglog_HAVE if (RTC.DataOut) { diff --git a/src/HW/RTC/RTCEMDEV.h b/src/HW/RTC/RTCEMDEV.h index fb4619c..31a4a7d 100644 --- a/src/HW/RTC/RTCEMDEV.h +++ b/src/HW/RTC/RTCEMDEV.h @@ -17,11 +17,11 @@ #ifndef RTCEMDEV_H #define RTCEMDEV_H -EXPORTFUNC bool RTC_Init(void); -EXPORTPROC RTC_Interrupt(void); +extern bool RTC_Init(void); +extern void RTC_Interrupt(void); -EXPORTPROC RTCunEnabled_ChangeNtfy(void); -EXPORTPROC RTCclock_ChangeNtfy(void); -EXPORTPROC RTCdataLine_ChangeNtfy(void); +extern void RTCunEnabled_ChangeNtfy(void); +extern void RTCclock_ChangeNtfy(void); +extern void RTCdataLine_ChangeNtfy(void); #endif \ No newline at end of file diff --git a/src/HW/SCC/SCCEMDEV.c b/src/HW/SCC/SCCEMDEV.c index 8c230f2..167fe5d 100644 --- a/src/HW/SCC/SCCEMDEV.c +++ b/src/HW/SCC/SCCEMDEV.c @@ -242,11 +242,11 @@ typedef struct { #endif } SCC_Ty; -LOCALVAR SCC_Ty SCC; +static SCC_Ty SCC; #if 0 -LOCALVAR int ReadPrint; -LOCALVAR int ReadModem; +static int ReadPrint; +static int ReadModem; #endif #if EmLocalTalk @@ -254,7 +254,7 @@ static int rx_data_offset = 0; /* when data pending, this is used */ #endif -EXPORTFUNC bool SCC_InterruptsEnabled(void) +extern bool SCC_InterruptsEnabled(void) { return SCC.MIE; } @@ -262,7 +262,7 @@ EXPORTFUNC bool SCC_InterruptsEnabled(void) /* ---- */ /* Function used to update the interrupt state of the SCC */ -LOCALPROC CheckSCCInterruptFlag(void) +static void CheckSCCInterruptFlag(void) { #if 0 /* ReceiveAInterrupt always false */ bool ReceiveAInterrupt = false @@ -398,7 +398,7 @@ LOCALPROC CheckSCCInterruptFlag(void) } } -LOCALPROC SCC_InitChannel(int chan) +static void SCC_InitChannel(int chan) { /* anything not done by ResetChannel */ @@ -433,7 +433,7 @@ LOCALPROC SCC_InitChannel(int chan) #endif } -LOCALPROC SCC_ResetChannel(int chan) +static void SCC_ResetChannel(int chan) { /* RR 0 */ #if EmLocalTalk @@ -568,7 +568,7 @@ LOCALPROC SCC_ResetChannel(int chan) #endif } -GLOBALPROC SCC_Reset(void) +void SCC_Reset(void) { SCCwaitrq = 1; @@ -592,9 +592,9 @@ GLOBALPROC SCC_Reset(void) #if EmLocalTalk -LOCALVAR bool CTSpacketPending = false; -LOCALVAR uint8_t CTSpacketRxDA; -LOCALVAR uint8_t CTSpacketRxSA; +static bool CTSpacketPending = false; +static uint8_t CTSpacketRxDA; +static uint8_t CTSpacketRxSA; /* Function used when all the tx data is sent to the SCC as indicated @@ -605,7 +605,7 @@ LOCALVAR uint8_t CTSpacketRxSA; handle collision detection and retransmission. Besides this is what a standard AppleTalk (LocalTalk to EtherTalk) bridge does. */ -LOCALPROC process_transmit(void) +static void process_transmit(void) { /* Check for LLAP packets, which we won't send */ if (LT_TxBuffSz == 3) { @@ -631,7 +631,7 @@ LOCALPROC process_transmit(void) } } -LOCALPROC SCC_TxBuffPut(uint8_t Data) +static void SCC_TxBuffPut(uint8_t Data) { /* Buffer the data in the transmit buffer */ if (LT_TxBuffSz < LT_TxBfMxSz) { @@ -640,9 +640,9 @@ LOCALPROC SCC_TxBuffPut(uint8_t Data) } } -LOCALVAR uint8_t CTSBuffer[4]; +static uint8_t CTSBuffer[4]; -LOCALPROC GetCTSpacket(void) +static void GetCTSpacket(void) { /* Get a single buffer worth of packets at a time */ uint8_t * device_buffer = CTSBuffer; @@ -666,7 +666,7 @@ LOCALPROC GetCTSpacket(void) This function is called once all the normal packet bytes have been received. */ -LOCALPROC rx_complete(void) +static void rx_complete(void) { if (SCC.a[1].EndOfFrame) { ReportAbnormalID(0x0702, "EndOfFrame true in rx_complete"); @@ -687,7 +687,7 @@ LOCALPROC rx_complete(void) SCC.a[1].EndOfFrame = true; } -LOCALPROC SCC_RxBuffAdvance(void) +static void SCC_RxBuffAdvance(void) { uint8_t value; @@ -721,9 +721,9 @@ LOCALPROC SCC_RxBuffAdvance(void) } /* LLAP/SDLC address */ -LOCALVAR uint8_t node_address = 0; +static uint8_t node_address = 0; -LOCALPROC GetNextPacketForMe(void) +static void GetNextPacketForMe(void) { unsigned char dst; unsigned char src; @@ -764,7 +764,7 @@ label_retry: External function, called periodically, to poll for any new LTOE packets. Any new packets are queued into the packet receipt queue. */ -GLOBALPROC LocalTalkTick(void) +void LocalTalkTick(void) { if (SCC.a[1].RxEnable && (! SCC.a[1].RxChrAvail)) @@ -798,7 +798,7 @@ GLOBALPROC LocalTalkTick(void) #if 0 -LOCALPROC SCC_Interrupt(int Type) +static void SCC_Interrupt(int Type) { if (SCC.MIE) { /* Master Interrupt Enable */ @@ -812,7 +812,7 @@ LOCALPROC SCC_Interrupt(int Type) #endif #if 0 -LOCALPROC SCC_Int(void) +static void SCC_Int(void) { /* This should be called at regular intervals */ @@ -920,7 +920,7 @@ LOCALPROC SCC_Int(void) #endif #if SCC_dolog -LOCALPROC SCC_DbgLogChanStartLine(int chan) +static void SCC_DbgLogChanStartLine(int chan) { dbglog_StartLine(); dbglog_writeCStr("SCC chan("); @@ -934,7 +934,7 @@ LOCALPROC SCC_DbgLogChanStartLine(int chan) } #endif -LOCALFUNC uint8_t SCC_GetRR0(int chan) +static uint8_t SCC_GetRR0(int chan) { /* happens on boot always */ @@ -966,7 +966,7 @@ LOCALFUNC uint8_t SCC_GetRR0(int chan) ; } -LOCALFUNC uint8_t SCC_GetRR1(int chan) +static uint8_t SCC_GetRR1(int chan) { /* happens in MacCheck */ @@ -999,7 +999,7 @@ LOCALFUNC uint8_t SCC_GetRR1(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR2(int chan) +static uint8_t SCC_GetRR2(int chan) { /* happens in MacCheck */ /* happens in Print to ImageWriter */ @@ -1103,7 +1103,7 @@ LOCALFUNC uint8_t SCC_GetRR2(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR3(int chan) +static uint8_t SCC_GetRR3(int chan) { uint8_t value = 0; @@ -1124,7 +1124,7 @@ LOCALFUNC uint8_t SCC_GetRR3(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR8(int chan) +static uint8_t SCC_GetRR8(int chan) { uint8_t value = 0; @@ -1160,7 +1160,7 @@ LOCALFUNC uint8_t SCC_GetRR8(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR10(int chan) +static uint8_t SCC_GetRR10(int chan) { /* happens on boot with appletalk on */ @@ -1174,7 +1174,7 @@ LOCALFUNC uint8_t SCC_GetRR10(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR12(int chan) +static uint8_t SCC_GetRR12(int chan) { uint8_t value = 0; @@ -1190,7 +1190,7 @@ LOCALFUNC uint8_t SCC_GetRR12(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR13(int chan) +static uint8_t SCC_GetRR13(int chan) { uint8_t value = 0; @@ -1206,7 +1206,7 @@ LOCALFUNC uint8_t SCC_GetRR13(int chan) return value; } -LOCALFUNC uint8_t SCC_GetRR15(int chan) +static uint8_t SCC_GetRR15(int chan) { uint8_t value = 0; @@ -1236,7 +1236,7 @@ LOCALFUNC uint8_t SCC_GetRR15(int chan) } #if SCC_dolog -LOCALPROC SCC_DbgLogChanCmnd(int chan, char *s) +static void SCC_DbgLogChanCmnd(int chan, char *s) { SCC_DbgLogChanStartLine(chan); dbglog_writeCStr(" "); @@ -1246,7 +1246,7 @@ LOCALPROC SCC_DbgLogChanCmnd(int chan, char *s) #endif #if SCC_dolog -LOCALPROC SCC_DbgLogChanChngBit(int chan, char *s, bool v) +static void SCC_DbgLogChanChngBit(int chan, char *s, bool v) { SCC_DbgLogChanStartLine(chan); dbglog_writeCStr(" "); @@ -1261,7 +1261,7 @@ LOCALPROC SCC_DbgLogChanChngBit(int chan, char *s, bool v) } #endif -LOCALPROC SCC_PutWR0(uint8_t Data, int chan) +static void SCC_PutWR0(uint8_t Data, int chan) /* "CRC initialize, initialization commands for the various modes, Register Pointers" @@ -1396,7 +1396,7 @@ LOCALPROC SCC_PutWR0(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR1(uint8_t Data, int chan) +static void SCC_PutWR1(uint8_t Data, int chan) /* "Transmit/Receive interrupt and data transfer mode definition" */ @@ -1533,7 +1533,7 @@ LOCALPROC SCC_PutWR1(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR2(uint8_t Data, int chan) +static void SCC_PutWR2(uint8_t Data, int chan) /* "Interrupt Vector (accessed through either channel)" */ { /* @@ -1583,7 +1583,7 @@ LOCALPROC SCC_PutWR2(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR3(uint8_t Data, int chan) +static void SCC_PutWR3(uint8_t Data, int chan) /* "Receive parameters and control" */ { #if SCC_TrackMore @@ -1725,7 +1725,7 @@ LOCALPROC SCC_PutWR3(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR4(uint8_t Data, int chan) +static void SCC_PutWR4(uint8_t Data, int chan) /* "Transmit/Receive miscellaneous parameters and modes" */ { #if ! (EmLocalTalk || SCC_TrackMore) @@ -1859,7 +1859,7 @@ LOCALPROC SCC_PutWR4(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR5(uint8_t Data, int chan) +static void SCC_PutWR5(uint8_t Data, int chan) /* "Transmit parameters and controls" */ { /* happens on boot with appletalk on */ @@ -1986,7 +1986,7 @@ LOCALPROC SCC_PutWR5(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR6(uint8_t Data, int chan) +static void SCC_PutWR6(uint8_t Data, int chan) /* "Sync characters or SDLC address field" */ { /* happens on boot with appletalk on */ @@ -2012,7 +2012,7 @@ LOCALPROC SCC_PutWR6(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR7(uint8_t Data, int chan) +static void SCC_PutWR7(uint8_t Data, int chan) /* "Sync character or SDLC flag" */ { /* happens on boot with appletalk on */ @@ -2034,7 +2034,7 @@ LOCALPROC SCC_PutWR7(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR8(uint8_t Data, int chan) +static void SCC_PutWR8(uint8_t Data, int chan) /* "Transmit Buffer" */ { /* happens on boot with appletalk on */ @@ -2081,7 +2081,7 @@ LOCALPROC SCC_PutWR8(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR9(uint8_t Data, int chan) +static void SCC_PutWR9(uint8_t Data, int chan) /* "Master interrupt control and reset (accessed through either channel)" @@ -2172,7 +2172,7 @@ LOCALPROC SCC_PutWR9(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR10(uint8_t Data, int chan) +static void SCC_PutWR10(uint8_t Data, int chan) /* "Miscellaneous transmitter/receiver control bits" */ { /* happens on boot with appletalk on */ @@ -2247,7 +2247,7 @@ LOCALPROC SCC_PutWR10(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR11(uint8_t Data, int chan) +static void SCC_PutWR11(uint8_t Data, int chan) /* "Clock mode control" */ { /* happens on boot with appletalk on */ @@ -2374,7 +2374,7 @@ LOCALPROC SCC_PutWR11(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR12(uint8_t Data, int chan) +static void SCC_PutWR12(uint8_t Data, int chan) /* "Lower byte of baud rate generator time constant" */ { /* happens on boot with appletalk on */ @@ -2412,7 +2412,7 @@ LOCALPROC SCC_PutWR12(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR13(uint8_t Data, int chan) +static void SCC_PutWR13(uint8_t Data, int chan) /* "Upper byte of baud rate generator time constant" */ { /* happens on boot with appletalk on */ @@ -2442,7 +2442,7 @@ LOCALPROC SCC_PutWR13(uint8_t Data, int chan) #endif } -LOCALPROC SCC_PutWR14(uint8_t Data, int chan) +static void SCC_PutWR14(uint8_t Data, int chan) /* "Miscellaneous control bits" */ { /* happens on boot with appletalk on */ @@ -2526,7 +2526,7 @@ LOCALPROC SCC_PutWR14(uint8_t Data, int chan) } } -LOCALPROC SCC_PutWR15(uint8_t Data, int chan) +static void SCC_PutWR15(uint8_t Data, int chan) /* "External/Status interrupt control" */ { /* happens on boot always */ @@ -2601,7 +2601,7 @@ LOCALPROC SCC_PutWR15(uint8_t Data, int chan) #endif } -LOCALFUNC uint8_t SCC_GetReg(int chan, uint8_t SCC_Reg) +static uint8_t SCC_GetReg(int chan, uint8_t SCC_Reg) { uint8_t value; @@ -2688,7 +2688,7 @@ LOCALFUNC uint8_t SCC_GetReg(int chan, uint8_t SCC_Reg) return value; } -LOCALPROC SCC_PutReg(uint8_t Data, int chan, uint8_t SCC_Reg) +static void SCC_PutReg(uint8_t Data, int chan, uint8_t SCC_Reg) { #if SCC_dolog && 0 SCC_DbgLogChanStartLine(chan); @@ -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, bool WriteMem, CPTR addr) + uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr) { #if EmLocalTalk /* diff --git a/src/HW/SCC/SCCEMDEV.h b/src/HW/SCC/SCCEMDEV.h index 5973016..dbe4709 100644 --- a/src/HW/SCC/SCCEMDEV.h +++ b/src/HW/SCC/SCCEMDEV.h @@ -17,15 +17,15 @@ #ifndef SCCEMDEV_H #define SCCEMDEV_H -EXPORTPROC SCC_Reset(void); +extern void SCC_Reset(void); -EXPORTFUNC uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t SCC_Access(uint32_t Data, bool WriteMem, CPTR addr); -EXPORTFUNC bool SCC_InterruptsEnabled(void); +extern bool SCC_InterruptsEnabled(void); #if EmLocalTalk -EXPORTPROC LocalTalkTick(void); -EXPORTFUNC int InitLocalTalk(void); +extern void LocalTalkTick(void); +extern int InitLocalTalk(void); #endif #endif diff --git a/src/HW/SCREEN/SCRNTRNS.h b/src/HW/SCREEN/SCRNTRNS.h index a6ccbaa..0c118d2 100644 --- a/src/HW/SCREEN/SCRNTRNS.h +++ b/src/HW/SCREEN/SCRNTRNS.h @@ -58,7 +58,7 @@ /* now define the procedure */ -LOCALPROC ScrnTrns_DoTrans(int16_t top, int16_t left, +static void ScrnTrns_DoTrans(int16_t top, int16_t left, int16_t bottom, int16_t right) { int i; diff --git a/src/HW/SCSI/SCSIEMDV.c b/src/HW/SCSI/SCSIEMDV.c index 0939493..07198e1 100644 --- a/src/HW/SCSI/SCSIEMDV.c +++ b/src/HW/SCSI/SCSIEMDV.c @@ -55,9 +55,9 @@ #define kSCSI_Size 0x00010 -LOCALVAR uint8_t SCSI[kSCSI_Size]; +static uint8_t SCSI[kSCSI_Size]; -GLOBALPROC SCSI_Reset(void) +void SCSI_Reset(void) { int i; @@ -66,7 +66,7 @@ GLOBALPROC SCSI_Reset(void) } } -LOCALPROC SCSI_BusReset(void) +static void SCSI_BusReset(void) { SCSI[scsiRd + sCDR] = 0; SCSI[scsiWr + sODR] = 0; @@ -93,7 +93,7 @@ LOCALPROC SCSI_BusReset(void) put_ram_word(0xb22, get_ram_word(0xb22) | 0x8000); } -LOCALPROC SCSI_Check(void) +static void SCSI_Check(void) { /* The arbitration select/reselect scenario @@ -141,7 +141,7 @@ LOCALPROC SCSI_Check(void) } } -GLOBALFUNC uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr) + uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr) { if (addr < (kSCSI_Size / 2)) { addr *= 2; diff --git a/src/HW/SCSI/SCSIEMDV.h b/src/HW/SCSI/SCSIEMDV.h index b57e408..2d4d0df 100644 --- a/src/HW/SCSI/SCSIEMDV.h +++ b/src/HW/SCSI/SCSIEMDV.h @@ -17,8 +17,8 @@ #ifndef SCSIEMDV_H #define SCSIEMDV_H -EXPORTPROC SCSI_Reset(void); +extern void SCSI_Reset(void); -EXPORTFUNC uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr); #endif diff --git a/src/HW/SOUND/ASCEMDEV.c b/src/HW/SOUND/ASCEMDEV.c index c81a422..429c1da 100644 --- a/src/HW/SOUND/ASCEMDEV.c +++ b/src/HW/SOUND/ASCEMDEV.c @@ -33,15 +33,15 @@ ReportAbnormalID unused 0x0F0E, 0x0F1E - 0x0FFF */ -LOCALVAR uint8_t SoundReg801 = 0; -LOCALVAR uint8_t SoundReg802 = 0; -LOCALVAR uint8_t SoundReg803 = 0; -LOCALVAR uint8_t SoundReg804 = 0; -LOCALVAR uint8_t SoundReg805 = 0; -LOCALVAR uint8_t SoundReg_Volume = 0; /* 0x806 */ -/* LOCALVAR uint8_t SoundReg807 = 0; */ +static uint8_t SoundReg801 = 0; +static uint8_t SoundReg802 = 0; +static uint8_t SoundReg803 = 0; +static uint8_t SoundReg804 = 0; +static uint8_t SoundReg805 = 0; +static uint8_t SoundReg_Volume = 0; /* 0x806 */ +/* static uint8_t SoundReg807 = 0; */ -LOCALVAR uint8_t ASC_SampBuff[0x800]; +static uint8_t ASC_SampBuff[0x800]; struct ASC_ChanR { uint8_t freq[4]; @@ -49,20 +49,20 @@ struct ASC_ChanR { }; typedef struct ASC_ChanR ASC_ChanR; -LOCALVAR ASC_ChanR ASC_ChanA[4]; +static 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 bool ASC_Playing = false; +static uint16_t ASC_FIFO_Out = 0; +static uint16_t ASC_FIFO_InA = 0; +static uint16_t ASC_FIFO_InB = 0; +static bool ASC_Playing = false; #define ASC_dolog (dbglog_HAVE && 0) #ifdef ASC_interrupt_PulseNtfy -IMPORTPROC ASC_interrupt_PulseNtfy(void); +extern void ASC_interrupt_PulseNtfy(void); #endif -LOCALPROC ASC_RecalcStatus(void) +static void ASC_RecalcStatus(void) { if ((1 == SoundReg801) && ASC_Playing) { if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) { @@ -90,7 +90,7 @@ LOCALPROC ASC_RecalcStatus(void) } } -LOCALPROC ASC_ClearFIFO(void) +static void ASC_ClearFIFO(void) { ASC_FIFO_Out = 0; ASC_FIFO_InA = 0; @@ -99,7 +99,7 @@ LOCALPROC ASC_ClearFIFO(void) ASC_RecalcStatus(); } -GLOBALFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr) + uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr) { if (addr < 0x800) { if (WriteMem) { @@ -517,11 +517,11 @@ GLOBALFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr) = {approx} (x - kCenterSound) / (8 - SoundVolume) + kCenterSound; */ -LOCALVAR const uint16_t vol_mult[] = { +static const uint16_t vol_mult[] = { 8192, 9362, 10922, 13107, 16384, 21845, 32768 }; -LOCALVAR const trSoundSamp vol_offset[] = { +static const trSoundSamp vol_offset[] = { #if 3 == kLn2SoundSampSz 112, 110, 107, 103, 96, 86, 64, 0 #elif 4 == kLn2SoundSampSz @@ -531,12 +531,12 @@ LOCALVAR const trSoundSamp vol_offset[] = { #endif }; -LOCALVAR const uint8_t SubTick_n[kNumSubTicks] = { +static const uint8_t SubTick_n[kNumSubTicks] = { 23, 23, 23, 23, 23, 23, 23, 24, 23, 23, 23, 23, 23, 23, 23, 24 }; -GLOBALPROC ASC_SubTick(int SubTick) +void ASC_SubTick(int SubTick) { uint16_t actL; #if SoundEnabled diff --git a/src/HW/SOUND/ASCEMDEV.h b/src/HW/SOUND/ASCEMDEV.h index 9a3feec..65bc133 100644 --- a/src/HW/SOUND/ASCEMDEV.h +++ b/src/HW/SOUND/ASCEMDEV.h @@ -17,7 +17,7 @@ #ifndef ASCEMDEV_H #define ASCEMDEV_H -EXPORTFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr); -EXPORTPROC ASC_SubTick(int SubTick); +extern uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern void ASC_SubTick(int SubTick); #endif diff --git a/src/HW/SOUND/SNDEMDEV.c b/src/HW/SOUND/SNDEMDEV.c index 61c77ec..80ec85e 100644 --- a/src/HW/SOUND/SNDEMDEV.c +++ b/src/HW/SOUND/SNDEMDEV.c @@ -50,11 +50,11 @@ = {approx} (x - kCenterSound) / (8 - SoundVolume) + kCenterSound; */ -LOCALVAR const uint16_t vol_mult[] = { +static const uint16_t vol_mult[] = { 8192, 9362, 10922, 13107, 16384, 21845, 32768 }; -LOCALVAR const trSoundSamp vol_offset[] = { +static const trSoundSamp vol_offset[] = { #if 3 == kLn2SoundSampSz 112, 110, 107, 103, 96, 86, 64, 0 #elif 4 == kLn2SoundSampSz @@ -64,12 +64,12 @@ LOCALVAR const trSoundSamp vol_offset[] = { #endif }; -LOCALVAR const uint16_t SubTick_offset[kNumSubTicks] = { +static const uint16_t SubTick_offset[kNumSubTicks] = { 0, 25, 50, 90, 102, 115, 138, 161, 185, 208, 231, 254, 277, 300, 323, 346 }; -LOCALVAR const uint8_t SubTick_n[kNumSubTicks] = { +static const uint8_t SubTick_n[kNumSubTicks] = { 25, 25, 40, 12, 13, 23, 23, 24, 23, 23, 23, 23, 23, 23, 23, 24 }; @@ -99,12 +99,12 @@ LOCALVAR const uint8_t SubTick_n[kNumSubTicks] = { writing offset 0 before it is read. */ -LOCALVAR uint32_t SoundInvertPhase = 0; -LOCALVAR uint16_t SoundInvertState = 0; +static uint32_t SoundInvertPhase = 0; +static uint16_t SoundInvertState = 0; -IMPORTFUNC uint16_t GetSoundInvertTime(void); +extern uint16_t GetSoundInvertTime(void); -GLOBALPROC MacSound_SubTick(int SubTick) +void MacSound_SubTick(int SubTick) { uint16_t actL; tpSoundSamp p; diff --git a/src/HW/SOUND/SNDEMDEV.h b/src/HW/SOUND/SNDEMDEV.h index 29e0a87..c421205 100644 --- a/src/HW/SOUND/SNDEMDEV.h +++ b/src/HW/SOUND/SNDEMDEV.h @@ -21,5 +21,5 @@ #endif #if SoundEnabled -EXPORTPROC MacSound_SubTick(int SubTick); +extern void MacSound_SubTick(int SubTick); #endif diff --git a/src/HW/VIA/VIA2EMDV.c b/src/HW/VIA/VIA2EMDV.c index 098c37a..87717ab 100644 --- a/src/HW/VIA/VIA2EMDV.c +++ b/src/HW/VIA/VIA2EMDV.c @@ -37,71 +37,71 @@ */ #ifdef VIA2_iA0_ChangeNtfy -IMPORTPROC VIA2_iA0_ChangeNtfy(void); +extern void VIA2_iA0_ChangeNtfy(void); #endif #ifdef VIA2_iA1_ChangeNtfy -IMPORTPROC VIA2_iA1_ChangeNtfy(void); +extern void VIA2_iA1_ChangeNtfy(void); #endif #ifdef VIA2_iA2_ChangeNtfy -IMPORTPROC VIA2_iA2_ChangeNtfy(void); +extern void VIA2_iA2_ChangeNtfy(void); #endif #ifdef VIA2_iA3_ChangeNtfy -IMPORTPROC VIA2_iA3_ChangeNtfy(void); +extern void VIA2_iA3_ChangeNtfy(void); #endif #ifdef VIA2_iA4_ChangeNtfy -IMPORTPROC VIA2_iA4_ChangeNtfy(void); +extern void VIA2_iA4_ChangeNtfy(void); #endif #ifdef VIA2_iA5_ChangeNtfy -IMPORTPROC VIA2_iA5_ChangeNtfy(void); +extern void VIA2_iA5_ChangeNtfy(void); #endif #ifdef VIA2_iA6_ChangeNtfy -IMPORTPROC VIA2_iA6_ChangeNtfy(void); +extern void VIA2_iA6_ChangeNtfy(void); #endif #ifdef VIA2_iA7_ChangeNtfy -IMPORTPROC VIA2_iA7_ChangeNtfy(void); +extern void VIA2_iA7_ChangeNtfy(void); #endif #ifdef VIA2_iB0_ChangeNtfy -IMPORTPROC VIA2_iB0_ChangeNtfy(void); +extern void VIA2_iB0_ChangeNtfy(void); #endif #ifdef VIA2_iB1_ChangeNtfy -IMPORTPROC VIA2_iB1_ChangeNtfy(void); +extern void VIA2_iB1_ChangeNtfy(void); #endif #ifdef VIA2_iB2_ChangeNtfy -IMPORTPROC VIA2_iB2_ChangeNtfy(void); +extern void VIA2_iB2_ChangeNtfy(void); #endif #ifdef VIA2_iB3_ChangeNtfy -IMPORTPROC VIA2_iB3_ChangeNtfy(void); +extern void VIA2_iB3_ChangeNtfy(void); #endif #ifdef VIA2_iB4_ChangeNtfy -IMPORTPROC VIA2_iB4_ChangeNtfy(void); +extern void VIA2_iB4_ChangeNtfy(void); #endif #ifdef VIA2_iB5_ChangeNtfy -IMPORTPROC VIA2_iB5_ChangeNtfy(void); +extern void VIA2_iB5_ChangeNtfy(void); #endif #ifdef VIA2_iB6_ChangeNtfy -IMPORTPROC VIA2_iB6_ChangeNtfy(void); +extern void VIA2_iB6_ChangeNtfy(void); #endif #ifdef VIA2_iB7_ChangeNtfy -IMPORTPROC VIA2_iB7_ChangeNtfy(void); +extern void VIA2_iB7_ChangeNtfy(void); #endif #ifdef VIA2_iCB2_ChangeNtfy -IMPORTPROC VIA2_iCB2_ChangeNtfy(void); +extern void VIA2_iCB2_ChangeNtfy(void); #endif #define Ui3rPowOf2(p) (1 << (p)) @@ -225,7 +225,7 @@ typedef struct { uint8_t ORA; /* Buffer A */ } VIA2_Ty; -LOCALVAR VIA2_Ty VIA2_D; +static VIA2_Ty VIA2_D; #define kIntCA2 0 /* One_Second */ #define kIntCA1 1 /* Vertical_Blanking */ @@ -243,7 +243,7 @@ LOCALVAR VIA2_Ty VIA2_D; about their status */ -LOCALFUNC uint8_t VIA2_Get_ORA(uint8_t Selection) +static uint8_t VIA2_Get_ORA(uint8_t Selection) { uint8_t Value = (~ VIA2_ORA_CanIn) & Selection & VIA2_ORA_FloatVal; @@ -304,7 +304,7 @@ LOCALFUNC uint8_t VIA2_Get_ORA(uint8_t Selection) about their status */ -LOCALFUNC uint8_t VIA2_Get_ORB(uint8_t Selection) +static uint8_t VIA2_Get_ORB(uint8_t Selection) { uint8_t Value = (~ VIA2_ORB_CanIn) & Selection & VIA2_ORB_FloatVal; @@ -363,7 +363,7 @@ LOCALFUNC uint8_t VIA2_Get_ORB(uint8_t Selection) (Ui3rTestBit(Selection, p) && \ ((v = (Data >> p) & 1) != x)) -LOCALPROC VIA2_Put_ORA(uint8_t Selection, uint8_t Data) +static void VIA2_Put_ORA(uint8_t Selection, uint8_t Data) { #if 0 != VIA2_ORA_CanOut uint8_t v; @@ -442,7 +442,7 @@ LOCALPROC VIA2_Put_ORA(uint8_t Selection, uint8_t Data) #endif } -LOCALPROC VIA2_Put_ORB(uint8_t Selection, uint8_t Data) +static void VIA2_Put_ORB(uint8_t Selection, uint8_t Data) { #if 0 != VIA2_ORB_CanOut uint8_t v; @@ -521,7 +521,7 @@ LOCALPROC VIA2_Put_ORB(uint8_t Selection, uint8_t Data) #endif } -LOCALPROC VIA2_SetDDR_A(uint8_t Data) +static void VIA2_SetDDR_A(uint8_t Data) { uint8_t floatbits = VIA2_D.DDR_A & ~ Data; uint8_t unfloatbits = Data & ~ VIA2_D.DDR_A; @@ -539,7 +539,7 @@ LOCALPROC VIA2_SetDDR_A(uint8_t Data) } } -LOCALPROC VIA2_SetDDR_B(uint8_t Data) +static void VIA2_SetDDR_B(uint8_t Data) { uint8_t floatbits = VIA2_D.DDR_B & ~ Data; uint8_t unfloatbits = Data & ~ VIA2_D.DDR_B; @@ -558,7 +558,7 @@ LOCALPROC VIA2_SetDDR_B(uint8_t Data) } -LOCALPROC VIA2_CheckInterruptFlag(void) +static void VIA2_CheckInterruptFlag(void) { uint8_t NewInterruptRequest = ((VIA2_D.IFR & VIA2_D.IER) != 0) ? 1 : 0; @@ -572,12 +572,12 @@ LOCALPROC VIA2_CheckInterruptFlag(void) } -LOCALVAR uint8_t VIA2_T1_Active = 0; -LOCALVAR uint8_t VIA2_T2_Active = 0; +static uint8_t VIA2_T1_Active = 0; +static uint8_t VIA2_T2_Active = 0; -LOCALVAR bool VIA2_T1IntReady = false; +static bool VIA2_T1IntReady = false; -LOCALPROC VIA2_Clear(void) +static void VIA2_Clear(void) { VIA2_D.ORA = 0; VIA2_D.DDR_A = 0; VIA2_D.ORB = 0; VIA2_D.DDR_B = 0; @@ -591,13 +591,13 @@ LOCALPROC VIA2_Clear(void) VIA2_T1IntReady = false; } -GLOBALPROC VIA2_Zap(void) +void VIA2_Zap(void) { VIA2_Clear(); VIA2_InterruptRequest = 0; } -GLOBALPROC VIA2_Reset(void) +void VIA2_Reset(void) { VIA2_SetDDR_A(0); VIA2_SetDDR_B(0); @@ -607,13 +607,13 @@ GLOBALPROC VIA2_Reset(void) VIA2_CheckInterruptFlag(); } -LOCALPROC VIA2_SetInterruptFlag(uint8_t VIA_Int) +static void VIA2_SetInterruptFlag(uint8_t VIA_Int) { VIA2_D.IFR |= ((uint8_t)1 << VIA_Int); VIA2_CheckInterruptFlag(); } -LOCALPROC VIA2_ClrInterruptFlag(uint8_t VIA_Int) +static void VIA2_ClrInterruptFlag(uint8_t VIA_Int) { VIA2_D.IFR &= ~ ((uint8_t)1 << VIA_Int); VIA2_CheckInterruptFlag(); @@ -623,7 +623,7 @@ LOCALPROC VIA2_ClrInterruptFlag(uint8_t VIA_Int) #include #endif -GLOBALPROC VIA2_ShiftInData(uint8_t v) +void VIA2_ShiftInData(uint8_t v) { /* external hardware generates 8 pulses on CB1, @@ -650,7 +650,7 @@ GLOBALPROC VIA2_ShiftInData(uint8_t v) } } -GLOBALFUNC uint8_t VIA2_ShiftOutData(void) + uint8_t VIA2_ShiftOutData(void) { /* external hardware generates 8 pulses on CB1, @@ -670,10 +670,10 @@ GLOBALFUNC uint8_t VIA2_ShiftOutData(void) #define CyclesPerViaTime (10 * ClockMult) #define CyclesScaledPerViaTime (kCycleScale * CyclesPerViaTime) -LOCALVAR bool VIA2_T1Running = true; -LOCALVAR iCountt VIA2_T1LastTime = 0; +static bool VIA2_T1Running = true; +static iCountt VIA2_T1LastTime = 0; -GLOBALPROC VIA2_DoTimer1Check(void) +void VIA2_DoTimer1Check(void) { if (VIA2_T1Running) { iCountt NewTime = GetCuriCount(); @@ -745,7 +745,7 @@ GLOBALPROC VIA2_DoTimer1Check(void) } } -LOCALPROC CheckT1IntReady(void) +static void CheckT1IntReady(void) { if (VIA2_T1Running) { bool NewT1IntReady = false; @@ -765,7 +765,7 @@ LOCALPROC CheckT1IntReady(void) } } -GLOBALFUNC uint16_t VIA2_GetT1InvertTime(void) + uint16_t VIA2_GetT1InvertTime(void) { uint16_t v; @@ -777,11 +777,11 @@ GLOBALFUNC uint16_t VIA2_GetT1InvertTime(void) return v; } -LOCALVAR bool VIA2_T2Running = true; -LOCALVAR bool VIA2_T2C_ShortTime = false; -LOCALVAR iCountt VIA2_T2LastTime = 0; +static bool VIA2_T2Running = true; +static bool VIA2_T2C_ShortTime = false; +static iCountt VIA2_T2LastTime = 0; -GLOBALPROC VIA2_DoTimer2Check(void) +void VIA2_DoTimer2Check(void) { if (VIA2_T2Running) { iCountt NewTime = GetCuriCount(); @@ -837,7 +837,7 @@ GLOBALPROC VIA2_DoTimer2Check(void) #define kIER 0x0E #define kORA 0x0F -GLOBALFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr) + uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr) { switch (addr) { case kORB : @@ -1167,7 +1167,7 @@ GLOBALFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr) return Data; } -GLOBALPROC VIA2_ExtraTimeBegin(void) +void VIA2_ExtraTimeBegin(void) { if (VIA2_T1Running) { VIA2_DoTimer1Check(); /* run up to this moment */ @@ -1179,7 +1179,7 @@ GLOBALPROC VIA2_ExtraTimeBegin(void) } } -GLOBALPROC VIA2_ExtraTimeEnd(void) +void VIA2_ExtraTimeEnd(void) { if (! VIA2_T1Running) { VIA2_T1Running = true; @@ -1196,28 +1196,28 @@ GLOBALPROC VIA2_ExtraTimeEnd(void) /* VIA Interrupt Interface */ #ifdef VIA2_iCA1_PulseNtfy -GLOBALPROC VIA2_iCA1_PulseNtfy(void) +void VIA2_iCA1_PulseNtfy(void) { VIA2_SetInterruptFlag(kIntCA1); } #endif #ifdef VIA2_iCA2_PulseNtfy -GLOBALPROC VIA2_iCA2_PulseNtfy(void) +void VIA2_iCA2_PulseNtfy(void) { VIA2_SetInterruptFlag(kIntCA2); } #endif #ifdef VIA2_iCB1_PulseNtfy -GLOBALPROC VIA2_iCB1_PulseNtfy(void) +void VIA2_iCB1_PulseNtfy(void) { VIA2_SetInterruptFlag(kIntCB1); } #endif #ifdef VIA2_iCB2_PulseNtfy -GLOBALPROC VIA2_iCB2_PulseNtfy(void) +void VIA2_iCB2_PulseNtfy(void) { VIA2_SetInterruptFlag(kIntCB2); } diff --git a/src/HW/VIA/VIA2EMDV.h b/src/HW/VIA/VIA2EMDV.h index 3683be3..3ad396a 100644 --- a/src/HW/VIA/VIA2EMDV.h +++ b/src/HW/VIA/VIA2EMDV.h @@ -17,31 +17,31 @@ #ifndef VIA2EMDV_H #define VIA2EMDV_H -EXPORTPROC VIA2_Zap(void); -EXPORTPROC VIA2_Reset(void); +extern void VIA2_Zap(void); +extern void VIA2_Reset(void); -EXPORTFUNC uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr); +extern uint32_t VIA2_Access(uint32_t Data, bool WriteMem, CPTR addr); -EXPORTPROC VIA2_ExtraTimeBegin(void); -EXPORTPROC VIA2_ExtraTimeEnd(void); +extern void VIA2_ExtraTimeBegin(void); +extern void VIA2_ExtraTimeEnd(void); #ifdef VIA2_iCA1_PulseNtfy -EXPORTPROC VIA2_iCA1_PulseNtfy(void); +extern void VIA2_iCA1_PulseNtfy(void); #endif #ifdef VIA2_iCA2_PulseNtfy -EXPORTPROC VIA2_iCA2_PulseNtfy(void); +extern void VIA2_iCA2_PulseNtfy(void); #endif #ifdef VIA2_iCB1_PulseNtfy -EXPORTPROC VIA2_iCB1_PulseNtfy(void); +extern void VIA2_iCB1_PulseNtfy(void); #endif #ifdef VIA2_iCB2_PulseNtfy -EXPORTPROC VIA2_iCB2_PulseNtfy(void); +extern void VIA2_iCB2_PulseNtfy(void); #endif -EXPORTPROC VIA2_DoTimer1Check(void); -EXPORTPROC VIA2_DoTimer2Check(void); +extern void VIA2_DoTimer1Check(void); +extern void VIA2_DoTimer2Check(void); -EXPORTFUNC uint16_t VIA2_GetT1InvertTime(void); +extern uint16_t VIA2_GetT1InvertTime(void); -EXPORTPROC VIA2_ShiftInData(uint8_t v); -EXPORTFUNC uint8_t VIA2_ShiftOutData(void); +extern void VIA2_ShiftInData(uint8_t v); +extern uint8_t VIA2_ShiftOutData(void); #endif diff --git a/src/HW/VIA/VIAEMDEV.c b/src/HW/VIA/VIAEMDEV.c index bca9b88..c28fb80 100644 --- a/src/HW/VIA/VIAEMDEV.c +++ b/src/HW/VIA/VIAEMDEV.c @@ -37,71 +37,71 @@ */ #ifdef VIA1_iA0_ChangeNtfy -IMPORTPROC VIA1_iA0_ChangeNtfy(void); +extern void VIA1_iA0_ChangeNtfy(void); #endif #ifdef VIA1_iA1_ChangeNtfy -IMPORTPROC VIA1_iA1_ChangeNtfy(void); +extern void VIA1_iA1_ChangeNtfy(void); #endif #ifdef VIA1_iA2_ChangeNtfy -IMPORTPROC VIA1_iA2_ChangeNtfy(void); +extern void VIA1_iA2_ChangeNtfy(void); #endif #ifdef VIA1_iA3_ChangeNtfy -IMPORTPROC VIA1_iA3_ChangeNtfy(void); +extern void VIA1_iA3_ChangeNtfy(void); #endif #ifdef VIA1_iA4_ChangeNtfy -IMPORTPROC VIA1_iA4_ChangeNtfy(void); +extern void VIA1_iA4_ChangeNtfy(void); #endif #ifdef VIA1_iA5_ChangeNtfy -IMPORTPROC VIA1_iA5_ChangeNtfy(void); +extern void VIA1_iA5_ChangeNtfy(void); #endif #ifdef VIA1_iA6_ChangeNtfy -IMPORTPROC VIA1_iA6_ChangeNtfy(void); +extern void VIA1_iA6_ChangeNtfy(void); #endif #ifdef VIA1_iA7_ChangeNtfy -IMPORTPROC VIA1_iA7_ChangeNtfy(void); +extern void VIA1_iA7_ChangeNtfy(void); #endif #ifdef VIA1_iB0_ChangeNtfy -IMPORTPROC VIA1_iB0_ChangeNtfy(void); +extern void VIA1_iB0_ChangeNtfy(void); #endif #ifdef VIA1_iB1_ChangeNtfy -IMPORTPROC VIA1_iB1_ChangeNtfy(void); +extern void VIA1_iB1_ChangeNtfy(void); #endif #ifdef VIA1_iB2_ChangeNtfy -IMPORTPROC VIA1_iB2_ChangeNtfy(void); +extern void VIA1_iB2_ChangeNtfy(void); #endif #ifdef VIA1_iB3_ChangeNtfy -IMPORTPROC VIA1_iB3_ChangeNtfy(void); +extern void VIA1_iB3_ChangeNtfy(void); #endif #ifdef VIA1_iB4_ChangeNtfy -IMPORTPROC VIA1_iB4_ChangeNtfy(void); +extern void VIA1_iB4_ChangeNtfy(void); #endif #ifdef VIA1_iB5_ChangeNtfy -IMPORTPROC VIA1_iB5_ChangeNtfy(void); +extern void VIA1_iB5_ChangeNtfy(void); #endif #ifdef VIA1_iB6_ChangeNtfy -IMPORTPROC VIA1_iB6_ChangeNtfy(void); +extern void VIA1_iB6_ChangeNtfy(void); #endif #ifdef VIA1_iB7_ChangeNtfy -IMPORTPROC VIA1_iB7_ChangeNtfy(void); +extern void VIA1_iB7_ChangeNtfy(void); #endif #ifdef VIA1_iCB2_ChangeNtfy -IMPORTPROC VIA1_iCB2_ChangeNtfy(void); +extern void VIA1_iCB2_ChangeNtfy(void); #endif #define Ui3rPowOf2(p) (1 << (p)) @@ -225,7 +225,7 @@ typedef struct { uint8_t ORA; /* Buffer A */ } VIA1_Ty; -LOCALVAR VIA1_Ty VIA1_D; +static VIA1_Ty VIA1_D; #define kIntCA2 0 /* One_Second */ #define kIntCA1 1 /* Vertical_Blanking */ @@ -243,7 +243,7 @@ LOCALVAR VIA1_Ty VIA1_D; about their status */ -LOCALFUNC uint8_t VIA1_Get_ORA(uint8_t Selection) +static uint8_t VIA1_Get_ORA(uint8_t Selection) { uint8_t Value = (~ VIA1_ORA_CanIn) & Selection & VIA1_ORA_FloatVal; @@ -304,7 +304,7 @@ LOCALFUNC uint8_t VIA1_Get_ORA(uint8_t Selection) about their status */ -LOCALFUNC uint8_t VIA1_Get_ORB(uint8_t Selection) +static uint8_t VIA1_Get_ORB(uint8_t Selection) { uint8_t Value = (~ VIA1_ORB_CanIn) & Selection & VIA1_ORB_FloatVal; @@ -363,7 +363,7 @@ LOCALFUNC uint8_t VIA1_Get_ORB(uint8_t Selection) (Ui3rTestBit(Selection, p) && \ ((v = (Data >> p) & 1) != x)) -LOCALPROC VIA1_Put_ORA(uint8_t Selection, uint8_t Data) +static void VIA1_Put_ORA(uint8_t Selection, uint8_t Data) { #if 0 != VIA1_ORA_CanOut uint8_t v; @@ -442,7 +442,7 @@ LOCALPROC VIA1_Put_ORA(uint8_t Selection, uint8_t Data) #endif } -LOCALPROC VIA1_Put_ORB(uint8_t Selection, uint8_t Data) +static void VIA1_Put_ORB(uint8_t Selection, uint8_t Data) { #if 0 != VIA1_ORB_CanOut uint8_t v; @@ -521,7 +521,7 @@ LOCALPROC VIA1_Put_ORB(uint8_t Selection, uint8_t Data) #endif } -LOCALPROC VIA1_SetDDR_A(uint8_t Data) +static void VIA1_SetDDR_A(uint8_t Data) { uint8_t floatbits = VIA1_D.DDR_A & ~ Data; uint8_t unfloatbits = Data & ~ VIA1_D.DDR_A; @@ -539,7 +539,7 @@ LOCALPROC VIA1_SetDDR_A(uint8_t Data) } } -LOCALPROC VIA1_SetDDR_B(uint8_t Data) +static void VIA1_SetDDR_B(uint8_t Data) { uint8_t floatbits = VIA1_D.DDR_B & ~ Data; uint8_t unfloatbits = Data & ~ VIA1_D.DDR_B; @@ -558,7 +558,7 @@ LOCALPROC VIA1_SetDDR_B(uint8_t Data) } -LOCALPROC VIA1_CheckInterruptFlag(void) +static void VIA1_CheckInterruptFlag(void) { uint8_t NewInterruptRequest = ((VIA1_D.IFR & VIA1_D.IER) != 0) ? 1 : 0; @@ -572,12 +572,12 @@ LOCALPROC VIA1_CheckInterruptFlag(void) } -LOCALVAR uint8_t VIA1_T1_Active = 0; -LOCALVAR uint8_t VIA1_T2_Active = 0; +static uint8_t VIA1_T1_Active = 0; +static uint8_t VIA1_T2_Active = 0; -LOCALVAR bool VIA1_T1IntReady = false; +static bool VIA1_T1IntReady = false; -LOCALPROC VIA1_Clear(void) +static void VIA1_Clear(void) { VIA1_D.ORA = 0; VIA1_D.DDR_A = 0; VIA1_D.ORB = 0; VIA1_D.DDR_B = 0; @@ -598,7 +598,7 @@ bool VIA1_Zap(void) return true; } -GLOBALPROC VIA1_Reset(void) +void VIA1_Reset(void) { VIA1_SetDDR_A(0); VIA1_SetDDR_B(0); @@ -608,13 +608,13 @@ GLOBALPROC VIA1_Reset(void) VIA1_CheckInterruptFlag(); } -LOCALPROC VIA1_SetInterruptFlag(uint8_t VIA_Int) +static void VIA1_SetInterruptFlag(uint8_t VIA_Int) { VIA1_D.IFR |= ((uint8_t)1 << VIA_Int); VIA1_CheckInterruptFlag(); } -LOCALPROC VIA1_ClrInterruptFlag(uint8_t VIA_Int) +static void VIA1_ClrInterruptFlag(uint8_t VIA_Int) { VIA1_D.IFR &= ~ ((uint8_t)1 << VIA_Int); VIA1_CheckInterruptFlag(); @@ -624,7 +624,7 @@ LOCALPROC VIA1_ClrInterruptFlag(uint8_t VIA_Int) #include #endif -GLOBALPROC VIA1_ShiftInData(uint8_t v) +void VIA1_ShiftInData(uint8_t v) { /* external hardware generates 8 pulses on CB1, @@ -651,7 +651,7 @@ GLOBALPROC VIA1_ShiftInData(uint8_t v) } } -GLOBALFUNC uint8_t VIA1_ShiftOutData(void) + uint8_t VIA1_ShiftOutData(void) { /* external hardware generates 8 pulses on CB1, @@ -671,10 +671,10 @@ GLOBALFUNC uint8_t VIA1_ShiftOutData(void) #define CyclesPerViaTime (10 * ClockMult) #define CyclesScaledPerViaTime (kCycleScale * CyclesPerViaTime) -LOCALVAR bool VIA1_T1Running = true; -LOCALVAR iCountt VIA1_T1LastTime = 0; +static bool VIA1_T1Running = true; +static iCountt VIA1_T1LastTime = 0; -GLOBALPROC VIA1_DoTimer1Check(void) +void VIA1_DoTimer1Check(void) { if (VIA1_T1Running) { iCountt NewTime = GetCuriCount(); @@ -746,7 +746,7 @@ GLOBALPROC VIA1_DoTimer1Check(void) } } -LOCALPROC CheckT1IntReady(void) +static void CheckT1IntReady(void) { if (VIA1_T1Running) { bool NewT1IntReady = false; @@ -766,7 +766,7 @@ LOCALPROC CheckT1IntReady(void) } } -GLOBALFUNC uint16_t VIA1_GetT1InvertTime(void) + uint16_t VIA1_GetT1InvertTime(void) { uint16_t v; @@ -778,11 +778,11 @@ GLOBALFUNC uint16_t VIA1_GetT1InvertTime(void) return v; } -LOCALVAR bool VIA1_T2Running = true; -LOCALVAR bool VIA1_T2C_ShortTime = false; -LOCALVAR iCountt VIA1_T2LastTime = 0; +static bool VIA1_T2Running = true; +static bool VIA1_T2C_ShortTime = false; +static iCountt VIA1_T2LastTime = 0; -GLOBALPROC VIA1_DoTimer2Check(void) +void VIA1_DoTimer2Check(void) { if (VIA1_T2Running) { iCountt NewTime = GetCuriCount(); @@ -838,7 +838,7 @@ GLOBALPROC VIA1_DoTimer2Check(void) #define kIER 0x0E #define kORA 0x0F -GLOBALFUNC uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr) + uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr) { switch (addr) { case kORB : @@ -1168,7 +1168,7 @@ GLOBALFUNC uint32_t VIA1_Access(uint32_t Data, bool WriteMem, CPTR addr) return Data; } -GLOBALPROC VIA1_ExtraTimeBegin(void) +void VIA1_ExtraTimeBegin(void) { if (VIA1_T1Running) { VIA1_DoTimer1Check(); /* run up to this moment */ @@ -1180,7 +1180,7 @@ GLOBALPROC VIA1_ExtraTimeBegin(void) } } -GLOBALPROC VIA1_ExtraTimeEnd(void) +void VIA1_ExtraTimeEnd(void) { if (! VIA1_T1Running) { VIA1_T1Running = true; @@ -1197,28 +1197,28 @@ GLOBALPROC VIA1_ExtraTimeEnd(void) /* VIA Interrupt Interface */ #ifdef VIA1_iCA1_PulseNtfy -GLOBALPROC VIA1_iCA1_PulseNtfy(void) +void VIA1_iCA1_PulseNtfy(void) { VIA1_SetInterruptFlag(kIntCA1); } #endif #ifdef VIA1_iCA2_PulseNtfy -GLOBALPROC VIA1_iCA2_PulseNtfy(void) +void VIA1_iCA2_PulseNtfy(void) { VIA1_SetInterruptFlag(kIntCA2); } #endif #ifdef VIA1_iCB1_PulseNtfy -GLOBALPROC VIA1_iCB1_PulseNtfy(void) +void VIA1_iCB1_PulseNtfy(void) { VIA1_SetInterruptFlag(kIntCB1); } #endif #ifdef VIA1_iCB2_PulseNtfy -GLOBALPROC VIA1_iCB2_PulseNtfy(void) +void VIA1_iCB2_PulseNtfy(void) { VIA1_SetInterruptFlag(kIntCB2); } diff --git a/src/HW/VIDCARD/VIDEMDEV.c b/src/HW/VIDCARD/VIDEMDEV.c index f559d58..9650046 100644 --- a/src/HW/VIDCARD/VIDEMDEV.c +++ b/src/HW/VIDCARD/VIDEMDEV.c @@ -42,7 +42,7 @@ #define VID_dolog (dbglog_HAVE && 0) -LOCALVAR const uint8_t VidDrvr_contents[] = { +static const uint8_t VidDrvr_contents[] = { 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xB6, 0x15, 0x2E, 0x44, 0x69, 0x73, 0x70, @@ -80,7 +80,7 @@ LOCALVAR const uint8_t VidDrvr_contents[] = { 0x08, 0xFC, 0x4E, 0xD0 }; -LOCALPROC ChecksumSlotROM(void) +static void ChecksumSlotROM(void) { /* Calculate CRC */ /* assuming check sum field initialized to zero */ @@ -94,45 +94,45 @@ LOCALPROC ChecksumSlotROM(void) do_put_mem_long(p - 12, crc); } -LOCALVAR uint8_t * pPatch; +static uint8_t * pPatch; -LOCALPROC PatchAByte(uint8_t v) +static void PatchAByte(uint8_t v) { *pPatch++ = v; } -LOCALPROC PatchAWord(uint16_t v) +static void PatchAWord(uint16_t v) { PatchAByte(v >> 8); PatchAByte(v & 0x00FF); } -LOCALPROC PatchALong(uint32_t v) +static void PatchALong(uint32_t v) { PatchAWord(v >> 16); PatchAWord(v & 0x0000FFFF); } #if 0 -LOCALPROC PatchAOSLstEntry0(uint8_t Id, uint32_t Offset) +static void PatchAOSLstEntry0(uint8_t Id, uint32_t Offset) { PatchALong((Id << 24) | (Offset & 0x00FFFFFF)); } #endif -LOCALPROC PatchAOSLstEntry(uint8_t Id, uint8_t * Offset) +static void PatchAOSLstEntry(uint8_t Id, uint8_t * Offset) { PatchALong((Id << 24) | ((Offset - pPatch) & 0x00FFFFFF)); } -LOCALFUNC uint8_t * ReservePatchOSLstEntry(void) +static uint8_t * ReservePatchOSLstEntry(void) { uint8_t * v = pPatch; pPatch += 4; return v; } -LOCALPROC PatchAReservedOSLstEntry(uint8_t * p, uint8_t Id) +static void PatchAReservedOSLstEntry(uint8_t * p, uint8_t Id) { uint8_t * pPatchSave = pPatch; pPatch = p; @@ -140,17 +140,17 @@ LOCALPROC PatchAReservedOSLstEntry(uint8_t * p, uint8_t Id) pPatch = pPatchSave; } -LOCALPROC PatchADatLstEntry(uint8_t Id, uint32_t Data) +static void PatchADatLstEntry(uint8_t Id, uint32_t Data) { PatchALong((Id << 24) | (Data & 0x00FFFFFF)); } -LOCALPROC PatchAnEndOfLst(void) +static void PatchAnEndOfLst(void) { PatchADatLstEntry(0xFF /* endOfList */, 0x00000000); } -GLOBALFUNC bool Vid_Init(void) + bool Vid_Init(void) { int i; uint32_t UsedSoFar; @@ -413,9 +413,9 @@ GLOBALFUNC bool Vid_Init(void) return true; } -IMPORTPROC Vid_VBLinterrupt_PulseNotify(void); +extern void Vid_VBLinterrupt_PulseNotify(void); -GLOBALPROC Vid_Update(void) +void Vid_Update(void) { if (! Vid_VBLintunenbl) { Vid_VBLinterrupt = 0; @@ -423,12 +423,12 @@ GLOBALPROC Vid_Update(void) } } -LOCALFUNC uint16_t Vid_GetMode(void) +static uint16_t Vid_GetMode(void) { return (UseColorMode && (vMacScreenDepth != 0)) ? 129 : 128; } -LOCALFUNC MacErr_t Vid_SetMode(uint16_t v) +static MacErr_t Vid_SetMode(uint16_t v) { if ( (vMacScreenDepth == 0) @@ -441,7 +441,7 @@ LOCALFUNC MacErr_t Vid_SetMode(uint16_t v) return mnvm_noErr; } -GLOBALFUNC uint16_t Vid_Reset(void) + uint16_t Vid_Reset(void) { if (0 != vMacScreenDepth) { UseColorMode = false; @@ -473,9 +473,9 @@ GLOBALFUNC uint16_t Vid_Reset(void) #define VidBaseAddr 0xF9900000 /* appears to be completely ignored */ -LOCALVAR bool UseGrayTones = false; +static bool UseGrayTones = false; -LOCALPROC FillScreenWithGrayPattern(void) +static void FillScreenWithGrayPattern(void) { int i; int j; @@ -516,7 +516,7 @@ LOCALPROC FillScreenWithGrayPattern(void) } } -GLOBALPROC ExtnVideo_Access(CPTR p) +void ExtnVideo_Access(CPTR p) { MacErr_t result = mnvm_controlErr; diff --git a/src/HW/VIDCARD/VIDEMDEV.h b/src/HW/VIDCARD/VIDEMDEV.h index a64bfb5..3eeea6d 100644 --- a/src/HW/VIDCARD/VIDEMDEV.h +++ b/src/HW/VIDCARD/VIDEMDEV.h @@ -17,10 +17,10 @@ #ifndef VIDEMDEV_H #define VIDEMDEV_H -EXPORTFUNC bool Vid_Init(void); -EXPORTFUNC uint16_t Vid_Reset(void); -EXPORTPROC Vid_Update(void); +extern bool Vid_Init(void); +extern uint16_t Vid_Reset(void); +extern void Vid_Update(void); -EXPORTPROC ExtnVideo_Access(CPTR p); +extern void ExtnVideo_Access(CPTR p); #endif diff --git a/src/PATCHES/HPMCHACK.h b/src/PATCHES/HPMCHACK.h index 85006e5..5793af1 100644 --- a/src/PATCHES/HPMCHACK.h +++ b/src/PATCHES/HPMCHACK.h @@ -86,7 +86,7 @@ unsigned char * HMAC_BITS[] = { #define HappyMacBase 0x1948 - 0x18 #endif -LOCALPROC PatchHappyMac(AHM_t ahm) +static void PatchHappyMac(AHM_t ahm) { uint8_t *dst = ROM + HappyMacBase + 0x18; uint8_t *src = HMAC_BITS[ahm]; diff --git a/src/PATCHES/ROMEMDEV.c b/src/PATCHES/ROMEMDEV.c index 126ec65..8cbb64a 100644 --- a/src/PATCHES/ROMEMDEV.c +++ b/src/PATCHES/ROMEMDEV.c @@ -38,7 +38,7 @@ #endif #ifdef ln2mtb -LOCALPROC ROMscrambleForMTB(void) +static void ROMscrambleForMTB(void) { int32_t j; uint8_t * p = ROM; @@ -60,7 +60,7 @@ LOCALPROC ROMscrambleForMTB(void) } #endif -GLOBALFUNC bool ROM_Init(void) + bool ROM_Init(void) { #if DisableRomCheck diff --git a/src/PATCHES/ROMEMDEV.h b/src/PATCHES/ROMEMDEV.h index 1766030..5c05501 100644 --- a/src/PATCHES/ROMEMDEV.h +++ b/src/PATCHES/ROMEMDEV.h @@ -28,7 +28,7 @@ #define kVidMem_Base 0x00540000 -EXPORTFUNC bool ROM_Init(void); +extern bool ROM_Init(void); #endif diff --git a/src/PROGMAIN.c b/src/PROGMAIN.c index c4b8daf..db01b88 100644 --- a/src/PROGMAIN.c +++ b/src/PROGMAIN.c @@ -262,7 +262,7 @@ const DevMethods_t DEVICES[] = { }, }; -LOCALPROC EmulatedHardwareZap(void) +static void EmulatedHardwareZap(void) { int i; for ( i = 0; i < ARRAY_SIZE(DEVICES); i++ ) { @@ -270,13 +270,13 @@ LOCALPROC EmulatedHardwareZap(void) } } -LOCALPROC DoMacReset(void) +static void DoMacReset(void) { Sony_EjectAllDisks(); EmulatedHardwareZap(); } -LOCALPROC InterruptReset_Update(void) +static void InterruptReset_Update(void) { SetInterruptButton(false); // don't keep held over 1/60 sec @@ -290,7 +290,7 @@ LOCALPROC InterruptReset_Update(void) } } -LOCALPROC SubTickNotify(int SubTick) +static void SubTickNotify(int SubTick) { int i; for ( i = 0; i < ARRAY_SIZE(DEVICES); i++ ) { @@ -301,9 +301,9 @@ LOCALPROC SubTickNotify(int SubTick) #define CyclesScaledPerTick (130240UL * ClockMult * kCycleScale) #define CyclesScaledPerSubTick (CyclesScaledPerTick / kNumSubTicks) -LOCALVAR uint16_t SubTickCounter; +static uint16_t SubTickCounter; -LOCALPROC SubTickTaskDo(void) +static void SubTickTaskDo(void) { SubTickNotify(SubTickCounter); ++SubTickCounter; @@ -318,18 +318,18 @@ LOCALPROC SubTickTaskDo(void) } } -LOCALPROC SubTickTaskStart(void) +static void SubTickTaskStart(void) { SubTickCounter = 0; ICT_add(kICT_SubTick, CyclesScaledPerSubTick); } -LOCALPROC SubTickTaskEnd(void) +static void SubTickTaskEnd(void) { SubTickNotify(kNumSubTicks - 1); } -LOCALPROC SixtiethSecondNotify(void) +static void SixtiethSecondNotify(void) { /*int i; // Begin new frame @@ -357,7 +357,7 @@ LOCALPROC SixtiethSecondNotify(void) SubTickTaskStart(); } -LOCALPROC SixtiethEndNotify(void) +static void SixtiethEndNotify(void) { int i; SubTickTaskEnd(); @@ -367,7 +367,7 @@ LOCALPROC SixtiethEndNotify(void) // End frame } -LOCALPROC ExtraTimeBeginNotify(void) +static void ExtraTimeBeginNotify(void) { int i; for ( i = 0; i < ARRAY_SIZE(DEVICES); i++ ) { @@ -375,7 +375,7 @@ LOCALPROC ExtraTimeBeginNotify(void) } } -LOCALPROC ExtraTimeEndNotify(void) +static void ExtraTimeEndNotify(void) { int i; for ( i = 0; i < ARRAY_SIZE(DEVICES); i++ ) { @@ -383,7 +383,7 @@ LOCALPROC ExtraTimeEndNotify(void) } } -GLOBALPROC EmulationReserveAlloc(void) +void EmulationReserveAlloc(void) { ReserveAllocOneBlock(&RAM, kRAM_Size + RAMSafetyMarginFudge, 5, false); #if EmVidCard @@ -397,7 +397,7 @@ GLOBALPROC EmulationReserveAlloc(void) #endif } -LOCALFUNC bool InitEmulation(void) +static bool InitEmulation(void) { int i; for ( i = 0; i < ARRAY_SIZE(DEVICES); i++ ) { @@ -410,7 +410,7 @@ LOCALFUNC bool InitEmulation(void) return true; } -LOCALPROC ICT_DoTask(int taskid) +static void ICT_DoTask(int taskid) { switch (taskid) { case kICT_SubTick: @@ -454,7 +454,7 @@ LOCALPROC ICT_DoTask(int taskid) } } -LOCALPROC ICT_DoCurrentTasks(void) +static void ICT_DoCurrentTasks(void) { int i; uimr m; @@ -475,7 +475,7 @@ LOCALPROC ICT_DoCurrentTasks(void) } } -LOCALFUNC uint32_t ICT_DoGetNext(uint32_t maxn) +static uint32_t ICT_DoGetNext(uint32_t maxn) { int i; uimr m; @@ -490,7 +490,7 @@ LOCALFUNC uint32_t ICT_DoGetNext(uint32_t maxn) return v; } -LOCALPROC m68k_go_nCycles_1(uint32_t n) +static void m68k_go_nCycles_1(uint32_t n) { uint32_t n2; uint32_t StopiCount = NextiCount + n; @@ -503,9 +503,9 @@ LOCALPROC m68k_go_nCycles_1(uint32_t n) } while (n != 0); } -LOCALVAR uint32_t ExtraSubTicksToDo = 0; +static uint32_t ExtraSubTicksToDo = 0; -LOCALPROC DoEmulateOneTick(void) +static void DoEmulateOneTick(void) { // AutoSlow uint32_t NewQuietTime = QuietTime + 1; @@ -537,7 +537,7 @@ LOCALPROC DoEmulateOneTick(void) } } -LOCALFUNC bool MoreSubTicksToDo(void) +static bool MoreSubTicksToDo(void) { bool v = false; @@ -557,7 +557,7 @@ LOCALFUNC bool MoreSubTicksToDo(void) periodically calls ExtraTimeNotOver and stops when this returns false (or it is finished with emulating the extra time). */ -LOCALPROC DoEmulateExtraTime(void) +static void DoEmulateExtraTime(void) { if (MoreSubTicksToDo()) { ExtraTimeBeginNotify(); @@ -579,7 +579,7 @@ LOCALPROC DoEmulateExtraTime(void) The number of ticks that have been emulated so far. That is, the number of times "DoEmulateOneTick" has been called. */ -LOCALVAR uint32_t CurEmulatedTime = 0; +static uint32_t CurEmulatedTime = 0; /* The general idea is to call DoEmulateOneTick once per tick. @@ -593,7 +593,7 @@ LOCALVAR uint32_t CurEmulatedTime = 0; determined at the beginning, rather than just calling DoEmulateOneTick until CurEmulatedTime >= TrueEmulatedTime. */ -LOCALPROC RunEmulatedTicksToTrueTime(void) +static void RunEmulatedTicksToTrueTime(void) { int8_t lag = OnTrueTime - CurEmulatedTime; @@ -623,7 +623,7 @@ LOCALPROC RunEmulatedTicksToTrueTime(void) } } -LOCALPROC MainEventLoop(void) +static void MainEventLoop(void) { while (true) { WaitForNextTick(); @@ -633,7 +633,7 @@ LOCALPROC MainEventLoop(void) } } -GLOBALPROC ProgramMain(void) +void ProgramMain(void) { if (InitEmulation() == false) {return;} MainEventLoop(); diff --git a/src/PROGMAIN.h b/src/PROGMAIN.h index fe331f2..1fc6f4b 100644 --- a/src/PROGMAIN.h +++ b/src/PROGMAIN.h @@ -18,7 +18,7 @@ #ifndef PROGMAIN_H #define PROGMAIN_H -EXPORTPROC EmulationReserveAlloc(void); -EXPORTPROC ProgramMain(void); +extern void EmulationReserveAlloc(void); +extern void ProgramMain(void); #endif \ No newline at end of file diff --git a/src/SYSDEPNS.h b/src/SYSDEPNS.h index 5a1aed8..21b3985 100644 --- a/src/SYSDEPNS.h +++ b/src/SYSDEPNS.h @@ -41,10 +41,6 @@ typedef int32_t simr; /* pascal string, single byte characters */ #define ps3p uint8_t * -#ifndef MayInline -#define MayInline -#endif - #ifndef reg_call #define reg_call #endif @@ -53,44 +49,10 @@ typedef int32_t simr; #define osglu_call #endif -#define LOCALVAR static -#ifdef AllFiles -#define GLOBALVAR LOCALVAR -#define EXPORTVAR(t, v) -#else -#define GLOBALVAR -#define EXPORTVAR(t, v) extern t v; -#endif - -#define LOCALFUNC static -#define FORWARDFUNC LOCALFUNC -#ifdef AllFiles -#define GLOBALFUNC LOCALFUNC -#define EXPORTFUNC LOCALFUNC -#else -#define GLOBALFUNC -#define EXPORTFUNC extern -#endif -#define IMPORTFUNC EXPORTFUNC -#define TYPEDEFFUNC typedef - -#define LOCALPROC LOCALFUNC void -#define GLOBALPROC GLOBALFUNC void -#define EXPORTPROC EXPORTFUNC void -#define IMPORTPROC IMPORTFUNC void -#define FORWARDPROC FORWARDFUNC void -#define TYPEDEFPROC TYPEDEFFUNC void - -#define LOCALINLINEFUNC static MayInline -#define LOCALINLINEPROC LOCALINLINEFUNC void - -#define LOCALFUNCUSEDONCE LOCALINLINEFUNC -#define LOCALPROCUSEDONCE LOCALINLINEPROC - -#define GLOBALOSGLUFUNC GLOBALFUNC osglu_call -#define EXPORTOSGLUFUNC EXPORTFUNC osglu_call -#define GLOBALOSGLUPROC GLOBALFUNC osglu_call void -#define EXPORTOSGLUPROC EXPORTFUNC osglu_call void +#define GLOBALOSGLUFUNC osglu_call +#define EXPORTOSGLUFUNC extern osglu_call +#define GLOBALOSGLUPROC osglu_call void +#define EXPORTOSGLUPROC extern osglu_call void /* For functions in operating system glue that are called by rest of program. diff --git a/src/UI/COMOSGLU.c b/src/UI/COMOSGLU.c index 81b9dda..996960b 100644 --- a/src/UI/COMOSGLU.c +++ b/src/UI/COMOSGLU.c @@ -26,54 +26,54 @@ #include "COMOSGLU.h" #include "HW/SCREEN/SCRNEMDV.h" -GLOBALVAR uint32_t vSonyWritableMask = 0; -GLOBALVAR uint32_t vSonyInsertedMask = 0; + uint32_t vSonyWritableMask = 0; + uint32_t vSonyInsertedMask = 0; #if IncludeSonyRawMode -GLOBALVAR bool vSonyRawMode = false; + bool vSonyRawMode = false; #endif #if IncludeSonyNew -GLOBALVAR bool vSonyNewDiskWanted = false; -GLOBALVAR uint32_t vSonyNewDiskSize; + bool vSonyNewDiskWanted = false; + uint32_t vSonyNewDiskSize; #endif #if IncludeSonyNameNew -GLOBALVAR tPbuf vSonyNewDiskName = NotAPbuf; + tPbuf vSonyNewDiskName = NotAPbuf; #endif -GLOBALVAR uint32_t CurMacDateInSeconds = 0; + uint32_t CurMacDateInSeconds = 0; #if AutoLocation -GLOBALVAR uint32_t CurMacLatitude = 0; -GLOBALVAR uint32_t CurMacLongitude = 0; + uint32_t CurMacLatitude = 0; + uint32_t CurMacLongitude = 0; #endif #if AutoTimeZone -GLOBALVAR uint32_t CurMacDelta = 0; + uint32_t CurMacDelta = 0; #endif -GLOBALVAR bool UseColorMode = false; -GLOBALVAR bool ColorModeWorks = false; + bool UseColorMode = false; + bool ColorModeWorks = false; -GLOBALVAR bool ColorMappingChanged = false; + bool ColorMappingChanged = false; -GLOBALVAR uint16_t CLUT_reds[CLUT_size]; -GLOBALVAR uint16_t CLUT_greens[CLUT_size]; -GLOBALVAR uint16_t CLUT_blues[CLUT_size]; + uint16_t CLUT_reds[CLUT_size]; + uint16_t CLUT_greens[CLUT_size]; + uint16_t CLUT_blues[CLUT_size]; -GLOBALVAR bool RequestMacOff = false; -GLOBALVAR bool ForceMacOff = false; -GLOBALVAR bool WantMacInterrupt = false; -GLOBALVAR bool WantMacReset = false; + bool RequestMacOff = false; + bool ForceMacOff = false; + bool WantMacInterrupt = false; + bool WantMacReset = false; -GLOBALVAR uint8_t SpeedValue = WantInitSpeedValue; -GLOBALVAR uint16_t CurMouseV = 0; -GLOBALVAR uint16_t CurMouseH = 0; + uint8_t SpeedValue = WantInitSpeedValue; + uint16_t CurMouseV = 0; + uint16_t CurMouseH = 0; -GLOBALVAR uint32_t QuietTime = 0; -GLOBALVAR uint32_t QuietSubTicks = 0; + uint32_t QuietTime = 0; + uint32_t QuietSubTicks = 0; #if IncludePbufs -GLOBALFUNC bool FirstFreePbuf(tPbuf *r) + bool FirstFreePbuf(tPbuf *r) { tPbuf i; @@ -86,13 +86,13 @@ GLOBALFUNC bool FirstFreePbuf(tPbuf *r) return false; } -GLOBALPROC PbufNewNotify(tPbuf Pbuf_No, uint32_t count) +void PbufNewNotify(tPbuf Pbuf_No, uint32_t count) { PbufSize[Pbuf_No] = count; PbufAllocatedMask |= ((uint32_t)1 << Pbuf_No); } -GLOBALPROC PbufDisposeNotify(tPbuf Pbuf_No) +void PbufDisposeNotify(tPbuf Pbuf_No) { PbufAllocatedMask &= ~ ((uint32_t)1 << Pbuf_No); } @@ -124,7 +124,7 @@ GLOBALOSGLUFUNC MacErr_t PbufGetSize(tPbuf Pbuf_No, uint32_t *Count) } #endif -GLOBALFUNC bool FirstFreeDisk(tDrive *Drive_No) + bool FirstFreeDisk(tDrive *Drive_No) { tDrive i; @@ -149,7 +149,7 @@ GLOBALOSGLUPROC DiskRevokeWritable(tDrive Drive_No) vSonyWritableMask &= ~ ((uint32_t)1 << Drive_No); } -GLOBALPROC DiskInsertNotify(tDrive Drive_No, bool locked) +void DiskInsertNotify(tDrive Drive_No, bool locked) { vSonyInsertedMask |= ((uint32_t)1 << Drive_No); if (! locked) { @@ -159,23 +159,23 @@ GLOBALPROC DiskInsertNotify(tDrive Drive_No, bool locked) QuietEnds(); } -GLOBALPROC DiskEjectedNotify(tDrive Drive_No) +void DiskEjectedNotify(tDrive Drive_No) { vSonyWritableMask &= ~ ((uint32_t)1 << Drive_No); vSonyInsertedMask &= ~ ((uint32_t)1 << Drive_No); } -GLOBALVAR uint8_t * screencomparebuff = nullpr; + uint8_t * screencomparebuff = nullpr; #if WantColorTransValid -LOCALVAR bool ColorTransValid = false; +static bool ColorTransValid = false; #endif -GLOBALVAR bool EmVideoDisable = false; -GLOBALVAR int8_t EmLagTime = 0; -GLOBALVAR uint32_t OnTrueTime = 0; + bool EmVideoDisable = false; + int8_t EmLagTime = 0; + uint32_t OnTrueTime = 0; -GLOBALPROC ScreenClearChanges(void) +void ScreenClearChanges(void) { ScreenChangedTop = vMacScreenHeight; ScreenChangedBottom = 0; @@ -183,7 +183,7 @@ GLOBALPROC ScreenClearChanges(void) ScreenChangedRight = 0; } -GLOBALPROC ScreenChangedAll(void) +void ScreenChangedAll(void) { ScreenChangedTop = 0; ScreenChangedBottom = vMacScreenHeight; @@ -192,13 +192,13 @@ GLOBALPROC ScreenChangedAll(void) } #if MayFullScreen -GLOBALVAR uint16_t ViewHSize; -GLOBALVAR uint16_t ViewVSize; -GLOBALVAR uint16_t ViewHStart = 0; -GLOBALVAR uint16_t ViewVStart = 0; + uint16_t ViewHSize; + uint16_t ViewVSize; + uint16_t ViewHStart = 0; + uint16_t ViewVStart = 0; #endif -LOCALPROC SetLongs(uint32_t *p, long n) +static void SetLongs(uint32_t *p, long n) { long i; @@ -207,8 +207,8 @@ LOCALPROC SetLongs(uint32_t *p, long n) } } -GLOBALVAR uimr ReserveAllocOffset; -GLOBALVAR uint8_t * ReserveAllocBigBlock = nullpr; + uimr ReserveAllocOffset; + uint8_t * ReserveAllocBigBlock = nullpr; GLOBALOSGLUPROC ReserveAllocOneBlock(uint8_t * *p, uimr n, uint8_t align, bool FillOnes) @@ -229,16 +229,16 @@ GLOBALOSGLUPROC ReserveAllocOneBlock(uint8_t * *p, uimr n, #if dbglog_HAVE -LOCALVAR uimr dbglog_bufpos = 0; -LOCALVAR char *dbglog_bufp = nullpr; +static uimr dbglog_bufpos = 0; +static char *dbglog_bufp = nullpr; -LOCALPROC dbglog_ReserveAlloc(void) +static void dbglog_ReserveAlloc(void) { ReserveAllocOneBlock((uint8_t * *)&dbglog_bufp, dbglog_bufsz, 5, false); } -LOCALPROC dbglog_close(void) +static void dbglog_close(void) { uimr n = ModPow2(dbglog_bufpos, dbglog_buflnsz); if (n != 0) { @@ -248,7 +248,7 @@ LOCALPROC dbglog_close(void) dbglog_close0(); } -LOCALPROC dbglog_write(char *p, uimr L) +static void dbglog_write(char *p, uimr L) { uimr r; uimr bufposmod; @@ -272,7 +272,7 @@ label_retry: dbglog_bufpos = newbufpos; } -LOCALFUNC uimr CStrLength(char *s) +static uimr CStrLength(char *s) { char *p = s; @@ -346,7 +346,7 @@ GLOBALOSGLUPROC dbglog_writeMacChar(uint8_t x) dbglog_write(&s, 1); } -LOCALPROC dbglog_writeSpace(void) +static void dbglog_writeSpace(void) { dbglog_writeCStr(" "); } @@ -369,9 +369,9 @@ GLOBALOSGLUPROC dbglog_writelnNum(char *s, simr v) /* my event queue */ -LOCALVAR EvtQEl EvtQA[EvtQSz]; -LOCALVAR uint16_t EvtQIn = 0; -LOCALVAR uint16_t EvtQOut = 0; +static EvtQEl EvtQA[EvtQSz]; +static uint16_t EvtQIn = 0; +static uint16_t EvtQOut = 0; GLOBALOSGLUFUNC EvtQEl * EvtQOutP(void) { @@ -387,10 +387,10 @@ GLOBALOSGLUPROC EvtQOutDone(void) ++EvtQOut; } -GLOBALVAR bool EvtQNeedRecover = false; + bool EvtQNeedRecover = false; /* events lost because of full queue */ -LOCALFUNC EvtQEl * EvtQElPreviousIn(void) +static EvtQEl * EvtQElPreviousIn(void) { EvtQEl *p = NULL; if (EvtQIn - EvtQOut != 0) { @@ -400,7 +400,7 @@ LOCALFUNC EvtQEl * EvtQElPreviousIn(void) return p; } -LOCALFUNC EvtQEl * EvtQElAlloc(void) +static EvtQEl * EvtQElAlloc(void) { EvtQEl *p = NULL; if (EvtQIn - EvtQOut >= EvtQSz) { @@ -414,9 +414,9 @@ LOCALFUNC EvtQEl * EvtQElAlloc(void) return p; } -LOCALVAR uint32_t theKeys[4]; +static uint32_t theKeys[4]; -GLOBALPROC Keyboard_UpdateKeyMap(uint8_t key, bool down) +void Keyboard_UpdateKeyMap(uint8_t key, bool down) { uint8_t k = key & 127; /* just for safety */ uint8_t bit = 1 << (k & 7); @@ -441,9 +441,9 @@ GLOBALPROC Keyboard_UpdateKeyMap(uint8_t key, bool down) } } -LOCALVAR bool MouseButtonState = false; +static bool MouseButtonState = false; -GLOBALPROC MouseButtonSet(bool down) +void MouseButtonSet(bool down) { if (MouseButtonState != down) { EvtQEl *p = EvtQElAlloc(); @@ -458,10 +458,10 @@ GLOBALPROC MouseButtonSet(bool down) } } -LOCALVAR uint16_t MousePosCurV = 0; -LOCALVAR uint16_t MousePosCurH = 0; +static uint16_t MousePosCurV = 0; +static uint16_t MousePosCurH = 0; -GLOBALPROC MousePositionSet(uint16_t h, uint16_t v) +void MousePositionSet(uint16_t h, uint16_t v) { if ((h != MousePosCurH) || (v != MousePosCurV)) { EvtQEl *p = EvtQElPreviousIn(); @@ -481,7 +481,7 @@ GLOBALPROC MousePositionSet(uint16_t h, uint16_t v) } } -GLOBALPROC InitKeyCodes(void) +void InitKeyCodes(void) { theKeys[0] = 0; theKeys[1] = 0; @@ -489,7 +489,7 @@ GLOBALPROC InitKeyCodes(void) theKeys[3] = 0; } -GLOBALPROC DisconnectKeyCodes(uint32_t KeepMask) +void DisconnectKeyCodes(uint32_t KeepMask) { /* Called when may miss key ups, @@ -528,7 +528,7 @@ GLOBALPROC DisconnectKeyCodes(uint32_t KeepMask) } } -GLOBALPROC EvtQTryRecoverFromFull(void) +void EvtQTryRecoverFromFull(void) { MouseButtonSet(false); DisconnectKeyCodes(0); @@ -536,14 +536,14 @@ GLOBALPROC EvtQTryRecoverFromFull(void) /* MacMsg */ -GLOBALVAR char *SavedBriefMsg = nullpr; -GLOBALVAR char *SavedLongMsg = nullpr; + char *SavedBriefMsg = nullpr; + char *SavedLongMsg = nullpr; #if WantAbnormalReports -GLOBALVAR uint16_t SavedIDMsg = 0; + uint16_t SavedIDMsg = 0; #endif -GLOBALVAR bool SavedFatalMsg = false; + bool SavedFatalMsg = false; -GLOBALPROC MacMsg(char *briefMsg, char *longMsg, bool fatal) +void MacMsg(char *briefMsg, char *longMsg, bool fatal) { if (nullpr != SavedBriefMsg) { /* diff --git a/src/UI/COMOSGLU.h b/src/UI/COMOSGLU.h index 1bb334c..13da6b8 100644 --- a/src/UI/COMOSGLU.h +++ b/src/UI/COMOSGLU.h @@ -27,49 +27,49 @@ #include "MYOSGLUE.h" #define EnableRecreateW 1 -extern GLOBALVAR uint32_t vSonyWritableMask; -extern GLOBALVAR uint32_t vSonyInsertedMask; +extern uint32_t vSonyWritableMask; +extern uint32_t vSonyInsertedMask; #if IncludeSonyRawMode -extern GLOBALVAR bool vSonyRawMode; +extern bool vSonyRawMode; #endif #if IncludeSonyNew -extern GLOBALVAR bool vSonyNewDiskWanted; -extern GLOBALVAR uint32_t vSonyNewDiskSize; +extern bool vSonyNewDiskWanted; +extern uint32_t vSonyNewDiskSize; #endif #if IncludeSonyNameNew -extern GLOBALVAR tPbuf vSonyNewDiskName; +extern tPbuf vSonyNewDiskName; #endif -extern GLOBALVAR uint32_t CurMacDateInSeconds; +extern uint32_t CurMacDateInSeconds; #if AutoLocation -extern GLOBALVAR uint32_t CurMacLatitude; -extern GLOBALVAR uint32_t CurMacLongitude; +extern uint32_t CurMacLatitude; +extern uint32_t CurMacLongitude; #endif #if AutoTimeZone -extern GLOBALVAR uint32_t CurMacDelta; +extern uint32_t CurMacDelta; #endif -extern GLOBALVAR bool UseColorMode; -extern GLOBALVAR bool ColorModeWorks; -extern GLOBALVAR bool ColorMappingChanged; +extern bool UseColorMode; +extern bool ColorModeWorks; +extern bool ColorMappingChanged; -extern GLOBALVAR uint16_t CLUT_reds[CLUT_size]; -extern GLOBALVAR uint16_t CLUT_greens[CLUT_size]; -extern GLOBALVAR uint16_t CLUT_blues[CLUT_size]; +extern uint16_t CLUT_reds[CLUT_size]; +extern uint16_t CLUT_greens[CLUT_size]; +extern uint16_t CLUT_blues[CLUT_size]; -extern GLOBALVAR bool RequestMacOff; -extern GLOBALVAR bool ForceMacOff; -extern GLOBALVAR bool WantMacInterrupt; -extern GLOBALVAR bool WantMacReset; -extern GLOBALVAR uint8_t SpeedValue; -extern GLOBALVAR uint16_t CurMouseV; -extern GLOBALVAR uint16_t CurMouseH; +extern bool RequestMacOff; +extern bool ForceMacOff; +extern bool WantMacInterrupt; +extern bool WantMacReset; +extern uint8_t SpeedValue; +extern uint16_t CurMouseV; +extern uint16_t CurMouseH; -extern GLOBALVAR uint32_t QuietTime; -extern GLOBALVAR uint32_t QuietSubTicks; +extern uint32_t QuietTime; +extern uint32_t QuietSubTicks; #ifndef GrabKeysFullScreen #define GrabKeysFullScreen 1 @@ -80,24 +80,24 @@ extern GLOBALVAR uint32_t QuietSubTicks; #endif #if IncludePbufs -GLOBALVAR uint32_t PbufAllocatedMask; -GLOBALVAR uint32_t PbufSize[NumPbufs]; + uint32_t PbufAllocatedMask; + uint32_t PbufSize[NumPbufs]; #define PbufIsAllocated(i) ((PbufAllocatedMask & ((uint32_t)1 << (i))) != 0) -GLOBALFUNC bool FirstFreePbuf(tPbuf *r); -GLOBALPROC PbufNewNotify(tPbuf Pbuf_No, uint32_t count); -GLOBALPROC PbufDisposeNotify(tPbuf Pbuf_No); + bool FirstFreePbuf(tPbuf *r); +void PbufNewNotify(tPbuf Pbuf_No, uint32_t count); +void PbufDisposeNotify(tPbuf Pbuf_No); GLOBALOSGLUFUNC MacErr_t CheckPbuf(tPbuf Pbuf_No); GLOBALOSGLUFUNC MacErr_t PbufGetSize(tPbuf Pbuf_No, uint32_t *Count); #endif -GLOBALFUNC bool FirstFreeDisk(tDrive *Drive_No); + bool FirstFreeDisk(tDrive *Drive_No); GLOBALOSGLUFUNC bool AnyDiskInserted(void); GLOBALOSGLUPROC DiskRevokeWritable(tDrive Drive_No); -GLOBALPROC DiskInsertNotify(tDrive Drive_No, bool locked); -GLOBALPROC DiskEjectedNotify(tDrive Drive_No); +void DiskInsertNotify(tDrive Drive_No, bool locked); +void DiskEjectedNotify(tDrive Drive_No); -extern GLOBALVAR uint8_t * screencomparebuff; +extern uint8_t * screencomparebuff; /* block type - for operating on multiple uint8_t elements @@ -134,27 +134,27 @@ extern GLOBALVAR uint8_t * screencomparebuff; #define WantColorTransValid 0 #endif -extern GLOBALVAR bool EmVideoDisable; -extern GLOBALVAR int8_t EmLagTime; +extern bool EmVideoDisable; +extern int8_t EmLagTime; // The time slice we are currently dealing with, // in the same units as TrueEmulatedTime. -extern GLOBALVAR uint32_t OnTrueTime; +extern uint32_t OnTrueTime; -GLOBALPROC ScreenClearChanges(void); -GLOBALPROC ScreenChangedAll(void); +void ScreenClearChanges(void); +void ScreenChangedAll(void); -GLOBALVAR int16_t ScreenChangedTop; -GLOBALVAR int16_t ScreenChangedLeft; -GLOBALVAR int16_t ScreenChangedBottom; -GLOBALVAR int16_t ScreenChangedRight; + int16_t ScreenChangedTop; + int16_t ScreenChangedLeft; + int16_t ScreenChangedBottom; + int16_t ScreenChangedRight; GLOBALOSGLUPROC Screen_OutputFrame(uint8_t * screencurrentbuff); #if MayFullScreen -extern GLOBALVAR uint16_t ViewHSize; -extern GLOBALVAR uint16_t ViewVSize; -extern GLOBALVAR uint16_t ViewHStart; -extern GLOBALVAR uint16_t ViewVStart; +extern uint16_t ViewHSize; +extern uint16_t ViewVSize; +extern uint16_t ViewHStart; +extern uint16_t ViewVStart; #endif #ifndef WantAutoScrollBorder @@ -169,8 +169,8 @@ extern GLOBALVAR uint16_t ViewVStart; #define CeilPow2Mult(i, p) FloorPow2Mult((i) + Pow2Mask(p), (p)) /* warning - CeilPow2Mult evaluates p twice */ -extern GLOBALVAR uimr ReserveAllocOffset; -extern GLOBALVAR uint8_t * ReserveAllocBigBlock; +extern uimr ReserveAllocOffset; +extern uint8_t * ReserveAllocBigBlock; GLOBALOSGLUPROC ReserveAllocOneBlock(uint8_t * *p, uimr n, uint8_t align, bool FillOnes); @@ -197,7 +197,7 @@ GLOBALOSGLUPROC dbglog_writelnNum(char *s, simr v); GLOBALOSGLUFUNC EvtQEl * EvtQOutP(void); GLOBALOSGLUPROC EvtQOutDone(void); -extern GLOBALVAR bool EvtQNeedRecover; +extern bool EvtQNeedRecover; #define kKeepMaskControl (1 << 0) #define kKeepMaskCapsLock (1 << 1) @@ -206,24 +206,24 @@ extern GLOBALVAR bool EvtQNeedRecover; #define kKeepMaskShift (1 << 4) -GLOBALPROC Keyboard_UpdateKeyMap(uint8_t key, bool down); -GLOBALPROC MouseButtonSet(bool down); -GLOBALPROC MousePositionSet(uint16_t h, uint16_t v); -GLOBALPROC MousePositionNotify(int h, int v); -GLOBALPROC InitKeyCodes(void); -GLOBALPROC DisconnectKeyCodes(uint32_t KeepMask); -GLOBALPROC EvtQTryRecoverFromFull(void); +void Keyboard_UpdateKeyMap(uint8_t key, bool down); +void MouseButtonSet(bool down); +void MousePositionSet(uint16_t h, uint16_t v); +void MousePositionNotify(int h, int v); +void InitKeyCodes(void); +void DisconnectKeyCodes(uint32_t KeepMask); +void EvtQTryRecoverFromFull(void); /* MacMsg */ -extern GLOBALVAR char *SavedBriefMsg; -extern GLOBALVAR char *SavedLongMsg; +extern char *SavedBriefMsg; +extern char *SavedLongMsg; #if WantAbnormalReports -extern GLOBALVAR uint16_t SavedIDMsg; +extern uint16_t SavedIDMsg; #endif -extern GLOBALVAR bool SavedFatalMsg; +extern bool SavedFatalMsg; -GLOBALPROC MacMsg(char *briefMsg, char *longMsg, bool fatal); +void MacMsg(char *briefMsg, char *longMsg, bool fatal); #if WantAbnormalReports GLOBALOSGLUPROC WarnMsgAbnormalID(uint16_t id); diff --git a/src/UI/CONTROLM.c b/src/UI/CONTROLM.c index 58cdaf8..bb7b5d4 100644 --- a/src/UI/CONTROLM.c +++ b/src/UI/CONTROLM.c @@ -56,12 +56,12 @@ void MacMsgOverride(char *title, char *msg) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, msg, main_wind); } -LOCALPROC WarnMsgCorruptedROM(void) +static void WarnMsgCorruptedROM(void) { MacMsgOverride(kStrCorruptedROMTitle, kStrCorruptedROMMessage); } -LOCALPROC WarnMsgUnsupportedROM(void) +static void WarnMsgUnsupportedROM(void) { MacMsgOverride(kStrUnsupportedROMTitle, kStrUnsupportedROMMessage); diff --git a/src/UI/MYOSGLUE.h b/src/UI/MYOSGLUE.h index 0cd7d7d..3384307 100644 --- a/src/UI/MYOSGLUE.h +++ b/src/UI/MYOSGLUE.h @@ -51,7 +51,7 @@ EXPORTOSGLUPROC ReserveAllocOneBlock( ); EXPORTOSGLUPROC MoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount); -EXPORTVAR(uint8_t *, ROM) +extern uint8_t * ROM; #if IncludePbufs @@ -71,8 +71,8 @@ EXPORTOSGLUPROC PbufTransfer(uint8_t * Buffer, #define tDrive uint16_t -EXPORTVAR(uint32_t, vSonyWritableMask) -EXPORTVAR(uint32_t, vSonyInsertedMask) +extern uint32_t vSonyWritableMask; +extern uint32_t vSonyInsertedMask; #define vSonyIsInserted(Drive_No) \ ((vSonyInsertedMask & ((uint32_t)1 << (Drive_No))) != 0) @@ -87,17 +87,17 @@ EXPORTOSGLUFUNC bool AnyDiskInserted(void); EXPORTOSGLUPROC DiskRevokeWritable(tDrive Drive_No); #if IncludeSonyRawMode -EXPORTVAR(bool, vSonyRawMode) +extern bool vSonyRawMode; #endif #if IncludeSonyNew -EXPORTVAR(bool, vSonyNewDiskWanted) -EXPORTVAR(uint32_t, vSonyNewDiskSize) +extern bool vSonyNewDiskWanted; +extern uint32_t vSonyNewDiskSize; EXPORTOSGLUFUNC MacErr_t vSonyEjectDelete(tDrive Drive_No); #endif #if IncludeSonyNameNew -EXPORTVAR(tPbuf, vSonyNewDiskName) +extern tPbuf vSonyNewDiskName; #endif #if IncludeSonyGetName @@ -109,53 +109,53 @@ EXPORTOSGLUFUNC MacErr_t HTCEexport(tPbuf i); EXPORTOSGLUFUNC MacErr_t HTCEimport(tPbuf *r); #endif -EXPORTVAR(uint32_t, OnTrueTime) +extern uint32_t OnTrueTime; -EXPORTVAR(uint32_t, CurMacDateInSeconds) +extern uint32_t CurMacDateInSeconds; #if AutoLocation -EXPORTVAR(uint32_t, CurMacLatitude) -EXPORTVAR(uint32_t, CurMacLongitude) +extern uint32_t CurMacLatitude; +extern uint32_t CurMacLongitude; #endif #if AutoTimeZone -EXPORTVAR(uint32_t, CurMacDelta) +extern uint32_t CurMacDelta; /* (dlsDelta << 24) | (gmtDelta & 0x00FFFFFF) */ #endif -EXPORTVAR(bool, UseColorMode) -EXPORTVAR(bool, ColorModeWorks) +extern bool UseColorMode; +extern bool ColorModeWorks; -EXPORTVAR(bool, ColorMappingChanged) +extern bool ColorMappingChanged; //#define CLUT_size (1 << (1 << vMacScreenDepth)) #define CLUT_size 256 // total guesstimate -EXPORTVAR(uint16_t, CLUT_reds[CLUT_size]) -EXPORTVAR(uint16_t, CLUT_greens[CLUT_size]) -EXPORTVAR(uint16_t, CLUT_blues[CLUT_size]) +extern uint16_t CLUT_reds[CLUT_size]; +extern uint16_t CLUT_greens[CLUT_size]; +extern uint16_t CLUT_blues[CLUT_size]; -EXPORTVAR(bool, EmVideoDisable) -EXPORTVAR(int8_t, EmLagTime) +extern bool EmVideoDisable; +extern int8_t EmLagTime; EXPORTOSGLUPROC Screen_OutputFrame(uint8_t * screencurrentbuff); EXPORTOSGLUPROC DoneWithDrawingForTick(void); -EXPORTVAR(bool, ForceMacOff) +extern bool ForceMacOff; -EXPORTVAR(bool, WantMacInterrupt) +extern bool WantMacInterrupt; -EXPORTVAR(bool, WantMacReset) +extern bool WantMacReset; EXPORTOSGLUFUNC bool ExtraTimeNotOver(void); -EXPORTVAR(uint8_t, SpeedValue) +extern uint8_t SpeedValue; /* where emulated machine thinks mouse is */ -EXPORTVAR(uint16_t, CurMouseV) -EXPORTVAR(uint16_t, CurMouseH) +extern uint16_t CurMouseV; +extern uint16_t CurMouseH; -EXPORTVAR(uint32_t, QuietTime) -EXPORTVAR(uint32_t, QuietSubTicks) +extern uint32_t QuietTime; +extern uint32_t QuietSubTicks; #define QuietEnds() \ { \ @@ -188,13 +188,13 @@ EXPORTOSGLUPROC Sound_EndWrite(uint16_t actL); #if EmLocalTalk #define LT_TxBfMxSz 1024 -EXPORTVAR(uint8_t *, LT_TxBuffer) -EXPORTVAR(uint16_t, LT_TxBuffSz) +extern uint8_t * LT_TxBuffer; +extern uint16_t LT_TxBuffSz; EXPORTOSGLUPROC LT_TransmitPacket(void); -EXPORTVAR(uint8_t *, LT_RxBuffer) -EXPORTVAR(uint32_t, LT_RxBuffSz) +extern uint8_t * LT_RxBuffer; +extern uint32_t LT_RxBuffSz; EXPORTOSGLUPROC LT_ReceivePacket(void); diff --git a/src/UI/SDL2/CLIPBRD.c b/src/UI/SDL2/CLIPBRD.c index 445326b..73b2ef6 100644 --- a/src/UI/SDL2/CLIPBRD.c +++ b/src/UI/SDL2/CLIPBRD.c @@ -12,7 +12,7 @@ /* --- clipboard --- */ #if IncludeHostTextClipExchange -LOCALFUNC uimr MacRoman2UniCodeSize(uint8_t *s, uimr L) +static uimr MacRoman2UniCodeSize(uint8_t *s, uimr L) { uimr i; uint8_t x; @@ -293,7 +293,7 @@ LOCALFUNC uimr MacRoman2UniCodeSize(uint8_t *s, uimr L) #endif #if IncludeHostTextClipExchange -LOCALPROC MacRoman2UniCodeData(uint8_t *s, uimr L, char *t) +static void MacRoman2UniCodeData(uint8_t *s, uimr L, char *t) { uimr i; uint8_t x; @@ -596,7 +596,7 @@ GLOBALOSGLUFUNC MacErr_t HTCEexport(tPbuf i) #endif #if IncludeHostTextClipExchange -LOCALFUNC MacErr_t UniCodeStrLength(char *s, uimr *r) +static MacErr_t UniCodeStrLength(char *s, uimr *r) { MacErr_t err; uint8_t t; @@ -665,7 +665,7 @@ label_retry: #endif #if IncludeHostTextClipExchange -LOCALFUNC uint8_t UniCodePoint2MacRoman(uint32_t x) +static uint8_t UniCodePoint2MacRoman(uint32_t x) { /* adapted from @@ -943,7 +943,7 @@ LOCALFUNC uint8_t UniCodePoint2MacRoman(uint32_t x) #endif #if IncludeHostTextClipExchange -LOCALPROC UniCodeStr2MacRoman(char *s, char *r) +static void UniCodeStr2MacRoman(char *s, char *r) { MacErr_t err; uint8_t t; diff --git a/src/UI/SDL2/DBGLOG.c b/src/UI/SDL2/DBGLOG.c index 0f5c54b..693818e 100644 --- a/src/UI/SDL2/DBGLOG.c +++ b/src/UI/SDL2/DBGLOG.c @@ -16,10 +16,10 @@ #endif #if ! dbglog_ToStdErr -LOCALVAR FILE *dbglog_File = NULL; +static FILE *dbglog_File = NULL; #endif -LOCALFUNC bool dbglog_open0(void) +static bool dbglog_open0(void) { #if dbglog_ToStdErr || dbglog_ToSDL_Log return true; @@ -39,7 +39,7 @@ LOCALFUNC bool dbglog_open0(void) #endif } -LOCALPROC dbglog_write0(char *s, uimr L) +static void dbglog_write0(char *s, uimr L) { #if dbglog_ToStdErr (void) fwrite(s, 1, L, stderr); @@ -60,7 +60,7 @@ LOCALPROC dbglog_write0(char *s, uimr L) #endif } -LOCALPROC dbglog_close0(void) +static void dbglog_close0(void) { #if ! dbglog_ToStdErr if (dbglog_File != NULL) { diff --git a/src/UI/SDL2/INTL.c b/src/UI/SDL2/INTL.c index 993d799..a984c51 100644 --- a/src/UI/SDL2/INTL.c +++ b/src/UI/SDL2/INTL.c @@ -16,12 +16,12 @@ #define CanGetAppPath 1 #endif -LOCALVAR char *d_arg = NULL; -LOCALVAR char *n_arg = NULL; +static char *d_arg = NULL; +static char *n_arg = NULL; #if CanGetAppPath -LOCALVAR char *app_parent = NULL; -LOCALVAR char *pref_dir = NULL; +static char *app_parent = NULL; +static char *pref_dir = NULL; #endif #ifdef _WIN32 diff --git a/src/UI/SDL2/OSGLUSD2.c b/src/UI/SDL2/OSGLUSD2.c index 9e34e5e..3ccf457 100644 --- a/src/UI/SDL2/OSGLUSD2.c +++ b/src/UI/SDL2/OSGLUSD2.c @@ -53,7 +53,7 @@ GLOBALOSGLUPROC MoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount) /* --- basic dialogs --- */ -LOCALPROC CheckSavedMacMsg(void) +static void CheckSavedMacMsg(void) { /* called only on quit, if error saved but not yet reported */ @@ -84,10 +84,10 @@ LOCALPROC CheckSavedMacMsg(void) #define UseMotionEvents 1 #if UseMotionEvents -LOCALVAR bool CaughtMouse = false; +static bool CaughtMouse = false; #endif -LOCALPROC HandleTheEvent(SDL_Event *event) +static void HandleTheEvent(SDL_Event *event) { switch (event->type) { case SDL_QUIT: @@ -206,10 +206,10 @@ LOCALPROC HandleTheEvent(SDL_Event *event) /* --- main window creation and disposal --- */ -LOCALVAR int argc; -LOCALVAR char **argv; +static int argc; +static char **argv; -LOCALFUNC bool SDL_InitDisplay(void) +static bool SDL_InitDisplay(void) { bool v = false; @@ -226,11 +226,11 @@ LOCALFUNC bool SDL_InitDisplay(void) } #if MayFullScreen -LOCALVAR bool GrabMachine = false; +static bool GrabMachine = false; #endif #if MayFullScreen -LOCALPROC GrabTheMachine(void) +static void GrabTheMachine(void) { #if GrabKeysFullScreen SDL_SetWindowGrab(main_wind, SDL_TRUE); @@ -261,7 +261,7 @@ LOCALPROC GrabTheMachine(void) #endif #if MayFullScreen -LOCALPROC UngrabMachine(void) +static void UngrabMachine(void) { #if EnableFSMouseMotion @@ -284,7 +284,7 @@ LOCALPROC UngrabMachine(void) #endif #if EnableFSMouseMotion && HaveWorkingWarp -LOCALPROC MouseConstrain(void) +static void MouseConstrain(void) { int16_t shiftdh; int16_t shiftdv; @@ -324,13 +324,13 @@ enum { #define kMagStateAuto kNumMagStates #if MayNotFullScreen -LOCALVAR int CurWinIndx; -LOCALVAR bool HavePositionWins[kNumMagStates]; -LOCALVAR int WinPositionsX[kNumMagStates]; -LOCALVAR int WinPositionsY[kNumMagStates]; +static int CurWinIndx; +static bool HavePositionWins[kNumMagStates]; +static int WinPositionsX[kNumMagStates]; +static int WinPositionsY[kNumMagStates]; #endif -LOCALFUNC bool CreateMainWindow(void) +static bool CreateMainWindow(void) { int NewWindowX; int NewWindowY; @@ -486,7 +486,7 @@ LOCALFUNC bool CreateMainWindow(void) return v; } -LOCALPROC CloseMainWindow(void) +static void CloseMainWindow(void) { if (NULL != format) { SDL_FreeFormat(format); @@ -510,7 +510,7 @@ LOCALPROC CloseMainWindow(void) } #if EnableRecreateW -LOCALPROC ZapWState(void) +static void ZapWState(void) { main_wind = NULL; renderer = NULL; @@ -547,7 +547,7 @@ typedef struct WState WState; #endif #if EnableRecreateW -LOCALPROC GetWState(WState *r) +static void GetWState(WState *r) { #if MayFullScreen r->f_ViewHSize = ViewHSize; @@ -574,7 +574,7 @@ LOCALPROC GetWState(WState *r) #endif #if EnableRecreateW -LOCALPROC SetWState(WState *r) +static void SetWState(WState *r) { #if MayFullScreen ViewHSize = r->f_ViewHSize; @@ -611,11 +611,11 @@ enum { #endif #if 1 && 1 -LOCALVAR int WinMagStates[kNumWinStates]; +static int WinMagStates[kNumWinStates]; #endif #if EnableRecreateW -LOCALFUNC bool ReCreateMainWindow(void) +static bool ReCreateMainWindow(void) { WState old_state; WState new_state; @@ -693,7 +693,7 @@ LOCALFUNC bool ReCreateMainWindow(void) } #endif -LOCALPROC ZapWinStateVars(void) +static void ZapWinStateVars(void) { #if MayNotFullScreen { @@ -755,13 +755,13 @@ void ToggleWantFullScreen(void) /* --- SavedTasks --- */ -LOCALPROC LeaveBackground(void) +static void LeaveBackground(void) { ReconnectKeyCodes3(); DisableKeyRepeat(); } -LOCALPROC EnterBackground(void) +static void EnterBackground(void) { RestoreKeyRepeat(); DisconnectKeyCodes3(); @@ -785,7 +785,7 @@ void EnterSpeedStopped(void) #endif } -LOCALPROC CheckForSavedTasks(void) +static void CheckForSavedTasks(void) { if (EvtQNeedRecover) { EvtQNeedRecover = false; @@ -884,7 +884,7 @@ LOCALPROC CheckForSavedTasks(void) /* --- command line parsing --- */ // TODO: reimplement with an actual argument parsing library -LOCALFUNC bool ScanCommandLine(void) +static bool ScanCommandLine(void) { return true; } @@ -897,7 +897,7 @@ GLOBALOSGLUFUNC bool ExtraTimeNotOver(void) return TrueEmulatedTime == OnTrueTime; } -LOCALPROC WaitForTheNextEvent(void) +static void WaitForTheNextEvent(void) { SDL_Event event; @@ -906,7 +906,7 @@ LOCALPROC WaitForTheNextEvent(void) } } -LOCALPROC CheckForSystemEvents(void) +static void CheckForSystemEvents(void) { SDL_Event event; int i = 10; @@ -963,13 +963,13 @@ label_retry: #include "PROGMAIN.h" -LOCALPROC ZapOSGLUVars(void) +static void ZapOSGLUVars(void) { InitDrives(); ZapWinStateVars(); } -LOCALPROC ReserveAllocAll(void) +static void ReserveAllocAll(void) { #if dbglog_HAVE dbglog_ReserveAlloc(); @@ -992,7 +992,7 @@ LOCALPROC ReserveAllocAll(void) EmulationReserveAlloc(); } -LOCALFUNC bool AllocMemory(void) +static bool AllocMemory(void) { uimr n; bool IsOk = false; @@ -1017,7 +1017,7 @@ LOCALFUNC bool AllocMemory(void) return IsOk; } -LOCALPROC UnallocMemory(void) +static void UnallocMemory(void) { if (nullpr != ReserveAllocBigBlock) { free((char *)ReserveAllocBigBlock); @@ -1025,7 +1025,7 @@ LOCALPROC UnallocMemory(void) } #if CanGetAppPath -LOCALFUNC bool InitWhereAmI(void) +static bool InitWhereAmI(void) { app_parent = SDL_GetBasePath(); @@ -1036,7 +1036,7 @@ LOCALFUNC bool InitWhereAmI(void) #endif #if CanGetAppPath -LOCALPROC UninitWhereAmI(void) +static void UninitWhereAmI(void) { SDL_free(pref_dir); @@ -1044,7 +1044,7 @@ LOCALPROC UninitWhereAmI(void) } #endif -LOCALFUNC bool InitOSGLU(void) +static bool InitOSGLU(void) { if (Config_TryInit()) if (AllocMemory()) @@ -1070,7 +1070,7 @@ LOCALFUNC bool InitOSGLU(void) return false; } -LOCALPROC UnInitOSGLU(void) +static void UnInitOSGLU(void) { RestoreKeyRepeat(); #if MayFullScreen diff --git a/src/UI/SDL2/ROM.c b/src/UI/SDL2/ROM.c index 7871627..af419a3 100644 --- a/src/UI/SDL2/ROM.c +++ b/src/UI/SDL2/ROM.c @@ -12,10 +12,10 @@ /* --- ROM --- */ -LOCALVAR char *rom_path = NULL; +static char *rom_path = NULL; #if CanGetAppPath -LOCALFUNC MacErr_t LoadMacRomFromPrefDir(void) +static MacErr_t LoadMacRomFromPrefDir(void) { MacErr_t err; char *t = NULL; @@ -46,7 +46,7 @@ LOCALFUNC MacErr_t LoadMacRomFromPrefDir(void) #endif #if CanGetAppPath -LOCALFUNC MacErr_t LoadMacRomFromAppPar(void) +static MacErr_t LoadMacRomFromAppPar(void) { MacErr_t err; char *d = (NULL == d_arg) ? app_parent : d_arg; diff --git a/src/UI/SDL2/SOUND.c b/src/UI/SDL2/SOUND.c index a81128f..6dc136a 100644 --- a/src/UI/SDL2/SOUND.c +++ b/src/UI/SDL2/SOUND.c @@ -20,9 +20,9 @@ volatile static uint16_t ThePlayOffset; volatile static uint16_t TheFillOffset; volatile static uint16_t MinFilledSoundBuffs; #if dbglog_SoundBuffStats -LOCALVAR uint16_t MaxFilledSoundBuffs; +static uint16_t MaxFilledSoundBuffs; #endif -LOCALVAR uint16_t TheWriteOffset; +static uint16_t TheWriteOffset; void Sound_Init0(void) { @@ -321,9 +321,9 @@ label_retry: datp->lastv = v1; } -LOCALVAR SoundR cur_audio; +static SoundR cur_audio; -LOCALVAR bool HaveSoundOut = false; +static bool HaveSoundOut = false; void Sound_Stop(void) { diff --git a/src/UI/SDL2/TIMEDATE.c b/src/UI/SDL2/TIMEDATE.c index 5664344..144f819 100644 --- a/src/UI/SDL2/TIMEDATE.c +++ b/src/UI/SDL2/TIMEDATE.c @@ -38,7 +38,7 @@ void InitNextTime(void) IncrNextTime(); } -LOCALVAR uint32_t NewMacDateInSeconds; +static uint32_t NewMacDateInSeconds; bool UpdateTrueEmulatedTime(void) { diff --git a/src/UTIL/BPFILTER.h b/src/UTIL/BPFILTER.h index e38053d..86892d2 100644 --- a/src/UTIL/BPFILTER.h +++ b/src/UTIL/BPFILTER.h @@ -35,10 +35,10 @@ static struct bpf_insn insns[] = BPF_STMT(BPF_RET + BPF_K, 0), }; -GLOBALVAR uint8_t * LT_TxBuffer = NULL; + uint8_t * LT_TxBuffer = NULL; /* Transmit state */ -GLOBALVAR uint16_t LT_TxBuffSz = 0; + uint16_t LT_TxBuffSz = 0; /* Transmit buffer that is reused from tx packet to tx packet. @@ -59,9 +59,9 @@ static unsigned char tx_buffer[20 + LT_TxBfMxSz] = "\xFF\xFF\xFF\xFF\xFF\xFFssssss\x80\x9BppppSS"; /* Receive state */ -GLOBALVAR uint8_t * LT_RxBuffer = NULL; + uint8_t * LT_RxBuffer = NULL; /* When data pending, this is used */ -GLOBALVAR uint32_t LT_RxBuffSz = 0; + uint32_t LT_RxBuffSz = 0; /* When data pending, this is used */ /* Macro used by only the get_sockaddrs function for readability. */ @@ -72,7 +72,7 @@ GLOBALVAR uint32_t LT_RxBuffSz = 0; Utility function needed for walking the addresses of the kernel route lookup */ -LOCALPROC get_sockaddrs(int addrs, struct sockaddr* sa, +static void get_sockaddrs(int addrs, struct sockaddr* sa, struct sockaddr** rti_info) { int loop; @@ -103,7 +103,7 @@ LOCALPROC get_sockaddrs(int addrs, struct sockaddr* sa, packets. */ -LOCALFUNC int get_ethernet(void) +static int get_ethernet(void) { int result; int size; @@ -260,13 +260,13 @@ LOCALFUNC int get_ethernet(void) return true; } -LOCALVAR unsigned char *RxBuffer = NULL; +static unsigned char *RxBuffer = NULL; /* External function needed at startup to initialize the LocalTalk functionality. */ -LOCALFUNC int InitLocalTalk(void) +static int InitLocalTalk(void) { /* Perform a lot of stuff to get access to the Ethernet */ get_ethernet(); @@ -307,10 +307,10 @@ GLOBALOSGLUPROC LT_TransmitPacket(void) (void)count; /* unused */ } -LOCALVAR unsigned char* NextPacket = NULL; -LOCALVAR unsigned char* EndPackets = NULL; +static unsigned char* NextPacket = NULL; +static unsigned char* EndPackets = NULL; -LOCALPROC LocalTalkTick0(void) +static void LocalTalkTick0(void) { /* Get a single buffer worth of packets from BPF */ unsigned char* device_buffer = RxBuffer; diff --git a/src/UTIL/ENDIANAC.h b/src/UTIL/ENDIANAC.h index b0a5ff0..85d7fdb 100644 --- a/src/UTIL/ENDIANAC.h +++ b/src/UTIL/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(uint8_t * a) +static 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(uint8_t * a) #elif HaveSwapUi5r && LittleEndianUnaligned #define do_get_mem_long(a) (SwapUi5r((uint32_t)*((uint32_t *)(a)))) #else -LOCALINLINEFUNC uint32_t do_get_mem_long(uint8_t * a) +static uint32_t do_get_mem_long(uint8_t * a) { #if LittleEndianUnaligned #if 0 @@ -98,7 +98,7 @@ LOCALINLINEFUNC uint32_t do_get_mem_long(uint8_t * a) #if BigEndianUnaligned #define do_put_mem_word(a, v) ((*((uint16_t *)(a))) = (v)) #else -LOCALINLINEFUNC void do_put_mem_word(uint8_t * a, uint16_t v) +static 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(uint8_t * 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(uint8_t * a, uint32_t v) +static void do_put_mem_long(uint8_t * a, uint32_t v) { #if LittleEndianUnaligned uint16_t b1 = v; diff --git a/src/UTIL/PBUFSTDC.h b/src/UTIL/PBUFSTDC.h index da8c8ee..b588253 100644 --- a/src/UTIL/PBUFSTDC.h +++ b/src/UTIL/PBUFSTDC.h @@ -20,11 +20,11 @@ #if IncludePbufs -LOCALVAR void *PbufDat[NumPbufs]; +static void *PbufDat[NumPbufs]; #endif #if IncludePbufs -LOCALFUNC MacErr_t PbufNewFromPtr(void *p, uint32_t count, tPbuf *r) +static MacErr_t PbufNewFromPtr(void *p, uint32_t count, tPbuf *r) { tPbuf i; MacErr_t err; @@ -44,7 +44,7 @@ LOCALFUNC MacErr_t PbufNewFromPtr(void *p, uint32_t count, tPbuf *r) #endif #if IncludePbufs -LOCALPROC PbufKillToPtr(void **p, uint32_t *count, tPbuf r) +static void PbufKillToPtr(void **p, uint32_t *count, tPbuf r) { *p = PbufDat[r]; *count = PbufSize[r]; @@ -80,7 +80,7 @@ GLOBALOSGLUPROC PbufDispose(tPbuf i) #endif #if IncludePbufs -LOCALPROC UnInitPbufs(void) +static void UnInitPbufs(void) { tPbuf i; @@ -97,7 +97,7 @@ LOCALPROC UnInitPbufs(void) #endif #if IncludePbufs -LOCALFUNC uint8_t * PbufLock(tPbuf i) +static uint8_t * PbufLock(tPbuf i) { return (uint8_t *)PbufDat[i]; }