X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fwin32%2FGenaDrive%2FEmu.cpp;h=b7a019c5206777590dbc7c45c99464e208b6989a;hb=a5f80ce405bdb5377ed58a2525819ca1a8e11685;hp=4e5bc95055886d889ed52d472d7ed239c14e2d4a;hpb=4b2b67ebc7fc6205c6589243b9c9a0a172a97ebb;p=picodrive.git diff --git a/platform/win32/GenaDrive/Emu.cpp b/platform/win32/GenaDrive/Emu.cpp index 4e5bc95..b7a019c 100644 --- a/platform/win32/GenaDrive/Emu.cpp +++ b/platform/win32/GenaDrive/Emu.cpp @@ -2,9 +2,9 @@ #include "app.h" unsigned short *EmuScreen=NULL; -extern "C" unsigned short *framebuff=NULL; -int EmuWidth=0,EmuHeight=0; -static int frame=0; +int EmuWidth=320,EmuHeight=224; +RECT EmuScreenRect = { 0, 0, 320, 224 }; + static int EmuScan(unsigned int num, void *sdata); unsigned char *PicoDraw2FB = NULL; @@ -18,10 +18,9 @@ int EmuInit() EmuWidth=320; EmuHeight=224; len=EmuWidth*EmuHeight; len<<=1; EmuScreen=(unsigned short *)malloc(len); if (EmuScreen==NULL) return 1; - framebuff=(unsigned short *)malloc((8+320)*(8+224+8)*2); + PicoDraw2FB=(unsigned char *)malloc((8+320)*(8+224+8)*2); memset(EmuScreen,0,len); - PicoDraw2FB = (unsigned char *)framebuff; PicoDrawSetColorFormat(1); PicoScan=EmuScan; @@ -32,7 +31,7 @@ void EmuExit() { //RomFree(); free(EmuScreen); EmuScreen=NULL; // Deallocate screen - free(framebuff); + free(PicoDraw2FB); EmuWidth=EmuHeight=0; PicoExit(); @@ -41,16 +40,16 @@ void EmuExit() // Megadrive scanline callback: static int EmuScan(unsigned int num, void *sdata) { - unsigned short *pd=NULL,*end=NULL; + unsigned short *pd=NULL; unsigned short *ps=NULL; if (num>=(unsigned int)EmuHeight) return 0; // Copy scanline to screen buffer: - pd=EmuScreen+(num<<8)+(num<<6); end=pd+320; + pd=EmuScreen+(num<<8)+(num<<6); ps=(unsigned short *)sdata; - do { *pd++=*ps++; } while (pd