mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-17 21:30:32 +00:00
install rootless code when opening video driver
This commit is contained in:
parent
fef996ed2f
commit
fa827b5c2a
@ -54,19 +54,25 @@ static const uint8 rootless_proc[] = {
|
||||
static uint32 rootless_proc_ptr = 0;
|
||||
static uint32 low_mem_map = 0;
|
||||
|
||||
void InstallRootlessProc() {
|
||||
int16 InstallRootlessProc() {
|
||||
// Rootless mode support
|
||||
M68kRegisters r;
|
||||
if (PrefsFindBool("rootless")) {
|
||||
printf("Installing rootless support\n");
|
||||
r.d[0] = sizeof(rootless_proc);
|
||||
Execute68kTrap(0xa71e, &r); // NewPtrSysClear()
|
||||
if (r.a[0] == 0) {
|
||||
return memFullErr;
|
||||
}
|
||||
rootless_proc_ptr = r.a[0];
|
||||
printf("Installing rootless support: 0x%x\n", rootless_proc_ptr);
|
||||
Host2Mac_memcpy(rootless_proc_ptr, rootless_proc, sizeof(rootless_proc));
|
||||
low_mem_map = 0;
|
||||
printf("Installed at 0x%x\n", rootless_proc_ptr);
|
||||
} else {
|
||||
rootless_proc_ptr = 0;
|
||||
low_mem_map = 0;
|
||||
}
|
||||
return noErr;
|
||||
}
|
||||
|
||||
static struct {
|
||||
|
@ -754,11 +754,6 @@ void InstallDrivers(uint32 pb)
|
||||
r.a[0] = pb;
|
||||
Execute68kTrap(0xa000, &r); // Open()
|
||||
}
|
||||
|
||||
#ifdef VIDEO_ROOTLESS
|
||||
extern void InstallRootlessProc(void);
|
||||
InstallRootlessProc();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -482,6 +482,12 @@ int16 monitor_desc::driver_open(void)
|
||||
|
||||
// Init color palette (solid gray)
|
||||
set_gray_palette();
|
||||
|
||||
// Enable rootless video
|
||||
#ifdef VIDEO_ROOTLESS
|
||||
extern int16 InstallRootlessProc(void);
|
||||
return InstallRootlessProc();
|
||||
#endif
|
||||
return noErr;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user