Hooked up 1414M4 emulation to Legion [Angelo Salese] (and fixed regression)

This commit is contained in:
Angelo Salese 2011-04-22 14:27:12 +00:00
parent 8e20a6df26
commit 48cb013faa
4 changed files with 146 additions and 160 deletions

View File

@ -257,8 +257,17 @@ static WRITE16_HANDLER( legion_io_w )
{ {
armedf_state *state = space->machine().driver_data<armedf_state>(); armedf_state *state = space->machine().driver_data<armedf_state>();
//if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition
// ... {
/* latch fg scroll values */
state->m_fg_scrollx = (state->m_text_videoram[0x0d] & 0xff) | ((state->m_text_videoram[0x0e] & 0x3) << 8);
state->m_fg_scrolly = (state->m_text_videoram[0x0b] & 0xff) | ((state->m_text_videoram[0x0c] & 0x3) << 8);
legion_mcu_exec(space,(state->m_text_videoram[0] << 8) | (state->m_text_videoram[1] & 0xff));
/* mark tiles dirty */
tilemap_mark_all_tiles_dirty(state->m_tx_tilemap);
}
COMBINE_DATA(&state->m_vreg); COMBINE_DATA(&state->m_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */ /* bits 0 and 1 of armedf_vreg are coin counters */
@ -365,7 +374,7 @@ static ADDRESS_MAP_START( legion_map, AS_PROGRAM, 16 )
AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2") AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2")
AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1") AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1")
AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2") AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2")
AM_RANGE(0x07c000, 0x07c001) AM_WRITE(legion_io_w) // AM_RANGE(0x07c000, 0x07c001) AM_WRITE(legion_io_w)
AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w)
AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w)
AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w) AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
@ -373,10 +382,20 @@ static ADDRESS_MAP_START( legion_map, AS_PROGRAM, 16 )
AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv2_ack_w) AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv2_ack_w)
ADDRESS_MAP_END ADDRESS_MAP_END
static WRITE8_HANDLER( legiono_fg_scroll_w )
{
armedf_state *state = space->machine().driver_data<armedf_state>();
if(offset >= 0xb && offset < 0xf)
state->m_legion_cmd[offset-0xb] = data & 0xff;
state->m_fg_scrollx = (state->m_legion_cmd[0x02] & 0xff) | ((state->m_legion_cmd[0x03] & 0x3) << 8);
state->m_fg_scrolly = (state->m_legion_cmd[0x00] & 0xff) | ((state->m_legion_cmd[0x01] & 0x3) << 8);
}
static ADDRESS_MAP_START( legiono_map, AS_PROGRAM, 16 ) static ADDRESS_MAP_START( legiono_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x040000, 0x04003f) AM_WRITE8(legiono_fg_scroll_w,0x00ff)
AM_RANGE(0x040000, 0x04003f) AM_WRITEONLY AM_BASE_MEMBER(armedf_state, m_legion_cmd) AM_RANGE(0x000000, 0x05ffff) AM_ROM
AM_RANGE(0x040040, 0x05ffff) AM_ROM
AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
AM_RANGE(0x061000, 0x063fff) AM_RAM AM_RANGE(0x061000, 0x063fff) AM_RAM
AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram) AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram)
@ -390,7 +409,7 @@ static ADDRESS_MAP_START( legiono_map, AS_PROGRAM, 16 )
AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2") AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2")
AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1") AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1")
AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2") AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2")
AM_RANGE(0x07c000, 0x07c001) AM_WRITE(bootleg_io_w) // AM_RANGE(0x07c000, 0x07c001) AM_WRITE(bootleg_io_w)
AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w)
AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w)
AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w) AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
@ -1186,7 +1205,7 @@ ROM_START( legion )
ROM_END ROM_END
ROM_START( legiono ) ROM_START( legiono )
ROM_REGION( 0x60000, "maincpu", 0 ) /* 64K*8 for 68000 code */ ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */
ROM_LOAD16_BYTE( "legion.1a", 0x000001, 0x010000, CRC(8c0cda1d) SHA1(14b93d4fb4381ebc6a4ccdb480089bf69c6f474b) ) ROM_LOAD16_BYTE( "legion.1a", 0x000001, 0x010000, CRC(8c0cda1d) SHA1(14b93d4fb4381ebc6a4ccdb480089bf69c6f474b) )
ROM_LOAD16_BYTE( "legion.1c", 0x000000, 0x010000, CRC(21226660) SHA1(ee48812d6ec9d4dccc58684164916f91b71aabf2) ) ROM_LOAD16_BYTE( "legion.1c", 0x000000, 0x010000, CRC(21226660) SHA1(ee48812d6ec9d4dccc58684164916f91b71aabf2) )
ROM_LOAD16_BYTE( "legion.1b", 0x020001, 0x010000, CRC(c306660a) SHA1(31c6b868ba07677b5110c577335873354bff596f) ) ROM_LOAD16_BYTE( "legion.1b", 0x020001, 0x010000, CRC(c306660a) SHA1(31c6b868ba07677b5110c577335873354bff596f) )
@ -1605,6 +1624,8 @@ static DRIVER_INIT( legion )
RAM[0x000488 / 2] = 0x4e71; RAM[0x000488 / 2] = 0x4e71;
#endif #endif
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(legion_io_w) );
state->m_scroll_type = 3; state->m_scroll_type = 3;
} }
@ -1619,7 +1640,9 @@ static DRIVER_INIT( legiono )
/* No need to patch the checksum routine (see notes) ! */ /* No need to patch the checksum routine (see notes) ! */
#endif #endif
state->m_scroll_type = 6; machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(bootleg_io_w) );
state->m_scroll_type = 3;
} }
static DRIVER_INIT( cclimbr2 ) static DRIVER_INIT( cclimbr2 )
@ -1636,8 +1659,8 @@ static DRIVER_INIT( cclimbr2 )
*************************************/ *************************************/
/* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */
GAME( 1987, legion, 0, legion, legion, legion, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (ver 2.03)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) GAME( 1987, legion, 0, legion, legion, legion, ROT270, "Nichibutsu", "Legion - Spinner-87 (World ver 2.03)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
GAME( 1987, legiono, legion, legiono, legion, legiono, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (ver 1.05)", GAME_SUPPORTS_SAVE ) /* bootleg? */ GAME( 1987, legiono, legion, legiono, legion, legiono, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (Japan bootleg ver 1.05)", GAME_SUPPORTS_SAVE ) /* bootleg? */
GAME( 1987, terraf, 0, terraf, terraf, terraf, ROT0, "bootleg", "Terra Force (bootleg)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) //world bootleg? GAME( 1987, terraf, 0, terraf, terraf, terraf, ROT0, "bootleg", "Terra Force (bootleg)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) //world bootleg?
GAME( 1987, terrafb, terraf, terrafb, terraf, terrafb, ROT0, "bootleg", "Terra Force (Japan bootleg with additional Z80)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) GAME( 1987, terrafb, terraf, terrafb, terraf, terrafb, ROT0, "bootleg", "Terra Force (Japan bootleg with additional Z80)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
GAME( 1987, terrafu, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) GAME( 1987, terrafu, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )

View File

@ -9,7 +9,7 @@ public:
UINT16 * m_text_videoram; UINT16 * m_text_videoram;
UINT16 * m_bg_videoram; UINT16 * m_bg_videoram;
UINT16 * m_fg_videoram; UINT16 * m_fg_videoram;
UINT16 * m_legion_cmd; // legion only! UINT16 m_legion_cmd[4]; // legiono only!
// UINT16 * m_spriteram; // currently this uses generic buffered_spriteram // UINT16 * m_spriteram; // currently this uses generic buffered_spriteram
// UINT16 * m_paletteram; // currently this uses generic palette handling // UINT16 * m_paletteram; // currently this uses generic palette handling
@ -50,3 +50,4 @@ WRITE16_HANDLER( armedf_bg_scrolly_w );
void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd); void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd);
void kozure_mcu_exec(address_space *space,UINT16 mcu_cmd); void kozure_mcu_exec(address_space *space,UINT16 mcu_cmd);
void legion_mcu_exec(address_space *space,UINT16 mcu_cmd);

