9090**************************************************************************************************/
9191
9292#include " emu.h"
93+
9394#include " cpu/z80/z80.h"
9495#include " machine/eepromser.h"
9596#include " machine/nvram.h"
9697#include " sound/okim6295.h"
98+
9799#include " emupal.h"
98100#include " screen.h"
99101#include " speaker.h"
@@ -113,13 +115,14 @@ class spool99_state : public driver_device
113115 m_gfxdecode (*this , " gfxdecode" ),
114116 m_main (*this , " mainram" ),
115117 m_vram (*this , " vram" ),
116- m_cram (*this , " cram" )
118+ m_cram (*this , " cram" ),
119+ m_maincpu_rom (*this , " maincpu" )
117120 { }
118121
119- void vcarn (machine_config &config);
120- void spool99 (machine_config &config);
122+ void vcarn (machine_config &config) ATTR_COLD ;
123+ void spool99 (machine_config &config) ATTR_COLD ;
121124
122- void init_spool99 ();
125+ void init_spool99 () ATTR_COLD ;
123126
124127protected:
125128 virtual void video_start () override ATTR_COLD;
@@ -133,6 +136,7 @@ class spool99_state : public driver_device
133136 required_shared_ptr<uint8_t > m_main;
134137 required_shared_ptr<uint8_t > m_vram;
135138 required_shared_ptr<uint8_t > m_cram;
139+ required_region_ptr<uint8_t > m_maincpu_rom;
136140
137141 tilemap_t *m_sc0_tilemap = nullptr ;
138142
@@ -152,13 +156,10 @@ class spool99_state : public driver_device
152156
153157TILE_GET_INFO_MEMBER (spool99_state::get_tile_info)
154158{
155- int code = ((m_vram[tile_index* 2 + 1 ]<< 8 ) | (m_vram[tile_index* 2 + 0 ]));
156- int color = m_cram[tile_index* 2 + 0 ];
159+ int const code = ((m_vram[tile_index * 2 + 1 ] << 8 ) | (m_vram[tile_index * 2 ]));
160+ int const color = m_cram[tile_index * 2 ];
157161
158- tileinfo.set (0 ,
159- code & 0x3fff ,
160- color & 0x1f ,
161- 0 );
162+ tileinfo.set (0 , code & 0x3fff , color & 0x1f , 0 );
162163}
163164
164165void spool99_state::video_start ()
@@ -175,24 +176,22 @@ uint32_t spool99_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
175176void spool99_state::vram_w (offs_t offset, uint8_t data)
176177{
177178 m_vram[offset] = data;
178- m_sc0_tilemap->mark_tile_dirty (offset/ 2 );
179+ m_sc0_tilemap->mark_tile_dirty (offset / 2 );
179180}
180181
181182void spool99_state::cram_w (offs_t offset, uint8_t data)
182183{
183184 m_cram[offset] = data;
184- m_sc0_tilemap->mark_tile_dirty (offset/ 2 );
185+ m_sc0_tilemap->mark_tile_dirty (offset / 2 );
185186}
186187
187188
188189
189190uint8_t spool99_state::spool99_io_r (offs_t offset)
190191{
191- uint8_t *ROM = memregion (" maincpu" )->base ();
192-
193192// if(!(io_switch))
194193 {
195- switch (offset+ 0xaf00 )
194+ switch (offset + 0xaf00 )
196195 {
197196 case 0xafd8 : return ioport (" COIN1" )->read ();
198197// case 0xafd9: return 1;
@@ -213,9 +212,9 @@ uint8_t spool99_state::spool99_io_r(offs_t offset)
213212 case 0xaff8 : return m_oki->read ();
214213 }
215214 }
216- // printf("%04x %d\n",offset+ 0xaf00,io_switch);
215+ // printf("%04x %d\n", offset + 0xaf00, io_switch);
217216
218- return ROM [0xaf00 + offset];
217+ return m_maincpu_rom [0xaf00 + offset];
219218}
220219
221220
@@ -239,7 +238,7 @@ void spool99_state::eeprom_dataline_w(uint8_t data)
239238
240239void spool99_state::spool99_map (address_map &map)
241240{
242- map (0x0000 , 0x00ff ).ram ().share (" mainram " );
241+ map (0x0000 , 0x00ff ).ram ().share (m_main );
243242 map (0x0100 , 0xaeff ).rom ().region (" maincpu" , 0x100 ).nopw ();
244243 map (0xaf00 , 0xafff ).r (FUNC (spool99_state::spool99_io_r));
245244 map (0xafed , 0xafed ).w (FUNC (spool99_state::eeprom_resetline_w));
@@ -250,17 +249,15 @@ void spool99_state::spool99_map(address_map &map)
250249 map (0xb000 , 0xb3ff ).ram ().w (" palette" , FUNC (palette_device::write8)).share (" palette" );
251250
252251 map (0xb800 , 0xdfff ).ram ().share (" nvram" );
253- map (0xe000 , 0xefff ).ram ().w (FUNC (spool99_state::vram_w)).share (" vram " );
254- map (0xf000 , 0xffff ).ram ().w (FUNC (spool99_state::cram_w)).share (" cram " );
252+ map (0xe000 , 0xefff ).ram ().w (FUNC (spool99_state::vram_w)).share (m_vram );
253+ map (0xf000 , 0xffff ).ram ().w (FUNC (spool99_state::cram_w)).share (m_cram );
255254}
256255
257256uint8_t spool99_state::vcarn_io_r (offs_t offset)
258257{
259- uint8_t *ROM = memregion (" maincpu" )->base ();
260-
261258// if(!(io_switch))
262259 {
263- switch (offset+ 0xa700 )
260+ switch (offset + 0xa700 )
264261 {
265262 case 0xa720 : return ioport (" SERVICE1" )->read ();// attract mode
266263 case 0xa722 : return ioport (" COIN1" )->read ();
@@ -279,14 +276,14 @@ uint8_t spool99_state::vcarn_io_r(offs_t offset)
279276
280277 }
281278 }
282- // printf("%04x\n",offset+ 0xa700);
279+ // printf("%04x\n", offset + 0xa700);
283280
284- return ROM [0xa700 + offset];
281+ return m_maincpu_rom [0xa700 + offset];
285282}
286283
287284void spool99_state::vcarn_map (address_map &map)
288285{
289- map (0x0000 , 0x00ff ).ram ().share (" mainram " );
286+ map (0x0000 , 0x00ff ).ram ().share (m_main );
290287 map (0x0100 , 0xa6ff ).rom ().region (" maincpu" , 0x100 ).nopw ();
291288 map (0xa700 , 0xa7ff ).r (FUNC (spool99_state::vcarn_io_r));
292289 map (0xa745 , 0xa745 ).w (FUNC (spool99_state::eeprom_resetline_w));
@@ -298,8 +295,8 @@ void spool99_state::vcarn_map(address_map &map)
298295
299296 map (0xb000 , 0xdfff ).ram ().share (" nvram" );
300297// map(0xdf00, 0xdfff).rw(FUNC(spool99_state::vcarn_io_r), FUNC(spool99_state::vcarn_io_w)).share("vcarn_io");
301- map (0xe000 , 0xefff ).ram ().w (FUNC (spool99_state::vram_w)).share (" vram " );
302- map (0xf000 , 0xffff ).ram ().w (FUNC (spool99_state::cram_w)).share (" cram " );
298+ map (0xe000 , 0xefff ).ram ().w (FUNC (spool99_state::vram_w)).share (m_vram );
299+ map (0xf000 , 0xffff ).ram ().w (FUNC (spool99_state::cram_w)).share (m_cram );
303300}
304301
305302
@@ -371,7 +368,7 @@ INPUT_PORTS_END
371368
372369void spool99_state::spool99(machine_config &config)
373370{
374- Z80 (config, m_maincpu, 24000000 / 8 );
371+ Z80 (config, m_maincpu, 14 .318181_MHz_XTAL / 4 );
375372 m_maincpu->set_addrmap (AS_PROGRAM, &spool99_state::spool99_map);
376373 m_maincpu->set_vblank_int (" screen" , FUNC (spool99_state::irq0_line_hold));
377374
@@ -392,7 +389,7 @@ void spool99_state::spool99(machine_config &config)
392389
393390 SPEAKER (config, " speaker" , 2 ).front ();
394391
395- OKIM6295 (config, m_oki, 1000000 , okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
392+ OKIM6295 (config, m_oki, 1_MHz_XTAL , okim6295_device::PIN7_HIGH); // pin 7 not verified
396393 m_oki->add_route (ALL_OUTPUTS, " speaker" , 0.47 , 0 );
397394 m_oki->add_route (ALL_OUTPUTS, " speaker" , 0.47 , 1 );
398395}
@@ -401,6 +398,7 @@ void spool99_state::vcarn(machine_config &config)
401398{
402399 spool99 (config);
403400 m_maincpu->set_addrmap (AS_PROGRAM, &spool99_state::vcarn_map);
401+ m_maincpu->set_clock (12_MHz_XTAL / 4 );
404402
405403 subdevice<screen_device>(" screen" )->set_visarea (0 *8 , 64 *8 -1 , 1 *8 , 31 *8 -1 ); // 512x240, raw guess
406404}
@@ -410,7 +408,7 @@ ROM_START( spool99 )
410408 ROM_REGION ( 0x40000 , " maincpu" , 0 ) // z80 code
411409 ROM_LOAD ( " v.36.u2" , 0x00000 , 0x10000 , CRC(29527f38) SHA1(bf302f4c6eb53ea55fe1ace7bc9bc7a68ad269e6) )
412410
413- ROM_REGION ( 0x040000 , " oki" , 0 ) /* Samples */
411+ ROM_REGION ( 0x040000 , " oki" , 0 )
414412 ROM_LOAD ( " u32.bin" , 0x00000 , 0x40000 , CRC(1b7aa54c) SHA1(87fc4da8d2a85bc3ce00d8f0f03fef0027e8454a) )
415413
416414 ROM_REGION ( 0x080000 , " gfx" , 0 )
@@ -422,7 +420,7 @@ ROM_START( spool99a )
422420 ROM_LOAD ( " sp99v.u2" , 0x00000 , 0x10000 , CRC(ca6cf364) SHA1(1be82af26db6730e00c01581ac0bea2057c2f1c6) ) // first half empty!
423421 ROM_CONTINUE ( 0x00000 , 0x10000 ) // 0x0000 - 0xafff used
424422
425- ROM_REGION ( 0x040000 , " oki" , 0 ) /* Samples */
423+ ROM_REGION ( 0x040000 , " oki" , 0 )
426424 ROM_LOAD ( " 272001.u32" , 0x00000 , 0x40000 , CRC(1b7aa54c) SHA1(87fc4da8d2a85bc3ce00d8f0f03fef0027e8454a) )
427425
428426 ROM_REGION ( 0x080000 , " gfx" , 0 )
@@ -434,7 +432,7 @@ ROM_START( spool99b )
434432 ROM_LOAD ( " u2.bin" , 0x00000 , 0x10000 , CRC(488dd1bf) SHA1(7289b639fa56722d1f60d8c4bda566d726f8e00b) ) // first half empty!
435433 ROM_CONTINUE ( 0x00000 , 0x10000 ) // 0x0000 - 0xafff used
436434
437- ROM_REGION ( 0x040000 , " oki" , 0 ) /* Samples */
435+ ROM_REGION ( 0x040000 , " oki" , 0 )
438436 ROM_LOAD ( " u32.bin" , 0x00000 , 0x40000 , CRC(1b7aa54c) SHA1(87fc4da8d2a85bc3ce00d8f0f03fef0027e8454a) )
439437
440438 ROM_REGION ( 0x080000 , " gfx" , 0 )
@@ -446,19 +444,32 @@ ROM_START( spool99c )
446444 ROM_LOAD ( " u2_v26.bin" , 0x00000 , 0x10000 , CRC(df8b561e) SHA1(bd2321e1154a45fc5abca15a37cb0b04023466bf) ) // first half empty!
447445 ROM_CONTINUE ( 0x00000 , 0x10000 ) // 0x0000 - 0xafff used
448446
449- ROM_REGION ( 0x040000 , " oki" , 0 ) /* Samples */
447+ ROM_REGION ( 0x040000 , " oki" , 0 )
450448 ROM_LOAD ( " u32_v26.bin" , 0x00000 , 0x40000 , CRC(1b7aa54c) SHA1(87fc4da8d2a85bc3ce00d8f0f03fef0027e8454a) )
451449
452450 ROM_REGION ( 0x080000 , " gfx" , 0 )
453451 ROM_LOAD ( " u15_v26.bin" , 0x00000 , 0x80000 , CRC(3d79f3df) SHA1(4ba2a09cba94889d29feca481667326da7757061) )
454452ROM_END
455453
454+ // bootleg PCB. Different layout but almost same components. Has a Dallas 1230Y-100 NVRAM.
455+ ROM_START ( scardy2k )
456+ ROM_REGION ( 0x40000 , " maincpu" , 0 ) // z80 code
457+ ROM_LOAD ( " 3.u10" , 0x00000 , 0x10000 , CRC(4daddc0c) SHA1(c0dec75f9395dcd582a4472f071ddfb0aadcf3af) ) // AM27C010, 0xxxxxxxxxxxxxxxx = 0xFF
458+ ROM_CONTINUE ( 0x00000 , 0x10000 ) // 0x0000 - 0xafff used
459+
460+ ROM_REGION ( 0x040000 , " oki" , 0 )
461+ ROM_LOAD ( " 1.u24" , 0x00000 , 0x40000 , CRC(1b7aa54c) SHA1(87fc4da8d2a85bc3ce00d8f0f03fef0027e8454a) ) // MX27C2000, matches the spool99 sets
462+
463+ ROM_REGION ( 0x080000 , " gfx" , 0 )
464+ ROM_LOAD ( " 2.u15" , 0x00000 , 0x80000 , CRC(a179633e) SHA1(352583b1697e4fd4f70857f4f8a3875002cc2fe3) ) // M27C4001
465+ ROM_END
466+
456467ROM_START ( vcarn )
457468 ROM_REGION ( 0x40000 , " maincpu" , 0 ) // z80 code
458469 ROM_LOAD ( " 3.u2" , 0x00000 , 0x10000 , CRC(e7c33032) SHA1(e769c83b6d2b48e347ad6112b4379f6e16bcc6e0) ) // first half empty!
459470 ROM_CONTINUE ( 0x00000 , 0x10000 ) // 0x0000 - 0xafff used
460471
461- ROM_REGION ( 0x080000 , " oki" , 0 ) /* Samples */
472+ ROM_REGION ( 0x080000 , " oki" , 0 )
462473 ROM_LOAD ( " 1.u32" , 0x00000 , 0x80000 , CRC(8a0aa6b5) SHA1(dc39cb26607fabdcb3e74a60943cf88456172d09) )
463474
464475 ROM_REGION ( 0x080000 , " gfx" , 0 )
@@ -476,8 +487,9 @@ void spool99_state::init_spool99()
476487} // anonymous namespace
477488
478489
479- GAME ( 1998 , spool99, 0 , spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.36)" , MACHINE_SUPPORTS_SAVE )
480- GAME( 1998 , spool99a, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.33)" , MACHINE_SUPPORTS_SAVE )
481- GAME( 1998 , spool99b, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.31)" , MACHINE_SUPPORTS_SAVE )
482- GAME( 1998 , spool99c, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.26)" , MACHINE_SUPPORTS_SAVE )
490+ GAME ( 1998 , spool99, 0 , spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.36)" , MACHINE_SUPPORTS_SAVE )
491+ GAME( 1998 , spool99a, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.33)" , MACHINE_SUPPORTS_SAVE )
492+ GAME( 1998 , spool99b, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.31)" , MACHINE_SUPPORTS_SAVE )
493+ GAME( 1998 , spool99c, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Super Pool 99 (Version 0.26)" , MACHINE_SUPPORTS_SAVE )
494+ GAME( 2000 , scardy2k, spool99, spool99, spool99, spool99_state, init_spool99, ROT0, " bootleg (CV)" , " Super Card Y2000K (Version 0.26)" , MACHINE_SUPPORTS_SAVE )
483495GAME( 1998 ?, vcarn, 0 , vcarn, spool99, spool99_state, init_spool99, ROT0, " Electronic Projects" , " Video Carnival 1999 / Super Royal Card (Version 0.11)" , MACHINE_SUPPORTS_SAVE ) // claims '98, '99 printed on PCB
0 commit comments