notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor svp
[picodrive.git]
/
Pico
/
Pico.c
diff --git
a/Pico/Pico.c
b/Pico/Pico.c
index
6d9d525
..
0e9ee6c
100644
(file)
--- a/
Pico/Pico.c
+++ b/
Pico/Pico.c
@@
-19,7
+19,7
@@
int PicoAutoRgnOrder = 0;
int emustatus = 0; // rapid_ym2612, multi_ym_updates
\r
void (*PicoWriteSound)(int len) = NULL; // called at the best time to send sound buffer (PsndOut) to hardware
\r
void (*PicoResetHook)(void) = NULL;
\r
int emustatus = 0; // rapid_ym2612, multi_ym_updates
\r
void (*PicoWriteSound)(int len) = NULL; // called at the best time to send sound buffer (PsndOut) to hardware
\r
void (*PicoResetHook)(void) = NULL;
\r
-void (*PicoLineHook)(
void
) = NULL;
\r
+void (*PicoLineHook)(
int count
) = NULL;
\r
\r
struct PicoSRAM SRam = {0,};
\r
int z80startCycle, z80stopCycle; // in 68k cycles
\r
\r
struct PicoSRAM SRam = {0,};
\r
int z80startCycle, z80stopCycle; // in 68k cycles
\r
@@
-255,6
+255,12
@@
static int CheckIdle(void)
// to be called on 224 or line_sample scanlines only
\r
static __inline void getSamples(int y)
\r
{
\r
// to be called on 224 or line_sample scanlines only
\r
static __inline void getSamples(int y)
\r
{
\r
+#if SIMPLE_WRITE_SOUND
\r
+ if (y != 224) return;
\r
+ PsndRender(0, PsndLen);
\r
+ if (PicoWriteSound) PicoWriteSound(PsndLen);
\r
+ PsndClear();
\r
+#else
\r
static int curr_pos = 0;
\r
\r
if(y == 224) {
\r
static int curr_pos = 0;
\r
\r
if(y == 224) {
\r
@@
-271,6
+277,7
@@
static __inline void getSamples(int y)
emustatus&=~1;
\r
curr_pos = PsndRender(0, PsndLen/2);
\r
}
\r
emustatus&=~1;
\r
curr_pos = PsndRender(0, PsndLen/2);
\r
}
\r
+#endif
\r
}
\r
\r
\r
}
\r
\r
\r
@@
-364,6
+371,7
@@
static int PicoFrameSimple(void)
SekRunM68k(cycles_68k_block);
\r
\r
PicoRunZ80Simple(line, lines);
\r
SekRunM68k(cycles_68k_block);
\r
\r
PicoRunZ80Simple(line, lines);
\r
+ if (PicoLineHook) PicoLineHook(lines_step);
\r
line=lines;
\r
}
\r
\r
line=lines;
\r
}
\r
\r
@@
-377,6
+385,7
@@
static int PicoFrameSimple(void)
\r
lines += sects*lines_step;
\r
PicoRunZ80Simple(line, lines);
\r
\r
lines += sects*lines_step;
\r
PicoRunZ80Simple(line, lines);
\r
+ if (PicoLineHook) PicoLineHook(sects*lines_step);
\r
}
\r
\r
// render screen
\r
}
\r
\r
// render screen
\r
@@
-440,6
+449,7
@@
static int PicoFrameSimple(void)
SekRunM68k(cycles_68k_vblock);
\r
\r
PicoRunZ80Simple(line, lines);
\r
SekRunM68k(cycles_68k_vblock);
\r
\r
PicoRunZ80Simple(line, lines);
\r
+ if (PicoLineHook) PicoLineHook(lines_step);
\r
line=lines;
\r
\r
sects--;
\r
line=lines;
\r
\r
sects--;
\r
@@
-450,6
+460,7
@@
static int PicoFrameSimple(void)
if (sects) {
\r
lines += sects*lines_step;
\r
PicoRunZ80Simple(line, lines);
\r
if (sects) {
\r
lines += sects*lines_step;
\r
PicoRunZ80Simple(line, lines);
\r
+ if (PicoLineHook) PicoLineHook(sects*lines_step);
\r
}
\r
\r
return 0;
\r
}
\r
\r
return 0;
\r
@@
-491,6
+502,17
@@
void PicoFrameDrawOnly(void)
for (y=0;y<224;y++) PicoLine(y);
\r
}
\r
\r
for (y=0;y<224;y++) PicoLine(y);
\r
}
\r
\r
+int PicoGetStat(pstat_t which)
\r
+{
\r
+ switch (which)
\r
+ {
\r
+ case PS_PAL: return Pico.m.pal;
\r
+ case PS_40_CELL: return Pico.video.reg[12]&1;
\r
+ case PS_240_LINES: return Pico.m.pal && (Pico.video.reg[1]&8);
\r
+ }
\r
+ return 0;
\r
+}
\r
+
\r
// callback to output message from emu
\r
void (*PicoMessage)(const char *msg)=NULL;
\r
\r
// callback to output message from emu
\r
void (*PicoMessage)(const char *msg)=NULL;
\r
\r
@@
-577,14
+599,6
@@
char *debugString(void)
}
\r
#endif
\r
\r
}
\r
#endif
\r
\r
-#if 0
\r
- {
\r
- FILE *f = fopen("zram", "wb");
\r
- fwrite(Pico.zram, 1, 0x2000, f);
\r
- fclose(f);
\r
- }
\r
-#endif
\r
-
\r
return dstr;
\r
}
\r
#endif
\r
return dstr;
\r
}
\r
#endif
\r