summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2012-07-28 18:32:30 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2012-07-28 18:32:30 +0000
commit3ae8987c2ce6a538dfcbf5ea73982794f2c8149f (patch)
tree579ecf2f42dc3899fb9fda1207bfd9862fc51eae
parent615ba7effac7850df74f80afffdc1e9ff34eef01 (diff)
Some improvements to Sky Destroyer, some gfxs are missing ...
-rw-r--r--src/mame/drivers/cyclemb.c206
1 files changed, 132 insertions, 74 deletions
diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c
index 8cc5c144046..54caa3cce78 100644
--- a/src/mame/drivers/cyclemb.c
+++ b/src/mame/drivers/cyclemb.c
@@ -170,15 +170,72 @@ static void cyclemb_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, co
}
}
+
+ /*
+ bank 1
+ xxxx xxxx [0] sprite offset
+ ---x xxxx [1] color offset
+ bank 2
+ xxxx xxxx [0] y offs
+ xxxx xxxx [1] x offs
+ bank 3
+ ---- ---x [1] sprite enable flag?
+ */
+static void cyclemb_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ cyclemb_state *state = screen.machine().driver_data<cyclemb_state>();
+ UINT8 flip_screen = state->flip_screen();
+ UINT8 col,fx,fy,region;
+ UINT16 spr_offs,i;
+ INT16 x,y;
+
+ /*
+ 0x3b-0x3c-0x3d tire (0x13 0x00 / 0x17 0x00 )
+ 0x3b- shirt (0x16 0x00)
+ 0x20 tire stick (0x16 0x00)
+ 0x2e go sign (0x11 0x00)
+ 0x18 trampoline (0x13 0x00)
+ 0x27 cone (0x13 0x00)
+ */
+
+ for(i=0;i<0x40;i+=2)
+ {
+ y = 0xf1 - state->m_obj2_ram[i];
+ x = state->m_obj2_ram[i+1] - 56;
+ spr_offs = (state->m_obj1_ram[i+0]);
+ col = (state->m_obj1_ram[i+1] & 0x3f);
+ region = ((state->m_obj3_ram[i] & 0x10) >> 4) + 1;
+ if(region == 2)
+ {
+ spr_offs >>= 2;
+ spr_offs += ((state->m_obj3_ram[i+0] & 3) << 5);
+ y-=16;
+ }
+
+ if(state->m_obj3_ram[i+1] & 1)
+ x+=256;
+ //if(state->m_obj3_ram[i+1] & 2)
+// x-=256;
+ fx = (state->m_obj3_ram[i+0] & 4) >> 2;
+ fy = (state->m_obj3_ram[i+0] & 8) >> 3;
+
+ if(flip_screen)
+ {
+ fx = !fx;
+ fy = !fy;
+ }
+ drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[region],spr_offs,col,fx,fy,x,y,0);
+ }
+}
+
+
static void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
cyclemb_state *state = screen.machine().driver_data<cyclemb_state>();
const gfx_element *gfx = screen.machine().gfx[0];
- int x,y,count;
+ int x,y;
UINT8 flip_screen = state->flip_screen();
- count = 0;
-
for (y=0;y<32;y++)
{
for (x=0;x<64;x++)
@@ -186,7 +243,7 @@ static void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, co
/* TODO: first two bytes appears to be scrolling for that line */
int attr = state->m_cram[x+y*64];
int tile = (state->m_vram[x+y*64]) | ((attr & 3)<<8);
- int color = ((attr & 0xf8) >> 3) + 0x20;
+ int color = ((attr & 0x7c) >> 2) ^ 0x1f;
int scrollx = 0;
if(flip_screen)
@@ -201,14 +258,11 @@ static void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, co
/* wrap-around */
drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,(x*8)-scrollx+512,(y*8));
}
-
- count++;
}
}
}
-
- /*
+/*
bank 1
xxxx xxxx [0] sprite offset
---x xxxx [1] color offset
@@ -217,8 +271,9 @@ static void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, co
xxxx xxxx [1] x offs
bank 3
---- ---x [1] sprite enable flag?
- */
-static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+*/
+
+static void skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
cyclemb_state *state = screen.machine().driver_data<cyclemb_state>();
UINT8 flip_screen = state->flip_screen();
@@ -226,35 +281,27 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect
UINT16 spr_offs,i;
INT16 x,y;
- /*
- 0x3b-0x3c-0x3d tire (0x13 0x00 / 0x17 0x00 )
- 0x3b- shirt (0x16 0x00)
- 0x20 tire stick (0x16 0x00)
- 0x2e go sign (0x11 0x00)
- 0x18 trampoline (0x13 0x00)
- 0x27 cone (0x13 0x00)
- */
-
for(i=0;i<0x40;i+=2)
{
- y = 0xf1 - state->m_obj2_ram[i];
- x = state->m_obj2_ram[i+1] - 56;
+ y = state->m_obj2_ram[i];
+ x = 0x100 - state->m_obj2_ram[i+1];
spr_offs = (state->m_obj1_ram[i+0]);
+ spr_offs += ((state->m_obj3_ram[i+0] & 3) << 8);
col = (state->m_obj1_ram[i+1] & 0x3f);
- region = ((state->m_obj3_ram[i] & 0x10) >> 4) + 1;
- if(region == 2)
- {
- spr_offs >>= 2;
- spr_offs += ((state->m_obj3_ram[i+0] & 3) << 5);
- y-=16;
- }
-
- if(state->m_obj3_ram[i+1] & 1)
- x+=256;
+ region = 1;//((state->m_obj3_ram[i] & 0x10) >> 4) + 1;
+ //if(region == 2)
+ //{
+ // spr_offs >>= 2;
+ // spr_offs += ((state->m_obj3_ram[i+0] & 3) << 5);
+ // x-=16;
+ //}
+
+ //if(state->m_obj3_ram[i+1] & 1)
+ // x+=256;
//if(state->m_obj3_ram[i+1] & 2)
// x-=256;
- fx = (state->m_obj3_ram[i+0] & 4) >> 2;
- fy = (state->m_obj3_ram[i+0] & 8) >> 3;
+ fx = 0;//(state->m_obj3_ram[i+0] & 4) >> 2;
+ fy = 0;//(state->m_obj3_ram[i+0] & 8) >> 3;
if(flip_screen)
{
@@ -268,14 +315,14 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect
static SCREEN_UPDATE_IND16( cyclemb )
{
cyclemb_draw_tilemap(screen,bitmap,cliprect);
- draw_sprites(screen,bitmap,cliprect);
+ cyclemb_draw_sprites(screen,bitmap,cliprect);
return 0;
}
static SCREEN_UPDATE_IND16( skydest )
{
skydest_draw_tilemap(screen,bitmap,cliprect);
- draw_sprites(screen,bitmap,cliprect);
+ skydest_draw_sprites(screen,bitmap,cliprect);
return 0;
}
@@ -343,13 +390,12 @@ static READ8_HANDLER( skydest_8741_0_r )
{
if(offset == 1) //status port
{
- printf("STATUS PC=%04x\n",cpu_get_pc(&space->device()));
+ //printf("STATUS PC=%04x\n",cpu_get_pc(&space->device()));
return 1;
}
else
{
- printf("READ PC=%04x\n",cpu_get_pc(&space->device()));
if(skydest_mcu.rst)
{
/* FIXME: mame rands are supposedly parity checks or signals that the i8741 sends to the main z80 for telling him what kind of input
@@ -359,6 +405,7 @@ static READ8_HANDLER( skydest_8741_0_r )
{
case 0x554: skydest_mcu.rxd = ((space->machine().root_device().ioport("DSW1")->read() & 0x1f) << 2); break;
case 0x583:
+ case 0x3b9:
{
static UINT8 mux_r;
mux_r^=0x20;
@@ -368,9 +415,11 @@ static READ8_HANDLER( skydest_8741_0_r )
skydest_mcu.rxd = ((space->machine().root_device().ioport("IN0")->read()) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
}
break;
- case 0x3b9:
- skydest_mcu.rxd = space->machine().rand();
+ default:
+ printf("READ PC=%04x\n",cpu_get_pc(&space->device()));
break;
+ // skydest_mcu.rxd = space->machine().rand();
+ // break;
}
}
@@ -382,7 +431,7 @@ static WRITE8_HANDLER( skydest_8741_0_w )
{
if(offset == 1) //command port
{
- printf("%02x CMD PC=%04x\n",data,cpu_get_pc(&space->device()));
+ //printf("%02x CMD PC=%04x\n",data,cpu_get_pc(&space->device()));
switch(data)
{
case 0:
@@ -415,7 +464,7 @@ static WRITE8_HANDLER( skydest_8741_0_w )
}
else
{
- printf("%02x DATA PC=%04x\n",data,cpu_get_pc(&space->device()));
+ //printf("%02x DATA PC=%04x\n",data,cpu_get_pc(&space->device()));
skydest_mcu.txd = data;
}
@@ -449,30 +498,30 @@ static MACHINE_RESET( cyclemb )
static INPUT_PORTS_START( cyclemb )
PORT_START("IN0")
- PORT_DIPNAME( 0x01, 0x01, "IN0" )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x01, 0x00, "IN0" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( On ) )
+ PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( On ) )
+ PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( On ) )
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN1")
PORT_DIPNAME( 0x01, 0x01, "IN1" )
@@ -791,15 +840,24 @@ ROM_START( skydest )
ROM_REGION( 0x4000, "tilemap_data", 0 )
ROM_LOAD( "pd0-20.1h", 0x000000, 0x004000, CRC(8b2137f2) SHA1(1f83e081cab116c69a8349fd33ba1916b1c91826) )
- ROM_REGION( 0x2000, "sprite_data_1", ROMREGION_ERASEFF )
- ROM_LOAD( "pd0-7.1k", 0x000000, 0x002000, CRC(83137d42) SHA1(7e35f28577d6bfeee184a0ac3095b478999d6477) )
-
- ROM_REGION( 0xc000, "sprite_data_2", ROMREGION_ERASEFF )
- ROM_LOAD( "pd0-11.1r", 0x000000, 0x002000, CRC(29e5fce4) SHA1(59748e3a192a45dce7920e8d5a7a11d5145915b0) )
- ROM_LOAD( "pd1-13.1t", 0x002000, 0x002000, CRC(3cca5b95) SHA1(74baec7c128254c394dd3162df7abacf5ed5a99b) )
- ROM_LOAD( "pd1-10.1n", 0x004000, 0x002000, CRC(5840b5b5) SHA1(1b5b188023c4d3198402c946b8c5a51d7f512a07) )
- ROM_LOAD( "pd0-12.1s", 0x006000, 0x002000, CRC(06234942) SHA1(1cc40a8c8e24ab6db1dc7dc88979be23b7a9cab6) )
- ROM_LOAD( "pd0-14.1u", 0x008000, 0x002000, CRC(7ef05b01) SHA1(f36ad1c0dac201729def78dc18feacda8fcf1a3f) )
+ ROM_REGION( 0x10000, "sprite_data_1", ROMREGION_ERASEFF ) // Note: sprite data for score points 80-99 are missing at very least
+ ROM_LOAD( "pd0-7.1k", 0x000000, 0x002000, BAD_DUMP CRC(83137d42) SHA1(7e35f28577d6bfeee184a0ac3095b478999d6477) )
+ ROM_RELOAD( 0x002000, 0x002000 )
+ ROM_LOAD( "pd1-10.1n", 0x006000, 0x002000, CRC(5840b5b5) SHA1(1b5b188023c4d3198402c946b8c5a51d7f512a07) )
+ ROM_LOAD( "pd0-12.1s", 0x00e000, 0x002000, CRC(06234942) SHA1(1cc40a8c8e24ab6db1dc7dc88979be23b7a9cab6) )
+ ROM_LOAD( "pd0-14.1u", 0x004000, 0x002000, CRC(7ef05b01) SHA1(f36ad1c0dac201729def78dc18feacda8fcf1a3f) )
+ ROM_LOAD( "pd0-11.1r", 0x008000, 0x002000, CRC(29e5fce4) SHA1(59748e3a192a45dce7920e8d5a7a11d5145915b0) ) //ok
+ ROM_LOAD( "pd1-13.1t", 0x00c000, 0x002000, CRC(3cca5b95) SHA1(74baec7c128254c394dd3162df7abacf5ed5a99b) ) //ok
+
+ ROM_REGION( 0x10000, "sprite_data_2", ROMREGION_ERASEFF )
+// ROM_COPY( "sprite_data_1", 0x0000, 0x0000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0x2000, 0x2000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0x4000, 0x4000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0x6000, 0x6000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0x8000, 0x8000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0xa000, 0xa000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0xc000, 0xc000, 0x2000 )
+// ROM_COPY( "sprite_data_1", 0xe000, 0xe000, 0x2000 )
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "green.11t", 0x000, 0x100, CRC(f803beb7) SHA1(9c979a296de04728d43c94e9e06f8d8600dc9cfb) )