bsnes/higan/processor/v30mz/instructions-misc.cpp
Tim Allen a89a3da77a Update to v097r11 release.
byuu says:

Alright, well interrupts are in. At least Vblank is.

I also fixed a bug in vector() indexing, MoDRM mod!=3&&reg==6 using SS
instead of DS, opcodes a0-a3 allowing segment override, and added the
"irq_disable" stuff to the relevant opcodes to suppress IRQs after
certain instructions.

But unfortunately ... still no go on Riviera. It's not reading any
unmapped ports, and although it enables Vblank IRQs and they set port
$b4's status bit, the game never sets the IE flag, so no interrupts ever
actually fire. The game does indeed appear to be sitting in a rather
huge loop, which is probably dependent upon some RAM variable being set
from the Vblank IRQ, but I don't know how I'm supposed to be triggering
it.

... I'm really quite stumped here >_>
2016-02-05 08:18:06 +11:00

76 lines
1.1 KiB
C++

//26 es:
//2e cs:
//36 ss:
//3e ds:
auto V30MZ::opSegment(uint16 segment) {
prefix.segment = segment;
state.prefix = true;
state.poll = false;
}
//f2 repnz:
//f3 repz:
auto V30MZ::opRepeat(bool flag) {
wait(4);
if(r.cx == 0) return;
prefix.repeat = flag;
state.prefix = true;
state.poll = false;
}
//f0 lock:
auto V30MZ::opLock() {
state.prefix = true;
state.poll = false;
}
//9b wait
auto V30MZ::opWait() {
}
//f4 hlt
auto V30MZ::opHalt() {
wait(8);
state.halt = true;
}
//90 nop
auto V30MZ::opNop() {
}
auto V30MZ::opIn(Size size) {
wait(5);
setAcc(size, in(size, fetch()));
}
auto V30MZ::opOut(Size size) {
wait(5);
out(size, fetch(), getAcc(size));
}
auto V30MZ::opInDX(Size size) {
wait(5);
setAcc(size, in(size, r.dx));
}
auto V30MZ::opOutDX(Size size) {
wait(5);
out(size, r.dx, getAcc(size));
}
//d7 xlat
auto V30MZ::opTranslate() {
wait(4);
r.al = read(Byte, segment(r.ds), r.bx + r.al);
}
//62 bound reg,mem,mem
auto V30MZ::opBound() {
wait(12);
modRM();
auto lo = getMem(Word, 0);
auto hi = getMem(Word, 2);
auto reg = getReg(Word);
if(reg < lo || reg > hi) interrupt(5);
}