Slight ESCC cleanup
This commit is contained in:
parent
b970a8d253
commit
457d7d34b8
|
@ -30,35 +30,32 @@ ESCC::ESCC() {}
|
||||||
|
|
||||||
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESCC::escc_write(uint32_t offset, uint8_t value, int size) {
|
void ESCC::escc_write(bool is_legacy, uint32_t offset, uint8_t value, int size) {
|
||||||
if (offset == 0x20) {
|
if (is_legacy) {
|
||||||
if (!prep_value) {
|
if (offset == 0x02) {
|
||||||
store_reg = value & 0xF;
|
if (!prep_value) {
|
||||||
prep_value = true;
|
store_reg = value & 0xF;
|
||||||
}
|
prep_value = true;
|
||||||
else {
|
} else {
|
||||||
escc_reg[store_reg] = value;
|
escc_reg[store_reg] = value;
|
||||||
prep_value = false;
|
prep_value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t ESCC::escc_legacy_read(uint32_t offset, int size) {
|
}
|
||||||
return 0;
|
else {
|
||||||
}
|
if (offset == 0x20) {
|
||||||
|
if (!prep_value) {
|
||||||
void ESCC::escc_legacy_write(uint32_t offset, uint8_t value, int size) {
|
store_reg = value & 0xF;
|
||||||
if (offset == 0x0) {
|
prep_value = true;
|
||||||
if (!prep_value) {
|
} else {
|
||||||
store_reg = value & 0xF;
|
escc_reg[store_reg] = value;
|
||||||
prep_value = true;
|
prep_value = false;
|
||||||
} else {
|
}
|
||||||
escc_reg[store_reg] = value;
|
|
||||||
prep_value = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,17 +24,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
NOT_LEGACY_ESCC = 0,
|
||||||
|
LEGACY_ESCC = 1
|
||||||
|
};
|
||||||
|
|
||||||
class ESCC {
|
class ESCC {
|
||||||
public:
|
public:
|
||||||
ESCC();
|
ESCC();
|
||||||
~ESCC();
|
~ESCC();
|
||||||
|
|
||||||
//protected:
|
//protected:
|
||||||
uint8_t escc_read(uint32_t offset, int size);
|
uint8_t escc_read(bool is_legacy, uint32_t offset, int size);
|
||||||
void escc_write(uint32_t offset, uint8_t value, int size);
|
void escc_write(bool is_legacy, 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);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t escc_reg[16];
|
uint8_t escc_reg[16];
|
||||||
|
|
|
@ -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);
|
LOG_F(WARNING, "LEGACY ESCC Write - Offset: %x; Value: %x; Size: %x\n", offset, value, size);
|
||||||
break;
|
break;
|
||||||
case 0x13:
|
case 0x13:
|
||||||
this->escc->escc_write((offset - 0x13000), value, size);
|
this->escc->escc_write(false, (offset - 0x13000), value, size);
|
||||||
break;
|
break;
|
||||||
case 0x14:
|
case 0x14:
|
||||||
this->screamer->snd_ctrl_write(offset - 0x14000, value, size);
|
this->screamer->snd_ctrl_write(offset - 0x14000, value, size);
|
||||||
|
|
Loading…
Reference in New Issue