* bump version number

* implement 32bit reads to keypad registers
* also implement RCNT more properly
This commit is contained in:
StapleButter 2017-06-04 22:34:31 +02:00
parent c2fa561e40
commit fb1eb43fb4
4 changed files with 59 additions and 8 deletions

View File

@ -6,8 +6,8 @@
//include version information in .exe, modify these values to match your needs //include version information in .exe, modify these values to match your needs
1 VERSIONINFO 1 VERSIONINFO
FILEVERSION 0,3,3,3 FILEVERSION 0,4,4,4
PRODUCTVERSION 0,3,3,3 PRODUCTVERSION 0,4,4,4
FILETYPE VFT_APP FILETYPE VFT_APP
{ {
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
@ -15,14 +15,14 @@ FILETYPE VFT_APP
BLOCK "040904E4" BLOCK "040904E4"
{ {
VALUE "CompanyName", "Melon Factory of Kuribo64" VALUE "CompanyName", "Melon Factory of Kuribo64"
VALUE "FileVersion", "0.3" VALUE "FileVersion", "0.4"
VALUE "FileDescription", "DS emulator, sorta. also 1st quality melon." VALUE "FileDescription", "DS emulator, sorta. also 1st quality melon."
VALUE "InternalName", "SDnolem" VALUE "InternalName", "SDnolem"
VALUE "LegalCopyright", "2016-2017 StapleButter & co." VALUE "LegalCopyright", "2016-2017 StapleButter & co."
VALUE "LegalTrademarks", "" VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "zafkflzdasd.exe" VALUE "OriginalFilename", "zafkflzdasd.exe"
VALUE "ProductName", "melonDS" VALUE "ProductName", "melonDS"
VALUE "ProductVersion", "0.3" VALUE "ProductVersion", "0.4"
} }
} }
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -104,6 +104,8 @@ u32 SqrtVal[2];
u32 SqrtRes; u32 SqrtRes;
u32 KeyInput; u32 KeyInput;
u16 KeyCnt;
u16 RCnt;
bool Running; bool Running;
@ -326,6 +328,8 @@ void Reset()
ARM7Offset = 0; ARM7Offset = 0;
KeyInput = 0x007F03FF; KeyInput = 0x007F03FF;
KeyCnt = 0;
RCnt = 0;
NDSCart::Reset(); NDSCart::Reset();
GPU::Reset(); GPU::Reset();
@ -1321,6 +1325,8 @@ u8 ARM9IORead8(u32 addr)
{ {
case 0x04000130: return KeyInput & 0xFF; case 0x04000130: return KeyInput & 0xFF;
case 0x04000131: return (KeyInput >> 8) & 0xFF; case 0x04000131: return (KeyInput >> 8) & 0xFF;
case 0x04000132: return KeyCnt & 0xFF;
case 0x04000133: return KeyCnt >> 8;
case 0x040001A2: return NDSCart::ReadSPIData(); case 0x040001A2: return NDSCart::ReadSPIData();
@ -1405,6 +1411,7 @@ u16 ARM9IORead16(u32 addr)
case 0x0400010E: return Timers[3].Cnt; case 0x0400010E: return Timers[3].Cnt;
case 0x04000130: return KeyInput & 0xFFFF; case 0x04000130: return KeyInput & 0xFFFF;
case 0x04000132: return KeyCnt;
case 0x04000180: return IPCSync9; case 0x04000180: return IPCSync9;
case 0x04000184: case 0x04000184:
@ -1495,6 +1502,8 @@ u32 ARM9IORead32(u32 addr)
case 0x04000108: return TimerGetCounter(2) | (Timers[2].Cnt << 16); case 0x04000108: return TimerGetCounter(2) | (Timers[2].Cnt << 16);
case 0x0400010C: return TimerGetCounter(3) | (Timers[3].Cnt << 16); case 0x0400010C: return TimerGetCounter(3) | (Timers[3].Cnt << 16);
case 0x04000130: return (KeyInput & 0xFFFF) | (KeyCnt << 16);
case 0x040001A0: return NDSCart::SPICnt | (NDSCart::ReadSPIData() << 16); case 0x040001A0: return NDSCart::SPICnt | (NDSCart::ReadSPIData() << 16);
case 0x040001A4: return NDSCart::ROMCnt; case 0x040001A4: return NDSCart::ROMCnt;
@ -1577,6 +1586,13 @@ void ARM9IOWrite8(u32 addr, u8 val)
{ {
switch (addr) switch (addr)
{ {
case 0x04000132:
KeyCnt = (KeyCnt & 0xFF00) | val;
return;
case 0x04000133:
KeyCnt = (KeyCnt & 0x00FF) | (val << 8);
return;
case 0x040001A0: case 0x040001A0:
if (!(ExMemCnt[0] & (1<<11))) if (!(ExMemCnt[0] & (1<<11)))
{ {
@ -1676,6 +1692,10 @@ void ARM9IOWrite16(u32 addr, u16 val)
case 0x0400010C: Timers[3].Reload = val; return; case 0x0400010C: Timers[3].Reload = val; return;
case 0x0400010E: TimerStart(3, val); return; case 0x0400010E: TimerStart(3, val); return;
case 0x04000132:
KeyCnt = val;
return;
case 0x04000180: case 0x04000180:
IPCSync7 &= 0xFFF0; IPCSync7 &= 0xFFF0;
IPCSync7 |= ((val & 0x0F00) >> 8); IPCSync7 |= ((val & 0x0F00) >> 8);
@ -1830,6 +1850,10 @@ void ARM9IOWrite32(u32 addr, u32 val)
TimerStart(3, val>>16); TimerStart(3, val>>16);
return; return;
case 0x04000130:
KeyCnt = val >> 16;
return;
case 0x04000188: case 0x04000188:
if (IPCFIFOCnt9 & 0x8000) if (IPCFIFOCnt9 & 0x8000)
{ {
@ -1937,6 +1961,10 @@ u8 ARM7IORead8(u32 addr)
{ {
case 0x04000130: return KeyInput & 0xFF; case 0x04000130: return KeyInput & 0xFF;
case 0x04000131: return (KeyInput >> 8) & 0xFF; case 0x04000131: return (KeyInput >> 8) & 0xFF;
case 0x04000132: return KeyCnt & 0xFF;
case 0x04000133: return KeyCnt >> 8;
case 0x04000134: return RCnt & 0xFF;
case 0x04000135: return RCnt >> 8;
case 0x04000136: return (KeyInput >> 16) & 0xFF; case 0x04000136: return (KeyInput >> 16) & 0xFF;
case 0x04000137: return KeyInput >> 24; case 0x04000137: return KeyInput >> 24;
@ -1998,9 +2026,10 @@ u16 ARM7IORead16(u32 addr)
case 0x0400010E: return Timers[7].Cnt; case 0x0400010E: return Timers[7].Cnt;
case 0x04000130: return KeyInput & 0xFFFF; case 0x04000130: return KeyInput & 0xFFFF;
case 0x04000132: return KeyCnt;
case 0x04000134: return RCnt;
case 0x04000136: return KeyInput >> 16; case 0x04000136: return KeyInput >> 16;
case 0x04000134: return 0x8000;
case 0x04000138: return RTC::Read(); case 0x04000138: return RTC::Read();
case 0x04000180: return IPCSync7; case 0x04000180: return IPCSync7;
@ -2070,6 +2099,10 @@ u32 ARM7IORead32(u32 addr)
case 0x04000108: return TimerGetCounter(6) | (Timers[6].Cnt << 16); case 0x04000108: return TimerGetCounter(6) | (Timers[6].Cnt << 16);
case 0x0400010C: return TimerGetCounter(7) | (Timers[7].Cnt << 16); case 0x0400010C: return TimerGetCounter(7) | (Timers[7].Cnt << 16);
case 0x04000130: return (KeyInput & 0xFFFF) | (KeyCnt << 16);
case 0x04000134: return RCnt | (KeyCnt & 0xFFFF0000);
case 0x04000138: return RTC::Read();
case 0x040001A0: return NDSCart::SPICnt | (NDSCart::ReadSPIData() << 16); case 0x040001A0: return NDSCart::SPICnt | (NDSCart::ReadSPIData() << 16);
case 0x040001A4: return NDSCart::ROMCnt; case 0x040001A4: return NDSCart::ROMCnt;
@ -2128,6 +2161,19 @@ void ARM7IOWrite8(u32 addr, u8 val)
{ {
switch (addr) switch (addr)
{ {
case 0x04000132:
KeyCnt = (KeyCnt & 0xFF00) | val;
return;
case 0x04000133:
KeyCnt = (KeyCnt & 0x00FF) | (val << 8);
return;
case 0x04000134:
RCnt = (RCnt & 0xFF00) | val;
return;
case 0x04000135:
RCnt = (RCnt & 0x00FF) | (val << 8);
return;
case 0x04000138: RTC::Write(val, true); return; case 0x04000138: RTC::Write(val, true); return;
case 0x040001A0: case 0x040001A0:
@ -2207,7 +2253,8 @@ void ARM7IOWrite16(u32 addr, u16 val)
case 0x0400010C: Timers[7].Reload = val; return; case 0x0400010C: Timers[7].Reload = val; return;
case 0x0400010E: TimerStart(7, val); return; case 0x0400010E: TimerStart(7, val); return;
case 0x04000134: /* TODO? */ return; case 0x04000132: KeyCnt = val; return;
case 0x04000134: RCnt = val; return;
case 0x04000138: RTC::Write(val, false); return; case 0x04000138: RTC::Write(val, false); return;
@ -2333,6 +2380,10 @@ void ARM7IOWrite32(u32 addr, u32 val)
TimerStart(7, val>>16); TimerStart(7, val>>16);
return; return;
case 0x04000130: KeyCnt = val >> 16; return;
case 0x04000134: RCnt = val & 0xFFFF; return;
case 0x04000138: RTC::Write(val & 0xFFFF, false); return;
case 0x04000188: case 0x04000188:
if (IPCFIFOCnt7 & 0x8000) if (IPCFIFOCnt7 & 0x8000)
{ {

View File

@ -941,7 +941,7 @@ void Write(u32 addr, u16 val)
case 0x0A4: case 0x0A4:
case 0x0A8: case 0x0A8:
case 0x094: case 0x094:
printf("wifi: trying to send packet. %08X=%04X\n", addr, val); printf("wifi: trying to send packet. %08X=%04X. TXREQ=%04X\n", addr, val, IOPORT(W_TXReqRead));
break; break;
// read-only ports // read-only ports

View File

@ -19,7 +19,7 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
#define MELONDS_VERSION "0.3" #define MELONDS_VERSION "0.4"
#define MELONDS_URL "http://melonds.kuribo64.net/" #define MELONDS_URL "http://melonds.kuribo64.net/"