diff --git a/devices/escc.cpp b/devices/escc.cpp
index 983db18..cab968a 100644
--- a/devices/escc.cpp
+++ b/devices/escc.cpp
@@ -30,35 +30,32 @@ ESCC::ESCC() {}
ESCC::~ESCC() {}
-uint8_t ESCC::escc_read(uint32_t offset, int size) {
+uint8_t ESCC::escc_read(bool is_legacy, uint32_t offset, int size) {
return 0;
}
-void ESCC::escc_write(uint32_t offset, uint8_t value, int size) {
- if (offset == 0x20) {
- if (!prep_value) {
- store_reg = value & 0xF;
- prep_value = true;
- }
- else {
- escc_reg[store_reg] = value;
- prep_value = false;
+void ESCC::escc_write(bool is_legacy, uint32_t offset, uint8_t value, int size) {
+ if (is_legacy) {
+ if (offset == 0x02) {
+ if (!prep_value) {
+ store_reg = value & 0xF;
+ prep_value = true;
+ } else {
+ escc_reg[store_reg] = value;
+ prep_value = false;
+ }
}
- }
-}
-uint8_t ESCC::escc_legacy_read(uint32_t offset, int size) {
- return 0;
-}
-
-void ESCC::escc_legacy_write(uint32_t offset, uint8_t value, int size) {
- if (offset == 0x0) {
- if (!prep_value) {
- store_reg = value & 0xF;
- prep_value = true;
- } else {
- escc_reg[store_reg] = value;
- prep_value = false;
+ }
+ else {
+ if (offset == 0x20) {
+ if (!prep_value) {
+ store_reg = value & 0xF;
+ prep_value = true;
+ } else {
+ escc_reg[store_reg] = value;
+ prep_value = false;
+ }
}
}
}
\ No newline at end of file
diff --git a/devices/escc.h b/devices/escc.h
index 1280570..12a460d 100644
--- a/devices/escc.h
+++ b/devices/escc.h
@@ -24,17 +24,19 @@ along with this program. If not, see .
#include
+enum {
+ NOT_LEGACY_ESCC = 0,
+ LEGACY_ESCC = 1
+};
+
class ESCC {
public:
ESCC();
~ESCC();
//protected:
- uint8_t escc_read(uint32_t offset, int size);
- void escc_write(uint32_t offset, uint8_t value, int size);
-
- uint8_t escc_legacy_read(uint32_t offset, int size);
- void escc_legacy_write(uint32_t offset, uint8_t value, int size);
+ uint8_t escc_read(bool is_legacy, uint32_t offset, int size);
+ void escc_write(bool is_legacy, uint32_t offset, uint8_t value, int size);
private:
uint8_t escc_reg[16];
diff --git a/devices/heathrow.cpp b/devices/heathrow.cpp
index 03c3061..d6db814 100644
--- a/devices/heathrow.cpp
+++ b/devices/heathrow.cpp
@@ -188,7 +188,7 @@ void HeathrowIC::write(uint32_t reg_start, uint32_t offset, uint32_t value, int
LOG_F(WARNING, "LEGACY ESCC Write - Offset: %x; Value: %x; Size: %x\n", offset, value, size);
break;
case 0x13:
- this->escc->escc_write((offset - 0x13000), value, size);
+ this->escc->escc_write(false, (offset - 0x13000), value, size);
break;
case 0x14:
this->screamer->snd_ctrl_write(offset - 0x14000, value, size);