X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=platform%2Fwin32%2FGenaDrive%2FEmu.cpp;h=d93abafc034ba180aa4cf6c122ef1131d6716dfc;hb=8831ef19a03770189816740eb2304ad2cb9a07a7;hp=5294d7aff13f6c76d4b50ae24dee65152de59432;hpb=cc68a136aa179a5f32fe40208371eb9c2b0aadae;p=picodrive.git diff --git a/platform/win32/GenaDrive/Emu.cpp b/platform/win32/GenaDrive/Emu.cpp index 5294d7af..d93abafc 100644 --- a/platform/win32/GenaDrive/Emu.cpp +++ b/platform/win32/GenaDrive/Emu.cpp @@ -1,48 +1,25 @@ #include "app.h" -extern "C" { -struct Pico -{ - unsigned char ram[0x10000]; // 0x00000 scratch ram - unsigned short vram[0x8000]; // 0x10000 - unsigned char zram[0x2000]; // 0x20000 Z80 ram - unsigned char ioports[0x10]; - unsigned int pad[0x3c]; // unused - unsigned short cram[0x40]; // 0x22100 - unsigned short vsram[0x40]; // 0x22180 - - unsigned char *rom; // 0x22200 - unsigned int romsize; // 0x22204 - -// struct PicoMisc m; -// struct PicoVideo video; -}; - extern struct Pico Pico; -} - unsigned short *EmuScreen=NULL; -extern "C" unsigned short *framebuff=NULL; int EmuWidth=0,EmuHeight=0; -static int frame=0; static int EmuScan(unsigned int num, void *sdata); +unsigned char *PicoDraw2FB = NULL; int EmuInit() { int len=0; -// PicoOpt=-1; -// PsndRate=44100; PsndLen=DSoundSeg; - PicoInit(); // Allocate screen: 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); + PicoDrawSetColorFormat(1); PicoScan=EmuScan; return 0; @@ -52,7 +29,7 @@ void EmuExit() { //RomFree(); free(EmuScreen); EmuScreen=NULL; // Deallocate screen - free(framebuff); + free(PicoDraw2FB); EmuWidth=EmuHeight=0; PicoExit(); @@ -70,7 +47,7 @@ static int EmuScan(unsigned int num, void *sdata) pd=EmuScreen+(num<<8)+(num<<6); end=pd+320; ps=(unsigned short *)sdata; - do { *pd++=(unsigned short)PicoCram(*ps++); } while (pd