1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Attempt to log dropped indirect writes.

This commit is contained in:
Thomas Harte 2023-01-20 23:07:14 -05:00
parent 4efda108c6
commit 9c57bfd58d
2 changed files with 13 additions and 6 deletions

View File

@ -727,9 +727,8 @@ void Base<personality>::write_register(uint8_t value) {
break;
case 17:
LOG("TODO: Yamaha indirect addressing; " << PADHEX(2) << +low_write_);
// b7: 1 = disable autoincrementing; 0 = enable.
// b5b0: register number
Storage<personality>::increment_indirect_register_ = low_write_ & 0x80;
Storage<personality>::indirect_register_ = low_write_ & 0x3f;
break;
case 18:
@ -829,9 +828,14 @@ void Base<personality>::write_palette(uint8_t value) {
}
template <Personality personality>
void Base<personality>::write_register_indirect(uint8_t value) {
LOG("Register indirect write TODO");
(void)value;
void Base<personality>::write_register_indirect([[maybe_unused]] uint8_t value) {
if constexpr (is_yamaha_vdp(personality)) {
LOG("TODO: indirect write of " << PADHEX(2) << +value << " to " << PADHEX(2) << Storage<personality>::indirect_register_);
if(Storage<personality>::increment_indirect_register_) {
Storage<personality>::indirect_register_ = (Storage<personality>::indirect_register_ + 1) & 0x3f;
}
}
}
template <Personality personality>

View File

@ -128,6 +128,9 @@ template <> struct Storage<Personality::TMS9918A> {
// Yamaha-specific storage.
template <Personality personality> struct Storage<personality, std::enable_if_t<is_yamaha_vdp(personality)>> {
int selected_status_ = 0;
int indirect_register_ = 0;
bool increment_indirect_register_ = false;
};
// Master System-specific storage.