/*
GLOBGLUE.c
Copyright (C) 2003 Bernd Schmidt, Philip Cummins, Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*//*
GLOBal GLUE (or GLOB of GLUE)
Holds the program together.
Some code here adapted from "custom.c" in vMac by Philip Cummins,
in turn descended from code in the Un*x Amiga Emulator by
Bernd Schmidt.
*/#ifndef AllFiles#include"SYSDEPNS.h"#include"MYOSGLUE.h"#include"ENDIANAC.h"#include"EMCONFIG.h"#endif#include"GLOBGLUE.h"/*
ReportAbnormalID unused 0x111D - 0x11FF
*//*
ReportAbnormalID ranges unused 0x12xx - 0xFFxx
*/IMPORTPROCm68k_reset(void);IMPORTPROCIWM_Reset(void);IMPORTPROCSCC_Reset(void);IMPORTPROCSCSI_Reset(void);IMPORTPROCVIA1_Reset(void);#if EmVIA2IMPORTPROCVIA2_Reset(void);#endifIMPORTPROCSony_Reset(void);IMPORTPROCExtnDisk_Access(CPTRp);IMPORTPROCExtnSony_Access(CPTRp);#if EmVidCardIMPORTPROCExtnVideo_Access(CPTRp);#endifIMPORTPROCSony_SetQuitOnEject(void);IMPORTPROCm68k_IPLchangeNtfy(void);IMPORTPROCMINEM68K_Init(ui3b*fIPL);IMPORTFUNCui5bGetCyclesRemaining(void);IMPORTPROCSetCyclesRemaining(ui5bn);IMPORTPROCSetHeadATTel(ATTepp);IMPORTFUNCATTepFindATTel(CPTRaddr);IMPORTFUNCui5bSCSI_Access(ui5bData,blnrWriteMem,CPTRaddr);IMPORTFUNCui5bSCC_Access(ui5bData,blnrWriteMem,CPTRaddr);IMPORTFUNCui5bIWM_Access(ui5bData,blnrWriteMem,CPTRaddr);IMPORTFUNCui5bVIA1_Access(ui5bData,blnrWriteMem,CPTRaddr);#if EmVIA2IMPORTFUNCui5bVIA2_Access(ui5bData,blnrWriteMem,CPTRaddr);#endif#if EmASCIMPORTFUNCui5bASC_Access(ui5bData,blnrWriteMem,CPTRaddr);#endifIMPORTFUNCui3rget_vm_byte(CPTRaddr);IMPORTFUNCui4rget_vm_word(CPTRaddr);IMPORTFUNCui5rget_vm_long(CPTRaddr);IMPORTPROCput_vm_byte(CPTRaddr,ui3rb);IMPORTPROCput_vm_word(CPTRaddr,ui4rw);IMPORTPROCput_vm_long(CPTRaddr,ui5rl);GLOBALVARui5rmy_disk_icon_addr;GLOBALPROCcustomreset(void){IWM_Reset();SCC_Reset();SCSI_Reset();VIA1_Reset();#if EmVIA2VIA2_Reset();#endifSony_Reset();Extn_Reset();#if CurEmMd <= kEmMd_PlusWantMacReset=trueblnr;/*
kludge, code in Finder appears
to do RESET and not expect
to come back. Maybe asserting
the RESET somehow causes
other hardware compenents to
later reset the 68000.
*/#endif}GLOBALVARui3pRAM=nullpr;#if EmVidCardGLOBALVARui3pVidROM=nullpr;#endif#if IncludeVidMemGLOBALVARui3pVidMem=nullpr;#endifGLOBALVARui3bWires[kNumWires];#if WantDisasmIMPORTPROCm68k_WantDisasmContext(void);#endif#if WantDisasmGLOBALPROCdbglog_StartLine(void){m68k_WantDisasmContext();dbglog_writeCStr("");}#endif#if dbglog_HAVEGLOBALPROCdbglog_WriteMemArrow(blnrWriteMem){if(WriteMem){dbglog_writeCStr(" <- ");}else{dbglog_writeCStr(" -> ");}}#endif#if dbglog_HAVEGLOBALPROCdbglog_AddrAccess(char*s,ui5rData,blnrWriteMem,ui5raddr){dbglog_StartLine();dbglog_writeCStr(s);dbglog_writeCStr("[");dbglog_writeHex(addr);dbglog_writeCStr("]");dbglog_WriteMemArrow(WriteMem);dbglog_writeHex(Data);dbglog_writeReturn();}#endif#if dbglog_HAVEGLOBALPROCdbglog_Access(char*s,ui5rData,blnrWriteMem){dbglog_StartLine();dbglog_writeCStr(s);dbglog_WriteMemArrow(WriteMem);dbglog_writeHex(Data);dbglog_writeReturn();}#endif#if dbglog_HAVEGLOBALPROCdbglog_WriteNote(char*s){dbglog_StartLine();dbglog_writeCStr(s);dbglog_writeReturn();}#endif#if dbglog_HAVEGLOBALPROCdbglog_WriteSetBool(char*s,blnrv){dbglog_StartLine();dbglog_writeCStr(s);dbglog_writeCStr(" <- ");if(v){dbglog_writeCStr("1");}else{dbglog_write