mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-02 00:32:22 +00:00
- AmigaOS: implemented XPRAM watchdog thread
- AmigaOS: disabled 68060 Super Bypass mode because of CPU bug triggered by MacOS 8 - minor documentation updates
This commit is contained in:
parent
049092ac3d
commit
81f357c42c
@ -19,6 +19,9 @@ V0.8 (snapshot) - <date>
|
|||||||
[Jürgen Lachmann]
|
[Jürgen Lachmann]
|
||||||
- AmigaOS: added MacsBug support (tested with MacsBug6.6.1),
|
- AmigaOS: added MacsBug support (tested with MacsBug6.6.1),
|
||||||
fixed <move sr,(sp)> bug [Jürgen Lachmann]
|
fixed <move sr,(sp)> bug [Jürgen Lachmann]
|
||||||
|
- AmigaOS: disabled 68060 Super Bypass mode because of CPU bug triggered
|
||||||
|
by MacOS 8
|
||||||
|
- AmigaOS: implemented XPRAM watchdog task
|
||||||
- AmigaOS/Unix/extfs_*.cpp: .finf helper file now stores complete
|
- AmigaOS/Unix/extfs_*.cpp: .finf helper file now stores complete
|
||||||
FInfo/FXInfo, replaced get/set_finder_*() functions by get/set_finfo()
|
FInfo/FXInfo, replaced get/set_finder_*() functions by get/set_finfo()
|
||||||
- AmigaOS/Unix: it's possible to specify preferences items on the
|
- AmigaOS/Unix: it's possible to specify preferences items on the
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Basilisk II, Version 0.8
|
Basilisk II, Version 0.8
|
||||||
A 68k Macintosh emulator
|
A 68k Macintosh emulator
|
||||||
|
|
||||||
Copyright (C) 1997-2000 Christian Bauer et al.
|
Copyright (C) 1997-2001 Christian Bauer et al.
|
||||||
|
|
||||||
|
|
||||||
License
|
License
|
||||||
|
@ -22,7 +22,6 @@ General:
|
|||||||
- Write a nice User's Manual with linuxdoc or something similar
|
- Write a nice User's Manual with linuxdoc or something similar
|
||||||
|
|
||||||
AmigaOS:
|
AmigaOS:
|
||||||
- XPRAM watchdog task
|
|
||||||
- "Create Hardfile..." button
|
- "Create Hardfile..." button
|
||||||
- Support for ShapeShifter External Video Drivers
|
- Support for ShapeShifter External Video Drivers
|
||||||
- Direct SCSI transfers, i.e. no buffering for contiguous transfers (can't check if the device
|
- Direct SCSI transfers, i.e. no buffering for contiguous transfers (can't check if the device
|
||||||
@ -46,6 +45,4 @@ Unix:
|
|||||||
- scsi_linux.cpp: adapt to SCSI Generic driver V2.0
|
- scsi_linux.cpp: adapt to SCSI Generic driver V2.0
|
||||||
- ESD vs. /dev/dsp should be a prefs item
|
- ESD vs. /dev/dsp should be a prefs item
|
||||||
- ESD is also available on Solaris
|
- ESD is also available on Solaris
|
||||||
- open /dev/dsp with O_NONBLOCK?
|
|
||||||
- serial_unix.cpp: provide a way to pipe input/output to programs
|
- serial_unix.cpp: provide a way to pipe input/output to programs
|
||||||
- NetBSD/m68k: FPU support
|
|
||||||
|
@ -9,7 +9,7 @@ DEFS =
|
|||||||
LDFLAGS = -noixemul
|
LDFLAGS = -noixemul
|
||||||
LIBS = /gg/lib/libnix/swapstack.o
|
LIBS = /gg/lib/libnix/swapstack.o
|
||||||
AS = PhxAss
|
AS = PhxAss
|
||||||
ASFLAGS = OPT ! INCPATH GG:os-include MACHINE=68020 FPU=1
|
ASFLAGS = OPT ! INCPATH GG:os-include FPU=1
|
||||||
|
|
||||||
## Files
|
## Files
|
||||||
SRCS = ../main.cpp main_amiga.cpp ../prefs.cpp ../prefs_items.cpp \
|
SRCS = ../main.cpp main_amiga.cpp ../prefs.cpp ../prefs_items.cpp \
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
XDEF _AtomicAnd
|
XDEF _AtomicAnd
|
||||||
XDEF _AtomicOr
|
XDEF _AtomicOr
|
||||||
XDEF _MoveVBR
|
XDEF _MoveVBR
|
||||||
|
XDEF _DisableSuperBypass
|
||||||
XDEF _Execute68k
|
XDEF _Execute68k
|
||||||
XDEF _Execute68kTrap
|
XDEF _Execute68kTrap
|
||||||
XDEF _TrapHandlerAsm
|
XDEF _TrapHandlerAsm
|
||||||
@ -50,6 +51,8 @@
|
|||||||
|
|
||||||
SECTION text,CODE
|
SECTION text,CODE
|
||||||
|
|
||||||
|
MACHINE 68020
|
||||||
|
|
||||||
*
|
*
|
||||||
* Atomic bit operations (don't trust the compiler)
|
* Atomic bit operations (don't trust the compiler)
|
||||||
*
|
*
|
||||||
@ -106,6 +109,29 @@ getvbr movec vbr,d0
|
|||||||
setvbr movec d0,vbr
|
setvbr movec d0,vbr
|
||||||
rte
|
rte
|
||||||
|
|
||||||
|
*
|
||||||
|
* Disable 68060 Super Bypass mode
|
||||||
|
*
|
||||||
|
|
||||||
|
_DisableSuperBypass
|
||||||
|
movem.l d0-d1/a0-a1/a5-a6,-(sp)
|
||||||
|
move.l _SysBase,a6
|
||||||
|
|
||||||
|
lea dissb,a5
|
||||||
|
JSRLIB Supervisor
|
||||||
|
|
||||||
|
movem.l (sp)+,d0-d1/a0-a1/a5-a6
|
||||||
|
rts
|
||||||
|
|
||||||
|
MACHINE 68060
|
||||||
|
|
||||||
|
dissb movec pcr,d0
|
||||||
|
bset #5,d0
|
||||||
|
movec d0,pcr
|
||||||
|
rte
|
||||||
|
|
||||||
|
MACHINE 68020
|
||||||
|
|
||||||
*
|
*
|
||||||
* Execute 68k subroutine (must be ended with rts)
|
* Execute 68k subroutine (must be ended with rts)
|
||||||
* r->a[7] and r->sr are unused!
|
* r->a[7] and r->sr are unused!
|
||||||
|
@ -108,6 +108,9 @@ static struct timerequest *timereq = NULL; // IORequest for timer
|
|||||||
static struct MsgPort *ahi_port = NULL; // Port for AHI
|
static struct MsgPort *ahi_port = NULL; // Port for AHI
|
||||||
static struct AHIRequest *ahi_io = NULL; // IORequest for AHI
|
static struct AHIRequest *ahi_io = NULL; // IORequest for AHI
|
||||||
|
|
||||||
|
static struct Process *xpram_proc = NULL; // XPRAM watchdog
|
||||||
|
static volatile bool xpram_proc_active = true; // Flag for quitting the XPRAM watchdog
|
||||||
|
|
||||||
static struct Process *tick_proc = NULL; // 60Hz process
|
static struct Process *tick_proc = NULL; // 60Hz process
|
||||||
static volatile bool tick_proc_active = true; // Flag for quitting the 60Hz process
|
static volatile bool tick_proc_active = true; // Flag for quitting the 60Hz process
|
||||||
|
|
||||||
@ -120,6 +123,7 @@ struct trap_regs;
|
|||||||
extern "C" void AtomicAnd(uint32 *p, uint32 val);
|
extern "C" void AtomicAnd(uint32 *p, uint32 val);
|
||||||
extern "C" void AtomicOr(uint32 *p, uint32 val);
|
extern "C" void AtomicOr(uint32 *p, uint32 val);
|
||||||
extern "C" void MoveVBR(void);
|
extern "C" void MoveVBR(void);
|
||||||
|
extern "C" void DisableSuperBypass(void);
|
||||||
extern "C" void TrapHandlerAsm(void);
|
extern "C" void TrapHandlerAsm(void);
|
||||||
extern "C" void ExceptionHandlerAsm(void);
|
extern "C" void ExceptionHandlerAsm(void);
|
||||||
extern "C" void IllInstrHandler(trap_regs *regs);
|
extern "C" void IllInstrHandler(trap_regs *regs);
|
||||||
@ -131,6 +135,7 @@ uint16 EmulatedSR; // Emulated SR (supervisor bit and interrupt mask)
|
|||||||
|
|
||||||
// Prototypes
|
// Prototypes
|
||||||
static void jump_to_rom(void);
|
static void jump_to_rom(void);
|
||||||
|
static void xpram_func(void);
|
||||||
static void tick_func(void);
|
static void tick_func(void);
|
||||||
|
|
||||||
|
|
||||||
@ -303,6 +308,10 @@ int main(int argc, char **argv)
|
|||||||
// Move VBR away from 0 if neccessary
|
// Move VBR away from 0 if neccessary
|
||||||
MoveVBR();
|
MoveVBR();
|
||||||
|
|
||||||
|
// On 68060, disable Super Bypass mode because of a CPU bug that is triggered by MacOS 8
|
||||||
|
if (CPUIs68060)
|
||||||
|
DisableSuperBypass();
|
||||||
|
|
||||||
// Install trap handler
|
// Install trap handler
|
||||||
EmulatedSR = 0x2700;
|
EmulatedSR = 0x2700;
|
||||||
OldTrapHandler = MainTask->tc_TrapCode;
|
OldTrapHandler = MainTask->tc_TrapCode;
|
||||||
@ -315,6 +324,14 @@ int main(int argc, char **argv)
|
|||||||
MainTask->tc_ExceptCode = (APTR)ExceptionHandlerAsm;
|
MainTask->tc_ExceptCode = (APTR)ExceptionHandlerAsm;
|
||||||
SetExcept(SIGBREAKF_CTRL_C | IRQSigMask, SIGBREAKF_CTRL_C | IRQSigMask);
|
SetExcept(SIGBREAKF_CTRL_C | IRQSigMask, SIGBREAKF_CTRL_C | IRQSigMask);
|
||||||
|
|
||||||
|
// Start XPRAM watchdog process
|
||||||
|
xpram_proc = CreateNewProcTags(
|
||||||
|
NP_Entry, (ULONG)xpram_func,
|
||||||
|
NP_Name, (ULONG)"Basilisk II XPRAM Watchdog",
|
||||||
|
NP_Priority, 0,
|
||||||
|
TAG_END
|
||||||
|
);
|
||||||
|
|
||||||
// Start 60Hz process
|
// Start 60Hz process
|
||||||
tick_proc = CreateNewProcTags(
|
tick_proc = CreateNewProcTags(
|
||||||
NP_Entry, (ULONG)tick_func,
|
NP_Entry, (ULONG)tick_func,
|
||||||
@ -362,13 +379,20 @@ void __saveds quit_emulator(void)
|
|||||||
|
|
||||||
void QuitEmulator(void)
|
void QuitEmulator(void)
|
||||||
{
|
{
|
||||||
// Stop 60Hz thread
|
// Stop 60Hz process
|
||||||
if (tick_proc) {
|
if (tick_proc) {
|
||||||
SetSignal(0, SIGF_SINGLE);
|
SetSignal(0, SIGF_SINGLE);
|
||||||
tick_proc_active = false;
|
tick_proc_active = false;
|
||||||
Wait(SIGF_SINGLE);
|
Wait(SIGF_SINGLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop XPRAM watchdog process
|
||||||
|
if (xpram_proc) {
|
||||||
|
SetSignal(0, SIGF_SINGLE);
|
||||||
|
xpram_proc_active = false;
|
||||||
|
Wait(SIGF_SINGLE);
|
||||||
|
}
|
||||||
|
|
||||||
// Restore stack
|
// Restore stack
|
||||||
if (stack_swapped) {
|
if (stack_swapped) {
|
||||||
stack_swapped = false;
|
stack_swapped = false;
|
||||||
@ -475,7 +499,7 @@ void TriggerNMI(void)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 60Hz thread
|
* 60Hz thread (really 60.15Hz)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static __saveds void tick_func(void)
|
static __saveds void tick_func(void)
|
||||||
@ -541,6 +565,30 @@ static __saveds void tick_func(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPRAM watchdog thread (saves XPRAM every minute)
|
||||||
|
*/
|
||||||
|
|
||||||
|
static __saveds void xpram_func(void)
|
||||||
|
{
|
||||||
|
uint8 last_xpram[256];
|
||||||
|
memcpy(last_xpram, XPRAM, 256);
|
||||||
|
|
||||||
|
while (xpram_proc_active) {
|
||||||
|
for (int i=0; i<60 && xpram_proc_active; i++)
|
||||||
|
Delay(50); // Only wait 1 second so we quit promptly when xpram_proc_active becomes false
|
||||||
|
if (memcmp(last_xpram, XPRAM, 256)) {
|
||||||
|
memcpy(last_xpram, XPRAM, 256);
|
||||||
|
SaveXPRAM();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main task asked for termination, send signal
|
||||||
|
Forbid();
|
||||||
|
Signal(MainTask, SIGF_SINGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Display error alert
|
* Display error alert
|
||||||
*/
|
*/
|
||||||
|
@ -774,7 +774,7 @@ static void *xpram_func(void *arg)
|
|||||||
{
|
{
|
||||||
while (!xpram_thread_cancel) {
|
while (!xpram_thread_cancel) {
|
||||||
for (int i=0; i<60 && !xpram_thread_cancel; i++)
|
for (int i=0; i<60 && !xpram_thread_cancel; i++)
|
||||||
Delay_usec(999999);
|
Delay_usec(999999); // Only wait 1 second so we quit promptly when xpram_thread_cancel becomes true
|
||||||
xpram_watchdog();
|
xpram_watchdog();
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user