mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
implement screen swap.
silence some logging for 3D GPU writes.
This commit is contained in:
19
GPU.cpp
19
GPU.cpp
@ -108,8 +108,8 @@ void Reset()
|
|||||||
GPU2D_A->Reset();
|
GPU2D_A->Reset();
|
||||||
GPU2D_B->Reset();
|
GPU2D_B->Reset();
|
||||||
|
|
||||||
GPU2D_A->SetFramebuffer(&Framebuffer[256*0]);
|
GPU2D_A->SetFramebuffer(&Framebuffer[256*192]);
|
||||||
GPU2D_B->SetFramebuffer(&Framebuffer[256*192]);
|
GPU2D_B->SetFramebuffer(&Framebuffer[256*0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -720,6 +720,21 @@ void MapVRAM_I(u32 bank, u8 cnt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DisplaySwap(u32 val)
|
||||||
|
{
|
||||||
|
if (val)
|
||||||
|
{
|
||||||
|
GPU2D_A->SetFramebuffer(&Framebuffer[256*0]);
|
||||||
|
GPU2D_B->SetFramebuffer(&Framebuffer[256*192]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GPU2D_A->SetFramebuffer(&Framebuffer[256*192]);
|
||||||
|
GPU2D_B->SetFramebuffer(&Framebuffer[256*0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void StartFrame()
|
void StartFrame()
|
||||||
{
|
{
|
||||||
StartScanline(0);
|
StartScanline(0);
|
||||||
|
2
GPU.h
2
GPU.h
@ -58,6 +58,8 @@ void MapVRAM_FG(u32 bank, u8 cnt);
|
|||||||
void MapVRAM_H(u32 bank, u8 cnt);
|
void MapVRAM_H(u32 bank, u8 cnt);
|
||||||
void MapVRAM_I(u32 bank, u8 cnt);
|
void MapVRAM_I(u32 bank, u8 cnt);
|
||||||
|
|
||||||
|
void DisplaySwap(u32 val);
|
||||||
|
|
||||||
void StartFrame();
|
void StartFrame();
|
||||||
void StartScanline(u32 line);
|
void StartScanline(u32 line);
|
||||||
|
|
||||||
|
20
NDS.cpp
20
NDS.cpp
@ -178,6 +178,9 @@ void SetupDirectBoot()
|
|||||||
|
|
||||||
ARM9->JumpTo(bootparams[1]);
|
ARM9->JumpTo(bootparams[1]);
|
||||||
ARM7->JumpTo(bootparams[5]);
|
ARM7->JumpTo(bootparams[5]);
|
||||||
|
|
||||||
|
PowerControl9 = 0x820F;
|
||||||
|
GPU::DisplaySwap(PowerControl9);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
@ -271,7 +274,7 @@ void Reset()
|
|||||||
// test
|
// test
|
||||||
//LoadROM();
|
//LoadROM();
|
||||||
//LoadFirmware();
|
//LoadFirmware();
|
||||||
NDSCart::LoadROM("rom/mkds.nds");
|
NDSCart::LoadROM("rom/sm64ds.nds");
|
||||||
|
|
||||||
Running = true; // hax
|
Running = true; // hax
|
||||||
}
|
}
|
||||||
@ -1412,6 +1415,11 @@ u32 ARM9IORead32(u32 addr)
|
|||||||
{
|
{
|
||||||
return GPU::GPU2D_B->Read32(addr);
|
return GPU::GPU2D_B->Read32(addr);
|
||||||
}
|
}
|
||||||
|
if (addr >= 0x04000320 && addr < 0x040006A4)
|
||||||
|
{
|
||||||
|
// 3D GPU
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
printf("unknown ARM9 IO read32 %08X\n", addr);
|
printf("unknown ARM9 IO read32 %08X\n", addr);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1576,7 +1584,10 @@ void ARM9IOWrite16(u32 addr, u16 val)
|
|||||||
PostFlag9 = val & 0x03;
|
PostFlag9 = val & 0x03;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 0x04000304: PowerControl9 = val; return;
|
case 0x04000304:
|
||||||
|
PowerControl9 = val;
|
||||||
|
GPU::DisplaySwap(PowerControl9>>15);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addr >= 0x04000000 && addr < 0x04000060)
|
if (addr >= 0x04000000 && addr < 0x04000060)
|
||||||
@ -1589,6 +1600,11 @@ void ARM9IOWrite16(u32 addr, u16 val)
|
|||||||
GPU::GPU2D_B->Write16(addr, val);
|
GPU::GPU2D_B->Write16(addr, val);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (addr >= 0x04000320 && addr < 0x040006A4)
|
||||||
|
{
|
||||||
|
// 3D GPU
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
printf("unknown ARM9 IO write16 %08X %04X\n", addr, val);
|
printf("unknown ARM9 IO write16 %08X %04X\n", addr, val);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
1481161027 c:\documents\sources\melonds\types.h
|
1481161027 c:\documents\sources\melonds\types.h
|
||||||
|
|
||||||
1485981206 source:c:\documents\sources\melonds\nds.cpp
|
1485982397 source:c:\documents\sources\melonds\nds.cpp
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
<string.h>
|
<string.h>
|
||||||
"NDS.h"
|
"NDS.h"
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"RTC.h"
|
"RTC.h"
|
||||||
"Wifi.h"
|
"Wifi.h"
|
||||||
|
|
||||||
1485979545 source:c:\documents\sources\melonds\arm.cpp
|
1485981252 source:c:\documents\sources\melonds\arm.cpp
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
"NDS.h"
|
"NDS.h"
|
||||||
"ARM.h"
|
"ARM.h"
|
||||||
@ -117,13 +117,13 @@
|
|||||||
1484698068 c:\documents\sources\melonds\dma.h
|
1484698068 c:\documents\sources\melonds\dma.h
|
||||||
"types.h"
|
"types.h"
|
||||||
|
|
||||||
1485964826 source:c:\documents\sources\melonds\gpu.cpp
|
1485982457 source:c:\documents\sources\melonds\gpu.cpp
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
<string.h>
|
<string.h>
|
||||||
"NDS.h"
|
"NDS.h"
|
||||||
"GPU.h"
|
"GPU.h"
|
||||||
|
|
||||||
1484709419 c:\documents\sources\melonds\gpu.h
|
1485982310 c:\documents\sources\melonds\gpu.h
|
||||||
"GPU2D.h"
|
"GPU2D.h"
|
||||||
|
|
||||||
1484848282 c:\documents\sources\melonds\rtc.h
|
1484848282 c:\documents\sources\melonds\rtc.h
|
||||||
|
Reference in New Issue
Block a user