diff --git a/src/cpu.c b/src/cpu.c index af298ae..6b4a814 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -4,12 +4,9 @@ * Modified by Gabriel Weingardt * *****************************************************/ -#include #include +#include "memory.h" -//externally supplied functions -extern uint8_t read6502(uint16_t address); -extern void write6502(uint16_t address, uint8_t value); //6502 defines #define FLAG_CARRY 0x01 @@ -724,28 +721,6 @@ void irq6502() { pc = (uint16_t)read6502(0xFFFE) | ((uint16_t)read6502(0xFFFF) << 8); } -uint8_t callexternal = 0; -void (*loopexternal)(); - -void exec6502(uint32_t tickcount) { - clockgoal6502 += tickcount; - - while (clockticks6502 < clockgoal6502) { - opcode = read6502(pc++); - - penaltyop = 0; - penaltyaddr = 0; - - (*addrtable[opcode])(); - (*optable[opcode])(); - clockticks6502 += ticktable[opcode]; - if (penaltyop && penaltyaddr) clockticks6502++; - - if (callexternal) (*loopexternal)(); - } - -} - void step6502() { opcode = read6502(pc++); @@ -758,12 +733,4 @@ void step6502() { if (penaltyop && penaltyaddr) clockticks6502++; clockgoal6502 = clockticks6502; - if (callexternal) (*loopexternal)(); -} - -void hookexternal(void *funcptr) { - if (funcptr != (void *)NULL) { - loopexternal = funcptr; - callexternal = 1; - } else callexternal = 0; }