mirror of
https://github.com/holub/mame
synced 2025-05-20 20:58:51 +03:00
Pre-Seibu CRTC update: [Angelo Salese]
* Fixed gfx banking in goodejan/totmejan; * Fixed vertical scrolling in Sengoku Mahjong (check title screen); * Made some clean-ups in either drivers; ================================================== The (likely) custom Seibu CRTC is used at least in the following games: Raiden (probably the first game to use it) Sengoku Mahjong Good e Jong Tottemo de Jong Blood Bros. Sky Smasher D-Con SD Gundam Psycho Salamander no Kyoui (all games in legionna.c) (all games in raiden2.c) All of these games have 4 layers with 2048 (0x800) bytes of ram each,a palette ram with xRRRRRGGGGGBBBBB format and (at least) 72 (0x48) video registers. The idea here is to merge everything in a single file and to understand the issues with some of them,namely the "bitmap_fill" color (goodejan/totmejan needs a black pen on the service mode and a white-to-black fade out effect at start-up?),some kludges with the tilemaps/sprites positioning (in both sd gundams,sdgndmsp and sdgndmrb for example) plus obviously anything that isn't yet understood from these regs.
This commit is contained in:
parent
cb153df898
commit
91ca9dd29e
@ -8,10 +8,9 @@ OSC: 12.000MHz 16.000MHz 7.15909MHz
|
||||
|
||||
|
||||
ToDo:
|
||||
BG Banking is wrong.
|
||||
Inputs are imperfect (missing dips)
|
||||
Sprite glitches in intro
|
||||
|
||||
Some sprite flickers on attract mode
|
||||
totmejan: Are the "dots" behind the girls in attract mode correct?
|
||||
|
||||
PCB Layout
|
||||
|
||||
@ -69,6 +68,7 @@ WRITE16_HANDLER( goodejan_txvram_w );
|
||||
WRITE16_HANDLER( goodejan_bg_scrollx_w );
|
||||
WRITE16_HANDLER( goodejan_bg_scrolly_w );
|
||||
WRITE16_HANDLER( goodejan_layer_en_w );
|
||||
WRITE16_HANDLER( goodejan_gfxbank_w );
|
||||
|
||||
VIDEO_START( goodejan );
|
||||
VIDEO_UPDATE( goodejan );
|
||||
@ -106,23 +106,28 @@ static ADDRESS_MAP_START( goodejan_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*totmejan CRT is at 8000-804f,goodejan is at 8040-807f(808f but not tested)*/
|
||||
static ADDRESS_MAP_START( goodejan_io_map, ADDRESS_SPACE_IO, 16 )
|
||||
AM_RANGE(0x801c, 0x801d) AM_WRITE(goodejan_layer_en_w )
|
||||
|
||||
AM_RANGE(0x805c, 0x805d) AM_WRITE(goodejan_layer_en_w )
|
||||
AM_RANGE(0x8060, 0x8061) AM_WRITE(goodejan_bg_scrollx_w )
|
||||
AM_RANGE(0x8062, 0x8063) AM_WRITE(goodejan_bg_scrolly_w )
|
||||
|
||||
static ADDRESS_MAP_START( common_io_map, ADDRESS_SPACE_IO, 16 )
|
||||
AM_RANGE(0x9000, 0x9001) AM_WRITE(goodejan_gfxbank_w)
|
||||
AM_RANGE(0x8020, 0x8023) AM_WRITENOP
|
||||
AM_RANGE(0xb000, 0xb003) AM_WRITENOP
|
||||
AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w)
|
||||
|
||||
AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r)
|
||||
AM_RANGE(0xc004, 0xc005) AM_READ_PORT("DSW2") // maybe it's a seibu_main_word mirror?
|
||||
// AM_RANGE(0xc004, 0xc005) AM_READ(random_reading)
|
||||
|
||||
AM_RANGE(0xd000, 0xd00f) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( totmejan_io_map, ADDRESS_SPACE_IO, 16 )
|
||||
AM_RANGE(0x801c, 0x801d) AM_WRITE(goodejan_layer_en_w )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( goodejan_io_map, ADDRESS_SPACE_IO, 16 )
|
||||
AM_RANGE(0x805c, 0x805d) AM_WRITE(goodejan_layer_en_w )
|
||||
AM_RANGE(0x8060, 0x8061) AM_WRITE(goodejan_bg_scrollx_w )
|
||||
AM_RANGE(0x8062, 0x8063) AM_WRITE(goodejan_bg_scrolly_w )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static INPUT_PORTS_START( goodejan )
|
||||
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
|
||||
|
||||
@ -326,7 +331,7 @@ static MACHINE_DRIVER_START( goodejan )
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("main", V30, GOODEJAN_MHZ2/2)
|
||||
MDRV_CPU_PROGRAM_MAP(goodejan_map,0)
|
||||
MDRV_CPU_IO_MAP(goodejan_io_map,0)
|
||||
MDRV_CPU_IO_MAP(common_io_map,goodejan_io_map)
|
||||
MDRV_CPU_VBLANK_INT_HACK(goodejan_interrupt,2)
|
||||
|
||||
SEIBU_SOUND_SYSTEM_CPU(GOODEJAN_MHZ1/2)
|
||||
@ -351,6 +356,12 @@ static MACHINE_DRIVER_START( goodejan )
|
||||
SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(GOODEJAN_MHZ1/2,GOODEJAN_MHZ2/16)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
static MACHINE_DRIVER_START( totmejan )
|
||||
MDRV_IMPORT_FROM( goodejan )
|
||||
MDRV_CPU_MODIFY("main")
|
||||
MDRV_CPU_IO_MAP(common_io_map,totmejan_io_map)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
ROM_START( totmejan )
|
||||
ROM_REGION( 0x100000, "main", 0 ) /* V30 code */
|
||||
ROM_LOAD16_BYTE( "1.022", 0xc0000, 0x20000, CRC(63c3c54f) SHA1(3116b73b848a1f7391a47b994951ba1af92ba298) )
|
||||
@ -393,8 +404,7 @@ ROM_START( goodejan )
|
||||
ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) )
|
||||
|
||||
ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "e_jan2scr.064", 0x080000, 0x080000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
|
||||
ROM_CONTINUE( 0x000000, 0x080000 )
|
||||
ROM_LOAD( "e_jan2scr.064", 0x000000, 0x100000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
|
||||
|
||||
ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) )
|
||||
@ -421,8 +431,7 @@ ROM_START( goodejaa )
|
||||
ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) )
|
||||
|
||||
ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "e_jan2scr.064", 0x080000, 0x080000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
|
||||
ROM_CONTINUE( 0x000000, 0x080000 )
|
||||
ROM_LOAD( "e_jan2scr.064", 0x000000, 0x100000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
|
||||
|
||||
ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) )
|
||||
@ -434,6 +443,6 @@ ROM_START( goodejaa )
|
||||
ROM_LOAD( "fmj08.083", 0x000, 0x100, CRC(9657b7ad) SHA1(e9b469c2b3534593f7fe0ea19cbbf93b55957e42) )
|
||||
ROM_END
|
||||
|
||||
GAME( 1991, totmejan, 0, goodejan, goodejan, 0, ROT0, "Seibu (distributed by Tecmo)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1991, totmejan, 0, totmejan, goodejan, 0, ROT0, "Seibu (distributed by Tecmo)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1991, goodejan, 0, goodejan, goodejan, 0, ROT0, "Seibu (distributed by Tecmo)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1991, goodejaa, goodejan, goodejan, goodejan, 0, ROT0, "Seibu (distributed by Tecmo)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS )
|
||||
|
@ -10,6 +10,7 @@ TODO:
|
||||
- Find what the remaining video C.R.T. registers does;
|
||||
- Fix sprites bugs at a start of a play;
|
||||
- Check NVRAM boudaries;
|
||||
- Why we need to write "something" to the comms to let the coins to work? Bug with the Seibu custom z80?
|
||||
- How the "SW Service Mode" (press F2 during gameplay) really works (inputs etc)? Nothing mapped works with it...
|
||||
|
||||
Notes:
|
||||
@ -64,6 +65,7 @@ WRITE16_HANDLER( sengokmj_fgvram_w );
|
||||
WRITE16_HANDLER( sengokmj_mdvram_w );
|
||||
WRITE16_HANDLER( sengokmj_txvram_w );
|
||||
WRITE16_HANDLER( sengokmj_layer_enable_w );
|
||||
WRITE16_HANDLER( sengokmj_bg_scrolly_w );
|
||||
VIDEO_START( sengokmj );
|
||||
VIDEO_UPDATE( sengokmj );
|
||||
|
||||
@ -99,6 +101,10 @@ static WRITE16_HANDLER( sengokmj_out_w )
|
||||
coin_counter_w(0,data & 4);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( seibu_z80_com_6_mirror_w )
|
||||
{
|
||||
seibu_main_word_w(space,6,data,0xffff);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( sengokmj_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x00000, 0x07fff) AM_RAM
|
||||
@ -114,19 +120,20 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sengokmj_io_map, ADDRESS_SPACE_IO, 16 )
|
||||
AM_RANGE(0x4000, 0x400f) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
|
||||
AM_RANGE(0x8000, 0x800f) AM_WRITE(seibu_main_word_w)
|
||||
/*Areas from 8010-804f appears to be video registers / C.R.T. related,probably usual Seibu customness.*/
|
||||
AM_RANGE(0x8010, 0x801b) AM_WRITENOP
|
||||
/*Areas from 8000-804f are for the custom Seibu CRTC.*/
|
||||
// AM_RANGE(0x8000, 0x800f) AM_WRITE(seibu_main_word_w)
|
||||
// AM_RANGE(0x8010, 0x801b) AM_WRITENOP
|
||||
AM_RANGE(0x801c, 0x801d) AM_WRITE(sengokmj_layer_enable_w)
|
||||
AM_RANGE(0x801e, 0x801f) AM_WRITENOP
|
||||
AM_RANGE(0x8020, 0x802f) AM_WRITENOP
|
||||
AM_RANGE(0x8030, 0x803f) AM_WRITENOP
|
||||
AM_RANGE(0x8040, 0x804f) AM_WRITENOP
|
||||
// AM_RANGE(0x801e, 0x801f) AM_WRITENOP
|
||||
// AM_RANGE(0x8020, 0x802f) AM_WRITENOP
|
||||
AM_RANGE(0x8022, 0x8023) AM_WRITE(sengokmj_bg_scrolly_w)
|
||||
// AM_RANGE(0x8030, 0x803f) AM_WRITENOP
|
||||
// AM_RANGE(0x8040, 0x804f) AM_WRITENOP
|
||||
|
||||
AM_RANGE(0x8100, 0x8101) AM_WRITENOP // always 0
|
||||
AM_RANGE(0x8080, 0x8081) AM_WRITE(seibu_z80_com_6_mirror_w)
|
||||
// AM_RANGE(0x80c0, 0x80c1) AM_WRITE(seibu_z80_com_unk_mirror_w)
|
||||
// AM_RANGE(0x8100, 0x8101) AM_WRITENOP // always 0
|
||||
AM_RANGE(0x8180, 0x8181) AM_WRITE(sengokmj_out_w)
|
||||
AM_RANGE(0x8080, 0x8081) AM_WRITENOP
|
||||
AM_RANGE(0x80c0, 0x80cf) AM_WRITENOP
|
||||
AM_RANGE(0x8140, 0x8141) AM_WRITE(mahjong_panel_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r)
|
||||
|
@ -3,6 +3,7 @@
|
||||
static tilemap *bg_tilemap, *tx_tilemap;
|
||||
UINT16 *goodejan_bgvram,*goodejan_txvram;
|
||||
static UINT16 goodejan_layer_en;
|
||||
static UINT16 goodejan_gfx_bank;
|
||||
|
||||
WRITE16_HANDLER( goodejan_bgvram_w )
|
||||
{
|
||||
@ -23,13 +24,19 @@ WRITE16_HANDLER( goodejan_layer_en_w )
|
||||
goodejan_layer_en = data;
|
||||
}
|
||||
|
||||
/*Not from the Seibu CRTC,it's an external ROM banking.*/
|
||||
WRITE16_HANDLER( goodejan_gfxbank_w )
|
||||
{
|
||||
goodejan_gfx_bank = (data & 0x100)>>8;
|
||||
tilemap_mark_all_tiles_dirty(bg_tilemap);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( goodejan_bg_tile_info )
|
||||
{
|
||||
int tile = goodejan_bgvram[tile_index]&0x0fff;
|
||||
int color = (goodejan_bgvram[tile_index]&0xf000)>>12;
|
||||
|
||||
// WRONG!
|
||||
tile|= (goodejan_bgvram[tile_index]&0x8000)>>3;
|
||||
tile|= goodejan_gfx_bank<<12;
|
||||
// if ((goodejan_bgvram[tile_index]&0x8000)==0x0000) tile+=0x1000;
|
||||
|
||||
SET_TILE_INFO(1, tile, color, 0);
|
||||
|
@ -9,6 +9,7 @@ Sengoku Mahjong Video Hardware section
|
||||
static tilemap *bg_tilemap,*md_tilemap,*fg_tilemap,*tx_tilemap;
|
||||
UINT16 *sengokmj_bgvram,*sengokmj_mdvram,*sengokmj_fgvram,*sengokmj_txvram;
|
||||
static UINT16 sengokmj_layer_en;
|
||||
static UINT16 sengokmj_scrolly;
|
||||
|
||||
WRITE16_HANDLER( sengokmj_bgvram_w )
|
||||
{
|
||||
@ -41,6 +42,11 @@ WRITE16_HANDLER( sengokmj_layer_enable_w )
|
||||
sengokmj_layer_en = data;
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( sengokmj_bg_scrolly_w )
|
||||
{
|
||||
sengokmj_scrolly = data;
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( sengoku_bg_tile_info )
|
||||
{
|
||||
int tile = sengokmj_bgvram[tile_index];
|
||||
@ -113,9 +119,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
VIDEO_START( sengokmj )
|
||||
{
|
||||
bg_tilemap = tilemap_create(machine, sengoku_bg_tile_info,tilemap_scan_rows,16,16,32,16);
|
||||
md_tilemap = tilemap_create(machine, sengoku_md_tile_info,tilemap_scan_rows,16,16,32,16);
|
||||
fg_tilemap = tilemap_create(machine, sengoku_fg_tile_info,tilemap_scan_rows,16,16,32,16);
|
||||
bg_tilemap = tilemap_create(machine, sengoku_bg_tile_info,tilemap_scan_rows,16,16,32,32);
|
||||
md_tilemap = tilemap_create(machine, sengoku_md_tile_info,tilemap_scan_rows,16,16,32,32);
|
||||
fg_tilemap = tilemap_create(machine, sengoku_fg_tile_info,tilemap_scan_rows,16,16,32,32);
|
||||
tx_tilemap = tilemap_create(machine, sengoku_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
|
||||
|
||||
tilemap_set_transparent_pen(md_tilemap,15);
|
||||
@ -126,19 +132,16 @@ VIDEO_START( sengokmj )
|
||||
VIDEO_UPDATE( sengokmj )
|
||||
{
|
||||
bitmap_fill(bitmap, cliprect, screen->machine->pens[0x7ff]); //black pen
|
||||
tilemap_set_scrolly( bg_tilemap,0, sengokmj_scrolly );
|
||||
|
||||
if(!(sengokmj_layer_en & 1))
|
||||
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
|
||||
draw_sprites(screen->machine, bitmap,cliprect, 2);
|
||||
draw_sprites(screen->machine, bitmap,cliprect, 1);
|
||||
if(!(sengokmj_layer_en & 2))
|
||||
tilemap_draw(bitmap,cliprect,md_tilemap,0,0);
|
||||
if(!(sengokmj_layer_en & 4))
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
|
||||
draw_sprites(screen->machine, bitmap,cliprect, 0);
|
||||
draw_sprites(screen->machine, bitmap,cliprect, 3);
|
||||
if(!(sengokmj_layer_en & 8))
|
||||
tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
|
||||
if(!(sengokmj_layer_en & 1)) { tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); }
|
||||
if(!(sengokmj_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 2); }
|
||||
if(!(sengokmj_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 1); }
|
||||
if(!(sengokmj_layer_en & 2)) { tilemap_draw(bitmap,cliprect,md_tilemap,0,0); }
|
||||
if(!(sengokmj_layer_en & 4)) { tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); }
|
||||
if(!(sengokmj_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 0); }
|
||||
if(!(sengokmj_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 3); }
|
||||
if(!(sengokmj_layer_en & 8)) { tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); }
|
||||
|
||||
// popmessage("%04x",sengokmj_layer_en);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user