mirror of
https://github.com/InvisibleUp/uvmac.git
synced 2025-01-21 16:30:02 +00:00
Try to get Mac II emulation working again
This commit is contained in:
parent
b4854c1546
commit
98f4e216c0
@ -4,7 +4,7 @@
|
||||
// Max VRAM on Mac II(x) is 2MiB
|
||||
|
||||
// Supported Macintosh models
|
||||
enum MacModel {
|
||||
typedef enum MacModel {
|
||||
mdl_Twig43, // Twiggy prototype (ROM 4.3T 07/04/83)
|
||||
mdl_Twiggy, // Twiggy prototype (later)
|
||||
mdl_m128K, // 128K
|
||||
@ -17,10 +17,10 @@ enum MacModel {
|
||||
mdl_PB100, // PowerBook 100
|
||||
mdl_II, // II
|
||||
mdl_IIx // IIx
|
||||
};
|
||||
} MacModel_t;
|
||||
|
||||
// Supported ROM types
|
||||
enum MacROM {
|
||||
typedef enum MacROM {
|
||||
rom_Twig43, // ROM 4.3T 07/04/83
|
||||
rom_Twiggy, // Twiggy prototype (later)
|
||||
rom_64K, // 128K/512K
|
||||
@ -30,41 +30,41 @@ enum MacROM {
|
||||
rom_IIx, // Mac II FDHD, IIx, IIcx
|
||||
rom_PB100, // PowerBook 100
|
||||
rom_Classic // Mac Classic
|
||||
};
|
||||
} MacROM_t;
|
||||
|
||||
enum M68KType {
|
||||
typedef enum M68KType {
|
||||
m68000,
|
||||
m68020,
|
||||
m68020FPU
|
||||
};
|
||||
} M68KType_t;
|
||||
|
||||
// ROM information. Duplicate MacROMs are alternate ROMS also supported
|
||||
struct MacROMInfo {
|
||||
enum MacROM;
|
||||
MacROM_t rom;
|
||||
uint32_t cksum;
|
||||
uint32_t size;
|
||||
};
|
||||
const struct MacROMInfo MacROMInfoTable[] = {
|
||||
{rom_Twig43, 0x27F4E04B, 2 << 16},
|
||||
{rom_Twiggy, 0x2884371D, 2 << 16},
|
||||
{rom_64K, 0x28BA61CE, 2 << 16}, // Mac 128K (?)
|
||||
{rom_64K, 0x28BA4E50, 2 << 16}, // Mac 512K (?)
|
||||
{rom_128K, 0x4D1EEEE1, 2 << 17}, // v1, 'Lonely Hearts'
|
||||
{rom_128K, 0x4D1EEAE1, 2 << 17}, // v2, 'Lonely Heifers'
|
||||
{rom_128K, 0x4D1F8172, 2 << 17}, // v3, 'Loud Harmonicas'
|
||||
{rom_SE, 0xB2E362A8, 2 << 18},
|
||||
{rom_II, 0x97851DB6, 2 << 18}, // v1
|
||||
{rom_II, 0x9779D2C4, 2 << 18}, // v2
|
||||
{rom_IIx, 0x97221136, 2 << 18},
|
||||
{rom_PB100, 0x96645F9C, 2 << 18}
|
||||
{rom_Twig43, 0x27F4E04B, 1 << 16},
|
||||
{rom_Twiggy, 0x2884371D, 1 << 16},
|
||||
{rom_64K, 0x28BA61CE, 1 << 16}, // Mac 128K (?)
|
||||
{rom_64K, 0x28BA4E50, 1 << 16}, // Mac 512K (?)
|
||||
{rom_128K, 0x4D1EEEE1, 1 << 17}, // v1, 'Lonely Hearts'
|
||||
{rom_128K, 0x4D1EEAE1, 1 << 17}, // v2, 'Lonely Heifers'
|
||||
{rom_128K, 0x4D1F8172, 1 << 17}, // v3, 'Loud Harmonicas'
|
||||
{rom_SE, 0xB2E362A8, 1 << 18},
|
||||
{rom_II, 0x97851DB6, 1 << 18}, // v1
|
||||
{rom_II, 0x9779D2C4, 1 << 18}, // v2
|
||||
{rom_IIx, 0x97221136, 1 << 18},
|
||||
{rom_PB100, 0x96645F9C, 1 << 18}
|
||||
};
|
||||
|
||||
// Model information
|
||||
// We're using base models for RAM and such; no addons
|
||||
struct MacModelInfo {
|
||||
enum MacModel;
|
||||
enum MacROM;
|
||||
enum M68KType;
|
||||
MacModel_t MacModel;
|
||||
MacROM_t MacROM;
|
||||
M68KType_t M68KType;
|
||||
uint32_t RAMaSize; // RAM in first address space (?)
|
||||
uint32_t RAMbSize;
|
||||
uint32_t RAMvidSize; // External video RAM size
|
||||
@ -88,14 +88,14 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.MacModel = mdl_Twig43,
|
||||
.MacROM = rom_Twig43,
|
||||
.M68KType = m68000,
|
||||
.RAMaSize = 2 >> 16,
|
||||
.RAMaSize = 2 << 16,
|
||||
.RAMbSize = 0,
|
||||
.RAMvidSize = 0,
|
||||
.hres = 512,
|
||||
.vres = 384,
|
||||
.bpp = 1,
|
||||
.MaxATTListN = 16,
|
||||
.ClockMult = 1,
|
||||
.ClockSpeed = 1,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
@ -109,13 +109,13 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.MacROM = rom_Twiggy,
|
||||
.M68KType = m68000,
|
||||
.RAMaSize = 2 >> 16,
|
||||
.RAMbSize = 0,
|
||||
<<AMbSize = 0,
|
||||
.RAMvidSize = 0,
|
||||
.hres = 512,
|
||||
.vres = 384,
|
||||
.bpp = 1,
|
||||
.MaxATTListN = 16,
|
||||
.ClockMult = 1,
|
||||
.ClockSpeed = 1,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
@ -126,7 +126,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
// 128K
|
||||
{
|
||||
.MacModel = mdl_m128K,
|
||||
.MacROM = rom_64k,
|
||||
.MacROM = rom_64K,
|
||||
.M68KType = m68000,
|
||||
.RAMaSize = 2 >> 16,
|
||||
.RAMbSize = 0,
|
||||
@ -135,7 +135,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.vres = 384,
|
||||
.bpp = 1,
|
||||
.MaxATTListN = 16,
|
||||
.ClockMult = 1,
|
||||
.ClockSpeed = 1,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
@ -146,7 +146,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
// 512K
|
||||
{
|
||||
.MacModel = mdl_m512K,
|
||||
.MacROM = rom_64k,
|
||||
.MacROM = rom_64K,
|
||||
.M68KType = m68000,
|
||||
.RAMaSize = 2 >> 19,
|
||||
.RAMbSize = 0,
|
||||
@ -155,7 +155,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.vres = 384,
|
||||
.bpp = 1,
|
||||
.MaxATTListN = 16,
|
||||
.ClockMult = 1,
|
||||
.ClockSpeed = 1,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
@ -166,7 +166,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
// 512Ke
|
||||
{
|
||||
.MacModel = mdl_m512Ke,
|
||||
.MacROM = rom_128k,
|
||||
.MacROM = rom_128K,
|
||||
.M68KType = m68000,
|
||||
.RAMaSize = 2 >> 19,
|
||||
.RAMbSize = 0,
|
||||
@ -175,7 +175,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.vres = 384,
|
||||
.bpp = 1,
|
||||
.MaxATTListN = 16,
|
||||
.ClockMult = 1,
|
||||
.ClockSpeed = 1,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
@ -186,7 +186,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
// Plus
|
||||
{
|
||||
.MacModel = mdl_Plus,
|
||||
.MacROM = rom_128k,
|
||||
.MacROM = rom_128K,
|
||||
.M68KType = m68000,
|
||||
.RAMaSize = 2 >> 19, // same RAM for SE, SEFDHD, Classic
|
||||
.RAMbSize = 2 >> 19,
|
||||
@ -195,7 +195,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.vres = 384,
|
||||
.bpp = 1,
|
||||
.MaxATTListN = 16,
|
||||
.ClockMult = 1,
|
||||
.ClockSpeed = 1,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
@ -215,7 +215,7 @@ const struct MacModelInfo MacModelInfoTable[] = {
|
||||
.vres = 480,
|
||||
.bpp = 8,
|
||||
.MaxATTListN = 20,
|
||||
.ClockMult = 2,
|
||||
.ClockSpeed = 2,
|
||||
.ADB = false,
|
||||
.RTC = false,
|
||||
.PMU = false,
|
||||
|
@ -39,8 +39,6 @@
|
||||
#define MKC_formac_RShift MKC_Shift
|
||||
#define MKC_UnMappedKey MKC_Control
|
||||
|
||||
#define CurEmMd kEmMd_Plus
|
||||
|
||||
#define MaxATTListN 32
|
||||
#define IncludeExtnPbufs 1
|
||||
// temporary
|
||||
@ -57,11 +55,13 @@
|
||||
#define AutoKeyThresh 0x06
|
||||
#define AutoKeyRate 0x03
|
||||
|
||||
#if (CurEmMd == kEmMd_Plus)
|
||||
#include "MACPLUS.h"
|
||||
#elif (CurEmMd == kEmMd_II)
|
||||
#define CurEmMd kEmMd_II
|
||||
|
||||
//#if (CurEmMd == kEmMd_Plus)
|
||||
//#include "MACPLUS.h"
|
||||
//#elif (CurEmMd == kEmMd_II)
|
||||
#include "MACII.h"
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#define WantDisasm 0
|
||||
#define ExtraAbnormalReports 0
|
||||
|
@ -7,17 +7,20 @@
|
||||
you know what you're doing.
|
||||
*/
|
||||
|
||||
//#define EmClassicKbrd 0
|
||||
//#define EmADB 1
|
||||
//#define EmRTC 1
|
||||
//#define EmPMU 0
|
||||
//#define EmVIA2 1
|
||||
#pragma once
|
||||
|
||||
#define EmClassicKbrd 0
|
||||
#define EmADB 1
|
||||
#define EmRTC 1
|
||||
#define EmPMU 0
|
||||
#define EmVIA2 1
|
||||
#define Use68020 1
|
||||
#define EmFPU 1
|
||||
//#define EmFPU 1 //temporarily disable, because it's broken
|
||||
#define EmFPU 0
|
||||
#define EmMMU 0
|
||||
#define EmASC 1
|
||||
|
||||
#define kMyClockMult 2
|
||||
#define ClockMult 2
|
||||
|
||||
#define WantCycByPriOp 0
|
||||
#define WantCloserCyc 0
|
||||
@ -36,6 +39,11 @@
|
||||
#define EmVidCard 1
|
||||
#define kVidROM_Size 0x000800
|
||||
|
||||
#define RomFileName "MacII.ROM"
|
||||
#define kRomCheckSum1 0x97851DB
|
||||
#define kRomCheckSum2 0x9779D2C
|
||||
#define kROM_Size (1 << 18)
|
||||
|
||||
/* the Wire variables are 1/0, not true/false */
|
||||
|
||||
enum {
|
17
meson.build
17
meson.build
@ -78,6 +78,7 @@ HW_SRC = {
|
||||
# 'src/HW/M68K/DISAM68K.c',
|
||||
'src/HW/M68K/M68KITAB.c',
|
||||
'src/HW/M68K/MINEM68K.c',
|
||||
# 'src/HW/M68K/FPCPEMDV.c',
|
||||
],
|
||||
'MOUSE': [
|
||||
'src/HW/MOUSE/MOUSEMDV.c',
|
||||
@ -99,9 +100,11 @@ HW_SRC = {
|
||||
'src/HW/SCSI/SCSIEMDV.c',
|
||||
],
|
||||
'SOUND': [
|
||||
# 'src/HW/SOUND/ASCEMDEV.c',
|
||||
'src/HW/SOUND/SNDEMDEV.c',
|
||||
],
|
||||
'SOUND_ASC': [
|
||||
'src/HW/SOUND/ASCEMDEV.c',
|
||||
],
|
||||
'VIA1': [
|
||||
'src/HW/VIA/VIAEMDEV.c',
|
||||
],
|
||||
@ -113,21 +116,19 @@ HW_SRC = {
|
||||
],
|
||||
}
|
||||
|
||||
MAC_SRC_COMMON = HW_SRC['DISK'] + HW_SRC['M68K'] + HW_SRC['RTC'] + HW_SRC['SOUND'] + HW_SRC['VIA1']
|
||||
MAC_SRC_COMMON = HW_SRC['DISK'] + HW_SRC['M68K'] + HW_SRC['RTC'] + HW_SRC['SOUND'] + HW_SRC['VIA1'] + HW_SRC['SCREEN'] + HW_SRC['SCC'] + HW_SRC['SCSI'] + HW_SRC['MOUSE']
|
||||
|
||||
# Macintosh definitions
|
||||
MAC_SRC = {
|
||||
'Plus':
|
||||
MAC_SRC_COMMON +
|
||||
HW_SRC['SCREEN'] +
|
||||
HW_SRC['SCC'] +
|
||||
HW_SRC['SCSI'] +
|
||||
HW_SRC['MOUSE'] +
|
||||
HW_SRC['KBRD'],
|
||||
'II':
|
||||
MAC_SRC_COMMON +
|
||||
HW_SRC['VIDCARD'] +
|
||||
HW_SRC['ADB'],
|
||||
HW_SRC['ADB'] +
|
||||
HW_SRC['VIA2'] +
|
||||
HW_SRC['SOUND_ASC']
|
||||
}
|
||||
|
||||
# User interface definitions
|
||||
@ -165,7 +166,7 @@ EMU_INC = include_directories([
|
||||
# Just gonna do an SDL2 Mac Plus for now
|
||||
executable(
|
||||
'microvmac',
|
||||
sources: MAC_SRC['Plus'] + UI_SRC + EMU_SRC,
|
||||
sources: MAC_SRC['II'] + UI_SRC + EMU_SRC,
|
||||
dependencies: [lSDL2],
|
||||
include_directories: EMU_INC,
|
||||
)
|
||||
|
@ -18,8 +18,6 @@
|
||||
Apple Desktop Bus EMulated DEVice
|
||||
*/
|
||||
|
||||
#if EmADB
|
||||
|
||||
#ifndef AllFiles
|
||||
#include "EMCONFIG.h"
|
||||
#include "SYSDEPNS.h"
|
||||
@ -214,5 +212,3 @@ GLOBALPROC ADB_Update(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
1222
src/HW/M68K/FPCPEMDV.c
Normal file
1222
src/HW/M68K/FPCPEMDV.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -262,28 +262,28 @@ LOCALVAR struct regstruct
|
||||
|
||||
|
||||
#ifdef r_regs
|
||||
register struct regstruct *g_regs asm (r_regs);
|
||||
struct regstruct *g_regs asm (r_regs);
|
||||
#define V_regs (*g_regs)
|
||||
#else
|
||||
#define V_regs regs
|
||||
#endif
|
||||
|
||||
#ifdef r_pc_p
|
||||
register uint8_t * g_pc_p asm (r_pc_p);
|
||||
uint8_t * g_pc_p asm (r_pc_p);
|
||||
#define V_pc_p g_pc_p
|
||||
#else
|
||||
#define V_pc_p V_regs.pc_p
|
||||
#endif
|
||||
|
||||
#ifdef r_MaxCyclesToGo
|
||||
register int32_t g_MaxCyclesToGo asm (r_MaxCyclesToGo);
|
||||
int32_t g_MaxCyclesToGo asm (r_MaxCyclesToGo);
|
||||
#define V_MaxCyclesToGo g_MaxCyclesToGo
|
||||
#else
|
||||
#define V_MaxCyclesToGo V_regs.MaxCyclesToGo
|
||||
#endif
|
||||
|
||||
#ifdef r_pc_pHi
|
||||
register uint8_t * g_pc_pHi asm (r_pc_pHi);
|
||||
uint8_t * g_pc_pHi asm (r_pc_pHi);
|
||||
#define V_pc_pHi g_pc_pHi
|
||||
#else
|
||||
#define V_pc_pHi V_regs.pc_pHi
|
||||
@ -8202,13 +8202,6 @@ LOCALIPROC DoCodeMMU(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EmFPU
|
||||
|
||||
#include "FPMATHEM.h"
|
||||
#include "FPCPEMDV.h"
|
||||
|
||||
#endif
|
||||
|
||||
#if HaveGlbReg
|
||||
LOCALPROC Em_Swap(void)
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ LOCALPROC WarnMsgUnsupportedROM(void)
|
||||
|
||||
MacErr_t ROM_IsValid(void)
|
||||
{
|
||||
if(CheckRomCheckSum) {
|
||||
/*if(CheckRomCheckSum) {
|
||||
uint32_t CheckSum = Calc_Checksum();
|
||||
|
||||
if (CheckSum != do_get_mem_long(ROM)) {
|
||||
@ -107,7 +107,7 @@ MacErr_t ROM_IsValid(void)
|
||||
WarnMsgUnsupportedROM();
|
||||
return mnvm_miscErr;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
ROM_loaded = true;
|
||||
SpeedStopped = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user