aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-01-18 17:57:12 +0100
committerStapleButter <thetotalworm@gmail.com>2017-01-18 17:57:12 +0100
commitd7c1d2a2cdb39c5e0bc6c3711968b876485d758a (patch)
treeed7f95ad0cf489535c4637e25279419f6974659b /main.cpp
parentd30e6956fa59182a23941a535d5f6c2bf515918a (diff)
* start GPU shit: draw BG0 16-color.
* fix a few DMA bugs. * fix a bug where some code could still run right after a halt instruction. * fix VRAM mapping, too. I'm an idiot.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 56ef7a7..8e40f89 100644
--- a/main.cpp
+++ b/main.cpp
@@ -34,6 +34,12 @@ LRESULT CALLBACK derpo(HWND window, UINT msg, WPARAM wparam, LPARAM lparam)
{
case WM_CLOSE:
printf("close\n");
+ {
+ FILE* f = fopen("vram.bin", "wb");
+ for (int i = 0; i < 128; i++)
+ fwrite(GPU::VRAM_BBG[i], 16384, 1, f);
+ fclose(f);
+ }
PostQuitMessage(0);
return 0;
@@ -46,6 +52,7 @@ LRESULT CALLBACK derpo(HWND window, UINT msg, WPARAM wparam, LPARAM lparam)
case VK_DOWN: NDS::PressKey(7); break;
case VK_LEFT: NDS::PressKey(5); break;
case VK_RIGHT: NDS::PressKey(4); break;
+ case 'P': NDS::PressKey(16+6); break;
}
return 0;
@@ -58,6 +65,7 @@ LRESULT CALLBACK derpo(HWND window, UINT msg, WPARAM wparam, LPARAM lparam)
case VK_DOWN: NDS::ReleaseKey(7); break;
case VK_LEFT: NDS::ReleaseKey(5); break;
case VK_RIGHT: NDS::ReleaseKey(4); break;
+ case 'P': NDS::ReleaseKey(16+6); break;
}
return 0;