mirror of
https://github.com/holub/mame
synced 2025-06-01 02:21:48 +03:00
Code refactoring, and fixed some bugs while at it
This commit is contained in:
parent
e8d94006bb
commit
e5ae0d5785
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3519,6 +3519,7 @@ src/mame/machine/ajax.c svneol=native#text/plain
|
|||||||
src/mame/machine/amiga.c svneol=native#text/plain
|
src/mame/machine/amiga.c svneol=native#text/plain
|
||||||
src/mame/machine/archimds.c svneol=native#text/plain
|
src/mame/machine/archimds.c svneol=native#text/plain
|
||||||
src/mame/machine/arkanoid.c svneol=native#text/plain
|
src/mame/machine/arkanoid.c svneol=native#text/plain
|
||||||
|
src/mame/machine/armedf.c svneol=native#text/plain
|
||||||
src/mame/machine/asic65.c svneol=native#text/plain
|
src/mame/machine/asic65.c svneol=native#text/plain
|
||||||
src/mame/machine/asic65.h svneol=native#text/plain
|
src/mame/machine/asic65.h svneol=native#text/plain
|
||||||
src/mame/machine/asteroid.c svneol=native#text/plain
|
src/mame/machine/asteroid.c svneol=native#text/plain
|
||||||
|
@ -181,212 +181,20 @@ static WRITE16_HANDLER( io_w )
|
|||||||
flip_screen_set(space->machine(), state->m_vreg & 0x1000);
|
flip_screen_set(space->machine(), state->m_vreg & 0x1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void terrafu_sm_transfer(address_space *space,UINT16 src,UINT16 dst,UINT8 size)
|
|
||||||
{
|
|
||||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
|
||||||
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
|
||||||
int i;
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
static 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;
|
|
||||||
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 */
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for(i=0;i<0x18;i++) /* PUSH START BUTTON (0x128? Gets wrong on the continue with this ...) */
|
|
||||||
{
|
|
||||||
state->m_text_videoram[i+0x1a8+0x0000] = data[i+0x00+0x004b] & 0xff;
|
|
||||||
state->m_text_videoram[i+0x1a8+0x0400] = data[i+0x18+0x004b] & 0xff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(credit_count == 1)
|
|
||||||
{
|
|
||||||
for(i=0;i<0x18;i++) /* ONE PLAYER ONLY */
|
|
||||||
{
|
|
||||||
state->m_text_videoram[i+0x168+0x0000] = (fl_cond) ? 0x20 : data[i+0x00+0x007d] & 0xff;
|
|
||||||
state->m_text_videoram[i+0x168+0x0400] = data[i+0x18+0x007d] & 0xff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(credit_count > 1)
|
|
||||||
{
|
|
||||||
for(i=0;i<0x18;i++) /* ONE OR TWO PLAYERS */
|
|
||||||
{
|
|
||||||
state->m_text_videoram[i+0x168+0x0000] = (fl_cond) ? 0x20 : data[i+0x00+0x00af] & 0xff;
|
|
||||||
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++)
|
|
||||||
{
|
|
||||||
state->m_text_videoram[i+0x000+0x0000] = data[i+0x000+0x2800] & 0xff;
|
|
||||||
state->m_text_videoram[i+0x000+0x0400] = data[i+0x400+0x2800] & 0xff;
|
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0x600: /* service mode */
|
|
||||||
for(i=0;i<0x400;i++)
|
|
||||||
{
|
|
||||||
if((state->m_text_videoram[i+0x000+0x0000] & 0xff00) == 0xff00) /* uhm, avoids bonus awards overwrite? */
|
|
||||||
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) + 0x10;
|
|
||||||
state->m_text_videoram[0x253+0x000] = (state->m_text_videoram[0x11] & 0x0f) + 0x10;
|
|
||||||
state->m_text_videoram[0x252+0x400] = (0x40);
|
|
||||||
state->m_text_videoram[0x253+0x400] = (0x40);
|
|
||||||
|
|
||||||
/*
|
|
||||||
[0x02] & 0x01 p1 up
|
|
||||||
[0x02] & 0x02 p1 down
|
|
||||||
[0x02] & 0x04 p1 left
|
|
||||||
[0x02] & 0x08 p1 right
|
|
||||||
[0x02] & 0x10 p1 button 1
|
|
||||||
[0x02] & 0x20 p1 button 2
|
|
||||||
[0x02] & 0x40 p1 button 3
|
|
||||||
[0x03] & 0x01 p2 up
|
|
||||||
[0x03] & 0x02 p2 down
|
|
||||||
[0x03] & 0x04 p2 left
|
|
||||||
[0x03] & 0x08 p2 right
|
|
||||||
[0x03] & 0x10 p2 button 1
|
|
||||||
[0x03] & 0x20 p2 button 2
|
|
||||||
[0x03] & 0x40 p2 button 3
|
|
||||||
[0x04] & 0x10 service
|
|
||||||
[0x04] & 0x04 coin A
|
|
||||||
[0x04] & 0x08 coin B
|
|
||||||
[0x04] & 0x01 start 1
|
|
||||||
[0x04] & 0x02 start 2
|
|
||||||
[0x05] DSW1
|
|
||||||
[0x06] DSW2
|
|
||||||
[0x07] & 0x40 demo sounds ON / OFF
|
|
||||||
[0x07] & 0x7 lives setting
|
|
||||||
[0x07] & 0x80 cabinet (upright / table)
|
|
||||||
[0x07] & 0x30 difficulty (easy / normal / hard / hardest)
|
|
||||||
[0x0f] coinage A
|
|
||||||
[0x10] coinage B
|
|
||||||
*/
|
|
||||||
state->m_text_videoram[0x3bb|0x000] = (state->m_text_videoram[7] & 0x7) + 0x10;
|
|
||||||
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);
|
|
||||||
|
|
||||||
state->m_text_videoram[0x2ee|0x000] = ((state->m_text_videoram[0xf] & 0xf0) >> 4) + 0x10;
|
|
||||||
state->m_text_videoram[0x2ee|0x400] = (0x40);
|
|
||||||
state->m_text_videoram[0x2f5|0x000] = ((state->m_text_videoram[0xf] & 0x0f) >> 0) + 0x10;
|
|
||||||
state->m_text_videoram[0x2f5|0x400] = (0x40);
|
|
||||||
state->m_text_videoram[0x2ce|0x000] = ((state->m_text_videoram[0x10] & 0xf0) >> 4) + 0x10;
|
|
||||||
state->m_text_videoram[0x2ce|0x400] = (0x40);
|
|
||||||
state->m_text_videoram[0x2d5|0x000] = ((state->m_text_videoram[0x10] & 0x0f) >> 0) + 0x10;
|
|
||||||
state->m_text_videoram[0x2d5|0x400] = (0x40);
|
|
||||||
|
|
||||||
for(i=0;i<8;i++) /* dips */
|
|
||||||
{
|
|
||||||
terrafu_sm_onoff(space,0x074 + (i * 0x20),(state->m_text_videoram[0x05] >> (7-i)) & 1);
|
|
||||||
terrafu_sm_onoff(space,0x079 + (i * 0x20),(state->m_text_videoram[0x06] >> (7-i)) & 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: inputs layout? */
|
|
||||||
|
|
||||||
break;
|
|
||||||
//default:
|
|
||||||
//printf("%04x\n",mcu_cmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static WRITE16_HANDLER( terraf_io_w )
|
static WRITE16_HANDLER( terraf_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, terrafu only?
|
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 */
|
||||||
terrafu_mcu_exec(space,(state->m_text_videoram[0] << 8) | (state->m_text_videoram[1] & 0xff));
|
terrafu_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);
|
tilemap_mark_all_tiles_dirty(state->m_tx_tilemap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,6 +237,32 @@ static WRITE16_HANDLER( kodure_io_w )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WRITE16_HANDLER( bootleg_io_w )
|
||||||
|
{
|
||||||
|
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||||
|
|
||||||
|
//if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition
|
||||||
|
// cputag_set_input_line(space->machine(), "extra", 0, HOLD_LINE);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
static WRITE16_HANDLER( legion_io_w )
|
||||||
|
{
|
||||||
|
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||||
|
|
||||||
|
//if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition
|
||||||
|
// ...
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
static WRITE16_HANDLER( sound_command_w )
|
static WRITE16_HANDLER( sound_command_w )
|
||||||
{
|
{
|
||||||
if (ACCESSING_BITS_0_7)
|
if (ACCESSING_BITS_0_7)
|
||||||
@ -451,16 +285,6 @@ static WRITE16_HANDLER( irq_lv2_ack_w )
|
|||||||
cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
|
cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef UNUSED_FUNCTION
|
|
||||||
static WRITE16_HANDLER( legion_command_c )
|
|
||||||
{
|
|
||||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
|
||||||
|
|
||||||
COMBINE_DATA(&state->m_legion_cmd[offset]);
|
|
||||||
//logerror("Legion CMD %04x=%04x", offset, data);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
@ -483,39 +307,12 @@ static ADDRESS_MAP_START( terraf_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(terraf_io_w)
|
// AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) handled in DRIVER_INIT
|
||||||
AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w)
|
|
||||||
AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w)
|
|
||||||
AM_RANGE(0x07c006, 0x07c007) AM_WRITE(terraf_fg_scrollx_w) /* not use in terrafu, 0x07c008 neither */
|
|
||||||
AM_RANGE(0x07c008, 0x07c009) AM_WRITE(terraf_fg_scrolly_w) /* written twice, lsb and msb */
|
|
||||||
AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
|
|
||||||
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
|
|
||||||
AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv1_ack_w)
|
|
||||||
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(terraf_fg_scroll_msb_arm_w) /* written between two consecutive writes to 7c008 */
|
|
||||||
ADDRESS_MAP_END
|
|
||||||
|
|
||||||
/* the same for now */
|
|
||||||
static ADDRESS_MAP_START( terrafb_map, AS_PROGRAM, 16 )
|
|
||||||
AM_RANGE(0x000000, 0x04ffff) 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)
|
|
||||||
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(terrafb_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)
|
||||||
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
|
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
|
||||||
AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv1_ack_w)
|
AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv1_ack_w)
|
||||||
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(terraf_fg_scroll_msb_arm_w) /* written between two consecutive writes to 7c008 */
|
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
static ADDRESS_MAP_START( kodure_map, AS_PROGRAM, 16 )
|
static ADDRESS_MAP_START( kodure_map, AS_PROGRAM, 16 )
|
||||||
@ -579,7 +376,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(terraf_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)
|
||||||
@ -604,7 +401,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(terraf_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)
|
||||||
@ -1092,7 +889,7 @@ static MACHINE_CONFIG_START( terrafb, armedf_state )
|
|||||||
|
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) // 8mhz?
|
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) // 8mhz?
|
||||||
MCFG_CPU_PROGRAM_MAP(terrafb_map)
|
MCFG_CPU_PROGRAM_MAP(terraf_map)
|
||||||
MCFG_CPU_VBLANK_INT("screen", irq1_line_assert)
|
MCFG_CPU_VBLANK_INT("screen", irq1_line_assert)
|
||||||
|
|
||||||
MCFG_CPU_ADD("audiocpu", Z80, XTAL_8MHz/2) // 4mhz?
|
MCFG_CPU_ADD("audiocpu", Z80, XTAL_8MHz/2) // 4mhz?
|
||||||
@ -1761,18 +1558,27 @@ static DRIVER_INIT( terraf )
|
|||||||
{
|
{
|
||||||
armedf_state *state = machine.driver_data<armedf_state>();
|
armedf_state *state = machine.driver_data<armedf_state>();
|
||||||
state->m_scroll_type = 0;
|
state->m_scroll_type = 0;
|
||||||
|
|
||||||
|
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(bootleg_io_w) );
|
||||||
|
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c006, 0x07c007, FUNC(terraf_fg_scrolly_w) );
|
||||||
|
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c008, 0x07c009, FUNC(terraf_fg_scrollx_w) );
|
||||||
|
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0c0001, FUNC(terraf_fg_scroll_msb_arm_w) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static DRIVER_INIT( terrafu )
|
static DRIVER_INIT( terrafu )
|
||||||
{
|
{
|
||||||
armedf_state *state = machine.driver_data<armedf_state>();
|
armedf_state *state = machine.driver_data<armedf_state>();
|
||||||
state->m_scroll_type = 5;
|
state->m_scroll_type = 0;
|
||||||
|
|
||||||
|
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terraf_io_w) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static DRIVER_INIT( terrafb )
|
static DRIVER_INIT( terrafb )
|
||||||
{
|
{
|
||||||
armedf_state *state = machine.driver_data<armedf_state>();
|
armedf_state *state = machine.driver_data<armedf_state>();
|
||||||
state->m_scroll_type = 7;
|
state->m_scroll_type = 0;
|
||||||
|
|
||||||
|
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terrafb_io_w) );
|
||||||
|
|
||||||
{
|
{
|
||||||
UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
|
UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
|
||||||
@ -1839,10 +1645,10 @@ 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", "Chouji Meikyuu Legion (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 (ver 1.05)", GAME_SUPPORTS_SAVE ) /* bootleg? */
|
||||||
GAME( 1987, terraf, 0, terraf, terraf, terraf, ROT0, "Nichibutsu", "Terra Force (set 1)", 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, terrafa, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu", "Terra Force (set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) //world?
|
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)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
|
GAME( 1987, terrafa, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) //world?
|
||||||
GAME( 1987, kodure, 0, kodure, kodure, kodure, ROT0, "Nichibutsu", "Kodure Ookami (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
|
GAME( 1987, kodure, 0, kodure, kodure, kodure, ROT0, "Nichibutsu", "Kodure Ookami (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
|
||||||
GAME( 1988, cclimbr2, 0, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan)", GAME_SUPPORTS_SAVE )
|
GAME( 1988, cclimbr2, 0, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan)", GAME_SUPPORTS_SAVE )
|
||||||
GAME( 1988, cclimbr2a,cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan, Harder)", GAME_SUPPORTS_SAVE )
|
GAME( 1988, cclimbr2a,cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan, Harder)", GAME_SUPPORTS_SAVE )
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class armedf_state : public driver_device
|
class armedf_state : public driver_device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -50,3 +47,5 @@ WRITE16_HANDLER( armedf_fg_scrollx_w );
|
|||||||
WRITE16_HANDLER( armedf_fg_scrolly_w );
|
WRITE16_HANDLER( armedf_fg_scrolly_w );
|
||||||
WRITE16_HANDLER( armedf_bg_scrollx_w );
|
WRITE16_HANDLER( armedf_bg_scrollx_w );
|
||||||
WRITE16_HANDLER( armedf_bg_scrolly_w );
|
WRITE16_HANDLER( armedf_bg_scrolly_w );
|
||||||
|
|
||||||
|
void terrafu_mcu_exec(address_space *space,UINT16 mcu_cmd);
|
||||||
|
206
src/mame/machine/armedf.c
Normal file
206
src/mame/machine/armedf.c
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
/***************************************************************
|
||||||
|
|
||||||
|
Text tilemap protection simulation for Armed Formation HW games
|
||||||
|
|
||||||
|
***************************************************************/
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
#include "includes/armedf.h"
|
||||||
|
|
||||||
|
static void terrafu_sm_transfer(address_space *space,UINT16 src,UINT16 dst,UINT8 size)
|
||||||
|
{
|
||||||
|
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||||
|
UINT8 * data = (UINT8 *)space->machine().region("gfx5")->base();
|
||||||
|
int i;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
{
|
||||||
|
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" */
|
||||||
|
|
||||||
|
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 */
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(i=0;i<0x18;i++) /* PUSH START BUTTON (0x128? Gets wrong on the continue with this ...) */
|
||||||
|
{
|
||||||
|
state->m_text_videoram[i+0x1a8+0x0000] = data[i+0x00+0x004b] & 0xff;
|
||||||
|
state->m_text_videoram[i+0x1a8+0x0400] = data[i+0x18+0x004b] & 0xff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(credit_count == 1)
|
||||||
|
{
|
||||||
|
for(i=0;i<0x18;i++) /* ONE PLAYER ONLY */
|
||||||
|
{
|
||||||
|
state->m_text_videoram[i+0x168+0x0000] = (fl_cond) ? 0x20 : data[i+0x00+0x007d] & 0xff;
|
||||||
|
state->m_text_videoram[i+0x168+0x0400] = data[i+0x18+0x007d] & 0xff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(credit_count > 1)
|
||||||
|
{
|
||||||
|
for(i=0;i<0x18;i++) /* ONE OR TWO PLAYERS */
|
||||||
|
{
|
||||||
|
state->m_text_videoram[i+0x168+0x0000] = (fl_cond) ? 0x20 : data[i+0x00+0x00af] & 0xff;
|
||||||
|
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++)
|
||||||
|
{
|
||||||
|
state->m_text_videoram[i+0x000+0x0000] = data[i+0x000+0x2800] & 0xff;
|
||||||
|
state->m_text_videoram[i+0x000+0x0400] = data[i+0x400+0x2800] & 0xff;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0x600: /* service mode */
|
||||||
|
for(i=0;i<0x400;i++)
|
||||||
|
{
|
||||||
|
if((state->m_text_videoram[i+0x000+0x0000] & 0xff00) == 0xff00) /* uhm, avoids bonus awards overwrite? */
|
||||||
|
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);
|
||||||
|
//state->m_text_videoram[0x253+0x400] = (0x40);
|
||||||
|
|
||||||
|
/*
|
||||||
|
[0x02] & 0x01 p1 up
|
||||||
|
[0x02] & 0x02 p1 down
|
||||||
|
[0x02] & 0x04 p1 left
|
||||||
|
[0x02] & 0x08 p1 right
|
||||||
|
[0x02] & 0x10 p1 button 1
|
||||||
|
[0x02] & 0x20 p1 button 2
|
||||||
|
[0x02] & 0x40 p1 button 3
|
||||||
|
[0x03] & 0x01 p2 up
|
||||||
|
[0x03] & 0x02 p2 down
|
||||||
|
[0x03] & 0x04 p2 left
|
||||||
|
[0x03] & 0x08 p2 right
|
||||||
|
[0x03] & 0x10 p2 button 1
|
||||||
|
[0x03] & 0x20 p2 button 2
|
||||||
|
[0x03] & 0x40 p2 button 3
|
||||||
|
[0x04] & 0x10 service
|
||||||
|
[0x04] & 0x04 coin A
|
||||||
|
[0x04] & 0x08 coin B
|
||||||
|
[0x04] & 0x01 start 1
|
||||||
|
[0x04] & 0x02 start 2
|
||||||
|
[0x05] DSW1
|
||||||
|
[0x06] DSW2
|
||||||
|
[0x07] & 0x40 demo sounds ON / OFF
|
||||||
|
[0x07] & 0x7 lives setting
|
||||||
|
[0x07] & 0x80 cabinet (upright / table)
|
||||||
|
[0x07] & 0x30 difficulty (easy / normal / hard / hardest)
|
||||||
|
[0x0f] coinage A
|
||||||
|
[0x10] coinage B
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
|
||||||
|
state->m_text_videoram[0x2ee|0x000] = ((state->m_text_videoram[0xf] & 0xf0) >> 4) + 0x30;
|
||||||
|
//state->m_text_videoram[0x2ee|0x400] = (0x40);
|
||||||
|
state->m_text_videoram[0x2f5|0x000] = ((state->m_text_videoram[0xf] & 0x0f) >> 0) + 0x30;
|
||||||
|
//state->m_text_videoram[0x2f5|0x400] = (0x40);
|
||||||
|
state->m_text_videoram[0x2ce|0x000] = ((state->m_text_videoram[0x10] & 0xf0) >> 4) + 0x30;
|
||||||
|
//state->m_text_videoram[0x2ce|0x400] = (0x40);
|
||||||
|
state->m_text_videoram[0x2d5|0x000] = ((state->m_text_videoram[0x10] & 0x0f) >> 0) + 0x30;
|
||||||
|
//state->m_text_videoram[0x2d5|0x400] = (0x40);
|
||||||
|
|
||||||
|
for(i=0;i<8;i++) /* dips */
|
||||||
|
{
|
||||||
|
terrafu_sm_onoff(space,0x074 + (i * 0x20),(state->m_text_videoram[0x05] >> (7-i)) & 1);
|
||||||
|
terrafu_sm_onoff(space,0x079 + (i * 0x20),(state->m_text_videoram[0x06] >> (7-i)) & 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: inputs layout? */
|
||||||
|
|
||||||
|
break;
|
||||||
|
//default:
|
||||||
|
//printf("%04x\n",mcu_cmd);
|
||||||
|
}
|
||||||
|
}
|
@ -997,7 +997,7 @@ $(MAMEOBJ)/neogeo.a: \
|
|||||||
$(MACHINE)/neoprot.o \
|
$(MACHINE)/neoprot.o \
|
||||||
|
|
||||||
$(MAMEOBJ)/nichibut.a: \
|
$(MAMEOBJ)/nichibut.a: \
|
||||||
$(DRIVERS)/armedf.o $(VIDEO)/armedf.o \
|
$(DRIVERS)/armedf.o $(VIDEO)/armedf.o $(MACHINE)/armedf.o \
|
||||||
$(DRIVERS)/bigfghtr.o \
|
$(DRIVERS)/bigfghtr.o \
|
||||||
$(DRIVERS)/cclimber.o $(MACHINE)/cclimber.o $(AUDIO)/cclimber.o $(VIDEO)/cclimber.o \
|
$(DRIVERS)/cclimber.o $(MACHINE)/cclimber.o $(AUDIO)/cclimber.o $(VIDEO)/cclimber.o \
|
||||||
$(DRIVERS)/clshroad.o $(VIDEO)/clshroad.o \
|
$(DRIVERS)/clshroad.o $(VIDEO)/clshroad.o \
|
||||||
|
@ -186,25 +186,30 @@ WRITE16_HANDLER( armedf_bg_videoram_w )
|
|||||||
tilemap_mark_tile_dirty(state->m_bg_tilemap, offset);
|
tilemap_mark_tile_dirty(state->m_bg_tilemap, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE16_HANDLER( terraf_fg_scrollx_w )
|
|
||||||
{
|
|
||||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
|
||||||
if (ACCESSING_BITS_8_15)
|
|
||||||
{
|
|
||||||
state->m_fg_scrollx = data >> 8;
|
|
||||||
state->m_waiting_msb = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WRITE16_HANDLER( terraf_fg_scrolly_w )
|
WRITE16_HANDLER( terraf_fg_scrolly_w )
|
||||||
|
{
|
||||||
|
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||||
|
if (ACCESSING_BITS_8_15)
|
||||||
|
{
|
||||||
|
state->m_fg_scrolly = ((data >> 8) & 0xff) | (state->m_fg_scrolly & 0x300);
|
||||||
|
state->m_waiting_msb = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE16_HANDLER( terraf_fg_scrollx_w )
|
||||||
{
|
{
|
||||||
armedf_state *state = space->machine().driver_data<armedf_state>();
|
armedf_state *state = space->machine().driver_data<armedf_state>();
|
||||||
if (ACCESSING_BITS_8_15)
|
if (ACCESSING_BITS_8_15)
|
||||||
{
|
{
|
||||||
if (state->m_waiting_msb)
|
if (state->m_waiting_msb)
|
||||||
|
{
|
||||||
state->m_scroll_msb = data >> 8;
|
state->m_scroll_msb = data >> 8;
|
||||||
|
state->m_fg_scrollx = (state->m_fg_scrollx & 0xff) | (((state->m_scroll_msb >> 4) & 3) << 8);
|
||||||
|
state->m_fg_scrolly = (state->m_fg_scrolly & 0xff) | (((state->m_scroll_msb >> 0) & 3) << 8);
|
||||||
|
//popmessage("%04X %04X %04X",data,state->m_fg_scrollx,state->m_fg_scrolly);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
state->m_fg_scrolly = data >> 8;
|
state->m_fg_scrollx = ((data >> 8) & 0xff) | (state->m_fg_scrollx & 0x300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,7 +337,7 @@ 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 == 5 ))
|
if ((state->m_scroll_type == 3 ))
|
||||||
{
|
{
|
||||||
if (state->m_old_mcu_mode != state->m_vreg)
|
if (state->m_old_mcu_mode != state->m_vreg)
|
||||||
{
|
{
|
||||||
@ -356,9 +361,9 @@ SCREEN_UPDATE( armedf )
|
|||||||
|
|
||||||
switch (state->m_scroll_type)
|
switch (state->m_scroll_type)
|
||||||
{
|
{
|
||||||
case 0: /* terra force */
|
case 0: /* terra force */
|
||||||
tilemap_set_scrollx(state->m_fg_tilemap, 0, state->m_fg_scrolly + ((state->m_scroll_msb >> 4) & 3) * 256);
|
tilemap_set_scrollx(state->m_fg_tilemap, 0, (state->m_fg_scrollx & 0x3ff));
|
||||||
tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fg_scrollx + ((state->m_scroll_msb) & 3) * 256);
|
tilemap_set_scrolly(state->m_fg_tilemap, 0, (state->m_fg_scrolly & 0x3ff));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: /* armed formation */
|
case 1: /* armed formation */
|
||||||
@ -384,14 +389,6 @@ SCREEN_UPDATE( armedf )
|
|||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5: /* terra force (US) */
|
|
||||||
tilemap_set_scrollx(state->m_fg_tilemap, 0, (state->m_text_videoram[13] & 0xff) | ((state->m_text_videoram[14] & 0x3) << 8));
|
|
||||||
tilemap_set_scrolly(state->m_fg_tilemap, 0, (state->m_text_videoram[11] & 0xff) | ((state->m_text_videoram[12] & 0x3) << 8));
|
|
||||||
break;
|
|
||||||
case 7: /* terra force (japan bootleg) */
|
|
||||||
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));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user