mirror of
https://github.com/libretro/Mu.git
synced 2026-09-23 07:05:37 +00:00
Add SPI2 reading and logging
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
Don't know where touch input is read
|
||||
|
||||
CPU read 8 bits from register 0x0431, PC 0x100815B2.
|
||||
CPU read 8 bits from register 0x0420, PC 0x100815B8.
|
||||
CPU read 8 bits from register 0x0421, PC 0x100815BE.
|
||||
SPI2 transfer, ENABLE:true, XCH:false, IRQ:false, IRQEN:false, BITCOUNT:12
|
||||
SPI2 transfer, ENABLE:true, XCH:true, IRQ:false, IRQEN:false, BITCOUNT:12
|
||||
SPI2 transfer, ENABLE:true, XCH:false, IRQ:false, IRQEN:false, BITCOUNT:5
|
||||
SPI2 transfer, ENABLE:true, XCH:true, IRQ:false, IRQEN:false, BITCOUNT:5
|
||||
SPI2 transfer, ENABLE:true, XCH:false, IRQ:false, IRQEN:false, BITCOUNT:16
|
||||
SPI2 transfer, ENABLE:true, XCH:true, IRQ:false, IRQEN:false, BITCOUNT:16
|
||||
SPI2 transfer, ENABLE:true, XCH:true, IRQ:false, IRQEN:false, BITCOUNT:3
|
||||
SPI2 transfer, ENABLE:false, XCH:false, IRQ:false, IRQEN:false, BITCOUNT:1
|
||||
CPU read 8 bits from register 0x0431, PC 0x10081A04.
|
||||
|
||||
CPU read 8 bits from register 0x0431, PC 0x100815B2.
|
||||
CPU read 8 bits from register 0x0420, PC 0x100815B8.
|
||||
CPU read 8 bits from register 0x0421, PC 0x100815BE.
|
||||
|
||||
|
||||
//copilots SPI touch code
|
||||
case SPIMCONT:
|
||||
db_SPIMCONT.x = value;
|
||||
|
||||
@@ -443,6 +443,8 @@ unsigned int getHwRegister16(unsigned int address){
|
||||
case RTCCTL:
|
||||
case RTCIENR:
|
||||
case ILCR:
|
||||
case SPICONT2:
|
||||
case SPIDATA2:
|
||||
//simple read, no actions needed
|
||||
return registerArrayRead16(address);
|
||||
|
||||
|
||||
@@ -213,9 +213,6 @@ static inline void setSpiCont2(uint16_t value){
|
||||
//unsure if ENABLE can be set at the exact moment of write or must be set before write, currently allow both
|
||||
//important bits are ENABLE, XCH, IRQ, IRQEN and BITCOUNT
|
||||
//uint16_t oldSpiCont2 = registerArrayRead16(SPICONT2);
|
||||
|
||||
debugLog("SPI2 transfer, ENABLE:%s, XCH:%s, IRQ:%s, IRQEN:%s, BITCOUNT:%d\n", boolString(value & 0x0200), boolString(value & 0x0100), boolString(value & 0x0080), boolString(value & 0x0400), value & 0x000F);
|
||||
|
||||
if(value & 0x0200 && value & 0x0100){
|
||||
//enabled and exchange set
|
||||
uint8_t bitCount = (value & 0x000F) + 1;
|
||||
@@ -233,6 +230,9 @@ static inline void setSpiCont2(uint16_t value){
|
||||
if(value & 0x0040)
|
||||
setIprIsrBit(INT_SPI2);
|
||||
|
||||
debugLog("SPI2 transfer, ENABLE:%s, XCH:%s, IRQ:%s, IRQEN:%s, BITCOUNT:%d\n", boolString(value & 0x0200), boolString(value & 0x0100), boolString(value & 0x0080), boolString(value & 0x0400), (value & 0x000F) + 1);
|
||||
debugLog("SPI2 transfer, shifted in:0x%04X, shifted out:0x%04X\n", spi2Data >> (16 - bitCount), spi2ExternalData >> (16 - bitCount));
|
||||
|
||||
//unset XCH, transfers are instant since timing is not emulated
|
||||
value &= 0xFEFF;
|
||||
|
||||
|
||||
@@ -346,6 +346,6 @@ void sed1376Render(){
|
||||
else{
|
||||
//black screen
|
||||
memset(palmFramebuffer, 0x00, 160 * 160 * sizeof(uint16_t));
|
||||
debugLog("Cant draw screen, LCD on:%s, PLL on:%s, power save on:%s, forced blank on:%s\n", boolString(palmMisc.lcdOn), boolString(pllIsOn()), boolString(sed1376PowerSaveEnabled()), boolString(sed1376Registers[DISP_MODE] & 0x80));
|
||||
//debugLog("Cant draw screen, LCD on:%s, PLL on:%s, power save on:%s, forced blank on:%s\n", boolString(palmMisc.lcdOn), boolString(pllIsOn()), boolString(sed1376PowerSaveEnabled()), boolString(sed1376Registers[DISP_MODE] & 0x80));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user