mirror of
https://github.com/kbeckmann/game-and-watch-retro-go.git
synced 2025-12-19 02:29:33 +01:00
77 lines
1.2 KiB
C++
77 lines
1.2 KiB
C++
#ifdef DEBUGGER
|
|
#include "../../../snes9x.h"
|
|
#include "../../../debug.h"
|
|
char tmp[1024];
|
|
#endif
|
|
|
|
#include "../snes/snes.hpp"
|
|
|
|
#define SMP_CPP
|
|
namespace SNES {
|
|
|
|
#ifdef DEBUGGER
|
|
#include "debugger/disassembler.cpp"
|
|
#endif
|
|
|
|
SMP smp;
|
|
|
|
#include "algorithms.hpp"
|
|
#include "core.hpp"
|
|
#include "iplrom.hpp"
|
|
#include "memory.hpp"
|
|
#include "timing.hpp"
|
|
|
|
void SMP::enter() {
|
|
while(clock < 0) op_step();
|
|
}
|
|
|
|
void SMP::power() {
|
|
Processor::clock = 0;
|
|
|
|
timer0.target = 0;
|
|
timer1.target = 0;
|
|
timer2.target = 0;
|
|
|
|
reset();
|
|
}
|
|
|
|
void SMP::reset() {
|
|
memset(apuram, 0x00, 0x10000);
|
|
|
|
opcode_number = 0;
|
|
opcode_cycle = 0;
|
|
|
|
regs.pc = 0xffc0;
|
|
regs.sp = 0xef;
|
|
regs.B.a = 0x00;
|
|
regs.x = 0x00;
|
|
regs.B.y = 0x00;
|
|
regs.p = 0x02;
|
|
|
|
//$00f1
|
|
status.iplrom_enable = true;
|
|
|
|
//$00f2
|
|
status.dsp_addr = 0x00;
|
|
|
|
//$00f8,$00f9
|
|
status.ram00f8 = 0x00;
|
|
status.ram00f9 = 0x00;
|
|
|
|
//timers
|
|
timer0.enable = timer1.enable = timer2.enable = false;
|
|
timer0.stage1_ticks = timer1.stage1_ticks = timer2.stage1_ticks = 0;
|
|
timer0.stage2_ticks = timer1.stage2_ticks = timer2.stage2_ticks = 0;
|
|
timer0.stage3_ticks = timer1.stage3_ticks = timer2.stage3_ticks = 0;
|
|
}
|
|
|
|
SMP::SMP() {
|
|
apuram = new uint8[64 * 1024];
|
|
}
|
|
|
|
SMP::~SMP() {
|
|
delete[] apuram;
|
|
}
|
|
|
|
}
|