notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renderer bugfix, minor adjustments
[picodrive.git]
/
Pico
/
Pico.c
diff --git
a/Pico/Pico.c
b/Pico/Pico.c
index
c47cf19
..
2ebe9c9
100644
(file)
--- a/
Pico/Pico.c
+++ b/
Pico/Pico.c
@@
-64,6
+64,9
@@
int PicoReset(int hard)
\r
if (Pico.romsize<=0) return 1;
\r
\r
\r
if (Pico.romsize<=0) return 1;
\r
\r
+ /* must call now, so that banking is reset, and correct vectors get fetched */
\r
+ if (PicoResetHook) PicoResetHook();
\r
+
\r
PicoMemReset();
\r
SekReset();
\r
// s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games).
\r
PicoMemReset();
\r
SekReset();
\r
// s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games).
\r
@@
-79,7
+82,7
@@
int PicoReset(int hard)
Pico.video.pending_ints=0;
\r
emustatus = 0;
\r
\r
Pico.video.pending_ints=0;
\r
emustatus = 0;
\r
\r
- if(hard) {
\r
+ if
(hard) {
\r
// clear all memory of the emulated machine
\r
memset(&Pico.ram,0,(unsigned int)&Pico.rom-(unsigned int)&Pico.ram);
\r
}
\r
// clear all memory of the emulated machine
\r
memset(&Pico.ram,0,(unsigned int)&Pico.rom-(unsigned int)&Pico.ram);
\r
}
\r
@@
-142,8
+145,6
@@
int PicoReset(int hard)
\r
PsndReset(); // pal must be known here
\r
\r
\r
PsndReset(); // pal must be known here
\r
\r
- if (PicoResetHook) PicoResetHook();
\r
-
\r
if (PicoMCD & 1) {
\r
PicoResetMCD(hard);
\r
return 0;
\r
if (PicoMCD & 1) {
\r
PicoResetMCD(hard);
\r
return 0;
\r
@@
-243,12
+244,12
@@
static __inline void SekStep(void)
\r
static int CheckIdle(void)
\r
{
\r
\r
static int CheckIdle(void)
\r
{
\r
- int i, state[0x2
2
];
\r
+ int i, state[0x2
4
];
\r
\r
// See if the state is the same after 2 steps:
\r
\r
// See if the state is the same after 2 steps:
\r
- SekState(state); SekStep(); SekStep(); SekState(state+0x1
1
);
\r
- for (i = 0x1
0
; i >= 0; i--)
\r
- if (state[i] != state[i+0x1
1
]) return 0;
\r
+ SekState(state); SekStep(); SekStep(); SekState(state+0x1
2
);
\r
+ for (i = 0x1
1
; i >= 0; i--)
\r
+ if (state[i] != state[i+0x1
2
]) return 0;
\r
\r
return 1;
\r
}
\r
\r
return 1;
\r
}
\r
@@
-343,6
+344,10
@@
static int PicoFrameSimple(void)
lines_step = 14;
\r
}
\r
\r
lines_step = 14;
\r
}
\r
\r
+ // a hack for VR, to get it running in fast mode
\r
+ if (PicoRead16Hook == PicoSVPRead16)
\r
+ Pico.ram[0xd864^1] = 0x1a;
\r
+
\r
// we don't emulate DMA timing in this mode
\r
if (Pico.m.dma_xfers) {
\r
Pico.m.dma_xfers=0;
\r
// we don't emulate DMA timing in this mode
\r
if (Pico.m.dma_xfers) {
\r
Pico.m.dma_xfers=0;
\r
@@
-390,10
+395,19
@@
static int PicoFrameSimple(void)
if (PicoLineHook) PicoLineHook(sects*lines_step);
\r
}
\r
\r
if (PicoLineHook) PicoLineHook(sects*lines_step);
\r
}
\r
\r
+ // another hack for VR (it needs hints to work)
\r
+ if (PicoRead16Hook == PicoSVPRead16) {
\r
+ Pico.ram[0xd864^1] = 1;
\r
+ pv->pending_ints|=0x10;
\r
+ if (pv->reg[0]&0x10) SekInterrupt(4);
\r
+ SekRunM68k(160);
\r
+ }
\r
+
\r
// render screen
\r
if (!PicoSkipFrame)
\r
{
\r
if (!(PicoOpt&0x10))
\r
// render screen
\r
if (!PicoSkipFrame)
\r
{
\r
if (!(PicoOpt&0x10))
\r
+ {
\r
// Draw the screen
\r
#if CAN_HANDLE_240_LINES
\r
if (pv->reg[1]&8) {
\r
// Draw the screen
\r
#if CAN_HANDLE_240_LINES
\r
if (pv->reg[1]&8) {
\r
@@
-404,6
+418,7
@@
static int PicoFrameSimple(void)
#else
\r
for (y=0;y<224;y++) PicoLine(y);
\r
#endif
\r
#else
\r
for (y=0;y<224;y++) PicoLine(y);
\r
#endif
\r
+ }
\r
else PicoFrameFull();
\r
#ifdef DRAW_FINISH_FUNC
\r
DRAW_FINISH_FUNC();
\r
else PicoFrameFull();
\r
#ifdef DRAW_FINISH_FUNC
\r
DRAW_FINISH_FUNC();
\r