1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-11-16 21:10:58 +00:00

replace cb and op tables with switch

This commit is contained in:
Stephen Crane 2019-02-25 13:21:41 +00:00
parent bdd84b908c
commit 9b6d8e6afb
2 changed files with 816 additions and 843 deletions

623
z80.cpp
View File

@ -82,7 +82,7 @@ void z80::run(unsigned clocks) {
while (clocks--) { while (clocks--) {
if (_irq_pending) if (_irq_pending)
_handle_interrupt(); _handle_interrupt();
step(); op(_fetch_op());
if (_halted) if (_halted)
break; break;
} }
@ -875,330 +875,6 @@ z80::z80(Memory &m, PortDevice<z80> &ports): CPU(m)
{ {
_ports = &ports; _ports = &ports;
OP *p = _ops;
// 0x00
*p++ = &z80::nop; *p++ = &z80::ldbcpc;
*p++ = &z80::ldBCa; *p++ = &z80::incbc;
*p++ = &z80::incb; *p++ = &z80::decb;
*p++ = &z80::ldb; *p++ = &z80::rlca;
*p++ = &z80::exaf; *p++ = &z80::addhlbc;
*p++ = &z80::ldaBC; *p++ = &z80::decbc;
*p++ = &z80::incc; *p++ = &z80::decc;
*p++ = &z80::ldc; *p++ = &z80::rrca;
// 0x10
*p++ = &z80::djnz; *p++ = &z80::lddepc;
*p++ = &z80::ldDEa; *p++ = &z80::incde;
*p++ = &z80::incd; *p++ = &z80::decd;
*p++ = &z80::ldd; *p++ = &z80::rla;
*p++ = &z80::jr; *p++ = &z80::addhlde;
*p++ = &z80::ldaDE; *p++ = &z80::decde;
*p++ = &z80::ince; *p++ = &z80::dece;
*p++ = &z80::lde; *p++ = &z80::rra;
// 0x20
*p++ = &z80::jrnz; *p++ = &z80::ldhlpc;
*p++ = &z80::ldPChl; *p++ = &z80::inchl;
*p++ = &z80::inch; *p++ = &z80::dech;
*p++ = &z80::ldh; *p++ = &z80::daa;
*p++ = &z80::jrz; *p++ = &z80::addhlhl;
*p++ = &z80::ldhlPC; *p++ = &z80::dechl;
*p++ = &z80::incl; *p++ = &z80::decl;
*p++ = &z80::ldl; *p++ = &z80::cpl;
// 0x30
*p++ = &z80::jrnc; *p++ = &z80::ldsppc;
*p++ = &z80::ldPCa; *p++ = &z80::incsp;
*p++ = &z80::incHL; *p++ = &z80::decHL;
*p++ = &z80::ldHL; *p++ = &z80::scf;
*p++ = &z80::jrc; *p++ = &z80::addhlsp;
*p++ = &z80::ldaPC; *p++ = &z80::decsp;
*p++ = &z80::inca; *p++ = &z80::deca;
*p++ = &z80::lda; *p++ = &z80::ccf;
// 0x40
*p++ = &z80::ldbb; *p++ = &z80::ldbc;
*p++ = &z80::ldbd; *p++ = &z80::ldbe;
*p++ = &z80::ldbh; *p++ = &z80::ldbl;
*p++ = &z80::ldbHL; *p++ = &z80::ldba;
*p++ = &z80::ldcb; *p++ = &z80::ldcc;
*p++ = &z80::ldcd; *p++ = &z80::ldce;
*p++ = &z80::ldch; *p++ = &z80::ldcl;
*p++ = &z80::ldcHL; *p++ = &z80::ldca;
// 0x50
*p++ = &z80::lddb; *p++ = &z80::lddc;
*p++ = &z80::lddd; *p++ = &z80::ldde;
*p++ = &z80::lddh; *p++ = &z80::lddl;
*p++ = &z80::lddHL; *p++ = &z80::ldda;
*p++ = &z80::ldeb; *p++ = &z80::ldec;
*p++ = &z80::lded; *p++ = &z80::ldee;
*p++ = &z80::ldeh; *p++ = &z80::ldel;
*p++ = &z80::ldeHL; *p++ = &z80::ldea;
// 0x60
*p++ = &z80::ldhb; *p++ = &z80::ldhc;
*p++ = &z80::ldhd; *p++ = &z80::ldhe;
*p++ = &z80::ldhh; *p++ = &z80::ldhl;
*p++ = &z80::ldhHL; *p++ = &z80::ldha;
*p++ = &z80::ldlb; *p++ = &z80::ldlc;
*p++ = &z80::ldld; *p++ = &z80::ldle;
*p++ = &z80::ldlh; *p++ = &z80::ldll;
*p++ = &z80::ldlHL; *p++ = &z80::ldla;
// 0x70
*p++ = &z80::ldHLb; *p++ = &z80::ldHLc;
*p++ = &z80::ldHLd; *p++ = &z80::ldHLe;
*p++ = &z80::ldHLh; *p++ = &z80::ldHLl;
*p++ = &z80::halt; *p++ = &z80::ldHLa;
*p++ = &z80::ldab; *p++ = &z80::ldac;
*p++ = &z80::ldad; *p++ = &z80::ldae;
*p++ = &z80::ldah; *p++ = &z80::ldal;
*p++ = &z80::ldaHL; *p++ = &z80::ldaa;
// 0x80
*p++ = &z80::addab; *p++ = &z80::addac;
*p++ = &z80::addad; *p++ = &z80::addae;
*p++ = &z80::addah; *p++ = &z80::addal;
*p++ = &z80::addaHL; *p++ = &z80::addaa;
*p++ = &z80::adcab; *p++ = &z80::adcac;
*p++ = &z80::adcad; *p++ = &z80::adcae;
*p++ = &z80::adcah; *p++ = &z80::adcal;
*p++ = &z80::adcaHL; *p++ = &z80::adcaa;
// 0x90
*p++ = &z80::subab; *p++ = &z80::subac;
*p++ = &z80::subad; *p++ = &z80::subae;
*p++ = &z80::subah; *p++ = &z80::subal;
*p++ = &z80::subaHL; *p++ = &z80::subaa;
*p++ = &z80::sbcab; *p++ = &z80::sbcac;
*p++ = &z80::sbcad; *p++ = &z80::sbcae;
*p++ = &z80::sbcah; *p++ = &z80::sbcal;
*p++ = &z80::sbcaHL; *p++ = &z80::sbcaa;
// 0xa0
*p++ = &z80::andb; *p++ = &z80::andc;
*p++ = &z80::andd; *p++ = &z80::ande;
*p++ = &z80::andh; *p++ = &z80::andl;
*p++ = &z80::andHL; *p++ = &z80::anda;
*p++ = &z80::xorb; *p++ = &z80::xorc;
*p++ = &z80::xord; *p++ = &z80::xore;
*p++ = &z80::xorh; *p++ = &z80::xorl;
*p++ = &z80::xorHL; *p++ = &z80::xora;
// 0xb0
*p++ = &z80::orb; *p++ = &z80::orc;
*p++ = &z80::ord; *p++ = &z80::ore;
*p++ = &z80::orh; *p++ = &z80::orl;
*p++ = &z80::orHL; *p++ = &z80::ora;
*p++ = &z80::cpb; *p++ = &z80::cpc;
*p++ = &z80::cpd; *p++ = &z80::cpe;
*p++ = &z80::cph; *p++ = &z80::cpL;
*p++ = &z80::cpHL; *p++ = &z80::cpa;
// 0xc0
*p++ = &z80::retnz; *p++ = &z80::popbc;
*p++ = &z80::jpnz; *p++ = &z80::jp;
*p++ = &z80::callnz; *p++ = &z80::pushbc;
*p++ = &z80::adda; *p++ = &z80::rst00;
*p++ = &z80::retz; *p++ = &z80::ret;
*p++ = &z80::jpz; *p++ = &z80::cb;
*p++ = &z80::callz; *p++ = &z80::call;
*p++ = &z80::adca; *p++ = &z80::rst08;
// 0xd0
*p++ = &z80::retnc; *p++ = &z80::popde;
*p++ = &z80::jpnc; *p++ = &z80::outa;
*p++ = &z80::callnc; *p++ = &z80::pushde;
*p++ = &z80::suba; *p++ = &z80::rst10;
*p++ = &z80::retc; *p++ = &z80::exx;
*p++ = &z80::jpc; *p++ = &z80::ina;
*p++ = &z80::callc; *p++ = &z80::dd;
*p++ = &z80::sbca; *p++ = &z80::rst18;
// 0xe0
*p++ = &z80::retpo; *p++ = &z80::pophl;
*p++ = &z80::jppo; *p++ = &z80::exSPhl;
*p++ = &z80::callpo; *p++ = &z80::pushhl;
*p++ = &z80::and_; *p++ = &z80::rst20;
*p++ = &z80::retpe; *p++ = &z80::jphl;
*p++ = &z80::jppe; *p++ = &z80::exdehl;
*p++ = &z80::callpe; *p++ = &z80::ed;
*p++ = &z80::xor_; *p++ = &z80::rst28;
// 0xf0
*p++ = &z80::retp; *p++ = &z80::popaf;
*p++ = &z80::jpp; *p++ = &z80::di;
*p++ = &z80::callp; *p++ = &z80::pushaf;
*p++ = &z80::or_; *p++ = &z80::rst30;
*p++ = &z80::retm; *p++ = &z80::ldsphl;
*p++ = &z80::jpm; *p++ = &z80::ei;
*p++ = &z80::callm; *p++ = &z80::fd;
*p++ = &z80::cp; *p++ = &z80::rst38;
OP *c = _cb;
// 0x00
*c++ = &z80::rlcB; *c++ = &z80::rlcC;
*c++ = &z80::rlcD; *c++ = &z80::rlcE;
*c++ = &z80::rlcH; *c++ = &z80::rlcL;
*c++ = &z80::rlcHL; *c++ = &z80::rlcA;
*c++ = &z80::rrcB; *c++ = &z80::rrcC;
*c++ = &z80::rrcD; *c++ = &z80::rrcE;
*c++ = &z80::rrcH; *c++ = &z80::rrcL;
*c++ = &z80::rrcHL; *c++ = &z80::rrcA;
// 0x10
*c++ = &z80::rlB; *c++ = &z80::rlC;
*c++ = &z80::rlD; *c++ = &z80::rlE;
*c++ = &z80::rlH; *c++ = &z80::rlL;
*c++ = &z80::rlHL; *c++ = &z80::rlA;
*c++ = &z80::rrB; *c++ = &z80::rrC;
*c++ = &z80::rrD; *c++ = &z80::rrE;
*c++ = &z80::rrH; *c++ = &z80::rrL;
*c++ = &z80::rrHL; *c++ = &z80::rrA;
// 0x20
*c++ = &z80::slab; *c++ = &z80::slac;
*c++ = &z80::slad; *c++ = &z80::slae;
*c++ = &z80::slah; *c++ = &z80::slal;
*c++ = &z80::slaHL; *c++ = &z80::slaa;
*c++ = &z80::srab; *c++ = &z80::srac;
*c++ = &z80::srad; *c++ = &z80::srae;
*c++ = &z80::srah; *c++ = &z80::sral;
*c++ = &z80::sraHL; *c++ = &z80::sraa;
// 0x30
*c++ = &z80::sllb; *c++ = &z80::sllc;
*c++ = &z80::slld; *c++ = &z80::slle;
*c++ = &z80::sllh; *c++ = &z80::slll;
*c++ = &z80::sllHL; *c++ = &z80::slla;
*c++ = &z80::srlb; *c++ = &z80::srlc;
*c++ = &z80::srld; *c++ = &z80::srle;
*c++ = &z80::srlh; *c++ = &z80::srll;
*c++ = &z80::srlHL; *c++ = &z80::srla;
// 0x40
*c++ = &z80::bit0b; *c++ = &z80::bit0c;
*c++ = &z80::bit0d; *c++ = &z80::bit0e;
*c++ = &z80::bit0h; *c++ = &z80::bit0l;
*c++ = &z80::bit0HL; *c++ = &z80::bit0a;
*c++ = &z80::bit1b; *c++ = &z80::bit1c;
*c++ = &z80::bit1d; *c++ = &z80::bit1e;
*c++ = &z80::bit1h; *c++ = &z80::bit1l;
*c++ = &z80::bit1HL; *c++ = &z80::bit1a;
// 0x50
*c++ = &z80::bit2b; *c++ = &z80::bit2c;
*c++ = &z80::bit2d; *c++ = &z80::bit2e;
*c++ = &z80::bit2h; *c++ = &z80::bit2l;
*c++ = &z80::bit2HL; *c++ = &z80::bit2a;
*c++ = &z80::bit3b; *c++ = &z80::bit3c;
*c++ = &z80::bit3d; *c++ = &z80::bit3e;
*c++ = &z80::bit3h; *c++ = &z80::bit3l;
*c++ = &z80::bit3HL; *c++ = &z80::bit3a;
// 0x60
*c++ = &z80::bit4b; *c++ = &z80::bit4c;
*c++ = &z80::bit4d; *c++ = &z80::bit4e;
*c++ = &z80::bit4h; *c++ = &z80::bit4l;
*c++ = &z80::bit4HL; *c++ = &z80::bit4a;
*c++ = &z80::bit5b; *c++ = &z80::bit5c;
*c++ = &z80::bit5d; *c++ = &z80::bit5e;
*c++ = &z80::bit5h; *c++ = &z80::bit5l;
*c++ = &z80::bit5HL; *c++ = &z80::bit5a;
// 0x70
*c++ = &z80::bit6b; *c++ = &z80::bit6c;
*c++ = &z80::bit6d; *c++ = &z80::bit6e;
*c++ = &z80::bit6h; *c++ = &z80::bit6l;
*c++ = &z80::bit6HL; *c++ = &z80::bit6a;
*c++ = &z80::bit7b; *c++ = &z80::bit7c;
*c++ = &z80::bit7d; *c++ = &z80::bit7e;
*c++ = &z80::bit7h; *c++ = &z80::bit7l;
*c++ = &z80::bit7HL; *c++ = &z80::bit7a;
// 0x80
*c++ = &z80::res0b; *c++ = &z80::res0c;
*c++ = &z80::res0d; *c++ = &z80::res0e;
*c++ = &z80::res0h; *c++ = &z80::res0l;
*c++ = &z80::res0HL; *c++ = &z80::res0a;
*c++ = &z80::res1b; *c++ = &z80::res1c;
*c++ = &z80::res1d; *c++ = &z80::res1e;
*c++ = &z80::res1h; *c++ = &z80::res1l;
*c++ = &z80::res1HL; *c++ = &z80::res1a;
// 0x90
*c++ = &z80::res2b; *c++ = &z80::res2c;
*c++ = &z80::res2d; *c++ = &z80::res2e;
*c++ = &z80::res2h; *c++ = &z80::res2l;
*c++ = &z80::res2HL; *c++ = &z80::res2a;
*c++ = &z80::res3b; *c++ = &z80::res3c;
*c++ = &z80::res3d; *c++ = &z80::res3e;
*c++ = &z80::res3h; *c++ = &z80::res3l;
*c++ = &z80::res3HL; *c++ = &z80::res3a;
// 0xa0
*c++ = &z80::res4b; *c++ = &z80::res4c;
*c++ = &z80::res4d; *c++ = &z80::res4e;
*c++ = &z80::res4h; *c++ = &z80::res4l;
*c++ = &z80::res4HL; *c++ = &z80::res4a;
*c++ = &z80::res5b; *c++ = &z80::res5c;
*c++ = &z80::res5d; *c++ = &z80::res5e;
*c++ = &z80::res5h; *c++ = &z80::res5l;
*c++ = &z80::res5HL; *c++ = &z80::res5a;
// 0xb0
*c++ = &z80::res6b; *c++ = &z80::res6c;
*c++ = &z80::res6d; *c++ = &z80::res6e;
*c++ = &z80::res6h; *c++ = &z80::res6l;
*c++ = &z80::res6HL; *c++ = &z80::res6a;
*c++ = &z80::res7b; *c++ = &z80::res7c;
*c++ = &z80::res7d; *c++ = &z80::res7e;
*c++ = &z80::res7h; *c++ = &z80::res7l;
*c++ = &z80::res7HL; *c++ = &z80::res7a;
// 0xc0
*c++ = &z80::set0b; *c++ = &z80::set0c;
*c++ = &z80::set0d; *c++ = &z80::set0e;
*c++ = &z80::set0h; *c++ = &z80::set0l;
*c++ = &z80::set0HL; *c++ = &z80::set0a;
*c++ = &z80::set1b; *c++ = &z80::set1c;
*c++ = &z80::set1d; *c++ = &z80::set1e;
*c++ = &z80::set1h; *c++ = &z80::set1l;
*c++ = &z80::set1HL; *c++ = &z80::set1a;
// 0xd0
*c++ = &z80::set2b; *c++ = &z80::set2c;
*c++ = &z80::set2d; *c++ = &z80::set2e;
*c++ = &z80::set2h; *c++ = &z80::set2l;
*c++ = &z80::set2HL; *c++ = &z80::set2a;
*c++ = &z80::set3b; *c++ = &z80::set3c;
*c++ = &z80::set3d; *c++ = &z80::set3e;
*c++ = &z80::set3h; *c++ = &z80::set3l;
*c++ = &z80::set3HL; *c++ = &z80::set3a;
// 0xe0
*c++ = &z80::set4b; *c++ = &z80::set4c;
*c++ = &z80::set4d; *c++ = &z80::set4e;
*c++ = &z80::set4h; *c++ = &z80::set4l;
*c++ = &z80::set4HL; *c++ = &z80::set4a;
*c++ = &z80::set5b; *c++ = &z80::set5c;
*c++ = &z80::set5d; *c++ = &z80::set5e;
*c++ = &z80::set5h; *c++ = &z80::set5l;
*c++ = &z80::set5HL; *c++ = &z80::set5a;
// 0xf0
*c++ = &z80::set6b; *c++ = &z80::set6c;
*c++ = &z80::set6d; *c++ = &z80::set6e;
*c++ = &z80::set6h; *c++ = &z80::set6l;
*c++ = &z80::set6HL; *c++ = &z80::set6a;
*c++ = &z80::set7b; *c++ = &z80::set7c;
*c++ = &z80::set7d; *c++ = &z80::set7e;
*c++ = &z80::set7h; *c++ = &z80::set7l;
*c++ = &z80::set7HL; *c++ = &z80::set7a;
OP_IDX *d = _ddcb; OP_IDX *d = _ddcb;
// 0x00 // 0x00
@ -1523,3 +1199,300 @@ z80::z80(Memory &m, PortDevice<z80> &ports): CPU(m)
*d++ = &z80::set7IYH; *d++ = &z80::set7IYL; *d++ = &z80::set7IYH; *d++ = &z80::set7IYL;
*d++ = &z80::set7IY; *d++ = &z80::set7IYA; *d++ = &z80::set7IY; *d++ = &z80::set7IYA;
} }
void z80::cb() {
switch(_fetch_op()) {
O(0x00, rlcB); O(0x01, rlcC);
O(0x02, rlcD); O(0x03, rlcE);
O(0x04, rlcH); O(0x05, rlcL);
O(0x06, rlcHL); O(0x07, rlcA);
O(0x08, rrcB); O(0x09, rrcC);
O(0x0a, rrcD); O(0x0b, rrcE);
O(0x0c, rrcH); O(0x0d, rrcL);
O(0x0e, rrcHL); O(0x0f, rrcA);
O(0x10, rlB); O(0x11, rlC);
O(0x12, rlD); O(0x13, rlE);
O(0x14, rlH); O(0x15, rlL);
O(0x16, rlHL); O(0x17, rlA);
O(0x18, rrB); O(0x19, rrC);
O(0x1a, rrD); O(0x1b, rrE);
O(0x1c, rrH); O(0x1d, rrL);
O(0x1e, rrHL); O(0x1f, rrA);
O(0x20, slab); O(0x21, slac);
O(0x22, slad); O(0x23, slae);
O(0x24, slah); O(0x25, slal);
O(0x26, slaHL); O(0x27, slaa);
O(0x28, srab); O(0x29, srac);
O(0x2a, srad); O(0x2b, srae);
O(0x2c, srah); O(0x2d, sral);
O(0x2e, sraHL); O(0x2f, sraa);
O(0x30, sllb); O(0x31, sllc);
O(0x32, slld); O(0x33, slle);
O(0x34, sllh); O(0x35, slll);
O(0x36, sllHL); O(0x37, slla);
O(0x38, srlb); O(0x39, srlc);
O(0x3a, srld); O(0x3b, srle);
O(0x3c, srlh); O(0x3d, srll);
O(0x3e, srlHL); O(0x3f, srla);
O(0x40, bit0b); O(0x41, bit0c);
O(0x42, bit0d); O(0x43, bit0e);
O(0x44, bit0h); O(0x45, bit0l);
O(0x46, bit0HL); O(0x47, bit0a);
O(0x48, bit1b); O(0x49, bit1c);
O(0x4a, bit1d); O(0x4b, bit1e);
O(0x4c, bit1h); O(0x4d, bit1l);
O(0x4e, bit1HL); O(0x4f, bit1a);
O(0x50, bit2b); O(0x51, bit2c);
O(0x52, bit2d); O(0x53, bit2e);
O(0x54, bit2h); O(0x55, bit2l);
O(0x56, bit2HL); O(0x57, bit2a);
O(0x58, bit3b); O(0x59, bit3c);
O(0x5a, bit3d); O(0x5b, bit3e);
O(0x5c, bit3h); O(0x5d, bit3l);
O(0x5e, bit3HL); O(0x5f, bit3a);
O(0x60, bit4b); O(0x61, bit4c);
O(0x62, bit4d); O(0x63, bit4e);
O(0x64, bit4h); O(0x65, bit4l);
O(0x66, bit4HL); O(0x67, bit4a);
O(0x68, bit5b); O(0x69, bit5c);
O(0x6a, bit5d); O(0x6b, bit5e);
O(0x6c, bit5h); O(0x6d, bit5l);
O(0x6e, bit5HL); O(0x6f, bit5a);
O(0x70, bit6b); O(0x71, bit6c);
O(0x72, bit6d); O(0x73, bit6e);
O(0x74, bit6h); O(0x75, bit6l);
O(0x76, bit6HL); O(0x77, bit6a);
O(0x78, bit7b); O(0x79, bit7c);
O(0x7a, bit7d); O(0x7b, bit7e);
O(0x7c, bit7h); O(0x7d, bit7l);
O(0x7e, bit7HL); O(0x7f, bit7a);
O(0x80, res0b); O(0x81, res0c);
O(0x82, res0d); O(0x83, res0e);
O(0x84, res0h); O(0x85, res0l);
O(0x86, res0HL); O(0x87, res0a);
O(0x88, res1b); O(0x89, res1c);
O(0x8a, res1d); O(0x8b, res1e);
O(0x8c, res1h); O(0x8d, res1l);
O(0x8e, res1HL); O(0x8f, res1a);
O(0x90, res2b); O(0x91, res2c);
O(0x92, res2d); O(0x93, res2e);
O(0x94, res2h); O(0x95, res2l);
O(0x96, res2HL); O(0x97, res2a);
O(0x98, res3b); O(0x99, res3c);
O(0x9a, res3d); O(0x9b, res3e);
O(0x9c, res3h); O(0x9d, res3l);
O(0x9e, res3HL); O(0x9f, res3a);
O(0xa0, res4b); O(0xa1, res4c);
O(0xa2, res4d); O(0xa3, res4e);
O(0xa4, res4h); O(0xa5, res4l);
O(0xa6, res4HL); O(0xa7, res4a);
O(0xa8, res5b); O(0xa9, res5c);
O(0xaa, res5d); O(0xab, res5e);
O(0xac, res5h); O(0xad, res5l);
O(0xae, res5HL); O(0xaf, res5a);
O(0xb0, res6b); O(0xb1, res6c);
O(0xb2, res6d); O(0xb3, res6e);
O(0xb4, res6h); O(0xb5, res6l);
O(0xb6, res6HL); O(0xb7, res6a);
O(0xb8, res7b); O(0xb9, res7c);
O(0xba, res7d); O(0xbb, res7e);
O(0xbc, res7h); O(0xbd, res7l);
O(0xbe, res7HL); O(0xbf, res7a);
O(0xc0, set0b); O(0xc1, set0c);
O(0xc2, set0d); O(0xc3, set0e);
O(0xc4, set0h); O(0xc5, set0l);
O(0xc6, set0HL); O(0xc7, set0a);
O(0xc8, set1b); O(0xc9, set1c);
O(0xca, set1d); O(0xcb, set1e);
O(0xcc, set1h); O(0xcd, set1l);
O(0xce, set1HL); O(0xcf, set1a);
O(0xd0, set2b); O(0xd1, set2c);
O(0xd2, set2d); O(0xd3, set2e);
O(0xd4, set2h); O(0xd5, set2l);
O(0xd6, set2HL); O(0xd7, set2a);
O(0xd8, set3b); O(0xd9, set3c);
O(0xda, set3d); O(0xdb, set3e);
O(0xdc, set3h); O(0xdd, set3l);
O(0xde, set3HL); O(0xdf, set3a);
O(0xe0, set4b); O(0xe1, set4c);
O(0xe2, set4d); O(0xe3, set4e);
O(0xe4, set4h); O(0xe5, set4l);
O(0xe6, set4HL); O(0xe7, set4a);
O(0xe8, set5b); O(0xe9, set5c);
O(0xea, set5d); O(0xeb, set5e);
O(0xec, set5h); O(0xed, set5l);
O(0xee, set5HL); O(0xef, set5a);
O(0xf0, set6b); O(0xf1, set6c);
O(0xf2, set6d); O(0xf3, set6e);
O(0xf4, set6h); O(0xf5, set6l);
O(0xf6, set6HL); O(0xf7, set6a);
O(0xf8, set7b); O(0xf9, set7c);
O(0xfa, set7d); O(0xfb, set7e);
O(0xfc, set7h); O(0xfd, set7l);
O(0xfe, set7HL); O(0xff, set7a);
}
}
void z80::op(uint8_t op) {
switch (op) {
O(0x00, nop); O(0x01, ldbcpc);
O(0x02, ldBCa); O(0x03, incbc);
O(0x04, incb); O(0x05, decb);
O(0x06, ldb); O(0x07, rlca);
O(0x08, exaf); O(0x09, addhlbc);
O(0x0a, ldaBC); O(0x0b, decbc);
O(0x0c, incc); O(0x0d, decc);
O(0x0e, ldc); O(0x0f, rrca);
O(0x10, djnz); O(0x11, lddepc);
O(0x12, ldDEa); O(0x13, incde);
O(0x14, incd); O(0x15, decd);
O(0x16, ldd); O(0x17, rla);
O(0x18, jr); O(0x19, addhlde);
O(0x1a, ldaDE); O(0x1b, decde);
O(0x1c, ince); O(0x1d, dece);
O(0x1e, lde); O(0x1f, rra);
O(0x20, jrnz); O(0x21, ldhlpc);
O(0x22, ldPChl); O(0x23, inchl);
O(0x24, inch); O(0x25, dech);
O(0x26, ldh); O(0x27, daa);
O(0x28, jrz); O(0x29, addhlhl);
O(0x2a, ldhlPC); O(0x2b, dechl);
O(0x2c, incl); O(0x2d, decl);
O(0x2e, ldl); O(0x2f, cpl);
O(0x30, jrnc); O(0x31, ldsppc);
O(0x32, ldPCa); O(0x33, incsp);
O(0x34, incHL); O(0x35, decHL);
O(0x36, ldHL); O(0x37, scf);
O(0x38, jrc); O(0x39, addhlsp);
O(0x3a, ldaPC); O(0x3b, decsp);
O(0x3c, inca); O(0x3d, deca);
O(0x3e, lda); O(0x3f, ccf);
O(0x40, ldbb); O(0x41, ldbc);
O(0x42, ldbd); O(0x43, ldbe);
O(0x44, ldbh); O(0x45, ldbl);
O(0x46, ldbHL); O(0x47, ldba);
O(0x48, ldcb); O(0x49, ldcc);
O(0x4a, ldcd); O(0x4b, ldce);
O(0x4c, ldch); O(0x4d, ldcl);
O(0x4e, ldcHL); O(0x4f, ldca);
O(0x50, lddb); O(0x51, lddc);
O(0x52, lddd); O(0x53, ldde);
O(0x54, lddh); O(0x55, lddl);
O(0x56, lddHL); O(0x57, ldda);
O(0x58, ldeb); O(0x59, ldec);
O(0x5a, lded); O(0x5b, ldee);
O(0x5c, ldeh); O(0x5d, ldel);
O(0x5e, ldeHL); O(0x5f, ldea);
O(0x60, ldhb); O(0x61, ldhc);
O(0x62, ldhd); O(0x63, ldhe);
O(0x64, ldhh); O(0x65, ldhl);
O(0x66, ldhHL); O(0x67, ldha);
O(0x68, ldlb); O(0x69, ldlc);
O(0x6a, ldld); O(0x6b, ldle);
O(0x6c, ldlh); O(0x6d, ldll);
O(0x6e, ldlHL); O(0x6f, ldla);
O(0x70, ldHLb); O(0x71, ldHLc);
O(0x72, ldHLd); O(0x73, ldHLe);
O(0x74, ldHLh); O(0x75, ldHLl);
O(0x76, halt); O(0x77, ldHLa);
O(0x78, ldab); O(0x79, ldac);
O(0x7a, ldad); O(0x7b, ldae);
O(0x7c, ldah); O(0x7d, ldal);
O(0x7e, ldaHL); O(0x7f, ldaa);
O(0x80, addab); O(0x81, addac);
O(0x82, addad); O(0x83, addae);
O(0x84, addah); O(0x85, addal);
O(0x86, addaHL); O(0x87, addaa);
O(0x88, adcab); O(0x89, adcac);
O(0x8a, adcad); O(0x8b, adcae);
O(0x8c, adcah); O(0x8d, adcal);
O(0x8e, adcaHL); O(0x8f, adcaa);
O(0x90, subab); O(0x91, subac);
O(0x92, subad); O(0x93, subae);
O(0x94, subah); O(0x95, subal);
O(0x96, subaHL); O(0x97, subaa);
O(0x98, sbcab); O(0x99, sbcac);
O(0x9a, sbcad); O(0x9b, sbcae);
O(0x9c, sbcah); O(0x9d, sbcal);
O(0x9e, sbcaHL); O(0x9f, sbcaa);
O(0xa0, andb); O(0xa1, andc);
O(0xa2, andd); O(0xa3, ande);
O(0xa4, andh); O(0xa5, andl);
O(0xa6, andHL); O(0xa7, anda);
O(0xa8, xorb); O(0xa9, xorc);
O(0xaa, xord); O(0xab, xore);
O(0xac, xorh); O(0xad, xorl);
O(0xae, xorHL); O(0xaf, xora);
O(0xb0, orb); O(0xb1, orc);
O(0xb2, ord); O(0xb3, ore);
O(0xb4, orh); O(0xb5, orl);
O(0xb6, orHL); O(0xb7, ora);
O(0xb8, cpb); O(0xb9, cpc);
O(0xba, cpd); O(0xbb, cpe);
O(0xbc, cph); O(0xbd, cpL);
O(0xbe, cpHL); O(0xbf, cpa);
O(0xc0, retnz); O(0xc1, popbc);
O(0xc2, jpnz); O(0xc3, jp);
O(0xc4, callnz); O(0xc5, pushbc);
O(0xc6, adda); O(0xc7, rst00);
O(0xc8, retz); O(0xc9, ret);
O(0xca, jpz); O(0xcb, cb);
O(0xcc, callz); O(0xcd, call);
O(0xce, adca); O(0xcf, rst08);
O(0xd0, retnc); O(0xd1, popde);
O(0xd2, jpnc); O(0xd3, outa);
O(0xd4, callnc); O(0xd5, pushde);
O(0xd6, suba); O(0xd7, rst10);
O(0xd8, retc); O(0xd9, exx);
O(0xda, jpc); O(0xdb, ina);
O(0xdc, callc); O(0xdd, dd);
O(0xde, sbca); O(0xdf, rst18);
O(0xe0, retpo); O(0xe1, pophl);
O(0xe2, jppo); O(0xe3, exSPhl);
O(0xe4, callpo); O(0xe5, pushhl);
O(0xe6, and_); O(0xe7, rst20);
O(0xe8, retpe); O(0xe9, jphl);
O(0xea, jppe); O(0xeb, exdehl);
O(0xec, callpe); O(0xed, ed);
O(0xee, xor_); O(0xef, rst28);
O(0xf0, retp); O(0xf1, popaf);
O(0xf2, jpp); O(0xf3, di);
O(0xf4, callp); O(0xf5, pushaf);
O(0xf6, or_); O(0xf7, rst30);
O(0xf8, retm); O(0xf9, ldsphl);
O(0xfa, jpm); O(0xfb, ei);
O(0xfc, callm); O(0xfd, fd);
O(0xfe, cp); O(0xff, rst38);
}
}

1036
z80.h

File diff suppressed because it is too large Load Diff