From 15eb00019d86fb8fd460f9b739ac8eba0a81ace0 Mon Sep 17 00:00:00 2001 From: emudave Date: Mon, 7 Feb 2011 22:35:41 +0000 Subject: [PATCH] Added 0.030 of PicoDrive and moved license files into root --- .../License-GPLv2.txt => License-GPLv2.txt | 0 Cyclone/License.txt => License.txt | 0 Pico/Area.cpp | 163 +++ Pico/Cart.cpp | 92 ++ Pico/Disa.c | 2 +- Pico/Disa.h | 6 +- Pico/Draw.cpp | 348 ++++++ Pico/MakeSine.bat | 4 + Pico/MakeSine.cpp | 38 + Pico/Makefile | 17 + Pico/Makefile.mir | 25 + Pico/Makefile.symb | 41 + Pico/Memory.cpp | 251 ++++ Pico/Pico.cpp | 215 ++++ Pico/Pico.dsp | 172 +++ Pico/Pico.dsw | 29 + Pico/Pico.h | 61 + Pico/Pico.vcp | 1074 +++++++++++++++++ Pico/Pico.vcw | 29 + Pico/PicoInt.h | 132 ++ Pico/Profile.cpp | 50 + Pico/Psnd.cpp | 245 ++++ Pico/Sek.cpp | 133 ++ Pico/Sine.cpp | 36 + Pico/SymbianClean.bat | 2 + Pico/SymbianMake.bat | 3 + Pico/Utils.cpp | 76 ++ Pico/VideoPort.cpp | 222 ++++ Pico/driver.h | 19 + PicoDrive/Config.cpp | 86 ++ PicoDrive/Debug.cpp | 80 ++ PicoDrive/Emulate.cpp | 217 ++++ PicoDrive/File.cpp | 62 + PicoDrive/FrameWindow.cpp | 92 ++ PicoDrive/PicoDrive.txt | 189 +++ PicoDrive/PicoDrive.vcp | 851 +++++++++++++ PicoDrive/PicoDrive.vcw | 44 + PicoDrive/Script1.rc | 116 ++ PicoDrive/Wave.cpp | 105 ++ PicoDrive/WinMain.cpp | 71 ++ PicoDrive/afxres.h | 7 + PicoDrive/resource.h | 27 + PicoDrive/stdafx.h | 73 ++ 43 files changed, 5503 insertions(+), 2 deletions(-) rename Cyclone/License-GPLv2.txt => License-GPLv2.txt (100%) rename Cyclone/License.txt => License.txt (100%) create mode 100644 Pico/Area.cpp create mode 100644 Pico/Cart.cpp create mode 100644 Pico/Draw.cpp create mode 100644 Pico/MakeSine.bat create mode 100644 Pico/MakeSine.cpp create mode 100644 Pico/Makefile create mode 100644 Pico/Makefile.mir create mode 100644 Pico/Makefile.symb create mode 100644 Pico/Memory.cpp create mode 100644 Pico/Pico.cpp create mode 100644 Pico/Pico.dsp create mode 100644 Pico/Pico.dsw create mode 100644 Pico/Pico.h create mode 100644 Pico/Pico.vcp create mode 100644 Pico/Pico.vcw create mode 100644 Pico/PicoInt.h create mode 100644 Pico/Profile.cpp create mode 100644 Pico/Psnd.cpp create mode 100644 Pico/Sek.cpp create mode 100644 Pico/Sine.cpp create mode 100644 Pico/SymbianClean.bat create mode 100644 Pico/SymbianMake.bat create mode 100644 Pico/Utils.cpp create mode 100644 Pico/VideoPort.cpp create mode 100644 Pico/driver.h create mode 100644 PicoDrive/Config.cpp create mode 100644 PicoDrive/Debug.cpp create mode 100644 PicoDrive/Emulate.cpp create mode 100644 PicoDrive/File.cpp create mode 100644 PicoDrive/FrameWindow.cpp create mode 100644 PicoDrive/PicoDrive.txt create mode 100644 PicoDrive/PicoDrive.vcp create mode 100644 PicoDrive/PicoDrive.vcw create mode 100644 PicoDrive/Script1.rc create mode 100644 PicoDrive/Wave.cpp create mode 100644 PicoDrive/WinMain.cpp create mode 100644 PicoDrive/afxres.h create mode 100644 PicoDrive/resource.h create mode 100644 PicoDrive/stdafx.h diff --git a/Cyclone/License-GPLv2.txt b/License-GPLv2.txt similarity index 100% rename from Cyclone/License-GPLv2.txt rename to License-GPLv2.txt diff --git a/Cyclone/License.txt b/License.txt similarity index 100% rename from Cyclone/License.txt rename to License.txt diff --git a/Pico/Area.cpp b/Pico/Area.cpp new file mode 100644 index 0000000..b0d2fb5 --- /dev/null +++ b/Pico/Area.cpp @@ -0,0 +1,163 @@ + +#include "PicoInt.h" + +int (*PicoAcb)(struct PicoArea *)=NULL; // Area callback for each block of memory +FILE *PmovFile=NULL; +int PmovAction=0; + +// Scan one variable and callback +static void ScanVar(void *data,int len,char *name) +{ + struct PicoArea pa={NULL,0,NULL}; + pa.data=data; pa.len=len; pa.name=name; + if (PicoAcb) PicoAcb(&pa); +} + +#define SCAN_VAR(x,y) ScanVar(&x,sizeof(x),y); +#define SCANP(x) ScanVar(&Pico.x,sizeof(Pico.x),#x); + +// Pack the cpu into a common format: +static int PackCpu(unsigned char *cpu) +{ + unsigned int pc=0; + +#ifdef EMU_A68K + memcpy(cpu,M68000_regs.d,0x40); + pc=M68000_regs.pc; + *(unsigned char *)(cpu+0x44)=(unsigned char)M68000_regs.ccr; + *(unsigned char *)(cpu+0x45)=(unsigned char)M68000_regs.srh; + *(unsigned int *)(cpu+0x48)=M68000_regs.isp; +#endif + +#ifdef EMU_C68K + memcpy(cpu,PicoCpu.d,0x40); + pc=PicoCpu.pc-PicoCpu.membase; + *(unsigned char *)(cpu+0x44)=PicoCpu.ccr; + *(unsigned char *)(cpu+0x45)=PicoCpu.srh; + *(unsigned int *)(cpu+0x48)=PicoCpu.osp; +#endif + + *(unsigned int *)(cpu+0x40)=pc; + return 0; +} + +static int UnpackCpu(unsigned char *cpu) +{ + unsigned int pc=0; + + pc=*(unsigned int *)(cpu+0x40); + +#ifdef EMU_A68K + memcpy(M68000_regs.d,cpu,0x40); + M68000_regs.pc=pc; + M68000_regs.ccr=*(unsigned char *)(cpu+0x44); + M68000_regs.srh=*(unsigned char *)(cpu+0x45); + M68000_regs.isp=*(unsigned int *)(cpu+0x48); +#endif + +#ifdef EMU_C68K + memcpy(PicoCpu.d,cpu,0x40); + PicoCpu.membase=0; + PicoCpu.pc =PicoCpu.checkpc(pc); // Base pc + PicoCpu.ccr=*(unsigned char *)(cpu+0x44); + PicoCpu.srh=*(unsigned char *)(cpu+0x45); + PicoCpu.osp=*(unsigned int *)(cpu+0x48); +#endif + return 0; +} + +// Scan the contents of the virtual machine's memory for saving or loading +int PicoAreaScan(int action,int *pmin) +{ + unsigned char cpu[0x60]; + + memset(&cpu,0,sizeof(cpu)); + + if (action&4) + { + // Scan all the memory areas: + SCANP(ram) SCANP(vram) SCANP(zram) SCANP(cram) SCANP(vsram) + + // Pack, scan and unpack the cpu data: + PackCpu(cpu); + SekInit(); + PicoMemInit(); + SCAN_VAR(cpu,"cpu") + UnpackCpu(cpu); + + SCAN_VAR(Pico.m ,"misc") + SCAN_VAR(Pico.video,"video") + SCAN_VAR(Pico.s ,"sound") + + Pico.m.scanline=0; + if (action&2) + { + memset(Pico.highpal,0,sizeof(Pico.highpal)); + Pico.m.dirtyPal=1; // Recalculate palette + } + } + + if (pmin) *pmin=0x0021; + + return 0; +} + +// --------------------------------------------------------------------------- +// Helper code to save/load to a file handle + +// Area callback for each piece of Megadrive memory, read or write to the file: +static int StateAcb(struct PicoArea *pa) +{ + if (PmovFile==NULL) return 1; + + if ((PmovAction&3)==1) fwrite(pa->data,1,pa->len,PmovFile); + if ((PmovAction&3)==2) fread (pa->data,1,pa->len,PmovFile); + return 0; +} + +// Save or load the state from PmovFile: +int PmovState() +{ + int minimum=0; + unsigned char head[32]; + + memset(head,0,sizeof(head)); + + // Find out minial compatible version: + PicoAreaScan(PmovAction&0xc,&minimum); + + memcpy(head,"Pico",4); + *(unsigned int *)(head+0x8)=PicoVer; + *(unsigned int *)(head+0xc)=minimum; + + // Scan header: + if (PmovAction&1) fwrite(head,1,sizeof(head),PmovFile); + if (PmovAction&2) fread (head,1,sizeof(head),PmovFile); + + // Scan memory areas: + PicoAcb=StateAcb; + PicoAreaScan(PmovAction,NULL); + PicoAcb=NULL; + return 0; +} + +int PmovUpdate() +{ + int ret=0; + if (PmovFile==NULL) return 1; + + if ((PmovAction&3)==0) return 0; + + PicoPad[1]=0; // Make sure pad #2 is blank + if (PmovAction&1) ret=fwrite(PicoPad,1,2,PmovFile); + if (PmovAction&2) ret=fread (PicoPad,1,2,PmovFile); + + if (ret!=2) + { + // End of file + fclose(PmovFile); PmovFile=NULL; + PmovAction=0; + } + + return 0; +} diff --git a/Pico/Cart.cpp b/Pico/Cart.cpp new file mode 100644 index 0000000..e7b81c1 --- /dev/null +++ b/Pico/Cart.cpp @@ -0,0 +1,92 @@ + +#include "PicoInt.h" + +static void Byteswap(unsigned char *data,int len) +{ + int i=0; + + if (len<2) return; // Too short + + do + { + unsigned short *pd=(unsigned short *)(data+i); + int value=*pd; // Get 2 bytes + + value=(value<<8)|(value>>8); // Byteswap it + *pd=(unsigned short)value; // Put 2b ytes + i+=2; + } + while (i+2<=len); +} + +// Interleve a 16k block and byteswap +static int InterleveBlock(unsigned char *dest,unsigned char *src) +{ + int i=0; + for (i=0;i<0x2000;i++) dest[(i<<1) ]=src[ i]; // Odd + for (i=0;i<0x2000;i++) dest[(i<<1)+1]=src[0x2000+i]; // Even + return 0; +} + +// Decode a SMD file +static int DecodeSmd(unsigned char *data,int len) +{ + unsigned char *temp=NULL; + int i=0; + + temp=(unsigned char *)malloc(0x4000); + if (temp==NULL) return 1; + memset(temp,0,0x4000); + + // Interleve each 16k block and shift down by 0x200: + for (i=0; i+0x4200<=len; i+=0x4000) + { + InterleveBlock(temp,data+0x200+i); // Interleve 16k to temporary buffer + memcpy(data+i,temp,0x4000); // Copy back in + } + + free(temp); + return 0; +} + +int PicoCartLoad(FILE *f,unsigned char **prom,unsigned int *psize) +{ + unsigned char *rom=NULL; int size=0; + if (f==NULL) return 1; + + fseek(f,0,SEEK_END); size=ftell(f); fseek(f,0,SEEK_SET); + + size=(size+3)&~3; // Round up to a multiple of 4 + + // Allocate space for the rom plus padding + rom=(unsigned char *)malloc(size+4); + if (rom==NULL) { fclose(f); return 1; } + memset(rom,0,size+4); + + fread(rom,1,size,f); // Load up the rom + fclose(f); + + // Check for SMD: + if ((size&0x3fff)==0x200) { DecodeSmd(rom,size); size-=0x200; } // Decode and byteswap SMD + else Byteswap(rom,size); // Just byteswap + + if (prom) *prom=rom; + if (psize) *psize=size; + + return 0; +} + +// Insert/remove a cartridge: +int PicoCartInsert(unsigned char *rom,unsigned int romsize) +{ + // Make sure movie playing/recording is stopped: + if (PmovFile) fclose(PmovFile); + PmovFile=NULL; PmovAction=0; + + memset(&Pico,0,sizeof(Pico)); // Blank Pico state + Pico.rom=rom; + Pico.romsize=romsize; + PicoReset(); + + return 0; +} diff --git a/Pico/Disa.c b/Pico/Disa.c index dbab233..b08f204 100644 --- a/Pico/Disa.c +++ b/Pico/Disa.c @@ -1,5 +1,5 @@ -// Dave's Disa 68000 Disassembler +// Disa 68000 Disassembler #ifndef __GNUC__ #pragma warning(disable:4115) #endif diff --git a/Pico/Disa.h b/Pico/Disa.h index af10eb5..fe54749 100644 --- a/Pico/Disa.h +++ b/Pico/Disa.h @@ -1,11 +1,15 @@ -// Dave's Disa 68000 Disassembler +// Disa 68000 Disassembler #ifdef __cplusplus extern "C" { #endif +#if defined(__GNUC__) || defined(_WIN32_WCE) #define CPU_CALL +#else +#define CPU_CALL __fastcall +#endif extern unsigned int DisaPc; extern char *DisaText; // Text buffer to write in diff --git a/Pico/Draw.cpp b/Pico/Draw.cpp new file mode 100644 index 0000000..d9fdb02 --- /dev/null +++ b/Pico/Draw.cpp @@ -0,0 +1,348 @@ + +#include "PicoInt.h" +#ifndef __GNUC__ +#pragma warning (disable:4706) // Disable assignment with conditional +#endif + +int (*PicoScan)(unsigned int num,unsigned short *data)=NULL; + +// Line colour indices - in the format 00ppcccc pp=palette, cccc=colour +static unsigned short HighCol[32+320+8]; // Gap for 32 column, and messy border on right +static int Scanline=0; // Scanline + +int PicoMask=0xfff; // Mask of which layers to draw + +static int TileNorm(unsigned short *pd,int addr,unsigned int *pal) +{ + unsigned int pack=0; unsigned int t=0; + + pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels + if (pack) + { + t=pack&0x0000f000; if (t) { t=pal[t>>12]; pd[0]=(unsigned short)t; } + t=pack&0x00000f00; if (t) { t=pal[t>> 8]; pd[1]=(unsigned short)t; } + t=pack&0x000000f0; if (t) { t=pal[t>> 4]; pd[2]=(unsigned short)t; } + t=pack&0x0000000f; if (t) { t=pal[t ]; pd[3]=(unsigned short)t; } + t=pack&0xf0000000; if (t) { t=pal[t>>28]; pd[4]=(unsigned short)t; } + t=pack&0x0f000000; if (t) { t=pal[t>>24]; pd[5]=(unsigned short)t; } + t=pack&0x00f00000; if (t) { t=pal[t>>20]; pd[6]=(unsigned short)t; } + t=pack&0x000f0000; if (t) { t=pal[t>>16]; pd[7]=(unsigned short)t; } + return 0; + } + + return 1; // Tile blank +} + +static int TileFlip(unsigned short *pd,int addr,unsigned int *pal) +{ + unsigned int pack=0; unsigned int t=0; + + pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels + if (pack) + { + t=pack&0x000f0000; if (t) { t=pal[t>>16]; pd[0]=(unsigned short)t; } + t=pack&0x00f00000; if (t) { t=pal[t>>20]; pd[1]=(unsigned short)t; } + t=pack&0x0f000000; if (t) { t=pal[t>>24]; pd[2]=(unsigned short)t; } + t=pack&0xf0000000; if (t) { t=pal[t>>28]; pd[3]=(unsigned short)t; } + t=pack&0x0000000f; if (t) { t=pal[t ]; pd[4]=(unsigned short)t; } + t=pack&0x000000f0; if (t) { t=pal[t>> 4]; pd[5]=(unsigned short)t; } + t=pack&0x00000f00; if (t) { t=pal[t>> 8]; pd[6]=(unsigned short)t; } + t=pack&0x0000f000; if (t) { t=pal[t>>12]; pd[7]=(unsigned short)t; } + return 0; + } + return 1; // Tile blank +} + +struct TileStrip +{ + int nametab; // Position in VRAM of name table (for this tile line) + int line; // Line number in pixels 0x000-0x3ff within the virtual tilemap + int hscroll; // Horizontal scroll value in pixels for the line + int xmask; // X-Mask (0x1f - 0x7f) for horizontal wraparound in the tilemap + int high; // High or low tiles +}; + +static int WrongPri=0; // 1 if there were tiles which are the wrong priority + +static int DrawStrip(struct TileStrip ts) +{ + int tilex=0,dx=0,ty=0; + int blank=-1; // The tile we know is blank + + WrongPri=0; + + // Draw tiles across screen: + tilex=(-ts.hscroll)>>3; + ty=(ts.line&7)<<1; // Y-Offset into tile + for (dx=((ts.hscroll-1)&7)+1; dx<328; dx+=8,tilex++) + { + int code=0,addr=0,zero=0; + unsigned int *pal=NULL; + + code=Pico.vram[ts.nametab+(tilex&ts.xmask)]; + if (code==blank) continue; + if ((code>>15)!=ts.high) { WrongPri=1; continue; } + + // Get tile address/2: + addr=(code&0x7ff)<<4; + if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip + + pal=Pico.highpal+((code>>9)&0x30); + + if (code&0x0800) zero=TileFlip(HighCol+24+dx,addr,pal); + else zero=TileNorm(HighCol+24+dx,addr,pal); + + if (zero) blank=code; // We know this tile is blank now + } + + return 0; +} + +static int DrawLayer(int plane,int high) +{ + struct PicoVideo *pvid=&Pico.video; + static char shift[4]={5,6,6,7}; // 32,64 or 128 sized tilemaps + struct TileStrip ts; + + // Work out the TileStrip to draw + + // Get vertical scroll value: + int vscroll=Pico.vsram[plane]; + + int htab=pvid->reg[13]<<9; // Horizontal scroll table address + if ( pvid->reg[11]&2) htab+=Scanline<<1; // Offset by line + if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile + htab+=plane; // A or B + + // Get horizontal scroll value + ts.hscroll=Pico.vram[htab&0x7fff]; + + // Work out the name table size: 32 64 or 128 tiles (0-3) + int width=pvid->reg[16]; + int height=(width>>4)&3; width&=3; + + ts.xmask=(1<reg[2]&0x38)<< 9; // A + else ts.nametab=(pvid->reg[4]&0x07)<<12; // B + + // Find the line in the name table + ts.line=(vscroll+Scanline)&ymask; + ts.nametab+=(ts.line>>3)<reg[3]&0x3c)<<9; // 40-cell mode + ts.nametab+=(ts.line>>3)<<6; + } + else + { + ts.nametab=(pvid->reg[3]&0x3e)<<9; // 32-cell mode + ts.nametab+=(ts.line>>3)<<5; + } + + ts.xmask=0x3f; + ts.high=high; + + DrawStrip(ts); + return 0; +} + +static int DrawSprite(int sy,unsigned short *sprite,int high) +{ + int sx=0,width=0,height=0; + int row=0,code=0; + unsigned int *pal=NULL; + int tile=0,delta=0; + int i=0; + + code=sprite[2]; + if ((code>>15)!=high) { WrongPri=1; return 0; } // Wrong priority + + height=sprite[1]>>8; + width=(height>>2)&3; height&=3; + width++; height++; // Width and height in tiles + if (Scanline>=sy+(height<<3)) return 0; // Not on this line after all + + row=Scanline-sy; // Row of the sprite we are on + pal=Pico.highpal+((code>>9)&0x30); // Get palette pointer + if (code&0x1000) row=(height<<3)-1-row; // Flip Y + + tile=code&0x7ff; // Tile number + tile+=row>>3; // Tile number increases going down + delta=height; // Delta to increase tile by going right + if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X + + tile<<=4; tile+=(row&7)<<1; // Tile address + delta<<=4; // Delta of address + + sx=(sprite[3]&0x1ff)-0x78; // Get X coordinate + 8 + + for (i=0; i=328) continue; // Offscreen + + tile&=0x7fff; // Clip tile address + if (code&0x0800) TileFlip(HighCol+24+sx,tile,pal); + else TileNorm(HighCol+24+sx,tile,pal); + } + + return 0; +} + +static int DrawAllSprites(int high) +{ + struct PicoVideo *pvid=&Pico.video; + int table=0; + int i=0,link=0; + unsigned char spin[80]; // Sprite index + + WrongPri=0; + + table=pvid->reg[5]&0x7f; + if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode + table<<=8; // Get sprite table address/2 + + for (;;) + { + unsigned short *sprite=NULL; + + spin[i]=(unsigned char)link; + sprite=Pico.vram+((table+(link<<2))&0x7ffc); // Find sprite + + // Find next sprite + link=sprite[1]&0x7f; + if (link==0 || i>=79) break; // End of sprites + i++; + } + + // Go through sprites backwards: + for ( ;i>=0; i--) + { + unsigned short *sprite=NULL; + int sy=0; + + sprite=Pico.vram+((table+(spin[i]<<2))&0x7ffc); // Find sprite + + sy=(sprite[0]&0x1ff)-0x80; // Get Y coordinate + + if (Scanline>=sy && Scanline=edge) full=1; } + else { if (Scanline< edge) full=1; } + + if (PicoMask&0x04) { DrawLayer(1,0); bhigh=WrongPri; } + if (PicoMask&0x08) { if (full) DrawWindow(0); else DrawLayer(0,0); ahigh=WrongPri; } + if (PicoMask&0x10) { DrawAllSprites(0); shigh=WrongPri; } + + if (bhigh) if (PicoMask&0x20) DrawLayer(1,1); + if (ahigh) if (PicoMask&0x40) { if (full) DrawWindow(1); else DrawLayer(0,1); } + if (shigh) if (PicoMask&0x80) DrawAllSprites(1); + return 0; +} + +static int UpdatePalette() +{ + int c=0; + + // Update palette: + for (c=0;c<64;c++) Pico.highpal[c]=(unsigned short)PicoCram(Pico.cram[c]); + Pico.m.dirtyPal=0; + + return 0; +} + +static int Overlay() +{ + int col=0,x=0; + + if (PmovAction==0) return 0; + if (Scanline>=4) return 0; + + if (PmovAction&1) col =0x00f; + if (PmovAction&2) col|=0x0f0; + col=PicoCram(col); + + for (x=0;x<4;x++) HighCol[32+x]=(unsigned short)col; + + return 0; +} + +static int Skip=0; + + +int PicoLine(int scan) +{ + if (Skip>0) { Skip--; return 0; } // Skip rendering lines + + Scanline=scan; + + if (Pico.m.dirtyPal) UpdatePalette(); + + // Draw screen: + if (PicoMask&0x02) BackFill(); + if (Pico.video.reg[1]&0x40) DrawDisplay(); + + Overlay(); + + if (Pico.video.reg[12]&1) + { + Skip=PicoScan(Scanline,HighCol+32); // 40-column mode + } + else + { + // Crop, centre and return 32-column mode + memset(HighCol, 0,64); // Left border + memset(HighCol+288,0,64); // Right border + Skip=PicoScan(Scanline,HighCol); + } + + return 0; +} + diff --git a/Pico/MakeSine.bat b/Pico/MakeSine.bat new file mode 100644 index 0000000..b9581ab --- /dev/null +++ b/Pico/MakeSine.bat @@ -0,0 +1,4 @@ +cl /W4 MakeSine.cpp +del MakeSine.obj +MakeSine.exe > Sine.cpp +del MakeSine.exe diff --git a/Pico/MakeSine.cpp b/Pico/MakeSine.cpp new file mode 100644 index 0000000..610cb0a --- /dev/null +++ b/Pico/MakeSine.cpp @@ -0,0 +1,38 @@ + +// Make a Sine table + +#pragma warning (disable:4514) + +#include +#include +#include +#include + +#define PI 3.14159265358979 + +int main() +{ + int i=0; + + printf ("\nshort Sine[0x100]=\n"); + printf ("{\n"); + + for (i=0;i<0x100;i++) + { + double fAng,fPos; + int nPos; + if ((i&7)==0) printf (" "); + + fAng=(double)i/(double)0x100; + fAng*=2*PI; + fPos=sin(fAng)*(double)0x4000; + nPos=(int)fPos; + printf ("%+6d,",nPos); + + if ((i&7)==7) printf ("\n"); + } + + printf ("};\n"); + + return 0; +} diff --git a/Pico/Makefile b/Pico/Makefile new file mode 100644 index 0000000..36e893b --- /dev/null +++ b/Pico/Makefile @@ -0,0 +1,17 @@ + +# Makefile for GP32 + +export CCBASE=D:/Devkitadv +export CUSER=-DLITTLE_ENDIAN -DGP32 -W -Wall +include $(CCBASE)/gp32.mk + +OBJS = Area.o Cart.o Disa.o Draw.o Memory.o Pico.o Psnd.o \ + Sek.o Sine.o VideoPort.o ym2612.o ../Cyclone/Cyclone.o + +Pico.a: $(OBJS) + ar -rs $@ $(OBJS) + + +Draw.o: Draw.cpp + gcc $(CFLAGS) -S $< + gcc $(CFLAGS) -c $< diff --git a/Pico/Makefile.mir b/Pico/Makefile.mir new file mode 100644 index 0000000..d4589d3 --- /dev/null +++ b/Pico/Makefile.mir @@ -0,0 +1,25 @@ + +# Makefile for GP32 (Mr. Mirko's SDK) + +CC=arm-elf-gcc +LD=arm-elf-gcc +AS=arm-elf-as +AR=arm-elf-ar + +INCLUDES=-I/gp32_MrMirko/lib.src/include +CFLAGS=$(INCLUDES) -O3 -W -Wall + +CPPFLAGS=$(CFLAGS) + +OBJS = Area.o Cart.o Disa.o Draw.o Memory.o Pico.o Psnd.o \ + Sek.o Sine.o VideoPort.o ym2612.o ../Cyclone/Cyclone.o + +Pico.a: $(OBJS) + $(AR) -rs $@ $(OBJS) + +VideoPort.o: VideoPort.cpp + $(CC) -c -O2 -W -Wall $< + +Draw.o: Draw.cpp + arm-elf-gcc $(CFLAGS) -S $< + arm-elf-gcc $(CFLAGS) -c $< diff --git a/Pico/Makefile.symb b/Pico/Makefile.symb new file mode 100644 index 0000000..65c4f24 --- /dev/null +++ b/Pico/Makefile.symb @@ -0,0 +1,41 @@ + +# Makefile for Symbian + +INCL=\ + -I "D:\Symbian\6.1\Series60\Epoc32\Include" \ + -I "D:\Symbian\6.1\Series60\Epoc32\Include\libc" + +# ----------------------------- ARM Compiler ----------------------------- +BPATH=D:\Symbian\6.1\Shared\Epoc32\gcc\bin +CPP=$(BPATH)\gcc +AS =$(BPATH)\as +AR =$(BPATH)\ar +CFLAGS=-D__SYMBIAN32__ -D__GCC32__ $(INCL) -march=armv4t \ + -Wall -Wno-ctor-dtor-privacy -O3 \ + -mstructure-size-boundary=32 \ + -fno-builtin + +OBJS = Area.o Cart.o Disa.o Draw.o Memory.o Pico.o Psnd.o \ + Sek.o Sine.o VideoPort.o Utils.o Cyclone.o ym2612.o + +Pico.lib: $(OBJS) + $(AR) -rs $@ $(OBJS) + copy Pico.lib "\Symbian\6.1\Series60\Epoc32\Release\armi\urel\" + copy Pico.lib "\Symbian\6.1\Series60\Epoc32\Release\thumb\urel\" + +Cyclone.o: ../Cyclone/Cyclone.s + $(AS) -mthumb-interwork -o $@ ../Cyclone/Cyclone.s 2> nul + +Utils.o: Utils.cpp + @$(CPP) $(CFLAGS) -S $*.cpp + @$(CPP) $(CFLAGS) -c $*.cpp + +.cpp.o: + @$(CPP) $(CFLAGS) -c $*.cpp +.c.o: + @$(CPP) $(CFLAGS) -c $*.c + + +CLEANUP=*.o *.lib Draw.s +clean : + for %i in ( $(CLEANUP) ) do if exist %i del %i diff --git a/Pico/Memory.cpp b/Pico/Memory.cpp new file mode 100644 index 0000000..64c1815 --- /dev/null +++ b/Pico/Memory.cpp @@ -0,0 +1,251 @@ + +#include "PicoInt.h" + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; + +static int PicoMemBase(u32 pc) +{ + int membase=0; + + if (pc>16); +} +#endif + +#ifdef EMU_C68K +static u32 PicoCheckPc(u32 pc) +{ + pc-=PicoCpu.membase; // Get real pc + pc&=0xffffff; + + PicoCpu.membase=PicoMemBase(pc); + + return PicoCpu.membase+pc; +} +#endif + +#ifdef EMU_NULL +static u32 PicoCheckPc(u32) { return 0; } +#endif + + +int PicoInitPc(u32 pc) +{ + PicoCheckPc(pc); + return 0; +} + +// ----------------------------------------------------------------- +static int PadRead(int i) +{ + int pad=0,value=0; + pad=~PicoPad[i]; // Get inverse of pad + + if (Pico.m.padSelect[i]) value=0x40|(pad&0x3f); // 01CB RLDU + else value=((pad&0xc0)>>2)|(pad&3); // 00SA 00DU + + return (value<<8)|value; // Mirror bytes +} + +static u32 OtherRead16(u32 a) +{ + u32 d=0; + + if ((a&0xffe000)==0xa00000) + { + // Z80 ram + d=*(u16 *)(Pico.zram+(a&0x1fff)); + + if (Pico.m.rotate&2) { d=(Pico.m.rotate>>2)&0xff; d|=d<<8; } // Fake z80 + Pico.m.rotate++; + + goto end; + } + + if ((a&0xffe000)==0xa00000) + { + // Fake Z80 ram + d=((Pico.m.rotate++)>>2)&0xff; d|=d<<8; + goto end; + } + + if (a==0xa04000) { d=Pico.m.rotate&3; Pico.m.rotate++; goto end; } // Fudge + if (a==0xa10000) { d=Pico.m.hardware; goto end; } // Hardware value + if (a==0xa10002) { d=PadRead(0); goto end; } + if (a==0xa10004) { d=PadRead(1); goto end; } + if (a==0xa11100) { d=((Pico.m.rotate++)&4)<<6; goto end; } // Fudge z80 reset + + if ((a&0xffffe0)==0xc00000) { d=PicoVideoRead(a); goto end; } + +end: + return d; +} + +static void OtherWrite8(u32 a,u32 d) +{ + if ((a&0xffe000)==0xa00000) { Pico.zram[(a^1)&0x1fff]=(u8)d; return; } // Z80 ram + if ((a&0xfffffc)==0xa04000) { PsndFm(a,d); return; } // FM Sound + + if (a==0xa11100) { Pico.m.z80Run=(u8)(d^1); return; } + if (a==0xa10003) { Pico.m.padSelect[0]=(u8)((d>>6)&1); return; } // Joypad 1 select + if (a==0xa10005) { Pico.m.padSelect[1]=(u8)((d>>6)&1); return; } // Joypad 2 select + + if ((a&0xffffe0)==0xc00000) { PicoVideoWrite(a,d|(d<<8)); return; } // Byte access gets mirrored +} + +static void OtherWrite16(u32 a,u32 d) +{ + if ((a&0xffffe0)==0xc00000) { PicoVideoWrite(a,d); return; } + if ((a&0xffe000)==0xa00000) { *(u16 *)(Pico.zram+(a&0x1ffe))=(u16)d; return; } // Z80 ram + + OtherWrite8(a, d>>8); + OtherWrite8(a+1,d&0xff); +} + +// ----------------------------------------------------------------- +// Read Rom and read Ram + +static u8 CPU_CALL PicoRead8(u32 a) +{ + u32 d=0; + a&=0xffffff; + + if (a>=8; + return (u8)d; +} + +u16 CPU_CALL PicoRead16(u32 a) +{ + a&=0xfffffe; + + if (a>16); pm[1]=(u16)d; + return; + } + + a&=0xfffffe; + OtherWrite16(a, (u16)(d>>16)); + OtherWrite16(a+2,(u16)d); +} + + +// ----------------------------------------------------------------- +int PicoMemInit() +{ +#ifdef EMU_C68K + // Setup memory callbacks: + PicoCpu.checkpc=PicoCheckPc; + PicoCpu.fetch8 =PicoCpu.read8 =PicoRead8; + PicoCpu.fetch16=PicoCpu.read16=PicoRead16; + PicoCpu.fetch32=PicoCpu.read32=PicoRead32; + PicoCpu.write8 =PicoWrite8; + PicoCpu.write16=PicoWrite16; + PicoCpu.write32=PicoWrite32; +#endif + return 0; +} + +#ifdef EMU_A68K +struct A68KInter +{ + u32 unknown; + u8 (__fastcall *Read8) (u32 a); + u16 (__fastcall *Read16)(u32 a); + u32 (__fastcall *Read32)(u32 a); + void (__fastcall *Write8) (u32 a,u8 d); + void (__fastcall *Write16) (u32 a,u16 d); + void (__fastcall *Write32) (u32 a,u32 d); + void (__fastcall *ChangePc)(u32 a); + u8 (__fastcall *PcRel8) (u32 a); + u16 (__fastcall *PcRel16)(u32 a); + u32 (__fastcall *PcRel32)(u32 a); + u16 (__fastcall *Dir16)(u32 a); + u32 (__fastcall *Dir32)(u32 a); +}; + +extern "C" struct A68KInter a68k_memory_intf= +{ + 0, + PicoRead8, + PicoRead16, + PicoRead32, + PicoWrite8, + PicoWrite16, + PicoWrite32, + PicoCheckPc, + PicoRead8, + PicoRead16, + PicoRead32, + PicoRead16, // unused + PicoRead32, // unused +}; +#endif diff --git a/Pico/Pico.cpp b/Pico/Pico.cpp new file mode 100644 index 0000000..7acc937 --- /dev/null +++ b/Pico/Pico.cpp @@ -0,0 +1,215 @@ + +#include "PicoInt.h" + +int PicoVer=0x0030; +struct Pico Pico; +int PicoOpt=0; + +int PicoPad[2]; // Joypads, format is SACB RLDU + +int PicoInit() +{ + // Blank space for state: + memset(&Pico,0,sizeof(Pico)); + memset(&PicoPad,0,sizeof(PicoPad)); + Pico.m.dirtyPal=1; + + // Init CPU: + SekInit(); + + // Setup memory callbacks: + PicoMemInit(); + PsndReset(); + +#ifdef MSOUND + YM2612Init(1,7670443,PsndRate,NULL,NULL); +#endif + return 0; +} + +void PicoExit() +{ +#ifdef MSOUND + YM2612Shutdown(); +#endif + + memset(&Pico,0,sizeof(Pico)); +} + +int PicoReset() +{ + unsigned int region=0; + int support=0,hw=0,i=0; + unsigned char pal=0; + + if (Pico.romsize<=0) return 1; + + SekReset(); + PsndReset(); +#ifdef MSOUND + YM2612ResetChip(0); +#endif + + // Read cartridge region data: + region=PicoRead32(0x1f0); + + for (i=0;i<4;i++) + { + int c=0; + + c=region>>(i<<3); c&=0xff; + if (c<=' ') continue; + + if (c=='J') support|=1; + else if (c=='U') support|=4; + else if (c=='E') support|=8; + else + { + // New style code: + char s[2]={0,0}; + s[0]=(char)c; + support|=strtol(s,NULL,16); + } + + } + + // Try to pick the best hardware value for English/60hz: + if (support&4) hw=0x80; // USA + else if (support&8) { hw=0xc0; pal=1; } // Europe + else if (support&1) hw=0x00; // Japan NTSC + else if (support&2) { hw=0x40; pal=1; } // Japan PAL + else hw=0x80; // USA + + Pico.m.hardware=(unsigned char)(hw|0x20); // No disk attached + Pico.m.pal=pal; + + return 0; +} + +static int CheckIdle() +{ + unsigned char state[0x88]; + + memset(state,0,sizeof(state)); + + // See if the state is the same after 2 steps: + SekState(state); SekRun(0); SekRun(0); SekState(state+0x44); + if (memcmp(state,state+0x44,0x44)==0) return 1; + + return 0; +} + +// Accurate but slower frame which does hints +static int PicoFrameHints() +{ + struct PicoVideo *pv=&Pico.video; + int total=0,aim=0; + int y=0; + int hint=0x400; // Hint counter + + pv->status|=0x08; // Go into vblank + + for (y=-38;y<224;y++) + { + if (y==0) + { + hint=pv->reg[10]; // Load H-Int counter + if (pv->reg[1]&0x40) pv->status&=~8; // Come out of vblank if display enabled + } + + // H-Interrupts: + if (hint<0) + { + hint=pv->reg[10]; // Reload H-Int counter + if (pv->reg[0]&0x10) SekInterrupt(4); + } + + // V-Interrupt: + if (y==-37) + { + pv->status|=0x80; // V-Int happened + if (pv->reg[1]&0x20) SekInterrupt(6); + } + + Pico.m.scanline=(short)y; + + // Run scanline: + aim+=489; total+=SekRun(aim-total); + + hint--; + + if (PicoScan && y>=0) PicoLine(y); + } + + SekInterrupt(0); // Cancel interrupt + + return 0; +} + +// Simple frame without H-Ints +static int PicoFrameSimple() +{ + int total=0,y=0,aim=0; + + Pico.m.scanline=-64; + + // V-Blanking period: + if (Pico.video.reg[1]&0x20) SekInterrupt(6); // Set IRQ + Pico.video.status|=0x88; // V-Int happened / go into vblank + total+=SekRun(18560); + + // Active Scan: + if (Pico.video.reg[1]&0x40) Pico.video.status&=~8; // Come out of vblank if display is enabled + SekInterrupt(0); // Clear IRQ + + // Run in sections: + for (aim=18560+6839; aim<=18560+6839*16; aim+=6839) + { + int add=0; + if (CheckIdle()) break; + add=SekRun(aim-total); + total+=add; + } + + if (PicoMask&0x100) + if (PicoScan) + { + // Draw the screen + for (y=0;y<224;y++) PicoLine(y); + } + + return 0; +} + +int PicoFrame() +{ + int hints=0; + + if (Pico.rom==NULL) return 1; // No Rom plugged in + + + PmovUpdate(); + + hints=Pico.video.reg[0]&0x10; + + if (hints) PicoFrameHints(); + else PicoFrameSimple(); + + PsndRender(); + + return 0; +} + +static int DefaultCram(int cram) +{ + int high=0x0841; + // Convert 0000bbbb ggggrrrr + // to rrrr1ggg g10bbbb1 + high|=(cram&0x00f)<<12; // Red + high|=(cram&0x0f0)<< 3; // Green + high|=(cram&0xf00)>> 7; // Blue + return high; +} + +// Function to convert Megadrive Cram into a native colour: +int (*PicoCram)(int cram)=DefaultCram; diff --git a/Pico/Pico.dsp b/Pico/Pico.dsp new file mode 100644 index 0000000..ca0635c --- /dev/null +++ b/Pico/Pico.dsp @@ -0,0 +1,172 @@ +# Microsoft Developer Studio Project File - Name="Pico" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=Pico - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Pico.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Pico.mak" CFG="Pico - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Pico - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "Pico - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Pico - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "Pico - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "Pico - Win32 Release" +# Name "Pico - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Area.cpp +# End Source File +# Begin Source File + +SOURCE=.\Cart.cpp +# End Source File +# Begin Source File + +SOURCE=.\Draw.cpp +# End Source File +# Begin Source File + +SOURCE=.\driver.h +# End Source File +# Begin Source File + +SOURCE=.\Memory.cpp +# End Source File +# Begin Source File + +SOURCE=.\Pico.cpp +# End Source File +# Begin Source File + +SOURCE=.\Psnd.cpp +# End Source File +# Begin Source File + +SOURCE=.\Sek.cpp +# End Source File +# Begin Source File + +SOURCE=.\Sine.cpp +# End Source File +# Begin Source File + +SOURCE=.\Utils.cpp +# End Source File +# Begin Source File + +SOURCE=.\VideoPort.cpp +# End Source File +# Begin Source File + +SOURCE=.\ym2612.c +# End Source File +# Begin Source File + +SOURCE=.\a68k.obj +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Pico.h +# End Source File +# Begin Source File + +SOURCE=.\PicoInt.h +# End Source File +# End Group +# Begin Group "Disassembler" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Disa.c +# End Source File +# Begin Source File + +SOURCE=.\Disa.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\bits.txt +# End Source File +# Begin Source File + +SOURCE=..\GenaDrive\zout.txt +# End Source File +# End Target +# End Project diff --git a/Pico/Pico.dsw b/Pico/Pico.dsw new file mode 100644 index 0000000..6e5c845 --- /dev/null +++ b/Pico/Pico.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Pico"=.\Pico.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Pico/Pico.h b/Pico/Pico.h new file mode 100644 index 0000000..f7214bb --- /dev/null +++ b/Pico/Pico.h @@ -0,0 +1,61 @@ + +// -------------------- Pico Library -------------------- + +// Pico Megadrive Emulator Library - Header File + +// This code is licensed under the GNU General Public License version 2.0 and the MAME License. +// You can choose the license that has the most advantages for you. + +// SVN repository can be found at http://code.google.com/p/cyclone68000/ + + +#ifdef __cplusplus +extern "C" { +#endif + +// Pico.cpp +extern int PicoVer; +extern int PicoOpt; +int PicoInit(); +void PicoExit(); +int PicoReset(); +int PicoFrame(); +extern int PicoPad[2]; // Joypads, format is SACB RLDU +extern int (*PicoCram)(int cram); // Callback to convert colour ram 0000bbb0 ggg0rrr0 + +// Area.cpp +struct PicoArea { void *data; int len; char *name; }; +extern int (*PicoAcb)(struct PicoArea *); // Area callback for each block of memory +extern FILE *PmovFile; +extern int PmovAction; +// &1=for reading &2=for writing &4=volatile &8=non-volatile +int PicoAreaScan(int action,int *pmin); +// Save or load the state from PmovFile: +int PmovState(); +int PmovUpdate(); + +// Cart.cpp +int PicoCartLoad(FILE *f,unsigned char **prom,unsigned int *psize); +int PicoCartInsert(unsigned char *rom,unsigned int romsize); + +// Draw.cpp +extern int (*PicoScan)(unsigned int num,unsigned short *data); +extern int PicoMask; // Mask of which layers to draw + +// Sek.cpp +extern char PicoStatus[]; + +// Sound.cpp +extern int PsndRate,PsndLen; +extern short *PsndOut; +extern unsigned char PicoSreg[]; + +// Utils.cpp +extern int PicuAnd; +int PicuQuick(unsigned short *dest,unsigned short *src); +int PicuShrink(unsigned short *dest,int destLen,unsigned short *src,int srcLen); +int PicuMerge(unsigned short *dest,int destLen,unsigned short *src,int srcLen); + +#ifdef __cplusplus +} // End of extern "C" +#endif diff --git a/Pico/Pico.vcp b/Pico/Pico.vcp new file mode 100644 index 0000000..d6c1ce4 --- /dev/null +++ b/Pico/Pico.vcp @@ -0,0 +1,1074 @@ +# Microsoft eMbedded Visual Tools Project File - Name="Pico" - Package Owner=<4> +# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304 +# TARGTYPE "Win32 (WCE x86em) Static Library" 0x7f04 +# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504 + +CFG=Pico - Win32 (WCE ARM) Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Pico.vcn". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Pico.vcn" CFG="Pico - Win32 (WCE ARM) Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Pico - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library") +!MESSAGE "Pico - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library") +!MESSAGE "Pico - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library") +!MESSAGE "Pico - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library") +!MESSAGE "Pico - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Static Library") +!MESSAGE "Pico - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +# PROP ATL_Project 2 + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ARMRel" +# PROP BASE Intermediate_Dir "ARMRel" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ARMRel" +# PROP Intermediate_Dir "ARMRel" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W4 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "ARMDbg" +# PROP BASE Intermediate_Dir "ARMDbg" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ARMDbg" +# PROP Intermediate_Dir "ARMDbg" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W4 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "X86Rel" +# PROP BASE Intermediate_Dir "X86Rel" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "X86Rel" +# PROP Intermediate_Dir "X86Rel" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /Oxs /c +# ADD CPP /nologo /W4 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /Oxs /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "X86Dbg" +# PROP BASE Intermediate_Dir "X86Dbg" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "X86Dbg" +# PROP Intermediate_Dir "X86Dbg" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +# ADD CPP /nologo /W4 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "X86EMRel" +# PROP BASE Intermediate_Dir "X86EMRel" +# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "X86EMRel" +# PROP Intermediate_Dir "X86EMRel" +# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Oxs /Gz /c +# ADD CPP /nologo /W4 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Oxs /Gz /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "X86EMDbg" +# PROP BASE Intermediate_Dir "X86EMDbg" +# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "X86EMDbg" +# PROP Intermediate_Dir "X86EMDbg" +# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gz /c +# ADD CPP /nologo /W4 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gz /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ENDIF + +# Begin Target + +# Name "Pico - Win32 (WCE ARM) Release" +# Name "Pico - Win32 (WCE ARM) Debug" +# Name "Pico - Win32 (WCE x86) Release" +# Name "Pico - Win32 (WCE x86) Debug" +# Name "Pico - Win32 (WCE x86em) Release" +# Name "Pico - Win32 (WCE x86em) Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Area.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_AREA_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_AREA_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_AREA_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_AREA_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_AREA_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_AREA_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Cart.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_CART_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_CART_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_CART_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_CART_=\ + "..\Cyclone\Cyclone.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + +NODEP_CPP_CART_=\ + "..\Cyclone\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_CART_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_CART_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Draw.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_DRAW_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_DRAW_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_DRAW_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_DRAW_=\ + "..\Cyclone\Cyclone.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + +NODEP_CPP_DRAW_=\ + "..\Cyclone\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_DRAW_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_DRAW_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Memory.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_MEMOR=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_MEMOR=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_MEMOR=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_MEMOR=\ + "..\Cyclone\Cyclone.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + +NODEP_CPP_MEMOR=\ + "..\Cyclone\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_MEMOR=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_MEMOR=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Pico.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_PICO_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_PICO_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_PICO_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_PICO_=\ + "..\Cyclone\Cyclone.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_PICO_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_PICO_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Profile.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_PROFI=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_PROFI=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_PROFI=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_PROFI=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_PROFI=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_PROFI=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Psnd.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_PSND_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_PSND_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_PSND_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_PSND_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_PSND_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_PSND_=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Sek.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_SEK_C=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_SEK_C=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_SEK_C=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_SEK_C=\ + "..\Cyclone\Cyclone.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + +NODEP_CPP_SEK_C=\ + "..\Cyclone\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_SEK_C=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_SEK_C=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Sine.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Utils.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_UTILS=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_UTILS=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_UTILS=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_UTILS=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_UTILS=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_UTILS=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\VideoPort.cpp + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_VIDEO=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_VIDEO=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_VIDEO=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_VIDEO=\ + "..\Cyclone\Cyclone.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + +NODEP_CPP_VIDEO=\ + "..\Cyclone\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_VIDEO=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_VIDEO=\ + "..\Cyclone\Cyclone.h"\ + ".\Disa.h"\ + ".\Pico.h"\ + ".\PicoInt.h"\ + ".\ym2612.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\ym2612.c + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_YM261=\ + ".\driver.h"\ + ".\ym2612.h"\ + +NODEP_CPP_YM261=\ + ".\deftypes.h"\ + ".\support.h"\ + +# ADD CPP /W3 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_YM261=\ + ".\driver.h"\ + ".\ym2612.h"\ + +NODEP_CPP_YM261=\ + ".\deftypes.h"\ + ".\support.h"\ + +# ADD CPP /W3 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_YM261=\ + ".\driver.h"\ + ".\ym2612.h"\ + +NODEP_CPP_YM261=\ + ".\deftypes.h"\ + ".\support.h"\ + +# ADD CPP /W3 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_YM261=\ + ".\driver.h"\ + ".\ym2612.h"\ + +NODEP_CPP_YM261=\ + ".\deftypes.h"\ + ".\support.h"\ + +# ADD CPP /W3 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_YM261=\ + ".\driver.h"\ + ".\ym2612.h"\ + +NODEP_CPP_YM261=\ + ".\deftypes.h"\ + ".\support.h"\ + +# ADD CPP /W3 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_YM261=\ + ".\driver.h"\ + ".\ym2612.h"\ + +NODEP_CPP_YM261=\ + ".\deftypes.h"\ + ".\support.h"\ + +# ADD CPP /W3 + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Pico.h +# End Source File +# Begin Source File + +SOURCE=.\PicoInt.h +# End Source File +# End Group +# Begin Group "Cyclone" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\Cyclone\Cyclone.h +# End Source File +# Begin Source File + +SOURCE=..\Cyclone\Cyclone.obj + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# End Group +# Begin Group "Dasm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Disa.c + +!IF "$(CFG)" == "Pico - Win32 (WCE ARM) Release" + +DEP_CPP_DISA_=\ + ".\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE ARM) Debug" + +DEP_CPP_DISA_=\ + ".\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Release" + +DEP_CPP_DISA_=\ + ".\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86) Debug" + +DEP_CPP_DISA_=\ + ".\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Release" + +DEP_CPP_DISA_=\ + ".\Disa.h"\ + + +!ELSEIF "$(CFG)" == "Pico - Win32 (WCE x86em) Debug" + +DEP_CPP_DISA_=\ + ".\Disa.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Disa.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\bits.txt +# End Source File +# Begin Source File + +SOURCE=..\PicoDrive\PicoDrive.txt +# End Source File +# End Target +# End Project diff --git a/Pico/Pico.vcw b/Pico/Pico.vcw new file mode 100644 index 0000000..55f6997 --- /dev/null +++ b/Pico/Pico.vcw @@ -0,0 +1,29 @@ +Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Pico"=.\Pico.vcp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Pico/PicoInt.h b/Pico/PicoInt.h new file mode 100644 index 0000000..a27e73a --- /dev/null +++ b/Pico/PicoInt.h @@ -0,0 +1,132 @@ + +#include +#include +#include +#include "Pico.h" + +#if defined(__GNUC__) || defined(_WIN32_WCE) +#define EMU_C68K // Use the Cyclone 68000 emulator +#else +#define EMU_A68K // Use the 'A68K' (Make68K) Assembler 68000 emulator +#endif + +//#define MSOUND + +// Disa.h also defines CPU_CALL to be fastcall or normal call +#include "Disa.h" + + +// ----------------------- 68000 CPU ----------------------- +#ifdef EMU_A68K +// The format of the data in a68k.asm (at the _M68000_regs location) +struct A68KContext +{ + unsigned int d[8],a[8]; + unsigned int isp,srh,ccr,xc,pc,irq,sr; + int (*IrqCallback) (int nIrq); + unsigned int ppc; + void *pResetCallback; + unsigned int sfc,dfc,usp,vbr; + unsigned int AsmBank,CpuVersion; +}; +extern "C" struct A68KContext M68000_regs; +#endif + +#ifdef EMU_C68K +#include "../Cyclone/Cyclone.h" +extern struct Cyclone PicoCpu; +#endif + +#ifdef MSOUND +extern "C" { +#include "ym2612.h" +} +#endif + +// --------------------------------------------------------- + +struct PicoVideo +{ + unsigned char reg[0x20]; + unsigned int command; // 32-bit Command + unsigned char pending; // 1 if waiting for second half of 32-bit command + unsigned char type; // Command type (v/c/vsram read/write) + unsigned short addr; // Read/Write address + int status; // Status bits + unsigned char pad[0x14]; +}; + +struct PicoMisc +{ + unsigned char rotate; + unsigned char z80Run; + unsigned char padSelect[2]; // Select high or low bit from joypad + short scanline; // -38 to 223 + char dirtyPal; // Is the palette dirty + unsigned char hardware; // Hardware value for country + unsigned char pal; // 1=PAL 0=NTSC + unsigned char pad[0x16]; +}; + +struct PicoSound +{ + unsigned char fmsel[2]; // FM selected register + unsigned char reg[0x100]; + unsigned char pad[0x3e]; +}; + +struct Pico +{ + unsigned char ram[0x10000]; // scratch ram + unsigned short vram[0x8000]; + unsigned char zram[0x2000]; // Z80 ram + unsigned int highpal[0x40]; + unsigned short cram[0x40]; + unsigned short vsram[0x40]; + + unsigned char *rom; + unsigned int romsize; + + struct PicoMisc m; + struct PicoVideo video; + struct PicoSound s; +}; + +// Draw.cpp +int PicoLine(int scan); + +// Draw2.cpp +int PicoDraw2(); + +// Memory.cpp +int PicoInitPc(unsigned int pc); +unsigned short CPU_CALL PicoRead16(unsigned int a); +unsigned int CPU_CALL PicoRead32(unsigned int a); +int PicoMemInit(); +void PicoDasm(int start,int len); + +// Pico.cpp +extern struct Pico Pico; + +// Sek.cpp +int SekInit(); +int SekReset(); +int SekRun(int cyc); +int SekInterrupt(int irq); +int SekPc(); +void SekState(unsigned char *data); + +// Sine.cpp +extern short Sine[]; + +// Psnd.cpp +int PsndReset(); +int PsndFm(int a,int d); +int PsndRender(); + +// VideoPort.cpp +void PicoVideoWrite(unsigned int a,unsigned int d); +unsigned int PicoVideoRead(unsigned int a); + +// External: +extern "C" int dprintf(char *Format, ...); diff --git a/Pico/Profile.cpp b/Pico/Profile.cpp new file mode 100644 index 0000000..a1fba7f --- /dev/null +++ b/Pico/Profile.cpp @@ -0,0 +1,50 @@ + +#include "PicoInt.h" + +#ifdef _WIN32_WCE + +#pragma warning(disable:4514) +#pragma warning(push) +#pragma warning(disable:4201) +#include +#pragma warning(pop) + +static float Period=0.0f; +static LARGE_INTEGER TimeStart={0,0}; + +int ProfileInit() +{ + LARGE_INTEGER freq={0,0}; + + QueryPerformanceFrequency(&freq); + + Period =(float)freq.HighPart*4294967296.0f; + Period+=(float)freq.LowPart; + + if (Period>=1.0f) Period=1.0f/Period; + return 0; +} + +int ProfileStart() +{ + QueryPerformanceCounter(&TimeStart); + + return 0; +} + +float ProfileTime() +{ + LARGE_INTEGER end={0,0}; + int ticks=0; + float seconds=0.0f; + + QueryPerformanceCounter(&end); + + ticks=end.LowPart-TimeStart.LowPart; + seconds=(float)ticks*Period; + + return seconds; +} + +#endif + diff --git a/Pico/Psnd.cpp b/Pico/Psnd.cpp new file mode 100644 index 0000000..235f7da --- /dev/null +++ b/Pico/Psnd.cpp @@ -0,0 +1,245 @@ + +#include "PicoInt.h" + +#ifdef MSOUND +extern "C" +{ +int YM2612UpdateReq(int) { return 0; } +void *errorlog=NULL; +} +#endif + +int PsndRate=0,PsndLen=0; +short *PsndOut=NULL; + +// An operator is a single sine wave generator +struct Operator +{ + unsigned short angle; // 0-0xffff + unsigned short freq; // Converted frequency + unsigned char key; + unsigned char state; // 1=attack, 2=decay, 3=sustain, 4=release + int vol; + int delta; // Change in volume per sample + int limit; // Next volume limit +}; + +struct Channel +{ + struct Operator op[4]; // 4 operators for the channel + unsigned short note; // Written to 0xa4 and 0xa0 +}; + +static struct Channel Chan[8]; + +unsigned char PicoSreg[0x200]; + +static int WriteReg(int side,int a,int d) +{ + struct Channel *pc=NULL; + + PicoSreg[(side<<8)|a]=(unsigned char)d; + + if (a==0x28) + { + pc=Chan+(d&7); + // Key On/Key Off + if (d&0xf0) pc->op[0].state=1; // Attack + else pc->op[0].state=4; // Release + + return 0; + } + + // Find channel: + pc=Chan+(a&3); if (side) pc+=4; + + if ((a&0xf0)==0xa0) + { + int n=0,f=0,mult=2455; + + if (PsndRate>0) mult=44100*2455/PsndRate; + + if (a&4) pc->note =(unsigned short)(d<<8); + else pc->note|=d; + + // Convert to an actual frequency: + n=pc->note; f=(n&0x7ff)<<((n>>11)&7); + + pc->op[0].freq=(unsigned short)((f*mult)>>16); + return 0; + } + + return 0; +} + +int PsndReset() +{ + int i=0; + memset(&Chan,0,sizeof(Chan)); + memset(PicoSreg,0,sizeof(PicoSreg)); + +// Change Sine wave into a square wave + for (i=0x00; i<0x080; i++) Sine[i]= 0x2000; + for (i=0x80; i<0x100; i++) Sine[i]=-0x2000; + + return 0; +} + +int PsndFm(int a,int d) +{ + int side=0; + +#ifdef MSOUND + YM2612Write(0,a&3,(unsigned char)d); +#endif + + a&=3; side=a>>1; // Which side: channels 0-2 or 3-5 + + if (a&1) WriteReg(side,Pico.s.fmsel[side],d); // Write register + else Pico.s.fmsel[side]=(unsigned char)d; // Select register + + return 0; +} + +static void BlankSound(short *dest,int len) +{ + short *end=NULL; + + end=dest+(len<<1); + + // Init sound to silence: + do { *dest=0; dest++; } while (dest0) total=0x7fff; else total=-0x8000; + } + *targ=(short)total; +} + +static void OpNewState(int c) +{ + struct Operator *op=Chan[c].op; + int off=0; + + off=((c&4)<<6)|(c&3); + + switch (op->state) + { + case 1: + { + // Attack: + int ar=PicoSreg[0x50|off]; + ar&=0x1f; if (ar) ar+=0x10; + op->delta=ar<<7; op->limit=0x1000000; break; + } + case 2: + { + // Decay: + int d1r=PicoSreg[0x60|off]; + d1r&=0x1f; if (d1r) d1r+=0x10; + op->delta=-(d1r<<5); op->limit=0; + } + break; + case 3: + { + // Sustain: + int d2r=0,rr=0; + + d2r=PicoSreg[0x70|off]; + d2r&=0x1f; if (d2r) d2r+=0x10; + rr =PicoSreg[0x80|off]; + rr>>=4; + + op->delta=-(d2r<<5); op->limit=rr<<20; + } + break; + case 4: + // Release: + int rr=PicoSreg[0x80|off]; + rr&=0x0f; rr<<=1; rr+=0x10; + op->delta=-(rr<<5); op->limit=0; + break; + } +} + +// Merely adding this code in seems to bugger up the N-Gage??? +static void UpdateOp(int c) +{ + struct Operator *op=Chan[c].op; + + op->angle=(unsigned short)(op->angle+op->freq); + op->vol+=op->delta; + + switch (op->state) + { + case 1: + if (op->vol>=op->limit) { op->vol=op->limit; op->state++; OpNewState(c); } + break; + case 2: case 3: // Decay/Sustain + if (op->vol< op->limit) { op->vol=op->limit; op->state++; OpNewState(c); } + break; + case 4: + if (op->vol< op->limit) { op->vol=op->limit; } + break; + } +} + +static void AddChannel(int c,short *dest,int len) +{ + struct Channel *pc=Chan+c; + struct Operator *op=pc->op; + short *end=NULL; + + // Work out volume delta for this operator: + OpNewState(c); + + end=dest+len; + do + { + int d=0; + d=Sine[(op->angle>>8)&0xff]>>2; + + d*=(op->vol>>8); d>>=16; + + // Add to output: + AddClip(dest,d); + UpdateOp(c); + + dest++; + } + while (dest>=1; bias+=destLen; } + *dest++=(unsigned short)pa; + + pa=*src++; bias-=sub; + if (bias<0) { pa+=*src++; pa>>=1; bias+=destLen; } + *dest++=(unsigned short)pa; + } + while (dest>=1; bias+=destLen; } + pa&=mask; pa+=(*dest)&mask; pa>>=1; + *dest++=(unsigned short)pa; + + pa=*src++; bias-=sub; + if (bias<0) { pa+=*src++; pa>>=1; bias+=destLen; } + pa&=mask; pa+=(*dest)&mask; pa>>=1; + *dest++=(unsigned short)pa; + } + while (dest>8); // If address is odd, bytes are swapped + a>>=1; + + switch (Pico.video.type) + { + case 1: Pico.vram [a&0x7fff]=sd; break; + case 3: Pico.cram [a&0x003f]=sd; Pico.m.dirtyPal=1; break; + case 5: Pico.vsram[a&0x003f]=sd; break; + } + + AutoIncrement(); +} + +static unsigned int VideoRead() +{ + unsigned int a=0,d=0; + + a=Pico.video.addr; a>>=1; + + switch (Pico.video.type) + { + case 0: d=Pico.vram [a&0x7fff]; break; + case 8: d=Pico.cram [a&0x003f]; break; + case 4: d=Pico.vsram[a&0x003f]; break; + } + + AutoIncrement(); + return d; +} + +static int GetDmaSource() +{ + struct PicoVideo *pvid=&Pico.video; + int source=0; + source =pvid->reg[0x15]<<1; + source|=pvid->reg[0x16]<<9; + source|=pvid->reg[0x17]<<17; + return source; +} + +static int GetDmaLength() +{ + struct PicoVideo *pvid=&Pico.video; + int len=0; + // 16-bit words to transfer: + len =pvid->reg[0x13]; + len|=pvid->reg[0x14]<<8; + return len; +} + +static void DmaSlow(int source,int len) +{ + int i=0,max=0; + + if (source>=0x800000 && source<0xe00000) return; // Invalid source address + + /// Clip Cram DMA size (Todds Adventures in Slime World): + if (Pico.video.type==3) { max=0x80-Pico.video.addr; if (len>max) len=max; } + + for (i=0;i>=1; // Length specifies number of bytes + + for (i=0;ireg[1]&0x10)==0) return; // DMA not enabled + + len=GetDmaLength(); + + method=pvid->reg[0x17]>>6; + source=GetDmaSource(); + if (method< 2) DmaSlow(source,len); // 68000 to VDP + if (method==3) DmaCopy(source,len); // VRAM Copy +} + +static void CommandChange() +{ + struct PicoVideo *pvid=&Pico.video; + unsigned int cmd=0,addr=0; + + cmd=pvid->command; + + // Get type of transfer 0xc0000030 (v/c/vsram read/write) + pvid->type=(unsigned char)(((cmd>>2)&0xc)|(cmd>>30)); + + // Get address 0x3fff0003 + addr =(cmd>>16)&0x3fff; + addr|=(cmd<<14)&0xc000; + pvid->addr=(unsigned short)addr; + + // Check for dma: + if (cmd&0x80) CommandDma(); +} + +void PicoVideoWrite(unsigned int a,unsigned int d) +{ + struct PicoVideo *pvid=&Pico.video; + + a&=0x1c; + d=(unsigned short)d; + + if (a==0x00) // Data port 0 or 2 + { + if (pvid->pending) CommandChange(); + pvid->pending=0; + + // If a DMA fill has been set up, do it + if ((pvid->command&0x80) && (pvid->reg[1]&0x10) && (pvid->reg[0x17]>>6)==2) + { + DmaFill(d); + } + else + { + VideoWrite(d); + } + return; + } + + if (a==0x04) // Command port 4 or 6 + { + if (pvid->pending) + { + // Low word of command: + pvid->command&=0xffff0000; + pvid->command|=d; + pvid->pending=0; + CommandChange(); + return; + } + + if ((d&0xc000)==0x8000) + { + // Register write: + int num=(d>>8)&0x1f; + pvid->reg[num]=(unsigned char)d; + return; + } + + // High word of command: + pvid->command&=0x0000ffff; + pvid->command|=d<<16; + pvid->pending=1; + } +} + +unsigned int PicoVideoRead(unsigned int a) +{ + unsigned int d=0; + + a&=0x1c; + + if (a==0x00) { d=VideoRead(); goto end; } + + if (a==0x04) + { + d=Pico.video.status; + + // Toggle fifo full empty: + if (Pico.m.rotate&4) d|=0x3520; else d|=0x3620; + if (Pico.m.rotate&2) d|=0x0004; // Toggle in/out of H-Blank + Pico.m.rotate++; + + if (Pico.m.pal) d|=1; // PAL screen + + goto end; + } + + if ((a&0x1c)==0x08) + { + if (Pico.m.scanline>-64) d=Pico.m.scanline; // HV-Counter + else d=Pico.m.rotate++; // Fudge + + d&=0xff; d<<=8; + goto end; + } + +end: + + return d; +} diff --git a/Pico/driver.h b/Pico/driver.h new file mode 100644 index 0000000..28889d4 --- /dev/null +++ b/Pico/driver.h @@ -0,0 +1,19 @@ +// Drive filler file for ym2612.c +#undef INLINE +#define INLINE __inline + +#define CLIB_DECL +#define INTERNAL_TIMER + +// Callbacks from fm.c +int YM2612UpdateReq(int nChip); +int AY8910_set_clock(int nChip,int nClock); +//int Log(int nType,char *szText,...); +extern void *errorlog; + +#ifndef __GNUC__ +#pragma warning (disable:4100) +#pragma warning (disable:4244) +#pragma warning (disable:4245) +#pragma warning (disable:4710) +#endif diff --git a/PicoDrive/Config.cpp b/PicoDrive/Config.cpp new file mode 100644 index 0000000..4ab2d57 --- /dev/null +++ b/PicoDrive/Config.cpp @@ -0,0 +1,86 @@ + +#include "stdafx.h" + +static char *ConfigName="\\PicoConfig.txt"; +struct Config Config; + +int ConfigInit() +{ + memset(&Config,0,sizeof(Config)); + + Config.key[0]=VK_UP; + Config.key[1]=VK_DOWN; + Config.key[2]=VK_LEFT; + Config.key[3]=VK_RIGHT; + Config.key[4]=GXKey.vkC; // A + Config.key[5]=GXKey.vkA; // B + Config.key[6]=GXKey.vkB; // C + Config.key[7]=GXKey.vkStart; + + return 0; +} + +int ConfigSave() +{ + FILE *f=NULL; + int i=0,max=0; + + // Open config file: + f=fopen(ConfigName,"wt"); if (f==NULL) return 1; + + fprintf(f,"// PicoDrive Config File\n\n"); + + fprintf(f,"// Keys: Up Down Left Right\n"); + fprintf(f,"// A B C Start\n\n"); + + max=sizeof(Config.key)/sizeof(Config.key[0]); + for (i=0;i=1000) break; + } + + // Use this filename + file=fopen(filename,"wb"); if (file==NULL) { GXEndDraw(); free(line); return 1; } + + head[0x02]=0x02; //? + head[0x0c]=(unsigned char) GXDisp.cxWidth; + head[0x0d]=(unsigned char)(GXDisp.cxWidth>>8); + head[0x0e]=(unsigned char) GXDisp.cyHeight; + head[0x0f]=(unsigned char)(GXDisp.cyHeight>>8); + head[0x10]=24; // Number of bits per pixel + + // Write header: + fwrite(head,1,sizeof(head),file); + + for (y=0;y<(int)GXDisp.cyHeight;y++) + { + unsigned char *ps=NULL,*pd=NULL; + int ry=0; + int pix=0; + + ry=GXDisp.cyHeight-y-1; + ps=screen+ry*GXDisp.cbyPitch; + pd=line; + + // Copy pixel to our line buffer + for (x=0;x<(int)GXDisp.cxWidth; x++,ps+=GXDisp.cbxPitch,pd+=3) + { + pix=*(unsigned short *)ps; + + pd[0]=(unsigned char)((pix&0x001f)<<3); // Red + pd[1]=(unsigned char)((pix&0x07e0)>>3); // Green + pd[2]=(unsigned char)((pix&0xf800)>>8); // Blue + } + + fwrite(line,1,GXDisp.cxWidth*3,file); + } + + fclose(file); file=NULL; + + GXEndDraw(); + free(line); + + return 0; +} diff --git a/PicoDrive/Emulate.cpp b/PicoDrive/Emulate.cpp new file mode 100644 index 0000000..341aa12 --- /dev/null +++ b/PicoDrive/Emulate.cpp @@ -0,0 +1,217 @@ + +#include "stdafx.h" + +TCHAR RomName[260]={0}; +static unsigned char *RomData=NULL; +static unsigned int RomSize=0; + +static unsigned int LastSecond=0; +static int FramesDone=0; +static int FramesPerSecond=60; + +struct Target Targ; + +static int TargetInit() +{ + RECT rect={0,0,0,0}; + int height=0; + + memset(&Targ,0,sizeof(Targ)); + + height=168; + + ClientToScreen(FrameWnd,&Targ.point); + + GetClientRect(FrameWnd,&rect); + // Find out where the top of the screen should go: + rect.top=(rect.bottom-height)>>1; + if (rect.top<0) rect.top=0; + rect.bottom=rect.top+height; + + Targ.view=rect; // Save the view rectangle (client coordinates) + + Targ.offset=Targ.view.top+Targ.point.y; + + return 0; +} + +static int TargetUpdate() +{ + // Need to repaint the view rectangle: + GetUpdateRect(FrameWnd,&Targ.update,0); + + Targ.top =Targ.update.top +Targ.point.y; + Targ.bottom=Targ.update.bottom+Targ.point.y; + + return 0; +} + +int EmulateInit() +{ + FILE *f=NULL; + + EmulateExit(); // Make sure exited + + TargetInit(); // Find out where to put the screen + + PicoInit(); + + // Load cartridge + f=_wfopen(RomName,L"rb"); if (f==NULL) return 1; + PicoCartLoad(f,&RomData,&RomSize); + fclose(f); + + PicoCartInsert(RomData,RomSize); + + LastSecond=GetTickCount(); FramesDone=0; + + return 0; +} + +void EmulateExit() +{ + // Remove cartridge + PicoCartInsert(NULL,0); + if (RomData) free(RomData); RomData=NULL; RomSize=0; + + PicoExit(); +} + +// Callback for scanline data: +static int EmulateScan(unsigned int scan,unsigned short *sdata) +{ + int len=0; + unsigned short *ps=NULL,*end=NULL; + unsigned char *pd=NULL; + int xpitch=0; + + if ((scan&3)==1) return 0; + scan+=scan<<1; scan>>=2; // Reduce size to 75% + + scan+=Targ.offset; + if ((int)scan< Targ.top) return 0; // Out of range + if ((int)scan>=Targ.bottom) return 0; // Out of range + + pd=Targ.screen+scan*GXDisp.cbyPitch; + + len=240; + xpitch=GXDisp.cbxPitch; + ps=sdata; end=ps+320; + + // Reduce 4 pixels into 3 + do + { + *(unsigned short *)pd=ps[0]; pd+=xpitch; + *(unsigned short *)pd=(unsigned short)((ps[1]+ps[2])>>1); pd+=xpitch; + *(unsigned short *)pd=ps[3]; pd+=xpitch; + ps+=4; + } + while (ps0) + { + // Carry over any >60 frame count to one second + while (FramesDone>=FramesPerSecond) { FramesDone-=FramesPerSecond; LastSecond+=1000; } + } + + if (need<=0) { Sleep(2); return 1; } + if (need>4) need=4; // Limit frame skipping + + for (i=0;i>1; + ofn.lpstrDefExt=L"mds"; + ofn.lpstrFilter=L"MD State Files\0*.mds\0\0"; + + if (load) GetOpenFileNameW(&ofn); + else GetSaveFileNameW(&ofn); + UpdateWindow(FrameWnd); + + if (name[0]==0) return 1; + + if (PmovFile) fclose(PmovFile); + + PmovFile=_wfopen(name,load ? L"rb":L"wb"); + if (PmovFile==NULL) return 1; + + PmovAction=load?6:5; + PmovState(); // Save the state + + return 0; +} diff --git a/PicoDrive/FrameWindow.cpp b/PicoDrive/FrameWindow.cpp new file mode 100644 index 0000000..a778c87 --- /dev/null +++ b/PicoDrive/FrameWindow.cpp @@ -0,0 +1,92 @@ + +#include "stdafx.h" + +HWND FrameWnd=NULL; +struct GXDisplayProperties GXDisp; +struct GXKeyList GXKey; + +// Window procedure for frame window +static LRESULT CALLBACK FrameProc(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) +{ + switch (Msg) + { + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: case IDCANCEL: SendMessage(hWnd,WM_CLOSE,0,0); break; + + case ID_LOADROM: FileLoadRom(); break; + case ID_OPTIONS_GRAB: DebugScreenGrab(); break; + case ID_OPTIONS_SAVE: FileState(0); break; + case ID_OPTIONS_LOAD: FileState(1); break; + } + return 0; + + case WM_KILLFOCUS: GXSuspend(); return 0; + case WM_SETFOCUS: GXResume(); return 0; + + case WM_CLOSE: PostQuitMessage(0); return 0; + + case WM_DESTROY: + GXCloseInput(); + GXCloseDisplay(); + FrameWnd=NULL; // Blank window handle + return 0; + } + + return DefWindowProc(hWnd,Msg,wParam,lParam); +} + +static int GxInit() +{ + GXOpenDisplay(FrameWnd,GX_FULLSCREEN); + GXOpenInput(); + GXDisp=GXGetDisplayProperties(); + GXKey=GXGetDefaultKeys(GX_NORMALKEYS); + + // The real layout of the 3800: + if (Main3800) { GXDisp.cbxPitch=-640; GXDisp.cbyPitch=2; } + + return 0; +} + +int FrameInit() +{ + WNDCLASS wc; + SHMENUBARINFO mbi; + TCHAR title[128]={0}; + RECT rect={0,0,0,0}; + + memset(&wc,0,sizeof(wc)); + memset(&mbi,0,sizeof(mbi)); + + // Register the Frame window class + wc.lpfnWndProc=FrameProc; + wc.hInstance=GetModuleHandle(NULL); + wc.lpszClassName=APP_TITLE; + wc.hbrBackground=(HBRUSH)CreateSolidBrush(0x404040); + RegisterClass(&wc); + + FrameWnd=CreateWindowEx(WS_EX_CAPTIONOKBTN,APP_TITLE,APP_TITLE,WS_VISIBLE, + CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT, + NULL,NULL,wc.hInstance,NULL); + + wsprintf(title,APP_TITLE L" v%x.%.3x",PicoVer>>12,PicoVer&0xfff); + SetWindowText(FrameWnd,title); + + // Show SIP + mbi.cbSize=sizeof(mbi); + mbi.hwndParent=FrameWnd; + mbi.nToolBarId=IDR_MENUBAR1; + mbi.hInstRes=wc.hInstance; + SHCreateMenuBar(&mbi); + + // Resize Frame to avoid the SIP + GetWindowRect(FrameWnd,&rect); + MoveWindow(FrameWnd, rect.left,rect.top, rect.right-rect.left,rect.bottom-rect.top-26, 1); + + GxInit(); + + FileLoadRom(); + return 0; +} diff --git a/PicoDrive/PicoDrive.txt b/PicoDrive/PicoDrive.txt new file mode 100644 index 0000000..1838ab2 --- /dev/null +++ b/PicoDrive/PicoDrive.txt @@ -0,0 +1,189 @@ + +---------------------------------------------------------------------------- + + PicoDrive + + Megadrive emulator for Pocket PC + +This code is licensed under the GNU General Public License version 2.0 and the MAME License. +You can choose the license that has the most advantages for you. + +---------------------------------------------------------------------------- + + What's new? + +0.030 + Cyclone v0.076, fixes: + + Fixed an issue with sbcd - e.g. when 0x00-0x01 was performed, the result was correct (0x99), + but the carry bit was not set. Also changed abcd code to be more similar to new sbcd. + Used on RT2. + + Fixed a subtle issue in btst #n,(An), if the target is less that 32-bit, the value is + now masked. + Rolling Thunder 2 did this, but it doesn't seem to have fixed/broken anything. + + Oops #2! Cmpa was writing back the value to the destination register! Fixes: don't know. + + Oops #3! The CCR should be writable from any mode, previously it was only allowed from the + supervisor mode. Fixes Gain Ground. + + Added cmpm (Flicky, Decap Attack) + + For movem, added some EA modes (like 0x3a PC relative) which I thought were invalid, but + Flicky uses movem to PC relative... + + Oops, incorrect eor opcodes were being emitted instead of cmpm opcodes + * Trying a different way of doing addx/subx with carry (to fix zero flag?) + +0.025 + + Doh, fixed a dumb divide by zero in the (w.i.p.) sound code - Sonic 1, Revenge of Shinobi + work again! + +0.024 + Cyclone v0.072: + + Fixed a problem with divs - remainder should be negative when result is negative + Fixed intro of Block Out. + + + Fixed a typo in SekInterrupt + + + Added a config file PicoConfig.txt with key codes, in the root directory + of the Pocket PC. If you want you can edit this to remap keys. I'll add + an easier way to redefine keys later. + - Revenge of Shinobi strangely seems broken? + +0.022 + Cyclone changes: + + Added movep opcode (Sonic 3 works) + + Fixed a problem with DBcc not decrementing if the condition is false (Shadow of the Beast) + +0.018 + Cyclone changes: + + Added SBCD and the flags for ABCD/SBCD. Score and time now works in games such as + Rolling Thunder 2, Ghouls 'N Ghosts + + Fixed a problem with addx and subx with 8-bit and 16-bit values. + Ghouls 'N' Ghosts now works! + + Alien 3 now works + + Added ABCD opcode (Streets of Rage works now!) + +0.017 Added Window (score display) + +0.016 + + Added some Z80 faking which makes a few more games run + + Sped up graphics rendering a bit + + Fixed Sprite priority + +Cyclone Fixes + + Added dbCC (After Burner) + + Added asr EA (Sonic 1 Boss/Labyrinth Zone) + + Added andi/ori/eori ccr (Altered Beast) + + Added trap (After Burner) + + Added special case for move.b (a7)+ and -(a7), stepping by 2 + After Burner is playable! Eternal Champions shows more + + Fixed lsr.b/w zero flag (Ghostbusters) + Rolling Thunder 2 first level only now works + + Fixed N flag for .b and .w arithmetic. Golden Axe works! + + +v0.011 +Changes are to the Cyclone core, repeated here: +---- +v0.0065 + + Fixed a problem with immediate values - they weren't being shifted up correctly for some + opcodes. Spiderman works, After Burner shows a bit of graphics. + + Fixed a problem with EA:"110nnn" extension word. 32-bit offsets were being decoded as 8-bit + offsets by mistake. Castlevania Bloodlines seems fine now. + + Added exg opcode + + Fixed asr opcode (Sonic jumping left is fixed) + + Fixed a problem with the carry bit in rol.b (Marble Madness) + +v0.0064 + + Added rtr + + Fixed addq/subq.l (all An opcodes are 32-bit) (Road Rash) + + Fixed various little timings + +v0.0063 + + Added link/unlk opcodes + + Fixed various little timings + + Fixed a problem with dbCC opcode being emitted at set opcodes + + Improved long register access, the EA fetch now does ldr r0,[r7,r0,lsl #2] whenever + possible, saving 1 or 2 cycles on many opcodes, which should give a nice speed up. + + May have fixed N flag on ext opcode? + + Added dasm for link opcode. + +v0.0062 + * I was a bit too keen with the Arithmetic opcodes! Some of them should have been abcd, + exg and addx. Removed the incorrect opcodes, pending re-adding them as abcd, exg and addx. + + Changed unknown opcodes to act as nops. + Not very technical, but fun - a few more games show more graphics ;) + +v0.0060 + + Fixed divu (EA intro) + + Added sf (set false) opcode - SOR2 + * Todo: pea/link/unlk opcodes +---- +v0.010 + ++ Cyclone v0.0059: Added remainder to divide opcodes. + Background is now fixed on Eswat and Revenge of Shinobi. In fact they are playable! + +* Shrunk the screen down because some games aren't playable if you can't see the whole + 320 pixel width. + +* Merged the PicoDrive and GenaDrive 'Pico' directories, with ifdefs for EMU_C68K (Cyclone) + and EMU_A68K. + ++ While making GenaDrive I noticed a few bugs in the memory handlers and carried them + over to PicoDrive. + A lot of games (Revenge of Shinobi, Eswat, Sonic 1 maybe even) were reading + from memory locations like 0xff000000+Rom address, and I wasn't returning the Rom data. + Many more games show graphics now (G'n'G, Sonic 1)! + +* Cyclone: Changed the way Cyclone reads memory to be a bit less confusing. + The read/write memory handlers are now like this: + + unsigned char (*read8 )(unsigned int a); // [r7,#0x68] + unsigned short (*read16 )(unsigned int a); // [r7,#0x6c] + unsigned int (*read32 )(unsigned int a); // [r7,#0x70] + void (*write8 )(unsigned int a,unsigned char d); // [r7,#0x74] + void (*write16)(unsigned int a,unsigned short d); // [r7,#0x78] + void (*write32)(unsigned int a,unsigned int d); // [r7,#0x7c] + + This means the Cyclone itself now sign-extends 16 and 8-bit values when needed, and + the application doesn't have to. + + +v0.007 - Initial release + + Haven't been working on this much recently so I thought I'd release what + I had onto the Internet. + + Basically this is largely a framework for Cyclone, my 68000 core, and the + simplest system has to be the Megadrive, which is just really a 68000 with + flat address space wired up to a video display processor. + The Megadrive does of course have a Z80 for sound as well, but many games + will still run without it. Basically it's one of the most forgiving systems, + so it's probably a good starting point. + + Not many games run, and none of them are playable yet, but if you really want + to take a look anyway, here's what to do: + +------------------------------------------------------------------------------- + +How to run PicoDrive + + First connect your Pocket PC and copy PicoDrive.exe to it. Windows\Start Menu is + probably the best place for easy access. + It needs to have GAPI installed, which you may have already. If you don't it + will give you a really unhelpful error message (good old Windows!) like "Unable to execute + program". + To install GAPI just drop gx.dll into either the same folder as PicoDrive, or + your Windows folder. + Rom images go in the My Documents folder, and they must be in .BIN format, uncompressed. + + From memory, some games which do something are: Revenge of Shinobi, Sonic 2, + Ghouls 'N' Ghosts and CastleVania Bloodlines. Most just show a big blank screen :( + + If you find any games that are playable (maybe a PD game?), let me know, I'd be interested ;) + My e-mail is dev(at)finalburn.com - replace the (at) with an @ + + I think there must be something wrong somewhere with one of the ASL-type instructions + or something - there are still a few unimplemented opcodes, and also I don't think I did + the remainder from DIVS and DIVU yet. + + Dave. + emudave(atsymbol)gmail.com + diff --git a/PicoDrive/PicoDrive.vcp b/PicoDrive/PicoDrive.vcp new file mode 100644 index 0000000..e0654d3 --- /dev/null +++ b/PicoDrive/PicoDrive.vcp @@ -0,0 +1,851 @@ +# Microsoft eMbedded Visual Tools Project File - Name="PicoDrive" - Package Owner=<4> +# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (WCE x86) Application" 0x8301 +# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 +# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01 + +CFG=PicoDrive - Win32 (WCE ARM) Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "PicoDrive.vcn". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "PicoDrive.vcn" CFG="PicoDrive - Win32 (WCE ARM) Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "PicoDrive - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") +!MESSAGE "PicoDrive - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") +!MESSAGE "PicoDrive - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application") +!MESSAGE "PicoDrive - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application") +!MESSAGE "PicoDrive - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application") +!MESSAGE "PicoDrive - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +# PROP ATL_Project 2 + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ARMRel" +# PROP BASE Intermediate_Dir "ARMRel" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ARMRel" +# PROP Intermediate_Dir "ARMRel" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W4 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /FR /YX /Oxs /M$(CECrtMT) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# ADD LINK32 coredll.lib gx.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# Begin Special Build Tool +TargetPath=.\ARMRel\PicoDrive.exe +SOURCE="$(InputPath)" +PostBuild_Cmds=copy $(TargetPath) "D:\Briefcase" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "ARMDbg" +# PROP BASE Intermediate_Dir "ARMDbg" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ARMDbg" +# PROP Intermediate_Dir "ARMDbg" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W4 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# ADD LINK32 coredll.lib gx.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# Begin Special Build Tool +TargetPath=.\ARMDbg\PicoDrive.exe +SOURCE="$(InputPath)" +PostBuild_Cmds=copy $(TargetPath) "C:\Documents and Settings\Dave\My Documents\Mio My Documents" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "X86Rel" +# PROP BASE Intermediate_Dir "X86Rel" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "X86Rel" +# PROP Intermediate_Dir "X86Rel" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c +# ADD CPP /nologo /W4 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /FR /YX /Gs8192 /GF /Oxs /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 +# ADD LINK32 $(CEx86Corelibc) coredll.lib gx.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 +# Begin Special Build Tool +TargetPath=.\X86Rel\PicoDrive.exe +SOURCE="$(InputPath)" +PostBuild_Cmds=copy $(TargetPath) "C:\Documents and Settings\Dave\My Documents\Mio My Documents" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "X86Dbg" +# PROP BASE Intermediate_Dir "X86Dbg" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "X86Dbg" +# PROP Intermediate_Dir "X86Dbg" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c +# ADD CPP /nologo /W4 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 +# ADD LINK32 $(CEx86Corelibc) coredll.lib gx.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 +# Begin Special Build Tool +TargetPath=.\X86Dbg\PicoDrive.exe +SOURCE="$(InputPath)" +PostBuild_Cmds=copy $(TargetPath) "C:\Documents and Settings\Dave\My Documents\Mio My Documents" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "X86EMRel" +# PROP BASE Intermediate_Dir "X86EMRel" +# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "X86EMRel" +# PROP Intermediate_Dir "X86EMRel" +# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c +# ADD CPP /nologo /W4 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /FR /YX /Gz /Oxs /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 +# ADD LINK32 $(CEx86Corelibc) coredll.lib gx.lib aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 +# Begin Special Build Tool +TargetPath=.\X86EMRel\PicoDrive.exe +SOURCE="$(InputPath)" +PostBuild_Cmds=copy $(TargetPath) "C:\Documents and Settings\Dave\My Documents\Mio My Documents" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "X86EMDbg" +# PROP BASE Intermediate_Dir "X86EMDbg" +# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "X86EMDbg" +# PROP Intermediate_Dir "X86EMDbg" +# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c +# ADD CPP /nologo /W4 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 +# ADD LINK32 $(CEx86Corelibc) coredll.lib gx.lib aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 +# Begin Special Build Tool +TargetPath=.\X86EMDbg\PicoDrive.exe +SOURCE="$(InputPath)" +PostBuild_Cmds=copy $(TargetPath) "C:\Documents and Settings\Dave\My Documents\Mio My Documents" +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "PicoDrive - Win32 (WCE ARM) Release" +# Name "PicoDrive - Win32 (WCE ARM) Debug" +# Name "PicoDrive - Win32 (WCE x86) Release" +# Name "PicoDrive - Win32 (WCE x86) Debug" +# Name "PicoDrive - Win32 (WCE x86em) Release" +# Name "PicoDrive - Win32 (WCE x86em) Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Config.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_CONFI=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_CONFI=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_CONFI=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_CONFI=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_CONFI=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_CONFI=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_CONFI=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_CONFI=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_CONFI=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_CONFI=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Debug.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_DEBUG=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_DEBUG=\ + "..\Cyclone\Cyclone.h"\ + "..\Pico\Disa.h"\ + "..\Pico\Pico.h"\ + "..\Pico\PicoInt.h"\ + +NODEP_CPP_DEBUG=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_DEBUG=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_DEBUG=\ + "..\Cyclone\Cyclone.h"\ + "..\Pico\Pico.h"\ + "..\Pico\PicoInt.h"\ + +NODEP_CPP_DEBUG=\ + "..\Cyclone\Disa.h"\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_DEBUG=\ + "..\Cyclone\Cyclone.h"\ + "..\Pico\Disa.h"\ + "..\Pico\Pico.h"\ + "..\Pico\PicoInt.h"\ + +NODEP_CPP_DEBUG=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_DEBUG=\ + "..\Cyclone\Cyclone.h"\ + "..\Pico\Pico.h"\ + "..\Pico\PicoInt.h"\ + +NODEP_CPP_DEBUG=\ + "..\Cyclone\Disa.h"\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Emulate.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_EMULA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_EMULA=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_EMULA=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_EMULA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_EMULA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_EMULA=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_EMULA=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_EMULA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\File.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_FILE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_FILE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + +NODEP_CPP_FILE_=\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_FILE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_FILE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + +NODEP_CPP_FILE_=\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_FILE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + +NODEP_CPP_FILE_=\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_FILE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + +NODEP_CPP_FILE_=\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\FrameWindow.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_FRAME=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_FRAME=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_FRAME=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_FRAME=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_FRAME=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_FRAME=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_FRAME=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_FRAME=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\PicoDrive.txt +# End Source File +# Begin Source File + +SOURCE=.\Wave.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_WAVE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_WAVE_=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_WAVE_=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_WAVE_=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_WAVE_=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_WAVE_=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_WAVE_=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_WAVE_=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_WAVE_=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_WAVE_=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\WinMain.cpp + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +DEP_CPP_WINMA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +DEP_CPP_WINMA=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_WINMA=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +DEP_CPP_WINMA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +DEP_CPP_WINMA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +DEP_CPP_WINMA=\ + "..\Pico\Pico.h"\ + +NODEP_CPP_WINMA=\ + ".\app.h"\ + ".\ipapi.h"\ + ".\x.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +DEP_CPP_WINMA=\ + "..\Pico\Pico.h"\ + ".\stdafx.h"\ + {$(INCLUDE)}"aygshell.h"\ + {$(INCLUDE)}"gx.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\afxres.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\stdafx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\bitmap1.bmp +# End Source File +# Begin Source File + +SOURCE=.\Script1.rc + +!IF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Release" + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE ARM) Debug" + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Release" + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86) Debug" + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Release" + +!ELSEIF "$(CFG)" == "PicoDrive - Win32 (WCE x86em) Debug" + +!ENDIF + +# End Source File +# End Group +# End Target +# End Project diff --git a/PicoDrive/PicoDrive.vcw b/PicoDrive/PicoDrive.vcw new file mode 100644 index 0000000..05c3401 --- /dev/null +++ b/PicoDrive/PicoDrive.vcw @@ -0,0 +1,44 @@ +Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Pico"=..\Pico\Pico.vcp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "PicoDrive"=.\PicoDrive.vcp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name Pico + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/PicoDrive/Script1.rc b/PicoDrive/Script1.rc new file mode 100644 index 0000000..d7928d3 --- /dev/null +++ b/PicoDrive/Script1.rc @@ -0,0 +1,116 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menubar +// + +IDR_MENUBAR1 MENU DISCARDABLE +BEGIN + MENUITEM "Load Rom", ID_LOADROM + POPUP "Options" + BEGIN + MENUITEM "Save Movie", ID_OPTIONS_SAVE + MENUITEM "Load Movie", ID_OPTIONS_LOAD + MENUITEM "Grab Image", ID_OPTIONS_GRAB + END + MENUITEM "Close", IDCANCEL +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Data +// + +IDR_MENUBAR1 SHMENUBAR DISCARDABLE +BEGIN + IDR_MENUBAR1, 3, + I_IMAGENONE, ID_LOADROM, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, + IDS_CAP_LOADROM, 0, 0, + I_IMAGENONE, ID_OPTIONS, TBSTATE_ENABLED, + TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_OPTIONS, 0, 1, + I_IMAGENONE, IDCANCEL, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, IDS_CAP_CLOSE, + 0, 2, +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CAP_LOADROM "Load Rom" + IDS_CAP_CLOSE "Close" + IDS_CAP_GRAB "Grab" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CAP_OPTIONS "Options" +END + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/PicoDrive/Wave.cpp b/PicoDrive/Wave.cpp new file mode 100644 index 0000000..b5e5a46 --- /dev/null +++ b/PicoDrive/Wave.cpp @@ -0,0 +1,105 @@ + +#include "stdafx.h" + +int WaveRate=0; +int WaveLen=0; // Length of each buffer in samples +short *WaveDest=NULL; // Destination to render sound + +static HWAVEOUT WaveOut=NULL; +static short *WaveBuf=NULL; // Wave double-buffer +static WAVEHDR WaveHeader[2]; // WAVEHDR for each buffer +static int WavePlay=0; // Next buffer side to play + +int WaveInit() +{ + WAVEFORMATEX wfx; + WAVEHDR *pwh=NULL; + + if (WaveOut) return 0; // Already initted + + memset(&wfx,0,sizeof(wfx)); + memset(&WaveHeader,0,sizeof(WaveHeader)); + + wfx.wFormatTag=WAVE_FORMAT_PCM; + wfx.nChannels=2; // stereo + wfx.nSamplesPerSec=WaveRate; // sample rate + wfx.wBitsPerSample=16; + // Calculate bytes per sample and per second + wfx.nBlockAlign=(unsigned short)( (wfx.wBitsPerSample>>3)*wfx.nChannels ); + wfx.nAvgBytesPerSec=wfx.nSamplesPerSec*wfx.nBlockAlign; + + waveOutOpen(&WaveOut,WAVE_MAPPER,&wfx,0,NULL,CALLBACK_NULL); + + // Allocate both buffers + WaveBuf=(short *)malloc(WaveLen<<3); + if (WaveBuf==NULL) return 1; + memset(WaveBuf,0,WaveLen<<3); + + // Make WAVEHDRs for both buffers + pwh=WaveHeader+0; + pwh->lpData=(char *)WaveBuf; + pwh->dwBufferLength=WaveLen<<2; + pwh->dwLoops=1; + + pwh=WaveHeader+1; + *pwh=WaveHeader[0]; pwh->lpData+=WaveLen<<2; + + // Prepare the buffers + waveOutPrepareHeader(WaveOut,WaveHeader, sizeof(WAVEHDR)); + waveOutPrepareHeader(WaveOut,WaveHeader+1,sizeof(WAVEHDR)); + + // Queue both buffers: + WavePlay=0; + WaveHeader[0].dwFlags|=WHDR_DONE; + WaveHeader[1].dwFlags|=WHDR_DONE; + WaveUpdate(); + return 0; +} + +int WaveExit() +{ + WAVEHDR *pwh=NULL; + int i=0; + + if (WaveOut) waveOutReset(WaveOut); + + for (i=0;i<2;i++) + { + pwh=WaveHeader+i; + if (pwh->lpData) waveOutUnprepareHeader(WaveOut,pwh,sizeof(*pwh)); + } + memset(WaveHeader,0,sizeof(WaveHeader)); + + free(WaveBuf); WaveBuf=NULL; WaveLen=0; + + if (WaveOut) waveOutClose(WaveOut); WaveOut=NULL; + return 0; +} + +int WaveUpdate() +{ + WAVEHDR *pwh=NULL; int i=0; + int Last=-1; + + for (i=0;i<2;i++) + { + pwh=WaveHeader+WavePlay; + if (pwh->lpData==NULL) return 1; // Not initted + + if (pwh->dwFlags&WHDR_DONE) + { + // This buffer has finished - start it playing again + WaveDest=(short *)pwh->lpData; + SndRender(); + WaveDest=NULL; + + waveOutWrite(WaveOut,pwh,sizeof(*pwh)); + Last=WavePlay; // Remember the last buffer we played + } + + WavePlay++; WavePlay&=1; + } + + if (Last>=0) WavePlay=Last^1; // Next buffer to play is the other one + return 0; +} diff --git a/PicoDrive/WinMain.cpp b/PicoDrive/WinMain.cpp new file mode 100644 index 0000000..acb6a33 --- /dev/null +++ b/PicoDrive/WinMain.cpp @@ -0,0 +1,71 @@ + +#include "stdafx.h" +#include + +static FILE *DebugFile=NULL; +int Main3800=0; +int WINAPI WinMain(HINSTANCE,HINSTANCE,LPTSTR,int) +{ + MSG msg; int ret=0; + TCHAR device[260]; + + memset(&msg,0,sizeof(msg)); + memset(device,0,sizeof(device)); + + // Check if this program is running already: + FrameWnd=FindWindow(APP_TITLE,NULL); + if (FrameWnd!=NULL) { SetForegroundWindow(FrameWnd); return 0; } + + DeleteFile(L"zout.txt"); + + SystemParametersInfo(SPI_GETOEMINFO,sizeof(device)>>1,device,0); + if (_wcsicmp(device,L"compaq ipaq h3800")==0) Main3800=1; + + FrameInit(); + + ConfigInit(); + ConfigLoad(); + + WaveRate=44100; WaveLen=735; + WaveInit(); + + for(;;) + { + ret=PeekMessage(&msg,NULL,0,0,PM_REMOVE); + if (ret) + { + if (msg.message==WM_QUIT) break; + TranslateMessage(&msg); + DispatchMessage(&msg); + } + else + { + EmulateFrame(); + //WaveUpdate(); + Sleep(1); + } + } + + WaveExit(); + EmulateExit(); + + ConfigSave(); + + DestroyWindow(FrameWnd); + + if (DebugFile) fclose(DebugFile); + DebugFile=NULL; + return 0; +} + +extern "C" int dprintf(char *Format, ...) +{ + va_list VaList=NULL; + va_start(VaList,Format); + + if (DebugFile==NULL) DebugFile=fopen("zout.txt","wt"); + if (DebugFile) vfprintf(DebugFile,Format,VaList); + + va_end(VaList); + return 0; +} diff --git a/PicoDrive/afxres.h b/PicoDrive/afxres.h new file mode 100644 index 0000000..75e02f7 --- /dev/null +++ b/PicoDrive/afxres.h @@ -0,0 +1,7 @@ + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#define I_IMAGENONE (-2) +#define SHMENUBAR RCDATA diff --git a/PicoDrive/resource.h b/PicoDrive/resource.h new file mode 100644 index 0000000..61cde71 --- /dev/null +++ b/PicoDrive/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by Script1.rc +// +#define IDR_MENUBAR1 101 +#define ID_LOADROM 40001 +#define IDS_CAP_LOADROM 40003 +#define IDS_CAP_CLOSE 40006 +#define ID_DEBUG_SHOWRAM 40010 +#define ID_GRAB 40012 +#define IDS_CAP_GRAB 40014 +#define ID_OPTIONS 40015 +#define IDS_CAP_OPTIONS 40017 +#define ID_OPTIONS_SAVE 40018 +#define ID_OPTIONS_LOAD 40019 +#define ID_OPTIONS_GRAB 40020 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_COMMAND_VALUE 40021 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/PicoDrive/stdafx.h b/PicoDrive/stdafx.h new file mode 100644 index 0000000..b63e5bf --- /dev/null +++ b/PicoDrive/stdafx.h @@ -0,0 +1,73 @@ + +#pragma warning(disable:4514) +#pragma warning(push) +#pragma warning(disable:4201) +#include +#pragma warning(pop) + +#include +#include +#include + +#include "resource.h" + +#include "../Pico/Pico.h" + +#define APP_TITLE L"PicoDrive" + +// ---------------------------------------------------------- + +struct Target +{ + unsigned char *screen; + POINT point; // Screen to client point + RECT view,update; + int offset; // Amount to add onto scanline + int top,bottom; // Update rectangle in screen coordinates +}; + +// Config.cpp +struct Config +{ + int key[8]; +}; +extern struct Config Config; + +int ConfigInit(); +int ConfigSave(); +int ConfigLoad(); + +// Debug.cpp +int DebugShowRam(); +int DebugScreenGrab(); + +// Emulate.cpp +extern struct Target Targ; +extern TCHAR RomName[260]; +int EmulateInit(); +void EmulateExit(); +int EmulateFrame(); +int SndRender(); + +// File.cpp +int FileLoadRom(); +int FileState(int load); + +// FrameWindow.cpp +extern HWND FrameWnd; +extern struct GXDisplayProperties GXDisp; +extern struct GXKeyList GXKey; +extern int FrameShowRam; +int FrameInit(); + +// Wave.cpp +extern int WaveRate; +extern int WaveLen; // Length of each buffer in samples +extern short *WaveDest; // Destination to render sound +int WaveInit(); +int WaveExit(); +int WaveUpdate(); + +// WinMain.cpp +extern "C" int dprintf(char *Format, ...); +extern int Main3800; -- 2.39.5