/* Functions for drawing stuff on the screen (actually they all draw to vram) all sprite functions are a modified version of void CopySprite(const color_t* sprite, int x, int y, int width, int height) { color_t* VRAM = (color_t*)GetVRAMAddress(); VRAM += LCD_WIDTH_PX*y + x; for(int j=y; j // #include // memcpy #include "memcopy.h" // memcpy replacement // a global pointer to the VRAM-address, because we don't want to call GetVRAMAddress() every draw call color_t* vramadress; // initialize the global vramaddress variable void initDrawing() { /* People used to have a hardcoded VRAM-Address which made the programms incompatible for either Casio fx-CG50 (if 0xA8000000 was used) or the fx-CG10 and fx-CG20 (if 0xAC000000 was used) */ vramadress = (color_t*)GetVRAMAddress(); } // Simply drawing sprites (not used in this project) void drawSprite(const color_t* sprite, int x, int y, int width, int height) { color_t* VRAM = (color_t*)vramadress; VRAM += LCD_WIDTH_PX*y + x; for(int j=y; j LCD_WIDTH_PX) cutwidth -= (x+width)-LCD_WIDTH_PX; if(cutwidth < 1) return; // the sprite is out of view // top cutoff unsigned int y_offset = 0; if(y < 0) y_offset = -y; // bottom cutoff if(y+height > LCD_HEIGHT_PX) height -= (y+height)-LCD_HEIGHT_PX; VRAM += LCD_WIDTH_PX*(y+y_offset) + x+x_offset; sprite += y_offset*width+x_offset; for(int j=y+y_offset; j