A lightweight Macintosh 128K Emulator leveraging lib68k
The ambition behind this project is to leverage another means by which I can utilise my Motorola 68000 Emulation Library to create another emulator to laisse between. Created using pure C99, I aim to provide a lightweight means of communicating with my Emulation Library in conjunction with new additions for laissing with flat-memory regions for IO and Device Handlers.
Everything so far is a WIP. Although, majority of what is provided here aims to just be a modularisation of lib68k_mem's functionality, to handle Memory Management and subsequent Bus-related infrastructures.
This section will continue to expand as more is added.
Much like the contemporary of lib68k, I have opted to utilise a similar scheme for being able to define and initialise aspects within the lookup table. Due to the very little ISA of the VIA within the Macintosh 128K, the benefit is being able to declare a small lookup table as an extension of the struct declaration - otherwise mitigiating the need to declare a function pointer to delegate across all relevant source implementations.
This helps especially with initialising variables that would need to be initialised otherwise for startup
// ACCESS ENUM, CREATES TWO FUNCTION POINTERS TO ACCESS DATA
static const struct
{
VIA_REGISTER_INDEX REGISTER; // REGISTER TYPE
U8(*READ)(void); // READ ARG
void(*WRITE)(U8); // WRITE ARG
} VIA_HANDLERS[] =
{
{IRB, VIA_READ_IRB, NULL},
{T1C_L, VIA_READ_T1C_L, NULL},
{T1C_H, NULL, VIA_WRITE_T1C_H},
{IFR, VIA_READ_IFR, NULL},
{IER, NULL, VIA_WRITE_IER}
};For building this project, you need a modern C Compiler and CMake which supports versions 3.20 onwards
From there, it is a case of:
git clone this repo
mkdir build && cd build
cmake ..
make