summaryrefslogtreecommitdiffstats
path: root/board/MAI/bios_emulator/scitech/src/pm/rttarget
diff options
context:
space:
mode:
Diffstat (limited to 'board/MAI/bios_emulator/scitech/src/pm/rttarget')
-rw-r--r--board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c22
-rw-r--r--board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c212
-rw-r--r--board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c90
-rw-r--r--board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c30
4 files changed, 177 insertions, 177 deletions
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c
index 3d6dd44313..4f32c3e887 100644
--- a/board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c
+++ b/board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c
@@ -46,7 +46,7 @@ static int SetMaxThreadPriority(void)
oldPriority = GetThreadPriority(hThread);
if (oldPriority != THREAD_PRIORITY_ERROR_RETURN)
- SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
+ SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
return oldPriority;
}
@@ -60,7 +60,7 @@ static void RestoreThreadPriority(
HANDLE hThread = GetCurrentThread();
if (oldPriority != THREAD_PRIORITY_ERROR_RETURN)
- SetThreadPriority(hThread, oldPriority);
+ SetThreadPriority(hThread, oldPriority);
}
/****************************************************************************
@@ -71,12 +71,12 @@ static void GetCounterFrequency(
CPU_largeInteger *freq)
{
if (!QueryPerformanceFrequency((LARGE_INTEGER*)freq)) {
- havePerformanceCounter = false;
- freq->low = 100000;
- freq->high = 0;
- }
+ havePerformanceCounter = false;
+ freq->low = 100000;
+ freq->high = 0;
+ }
else
- havePerformanceCounter = true;
+ havePerformanceCounter = true;
}
/****************************************************************************
@@ -86,9 +86,9 @@ Read the counter and return the counter value.
#define GetCounter(t) \
{ \
if (havePerformanceCounter) \
- QueryPerformanceCounter((LARGE_INTEGER*)t); \
+ QueryPerformanceCounter((LARGE_INTEGER*)t); \
else { \
- (t)->low = timeGetTime() * 100; \
- (t)->high = 0; \
- } \
+ (t)->low = timeGetTime() * 100; \
+ (t)->high = 0; \
+ } \
}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c
index e9aba21b9f..962a14a3c1 100644
--- a/board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c
+++ b/board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c
@@ -71,113 +71,113 @@ void _EVT_pumpMessages(void)
event_t evt;
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
- memset(&evt,0,sizeof(evt));
- switch (msg.message) {
- case WM_MOUSEMOVE:
- evt.what = EVT_MOUSEMOVE;
- break;
- case WM_LBUTTONDBLCLK:
- evt.what = EVT_MOUSEDOWN;
- evt.message = EVT_LEFTBMASK | EVT_DBLCLICK;
- break;
- case WM_LBUTTONDOWN:
- evt.what = EVT_MOUSEDOWN;
- evt.message = EVT_LEFTBMASK;
- break;
- case WM_LBUTTONUP:
- evt.what = EVT_MOUSEUP;
- evt.message = EVT_LEFTBMASK;
- break;
- case WM_RBUTTONDBLCLK:
- evt.what = EVT_MOUSEDOWN | EVT_DBLCLICK;
- evt.message = EVT_RIGHTBMASK;
- break;
- case WM_RBUTTONDOWN:
- evt.what = EVT_MOUSEDOWN;
- evt.message = EVT_RIGHTBMASK;
- break;
- case WM_RBUTTONUP:
- evt.what = EVT_MOUSEUP;
- evt.message = EVT_RIGHTBMASK;
- break;
- case WM_KEYDOWN:
- case WM_SYSKEYDOWN:
- if (HIWORD(msg.lParam) & KF_REPEAT) {
- evt.what = EVT_KEYREPEAT;
- }
- else {
- evt.what = EVT_KEYDOWN;
- }
- break;
- case WM_KEYUP:
- case WM_SYSKEYUP:
- evt.what = EVT_KEYUP;
- break;
- }
+ memset(&evt,0,sizeof(evt));
+ switch (msg.message) {
+ case WM_MOUSEMOVE:
+ evt.what = EVT_MOUSEMOVE;
+ break;
+ case WM_LBUTTONDBLCLK:
+ evt.what = EVT_MOUSEDOWN;
+ evt.message = EVT_LEFTBMASK | EVT_DBLCLICK;
+ break;
+ case WM_LBUTTONDOWN:
+ evt.what = EVT_MOUSEDOWN;
+ evt.message = EVT_LEFTBMASK;
+ break;
+ case WM_LBUTTONUP:
+ evt.what = EVT_MOUSEUP;
+ evt.message = EVT_LEFTBMASK;
+ break;
+ case WM_RBUTTONDBLCLK:
+ evt.what = EVT_MOUSEDOWN | EVT_DBLCLICK;
+ evt.message = EVT_RIGHTBMASK;
+ break;
+ case WM_RBUTTONDOWN:
+ evt.what = EVT_MOUSEDOWN;
+ evt.message = EVT_RIGHTBMASK;
+ break;
+ case WM_RBUTTONUP:
+ evt.what = EVT_MOUSEUP;
+ evt.message = EVT_RIGHTBMASK;
+ break;
+ case WM_KEYDOWN:
+ case WM_SYSKEYDOWN:
+ if (HIWORD(msg.lParam) & KF_REPEAT) {
+ evt.what = EVT_KEYREPEAT;
+ }
+ else {
+ evt.what = EVT_KEYDOWN;
+ }
+ break;
+ case WM_KEYUP:
+ case WM_SYSKEYUP:
+ evt.what = EVT_KEYUP;
+ break;
+ }
- /* Convert mouse event modifier flags */
- if (evt.what & EVT_MOUSEEVT) {
- evt.where_x = msg.pt.x;
- evt.where_y = msg.pt.y;
- if (evt.what == EVT_MOUSEMOVE) {
- if (oldMove != -1) {
- evtq[oldMove].where_x = evt.where_x;/* Modify existing one */
- evtq[oldMove].where_y = evt.where_y;
- evt.what = 0;
- }
- else {
- oldMove = freeHead; /* Save id of this move event */
- }
- }
- else
- oldMove = -1;
- if (msg.wParam & MK_LBUTTON)
- evt.modifiers |= EVT_LEFTBUT;
- if (msg.wParam & MK_RBUTTON)
- evt.modifiers |= EVT_RIGHTBUT;
- if (msg.wParam & MK_SHIFT)
- evt.modifiers |= EVT_SHIFTKEY;
- if (msg.wParam & MK_CONTROL)
- evt.modifiers |= EVT_CTRLSTATE;
- }
+ /* Convert mouse event modifier flags */
+ if (evt.what & EVT_MOUSEEVT) {
+ evt.where_x = msg.pt.x;
+ evt.where_y = msg.pt.y;
+ if (evt.what == EVT_MOUSEMOVE) {
+ if (oldMove != -1) {
+ evtq[oldMove].where_x = evt.where_x;/* Modify existing one */
+ evtq[oldMove].where_y = evt.where_y;
+ evt.what = 0;
+ }
+ else {
+ oldMove = freeHead; /* Save id of this move event */
+ }
+ }
+ else
+ oldMove = -1;
+ if (msg.wParam & MK_LBUTTON)
+ evt.modifiers |= EVT_LEFTBUT;
+ if (msg.wParam & MK_RBUTTON)
+ evt.modifiers |= EVT_RIGHTBUT;
+ if (msg.wParam & MK_SHIFT)
+ evt.modifiers |= EVT_SHIFTKEY;
+ if (msg.wParam & MK_CONTROL)
+ evt.modifiers |= EVT_CTRLSTATE;
+ }
- /* Convert keyboard codes */
- TranslateMessage(&msg);
- if (evt.what & EVT_KEYEVT) {
- int scanCode = (msg.lParam >> 16) & 0xFF;
- if (evt.what == EVT_KEYUP) {
- /* Get message for keyup code from table of cached down values */
- evt.message = keyUpMsg[scanCode];
- keyUpMsg[scanCode] = 0;
- }
- else {
- if (PeekMessage(&charMsg,NULL,WM_CHAR,WM_CHAR,PM_REMOVE))
- evt.message = charMsg.wParam;
- if (PeekMessage(&charMsg,NULL,WM_SYSCHAR,WM_SYSCHAR,PM_REMOVE))
- evt.message = charMsg.wParam;
- evt.message |= ((msg.lParam >> 8) & 0xFF00);
- keyUpMsg[scanCode] = (ushort)evt.message;
- }
- if (evt.what == EVT_KEYREPEAT)
- evt.message |= (msg.lParam << 16);
- if (HIWORD(msg.lParam) & KF_ALTDOWN)
- evt.modifiers |= EVT_ALTSTATE;
- if (GetKeyState(VK_SHIFT) & 0x8000U)
- evt.modifiers |= EVT_SHIFTKEY;
- if (GetKeyState(VK_CONTROL) & 0x8000U)
- evt.modifiers |= EVT_CTRLSTATE;
- oldMove = -1;
- }
+ /* Convert keyboard codes */
+ TranslateMessage(&msg);
+ if (evt.what & EVT_KEYEVT) {
+ int scanCode = (msg.lParam >> 16) & 0xFF;
+ if (evt.what == EVT_KEYUP) {
+ /* Get message for keyup code from table of cached down values */
+ evt.message = keyUpMsg[scanCode];
+ keyUpMsg[scanCode] = 0;
+ }
+ else {
+ if (PeekMessage(&charMsg,NULL,WM_CHAR,WM_CHAR,PM_REMOVE))
+ evt.message = charMsg.wParam;
+ if (PeekMessage(&charMsg,NULL,WM_SYSCHAR,WM_SYSCHAR,PM_REMOVE))
+ evt.message = charMsg.wParam;
+ evt.message |= ((msg.lParam >> 8) & 0xFF00);
+ keyUpMsg[scanCode] = (ushort)evt.message;
+ }
+ if (evt.what == EVT_KEYREPEAT)
+ evt.message |= (msg.lParam << 16);
+ if (HIWORD(msg.lParam) & KF_ALTDOWN)
+ evt.modifiers |= EVT_ALTSTATE;
+ if (GetKeyState(VK_SHIFT) & 0x8000U)
+ evt.modifiers |= EVT_SHIFTKEY;
+ if (GetKeyState(VK_CONTROL) & 0x8000U)
+ evt.modifiers |= EVT_CTRLSTATE;
+ oldMove = -1;
+ }
- if (evt.what != 0) {
- /* Add time stamp and add the event to the queue */
- evt.when = msg.time;
- if (count < EVENTQSIZE) {
- addEvent(&evt);
- }
- }
- DispatchMessage(&msg);
- }
+ if (evt.what != 0) {
+ /* Add time stamp and add the event to the queue */
+ evt.when = msg.time;
+ if (count < EVENTQSIZE) {
+ addEvent(&evt);
+ }
+ }
+ DispatchMessage(&msg);
+ }
}
/****************************************************************************
@@ -261,7 +261,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
- // Do nothing for Win32
+ /* Do nothing for Win32 */
}
/****************************************************************************
@@ -271,7 +271,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
- // Do nothing for Win32
+ /* Do nothing for Win32 */
}
/****************************************************************************
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c
index e6c1fbd8b3..47d7ed6ab1 100644
--- a/board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c
+++ b/board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c
@@ -59,7 +59,7 @@ Initialise the PM library.
****************************************************************************/
void PMAPI PM_init(void)
{
- // TODO: dO any special init code in here.
+ /* TODO: dO any special init code in here. */
MTRR_init();
}
@@ -90,9 +90,9 @@ void PMAPI PM_backslash(
{
uint pos = strlen(s);
if (s[pos-1] != '\\') {
- s[pos] = '\\';
- s[pos+1] = '\0';
- }
+ s[pos] = '\\';
+ s[pos+1] = '\0';
+ }
}
/****************************************************************************
@@ -113,9 +113,9 @@ void PMAPI PM_fatalError(
const char *msg)
{
if (fatalErrorCleanup)
- fatalErrorCleanup();
- // TODO: Display a fatal error message and exit!
-// MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION);
+ fatalErrorCleanup();
+ /* TODO: Display a fatal error message and exit! */
+/* MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION); */
exit(1);
}
@@ -138,7 +138,7 @@ Check if a key has been pressed.
****************************************************************************/
int PMAPI PM_kbhit(void)
{
- // TODO: Need to check if a key is waiting on the keyboard queue
+ /* TODO: Need to check if a key is waiting on the keyboard queue */
return true;
}
@@ -148,7 +148,7 @@ Wait for and return the next keypress.
****************************************************************************/
int PMAPI PM_getch(void)
{
- // TODO: Need to obtain the next keypress, and block until one is hit
+ /* TODO: Need to obtain the next keypress, and block until one is hit */
return 0xD;
}
@@ -240,7 +240,7 @@ Return the path to the Nucleus driver files.
****************************************************************************/
const char * PMAPI PM_getNucleusPath(void)
{
- // TODO: Point this at the path when the Nucleus drivers will be found
+ /* TODO: Point this at the path when the Nucleus drivers will be found */
return "c:\\nucleus";
}
@@ -294,7 +294,7 @@ void * PMAPI PM_getA0000Pointer(void)
{
static void *bankPtr;
if (!bankPtr)
- bankPtr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
+ bankPtr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
return bankPtr;
}
@@ -307,7 +307,7 @@ void * PMAPI PM_mapPhysicalAddr(
ulong limit,
ibool isCached)
{
- // TODO: Map a physical memory address to a linear address
+ /* TODO: Map a physical memory address to a linear address */
return NULL;
}
@@ -319,13 +319,13 @@ void PMAPI PM_freePhysicalAddr(
void *ptr,
ulong limit)
{
- // TODO: Free the physical address mapping
+ /* TODO: Free the physical address mapping */
}
ulong PMAPI PM_getPhysicalAddr(void *p)
{
- // TODO: This function should find the physical address of a linear
- // address.
+ /* TODO: This function should find the physical address of a linear */
+ /* address. */
return 0xFFFFFFFFUL;
}
@@ -336,24 +336,24 @@ void PMAPI PM_sleep(ulong milliseconds)
int PMAPI PM_getCOMPort(int port)
{
- // TODO: Re-code this to determine real values using the Plug and Play
- // manager for the OS.
+ /* TODO: Re-code this to determine real values using the Plug and Play */
+ /* manager for the OS. */
switch (port) {
- case 0: return 0x3F8;
- case 1: return 0x2F8;
- }
+ case 0: return 0x3F8;
+ case 1: return 0x2F8;
+ }
return 0;
}
int PMAPI PM_getLPTPort(int port)
{
- // TODO: Re-code this to determine real values using the Plug and Play
- // manager for the OS.
+ /* TODO: Re-code this to determine real values using the Plug and Play */
+ /* manager for the OS. */
switch (port) {
- case 0: return 0x3BC;
- case 1: return 0x378;
- case 2: return 0x278;
- }
+ case 0: return 0x3BC;
+ case 1: return 0x378;
+ case 2: return 0x278;
+ }
return 0;
}
@@ -484,8 +484,8 @@ void PMAPI PM_availableMemory(
ulong *physical,
ulong *total)
{
- // TODO: Figure out how to determine the available memory. Not entirely
- // critical so returning 0 is OK.
+ /* TODO: Figure out how to determine the available memory. Not entirely */
+ /* critical so returning 0 is OK. */
*physical = *total = 0;
}
@@ -499,7 +499,7 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous,
ibool below16M)
{
- // TODO: Allocate a block of locked, phsyically contigous memory for DMA
+ /* TODO: Allocate a block of locked, phsyically contigous memory for DMA */
return 0;
}
@@ -510,10 +510,10 @@ Free a block of locked physical memory.
void PMAPI PM_freeLockedMem(
void *p,
uint size,
-
+
ibool contiguous)
{
- // TODO: Free a locked memory buffer
+ /* TODO: Free a locked memory buffer */
}
/****************************************************************************
@@ -564,7 +564,7 @@ ibool PMAPI PM_doBIOSPOST(
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
- // TODO: Implement this to load shared libraries!
+ /* TODO: Implement this to load shared libraries! */
(void)szDLLName;
return NULL;
}
@@ -573,7 +573,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
- // TODO: Implement this!
+ /* TODO: Implement this! */
(void)hModule;
(void)szProcName;
return NULL;
@@ -582,7 +582,7 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
- // TODO: Implement this!
+ /* TODO: Implement this! */
(void)hModule;
}
@@ -594,9 +594,9 @@ ulong PMAPI PM_findFirstFile(
const char *filename,
PM_findData *findData)
{
- // TODO: This function should start a directory enumeration search
- // given the filename (with wildcards). The data should be
- // converted and returned in the findData standard form.
+ /* TODO: This function should start a directory enumeration search */
+ /* given the filename (with wildcards). The data should be */
+ /* converted and returned in the findData standard form. */
(void)filename;
(void)findData;
return PM_FILE_INVALID;
@@ -610,10 +610,10 @@ ibool PMAPI PM_findNextFile(
ulong handle,
PM_findData *findData)
{
- // TODO: This function should find the next file in directory enumeration
- // search given the search criteria defined in the call to
- // PM_findFirstFile. The data should be converted and returned
- // in the findData standard form.
+ /* TODO: This function should find the next file in directory enumeration */
+ /* search given the search criteria defined in the call to */
+ /* PM_findFirstFile. The data should be converted and returned */
+ /* in the findData standard form. */
(void)handle;
(void)findData;
return false;
@@ -626,8 +626,8 @@ Function to close the find process
void PMAPI PM_findClose(
ulong handle)
{
- // TODO: This function should close the find process. This may do
- // nothing for some OS'es.
+ /* TODO: This function should close the find process. This may do */
+ /* nothing for some OS'es. */
(void)handle;
}
@@ -648,7 +648,7 @@ ibool PMAPI PM_driveValid(
char drive)
{
if (drive == 3)
- return true;
+ return true;
return false;
}
@@ -675,7 +675,7 @@ void PMAPI PM_setFileAttr(
const char *filename,
uint attrib)
{
- // TODO: Set the file attributes for a file
+ /* TODO: Set the file attributes for a file */
(void)filename;
(void)attrib;
}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c
index 52472c385a..80c184dff1 100644
--- a/board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c
+++ b/board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c
@@ -57,9 +57,9 @@ static void __LZTimerOn(
LZTimerObject *tm)
{
if (havePerformanceCounter)
- QueryPerformanceCounter((LARGE_INTEGER*)&tm->start);
+ QueryPerformanceCounter((LARGE_INTEGER*)&tm->start);
else
- tm->start.low = timeGetTime();
+ tm->start.low = timeGetTime();
}
/****************************************************************************
@@ -72,14 +72,14 @@ static ulong __LZTimerLap(
CPU_largeInteger tmLap,tmCount;
if (havePerformanceCounter) {
- QueryPerformanceCounter((LARGE_INTEGER*)&tmLap);
- _CPU_diffTime64(&tm->start,&tmLap,&tmCount);
- return _CPU_calcMicroSec(&tmCount,countFreq.low);
- }
+ QueryPerformanceCounter((LARGE_INTEGER*)&tmLap);
+ _CPU_diffTime64(&tm->start,&tmLap,&tmCount);
+ return _CPU_calcMicroSec(&tmCount,countFreq.low);
+ }
else {
- tmLap.low = timeGetTime();
- return (tmLap.low - tm->start.low) * 1000L;
- }
+ tmLap.low = timeGetTime();
+ return (tmLap.low - tm->start.low) * 1000L;
+ }
}
/****************************************************************************
@@ -90,9 +90,9 @@ static void __LZTimerOff(
LZTimerObject *tm)
{
if (havePerformanceCounter)
- QueryPerformanceCounter((LARGE_INTEGER*)&tm->end);
+ QueryPerformanceCounter((LARGE_INTEGER*)&tm->end);
else
- tm->end.low = timeGetTime();
+ tm->end.low = timeGetTime();
}
/****************************************************************************
@@ -105,11 +105,11 @@ static ulong __LZTimerCount(
CPU_largeInteger tmCount;
if (havePerformanceCounter) {
- _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
- return _CPU_calcMicroSec(&tmCount,countFreq.low);
- }
+ _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
+ return _CPU_calcMicroSec(&tmCount,countFreq.low);
+ }
else
- return (tm->end.low - tm->start.low) * 1000L;
+ return (tm->end.low - tm->start.low) * 1000L;
}
/****************************************************************************
OpenPOWER on IntegriCloud