- Initial commit

This commit is contained in:
2025-01-12 20:46:02 +01:00
commit 44c044d64e
2 changed files with 2851 additions and 0 deletions

2811
sm83.cpp Normal file

File diff suppressed because it is too large Load Diff

40
sm83.h Normal file
View File

@@ -0,0 +1,40 @@
#pragma once
#include <stdint.h>
namespace sm83
{
#define SM83_OPTION_STOP_ON_INVALID 0
#define SM83_OPTION_BREAK_ON_INTERRUPT 1
#define SM83_OPTION_BREAK_ON_RET 2
#define SM83_NUM_OPTIONS 3
void reset();
void setClock(uint32_t freq);
uint32_t getClock();
void interrupt();
uint32_t step();
uint8_t *getRegs();
uint16_t getAF(const bool alt=false);
uint16_t getBC(const bool alt=false);
uint16_t getDE(const bool alt=false);
uint16_t getHL(const bool alt=false);
uint16_t getSP();
uint16_t getPC();
uint8_t getI();
uint8_t getR();
void setPC(const uint16_t addr);
const bool getOption(const int option);
void setOption(const int option, const bool value);
void toggleOption(const int option);
}