1.30 release

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@78 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-03-25 00:08:03 +00:00
parent 7a1f6e45c9
commit 89fa852dce
8 changed files with 63 additions and 16 deletions

View file

@ -79,8 +79,10 @@ zip_failed:
f = fopen(path, "rb");
if (f == NULL) return NULL;
#ifndef NO_IONBF
/* we use our own buffering */
setvbuf(f, NULL, _IONBF, 0);
#endif
file = malloc(sizeof(*file));
if (file == NULL) {

View file

@ -12,6 +12,9 @@
#include <string.h>
#include "Pico.h"
//
#define USE_POLL_DETECT
// to select core, define EMU_C68K, EMU_M68K or EMU_A68K in your makefile or project
@ -210,7 +213,7 @@ struct mcd_misc
unsigned short hint_vector;
unsigned char busreq;
unsigned char s68k_pend_ints;
unsigned int state_flags; // 04: emu state: reset_pending,
unsigned int state_flags; // 04: emu state: reset_pending, dmna_pending
unsigned int counter75hz;
unsigned short audio_offset; // 0c: for savestates: play pointer offset (0-1023)
unsigned char audio_track; // playing audio track # (zero based)

View file

@ -34,7 +34,6 @@ typedef unsigned int u32;
// -----------------------------------------------------------------
// poller detection
#define USE_POLL_DETECT
#define POLL_LIMIT 16
#define POLL_CYCLES 124
// int m68k_poll_addr, m68k_poll_cnt;
@ -53,7 +52,7 @@ static u32 m68k_reg_read16(u32 a)
goto end;
case 2:
d = (Pico_mcd->s68k_regs[a]<<8) | (Pico_mcd->s68k_regs[a+1]&0xc7);
dprintf("m68k_regs r3: %02x @%06x", (u8)d, SekPcS68k);
dprintf("m68k_regs r3: %02x @%06x", (u8)d, SekPc);
goto end;
case 4:
d = Pico_mcd->s68k_regs[4]<<8;
@ -129,7 +128,14 @@ void m68k_reg_write8(u32 a, u32 d)
d ^= 2; // writing 0 to DMNA actually sets it, 1 does nothing
} else {
//dold &= ~2; // ??
#if 1
if ((d & 2) && !(dold & 2)) {
Pico_mcd->m.state_flags |= 2; // we must delay setting DMNA bit (needed for Silpheed)
d &= ~2;
}
#else
if (d & 2) dold &= ~1; // return word RAM to s68k in 2M mode
#endif
}
Pico_mcd->s68k_regs[3] = d | dold; // really use s68k side register
#ifdef USE_POLL_DETECT
@ -273,7 +279,7 @@ void s68k_reg_write8(u32 a, u32 d)
return; // only m68k can change WP
case 3: {
int dold = Pico_mcd->s68k_regs[3];
dprintf("s68k_regs w3: %02x @%06x", (u8)d, SekPc);
dprintf("s68k_regs w3: %02x @%06x", (u8)d, SekPcS68k);
d &= 0x1d;
d |= dold&0xc2;
if (d&4) {

View file

@ -201,8 +201,8 @@ PicoMemResetCD: @ r3
bx lr
PicoMemResetCDdecode: @r3
tst r3, #4
PicoMemResetCDdecode: @reg3
tst r0, #4
bxeq lr @ we should not be called in 2M mode
ldr r1, =m_s68k_write8_table
ldr r3, =m_s68k_decode_write_table

View file

@ -12,6 +12,28 @@
extern unsigned char formatted_bram[4*0x10];
extern unsigned int s68k_poll_adclk;
#define dump_ram(ram,fname) \
{ \
int i, d; \
FILE *f; \
\
for (i = 0; i < sizeof(ram); i+=2) { \
d = (ram[i]<<8) | ram[i+1]; \
*(unsigned short *)(ram+i) = d; \
} \
f = fopen(fname, "wb"); \
if (f) { \
fwrite(ram, 1, sizeof(ram), f); \
fclose(f); \
} \
for (i = 0; i < sizeof(ram); i+=2) { \
d = (ram[i]<<8) | ram[i+1]; \
*(unsigned short *)(ram+i) = d; \
} \
}
int PicoInitMCD(void)
@ -26,6 +48,9 @@ int PicoInitMCD(void)
void PicoExitMCD(void)
{
End_CD_Driver();
//dump_ram(Pico_mcd->prg_ram, "prg.bin");
//dump_ram(Pico.ram, "ram.bin");
}
int PicoResetMCD(int hard)
@ -185,6 +210,18 @@ static __inline void update_chips(void)
// update gfx chip
if (Pico_mcd->rot_comp.Reg_58 & 0x8000)
gfx_cd_update();
// delayed setting of DMNA bit (needed for Silpheed)
if (Pico_mcd->m.state_flags & 2) {
Pico_mcd->m.state_flags &= ~2;
Pico_mcd->s68k_regs[3] |= 2;
Pico_mcd->s68k_regs[3] &= ~1;
#ifdef USE_POLL_DETECT
if ((s68k_poll_adclk&0xfe) == 2) {
SekSetStopS68k(0); s68k_poll_adclk = 0;
}
#endif
}
}

View file

@ -1,6 +1,4 @@
// TODO...
// #include <string.h>
#include "../PicoInt.h"
#define rot_comp Pico_mcd->rot_comp
@ -359,7 +357,7 @@ unsigned int gfx_cd_read(unsigned int a)
dprintf("gfx_cd_read(%02x) = %04x", a, d);
return 0;
return d;
}
void gfx_cd_write16(unsigned int a, unsigned int d)

View file

@ -799,7 +799,7 @@ static void cd_menu_loop_options(void)
} else {
if (PicoCDBuffers < 64) PicoCDBuffers = 64;
else PicoCDBuffers <<= 1;
if (PicoCDBuffers > 4096) PicoCDBuffers = 4096;
if (PicoCDBuffers > 8*1024) PicoCDBuffers = 8*1024; // 16M
}
break;
case 7: currentConfig.PicoOpt^=0x1000; break;

View file

@ -4,6 +4,7 @@
#define PORT_CONFIG_H
#define CPU_CALL
#define NO_IONBF
// draw2.c
#define START_ROW 0 // which row of tiles to start rendering at?
@ -12,8 +13,8 @@
// pico.c
#define CAN_HANDLE_240_LINES 1
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
#define dprintf(x...)
#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
//#define dprintf(x...)
#endif //PORT_CONFIG_H