* - H counter
*/
#include "pico_int.h"
+#include "memory.h"
#include "sound/sn76496.h"
static unsigned char vdp_data_read(void)
static void write_bank(unsigned short a, unsigned char d)
{
+ elprintf(EL_Z80BNK, "bank %04x %02x @ %04x", a, d, z80_pc());
switch (a & 0x0f)
{
case 0x0c:
d &= bank_mask;
z80_map_set(z80_read_map, 0x4000, 0x7fff, Pico.rom + (d << 14), 0);
#ifdef _USE_CZ80
- Cz80_Set_Fetch(&CZ80, 0x4000, 0x7fff, (UINT32)Pico.rom + (d << 14));
+ Cz80_Set_Fetch(&CZ80, 0x4000, 0x7fff, (FPTR)Pico.rom + (d << 14));
#endif
break;
case 0x0f:
d &= bank_mask;
z80_map_set(z80_read_map, 0x8000, 0xbfff, Pico.rom + (d << 14), 0);
#ifdef _USE_CZ80
- Cz80_Set_Fetch(&CZ80, 0x8000, 0xbfff, (UINT32)Pico.rom + (d << 14));
+ Cz80_Set_Fetch(&CZ80, 0x8000, 0xbfff, (FPTR)Pico.rom + (d << 14));
#endif
break;
}
}
-static void MEMH_FUNC xwrite(unsigned int a, unsigned char d)
+static void xwrite(unsigned int a, unsigned char d)
{
elprintf(EL_IO, "z80 write [%04x] %02x", a, d);
if (a >= 0xc000)
{
int s, tmp;
- memset(&Pico.ram,0,(unsigned int)&Pico.rom-(unsigned int)&Pico.ram);
+ memset(&Pico.ram,0,(unsigned char *)&Pico.rom - Pico.ram);
memset(&Pico.video,0,sizeof(Pico.video));
memset(&Pico.m,0,sizeof(Pico.m));
Pico.m.pal = 0;
drZ80.z80_out = z80_sms_out;
#endif
#ifdef _USE_CZ80
- Cz80_Set_Fetch(&CZ80, 0x0000, 0xbfff, (UINT32)Pico.rom);
- Cz80_Set_Fetch(&CZ80, 0xc000, 0xdfff, (UINT32)Pico.zram);
- Cz80_Set_Fetch(&CZ80, 0xe000, 0xffff, (UINT32)Pico.zram);
+ Cz80_Set_Fetch(&CZ80, 0x0000, 0xbfff, (FPTR)Pico.rom);
+ Cz80_Set_Fetch(&CZ80, 0xc000, 0xdfff, (FPTR)Pico.zram);
+ Cz80_Set_Fetch(&CZ80, 0xe000, 0xffff, (FPTR)Pico.zram);
Cz80_Set_INPort(&CZ80, z80_sms_in);
Cz80_Set_OUTPort(&CZ80, z80_sms_out);
#endif
int lines = is_pal ? 313 : 262;
int cycles_line = is_pal ? 58020 : 58293; /* (226.6 : 227.7) * 256 */
int cycles_done = 0, cycles_aim = 0;
+ int skip = PicoSkipFrame;
int lines_vis = 192;
int hint; // Hint counter
int y;
{
pv->v_counter = Pico.m.scanline = y;
- if (y < lines_vis)
+ if (y < lines_vis && !skip)
PicoLineMode4(y);
if (y <= lines_vis)
cycles_done += z80_run((cycles_aim - cycles_done) >> 8) << 8;
}
- PsndGetSamplesMS();
+ if (PsndOut)
+ PsndGetSamplesMS();
}
void PicoFrameDrawOnlyMS(void)