SVP stubs

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@317 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-12-22 20:25:17 +00:00
parent 0ce6e5ee0a
commit f53f286a8b
11 changed files with 69 additions and 12 deletions

View file

@ -632,5 +632,13 @@ void PicoCartDetect(void)
// Unusual region 'code'
if (rom_strcmp(0x1f0, "EUROPE") == 0)
*(int *) (Pico.rom+0x1f0) = 0x20204520;
// SVP detection
if (name_cmp("Virtua Racing") == 0)
{
PicoSVPInit();
PicoRead16Hook = PicoSVPRead16;
PicoWrite8Hook = PicoSVPWrite8;
}
}

View file

@ -203,10 +203,7 @@ static void SRAMWrite(u32 a, u32 d)
}
// for nonstandard reads
#ifndef _ASM_MEMORY_C
static
#endif
u32 OtherRead16End(u32 a, int realsize)
static u32 OtherRead16End(u32 a, int realsize)
{
u32 d=0;
@ -499,8 +496,17 @@ static void PicoWrite32(u32 a,u32 d)
// -----------------------------------------------------------------
// TODO: asm code
u32 (*PicoRead16Hook)(u32 a, int realsize) = OtherRead16End;
void (*PicoWrite8Hook)(u32 a, u32 d, int realsize) = OtherWrite8End;
PICO_INTERNAL void PicoMemSetup(void)
{
// default unmapped/cart specific handlers
PicoRead16Hook = OtherRead16End;
PicoWrite8Hook = OtherWrite8End;
// Setup memory callbacks:
#ifdef EMU_C68K
PicoCpuCM68k.checkpc=PicoCheckPc;

View file

@ -136,7 +136,7 @@ u32 OtherRead16(u32 a, int realsize)
goto end;
}
d = OtherRead16End(a, realsize);
d = PicoRead16Hook(a, realsize);
end:
return d;
@ -191,7 +191,7 @@ void OtherWrite8(u32 a,u32 d)
return;
}
OtherWrite8End(a, d, 8);
PicoWrite8Hook(a, d, 8);
}
@ -227,10 +227,10 @@ void OtherWrite16(u32 a,u32 d)
SRAMWrite(a, d);
return;
}
#else
OtherWrite8End(a, d>>8, 16);
OtherWrite8End(a+1,d&0xff, 16);
#endif
PicoWrite8Hook(a, d>>8, 16);
PicoWrite8Hook(a+1,d&0xff, 16);
}

View file

@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include "Pico.h"
#include "carthw/carthw.h"
//
#define USE_POLL_DETECT
@ -393,6 +394,8 @@ PICO_INTERNAL unsigned short z80_read16(unsigned short a);
#else
PICO_INTERNAL_ASM void z80_write(unsigned int a, unsigned char data);
#endif
extern unsigned int (*PicoRead16Hook)(unsigned int a, int realsize);
extern void (*PicoWrite8Hook)(unsigned int a,unsigned int d,int realsize);
// cd/Memory.c
PICO_INTERNAL void PicoMemSetupCD(void);

8
Pico/carthw/carthw.h Normal file
View file

@ -0,0 +1,8 @@
/* svp */
void PicoSVPInit(void);
unsigned int PicoSVPRead16(unsigned int a, int realsize);
void PicoSVPWrite8(unsigned int a,unsigned int d,int realsize);

16
Pico/carthw/svp/Memory.c Normal file
View file

@ -0,0 +1,16 @@
#include "../../PicoInt.h"
unsigned int PicoSVPRead16(unsigned int a, int realsize)
{
unsigned int d = 0;
elprintf(EL_UIO, "SVP r%i: [%06x] %04x @%06x", realsize, a&0xffffff, d, SekPc);
return d;
}
void PicoSVPWrite8(unsigned int a, unsigned int d, int realsize)
{
elprintf(EL_UIO, "SVP w%i: %06x, %08x @%06x", realsize, a&0xffffff, d, SekPc);
}

7
Pico/carthw/svp/svp.c Normal file
View file

@ -0,0 +1,7 @@
#include "../../PicoInt.h"
void PicoSVPInit(void)
{
elprintf(0xffff, "SVP");
}

View file

@ -1626,6 +1626,10 @@ void PicoMemResetCD(int r3)
PICO_INTERNAL void PicoMemSetupCD(void)
{
// additional handlers for common code
PicoRead16Hook = OtherRead16End;
PicoWrite8Hook = OtherWrite8End;
#ifdef EMU_C68K
// Setup m68k memory callbacks:
PicoCpuCM68k.checkpc=PicoCheckPcM68k;

View file

@ -43,6 +43,8 @@ OBJS += Pico/cd/Pico.o Pico/cd/Memory.o Pico/cd/Sek.o Pico/cd/LC89510.o \
Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o
# Pico - sound
OBJS += Pico/sound/sound.o Pico/sound/sn76496.o Pico/sound/ym2612.o Pico/sound/mix.o
# Pico - carthw
OBJS += Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o
# zlib
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
@ -74,8 +76,8 @@ endif
endif
vpath %.c = ../..
DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/sound zlib unzip \
cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/sound Pico/carthw/svp \
zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
all: mkdirs PicoDrive
clean: tidy

View file

@ -30,6 +30,7 @@ static const char *verstring = "PicoDrive " VERSION;
// dummies
char *ext_menu = 0, *ext_state = 0;
int mix_32_to_16l_level;
/* gtk */
struct gtk_global_struct

View file

@ -12,7 +12,9 @@
// pico.c
#define CAN_HANDLE_240_LINES 1
#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_SRAMIO|EL_EEPROM) // EL_VDPDMA|EL_ASVDP|EL_SR) // |EL_BUSREQ|EL_Z80BNK)
#define mix_32_to_16l_stereo_lvl mix_32_to_16l_stereo
#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_SRAMIO|EL_EEPROM|EL_UIO) // EL_VDPDMA|EL_ASVDP|EL_SR) // |EL_BUSREQ|EL_Z80BNK)
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
#define dprintf(x...)