2016-02-04 10:29:08 +00:00
|
|
|
//00 addb mem,reg
|
|
|
|
//01 addw mem,reg
|
|
|
|
auto V30MZ::opAddMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alAdd(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//02 addb reg,mem
|
|
|
|
//03 addw reg,mem
|
|
|
|
auto V30MZ::opAddRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alAdd(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//04 add al,#imm
|
|
|
|
//05 add ax,#imm
|
|
|
|
auto V30MZ::opAddAccImm(Size size) {
|
|
|
|
setAcc(size, alAdd(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//08 orb mem,reg
|
|
|
|
//09 orb mem,reg
|
|
|
|
auto V30MZ::opOrMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alOr(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//0a orb reg,mem
|
|
|
|
//0b orb reg,mem
|
|
|
|
auto V30MZ::opOrRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alOr(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//0c or al,#imm
|
|
|
|
//0d or ax,#imm
|
|
|
|
auto V30MZ::opOrAccImm(Size size) {
|
|
|
|
setAcc(size, alOr(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opAdcMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alAdc(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opAdcRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alAdc(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opAdcAccImm(Size size) {
|
|
|
|
setAcc(size, alAdc(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opSbbMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alSbb(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opSbbRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alSbb(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opSbbAccImm(Size size) {
|
|
|
|
setAcc(size, alSbb(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opAndMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alAnd(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opAndRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alAnd(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opAndAccImm(Size size) {
|
|
|
|
setAcc(size, alAnd(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opSubMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alSub(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opSubRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alSub(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opSubAccImm(Size size) {
|
|
|
|
setAcc(size, alSub(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opXorMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
setMem(size, alXor(size, getMem(size), getReg(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opXorRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
setReg(size, alXor(size, getReg(size), getMem(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opXorAccImm(Size size) {
|
|
|
|
setAcc(size, alXor(size, getAcc(size), fetch(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opCmpMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
alSub(size, getMem(size), getReg(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opCmpRegMem(Size size) {
|
|
|
|
modRM();
|
|
|
|
alSub(size, getReg(size), getMem(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opCmpAccImm(Size size) {
|
|
|
|
alSub(size, getAcc(size), fetch(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opTestAcc(Size size) {
|
|
|
|
alAnd(size, getAcc(size), fetch(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opTestMemReg(Size size) {
|
|
|
|
modRM();
|
|
|
|
alAnd(size, getMem(size), getReg(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
auto V30MZ::opMultiplySignedRegMemImm(Size size) {
|
|
|
|
wait(2);
|
|
|
|
modRM();
|
Update to v097r26 release.
byuu says:
Changelog:
- WS: fixed 8-bit sign-extended imul (fixes Star Hearts completely,
Final Fantasy world map)
- WS: fixed rcl/rcr carry shifting (fixes Crazy Climber, others)
- WS: added sound DMA emulation (Star Hearts rain sound for one example)
- WS: added OAM caching, but it's forced every line for now because
otherwise there are too many sprite glitches
- WS: use headphoneEnable bit instead of speakerEnable bit (fixes muted
audio in games)
- WS: various code cleanups (I/O mapping, audio channel naming, etc)
The hypervoice channel doesn't sound all that great just yet. But I'm
not sure how it's supposed to sound. I need a better example of some
more complex music.
What's left are some unknown register status bits (especially in the
sound area), keypad interrupts, RTC emulation, CPU prefetch emulation.
And then it's all just bugs. Lots and lots of bugs that need to be
fixed.
EDIT: oops, bad typo in the code.
ws/ppu/ppu.cpp line 20: change range(256) to range(224).
Also, delete the r.speed stuff from channel5.cpp to make the rain sound
a lot better in Star Hearts. Apparently that's outdated and not what the
bits really do.
2016-03-17 11:28:15 +00:00
|
|
|
setReg(Word, alMuli(Word, getMem(Word), size == Word ? (int16_t)fetch(Word) : (int8_t)fetch(Byte)));
|
2016-02-04 10:29:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//40 inc ax
|
|
|
|
//41 inc cx
|
|
|
|
//42 inc dx
|
|
|
|
//43 inc bx
|
|
|
|
//44 inc sp
|
|
|
|
//45 inc bp
|
|
|
|
//46 inc si
|
|
|
|
//47 inc di
|
2016-02-16 09:27:55 +00:00
|
|
|
auto V30MZ::opIncReg(uint16_t& reg) {
|
2016-03-10 10:35:48 +00:00
|
|
|
reg = alInc(Word, reg);
|
2016-02-04 10:29:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//48 dec ax
|
|
|
|
//49 dec cx
|
|
|
|
//4a dec dx
|
|
|
|
//4b dec bx
|
|
|
|
//4c dec sp
|
|
|
|
//4d dec bp
|
|
|
|
//4e dec si
|
|
|
|
//4f dec di
|
2016-02-16 09:27:55 +00:00
|
|
|
auto V30MZ::opDecReg(uint16_t& reg) {
|
2016-03-10 10:35:48 +00:00
|
|
|
reg = alDec(Word, reg);
|
2016-02-04 10:29:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//98 cbw
|
|
|
|
auto V30MZ::opSignExtendByte() {
|
|
|
|
setAcc(Word, (int8)getAcc(Byte));
|
|
|
|
}
|
|
|
|
|
|
|
|
//99 cwd
|
|
|
|
auto V30MZ::opSignExtendWord() {
|
|
|
|
setAcc(Long, (int16)getAcc(Word));
|
|
|
|
}
|