View File

@ -8,9 +8,10 @@ This is some fancy MCU / blitter that copies text strings in various Nihon Bussa
TODO: TODO:
- Device-ify this; - Device-ify this;
- merge implementations
Notes: Notes:
- just before any string in the "MCU" rom, there's an offset, it indicates where the string should go in the tilemap. - Just before any string in the "MCU" rom, there's an offset, it indicates where the string should go in the tilemap.
This is currently hard-coded in this handling; This is currently hard-coded in this handling;
- I'm sure that this is a shared device, that shares everything. All of the known differences are due of not - I'm sure that this is a shared device, that shares everything. All of the known differences are due of not
understood features of the chip (some bytes in the ROM etc.) understood features of the chip (some bytes in the ROM etc.)
@ -28,11 +29,29 @@ static void terrafu_sm_transfer(address_space *space,UINT16 src,UINT16 dst,UINT1
for(i=0;i<size;i++) for(i=0;i<size;i++)
{ {
if(i+dst+0x000 < 18)
continue;
state->m_text_videoram[i+dst+0x000] = (condition) ? (data[i+(0)+src] & 0xff) : 0x20; state->m_text_videoram[i+dst+0x000] = (condition) ? (data[i+(0)+src] & 0xff) : 0x20;
state->m_text_videoram[i+dst+0x400] = data[i+(size)+src] & 0xff; state->m_text_videoram[i+dst+0x400] = data[i+(size)+src] & 0xff;
} }
} }
static void legion_layer_clear(address_space *space,UINT16 dst,UINT16 size)
{
armedf_state *state = space->machine().driver_data<armedf_state>();
int i;
for(i=0;i<size;i++)
{
if(i+dst+0x000 < 18)
continue;
state->m_text_videoram[i+dst+0x000] = 0x20;
state->m_text_videoram[i+dst+0x400] = 0x00;
}
}
static void terrafu_sm_onoff(address_space *space,UINT16 dst,UINT8 condition) static void terrafu_sm_onoff(address_space *space,UINT16 dst,UINT8 condition)
{ {
armedf_state *state = space->machine().driver_data<armedf_state>(); armedf_state *state = space->machine().driver_data<armedf_state>();
@ -72,13 +91,17 @@ static void insert_coin_msg(address_space *space)
} }
} }
static void credit_msg(address_space *space, UINT8 tile_base,UINT8 pal_base) static void credit_msg(address_space *space)
{ {
armedf_state *state = space->machine().driver_data<armedf_state>(); armedf_state *state = space->machine().driver_data<armedf_state>();
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base(); UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
int i; int i;
int credit_count = (state->m_text_videoram[0xf] & 0xff); int credit_count = (state->m_text_videoram[0xf] & 0xff);
UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */ UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
UINT8 tile_base, pal_base;
tile_base = data[0x47];
pal_base = data[0x48];
for(i=0;i<0x10;i++) for(i=0;i<0x10;i++)
{ {
@ -219,42 +242,35 @@ static void service_mode(address_space *space, UINT8 is2p)
void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd) void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
{ {
armedf_state *state = space->machine().driver_data<armedf_state>(); switch(mcu_cmd & 0xff00)
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
int i;
switch(mcu_cmd)
{ {
case 0x0e00:
break;
case 0x0e1c: /* gameplay, unknown ... */
break;
case 0x0e80: /* attract demo */
insert_coin_msg(space);
credit_msg(space,0x10,0x40);
for(i=0;i<0x10;i++) /* GAME OVER */
{
state->m_text_videoram[i+0x1a8+0x0000] = data[i+0x00+0x0135] & 0xff;
state->m_text_videoram[i+0x1a8+0x0400] = data[i+0x10+0x0135] & 0xff;
}
break;
case 0x0000: /* title screen / continue */ case 0x0000: /* title screen / continue */
insert_coin_msg(space); insert_coin_msg(space);
credit_msg(space,0x10,0x40); credit_msg(space);
break; break;
case 0x0280: /* layer clearances */
case 0x0282: case 0x0200:
terrafu_sm_transfer(space,0x2800,0x0000,0x400,1); switch(mcu_cmd & 0xff)
{
case 0x80: case 0x82: terrafu_sm_transfer(space,0x2800,0x0000,0x400,1); break; /* layer clearance */
case 0x00: case 0x01: case 0x02: terrafu_sm_transfer(space,0x2000,0x0000,0x400,1); break; /* Nichibutsu logo */
case 0x06: case 0x86: terrafu_sm_transfer(space,0x3800,0x0000,0x400,1); break; /* ranking screen */
default: popmessage("1414M4 layer clearance param %02x, contact MAMEdev",mcu_cmd & 0xff); break;
}
break; break;
case 0x0200: /* Nichibutsu logo */ case 0x0600: /* service mode */
case 0x0201:
terrafu_sm_transfer(space,0x2000,0x0000,0x400,1);
break;
case 0x600: /* service mode */
case 0x601:
service_mode(space,mcu_cmd & 1); service_mode(space,mcu_cmd & 1);
break; break;
case 0x0e00:
if(!(mcu_cmd & 4))
{
insert_coin_msg(space);
credit_msg(space);
terrafu_sm_transfer(space,0x0135,0x01a8,0x10,!(mcu_cmd & 1)); /* game over */
}
break;
//default: //default:
//printf("%04x\n",mcu_cmd); //printf("%04x\n",mcu_cmd);
} }
@ -262,45 +278,29 @@ void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
void kozure_mcu_exec(address_space *space,UINT16 mcu_cmd) void kozure_mcu_exec(address_space *space,UINT16 mcu_cmd)
{ {
switch(mcu_cmd) switch(mcu_cmd & 0xff00)
{ {
case 0x0000: /* title screen / continue */ case 0x0000: /* title screen / continue */
insert_coin_msg(space); insert_coin_msg(space);
credit_msg(space,0x30,0x30); credit_msg(space);
break; break;
case 0x0280: /* layer clearances */ case 0x0200: /* layer clearances */
case 0x0282: switch(mcu_cmd & 0xff)
terrafu_sm_transfer(space,0x2800,0x0000,0x400,1); {
case 0x80: case 0x82: terrafu_sm_transfer(space,0x2800,0x0000,0x400,1); break; /* layer clearance */
case 0x00: case 0x01: case 0x02: terrafu_sm_transfer(space,0x2000,0x0000,0x400,1); break; /* Nichibutsu logo */
case 0x06: case 0x86: terrafu_sm_transfer(space,0x3800,0x0000,0x400,1); break; /* ranking screen */
default: popmessage("1414M4 DMA param %02x, contact MAMEdev",mcu_cmd & 0xff); break;
}
break; break;
case 0x0200: /* Nichibutsu logo */ case 0x0600:
case 0x0201: service_mode(space,mcu_cmd & 1);
terrafu_sm_transfer(space,0x2000,0x0000,0x400,1);
break; break;
case 0x206: /* ranking screen */ case 0x0e00: /* 1p / hi-score msg / 2p + points */
case 0x286:
terrafu_sm_transfer(space,0x3800,0x0000,0x400,1);
//if(mcu_cmd & 0x80)
// credit_msg(space,0x30,0x30);
break;
case 0xe1c: /* 1p / hi-score msg / 2p + points */
case 0xe1d:
case 0xe9c:
case 0xe9d:
case 0xe9e:
case 0xe98:
case 0xe18:
case 0xe19:
case 0xe14:
case 0xe15:
case 0xe94:
case 0xe95:
case 0xe96:
case 0xe99:
case 0xe9a:
terrafu_sm_transfer(space,0x00e1,0x03ac,8,1); /* hi-score */ terrafu_sm_transfer(space,0x00e1,0x03ac,8,1); /* hi-score */
if(mcu_cmd & 0x04) if(mcu_cmd & 0x04)
{ {
@ -320,11 +320,57 @@ void kozure_mcu_exec(address_space *space,UINT16 mcu_cmd)
} }
break; break;
case 0x600: //default:
case 0x601: // printf("%04x\n",mcu_cmd);
}
}
void legion_mcu_exec(address_space *space,UINT16 mcu_cmd)
{
switch(mcu_cmd & 0xff00)
{
case 0x0000: /* title screen / continue */
insert_coin_msg(space);
credit_msg(space);
break;
case 0x0200: /* layer clearances */
switch(mcu_cmd & 0xff)
{
case 0x00: legion_layer_clear(space,0x0000,0x400); break;
case 0x01: terrafu_sm_transfer(space,0x2000,0x0000,0x400,1); break;
case 0x06: terrafu_sm_transfer(space,0x3800,0x0000,0x400,1); break; /* portraits */
case 0x82: terrafu_sm_transfer(space,0x2800,0x0000,0x400,1); break;
case 0x87: terrafu_sm_transfer(space,0x3000,0x0000,0x400,1); break; /* service mode? */
default: popmessage("1414M4 DMA param %02x, contact MAMEdev",mcu_cmd & 0xff); break;
}
break;
case 0x0600:
service_mode(space,mcu_cmd & 1); service_mode(space,mcu_cmd & 1);
break; break;
case 0x0e00: /* 1p / hi-score msg / 2p + points */
terrafu_sm_transfer(space,0x00e1,0x080c,8,1); /* hi-score */
if(mcu_cmd & 0x04)
{
terrafu_sm_transfer(space,0x00fd,0x03a0,8,!(mcu_cmd & 1)); /* 1p-msg */
//kozure_score_msg(space,0x380,0); /* 1p score */
if(mcu_cmd & 0x80)
{
terrafu_sm_transfer(space,0x0119,0x03b8,8,!(mcu_cmd & 2)); /* 2p-msg */
//kozure_score_msg(space,0x398,1); /* 2p score */
}
}
else
{
terrafu_sm_transfer(space,0x0135,0x0128,0x10,!(mcu_cmd & 1)); /* game over */
insert_coin_msg(space);
//credit_msg(space,0x30,0x30);
}
break;
//default: //default:
// printf("%04x\n",mcu_cmd); // printf("%04x\n",mcu_cmd);
} }

View File

@ -294,46 +294,6 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect
} }
} }
static void copy_textmap(running_machine &machine, int index)
{
/*
(not simulated)
1st half of the MCU ROM contains various strings and
gfx elements (copied by MCU to textram)
(partially simulated)
2nd half of the MCu external ROM contains text tilemaps:
4 - title screen
5 - bottom layer gfx, visible in later levels, during boss fight
6 - test mode screen (not hooked up)
7 - portraits (title)
*/
armedf_state *state = machine.driver_data<armedf_state>();
UINT8 * data = (UINT8 *)machine.region("gfx5")->base();
for(int i=0;i<0x400;++i)
{
if(i<0x10) continue;
int tile=data[0x800*index+i];
int bank=data[0x800*index+i+0x400]&3;
if( (tile|(bank<<8))!=0x20)
{
state->m_text_videoram[i]=tile;
state->m_text_videoram[i+0x400]=data[0x800*index+i+0x400];
}
}
tilemap_mark_all_tiles_dirty(state->m_tx_tilemap);
}
SCREEN_UPDATE( armedf ) SCREEN_UPDATE( armedf )
{ {
armedf_state *state = screen->machine().driver_data<armedf_state>(); armedf_state *state = screen->machine().driver_data<armedf_state>();
@ -343,31 +303,10 @@ SCREEN_UPDATE( armedf )
tilemap_set_enable(state->m_fg_tilemap, state->m_vreg & 0x400); tilemap_set_enable(state->m_fg_tilemap, state->m_vreg & 0x400);
tilemap_set_enable(state->m_tx_tilemap, state->m_vreg & 0x100); tilemap_set_enable(state->m_tx_tilemap, state->m_vreg & 0x100);
if ((state->m_scroll_type == 3 ))
{
if (state->m_old_mcu_mode != state->m_vreg)
{
if ((state->m_vreg & 0x000f) == 0x0004)
{ // transparent tx
tilemap_set_transparent_pen(state->m_tx_tilemap, 0x0f);
tilemap_mark_all_tiles_dirty(state->m_tx_tilemap);
//logerror("? Transparent TX 0x0f\n");
}
if ((state->m_vreg & 0x000f) == 0x000f)
{ // opaque tx
tilemap_set_transparent_pen(state->m_tx_tilemap, 0x10);
tilemap_mark_all_tiles_dirty(state->m_tx_tilemap);
//logerror("? Opaque TX\n");
}
state->m_old_mcu_mode = state->m_vreg;
//logerror("MCU Change => %04x\n", state->m_mcu_mode);
}
}
switch (state->m_scroll_type) switch (state->m_scroll_type)
{ {
case 0: /* terra force, kozure ookami */ case 0: /* terra force, kozure ookami */
case 3: /* legion */
tilemap_set_scrollx(state->m_fg_tilemap, 0, (state->m_fg_scrollx & 0x3ff)); tilemap_set_scrollx(state->m_fg_tilemap, 0, (state->m_fg_scrollx & 0x3ff));
tilemap_set_scrolly(state->m_fg_tilemap, 0, (state->m_fg_scrolly & 0x3ff)); tilemap_set_scrolly(state->m_fg_tilemap, 0, (state->m_fg_scrolly & 0x3ff));
break; break;
@ -377,11 +316,6 @@ SCREEN_UPDATE( armedf )
tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fg_scrolly); tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fg_scrolly);
break; break;
case 6: /* legiono */
tilemap_set_scrollx(state->m_fg_tilemap, 0, (state->m_legion_cmd[13] & 0xff) | ((state->m_legion_cmd[14] & 0x3) << 8));
tilemap_set_scrolly(state->m_fg_tilemap, 0, (state->m_legion_cmd[11] & 0xff) | ((state->m_legion_cmd[12] & 0x3) << 8));
break;
case 3:
case 4: /* crazy climber 2 */ case 4: /* crazy climber 2 */
{ {
int scrollx, scrolly; int scrollx, scrolly;
@ -440,24 +374,6 @@ SCREEN_UPDATE( armedf )
if (sprite_enable) if (sprite_enable)
draw_sprites(screen->machine(), bitmap, cliprect, 0); draw_sprites(screen->machine(), bitmap, cliprect, 0);
if(state->m_scroll_type == 3) /* legion */
{
int mode=state->m_text_videoram[1]&0xff;
if (mode != state->m_oldmode)
{
state->m_oldmode=mode;
switch(mode)
{
case 0x01: copy_textmap(screen->machine(), 4); break; /* title screen */
case 0x06: copy_textmap(screen->machine(), 7); break; /* portraits on title screen */
case 0x1c: copy_textmap(screen->machine(), 5); break; /* bottom, in-game layer */
default: logerror("unknown mode %d\n", mode); break;
}
}
}
return 0; return 0;
} }