mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-29 16:55:59 +00:00
Implements MEMPTR for IN.
This commit is contained in:
parent
989628a024
commit
3f3229851b
@ -90,6 +90,7 @@ class PatrikRakTests: XCTestCase, CSTestMachineTrapHandler {
|
|||||||
|
|
||||||
func testMemptr() {
|
func testMemptr() {
|
||||||
runTest("z80memptr")
|
runTest("z80memptr")
|
||||||
|
// Result: 102 of 152 tests failed.
|
||||||
}
|
}
|
||||||
|
|
||||||
func testMachine(_ testMachine: CSTestMachine, didTrapAtAddress address: UInt16) {
|
func testMachine(_ testMachine: CSTestMachine, didTrapAtAddress address: UInt16) {
|
||||||
@ -110,6 +111,7 @@ class PatrikRakTests: XCTestCase, CSTestMachineTrapHandler {
|
|||||||
|
|
||||||
let textToAppend = UnicodeScalar(characterCode)!
|
let textToAppend = UnicodeScalar(characterCode)!
|
||||||
output += String(textToAppend)
|
output += String(textToAppend)
|
||||||
|
// print(textToAppend, terminator:"")
|
||||||
|
|
||||||
case 0x7003:
|
case 0x7003:
|
||||||
done = true
|
done = true
|
||||||
|
@ -279,18 +279,22 @@ class Z80MemptrTests: XCTestCase {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
JP(except JP rp)/CALL addr (even in case of conditional call/jp, independantly on condition satisfied or not)
|
JP(except JP rp)/CALL addr (even in case of conditional call/jp, independently on condition satisfied or not)
|
||||||
MEMPTR = addr
|
MEMPTR = addr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
IN A,(port)
|
IN A,(port)
|
||||||
MEMPTR = (A_before_operation << 8) + port + 1
|
MEMPTR = (A_before_operation << 8) + port + 1
|
||||||
|
|
||||||
|
(implemented, not tested)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
IN A,(C)
|
IN A,(C)
|
||||||
MEMPTR = BC + 1
|
MEMPTR = BC + 1
|
||||||
|
|
||||||
|
(implemented, not tested)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
|
@ -804,6 +804,7 @@ template < class T,
|
|||||||
sign_result_ = zero_result_ = bit53_result_ = *static_cast<uint8_t *>(operation->source);
|
sign_result_ = zero_result_ = bit53_result_ = *static_cast<uint8_t *>(operation->source);
|
||||||
set_parity(sign_result_);
|
set_parity(sign_result_);
|
||||||
set_did_compute_flags();
|
set_did_compute_flags();
|
||||||
|
memptr_.full = bc_.full + 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MicroOp::SetAFlags:
|
case MicroOp::SetAFlags:
|
||||||
@ -840,6 +841,7 @@ template < class T,
|
|||||||
case MicroOp::RETN:
|
case MicroOp::RETN:
|
||||||
iff1_ = iff2_;
|
iff1_ = iff2_;
|
||||||
if(irq_line_ && iff1_) request_status_ |= Interrupt::IRQ;
|
if(irq_line_ && iff1_) request_status_ |= Interrupt::IRQ;
|
||||||
|
memptr_ = pc_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MicroOp::HALT:
|
case MicroOp::HALT:
|
||||||
|
@ -487,7 +487,7 @@ void ProcessorStorage::assemble_base_page(InstructionPage &target, RegisterPair1
|
|||||||
/* 0xd6 SUB n */ StdInstr(ReadInc(pc_, temp8_), {MicroOp::SUB8, &temp8_}),
|
/* 0xd6 SUB n */ StdInstr(ReadInc(pc_, temp8_), {MicroOp::SUB8, &temp8_}),
|
||||||
/* 0xd7 RST 10h */ RST(),
|
/* 0xd7 RST 10h */ RST(),
|
||||||
/* 0xd8 RET C */ RET(TestC), /* 0xd9 EXX */ StdInstr({MicroOp::EXX}),
|
/* 0xd8 RET C */ RET(TestC), /* 0xd9 EXX */ StdInstr({MicroOp::EXX}),
|
||||||
/* 0xda JP C */ JP(TestC), /* 0xdb IN A, (n) */StdInstr(ReadInc(pc_, temp16_.halves.low), {MicroOp::Move8, &a_, &temp16_.halves.high}, Input(temp16_, a_)),
|
/* 0xda JP C */ JP(TestC), /* 0xdb IN A, (n) */StdInstr(ReadInc(pc_, memptr_.halves.low), {MicroOp::Move8, &a_, &memptr_.halves.high}, Input(memptr_, a_), Inc16(memptr_)),
|
||||||
/* 0xdc CALL C */ CALL(TestC), /* 0xdd [DD page] */StdInstr({MicroOp::SetInstructionPage, &dd_page_}),
|
/* 0xdc CALL C */ CALL(TestC), /* 0xdd [DD page] */StdInstr({MicroOp::SetInstructionPage, &dd_page_}),
|
||||||
/* 0xde SBC A, n */ StdInstr(ReadInc(pc_, temp8_), {MicroOp::SBC8, &temp8_}),
|
/* 0xde SBC A, n */ StdInstr(ReadInc(pc_, temp8_), {MicroOp::SBC8, &temp8_}),
|
||||||
/* 0xdf RST 18h */ RST(),
|
/* 0xdf RST 18h */ RST(),
|
||||||
|
Loading…
Reference in New Issue
Block a user