pd[0] = pd[1] = pal * 0x01010101;
}
-// 8 pixels are arranged are arranged in 4 bitplanes in a 32 bit word. To pull
-// the 4 bitplanes together multiply with each bit distance (multiples of 1<<7)
+// 8 pixels are arranged in 4 bitplane bytes in a 32 bit word. To pull the
+// 4 bitplanes together multiply with each bit distance (multiples of 1<<7)
#define PLANAR_PIXELBG(x,p) \
t = (pack>>(7-p)) & 0x01010101; \
t = (t*0x10204080) >> 28; \
static void DrawSpritesM4(int scanline)
{
struct PicoVideo *pv = &Pico.video;
- unsigned char mb[256/8+2] = {0};
+ unsigned char mb[1+256/8+2] = {0}; // zoomed
unsigned int sprites_addr[8];
unsigned int sprites_x[8];
unsigned int pack;
static void DrawSpritesTMS(int scanline)
{
struct PicoVideo *pv = &Pico.video;
- unsigned char mb[256/8+2] = {0};
+ unsigned char mb[1+256/8+4] = {0}; // zoomed+doublesize
unsigned int sprites_addr[4];
unsigned int sprites_x[4];
unsigned int pack;
// 8KB ROM mapping for MSX mapper
static void write_bank_msx(unsigned short a, unsigned char d)
{
+ if (Pico.ms.mapper != 2 && (a|d) == 0) return;
elprintf(EL_Z80BNK, "bank 8k %04x %02x @ %04x", a, d, z80_pc());
Pico.ms.mapper = 2; // TODO define (more) mapper types
Pico.ms.carthw[a] = d;
if (a == 0xa000 && Pico.ms.mapper != 2)
write_bank_sega(0xffff, d);
// MSX. 4 selectable 8KB banks at the top
- if (a <= 0x0003 && Pico.ms.mapper != 1 && (a|d))
+ if (a <= 0x0003 && Pico.ms.mapper != 1)
write_bank_msx(a, d);
}
if (pv->reg[0] & 0x10) {
elprintf(EL_INTS, "hint");
z80_int_assert(1);
- }
+ }
+ } else if (pv->pending_ints & 2) {
+ pv->pending_ints &= ~2;
+ z80_int_assert(0);
}
}
else if (y == lines_vis + 1) {
+ pv->pending_ints &= ~2;
pv->pending_ints |= 1;
if (pv->reg[1] & 0x20) {
elprintf(EL_INTS, "vint");
z80_int_assert(1);
- }
+ } else
+ z80_int_assert(0);
}
cycles_aim += cycles_line;