1
1
// license:BSD-3-Clause
2
- // copyright-holders:Angelo Salese, David Haywood
3
- /* ******************************************************************************************
2
+ // copyright-holders:Angelo Salese, David Haywood, Pierpaolo Prazzoli
3
+ /* *************************************************************************************************
4
4
5
5
Best League (c) 1993
6
6
7
7
A Big Striker Italian bootleg (made by Playmark?) running on a different hardware.
8
8
9
- driver by David Haywood & Angelo Salese
10
-
11
- Changes 29/03/2005 - Pierpaolo Prazzoli
12
- - Fixed tilemaps and sprites offset
13
- - Fixed visible area
14
- - Fixed dip-switches
15
- - Added oki banking
16
- - Added sprites wraparound
17
- - Added sprites color masking
18
-
19
- Dip Locations added according to Service Mode
20
-
21
- *******************************************************************************************/
9
+ **************************************************************************************************/
22
10
23
11
#include " emu.h"
24
12
#include " cpu/m68000/m68000.h"
25
13
#include " sound/okim6295.h"
14
+
26
15
#include " emupal.h"
27
16
#include " screen.h"
28
17
#include " speaker.h"
@@ -34,19 +23,31 @@ namespace {
34
23
class bestleag_state : public driver_device
35
24
{
36
25
public:
37
- bestleag_state (const machine_config &mconfig, device_type type, const char *tag) :
38
- driver_device (mconfig, type, tag),
39
- m_maincpu (*this , " maincpu " ),
40
- m_oki (*this , " oki " ),
41
- m_gfxdecode (*this , " gfxdecode " ),
42
- m_palette (*this , " palette " ),
43
- m_bgram (*this , " bgram " ),
44
- m_fgram (*this , " fgram " ),
45
- m_txram (*this , " txram " ),
46
- m_vregs (*this , " vregs " ),
47
- m_spriteram (*this , " spriteram" )
26
+ bestleag_state (const machine_config &mconfig, device_type type, const char *tag)
27
+ : driver_device(mconfig, type, tag)
28
+ , m_vregs (*this , " vregs " )
29
+ , m_maincpu (*this , " maincpu " )
30
+ , m_oki (*this , " oki " )
31
+ , m_gfxdecode (*this , " gfxdecode " )
32
+ , m_palette (*this , " palette " )
33
+ , m_bgram (*this , " bgram " )
34
+ , m_fgram (*this , " fgram " )
35
+ , m_txram (*this , " txram " )
36
+ , m_spriteram(*this , " spriteram" )
48
37
{ }
49
38
39
+ void bestleag (machine_config &config);
40
+
41
+ protected:
42
+ tilemap_t *m_tx_tilemap = nullptr ;
43
+ tilemap_t *m_bg_tilemap = nullptr ;
44
+ tilemap_t *m_fg_tilemap = nullptr ;
45
+ void draw_sprites (bitmap_ind16 &bitmap, const rectangle &cliprect);
46
+
47
+ virtual uint32_t screen_update (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
48
+ required_shared_ptr<uint16_t > m_vregs;
49
+
50
+ private:
50
51
required_device<cpu_device> m_maincpu;
51
52
required_device<okim6295_device> m_oki;
52
53
required_device<gfxdecode_device> m_gfxdecode;
@@ -55,12 +56,8 @@ class bestleag_state : public driver_device
55
56
required_shared_ptr<uint16_t > m_bgram;
56
57
required_shared_ptr<uint16_t > m_fgram;
57
58
required_shared_ptr<uint16_t > m_txram;
58
- required_shared_ptr<uint16_t > m_vregs;
59
59
required_shared_ptr<uint16_t > m_spriteram;
60
60
61
- tilemap_t *m_tx_tilemap = nullptr ;
62
- tilemap_t *m_bg_tilemap = nullptr ;
63
- tilemap_t *m_fg_tilemap = nullptr ;
64
61
65
62
void txram_w (offs_t offset, uint16_t data);
66
63
void bgram_w (offs_t offset, uint16_t data);
@@ -70,20 +67,23 @@ class bestleag_state : public driver_device
70
67
TILE_GET_INFO_MEMBER (get_tx_tile_info);
71
68
TILE_GET_INFO_MEMBER (get_bg_tile_info);
72
69
TILE_GET_INFO_MEMBER (get_fg_tile_info);
73
- TILEMAP_MAPPER_MEMBER (bsb_bg_scan );
70
+ TILEMAP_MAPPER_MEMBER (bg_scan );
74
71
75
72
virtual void video_start () override ATTR_COLD;
76
73
77
- uint32_t screen_update_bestleag (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
78
- uint32_t screen_update_bestleaw (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
79
- void draw_sprites (bitmap_ind16 &bitmap, const rectangle &cliprect);
80
- void bestleag (machine_config &config);
81
- void bestleaw (machine_config &config);
82
- void bestleag_map (address_map &map) ATTR_COLD;
74
+ void main_map (address_map &map) ATTR_COLD;
83
75
};
84
76
77
+ class bestleaw_state : public bestleag_state
78
+ {
79
+ public:
80
+ bestleaw_state (const machine_config &mconfig, device_type type, const char *tag)
81
+ : bestleag_state(mconfig, type, tag)
82
+ { }
85
83
86
- /* Video Handling */
84
+ protected:
85
+ virtual uint32_t screen_update (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override ATTR_COLD;
86
+ };
87
87
88
88
89
89
TILE_GET_INFO_MEMBER (bestleag_state::get_tx_tile_info)
@@ -116,7 +116,7 @@ TILE_GET_INFO_MEMBER(bestleag_state::get_fg_tile_info)
116
116
0 );
117
117
}
118
118
119
- TILEMAP_MAPPER_MEMBER (bestleag_state::bsb_bg_scan )
119
+ TILEMAP_MAPPER_MEMBER (bestleag_state::bg_scan )
120
120
{
121
121
int offset;
122
122
@@ -130,22 +130,19 @@ TILEMAP_MAPPER_MEMBER(bestleag_state::bsb_bg_scan)
130
130
void bestleag_state::video_start ()
131
131
{
132
132
m_tx_tilemap = &machine ().tilemap ().create (*m_gfxdecode, tilemap_get_info_delegate (*this , FUNC (bestleag_state::get_tx_tile_info)), TILEMAP_SCAN_COLS, 8 , 8 , 256 , 32 );
133
- m_bg_tilemap = &machine ().tilemap ().create (*m_gfxdecode, tilemap_get_info_delegate (*this , FUNC (bestleag_state::get_bg_tile_info)), tilemap_mapper_delegate (*this , FUNC (bestleag_state::bsb_bg_scan )), 16 , 16 , 128 , 64 );
134
- m_fg_tilemap = &machine ().tilemap ().create (*m_gfxdecode, tilemap_get_info_delegate (*this , FUNC (bestleag_state::get_fg_tile_info)), tilemap_mapper_delegate (*this , FUNC (bestleag_state::bsb_bg_scan )), 16 , 16 , 128 , 64 );
133
+ m_bg_tilemap = &machine ().tilemap ().create (*m_gfxdecode, tilemap_get_info_delegate (*this , FUNC (bestleag_state::get_bg_tile_info)), tilemap_mapper_delegate (*this , FUNC (bestleag_state::bg_scan )), 16 , 16 , 128 , 64 );
134
+ m_fg_tilemap = &machine ().tilemap ().create (*m_gfxdecode, tilemap_get_info_delegate (*this , FUNC (bestleag_state::get_fg_tile_info)), tilemap_mapper_delegate (*this , FUNC (bestleag_state::bg_scan )), 16 , 16 , 128 , 64 );
135
135
136
136
m_tx_tilemap->set_transparent_pen (15 );
137
137
m_fg_tilemap->set_transparent_pen (15 );
138
138
}
139
139
140
+ /*
141
+ * Sprites are the same to sslam, but using 16x16 sprites instead of 8x8,
142
+ * moved start address to 0x16/2?
143
+ */
140
144
void bestleag_state::draw_sprites (bitmap_ind16 &bitmap, const rectangle &cliprect)
141
145
{
142
- /*
143
- Sprites are the same to sslam, but using 16x16 sprites instead of 8x8
144
-
145
- Note: sprite chip is different than the other Big Striker sets and they
146
- include several similiarities with other Playmark games (including
147
- the sprite end code and the data being offset (i.e. spriteram starting from 0x16/2))
148
- */
149
146
for (int offs = 0x16 /2 ; offs < m_spriteram.length () - 3 ; offs += 4 )
150
147
{
151
148
int code = m_spriteram[offs+3 ] & 0xfff ;
@@ -189,7 +186,7 @@ void bestleag_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
189
186
}
190
187
}
191
188
192
- uint32_t bestleag_state::screen_update_bestleag (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
189
+ uint32_t bestleag_state::screen_update (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
193
190
{
194
191
m_bg_tilemap->set_scrollx (0 ,(m_vregs[0x00 /2 ] & 0xfff ) + (m_vregs[0x08 /2 ] & 0x7 ) - 3 );
195
192
m_bg_tilemap->set_scrolly (0 ,m_vregs[0x02 /2 ]);
@@ -205,7 +202,7 @@ uint32_t bestleag_state::screen_update_bestleag(screen_device &screen, bitmap_in
205
202
return 0 ;
206
203
}
207
204
208
- uint32_t bestleag_state::screen_update_bestleaw (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
205
+ uint32_t bestleaw_state::screen_update (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
209
206
{
210
207
m_bg_tilemap->set_scrollx (0 ,m_vregs[0x08 /2 ]);
211
208
m_bg_tilemap->set_scrolly (0 ,m_vregs[0x0a /2 ]);
@@ -245,9 +242,8 @@ void bestleag_state::oki_bank_w(uint16_t data)
245
242
}
246
243
247
244
248
- /* Memory Map */
249
245
250
- void bestleag_state::bestleag_map (address_map &map)
246
+ void bestleag_state::main_map (address_map &map)
251
247
{
252
248
map (0x000000 , 0x03ffff ).rom ();
253
249
map (0x0d2000 , 0x0d3fff ).noprw (); // left over from the original game (only read / written in memory test)
@@ -346,15 +342,15 @@ static INPUT_PORTS_START( bestleag )
346
342
PORT_SERVICE_DIPLOC( 0x80 , IP_ACTIVE_LOW, " SW.B:8" )
347
343
INPUT_PORTS_END
348
344
349
- /* GFX Decode */
345
+
350
346
static const gfx_layout bestleag_charlayout =
351
347
{
352
348
8 ,8 ,
353
349
RGN_FRAC (1 ,4 ),
354
350
4 ,
355
351
{ RGN_FRAC (3 ,4 ), RGN_FRAC (2 ,4 ), RGN_FRAC (1 ,4 ), RGN_FRAC (0 ,4 ) },
356
- { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
357
- { 0 *8 , 2 *8 , 4 *8 , 6 *8 ,1 *8 ,3 *8 ,5 *8 ,7 *8 },
352
+ { STEP8 ( 0 , 1 ) },
353
+ { 0 *8 , 2 *8 , 4 *8 , 6 *8 , 1 *8 , 3 *8 , 5 *8 , 7 *8 },
358
354
8 *8
359
355
};
360
356
@@ -364,9 +360,8 @@ static const gfx_layout bestleag_char16layout =
364
360
RGN_FRAC (1 ,4 ),
365
361
4 ,
366
362
{ RGN_FRAC (3 ,4 ), RGN_FRAC (2 ,4 ), RGN_FRAC (1 ,4 ), RGN_FRAC (0 ,4 ) },
367
- { 0 ,1 ,2 , 3 , 4 , 5 , 6 , 7 ,
368
- 128 +0 ,128 +1 ,128 +2 ,128 +3 ,128 +4 ,128 +5 ,128 +6 ,128 +7 },
369
- { 0 *8 ,1 *8 ,2 *8 ,3 *8 ,4 *8 ,5 *8 ,6 *8 ,7 *8 ,8 *8 ,9 *8 ,10 *8 ,11 *8 ,12 *8 ,13 *8 ,14 *8 ,15 *8 },
363
+ { STEP8 (0 , 1 ), STEP8 (128 , 1 ) },
364
+ { STEP16 (0 , 8 ) },
370
365
16 *16
371
366
};
372
367
@@ -379,15 +374,15 @@ GFXDECODE_END
379
374
void bestleag_state::bestleag(machine_config &config)
380
375
{
381
376
M68000 (config, m_maincpu, 12000000 );
382
- m_maincpu->set_addrmap (AS_PROGRAM, &bestleag_state::bestleag_map );
377
+ m_maincpu->set_addrmap (AS_PROGRAM, &bestleag_state::main_map );
383
378
m_maincpu->set_vblank_int (" screen" , FUNC (bestleag_state::irq6_line_hold));
384
379
385
380
screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
386
381
screen.set_refresh_hz (60 );
387
382
screen.set_vblank_time (ATTOSECONDS_IN_USEC (0 ));
388
383
screen.set_size (32 *8 , 32 *8 );
389
384
screen.set_visarea (0 *8 , 32 *8 -1 , 2 *8 , 30 *8 -1 );
390
- screen.set_screen_update (FUNC (bestleag_state::screen_update_bestleag ));
385
+ screen.set_screen_update (FUNC (bestleag_state::screen_update ));
391
386
screen.set_palette (m_palette);
392
387
393
388
GFXDECODE (config, m_gfxdecode, m_palette, gfx_bestleag);
@@ -401,14 +396,6 @@ void bestleag_state::bestleag(machine_config &config)
401
396
m_oki->add_route (ALL_OUTPUTS, " rspeaker" , 1.00 );
402
397
}
403
398
404
- void bestleag_state::bestleaw (machine_config &config)
405
- {
406
- bestleag (config);
407
- subdevice<screen_device>(" screen" )->set_screen_update (FUNC (bestleag_state::screen_update_bestleaw));
408
- }
409
-
410
-
411
- /* Rom Loading */
412
399
413
400
ROM_START ( bestleag )
414
401
ROM_REGION ( 0x40000 , " maincpu" , 0 ) /* 68000 Code */
@@ -478,7 +465,5 @@ ROM_END
478
465
} // anonymous namespace
479
466
480
467
481
- /* GAME drivers */
482
-
483
468
GAME ( 1993 , bestleag, bigstrik, bestleag, bestleag, bestleag_state, empty_init, ROT0, " bootleg" , " Best League (bootleg of Big Striker, Italian Serie A)" , MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
484
- GAME( 1993 , bestleaw, bigstrik, bestleaw , bestleag, bestleag_state , empty_init, ROT0, " bootleg" , " Best League (bootleg of Big Striker, World Cup)" , MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
469
+ GAME( 1993 , bestleaw, bigstrik, bestleag , bestleag, bestleaw_state , empty_init, ROT0, " bootleg" , " Best League (bootleg of Big Striker, World Cup)" , MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
0 commit comments