mirror of
https://github.com/holub/mame
synced 2025-05-13 17:38:21 +03:00
Hooked up text protection simulation to Kodure Ookami, allowing it to display scoring during gameplay and copyright screens [Angelo Salese]
This commit is contained in:
parent
e5ae0d5785
commit
4272555fb6
@ -221,20 +221,23 @@ static WRITE16_HANDLER( kodure_io_w )
|
||||
{
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
|
||||
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);
|
||||
|
||||
/* process the command */
|
||||
kodure_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);
|
||||
/* bits 0 and 1 of armedf_vreg are coin counters */
|
||||
/* bit 12 seems to handle screen flipping */
|
||||
flip_screen_set(space->machine(), state->m_vreg & 0x1000);
|
||||
|
||||
/* This is a temporary condition specification. */
|
||||
if (!(state->m_vreg & 0x0080))
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 0x1000; i++)
|
||||
{
|
||||
armedf_text_videoram_w(space,i, ' ', 0xffff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( bootleg_io_w )
|
||||
@ -294,7 +297,7 @@ static WRITE16_HANDLER( irq_lv2_ack_w )
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( terraf_map, AS_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x04ffff) AM_ROM
|
||||
AM_RANGE(0x000000, 0x05ffff) AM_ROM
|
||||
AM_RANGE(0x060000, 0x0603ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x060400, 0x063fff) AM_RAM
|
||||
AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram)
|
||||
@ -316,26 +319,12 @@ static ADDRESS_MAP_START( terraf_map, AS_PROGRAM, 16 )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( kodure_map, AS_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x05ffff) AM_ROM
|
||||
AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x061000, 0x063fff) AM_RAM
|
||||
AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE_MEMBER(armedf_state, m_text_videoram)
|
||||
AM_RANGE(0x06a000, 0x06a9ff) AM_RAM
|
||||
AM_RANGE(0x06c000, 0x06c9ff) AM_RAM
|
||||
AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE_MEMBER(armedf_state, m_fg_videoram)
|
||||
AM_RANGE(0x074000, 0x074fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE_MEMBER(armedf_state, m_bg_videoram)
|
||||
AM_RANGE(0x078000, 0x078001) AM_READ_PORT("P1")
|
||||
AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2")
|
||||
AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x07c000, 0x07c001) AM_WRITE(kodure_io_w)
|
||||
AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w)
|
||||
AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w)
|
||||
AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
|
||||
AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv1_ack_w)
|
||||
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITENOP /* watchdog? */
|
||||
AM_RANGE(0xffd000, 0xffd001) AM_WRITENOP /* ? */
|
||||
AM_RANGE(0x060400, 0x063fff) AM_RAM
|
||||
// AM_RANGE(0x07c000, 0x07c001) AM_WRITE(kodure_io_w)
|
||||
// AM_RANGE(0x0c0000, 0x0c0001) AM_WRITENOP /* watchdog? */
|
||||
// AM_RANGE(0xffd000, 0xffd001) AM_WRITENOP /* ? */
|
||||
AM_IMPORT_FROM( terraf_map )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( cclimbr2_map, AS_PROGRAM, 16 )
|
||||
@ -680,10 +669,10 @@ static INPUT_PORTS_START( kodure )
|
||||
PORT_DIPSETTING( 0x00, "50k then every 90k" )
|
||||
PORT_DIPSETTING( 0x0c, "Every 60k" )
|
||||
PORT_DIPSETTING( 0x04, "Every 90k" )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6")
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7")
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Easy ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:7" ) /* Listed as "Unused" */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" ) /* Listed as "Unused" */
|
||||
|
||||
PORT_MODIFY("DSW2")
|
||||
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:3,4")
|
||||
@ -694,6 +683,7 @@ static INPUT_PORTS_START( kodure )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( cclimbr2 )
|
||||
@ -957,7 +947,7 @@ static MACHINE_CONFIG_START( kodure, armedf_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
|
||||
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MCFG_SCREEN_SIZE(64*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
|
||||
MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 1*8, 31*8-1 ) // vertical res confirmed by a real HW video
|
||||
MCFG_SCREEN_UPDATE(armedf)
|
||||
MCFG_SCREEN_EOF(armedf)
|
||||
|
||||
@ -1223,7 +1213,7 @@ ROM_START( legiono )
|
||||
ROM_END
|
||||
|
||||
ROM_START( terraf )
|
||||
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64K*8 for 68000 code */
|
||||
ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */
|
||||
ROM_LOAD16_BYTE( "tf-014.6e", 0x00000, 0x10000, CRC(8e5f557f) SHA1(3462a58146c3f33bf8686adbd2ead25dae3804a8) )
|
||||
ROM_LOAD16_BYTE( "tf-011.6h", 0x00001, 0x10000, CRC(5320162a) SHA1(eaffafcaf146cdddb03f40f92ce23dfd096eb89e) )
|
||||
ROM_LOAD16_BYTE( "tf-013.4e", 0x20000, 0x10000, CRC(a86951e0) SHA1(804cc6f143993f5a9d5f3798e971d7abfe94c3a8) )
|
||||
@ -1287,7 +1277,7 @@ Company logo and copyright string removed.
|
||||
|
||||
|
||||
ROM_START( terrafb )
|
||||
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64K*8 for 68000 code */
|
||||
ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */
|
||||
ROM_LOAD16_BYTE( "tfb-8.bin", 0x00000, 0x10000, CRC(b11a6fa7) SHA1(7bb2b98be02d8913796a6d4fa20eed16226ce6b9) )
|
||||
ROM_LOAD16_BYTE( "tfb-3.bin", 0x00001, 0x10000, CRC(6c6aa7ed) SHA1(ee5fdeb5411034ce0fd1c883ee25bf1fe9a3ec52) )
|
||||
ROM_LOAD16_BYTE( "tfb-7.bin", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) )
|
||||
@ -1323,7 +1313,7 @@ ROM_END
|
||||
|
||||
|
||||
ROM_START( terrafu )
|
||||
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64K*8 for 68000 code */
|
||||
ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */
|
||||
ROM_LOAD16_BYTE( "tf-8.6e", 0x00000, 0x10000, CRC(fea6dd64) SHA1(682eae338ce14808f134897f594fae1c69e75a1a) )
|
||||
ROM_LOAD16_BYTE( "tf-3.6h", 0x00001, 0x10000, CRC(02f9d05a) SHA1(88985373bc3cffbc838e0b701ecd732a417975a1) )
|
||||
ROM_LOAD16_BYTE( "tf-7.4e", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) )
|
||||
@ -1357,7 +1347,7 @@ ROM_START( terrafu )
|
||||
ROM_END
|
||||
|
||||
ROM_START( terrafa )
|
||||
ROM_REGION( 0x60000, "maincpu", 0 ) /* 64K*8 for 68000 code */
|
||||
ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */
|
||||
ROM_LOAD16_BYTE( "8.6e", 0x00000, 0x10000, CRC(fd58fa06) SHA1(f1f5fbd153be5fd5669aada66134baedfeac5d32) )
|
||||
ROM_LOAD16_BYTE( "3.6h", 0x00001, 0x10000, CRC(54823a7d) SHA1(bdf67890428710470a622ea48383b3fae8de8cbd) )
|
||||
ROM_LOAD16_BYTE( "7.4e", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) )
|
||||
@ -1598,6 +1588,9 @@ static DRIVER_INIT( kodure )
|
||||
{
|
||||
armedf_state *state = machine.driver_data<armedf_state>();
|
||||
state->m_scroll_type = 2;
|
||||
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(kodure_io_w) );
|
||||
|
||||
}
|
||||
|
||||
static DRIVER_INIT( legion )
|
||||
|
@ -49,3 +49,4 @@ WRITE16_HANDLER( armedf_bg_scrollx_w );
|
||||
WRITE16_HANDLER( armedf_bg_scrolly_w );
|
||||
|
||||
void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd);
|
||||
void kodure_mcu_exec(address_space *space,UINT16 mcu_cmd);
|
||||
|
@ -1,13 +1,25 @@
|
||||
/***************************************************************
|
||||
/*******************************************************************************************************************
|
||||
|
||||
Text tilemap protection simulation for Armed Formation HW games
|
||||
|
||||
***************************************************************/
|
||||
Written by Angelo Salese, based on researches by Tomasz Slanina with Legion
|
||||
|
||||
TODO:
|
||||
- name of this device / MCU;
|
||||
|
||||
|
||||
Notes:
|
||||
- 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;
|
||||
- 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.)
|
||||
|
||||
********************************************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/armedf.h"
|
||||
|
||||
static void terrafu_sm_transfer(address_space *space,UINT16 src,UINT16 dst,UINT8 size)
|
||||
static void terrafu_sm_transfer(address_space *space,UINT16 src,UINT16 dst,UINT16 size, UINT8 condition)
|
||||
{
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
||||
@ -15,8 +27,8 @@ static void terrafu_sm_transfer(address_space *space,UINT16 src,UINT16 dst,UINT8
|
||||
|
||||
for(i=0;i<size;i++)
|
||||
{
|
||||
state->m_text_videoram[i+dst+0x000] = data[i+0x0+src] & 0xff;
|
||||
state->m_text_videoram[i+dst+0x400] = data[i+0xc+src] & 0xff;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,19 +37,15 @@ static void terrafu_sm_onoff(address_space *space,UINT16 dst,UINT8 condition)
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
||||
int i;
|
||||
// char on_string[] = { "O", "N", " " };
|
||||
const UINT8 on_string[4] = { "ON " };
|
||||
|
||||
for(i=0;i<3;i++)
|
||||
{
|
||||
state->m_text_videoram[i+dst+0x000] = (condition) ? (data[i+0x0+0x316] & 0xff) : (on_string[i] & 0xff);
|
||||
state->m_text_videoram[i+dst+0x400] = 0x10;
|
||||
state->m_text_videoram[i+dst+0x000] = (condition) ? (data[i+0x0+0x316] & 0xff) : (data[i+0x0+0x310] & 0xff);
|
||||
state->m_text_videoram[i+dst+0x400] = (condition) ? (data[i+0x0+0x319] & 0xff) : (data[i+0x0+0x313] & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
/* Note: 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 */
|
||||
void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
static void insert_coin_msg(address_space *space)
|
||||
{
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
||||
@ -45,42 +53,6 @@ void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
int credit_count = (state->m_text_videoram[0xf] & 0xff);
|
||||
UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
|
||||
|
||||
switch(mcu_cmd)
|
||||
{
|
||||
case 0x0e00:
|
||||
break;
|
||||
case 0x0e1c: /* gameplay, unknown ... */
|
||||
break;
|
||||
case 0x0e80: /* attract demo */
|
||||
for(i=0;i<0x10;i++) /* CREDIT */
|
||||
{
|
||||
state->m_text_videoram[i+0x050+0x0000] = data[i+0x00+0x0025] & 0xff;
|
||||
state->m_text_videoram[i+0x050+0x0400] = data[i+0x10+0x0025] & 0xff;
|
||||
}
|
||||
state->m_text_videoram[0x05f+0x000] = ((credit_count) + 0x10);
|
||||
state->m_text_videoram[0x05f+0x400] = (0x40);
|
||||
|
||||
for(i=0;i<0x10;i++) /* INSERT COIN */
|
||||
{
|
||||
state->m_text_videoram[i+0x16a+0x0000] = (fl_cond) ? 0x20 : data[i+0x00+0x0003] & 0xff;
|
||||
state->m_text_videoram[i+0x16a+0x0400] = data[i+0x10+0x0003] & 0xff;
|
||||
}
|
||||
|
||||
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 */
|
||||
for(i=0;i<0x10;i++)
|
||||
{
|
||||
state->m_text_videoram[i+0x050+0x0000] = data[i+0x00+0x0025] & 0xff;
|
||||
state->m_text_videoram[i+0x050+0x0400] = data[i+0x10+0x0025] & 0xff;
|
||||
}
|
||||
state->m_text_videoram[0x05f+0x000] = (credit_count + 0x10);
|
||||
state->m_text_videoram[0x05f+0x400] = (0x40);
|
||||
|
||||
if(credit_count == 0)
|
||||
{
|
||||
for(i=0;i<0x10;i++) /* INSERT COIN */
|
||||
@ -97,6 +69,23 @@ void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
state->m_text_videoram[i+0x1a8+0x0400] = data[i+0x18+0x004b] & 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void credit_msg(address_space *space, UINT8 tile_base,UINT8 pal_base)
|
||||
{
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
||||
int i;
|
||||
int credit_count = (state->m_text_videoram[0xf] & 0xff);
|
||||
UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
|
||||
|
||||
for(i=0;i<0x10;i++)
|
||||
{
|
||||
state->m_text_videoram[i+0x050+0x0000] = data[i+0x00+0x0025] & 0xff;
|
||||
state->m_text_videoram[i+0x050+0x0400] = data[i+0x10+0x0025] & 0xff;
|
||||
}
|
||||
state->m_text_videoram[0x05f+0x000] = (credit_count + tile_base);
|
||||
state->m_text_videoram[0x05f+0x400] = (pal_base);
|
||||
|
||||
if(credit_count == 1)
|
||||
{
|
||||
@ -114,33 +103,54 @@ void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
state->m_text_videoram[i+0x168+0x0400] = data[i+0x18+0x00af] & 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0280: /* layer clearances */
|
||||
case 0x0282:
|
||||
for(i=0;i<0x400;i++)
|
||||
static void kodure_score_msg(address_space *space,UINT16 dst,UINT8 src_base)
|
||||
{
|
||||
state->m_text_videoram[i+0x000+0x0000] = data[i+0x000+0x2800] & 0xff;
|
||||
state->m_text_videoram[i+0x000+0x0400] = data[i+0x400+0x2800] & 0xff;
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
int i;
|
||||
UINT8 first_digit;
|
||||
UINT8 res;
|
||||
|
||||
first_digit = 0;
|
||||
|
||||
for(i=0;i<6;i++)
|
||||
{
|
||||
res = ((state->m_text_videoram[(i/2)+5+src_base*3] >> (!(i & 1) * 4)) & 0xf);
|
||||
|
||||
if(first_digit || res)
|
||||
{
|
||||
state->m_text_videoram[i+dst+0x0000] = res + 0x30;
|
||||
first_digit = 1;
|
||||
}
|
||||
break;
|
||||
case 0x0200: /* Nichibutsu logo */
|
||||
case 0x0201:
|
||||
for(i=0;i<0x400;i++)
|
||||
{
|
||||
state->m_text_videoram[i+0x000+0x0000] = data[i+0x000+0x2000] & 0xff;
|
||||
state->m_text_videoram[i+0x000+0x0400] = data[i+0x400+0x2000] & 0xff;
|
||||
else
|
||||
state->m_text_videoram[i+dst+0x0000] = 0x20;
|
||||
|
||||
state->m_text_videoram[i+dst+0x0400] = 0x10; // hardcoded in ROM
|
||||
}
|
||||
break;
|
||||
case 0x600: /* service mode */
|
||||
|
||||
state->m_text_videoram[6+dst+0x0000] = 0x30;
|
||||
state->m_text_videoram[6+dst+0x0400] = 0x10; // hardcoded in ROM
|
||||
state->m_text_videoram[7+dst+0x0000] = 0x30;
|
||||
state->m_text_videoram[7+dst+0x0400] = 0x10; // hardcoded in ROM
|
||||
|
||||
}
|
||||
|
||||
static void service_mode(address_space *space)
|
||||
{
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
||||
int i;
|
||||
|
||||
for(i=0;i<0x400;i++)
|
||||
{
|
||||
if((state->m_text_videoram[i+0x000+0x0000] & 0xff00) == 0xff00) /* uhm, avoids bonus awards overwrite? */
|
||||
if(i < 18 || i == 0x377 || i == 0x357) // params and digits for bonus lives doesn't get overwritten
|
||||
continue;
|
||||
|
||||
state->m_text_videoram[i+0x000+0x0000] = data[i+0x000+0x3000] & 0xff;
|
||||
state->m_text_videoram[i+0x000+0x0400] = data[i+0x400+0x3000] & 0xff;
|
||||
}
|
||||
|
||||
state->m_text_videoram[0x252+0x000] = ((state->m_text_videoram[0x11] & 0xf0) >> 4) + 0x30;
|
||||
state->m_text_videoram[0x253+0x000] = (state->m_text_videoram[0x11] & 0x0f) + 0x30;
|
||||
//state->m_text_videoram[0x252+0x400] = (0x40);
|
||||
@ -178,9 +188,9 @@ void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
state->m_text_videoram[0x3bb|0x000] = (state->m_text_videoram[7] & 0x7) + 0x30;
|
||||
//state->m_text_videoram[0x3bb|0x400] = (0x40);
|
||||
|
||||
terrafu_sm_transfer(space,0x1fa + (((state->m_text_videoram[7] & 0x30) >> 4) * 0x18),0x390,12);
|
||||
terrafu_sm_transfer(space,0x264 + (((state->m_text_videoram[7] & 0x80) >> 7) * 0x18),0x330,12);
|
||||
terrafu_sm_transfer(space,0x296 + (((state->m_text_videoram[7] & 0x40) >> 6) * 0x18),0x310,12);
|
||||
terrafu_sm_transfer(space,0x1fa + (((state->m_text_videoram[7] & 0x30) >> 4) * 0x18),0x390,12,1);
|
||||
terrafu_sm_transfer(space,0x264 + (((state->m_text_videoram[7] & 0x80) >> 7) * 0x18),0x330,12,1);
|
||||
terrafu_sm_transfer(space,0x296 + (((state->m_text_videoram[7] & 0x40) >> 6) * 0x18),0x310,12,1);
|
||||
|
||||
state->m_text_videoram[0x2ee|0x000] = ((state->m_text_videoram[0xf] & 0xf0) >> 4) + 0x30;
|
||||
//state->m_text_videoram[0x2ee|0x400] = (0x40);
|
||||
@ -198,9 +208,115 @@ void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
}
|
||||
|
||||
/* TODO: inputs layout? */
|
||||
}
|
||||
|
||||
void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
{
|
||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||
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 */
|
||||
insert_coin_msg(space);
|
||||
credit_msg(space,0x10,0x40);
|
||||
break;
|
||||
case 0x0280: /* layer clearances */
|
||||
case 0x0282:
|
||||
terrafu_sm_transfer(space,0x2800,0x0000,0x400,1);
|
||||
break;
|
||||
case 0x0200: /* Nichibutsu logo */
|
||||
case 0x0201:
|
||||
terrafu_sm_transfer(space,0x2000,0x0000,0x400,1);
|
||||
break;
|
||||
case 0x600: /* service mode */
|
||||
service_mode(space);
|
||||
break;
|
||||
//default:
|
||||
//printf("%04x\n",mcu_cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void kodure_mcu_exec(address_space *space,UINT16 mcu_cmd)
|
||||
{
|
||||
switch(mcu_cmd)
|
||||
{
|
||||
case 0x0000: /* title screen / continue */
|
||||
insert_coin_msg(space);
|
||||
credit_msg(space,0x30,0x30);
|
||||
break;
|
||||
|
||||
case 0x0280: /* layer clearances */
|
||||
case 0x0282:
|
||||
terrafu_sm_transfer(space,0x2800,0x0000,0x400,1);
|
||||
break;
|
||||
|
||||
case 0x0200: /* Nichibutsu logo */
|
||||
case 0x0201:
|
||||
terrafu_sm_transfer(space,0x2000,0x0000,0x400,1);
|
||||
break;
|
||||
|
||||
case 0x206: /* ranking screen */
|
||||
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 */
|
||||
if(mcu_cmd & 0x04)
|
||||
{
|
||||
terrafu_sm_transfer(space,0x00fd,0x03a0,8,!(mcu_cmd & 1)); /* 1p-msg */
|
||||
kodure_score_msg(space,0x380,0); /* 1p score */
|
||||
if(mcu_cmd & 0x80)
|
||||
{
|
||||
terrafu_sm_transfer(space,0x0119,0x03b8,8,!(mcu_cmd & 2)); /* 2p-msg */
|
||||
kodure_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;
|
||||
|
||||
case 0x600:
|
||||
service_mode(space);
|
||||
break;
|
||||
|
||||
//default:
|
||||
// printf("%04x\n",mcu_cmd);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user