mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-11-29 05:49:21 +00:00
1 line
36 KiB
C
1 line
36 KiB
C
|
/*
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"
IMPORTPROC m68k_reset(void);
IMPORTPROC IWM_Reset(void);
IMPORTPROC SCC_Reset(void);
IMPORTPROC SCSI_Reset(void);
IMPORTPROC VIA1_Reset(void);
#if EmVIA2
IMPORTPROC VIA2_Reset(void);
#endif
IMPORTPROC Sony_Reset(void);
IMPORTPROC ExtnDisk_Access(CPTR p);
IMPORTPROC ExtnSony_Access(CPTR p);
#if EmVidCard
IMPORTPROC ExtnVideo_Access(CPTR p);
#endif
IMPORTPROC Sony_SetQuitOnEject(void);
IMPORTPROC m68k_IPLchangeNtfy(void);
IMPORTPROC MINEM68K_Init(
ui3b *fIPL);
IMPORTFUNC ui5b GetCyclesRemaining(void);
IMPORTPROC SetCyclesRemaining(ui5b n);
IMPORTPROC SetHeadATTel(ATTep p);
IMPORTFUNC ATTep FindATTel(CPTR addr);
IMPORTFUNC ui5b SCSI_Access(ui5b Data, blnr WriteMem, CPTR addr);
IMPORTFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr);
IMPORTFUNC ui5b IWM_Access(ui5b Data, blnr WriteMem, CPTR addr);
IMPORTFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr);
#if EmVIA2
IMPORTFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr);
#endif
#if EmASC
IMPORTFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr);
#endif
IMPORTFUNC ui3r get_vm_byte(CPTR addr);
IMPORTFUNC ui4r get_vm_word(CPTR addr);
IMPORTFUNC ui5r get_vm_long(CPTR addr);
IMPORTPROC put_vm_byte(CPTR addr, ui3r b);
IMPORTPROC put_vm_word(CPTR addr, ui4r w);
IMPORTPROC put_vm_long(CPTR addr, ui5r l);
GLOBALVAR ui5r my_disk_icon_addr;
GLOBALPROC customreset(void)
{
IWM_Reset();
SCC_Reset();
SCSI_Reset();
VIA1_Reset();
#if EmVIA2
VIA2_Reset();
#endif
Sony_Reset();
Extn_Reset();
#if CurEmMd <= kEmMd_Plus
WantMacReset = 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
}
GLOBALVAR ui3p RAM = nullpr;
#if EmVidCard
GLOBALVAR ui3p VidROM = nullpr;
#endif
#if IncludeVidMem
GLOBALVAR ui3p VidMem = nullpr;
#endif
GLOBALVAR ui3b Wires[kNumWires];
#if WantDisasm
IMPORTPROC m68k_WantDisasmContext(void);
#endif
#if WantDisasm
GLOBALPROC dbglog_StartLine(void)
{
m68k_WantDisasmContext();
dbglog_writeCStr(" ");
}
#endif
#if dbglog_HAVE
GLOBALPROC dbglog_WriteMemArrow(blnr WriteMem)
{
if (WriteMem) {
dbglog_writeCStr(" <- ");
} else {
dbglog_writeCStr(" -> ");
}
}
#endif
#if dbglog_HAVE
GLOBALPROC dbglog_AddrAccess(char *s, ui5r Data,
blnr WriteMem, ui5r addr)
{
dbglog_StartLine();
dbglog_writeCStr(s);
dbglog_writeCStr("[");
dbglog_writeHex(addr);
dbglog_writeCStr("]");
dbglog_WriteMemArrow(WriteMem);
dbglog_writeHex(Data);
dbglog_writeReturn();
}
#endif
#if dbglog_HAVE
GLOBALPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem)
{
dbglog_StartLine();
dbglog_writeCStr(s);
dbglog_WriteMemArrow(WriteMem);
dbglog_writeHex(Data);
dbglog_writeReturn();
}
#endif
#if dbglog_HAVE
GLOBALPROC dbglog_WriteNote(char *s)
{
dbglog_StartLine();
dbglog_writeCStr(s);
dbglog_writeReturn();
}
#endif
#if dbglog_HAVE
GLOBALPROC dbglog_WriteSetBool(char *s, blnr v)
{
dbglog_StartLine();
dbglog_writeCStr(s);
dbglog_writeCStr(" <- ");
if (v) {
dbglog_writeCStr("1");
} else {
dbglog_writeCStr("0");
}
dbglog_writeReturn();
}
#endif
LOCALVAR blnr GotOneAbnormal = falseblnr;
#ifndef Repor
|