mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-10-27 00:29:39 -04:00
sms, minor fixes (vdp mode switch, zram init)
This commit is contained in:
parent
1c70532fc2
commit
1603058a88
2 changed files with 17 additions and 6 deletions
11
pico/mode4.c
11
pico/mode4.c
|
|
@ -18,7 +18,7 @@
|
||||||
static void (*FinalizeLineSMS)(int line);
|
static void (*FinalizeLineSMS)(int line);
|
||||||
static int skip_next_line;
|
static int skip_next_line;
|
||||||
static int screen_offset, line_offset;
|
static int screen_offset, line_offset;
|
||||||
|
static u8 mode;
|
||||||
|
|
||||||
/* sprite collision detection */
|
/* sprite collision detection */
|
||||||
static int CollisionDetect(u8 *mb, u16 sx, unsigned int pack, int zoomed)
|
static int CollisionDetect(u8 *mb, u16 sx, unsigned int pack, int zoomed)
|
||||||
|
|
@ -558,6 +558,12 @@ void PicoFrameStartSMS(void)
|
||||||
loffs = screen_offset = 24; // 192 lines is really 224 with top/bottom bars
|
loffs = screen_offset = 24; // 192 lines is really 224 with top/bottom bars
|
||||||
Pico.est.rendstatus = PDRAW_32_COLS;
|
Pico.est.rendstatus = PDRAW_32_COLS;
|
||||||
|
|
||||||
|
// if mode changes make palette dirty since some modes switch to a fixed one
|
||||||
|
if (mode != ((Pico.video.reg[0]&0x06) | (Pico.video.reg[1]&0x18))) {
|
||||||
|
mode = (Pico.video.reg[0]&0x06) | (Pico.video.reg[1]&0x18);
|
||||||
|
Pico.m.dirtyPal = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Copy LCD enable flag for easier handling
|
// Copy LCD enable flag for easier handling
|
||||||
Pico.m.hardware &= ~0x2;
|
Pico.m.hardware &= ~0x2;
|
||||||
if (PicoIn.opt & POPT_EN_GG_LCD)
|
if (PicoIn.opt & POPT_EN_GG_LCD)
|
||||||
|
|
@ -569,7 +575,7 @@ void PicoFrameStartSMS(void)
|
||||||
loffs = 48;
|
loffs = 48;
|
||||||
lines = 144;
|
lines = 144;
|
||||||
columns = 160;
|
columns = 160;
|
||||||
} else switch ((Pico.video.reg[0]&0x06) | (Pico.video.reg[1]&0x18)) {
|
} else switch (mode) {
|
||||||
// SMS2 only 224/240 line modes, e.g. Micro Machines
|
// SMS2 only 224/240 line modes, e.g. Micro Machines
|
||||||
case 0x06|0x08:
|
case 0x06|0x08:
|
||||||
loffs = screen_offset = 0;
|
loffs = screen_offset = 0;
|
||||||
|
|
@ -717,6 +723,7 @@ void PicoDrawSetOutputSMS(pdso_t which)
|
||||||
PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328); break;
|
PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328); break;
|
||||||
}
|
}
|
||||||
rendstatus_old = -1;
|
rendstatus_old = -1;
|
||||||
|
mode = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim:shiftwidth=2:ts=2:expandtab
|
// vim:shiftwidth=2:ts=2:expandtab
|
||||||
|
|
|
||||||
12
pico/sms.c
12
pico/sms.c
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* SMS emulation
|
* SMS emulation
|
||||||
* (C) notaz, 2009-2010
|
* (C) notaz, 2009-2010
|
||||||
|
* (C) kub, 2021
|
||||||
*
|
*
|
||||||
* This work is licensed under the terms of MAME license.
|
* This work is licensed under the terms of MAME license.
|
||||||
* See COPYING file in the top-level directory.
|
* See COPYING file in the top-level directory.
|
||||||
|
|
@ -149,10 +150,10 @@ static unsigned char z80_sms_in(unsigned short a)
|
||||||
case 0x01:
|
case 0x01:
|
||||||
if ((Pico.m.hardware & 0x1) && a < 0x8) { // GG I/O area
|
if ((Pico.m.hardware & 0x1) && a < 0x8) { // GG I/O area
|
||||||
switch (a) {
|
switch (a) {
|
||||||
case 0: d = 0xff & ~(PicoIn.pad[0] & 0x80); break;
|
case 0: d = 0xff & ~(PicoIn.pad[0] & 0x80); break;
|
||||||
case 1: d = Pico.ms.io_gg[1] | Pico.ms.io_gg[2]; break;
|
case 1: d = Pico.ms.io_gg[1] | (Pico.ms.io_gg[2] & 0x7f); break;
|
||||||
case 5: d = Pico.ms.io_gg[5] & 0xf8; break;
|
case 5: d = Pico.ms.io_gg[5] & 0xf8; break;
|
||||||
default: d = Pico.ms.io_gg[a]; break;
|
default: d = Pico.ms.io_gg[a]; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -398,6 +399,9 @@ void PicoPowerMS(void)
|
||||||
memset(&Pico.m,0,sizeof(Pico.m));
|
memset(&Pico.m,0,sizeof(Pico.m));
|
||||||
Pico.m.pal = 0;
|
Pico.m.pal = 0;
|
||||||
|
|
||||||
|
for (s = 0; s < sizeof(PicoMem.zram); s++)
|
||||||
|
PicoMem.zram[s] = rand();
|
||||||
|
|
||||||
// calculate a mask for bank writes.
|
// calculate a mask for bank writes.
|
||||||
// ROM loader has aligned the size for us, so this is safe.
|
// ROM loader has aligned the size for us, so this is safe.
|
||||||
s = 0; tmp = Pico.romsize;
|
s = 0; tmp = Pico.romsize;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue