auto R65816::op_rts() { idle(); idle(); rd.l = readSP(); rd.h = readSP(); L idle(); r.pc.w = ++rd.w; }
auto R65816::op_sta_isry_b() { sp = readPC(); idle(); aa.l = readSP(sp + 0); aa.h = readSP(sp + 1); idle(); L writeDB(aa.w + r.y.w, r.a.l); }
auto R65816::op_rti() { idle(); idle(); r.p = readSP(); E r.p.m = 1, r.p.x = 1; if(r.p.x) { r.x.h = 0x00; r.y.h = 0x00; } r.pc.l = readSP(); if(r.e) { L r.pc.h = readSP(); } else { r.pc.h = readSP(); L r.pc.b = readSP(); } }
int runFrom(int PC, int A, int CC, int HX) { int SP=readSP(); if (verbose>2) flsprintf(stdout,"Execute code PC=%04X A=%02X CC=%02X H:X=%04X SP=%04X\n",PC,A,CC,HX,SP); image[ SP + 1 ] = HX >> 8; image[ SP + 2 ] = CC; image[ SP + 3 ] = A; image[ SP + 4 ] = HX & 0xFF; image[ SP + 5 ] = PC >> 8; image[ SP + 6 ] = PC & 0xFF; writeMemory(SP + 1 , 6 , 0); sendByte(0x28); // Monitor mode RUN command //struct timespec tspec; //tspec.tv_sec=0; //tspec.tv_nsec=5000000; /* wait at least 1 ms (datasheet specifies 11 bit times) */ //nanosleep(&tspec,0); return SP; }
uint8_t In4Dimmer4::ReadCurrent(uint8_t _card_channel){ return readSP(_card_channel); }