aboutsummaryrefslogtreecommitdiff
path: root/source/nds/displaymodes.cpp
diff options
context:
space:
mode:
authorKitty Draper2011-03-05 21:39:25 -0500
committerKitty Draper2011-03-05 21:39:25 -0500
commitd40ae99422e118188a7f48055dc340c6aca022aa (patch)
tree83ab93f49fd9e66e43bcd824091ae1dbcaa0c173 /source/nds/displaymodes.cpp
downloadsnes9x2005-d40ae99422e118188a7f48055dc340c6aca022aa.tar.gz
snes9x2005-d40ae99422e118188a7f48055dc340c6aca022aa.tar.bz2
snes9x2005-d40ae99422e118188a7f48055dc340c6aca022aa.zip
first commit
Diffstat (limited to 'source/nds/displaymodes.cpp')
-rw-r--r--source/nds/displaymodes.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/source/nds/displaymodes.cpp b/source/nds/displaymodes.cpp
new file mode 100644
index 0000000..4b52753
--- /dev/null
+++ b/source/nds/displaymodes.cpp
@@ -0,0 +1,53 @@
+//entry.c
+#include <stdio.h>
+
+#include "ds2_types.h"
+#include "ds2_cpu.h"
+#include "ds2_timer.h"
+#include "ds2io.h"
+#include "fs_api.h"
+
+
+#include "gfx.h"
+
+
+u32 y_scale_ = (224<<8) / 192;
+
+
+static inline void Put_Pixel (unsigned char* screen, int y, int y_scale)
+{
+
+ memcpy(&screen[((y<<1) << 8)], &GFX.Screen [(((y*y_scale)>>8)<<1) <<8], 256*2);
+}
+
+
+bool Draw_Frame_Flip(bool flip)
+{
+
+ int y = 0;
+
+ do
+ {
+ int tempy = y << 4;
+
+
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_+1);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);tempy++;
+ Put_Pixel ((unsigned char*)up_screen_addr, tempy, y_scale_);
+ }
+ while(++y < 12);
+ return 1;
+}