summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/metlfrzr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/metlfrzr.cpp')
-rw-r--r--src/mame/drivers/metlfrzr.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/mame/drivers/metlfrzr.cpp b/src/mame/drivers/metlfrzr.cpp
index 3dc524f2e55..aa5ba6bc640 100644
--- a/src/mame/drivers/metlfrzr.cpp
+++ b/src/mame/drivers/metlfrzr.cpp
@@ -2,18 +2,18 @@
// copyright-holders:Angelo Salese
/****************************************
- Metal Freezer (c) 1989 Seibu
-
- preliminary driver by Angelo Salese
-
- HW seems the natural evolution of Dark Mist type.
-
- TODO:
- - Video registers needs better understanding.
- - Nuke legacy video code and re-do it by using tilemap system.
- - sprites are ahead of 1/2 frames;
- - Writes at 0xb800-0xbfff at attract mode gameplay demo transition?
- - DIPs need work - Flip Screen does not function. Still playable
+ Metal Freezer (c) 1989 Seibu
+
+ preliminary driver by Angelo Salese
+
+ HW seems the natural evolution of Dark Mist type.
+
+ TODO:
+ - Video registers needs better understanding.
+ - Nuke legacy video code and re-do it by using tilemap system.
+ - sprites are ahead of 1/2 frames;
+ - Writes at 0xb800-0xbfff at attract mode gameplay demo transition?
+ - DIPs need work - Flip Screen does not function. Still playable
****************************************/
@@ -64,12 +64,12 @@ void metlfrzr_state::video_start()
/*
- video regs format:
- [0x06] ---- --x- used during title screen transition, unknown purpose
- [0x06] ---- ---x
- [0x15] always 0?
- [0x16] always 0?
- [0x17] xxxx xxxx X scrolling base value
- Notice that it's currently unknown how the game is really supposed to NOT enable scrolling during gameplay.
+ [0x06] ---- --x- used during title screen transition, unknown purpose
+ [0x06] ---- ---x
+ [0x15] always 0?
+ [0x16] always 0?
+ [0x17] xxxx xxxx X scrolling base value
+ Notice that it's currently unknown how the game is really supposed to NOT enable scrolling during gameplay.
*/
void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
@@ -81,7 +81,7 @@ void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &clipre
UINT16 x_scroll_value;
x_scroll_value = m_video_regs[0x17] + ((m_video_regs[0x06] & 1) << 8);
x_scroll_base = (x_scroll_value >> 3) * 32;
-
+
for (count=0;count<32*33;count++)
{
int tile_base = count;
@@ -96,10 +96,10 @@ void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &clipre
tile_base &= vram_mask;
int x = (count / 32);
-
+
UINT16 tile = m_vram[tile_base*2+0] + ((m_vram[tile_base*2+1] & 0xf0) << 4);
UINT8 color = m_vram[tile_base*2+1] & 0xf;
-
+
gfx->transpen(bitmap,cliprect,tile,color,0,0,x*8-x_scroll_shift,y*8,0xf);
}
@@ -107,16 +107,16 @@ void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &clipre
/*
sprite DMA:
- 0xfe00-0xffff contains buffer for data to be copied.
- Sprites are currently lagging (noticeable during scrolling) therefore there must be either an automatic or manual trigger.
- Sprite seems to traverse from top to bottom priority-wise, other than that format is almost 1:1 with darkmist.cpp.
+ 0xfe00-0xffff contains buffer for data to be copied.
+ Sprites are currently lagging (noticeable during scrolling) therefore there must be either an automatic or manual trigger.
+ Sprite seems to traverse from top to bottom priority-wise, other than that format is almost 1:1 with darkmist.cpp.
sprite format:
- [0] tttt tttt tile number
- [1] x--- ---- if 1 sprite is disabled
- [1] -ttt ---- tile bank
- [1] ---- cccc palette number
- [2] yyyy yyyy Y offset
- [3] xxxx xxxx X offset
+ [0] tttt tttt tile number
+ [1] x--- ---- if 1 sprite is disabled
+ [1] -ttt ---- tile bank
+ [1] ---- cccc palette number
+ [2] yyyy yyyy Y offset
+ [3] xxxx xxxx X offset
*/
void metlfrzr_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
@@ -124,19 +124,19 @@ void metlfrzr_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr
gfx_element *gfx_3 = m_gfxdecode->gfx(3);
int count;
UINT8 *base_spriteram = m_work_ram + 0xe00;
-
+
for(count=0x200-4;count>-1;count-=4)
{
if(base_spriteram[count+1] & 0x80)
continue;
-
+
gfx_element *cur_gfx = base_spriteram[count+1] & 0x40 ? gfx_3 : gfx_2;
UINT8 tile_bank = (base_spriteram[count+1] & 0x30) >> 4;
UINT16 tile = base_spriteram[count] | (tile_bank << 8);
UINT8 color = base_spriteram[count+1] & 0xf;
int y = base_spriteram[count+2];
int x = base_spriteram[count+3];
-
+
cur_gfx->transpen(bitmap,cliprect,tile,color,0,0,x,y,0xf);
}
}
@@ -162,7 +162,7 @@ WRITE8_MEMBER(metlfrzr_state::output_w)
m_fg_tilebank = (data & 0x10) >> 4;
membank("bank1")->set_entry((data & 0xc) >> 2);
-// popmessage("%02x",data & 3);
+// popmessage("%02x",data & 3);
}
static ADDRESS_MAP_START( metlfrzr_map, AS_PROGRAM, 8, metlfrzr_state )
@@ -180,14 +180,14 @@ static ADDRESS_MAP_START( metlfrzr_map, AS_PROGRAM, 8, metlfrzr_state )
AM_RANGE(0xd603, 0xd603) AM_READ_PORT("DSW1")
AM_RANGE(0xd604, 0xd604) AM_READ_PORT("DSW2")
AM_RANGE(0xd600, 0xd61f) AM_RAM AM_SHARE("vregs") // TODO: write-only, debug
-
+
AM_RANGE(0xd700, 0xd700) AM_WRITE(output_w)
AM_RANGE(0xd710, 0xd710) AM_DEVWRITE("t5182", t5182_device, sound_irq_w)
AM_RANGE(0xd711, 0xd711) AM_DEVREAD("t5182", t5182_device, sharedram_semaphore_snd_r)
// following two do swapped access compared to darkmist
AM_RANGE(0xd712, 0xd712) AM_DEVWRITE("t5182", t5182_device, sharedram_semaphore_main_release_w)
AM_RANGE(0xd713, 0xd713) AM_DEVWRITE("t5182", t5182_device, sharedram_semaphore_main_acquire_w)
-
+
AM_RANGE(0xd800, 0xdfff) AM_RAM
AM_RANGE(0xe000, 0xefff) AM_RAM
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("wram")
@@ -240,7 +240,7 @@ static INPUT_PORTS_START( metlfrzr )
PORT_DIPNAME( 0x80, 0x80, "2-7" )
PORT_DIPSETTING( 0x80, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
-
+
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, "SYSA" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -264,7 +264,7 @@ static INPUT_PORTS_START( metlfrzr )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
+
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x00, "SYSB" )
@@ -313,7 +313,7 @@ static const gfx_layout tile_layout =
RGN_FRAC(1,1),
4,
{ STEP4(0,4) },
- { STEP4_INV(16,1), STEP4_INV(0,1) },
+ { STEP4_INV(16,1), STEP4_INV(0,1) },
{ STEP8(0,32) },
32*8
};
@@ -405,7 +405,7 @@ ROM_START(metlfrzr)
ROM_REGION(0x20000, "gfx3", 0)
ROM_LOAD16_BYTE("14.13a", 0x00001, 0x10000, CRC(a9cd5225) SHA1(f3d5e29ee08fb563fdc1af3c64128f2cd2feb987))
ROM_LOAD16_BYTE("16.11a", 0x00000, 0x10000, CRC(92f2cb49) SHA1(498021d94b0fde216207076491702af2324a2dcc))
-
+
ROM_REGION(0x20000, "gfx4", 0)
ROM_LOAD16_BYTE("15.12a", 0x00001, 0x10000, CRC(ce5c4c8b) SHA1(2351d66ba51e80097ce53bfd448ac24901844cda))
ROM_LOAD16_BYTE("17.10a", 0x00000, 0x10000, CRC(3fec33f7) SHA1(af086ba30fc4521a0114da2824f5baa04d225a89))