mirror of
https://github.com/holub/mame
synced 2025-05-19 20:29:09 +03:00
Preliminary simulation of text layer protection in Chouji Meikyuu Legion [Tomasz Slanina]
This commit is contained in:
parent
5025452bd1
commit
41fbb1963c
@ -1166,7 +1166,6 @@ ROM_START( legiono )
|
|||||||
ROM_LOAD( "legion.1j", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) )
|
ROM_LOAD( "legion.1j", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) )
|
||||||
|
|
||||||
/* should lg7.bin be loaded here too? The ROM wasn't included in this set */
|
/* should lg7.bin be loaded here too? The ROM wasn't included in this set */
|
||||||
|
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
ROM_START( terraf )
|
ROM_START( terraf )
|
||||||
|
@ -43,6 +43,29 @@ static TILE_GET_INFO( get_tx_tile_info )
|
|||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TILE_GET_INFO( get_legion_tx_tile_info )
|
||||||
|
{
|
||||||
|
armedf_state *state = machine->driver_data<armedf_state>();
|
||||||
|
|
||||||
|
int tile_number = state->text_videoram[tile_index] & 0xff;
|
||||||
|
|
||||||
|
if(tile_index<0x10) tile_number=0x20;
|
||||||
|
|
||||||
|
int attributes;
|
||||||
|
|
||||||
|
if (state->scroll_type == 1)
|
||||||
|
attributes = state->text_videoram[tile_index + 0x800] & 0xff;
|
||||||
|
else
|
||||||
|
attributes = state->text_videoram[tile_index + 0x400] & 0xff;
|
||||||
|
|
||||||
|
SET_TILE_INFO(
|
||||||
|
0,
|
||||||
|
tile_number + 256 * (attributes & 0x3),
|
||||||
|
attributes >> 4,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static TILE_GET_INFO( get_fg_tile_info )
|
static TILE_GET_INFO( get_fg_tile_info )
|
||||||
{
|
{
|
||||||
armedf_state *state = machine->driver_data<armedf_state>();
|
armedf_state *state = machine->driver_data<armedf_state>();
|
||||||
@ -97,6 +120,9 @@ VIDEO_START( armedf )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: /* legion */
|
case 3: /* legion */
|
||||||
|
state->tx_tilemap = tilemap_create(machine, get_legion_tx_tile_info, armedf_scan_type3, 8, 8, 64, 32);
|
||||||
|
break;
|
||||||
|
|
||||||
case 6: /* legiono */
|
case 6: /* legiono */
|
||||||
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, armedf_scan_type3, 8, 8, 64, 32);
|
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, armedf_scan_type3, 8, 8, 64, 32);
|
||||||
break;
|
break;
|
||||||
@ -128,15 +154,16 @@ WRITE16_HANDLER( armedf_text_videoram_w )
|
|||||||
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x7ff);
|
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x7ff);
|
||||||
else
|
else
|
||||||
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0xbff);
|
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0xbff);
|
||||||
|
/*
|
||||||
/* if (offset < 0x10)
|
if (offset < 0x10)
|
||||||
logerror("%04x %04x %04x %04x %04x %04x %04x %04x-%04x %04x %04x %04x %04x %04x %04x %04x (%04x)\n",
|
logerror("%04x %04x %04x %04x %04x %04x %04x %04x-%04x %04x %04x %04x %04x %04x %04x %04x (%04x)\n",
|
||||||
state->text_videoram[0], state->text_videoram[1], state->text_videoram[2],
|
state->text_videoram[0], state->text_videoram[1], state->text_videoram[2],
|
||||||
state->text_videoram[3], state->text_videoram[4], state->text_videoram[5],
|
state->text_videoram[3], state->text_videoram[4], state->text_videoram[5],
|
||||||
state->text_videoram[6], state->text_videoram[7], state->text_videoram[8],
|
state->text_videoram[6], state->text_videoram[7], state->text_videoram[8],
|
||||||
state->text_videoram[9], state->text_videoram[10], state->text_videoram[11],
|
state->text_videoram[9], state->text_videoram[10], state->text_videoram[11],
|
||||||
state->text_videoram[12], state->text_videoram[13], state->text_videoram[14],
|
state->text_videoram[12], state->text_videoram[13], state->text_videoram[14],
|
||||||
state->text_videoram[15], offset);*/
|
state->text_videoram[15], offset);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE16_HANDLER( armedf_fg_videoram_w )
|
WRITE16_HANDLER( armedf_fg_videoram_w )
|
||||||
@ -256,8 +283,54 @@ 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 - ??? - should be (when comapred with legiono set) displayed(? inivisble? different prority?) during game
|
||||||
|
6 - test mode screen
|
||||||
|
7 - portraits (title)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
armedf_state *state = machine->driver_data<armedf_state>();
|
||||||
|
UINT8 * data = (UINT8 *)memory_region(machine, "gfx5");
|
||||||
|
|
||||||
|
for(int i=0;i<0x400;++i)
|
||||||
|
{
|
||||||
|
if(i<0x10) continue;
|
||||||
|
|
||||||
|
if(index>0)
|
||||||
|
{
|
||||||
|
int tile=data[0x800*index+i];
|
||||||
|
int bank=data[0x800*index+i+0x400]&3;
|
||||||
|
|
||||||
|
if( (tile|(bank<<8))!=0x20)
|
||||||
|
{
|
||||||
|
state->text_videoram[i]=tile;
|
||||||
|
state->text_videoram[i+0x400]=data[0x800*index+i+0x400];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//clear - not used
|
||||||
|
state->text_videoram[i]=0x20;
|
||||||
|
state->text_videoram[i+0x400]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tilemap_mark_all_tiles_dirty(state->tx_tilemap);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
VIDEO_UPDATE( armedf )
|
VIDEO_UPDATE( armedf )
|
||||||
{
|
{
|
||||||
armedf_state *state = screen->machine->driver_data<armedf_state>();
|
armedf_state *state = screen->machine->driver_data<armedf_state>();
|
||||||
@ -363,6 +436,39 @@ VIDEO_UPDATE( armedf )
|
|||||||
if (sprite_enable)
|
if (sprite_enable)
|
||||||
draw_sprites(screen->machine, bitmap, cliprect, 0);
|
draw_sprites(screen->machine, bitmap, cliprect, 0);
|
||||||
|
|
||||||
|
|
||||||
|
if(state->scroll_type == 3) /* legion */
|
||||||
|
{
|
||||||
|
/* Hack to clear the garbage draw in place of "GAME OVER" after
|
||||||
|
continue. Game code copies there '@ABCDEFG' (from location $13fad),
|
||||||
|
to fix tilemap (index 5) currently not displayed in game
|
||||||
|
(visible in legiono (unprotected) set - it covers the playfield,
|
||||||
|
but should be not visible? or draw under the tilemaps)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if( (state->text_videoram[0]&0xff) == 0x0e &&
|
||||||
|
(state->text_videoram[0x40e/2]&0xff)==' ' &&
|
||||||
|
(state->text_videoram[0x410/2]&0xff)=='@' &&
|
||||||
|
(state->text_videoram[0x412/2]&0xff)=='A')
|
||||||
|
{
|
||||||
|
for(int i=0;i<16;++i)
|
||||||
|
{
|
||||||
|
state->text_videoram[0x410/2+i]=0x20;
|
||||||
|
state->text_videoram[0x410/2+i+0x400]=0;
|
||||||
|
}
|
||||||
|
tilemap_mark_all_tiles_dirty(state->tx_tilemap);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(state->text_videoram[1]&0xff)
|
||||||
|
{
|
||||||
|
case 1: copy_textmap(screen->machine, 4); break; /* title screen */
|
||||||
|
case 6: copy_textmap(screen->machine, 7); break; /* portraits on title screen */
|
||||||
|
/* display tilemap 5 during game .. but it makes the game unplayable */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user