minivmac4ios/Mini vMac/mnvm_core/GLOBGLUE.h

1 line
5.7 KiB
C
Raw Normal View History

2016-05-01 17:05:36 +00:00
/* GLOBGLUE.h 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. */ #ifdef GLOBGLUE_H #error "header already included" #else #define GLOBGLUE_H #endif #define kEmMd_128K 0 #define kEmMd_512Ke 1 #define kEmMd_Plus 2 #define kEmMd_SE 3 #define kEmMd_SEFDHD 4 #define kEmMd_Classic 5 #define kEmMd_PB100 6 #define kEmMd_II 7 #define kEmMd_IIx 8 #define RAMSafetyMarginFudge 4 #define kRAM_Size (kRAMa_Size + kRAMb_Size) EXPORTVAR(ui3p, RAM) /* allocated by MYOSGLUE to be at least kRAM_Size + RAMSafetyMarginFudge bytes. Because of shortcuts taken in GLOBGLUE.c, it is in theory possible for the emulator to write up to 3 bytes past kRAM_Size. */ #if EmVidCard EXPORTVAR(ui3p, VidROM) #endif #if IncludeVidMem EXPORTVAR(ui3p, VidMem) #endif EXPORTPROC MemOverlay_ChangeNtfy(void); #if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) EXPORTPROC Addr32_ChangeNtfy(void); #endif /* representation of pointer into memory of emulated computer. */ typedef ui5b CPTR; /* mapping of address space to real memory */ EXPORTFUNC ui3p get_real_address0(ui5b L, blnr WritableMem, CPTR addr, ui5b *actL); /* memory access routines that can use when have address that is known to be in RAM (and that is in the first copy of the ram, not the duplicates, i.e. < kRAM_Size). */ #define get_ram_byte(addr) do_get_mem_byte((addr) + RAM) #define get_ram_word(addr) do_get_mem_word((addr) + RAM) #define get_ram_long(addr) do_get_mem_long((addr) + RAM) #define put_ram_byte(addr, b) do_put_mem_byte((addr) + RAM, (b)) #define put_ram_word(addr, w) do_put_mem_word((addr) + RAM, (w)) #define put_ram_long(addr, l) do_put_mem_long((addr) + RAM, (l)) #define get_ram_address(addr) ((addr) + RAM) /* accessing addresses that don't map to real memory, i.e. memory mapped devices */ EXPORTFUNC blnr AddrSpac_Init(void); #define ui5r_FromSByte(x) ((ui5r)(si5r)(si3b)(ui3b)(x)) #define ui5r_FromSWord(x) ((ui5r)(si5r)(si4b)(ui4b)(x)) #define ui5r_FromSLong(x) ((ui5r)(si5r)(si5b)(ui5b)(x)) #define ui5r_FromUByte(x) ((ui5r)(ui3b)(x)) #define ui5r_FromUWord(x) ((ui5r)(ui4b)(x)) #define ui5r_FromULong(x) ((ui5r)(ui5b)(x)) #define LOCALPROCUSEDONCE LOCALFUNC MayInline void #if WantDisasm EXPORTPROC dbglog_StartLine(void); #else #define dbglog_StartLine() #endif #if dbglog_HAVE EXPORTPROC dbglog_WriteMemArrow(blnr WriteMem); EXPORTPROC dbglog_WriteNote(char *s); EXPORTPROC dbglog_WriteSetBool(char *s, blnr v); EXPORTPROC dbglog_AddrAccess(char *s, ui5r Data, blnr WriteMem, ui5r addr); EXPORTPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem); #endif #if dbglog_HAVE #define ReportAbnormal DoReportAbnormal EXPORTPROC DoReportAbnormal(char *s); #else #define ReportAbnormal(s) DoReportAbnormal() EXPORTPROC DoReportAbnormal(void); #endif EXPORTPROC VIAorSCCinterruptChngNtfy(void); EXPORTVAR(blnr, InterruptButton) EXPORTPROC SetInterruptButton(blnr v); enum { kICT_SubTick, #if EmClassicKbrd kICT_Kybd_ReceiveCommand, kICT_Kybd_ReceiveEndCommand, #endif #if EmADB kICT_ADB_NewState, #endif #if EmPMU kICT_PMU_Task, #endif kICT_VIA1_Timer1Check, kICT_VIA1_Timer2Check, #if EmVIA2 kICT_VIA2_Timer1Check, kICT_VIA2_Timer2Check, #endif kNumICTs }; EXPORTPROC ICT_add(int taskid, ui5b n); #define iCountt ui5b EXPORTFUNC iCountt GetCuriCount(void); EXPORTPROC ICT_Zap(void); EXPORTVAR(uimr, ICTactive) EXPORTVAR(iCountt, ICTwhen[kNumICTs]) EXPORTVAR(iCountt, NextiCount) EXPORTVAR(ui3b, Wires[kNumWires]) #define kLn2CycleScale 6 #define kCycleScale (1 << kLn2CycleScale) #if WantCycByPriOp #define RdAvgXtraCy