adding missing registers to stop trowing

This commit is contained in:
Clément Le Bihan
2020-05-12 00:10:44 +02:00
parent d889936aa0
commit 3e811db9cd
3 changed files with 66 additions and 2 deletions
+14
View File
@@ -32,6 +32,16 @@ namespace ComSquare::PPU
return this->_registers._mpy.mpym; return this->_registers._mpy.mpym;
case ppuRegisters::mpyh: case ppuRegisters::mpyh:
return this->_registers._mpy.mpyh; return this->_registers._mpy.mpyh;
case ppuRegisters::slhv:
return this->_registers._slhv;
case ppuRegisters::oamdataread:
case ppuRegisters::vmdatalread:
case ppuRegisters::vmdatahread:
case ppuRegisters::ophct:
case ppuRegisters::opvct:
case ppuRegisters::stat77:
case ppuRegisters::stat78:
return 0;
default: default:
throw InvalidAddress("PPU Internal Registers read ", addr); throw InvalidAddress("PPU Internal Registers read ", addr);
} }
@@ -137,6 +147,10 @@ namespace ComSquare::PPU
case ppuRegisters::m7d: case ppuRegisters::m7d:
this->_registers._m7[addr - ppuRegisters::m7a].m7 = (this->_registers._m7[addr - ppuRegisters::m7a].m7 << 8) | data; this->_registers._m7[addr - ppuRegisters::m7a].m7 = (this->_registers._m7[addr - ppuRegisters::m7a].m7 << 8) | data;
break; break;
case ppuRegisters::m7x:
case ppuRegisters::m7y:
// TODO these registers
break;
case ppuRegisters::cgadd: case ppuRegisters::cgadd:
this->_registers._cgadd = data; this->_registers._cgadd = data;
this->_registers._isLowByte = true; this->_registers._isLowByte = true;
+51 -1
View File
@@ -482,7 +482,7 @@ namespace ComSquare::PPU
uint8_t raw; uint8_t raw;
} _setini; } _setini;
// <READ registers> not in priority // <READ registers>
//! @brief MPYL - MPYM - MPYH Registers (Multiplication Result) //! @brief MPYL - MPYM - MPYH Registers (Multiplication Result)
union { union {
@@ -493,6 +493,56 @@ namespace ComSquare::PPU
}; };
uint32_t mpy; uint32_t mpy;
} _mpy; } _mpy;
//! @brief SLHV - Software Latch for H/V Counter
uint8_t _slhv;
//! @brief OAMDATAREAD - Data for OAM read
uint8_t _oamdataread;
//! @brief VMDATALREAD/VMDATAHREAD - VRAM Data Read low/high byte
union {
struct {
uint8_t vmDataLRead;
uint8_t vmDataHRead;
};
uint16_t raw;
} _vmdataread;
//! @brief CGRAM Data read
union {
struct {
uint8_t cgDataLRead;
uint8_t cgDataHRead;
};
uint16_t raw;
} _cgdataread;
//! @brief OPHCT/OPVCT - Horizontal/Vertical Scanline Location
union {
struct {
uint16_t opct: 9;
uint8_t _: 7;
};
uint16_t raw;
} _opct;
//! @brief STAT77 - PPU Status Flag and Version
union {
struct {
uint8_t chipVersionNumber: 4;
bool _: 1;
bool modeSelect: 1;
bool rangeOverFlag: 1;
bool timeOverFlag: 1;
};
uint8_t raw;
} _stat77;
//! @brief STAT78 - PPU Status Flag and Version
union {
struct {
uint8_t chipVersionNumber: 4;
bool mode: 1;
bool _: 1;
bool externalLatchFlag: 1;
bool interlaceField: 1;
};
uint8_t raw;
} _stat78;
}; };
//! @brief The class containing all the registers of the PPU //! @brief The class containing all the registers of the PPU
+1 -1
View File
@@ -1,7 +1,7 @@
/******************************************************************************** /********************************************************************************
** Form generated from reading UI file 'cpu.ui' ** Form generated from reading UI file 'cpu.ui'
** **
** Created by: Qt User Interface Compiler version 5.14.1 ** Created by: Qt User Interface Compiler version 5.13.2
** **
** WARNING! All changes made in this file will be lost when recompiling UI file! ** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/ ********************************************************************************/