From ba046afd274986801af1bc8730283058b5342bf0 Mon Sep 17 00:00:00 2001 From: Mamesick Date: Sat, 5 Sep 2015 16:37:05 +0200 Subject: [PATCH 1/7] Fix for MAMETESTERS bug #4701 VIDEO_UPDATE_AFTER_VBLANK. Probably is needed by all games in the driver, though the rest seems to work fine with the default method. --- src/mame/drivers/seta.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 03a02d1bb5f..1a706be24e1 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -8044,6 +8044,7 @@ static MACHINE_CONFIG_START( blandia, seta_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) @@ -8081,6 +8082,7 @@ static MACHINE_CONFIG_START( blandiap, seta_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) From 9dc8e820907c18194ab23e6b8f43a0c0b9822a51 Mon Sep 17 00:00:00 2001 From: incog Date: Sun, 6 Sep 2015 10:43:52 +0100 Subject: [PATCH 2/7] Update tutor.xml --- hash/tutor.xml | 79 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/hash/tutor.xml b/hash/tutor.xml index 268641d3f26..b1a86264cd1 100644 --- a/hash/tutor.xml +++ b/hash/tutor.xml @@ -15,18 +15,18 @@ Japanese Releases - Pyuuta 005E Frogger ~ フロッガー [dumped] 006E Scramble ~ スクランブル [dumped] 007E NightFlight ~ ナイトフライト [dumped] -008E Marine Adventure ~ マリン アドベンチャー [dumped] +008E Marine Adventure ~ マリン アドベンチーャ [dumped] 009E Mission Attack ~ ミッション アタック [dumped] -010E Traffic Jam ~ トラフィック ジャム -011E Mystery Gold ~ ミステリー ゴールド +010E Traffic Jam ~ トラフィック ジャム [dumped] +011E Mystery Gold ~ ミステリー ゴールド [dumped] 012E DonPan ~ ドンバン [dumped] 013E Mickey Athletic Land ~ ミッキー アスレチックランド [dumped] 014E Pooyan ~ プーヤン 015E Jungler ~ ジャングラー 016E Guttang Gottong ~ ガッタンゴットン -017E Maze Patrol ~ メイズ パトロール +017E Maze Patrol ~ メイズ パトロール [dumped] 018E Tron ~ トロン -019E Mr. Do! ~ Mr.DO! +019E Mr. Do! ~ Mr.DO! [dumped] 020E Bermuda Triangle ~ バミューダ・ トライアングル 021E 4-nin Mahjan ~ 四人麻雀 022E Triplecommand ~ トリプルコマンド @@ -218,6 +218,19 @@ Battlefighter (Original) (Unreleased - Prototype Stage) + + + Maze Patrol (Jpn) + 1983 + Tomy + + + + + + + + Mickey Athletic Land (Jpn) @@ -257,6 +270,32 @@ Battlefighter (Original) (Unreleased - Prototype Stage) + + + Mystery Gold (Jpn) + 1983 + Tomy + + + + + + + + + + + Mr. Do! (Jpn) + 1983 + Tomy + + + + + + + + Night Flight (Jpn) @@ -334,26 +373,26 @@ Battlefighter (Original) (Unreleased - Prototype Stage) - + - Traffic Jam - 1983 - Tomy - - - - - - - - - - Traffic Jam (Alt) + Traffic Jam (Jpn) 1982 Tomy - + + + + + + + + Traffic Jam (USA) + 1983 + Tomy + + + From ca93cf4a7eabbf0e6a3f4f1fbdd29878cddea6a0 Mon Sep 17 00:00:00 2001 From: incog Date: Sun, 6 Sep 2015 10:53:03 +0100 Subject: [PATCH 3/7] Update tutor.xml --- hash/tutor.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hash/tutor.xml b/hash/tutor.xml index b1a86264cd1..da60657548a 100644 --- a/hash/tutor.xml +++ b/hash/tutor.xml @@ -373,7 +373,7 @@ Battlefighter (Original) (Unreleased - Prototype Stage) - + Traffic Jam (Jpn) 1982 @@ -385,7 +385,7 @@ Battlefighter (Original) (Unreleased - Prototype Stage) - + Traffic Jam (USA) 1983 From a02e1900800fa13a32a9fced7b463101a11c2914 Mon Sep 17 00:00:00 2001 From: incog Date: Sun, 6 Sep 2015 11:40:05 +0100 Subject: [PATCH 4/7] Update tutor.xml --- hash/tutor.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hash/tutor.xml b/hash/tutor.xml index da60657548a..89b96fe53a0 100644 --- a/hash/tutor.xml +++ b/hash/tutor.xml @@ -219,7 +219,7 @@ Battlefighter (Original) (Unreleased - Prototype Stage) - + Maze Patrol (Jpn) 1983 Tomy From 17d52442efe5bba5343b59043f5d9780c331a554 Mon Sep 17 00:00:00 2001 From: Luca Elia Date: Sun, 6 Sep 2015 15:51:44 +0200 Subject: [PATCH 5/7] suna8.c: Overhauled the rendering of text sprites, added masking [Luca Elia] Not perfect yet but improves a few effects compared to PCB videos. --- src/mame/drivers/suna8.c | 24 ++-- src/mame/includes/suna8.h | 11 +- src/mame/video/suna8.c | 261 +++++++++++++++++++++++++------------- 3 files changed, 189 insertions(+), 107 deletions(-) diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c index 77df63a4368..f29c80842c9 100644 --- a/src/mame/drivers/suna8.c +++ b/src/mame/drivers/suna8.c @@ -27,8 +27,10 @@ Notes: - hardhea2: in test mode press P1&P2 button 2 to see a picture of each level - Rough Ranger default dipswitch settings are based on the settings listed in - the Sharp Image licensed Rough Ranger manaul / NOTICE sheet dated 8-5-88 -- starfigh video: http://youtu.be/SIwV7wjvnHM -> missing starfield effect! + the Sharp Image licensed Rough Ranger manual / NOTICE sheet dated 8-5-88 +- rranger video: http://www.nicovideo.jp/watch/sm15788808 (not perfect: fireball masking, lev. 5; masking/missing legs, lev. 10) +- hardhead video: https://youtu.be/zamQvXr9_xs +- starfigh video: http://youtu.be/SIwV7wjvnHM (missing starfield effect!) - brickzn video: http://youtu.be/yfU1C7A3iZI (recorded from v6.0, Joystick version) ***************************************************************************/ @@ -1885,7 +1887,7 @@ static MACHINE_CONFIG_START( hardhead, suna8_state ) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) - MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_textdim12) + MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -1939,7 +1941,7 @@ static MACHINE_CONFIG_START( rranger, suna8_state ) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) - MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_textdim8) + MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -2921,13 +2923,13 @@ DRIVER_INIT_MEMBER(suna8_state,suna8) m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000); } -GAME( 1988, sranger, 0, rranger, rranger, suna8_state, suna8, ROT0, "SunA", "Super Ranger (v2.0)", 0 ) -GAME( 1988, rranger, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA (Sharp Image license)", "Rough Ranger (v2.0)", 0 ) -GAME( 1988, rrangerb, sranger, rranger, rranger, suna8_state, suna8, ROT0, "bootleg", "Rough Ranger (v2.0, bootleg)", 0 ) -GAME( 1988, srangero, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA", "Super Ranger (older)", 0 ) -GAME( 1988, srangern, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA (NOVA license)", "Super Ranger (older, NOVA license)", 0 ) -GAME( 1988, srangerw, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA (WDK license)", "Super Ranger (older, WDK license)", 0 ) -GAME( 1988, srangerb, sranger, rranger, rranger, suna8_state, suna8, ROT0, "bootleg (NYWA)", "Super Ranger (older, bootleg)", 0 ) +GAME( 1988, sranger, 0, rranger, rranger, suna8_state, suna8, ROT0, "SunA", "Super Ranger (v2.0)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1988, rranger, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA (Sharp Image license)", "Rough Ranger (v2.0)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1988, rrangerb, sranger, rranger, rranger, suna8_state, suna8, ROT0, "bootleg", "Rough Ranger (v2.0, bootleg)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1988, srangero, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA", "Super Ranger (older)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1988, srangern, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA (NOVA license)", "Super Ranger (older, NOVA license)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1988, srangerw, sranger, rranger, rranger, suna8_state, suna8, ROT0, "SunA (WDK license)", "Super Ranger (older, WDK license)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1988, srangerb, sranger, rranger, rranger, suna8_state, suna8, ROT0, "bootleg (NYWA)", "Super Ranger (older, bootleg)", MACHINE_IMPERFECT_GRAPHICS ) GAME( 1988, hardhead, 0, hardhead, hardhead, suna8_state, hardhead, ROT0, "SunA", "Hard Head", 0 ) GAME( 1988, hardheadb, hardhead, hardhead, hardhead, suna8_state, hardhedb, ROT0, "bootleg", "Hard Head (bootleg)", 0 ) diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h index 379250fae09..97067103bc3 100644 --- a/src/mame/includes/suna8.h +++ b/src/mame/includes/suna8.h @@ -64,7 +64,7 @@ public: } m_gfxbank_type; UINT8 m_gfxbank; - int m_text_dim; // vertical size of the text layer (0 = no text layer) + bool m_has_text; // has text sprites (older games) // samples INT16 *m_samplebuf; @@ -148,9 +148,8 @@ public: DECLARE_DRIVER_INIT(hardhead); DECLARE_DRIVER_INIT(suna8); - void suna8_vh_start_common(int text_dim, GFXBANK_TYPE_T gfxbank_type); - DECLARE_VIDEO_START(suna8_textdim8); - DECLARE_VIDEO_START(suna8_textdim12); + void suna8_vh_start_common(bool has_text, GFXBANK_TYPE_T gfxbank_type); + DECLARE_VIDEO_START(suna8_text); DECLARE_VIDEO_START(suna8_sparkman); DECLARE_VIDEO_START(suna8_brickzn); DECLARE_VIDEO_START(suna8_starfigh); @@ -168,7 +167,7 @@ public: void play_sample(int index); SAMPLES_START_CB_MEMBER(sh_start); - void draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which); - void draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); + void draw_sprites (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int which); + void draw_text_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int ypos, bool write_mask); UINT8 *brickzn_decrypt(); }; diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c index df18140d405..d1ab493638c 100644 --- a/src/mame/video/suna8.c +++ b/src/mame/video/suna8.c @@ -17,49 +17,6 @@ sent to the screen. Each sprite uses 4 bytes, held within the last page of tiles. - * Note: later games use a more complex format than the following, - which is yet to be completely understood. - - [ Sprites Format ] - - Offset: Bits: Value: - - 0.b Y (Bottom up) - - 1.b 7--- ---- Sprite Size (1 = 2x32 tiles; 0 = 2x2) - - 2x2 Sprites: - -65- ---- Tiles Row (height = 8 tiles) - ---4 ---- Page - - 2x32 Sprites: - -6-- ---- Ignore X (Multisprite) - --54 ---- Page - - ---- 3210 Tiles Column (width = 2 tiles) - - 2.b X - - 3.b 7--- ---- - -6-- ---- X (Sign Bit) - --54 3--- - ---- -210 Tiles Bank - - - [ Sprite's Tiles Format ] - - - Offset: Bits: Value: - - 0.b Code (Low Bits) - - 1.b 7--- ---- Flip Y - -6-- ---- Flip X - --54 32-- Color - ---- --10 Code (High Bits) - - - Set TILEMAPS to 1 to debug. Press Z (you see the "tilemaps" in RAM) or Press X (you see the "tilemaps" in ROM) then @@ -72,6 +29,7 @@ #include "emu.h" #include "includes/suna8.h" +#include "drawgfxm.h" /*************************************************************************** For Debug: there's no tilemap, just sprites. @@ -180,15 +138,15 @@ WRITE8_MEMBER( suna8_state::brickzn_banked_paletteram_w ) -void suna8_state::suna8_vh_start_common(int text_dim, GFXBANK_TYPE_T gfxbank_type) +void suna8_state::suna8_vh_start_common(bool has_text, GFXBANK_TYPE_T gfxbank_type) { - m_text_dim = text_dim; + m_has_text = has_text; m_spritebank = 0; m_gfxbank = 0; m_gfxbank_type = gfxbank_type; m_palettebank = 0; - if (!m_text_dim) + if (!m_has_text) { m_banked_paletteram.allocate(0x200 * 2); @@ -199,17 +157,16 @@ void suna8_state::suna8_vh_start_common(int text_dim, GFXBANK_TYPE_T gfxbank_typ #if TILEMAPS m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suna8_state::get_tile_info),this), TILEMAP_SCAN_COLS, - 8, 8, 0x20*(m_text_dim ? 4 : 16), 0x20); + 8, 8, 0x20*(m_has_text ? 4 : 16), 0x20); m_bg_tilemap->set_transparent_pen(15); #endif } -VIDEO_START_MEMBER(suna8_state,suna8_textdim8) { suna8_vh_start_common( 8, GFXBANK_TYPE_SPARKMAN); } -VIDEO_START_MEMBER(suna8_state,suna8_textdim12) { suna8_vh_start_common( 12, GFXBANK_TYPE_SPARKMAN); } -VIDEO_START_MEMBER(suna8_state,suna8_sparkman) { suna8_vh_start_common( 0, GFXBANK_TYPE_SPARKMAN); } -VIDEO_START_MEMBER(suna8_state,suna8_brickzn) { suna8_vh_start_common( 0, GFXBANK_TYPE_BRICKZN); } -VIDEO_START_MEMBER(suna8_state,suna8_starfigh) { suna8_vh_start_common( 0, GFXBANK_TYPE_STARFIGH); } +VIDEO_START_MEMBER(suna8_state,suna8_text) { suna8_vh_start_common( true, GFXBANK_TYPE_SPARKMAN); } +VIDEO_START_MEMBER(suna8_state,suna8_sparkman) { suna8_vh_start_common( false, GFXBANK_TYPE_SPARKMAN); } +VIDEO_START_MEMBER(suna8_state,suna8_brickzn) { suna8_vh_start_common( false, GFXBANK_TYPE_BRICKZN); } +VIDEO_START_MEMBER(suna8_state,suna8_starfigh) { suna8_vh_start_common( false, GFXBANK_TYPE_STARFIGH); } /*************************************************************************** @@ -219,17 +176,87 @@ VIDEO_START_MEMBER(suna8_state,suna8_starfigh) { suna8_vh_start_common( ***************************************************************************/ -void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which) +#define PIXEL_OP_REBASE_TRANSPEN_PRIORITY_MASK(DEST, PRIORITY, SOURCE) \ +do \ +{ \ + UINT32 srcdata = (SOURCE); \ + if (srcdata != trans_pen) \ + { \ + if ((PRIORITY) == 0) \ + (DEST) = color + srcdata; \ + } \ +} \ +while (0) + +class mygfx_element : public gfx_element +{ +public: + void prio_mask_transpen(bitmap_ind16 &dest, const rectangle &cliprect, + UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, + bitmap_ind8 &priority, UINT32 trans_pen) + { + color = colorbase() + granularity() * (color % colors()); + code %= elements(); + DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY_MASK, UINT8); + } +}; + +/*************************************************************************** + + [ Sprites Format ] + + * Note: later games use a more complex format than the following + + Offset: Bits: Value: + + 0.b Y (Bottom up) + + 1.b 7--- ---- Sprite Size (1 = 2x32 tiles; 0 = 2x2) + + 2x2 Sprites: + -65- ---- Tiles Row (height = 8 tiles) + ---4 ---- Page + + 2x32 Sprites: + -6-- ---- Ignore X (Multisprite) + --54 ---- Page + + ---- 3210 Tiles Column (width = 2 tiles) + + 2.b X + + 3.b 7--- ---- Text Sprite + -6-- ---- X (Sign Bit) <- Also Set For Text Sprites + --54 3210 Tiles Bank ($400 tiles each) + + + [ Sprite's Tiles Format ] + + + Offset: Bits: Value: + + 0.b Code (Low Bits) + + 1.b 7--- ---- Flip Y + -6-- ---- Flip X + --54 32-- Color + ---- --10 Code (High Bits) + +***************************************************************************/ + +void suna8_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int which) { UINT8 *spriteram = m_spriteram + which * 0x2000 * 2; - int i; int mx = 0; // multisprite x counter int max_x = m_screen->width() - 8; int max_y = m_screen->height() - 8; - for (i = 0x1d00; i < 0x2000; i += 4) + if (m_has_text) + screen.priority().fill(0, cliprect); + + for (int i = start; i < end; i += 4) { int srcpg, srcx,srcy, dimx,dimy, tx, ty; int gfxbank, colorbank = 0, flipx,flipy, multisprite; @@ -239,9 +266,33 @@ void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &clip int x = spriteram[i + 2]; int bank = spriteram[i + 3]; - if (m_text_dim) + bool read_mask = false; + + if (m_has_text) { // Older, simpler hardware: hardhead, rranger + + // rranger (20:18): + // fireball (fe00: 19 00 28 07) not masked by text (fd48: e0 00 00 c0, fd4c: 10 00 00 c0), fire (fdb0: 30 00 00 c0, fdb4: 20 00 00 c0) + // fireball (fe00: 20 00 ba 07) is masked!? But only by fire? + // rranger (33:04, 35:17): + // generally no masking by fire, but there are missing legs on some enemies. + // Could be a sprite limit hit, as there are many sprites on that line, and it's affected by the horizontal (dead) player + read_mask = true; + + if ((bank & 0xc0) == 0xc0) + { + // hardhead: fd88/8c/90 -> f994..f9c0 + // rranger: fd48/4c -> f980..f9ac + // fdb0/b4 -> f9c0..f9fc + // note: fireballs in level 5 (fe20/40) should go above flames and score (text sprites) + int text_list = (i - start) & 0x20; + int text_start = text_list ? 0x19c0 : 0x1980; + bool write_mask = (text_list == 0); // hack? + draw_text_sprites(screen, bitmap, cliprect, text_start, text_start + 0x80, y, write_mask); + continue; + } + flipx = 0; flipy = 0; gfxbank = bank & 0x3f; @@ -263,7 +314,7 @@ void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &clip } else { - // Newer, more complex hardware: brickzn, hardhea2, sparkman?, starfigh + // Newer, more complex hardware: brickzn, hardhea2, sparkman, starfigh switch( code & 0xc0 ) { case 0xc0: @@ -282,8 +333,8 @@ void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &clip gfxbank = bank & 0x1f; srcpg = (code >> 4) & 3; break; -// hardhea2: fire code=52/54 bank=a4; player code=02/04/06 bank=08; arrow:code=16 bank=27 case 0x40: + // hardhea2: fire code=52/54 bank=a4; player code=02/04/06 bank=08; arrow:code=16 bank=27 dimx = 4; dimy = 4; srcx = (code & 0xe) * 2; flipx = code & 0x01; @@ -347,7 +398,7 @@ void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &clip x = x - ((bank & 0x40) ? 0x100 : 0); y = (0x100 - y - dimy*8 ) & 0xff; - /* Multi Sprite */ + // Multi Sprite if ( multisprite ) { mx += dimx*8; x = mx; } else mx = x; @@ -379,26 +430,52 @@ void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &clip sy = max_y - sy; tile_flipy = !tile_flipy; } - m_gfxdecode->gfx(which)->transpen(bitmap,cliprect, - tile + (attr & 0x3)*0x100 + gfxbank, - (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank, // player2 in hardhea2 and sparkman - tile_flipx, tile_flipy, - sx, sy, 0xf); + int code = tile + (attr & 0x3)*0x100 + gfxbank; + int color = (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank; // player2 in hardhea2 and sparkman + + if (read_mask) + ((mygfx_element*)(m_gfxdecode->gfx(which)))->prio_mask_transpen(bitmap, cliprect, + code, color, tile_flipx, tile_flipy, sx, sy, screen.priority(), 0xf); + else + m_gfxdecode->gfx(which)->transpen(bitmap, cliprect, + code, color, tile_flipx, tile_flipy, sx, sy, 0xf); } } - } } -void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) +/*************************************************************************** + + [ Text Sprites Format ] + + Offset: Bits: Value: + + 0.b Tiles Y (height = 2 tiles) + + 1.b 7--- ---- 0 = Skip Sprite + -6-- ---- + --54 ---- Page + ---- 3210 Tiles Column (width = 2 tiles) + + 2.b X + + 3.b 7--- ---- 0 = Last Sprite + -6-- ---- X (Sign Bit) + --54 3210 Tiles Bank ($400 tiles each) + + Each text sprite is 2x2 tiles + +***************************************************************************/ + +void suna8_state::draw_text_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int ypos, bool write_mask) { UINT8 *spriteram = m_spriteram; - int i; int max_x = m_screen->width() - 8; int max_y = m_screen->height() - 8; - for (i = 0x1900; i < 0x19ff; i += 4) + bool last = false; + for (int i = start; i < end && !last; i += 4) { int srcpg, srcx,srcy, dimx,dimy, tx, ty; @@ -408,13 +485,13 @@ void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &clipre int bank = spriteram[i + 3]; if (~code & 0x80) continue; + last = !(bank & 0x80); - dimx = 2; dimy = m_text_dim; - srcx = (code & 0xf) * 2; srcy = (y & 0xf0) / 8; + dimx = 2; dimy = 2; + srcx = (code & 0xf) * 2; srcy = ((y & 0xf8) - (ypos & 0xf8) - 0x10) / 8; srcpg = (code >> 4) & 3; x = x - ((bank & 0x40) ? 0x100 : 0); - y = 0; bank = (bank & 0x3f) * 0x400; @@ -422,11 +499,9 @@ void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &clipre { for (tx = 0; tx < dimx; tx ++) { - int real_ty = (ty < (dimy/2)) ? ty : (ty + 0x20 - dimy); - int addr = (srcpg * 0x20 * 0x20) + ((srcx + tx) & 0x1f) * 0x20 + - ((srcy + real_ty) & 0x1f); + ((srcy + ty) & 0x1f); int tile = spriteram[addr*2 + 0]; int attr = spriteram[addr*2 + 1]; @@ -435,7 +510,7 @@ void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &clipre int flipy = attr & 0x80; int sx = x + tx * 8; - int sy = (y + real_ty * 8) & 0xff; + int sy = (0xf0 - ypos + ty * 8) & 0xff; if (flip_screen()) { @@ -443,14 +518,24 @@ void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &clipre sy = max_y - sy; flipy = !flipy; } - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, tile + (attr & 0x3)*0x100 + bank, (attr >> 2) & 0xf, flipx, flipy, - sx, sy, 0xf); + sx, sy, 0xf ); } } + } + if (write_mask) + { + // Fill the text sprites row with high priority for masking + int sy = (0xf0 - ypos) & 0xff; + if (flip_screen()) + sy = max_y - sy - 8; + rectangle text_clip(cliprect.min_x, cliprect.max_x, sy, sy + 0x10 - 1); + text_clip &= cliprect; + screen.priority().fill(1, text_clip); } } @@ -464,7 +549,7 @@ void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &clipre UINT32 suna8_state::screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - /* see hardhead, hardhea2 test mode (press button 2 for both players) */ + // see hardhead, hardhea2 test mode (press button 2 for both players) bitmap.fill(0xff, cliprect); #ifdef MAME_DEBUG @@ -481,7 +566,7 @@ UINT32 suna8_state::screen_update_suna8(screen_device &screen, bitmap_ind16 &bit if (machine().input().code_pressed_once(KEYCODE_S)) { m_trombank++; machine().tilemap().mark_all_dirty(); } m_trombank &= 0xf; - m_page &= m_text_dim ? 3 : (m_gfxdecode->gfx(1) ? 15 : 7); + m_page &= m_has_text ? 3 : (m_gfxdecode->gfx(1) ? 15 : 7); m_tiles %= max_tiles; if (m_tiles < 0) m_tiles += max_tiles; @@ -493,21 +578,17 @@ UINT32 suna8_state::screen_update_suna8(screen_device &screen, bitmap_ind16 &bit m_rombank, m_palettebank, m_spritebank, m_page, m_tiles, m_trombank); #endif + return 0; } - else #endif #endif - { - // Normal sprites - draw_normal_sprites(bitmap,cliprect, 0); - // More normal sprites (second sprite "chip" in sparkman) - if (m_gfxdecode->gfx(1)) - draw_normal_sprites(bitmap,cliprect, 1); + // Sprites + draw_sprites(screen, bitmap, cliprect, 0x1d00, 0x2000, 0); + + // More sprites (second sprite "chip" in sparkman) + if (m_gfxdecode->gfx(1)) + draw_sprites(screen, bitmap, cliprect, 0x1d00, 0x2000, 1); - // Text sprites (earlier games only) - if (m_text_dim) - draw_text_sprites(bitmap,cliprect); - } return 0; } From 9f5eb3fa26c51cef8a84e1e5fa66305d21d5ee66 Mon Sep 17 00:00:00 2001 From: Luca Elia Date: Sun, 6 Sep 2015 16:55:28 +0200 Subject: [PATCH 6/7] remove unneeded drawgfxm.h include (nw) --- src/mame/video/hng64.c | 1 - src/mame/video/pc080sn.c | 1 - src/mame/video/pc090oj.c | 1 - src/mame/video/tc0100scn.c | 1 - src/mame/video/tc0110pcr.c | 1 - src/mame/video/tc0150rod.c | 1 - src/mame/video/tc0180vcu.c | 1 - src/mame/video/tc0280grd.c | 1 - src/mame/video/tc0360pri.c | 1 - src/mame/video/tc0480scp.c | 1 - 10 files changed, 10 deletions(-) diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c index e128297842b..69642b4b168 100644 --- a/src/mame/video/hng64.c +++ b/src/mame/video/hng64.c @@ -1,7 +1,6 @@ // license:LGPL-2.1+ // copyright-holders:David Haywood, Angelo Salese, ElSemi, Andrew Gardner #include "emu.h" -#include "drawgfxm.h" #include "includes/hng64.h" #define BLEND_TEST 0 diff --git a/src/mame/video/pc080sn.c b/src/mame/video/pc080sn.c index 4332cfcc8a2..73c74b68a3d 100644 --- a/src/mame/video/pc080sn.c +++ b/src/mame/video/pc080sn.c @@ -42,7 +42,6 @@ Control registers */ #include "emu.h" -#include "drawgfxm.h" #include "pc080sn.h" #include "video/taito_helper.h" diff --git a/src/mame/video/pc090oj.c b/src/mame/video/pc090oj.c index 21341da6c0c..d9b56ff9d94 100644 --- a/src/mame/video/pc090oj.c +++ b/src/mame/video/pc090oj.c @@ -60,7 +60,6 @@ Taito pc090oj */ #include "emu.h" -#include "drawgfxm.h" #include "pc090oj.h" #define PC090OJ_RAM_SIZE 0x4000 diff --git a/src/mame/video/tc0100scn.c b/src/mame/video/tc0100scn.c index abe0a708c07..dc9e16489ce 100644 --- a/src/mame/video/tc0100scn.c +++ b/src/mame/video/tc0100scn.c @@ -141,7 +141,6 @@ the wide tilemap mode) */ #include "emu.h" -#include "drawgfxm.h" #include "tc0100scn.h" #define TC0100SCN_RAM_SIZE 0x14000 /* enough for double-width tilemaps */ diff --git a/src/mame/video/tc0110pcr.c b/src/mame/video/tc0110pcr.c index 52e9c685c67..f9c87099122 100644 --- a/src/mame/video/tc0110pcr.c +++ b/src/mame/video/tc0110pcr.c @@ -13,7 +13,6 @@ The data bus is 16 bits wide. */ #include "emu.h" -#include "drawgfxm.h" #include "tc0110pcr.h" #define TC0110PCR_RAM_SIZE 0x2000 diff --git a/src/mame/video/tc0150rod.c b/src/mame/video/tc0150rod.c index dcaa18c2742..2e7a0ce98fa 100644 --- a/src/mame/video/tc0150rod.c +++ b/src/mame/video/tc0150rod.c @@ -7,7 +7,6 @@ Road generator. Two roads allow for forking. Gfx data fetched from ROM. Refer to */ #include "emu.h" -#include "drawgfxm.h" #include "tc0150rod.h" #include "video/taito_helper.h" diff --git a/src/mame/video/tc0180vcu.c b/src/mame/video/tc0180vcu.c index 563c313a4de..29809218cfd 100644 --- a/src/mame/video/tc0180vcu.c +++ b/src/mame/video/tc0180vcu.c @@ -3,7 +3,6 @@ /* Taito TC0180VCU */ #include "emu.h" -#include "drawgfxm.h" #include "tc0180vcu.h" #define TC0180VCU_RAM_SIZE 0x10000 diff --git a/src/mame/video/tc0280grd.c b/src/mame/video/tc0280grd.c index 09563ca1864..a4532102250 100644 --- a/src/mame/video/tc0280grd.c +++ b/src/mame/video/tc0280grd.c @@ -21,7 +21,6 @@ control registers: */ #include "emu.h" -#include "drawgfxm.h" #include "tc0280grd.h" #define TC0280GRD_RAM_SIZE 0x2000 diff --git a/src/mame/video/tc0360pri.c b/src/mame/video/tc0360pri.c index 93e4d434b82..43bf42ee1ef 100644 --- a/src/mame/video/tc0360pri.c +++ b/src/mame/video/tc0360pri.c @@ -40,7 +40,6 @@ each one of them can declare to have four different priority levels. */ #include "emu.h" -#include "drawgfxm.h" #include "tc0360pri.h" diff --git a/src/mame/video/tc0480scp.c b/src/mame/video/tc0480scp.c index 85800fbbff4..1c2aa3eea2a 100644 --- a/src/mame/video/tc0480scp.c +++ b/src/mame/video/tc0480scp.c @@ -142,7 +142,6 @@ Control registers */ #include "emu.h" -#include "drawgfxm.h" #include "tc0480scp.h" #include "video/taito_helper.h" From 9a49d1faebafe97d5e401a1879b514c89830f5bd Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 6 Sep 2015 23:18:04 +0800 Subject: [PATCH 7/7] cmast91: document Show Odds In Double Up Game [hsialin]; correct settings for '7' In Double Up Game and move to uniform descriptions [Vas Crabb] --- src/mame/drivers/goldstar.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c index 4b47b253799..89c0b9f53c6 100644 --- a/src/mame/drivers/goldstar.c +++ b/src/mame/drivers/goldstar.c @@ -1741,25 +1741,25 @@ static INPUT_PORTS_START( cmast91 ) PORT_INCLUDE( cmv4_service ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1") /* OK */ + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1") /* OK */ PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Hopper Out Switch" ) PORT_DIPLOCATION("DSW1:2") /* OK */ + PORT_DIPNAME( 0x02, 0x02, "Hopper Out Switch" ) PORT_DIPLOCATION("DSW1:2") /* OK */ PORT_DIPSETTING( 0x02, "Active Low" ) PORT_DIPSETTING( 0x00, "Active High" ) - PORT_DIPNAME( 0x04, 0x00, "Payout Mode" ) PORT_DIPLOCATION("DSW1:3") /* OK */ + PORT_DIPNAME( 0x04, 0x00, "Payout Mode" ) PORT_DIPLOCATION("DSW1:3") /* OK */ PORT_DIPSETTING( 0x04, "Payout Switch" ) PORT_DIPSETTING( 0x00, "Automatic" ) - PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" ) PORT_DIPLOCATION("DSW1:4") /* not checked */ - PORT_DIPSETTING( 0x08, "Loss" ) - PORT_DIPSETTING( 0x00, "Even" ) - PORT_DIPNAME( 0x10, 0x00, "W-UP Pay Rate" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPNAME( 0x08, 0x00, "'7' In Double Up Game" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x08, "Even" ) + PORT_DIPSETTING( 0x00, "Loss" ) + PORT_DIPNAME( 0x10, 0x00, "Double Up Game Pay Rate" ) PORT_DIPLOCATION("DSW1:5") /* OK */ PORT_DIPSETTING( 0x00, "80%" ) PORT_DIPSETTING( 0x10, "90%" ) - PORT_DIPNAME( 0x20, 0x00, "W-UP Game" ) PORT_DIPLOCATION("DSW1:6") /* OK */ + PORT_DIPNAME( 0x20, 0x00, "Double Up Game" ) PORT_DIPLOCATION("DSW1:6") /* OK */ PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0xc0, "Bet Max" ) PORT_DIPLOCATION("DSW1:7,8") /* OK */ + PORT_DIPNAME( 0xc0, 0xc0, "Bet Max" ) PORT_DIPLOCATION("DSW1:7,8") /* OK */ PORT_DIPSETTING( 0x00, "8" ) PORT_DIPSETTING( 0x40, "16" ) PORT_DIPSETTING( 0x80, "32" ) @@ -1787,18 +1787,18 @@ static INPUT_PORTS_START( cmast91 ) PORT_INCLUDE( cmv4_dsw5 ) PORT_MODIFY("DSW5") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") /* normally Display of Doll On Demo, but no whores in this set */ + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") /* normally Display of Doll On Demo, but no whores in this set */ PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* Coin In Limit OK */ /* Condition For 3 Kind Of Bonus not checked */ - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") /* normally Display Of Doll At All Fr. Bonus, but no whores in this set */ - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Skill Stop" ) PORT_DIPLOCATION("DSW5:7") /* OK */ + PORT_DIPNAME( 0x20, 0x20, "Show Odds In Double Up Game" ) PORT_DIPLOCATION("DSW5:6") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Skill Stop" ) PORT_DIPLOCATION("DSW5:7") /* OK */ PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") /* normally Test Mode For Disp. Of Doll, but no whores in this set */ + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") /* normally Test Mode For Disp. Of Doll, but no whores in this set */ PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END