static UINT32 opBE16(void) /* TRUSTED */ { if ((_Z)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
static UINT32 opBNH16(v60_state *cpustate) /* TRUSTED */ { if ((cpustate->_CY | cpustate->_Z)) { cpustate->PC += (INT16)OpRead16(cpustate->program, cpustate->PC + 1); return 0; } return 3; }
UINT32 opBN16(void) /* TRUSTED */ { if ((_S)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
UINT32 opBSR(void) /* TRUSTED */ { // Save Next PC onto the stack SP -= 4; MemWrite32(SP, PC+3); // Jump to subroutine PC += (INT16)OpRead16(PC + 1); return 0; }
UINT32 opBNV16(void) /* TRUSTED */ { if (!(_OV)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
UINT32 opBH16(void) /* TRUSTED */ { if (!(_CY | _Z)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
static UINT32 opBNL16(void) /* TRUSTED */ { if (!(_CY)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
static UINT32 opDBNH(v60_state *cpustate, int reg) /* TRUSTED */ { cpustate->reg[reg]--; if ((cpustate->reg[reg] != 0) && (cpustate->_CY | cpustate->_Z)) { cpustate->PC += (INT16)OpRead16(cpustate, cpustate->PC + 2); return 0; } return 4; }
UINT32 opBLE16(void) /* TRUSTED */ { NORMALIZEFLAGS(); if (((_S ^ _OV) | _Z)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
static UINT32 opBLE16(v60_state *cpustate) /* TRUSTED */ { NORMALIZEFLAGS(cpustate); if (((cpustate->_S ^ cpustate->_OV) | cpustate->_Z)) { cpustate->PC += (INT16)OpRead16(cpustate, cpustate->PC + 1); return 0; } return 3; }
static UINT32 opDBR(v60_state *cpustate, int reg) /* TRUSTED */ { cpustate->reg[reg]--; if (cpustate->reg[reg] != 0) { cpustate->PC += (INT16)OpRead16(cpustate->program, cpustate->PC + 2); return 0; } return 4; }
static UINT32 opBGE16(v60_state *cpustate) /* TRUSTED */ { NORMALIZEFLAGS(cpustate); if (!(cpustate->_S ^ cpustate->_OV)) { cpustate->PC += (INT16)OpRead16(cpustate->program, cpustate->PC + 1); return 0; } return 3; }
static UINT32 opBGE16(void) /* TRUSTED */ { NORMALIZEFLAGS(); if (!(_S ^ _OV)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
UINT32 v60_device::opBLE16() /* TRUSTED */ { NORMALIZEFLAGS(); if (((_S ^ _OV) | _Z)) { PC += (INT16)OpRead16(PC + 1); return 0; } return 3; }
static UINT32 am2DisplacementIndexed16(v60_state *cpustate) { cpustate->amflag = 0; switch (cpustate->moddim) { case 0: cpustate->amout = cpustate->reg[cpustate->modval2 & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 2) + cpustate->reg[cpustate->modval & 0x1F]; break; case 1: cpustate->amout = cpustate->reg[cpustate->modval2 & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 2) + cpustate->reg[cpustate->modval & 0x1F] * 2; break; case 2: cpustate->amout = cpustate->reg[cpustate->modval2 & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 2) + cpustate->reg[cpustate->modval & 0x1F] * 4; break; case 3: cpustate->amout = cpustate->reg[cpustate->modval2 & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 2) + cpustate->reg[cpustate->modval & 0x1F] * 8; break; } return 4; }
UINT32 am2DisplacementIndexed16(void) { amFlag = 0; switch (modDim) { case 0: amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]; break; case 1: amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 2; break; case 2: amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 4; break; case 3: amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 8; break; } return 4; }
static UINT32 am2PCDisplacementIndirectIndexed16(v60_state *cpustate) { cpustate->amflag = 0; switch (cpustate->moddim) { case 0: cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F]; break; case 1: cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F] * 2; break; case 2: cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F] * 4; break; case 3: cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F] * 8; break; } return 4; }
static UINT32 am2PCDisplacementIndirectIndexed16(void) { amFlag = 0; switch (modDim) { case 0: amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]; break; case 1: amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 2; break; case 2: amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 4; break; case 3: amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 8; break; } return 4; }
static UINT32 opDBLT(v60_state *cpustate, int reg) /* TRUSTED */ { cpustate->reg[reg]--; NORMALIZEFLAGS(cpustate); if ((cpustate->reg[reg] != 0) && (cpustate->_S ^ cpustate->_OV)) { cpustate->PC += (INT16)OpRead16(cpustate, cpustate->PC + 2); return 0; } return 4; }
static UINT32 am3PCDoubleDisplacement16(void) { switch (modDim) { case 0: MemWrite8(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValB); break; case 1: MemWrite16(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValH); break; case 2: MemWrite32(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValW); break; } return 5; }
UINT32 v60_device::opUNHANDLED() { fatalerror("Unhandled OpCode found : %02x at %08x\n", OpRead16(PC), PC); //return 0; /* never reached, fatalerror won't return */ }
static UINT32 opBR16(v60_state *cpustate) /* TRUSTED */ { cpustate->PC += (INT16)OpRead16(cpustate, cpustate->PC + 1); return 0; }
static UINT32 am2DisplacementIndirect16(v60_state *cpustate) { cpustate->amflag = 0; cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->reg[cpustate->modval & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 1)); return 3; }
UINT32 opBR16(void) /* TRUSTED */ { PC += (INT16)OpRead16(PC + 1); return 0; }
static UINT32 bam2DisplacementIndirectIndexed16(v60_state *cpustate) { cpustate->amflag = 0; cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->reg[cpustate->modval2 & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 2)); cpustate->bamoffset = cpustate->reg[cpustate->modval & 0x1F]; return 4; }
static UINT32 bam2DoubleDisplacement16(v60_state *cpustate) { cpustate->amflag = 0; cpustate->amout = cpustate->program->read_dword_unaligned(cpustate->reg[cpustate->modval & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 1)); cpustate->bamoffset = (INT8)OpRead8(cpustate, cpustate->modadd + 3); return 5; }
UINT32 v60_device::opBR16() /* TRUSTED */ { PC += (INT16)OpRead16(PC + 1); return 0; }
static UINT32 am3PCDoubleDisplacement16(v60_state *cpustate) { switch (cpustate->moddim) { case 0: cpustate->program->write_byte(cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 1)) + (INT16)OpRead16(cpustate, cpustate->modadd + 3), cpustate->modwritevalb); break; case 1: cpustate->program->write_word_unaligned(cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 1)) + (INT16)OpRead16(cpustate, cpustate->modadd + 3), cpustate->modwritevalh); break; case 2: cpustate->program->write_dword_unaligned(cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 1)) + (INT16)OpRead16(cpustate, cpustate->modadd + 3), cpustate->modwritevalw); break; } return 5; }
static UINT32 am3PCDisplacementIndirectIndexed16(v60_state *cpustate) { switch (cpustate->moddim) { case 0: cpustate->program->write_byte(cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F], cpustate->modwritevalb); break; case 1: cpustate->program->write_word_unaligned(cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F] * 2, cpustate->modwritevalh); break; case 2: cpustate->program->write_dword_unaligned(cpustate->program->read_dword_unaligned(cpustate->PC + (INT16)OpRead16(cpustate, cpustate->modadd + 2)) + cpustate->reg[cpustate->modval & 0x1F] * 4, cpustate->modwritevalw); break; } return 4; }
static UINT32 am3Displacement16(v60_state *cpustate) { switch (cpustate->moddim) { case 0: cpustate->program->write_byte(cpustate->reg[cpustate->modval & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 1), cpustate->modwritevalb); break; case 1: cpustate->program->write_word_unaligned(cpustate->reg[cpustate->modval & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 1), cpustate->modwritevalh); break; case 2: cpustate->program->write_dword_unaligned(cpustate->reg[cpustate->modval & 0x1F] + (INT16)OpRead16(cpustate, cpustate->modadd + 1), cpustate->modwritevalw); break; } return 3; }