notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
memhandlers slightly improved
[picodrive.git]
/
Pico
/
cd
/
Pico.c
diff --git
a/Pico/cd/Pico.c
b/Pico/cd/Pico.c
index
b1d7c5d
..
5dcb39c
100644
(file)
--- a/
Pico/cd/Pico.c
+++ b/
Pico/cd/Pico.c
@@
-1,14
+1,7
@@
-// This is part of Pico Library
-
-// (c) Copyright 2004 Dave, All rights reserved.
// (c) Copyright 2007 notaz, All rights reserved.
// (c) Copyright 2007 notaz, All rights reserved.
-// Free for non-commercial use.
-
-// For commercial use, separate licencing terms must be obtained.
#include "../PicoInt.h"
#include "../PicoInt.h"
-#include "../sound/sound.h"
extern unsigned char formatted_bram[4*0x10];
extern unsigned char formatted_bram[4*0x10];
@@
-38,7
+31,7
@@
int (*PicoMCDcloseTray)(void) = NULL;
}
}
-int PicoInitMCD(void)
+
PICO_INTERNAL
int PicoInitMCD(void)
{
SekInitS68k();
Init_CD_Driver();
{
SekInitS68k();
Init_CD_Driver();
@@
-47,7
+40,7
@@
int PicoInitMCD(void)
}
}
-void PicoExitMCD(void)
+
PICO_INTERNAL
void PicoExitMCD(void)
{
End_CD_Driver();
{
End_CD_Driver();
@@
-55,7
+48,7
@@
void PicoExitMCD(void)
//dump_ram(Pico.ram, "ram.bin");
}
//dump_ram(Pico.ram, "ram.bin");
}
-int PicoResetMCD(int hard)
+
PICO_INTERNAL
int PicoResetMCD(int hard)
{
if (hard) {
int fmt_size = sizeof(formatted_bram);
{
if (hard) {
int fmt_size = sizeof(formatted_bram);
@@
-81,10
+74,16
@@
int PicoResetMCD(int hard)
//PicoMemResetCDdecode(1); // don't have to call this in 2M mode
#endif
//PicoMemResetCDdecode(1); // don't have to call this in 2M mode
#endif
+ // use SRam.data for RAM cart
+ if (SRam.data) free(SRam.data);
+ SRam.data = NULL;
+ if (PicoOpt&0x8000)
+ SRam.data = calloc(1, 0x12000);
+
return 0;
}
return 0;
}
-static __inline void SekRun(int cyc)
+static __inline void SekRun
M68k
(int cyc)
{
int cyc_do;
SekCycleAim+=cyc;
{
int cyc_do;
SekCycleAim+=cyc;
@@
-291,7
+290,7
@@
static int PicoFrameHintsMCD(void)
{
//dprintf("vint: @ %06x [%i|%i]", SekPc, y, SekCycleCnt);
pv->status|=0x88; // V-Int happened, go into vblank
{
//dprintf("vint: @ %06x [%i|%i]", SekPc, y, SekCycleCnt);
pv->status|=0x88; // V-Int happened, go into vblank
- SekRun(128); SekCycleAim-=128; // there must be a gap between H and V ints, also after vblank bit set (Mazin Saga, Bram Stoker's Dracula)
+ SekRun
M68k
(128); SekCycleAim-=128; // there must be a gap between H and V ints, also after vblank bit set (Mazin Saga, Bram Stoker's Dracula)
/*if(Pico.m.z80Run && (PicoOpt&4)) {
z80CycleAim+=cycles_z80/2;
total_z80+=z80_run(z80CycleAim-total_z80);
/*if(Pico.m.z80Run && (PicoOpt&4)) {
z80CycleAim+=cycles_z80/2;
total_z80+=z80_run(z80CycleAim-total_z80);
@@
-329,7
+328,7
@@
static int PicoFrameHintsMCD(void)
if ((PicoOpt & 0x2000) && (Pico_mcd->m.busreq&3) == 1) {
SekRunPS(cycles_68k, cycles_s68k); // "better/perfect sync"
} else {
if ((PicoOpt & 0x2000) && (Pico_mcd->m.busreq&3) == 1) {
SekRunPS(cycles_68k, cycles_s68k); // "better/perfect sync"
} else {
- SekRun(cycles_68k);
+ SekRun
M68k
(cycles_68k);
if ((Pico_mcd->m.busreq&3) == 1) // no busreq/no reset
SekRunS68k(cycles_s68k);
}
if ((Pico_mcd->m.busreq&3) == 1) // no busreq/no reset
SekRunS68k(cycles_s68k);
}
@@
-358,7
+357,7
@@
static int PicoFrameHintsMCD(void)
}
}
-int PicoFrameMCD(void)
+
PICO_INTERNAL
int PicoFrameMCD(void)
{
if(!(PicoOpt&0x10))
PicoFrameStart();
{
if(!(PicoOpt&0x10))
PicoFrameStart();