#include <stdio.h>

#include "6502P.h"
#include "module_inc.h"
#include "memory.h"
#include "dis6502.h"

t_6502 i_6502 = {
    init, /*update*/NULL
};

byte A;
byte X;
byte Y;
byte P;
byte SP;
word PC;
long T; /* time */

static void init() {
    A = 0x00;
    X = 0x00;
    Y = 0x00;
    P = P_U | P_B;
    SP = 0xFF;
    T = 0;
    PC=readw(0xFFFC);
}

#if 0
static time_t update(time_t inc) {
    extern int debug;
    byte op;

    op = readbq(PC);

/*    if (debug) {
    printf("%04x: %02x %02x %02x, A=%02x, X=%02x, Y=%02x, S=%02x, P=%02x ; ",
	   PC, op, readbq(PC+1), readbq(PC+2),
	   A, X, Y, SP, P);
    disassemble(op); 
    }
*/
    opcode[op]();
    return T += inc;
}
#endif
