From d40ae99422e118188a7f48055dc340c6aca022aa Mon Sep 17 00:00:00 2001 From: Kitty Draper Date: Sat, 5 Mar 2011 21:39:25 -0500 Subject: first commit --- source/nds/displaymodes.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 source/nds/displaymodes.cpp (limited to 'source/nds/displaymodes.cpp') 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 + +#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; +} -- cgit v1.2.3