PPU: Implemented multiply register
This commit is contained in:
parent
5952fcd3f5
commit
d73ca5bf82
2 changed files with 20 additions and 0 deletions
16
Core/Ppu.cpp
16
Core/Ppu.cpp
|
@ -529,6 +529,10 @@ void Ppu::LatchLocationValues()
|
||||||
uint8_t Ppu::Read(uint16_t addr)
|
uint8_t Ppu::Read(uint16_t addr)
|
||||||
{
|
{
|
||||||
switch(addr) {
|
switch(addr) {
|
||||||
|
case 0x2134: return ((int16_t)_mode7MatrixA * ((int16_t)_mode7MatrixB >> 8)) & 0xFF;
|
||||||
|
case 0x2135: return (((int16_t)_mode7MatrixA * ((int16_t)_mode7MatrixB >> 8)) >> 8) & 0xFF;
|
||||||
|
case 0x2136: return (((int16_t)_mode7MatrixA * ((int16_t)_mode7MatrixB >> 8)) >> 16) & 0xFF;
|
||||||
|
|
||||||
case 0x2137:
|
case 0x2137:
|
||||||
//SLHV - Software Latch for H/V Counter
|
//SLHV - Software Latch for H/V Counter
|
||||||
//Latch values on read, and return open bus
|
//Latch values on read, and return open bus
|
||||||
|
@ -753,6 +757,18 @@ void Ppu::Write(uint32_t addr, uint8_t value)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x211B:
|
||||||
|
//M7A - Mode 7 Matrix A (also used with $2134/6)
|
||||||
|
_mode7MatrixA = (value << 8) | _mode7Latch;
|
||||||
|
_mode7Latch = value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x211C:
|
||||||
|
//M7B - Mode 7 Matrix B (also used with $2134/6)
|
||||||
|
_mode7MatrixB = (value << 8) | _mode7Latch;
|
||||||
|
_mode7Latch = value;
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x2121:
|
case 0x2121:
|
||||||
//CGRAM Address(CGADD)
|
//CGRAM Address(CGADD)
|
||||||
_cgramAddress = value * 2;
|
_cgramAddress = value * 2;
|
||||||
|
|
|
@ -117,6 +117,10 @@ private:
|
||||||
uint16_t _verticalLocation = 0;
|
uint16_t _verticalLocation = 0;
|
||||||
bool _verticalLocationToggle = false;
|
bool _verticalLocationToggle = false;
|
||||||
|
|
||||||
|
uint16_t _mode7MatrixA = 0;
|
||||||
|
uint16_t _mode7MatrixB = 0;
|
||||||
|
uint8_t _mode7Latch = 0;
|
||||||
|
|
||||||
template<bool forMainScreen>
|
template<bool forMainScreen>
|
||||||
void RenderBgColor();
|
void RenderBgColor();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue