1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 19:17:52 +00:00

Corrects memptr leakage via BIT, and ld (de/bc/nn), A behaviour.

This commit is contained in:
Thomas Harte
2018-03-08 20:30:22 -05:00
parent 03501df9e5
commit f0f9d5a6af
4 changed files with 89 additions and 19 deletions
@@ -621,7 +621,7 @@ template < class T,
case MicroOp::BIT: {
uint8_t result = *static_cast<uint8_t *>(operation->source) & (1 << ((operation_ >> 3)&7));
if(current_instruction_page_->is_indexed || ((operation_&0x08) == 7)) {
if(current_instruction_page_->is_indexed || ((operation_&0x07) == 6)) {
bit53_result_ = memptr_.bytes.high;
} else {
bit53_result_ = *static_cast<uint8_t *>(operation->source);
@@ -848,6 +848,10 @@ template < class T,
memptr_.full = static_cast<uint16_t>(*static_cast<uint16_t *>(operation->source) + (int8_t)temp8_);
break;
case MicroOp::SetAddrAMemptr:
memptr_.full = static_cast<uint16_t>(((*static_cast<uint16_t *>(operation->source) + 1)&0xff) + (a_ << 8));
break;
case MicroOp::IndexedPlaceHolder:
return;
}