implemented check if running on EmuTOS
This commit is contained in:
@@ -105,11 +105,17 @@ int main(int argc, char *argv[])
|
||||
struct driver_table *dt;
|
||||
void *ssp;
|
||||
void *old_vector;
|
||||
char **sysbase = (char **) 0x4f2;
|
||||
|
||||
(void) Cconws("retrieve BaS driver interface\r\n");
|
||||
|
||||
ssp = (void *) Super(0L);
|
||||
ssp = (void *) Super(0L); /* go to supervisor mode, we are doing dirty tricks */
|
||||
|
||||
/*
|
||||
* first check if we are on EmuTOS, FireTOS want's to do everything itself
|
||||
*/
|
||||
if (* (long *)(*sysbase + 0x2c) == 0x45544f53)
|
||||
{
|
||||
old_vector = Setexc(0x20, my_own_trap0_handler); /* set our own temporarily */
|
||||
dt = get_bas_drivers(); /* trap #1 */
|
||||
(void) Setexc(0x20, old_vector); /* restore original vector */
|
||||
@@ -136,6 +142,11 @@ int main(int argc, char *argv[])
|
||||
ifc++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("not running on EmuTOS, exiting\r\n");
|
||||
}
|
||||
Super(ssp);
|
||||
|
||||
while (Cconis()) Cconin(); /* eat keys */
|
||||
|
||||
Reference in New Issue
Block a user