mirror of
https://github.com/holub/mame
synced 2025-05-18 19:49:35 +03:00
spaceg.c improvements: [hap]
- less garbage trails, though it's not completely good yet - fixed jerky x-movement - fixed crash on loadstate - marked color proms as undumped
This commit is contained in:
parent
bd45026e49
commit
319f170519
@ -180,7 +180,7 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
UINT8 * videoram;
|
||||
UINT8 * unkram;
|
||||
UINT8 * colorram;
|
||||
UINT8 * io9400;
|
||||
UINT8 * io9401;
|
||||
};
|
||||
@ -198,7 +198,7 @@ static PALETTE_INIT( spaceg )
|
||||
for (i = 0; i < 128; i++)
|
||||
palette_set_color (machine, i, MAKE_RGB(0x00,0x00,0x00));
|
||||
|
||||
|
||||
// proms are currently undumped...
|
||||
palette_set_color (machine, 0, MAKE_RGB(0x00,0x00,0x00)); //ok czarny
|
||||
palette_set_color (machine, 1, MAKE_RGB(0x7f,0x00,0x00));//???
|
||||
palette_set_color (machine, 2, MAKE_RGB(0xff,0xff,0xff)); //ok+ bialy
|
||||
@ -216,41 +216,47 @@ static PALETTE_INIT( spaceg )
|
||||
palette_set_color (machine, 13, MAKE_RGB(0x7f,0xbf,0xff)); //ok j.niebieski (jasniejszy od 9)
|
||||
palette_set_color (machine, 14, MAKE_RGB(0x00,0xff,0xff));//???
|
||||
palette_set_color (machine, 15, MAKE_RGB(0x7f,0x7f,0x7f));//???
|
||||
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( zvideoram_w )
|
||||
{
|
||||
spaceg_state *state = space->machine->driver_data<spaceg_state>();
|
||||
int col;
|
||||
|
||||
col = state->unkram[0x400];
|
||||
|
||||
if (col > 0x0f)
|
||||
popmessage("color > 0x0f = %2d", col);
|
||||
int col = state->colorram[0x400];
|
||||
int xoff = *state->io9400 >> 5 & 7;
|
||||
UINT16 offset2 = (offset + 0x100) & 0x1fff;
|
||||
UINT16 sdata = data << (8 - xoff);
|
||||
UINT16 vram_data = state->videoram[offset] << 8 | (state->videoram[offset2]);
|
||||
|
||||
if (col > 0x0f) popmessage("color > 0x0f = %2d", col);
|
||||
col &= 0x0f;
|
||||
|
||||
switch (*state->io9401)
|
||||
{
|
||||
case 0x0d: /* 1101 */
|
||||
state->videoram[offset] &= ~data;
|
||||
data = state->videoram[offset];
|
||||
break;
|
||||
// draw
|
||||
case 0:
|
||||
vram_data &= ~(0xff00 >> xoff);
|
||||
// (fall through)
|
||||
case 1:
|
||||
vram_data |= sdata;
|
||||
|
||||
case 0x01: /* 0001 */
|
||||
case 0x00: /* 0000 */
|
||||
state->videoram[offset] = data;
|
||||
break;
|
||||
// update colorram
|
||||
if (sdata&0xff00) state->colorram[offset] = col;
|
||||
if (sdata&0x00ff) state->colorram[offset2] = col;
|
||||
break;
|
||||
|
||||
default:
|
||||
logerror("mode = %02x pc = %04x\n", *state->io9401, cpu_get_pc(space->cpu));
|
||||
popmessage("mode = %02x pc = %04x\n", *state->io9401, cpu_get_pc(space->cpu));
|
||||
return;
|
||||
// erase
|
||||
case 0xd:
|
||||
vram_data &= ~sdata;
|
||||
break;
|
||||
|
||||
default:
|
||||
logerror("mode = %02x pc = %04x\n", *state->io9401, cpu_get_pc(space->cpu));
|
||||
popmessage("mode = %02x pc = %04x\n", *state->io9401, cpu_get_pc(space->cpu));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
state->unkram[offset] = col;
|
||||
state->videoram[offset]=vram_data>>8;
|
||||
state->videoram[offset2]=vram_data&0xff;
|
||||
}
|
||||
|
||||
|
||||
@ -261,7 +267,7 @@ static READ8_HANDLER(spaceg_colorram_r)
|
||||
|
||||
if (offset < 0x400)
|
||||
{
|
||||
rgbcolor = (state->unkram[offset] << 1) | ((offset &0x100) >> 8);
|
||||
rgbcolor = (state->colorram[offset] << 1) | ((offset &0x100) >> 8);
|
||||
|
||||
if ((offset >= 0x200) && (offset < 0x220)) /* 0xa200- 0xa21f */
|
||||
{
|
||||
@ -276,13 +282,13 @@ static READ8_HANDLER(spaceg_colorram_r)
|
||||
palette_set_color_rgb(space->machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
|
||||
}
|
||||
else
|
||||
logerror("palette? read from unkram offset = %04x\n",offset);
|
||||
logerror("palette? read from colorram offset = %04x\n",offset);
|
||||
}
|
||||
|
||||
if (*state->io9401 != 0x40)
|
||||
logerror("unkram read in mode: 9401 = %02x (offset = %04x)\n", *state->io9401, offset);
|
||||
logerror("colorram read in mode: 9401 = %02x (offset = %04x)\n", *state->io9401, offset);
|
||||
|
||||
return state->unkram[offset];
|
||||
return state->colorram[offset];
|
||||
}
|
||||
|
||||
|
||||
@ -295,13 +301,12 @@ static VIDEO_UPDATE( spaceg )
|
||||
{
|
||||
int i;
|
||||
UINT8 data = state->videoram[offs];
|
||||
|
||||
int y = offs & 0xff;
|
||||
UINT8 x = ((offs >> 8) << 3) - ((*state->io9400 & 0xe0) >> 5);
|
||||
int x = (offs >> 8) << 3;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
*BITMAP_ADDR16(bitmap, y, x) = (data & 0x80) ? state->unkram[offs] : 0;
|
||||
*BITMAP_ADDR16(bitmap, y, x) = (data & 0x80) ? state->colorram[offs] : 0;
|
||||
|
||||
x++;
|
||||
data <<= 1;
|
||||
@ -323,7 +328,7 @@ static ADDRESS_MAP_START( spaceg_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x3000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x7000, 0x77ff) AM_RAM
|
||||
|
||||
AM_RANGE(0xa000, 0xbfff) AM_RAM_READ(spaceg_colorram_r) AM_BASE_MEMBER(spaceg_state, unkram)
|
||||
AM_RANGE(0xa000, 0xbfff) AM_RAM_READ(spaceg_colorram_r) AM_BASE_MEMBER(spaceg_state, colorram)
|
||||
AM_RANGE(0xc000, 0xdfff) AM_RAM_WRITE(zvideoram_w) AM_BASE_MEMBER(spaceg_state, videoram)
|
||||
|
||||
AM_RANGE(0x9400, 0x9400) AM_WRITEONLY AM_BASE_MEMBER(spaceg_state, io9400) /* gfx ctrl */
|
||||
@ -381,18 +386,18 @@ static INPUT_PORTS_START( spaceg )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
|
||||
PORT_START("9805") /* player 1 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
|
||||
|
||||
PORT_START("9806") /* player 2 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine driver
|
||||
* Machine config
|
||||
*
|
||||
*************************************/
|
||||
|
||||
@ -406,7 +411,7 @@ static MACHINE_CONFIG_START( spaceg, spaceg_state )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
|
||||
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MCFG_SCREEN_SIZE(256, 256)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 255, 32, 255)
|
||||
@ -416,7 +421,7 @@ static MACHINE_CONFIG_START( spaceg, spaceg_state )
|
||||
MCFG_VIDEO_UPDATE( spaceg )
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
// MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
// MCFG_SOUND_ADD("sn1", SN76496, 15468480/4)
|
||||
// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
@ -452,6 +457,10 @@ ROM_START( spaceg )
|
||||
ROM_LOAD( "14.8g", 0x3400, 0x0400, CRC(dc9a10c2) SHA1(8fb2316d6e8aeef558d0da5029e2932abf47a6b4) )
|
||||
ROM_LOAD( "15.9h", 0x3800, 0x0400, CRC(55e2950d) SHA1(2241c3620c9a6df8b8bd234ccee9af5d3d19a5d4) )
|
||||
ROM_LOAD( "16.8h", 0x3c00, 0x0400, CRC(567259c4) SHA1(b2c3f7aaceabea075af6a43b89fb7331732278c8) )
|
||||
|
||||
ROM_REGION( 0x40, "proms", 0 )
|
||||
ROM_LOAD( "prom1", 0x0000, 0x0020, NO_DUMP )
|
||||
ROM_LOAD( "prom2", 0x0020, 0x0020, NO_DUMP )
|
||||
ROM_END
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user