@@ -124,7 +124,7 @@ Check zr107.cpp for details on the top board.
124
124
125
125
Operation Thunder Hurricane uses an additional top board gun/analog controls. Analog inputs are controlled by two CCD
126
126
cameras, one from each gun. This specific variation uses a K056230 for networking between the cpu board to receive
127
- the analog values that way. Teraburst uses a different variation of this I/O board replacing the K056230 with a K056800 (see hornet.cpp).
127
+ the analog values that way. Teraburst uses a different variation of this I/O board replacing the K056230 with a K056800 (see konami/ hornet.cpp).
128
128
129
129
GN680 PWB(E)403381B
130
130
|------------------------------------------|
@@ -245,6 +245,16 @@ Hang Pilot (uses an unknown but similar video board) 12W
245
245
#include " speaker.h"
246
246
247
247
248
+ #define LOG_SYSREG (1 << 1 )
249
+
250
+ #define LOG_ALL (LOG_SYSREG)
251
+
252
+ #define VERBOSE (0 )
253
+
254
+ #include " logmacro.h"
255
+
256
+ #define LOGSYSREG (...) LOGMASKED(LOG_SYSREG, __VA_ARGS__)
257
+
248
258
namespace {
249
259
250
260
#define DEBUG_GTI (0 )
@@ -256,7 +266,7 @@ class gticlub_base_state : public driver_device
256
266
: driver_device(mconfig, type, tag)
257
267
, m_maincpu(*this , " maincpu" )
258
268
, m_audiocpu(*this , " audiocpu" )
259
- , m_dsp(*this , { " dsp" , " dsp2 " }) // TODO: hardcoded tags in machine/konpc.cpp
269
+ , m_dsp(*this , " dsp%u " , 1U )
260
270
, m_k056800(*this , " k056800" )
261
271
, m_adc1038(*this , " adc1038" )
262
272
, m_eeprom(*this , " eeprom" )
@@ -266,6 +276,7 @@ class gticlub_base_state : public driver_device
266
276
, m_k001604(*this , " k001604%u" , 1U )
267
277
, m_work_ram(*this , " work_ram" )
268
278
, m_sharc_dataram(*this , " sharc%u_dataram" , 0U )
279
+ , m_cgboard_bank(*this , " cgboard_%u_bank" , 0U )
269
280
, m_analog(*this , " AN%u" , 0U )
270
281
, m_ports(*this , " IN%u" , 0 )
271
282
, m_pcb_digit(*this , " pcbdigit%u" , 0U )
@@ -290,12 +301,14 @@ class gticlub_base_state : public driver_device
290
301
optional_device_array<k001604_device, 2 > m_k001604;
291
302
required_shared_ptr<uint32_t > m_work_ram;
292
303
optional_shared_ptr_array<uint32_t , 2 > m_sharc_dataram;
304
+ optional_memory_bank_array<2 > m_cgboard_bank;
293
305
optional_ioport_array<4 > m_analog;
294
306
required_ioport_array<4 > m_ports;
295
307
output_finder<2 > m_pcb_digit;
296
308
memory_view m_cg_view;
297
309
298
- static rgb_t gticlub_XR5G5B5 (uint32_t raw);
310
+ emu_timer *m_sound_irq_timer = nullptr ;
311
+
299
312
uint8_t sysreg_r (offs_t offset);
300
313
void sysreg_w (offs_t offset, uint8_t data);
301
314
void soundtimer_en_w (uint16_t data);
@@ -306,8 +319,6 @@ class gticlub_base_state : public driver_device
306
319
int adc1038_input_callback (int input);
307
320
308
321
void sound_memmap (address_map &map) ATTR_COLD;
309
-
310
- emu_timer *m_sound_irq_timer = nullptr ;
311
322
};
312
323
313
324
// with GN678 Video board
@@ -361,7 +372,6 @@ class thunderh_state : public gticlub_state
361
372
};
362
373
363
374
// with Voodoo based video board
364
-
365
375
class hangplt_state : public gticlub_base_state
366
376
{
367
377
public:
@@ -382,16 +392,10 @@ class hangplt_state : public gticlub_base_state
382
392
template <uint8_t Which> uint32_t screen_update (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
383
393
384
394
void hangplt_map (address_map &map) ATTR_COLD;
385
- void hangplt_sharc0_map (address_map &map) ATTR_COLD;
386
- void hangplt_sharc1_map (address_map &map) ATTR_COLD;
395
+ template <unsigned Board> void hangplt_sharc_map (address_map &map) ATTR_COLD;
387
396
};
388
397
389
398
390
- rgb_t gticlub_base_state::gticlub_XR5G5B5 (uint32_t raw)
391
- {
392
- return rgb_t (pal5bit (raw >> 10 ), pal5bit (raw >> 5 ), pal5bit (raw >> 0 ));
393
- }
394
-
395
399
/* *****************************************************************/
396
400
397
401
uint8_t gticlub_base_state::sysreg_r (offs_t offset)
@@ -420,7 +424,8 @@ uint8_t gticlub_base_state::sysreg_r(offs_t offset)
420
424
}
421
425
422
426
default :
423
- osd_printf_debug (" sysreg_r %d\n " , offset);
427
+ if (!machine ().side_effects_disabled ())
428
+ LOGSYSREG (" sysreg_r %d\n " , offset);
424
429
break ;
425
430
}
426
431
return 0 ;
@@ -436,20 +441,20 @@ void gticlub_base_state::sysreg_w(offs_t offset, uint8_t data)
436
441
break ;
437
442
438
443
case 3 :
439
- m_eeprom->di_write ((data & 0x01 ) ? 1 : 0 );
440
- m_eeprom->clk_write ((data & 0x02 ) ? ASSERT_LINE : CLEAR_LINE );
441
- m_eeprom->cs_write ((data & 0x04 ) ? ASSERT_LINE : CLEAR_LINE );
444
+ m_eeprom->di_write (BIT (data, 0 ) );
445
+ m_eeprom->clk_write (BIT (data, 1 ) );
446
+ m_eeprom->cs_write (BIT (data, 2 ) );
442
447
break ;
443
448
444
449
case 4 :
445
- if (data & 0x80 ) // CG Board 1 IRQ Ack
450
+ if (BIT ( data, 7 ) ) // CG Board 1 IRQ Ack
446
451
m_maincpu->set_input_line (INPUT_LINE_IRQ1, CLEAR_LINE);
447
452
448
- if (data & 0x40 ) // CG Board 0 IRQ Ack
453
+ if (BIT ( data, 6 ) ) // CG Board 0 IRQ Ack
449
454
m_maincpu->set_input_line (INPUT_LINE_IRQ0, CLEAR_LINE);
450
455
451
- m_adc1038->di_write ((data >> 0 ) & 1 );
452
- m_adc1038->clk_write ((data >> 1 ) & 1 );
456
+ m_adc1038->di_write (BIT (data, 0 ) );
457
+ m_adc1038->clk_write (BIT (data, 1 ) );
453
458
454
459
m_konppc->set_cgboard_id ((data >> 4 ) & 0x3 );
455
460
m_cg_view.select (m_konppc->get_cgboard_id () ? 1 : 0 );
@@ -470,7 +475,7 @@ TIMER_CALLBACK_MEMBER(gticlub_base_state::sound_irq)
470
475
471
476
void gticlub_base_state::soundtimer_en_w (uint16_t data)
472
477
{
473
- if (data & 1 )
478
+ if (BIT ( data, 0 ) )
474
479
{
475
480
// Reset and disable timer
476
481
m_sound_irq_timer->adjust (attotime::from_usec (m_sound_timer_usec));
@@ -585,34 +590,23 @@ void thunderh_state::gn680_memmap(address_map &map)
585
590
586
591
void gticlub_state::sharc_map (address_map &map)
587
592
{
588
- map (0x400000 , 0x41ffff ).rw (m_konppc, FUNC (konppc_device::cgboard_0_shared_sharc_r ), FUNC (konppc_device::cgboard_0_shared_sharc_w ));
593
+ map (0x400000 , 0x41ffff ).rw (m_konppc, FUNC (konppc_device::cgboard_shared_sharc_r< 0 > ), FUNC (konppc_device::cgboard_shared_sharc_w< 0 > ));
589
594
map (0x500000 , 0x5fffff ).ram ().share (m_sharc_dataram[0 ]).lr32 (NAME ([this ](offs_t offset) { return m_sharc_dataram[0 ][offset] & 0xffff ; }));
590
595
map (0x600000 , 0x6fffff ).rw (m_k001005, FUNC (k001005_device::read), FUNC (k001005_device::write));
591
- map (0x700000 , 0x7000ff ).rw (m_konppc, FUNC (konppc_device::cgboard_0_comm_sharc_r), FUNC (konppc_device::cgboard_0_comm_sharc_w));
592
- }
593
-
594
- void hangplt_state::hangplt_sharc0_map (address_map &map)
595
- {
596
- map (0x0400000 , 0x041ffff ).rw (m_konppc, FUNC (konppc_device::cgboard_0_shared_sharc_r), FUNC (konppc_device::cgboard_0_shared_sharc_w));
597
- map (0x0500000 , 0x05fffff ).ram ().share (m_sharc_dataram[0 ]).lr32 (NAME ([this ](offs_t offset) { return m_sharc_dataram[0 ][offset] & 0xffff ; }));
598
- map (0x1400000 , 0x14fffff ).ram ();
599
- map (0x2400000 , 0x27fffff ).r (m_konppc, FUNC (konppc_device::nwk_voodoo_0_r)).w (m_voodoo[0 ], FUNC (generic_voodoo_device::write));
600
- map (0x3400000 , 0x34000ff ).rw (m_konppc, FUNC (konppc_device::cgboard_0_comm_sharc_r), FUNC (konppc_device::cgboard_0_comm_sharc_w));
601
- map (0x3401000 , 0x34fffff ).w (m_konppc, FUNC (konppc_device::nwk_fifo_0_w));
602
- map (0x3500000 , 0x3507fff ).rw (m_konppc, FUNC (konppc_device::K033906_0_r), FUNC (konppc_device::K033906_0_w));
603
- map (0x3600000 , 0x37fffff ).bankr (" master_cgboard_bank" );
596
+ map (0x700000 , 0x7000ff ).rw (m_konppc, FUNC (konppc_device::cgboard_comm_sharc_r<0 >), FUNC (konppc_device::cgboard_comm_sharc_w<0 >));
604
597
}
605
598
606
- void hangplt_state::hangplt_sharc1_map (address_map &map)
599
+ template <unsigned Board>
600
+ void hangplt_state::hangplt_sharc_map (address_map &map)
607
601
{
608
- map (0x0400000 , 0x041ffff ).rw (m_konppc, FUNC (konppc_device::cgboard_1_shared_sharc_r ), FUNC (konppc_device::cgboard_1_shared_sharc_w ));
609
- map (0x0500000 , 0x05fffff ).ram ().share (m_sharc_dataram[1 ]).lr32 (NAME ([this ](offs_t offset) { return m_sharc_dataram[1 ][offset] & 0xffff ; }));
602
+ map (0x0400000 , 0x041ffff ).rw (m_konppc, FUNC (konppc_device::cgboard_shared_sharc_r<Board> ), FUNC (konppc_device::cgboard_shared_sharc_w<Board> ));
603
+ map (0x0500000 , 0x05fffff ).ram ().share (m_sharc_dataram[Board ]).lr32 (NAME ([this ](offs_t offset) { return m_sharc_dataram[Board ][offset] & 0xffff ; }));
610
604
map (0x1400000 , 0x14fffff ).ram ();
611
- map (0x2400000 , 0x27fffff ).r (m_konppc, FUNC (konppc_device::nwk_voodoo_1_r )).w (m_voodoo[1 ], FUNC (generic_voodoo_device::write));
612
- map (0x3400000 , 0x34000ff ).rw (m_konppc, FUNC (konppc_device::cgboard_1_comm_sharc_r ), FUNC (konppc_device::cgboard_1_comm_sharc_w ));
613
- map (0x3401000 , 0x34fffff ).w (m_konppc, FUNC (konppc_device::nwk_fifo_1_w ));
614
- map (0x3500000 , 0x3507fff ).rw (m_konppc, FUNC (konppc_device::K033906_1_r ), FUNC (konppc_device::K033906_1_w ));
615
- map (0x3600000 , 0x37fffff ).bankr (" slave_cgboard_bank " );
605
+ map (0x2400000 , 0x27fffff ).r (m_konppc, FUNC (konppc_device::nwk_voodoo_r<Board> )).w (m_voodoo[Board ], FUNC (generic_voodoo_device::write));
606
+ map (0x3400000 , 0x34000ff ).rw (m_konppc, FUNC (konppc_device::cgboard_comm_sharc_r<Board> ), FUNC (konppc_device::cgboard_comm_sharc_w<Board> ));
607
+ map (0x3401000 , 0x34fffff ).w (m_konppc, FUNC (konppc_device::nwk_voodoo_fifo_w<Board> ));
608
+ map (0x3500000 , 0x3507fff ).rw (m_konppc, FUNC (konppc_device::cgboard_k033906_r<Board> ), FUNC (konppc_device::cgboard_k033906_w<Board> ));
609
+ map (0x3600000 , 0x37fffff ).bankr (m_cgboard_bank[Board] );
616
610
}
617
611
618
612
/* ****************************************************************************/
@@ -918,7 +912,7 @@ void gticlub_state::gticlub(machine_config &config)
918
912
screen.set_visarea (40 , 511 +40 , 28 , 383 +28 ); // needs CRTC emulation
919
913
screen.set_screen_update (FUNC (gticlub_state::screen_update));
920
914
921
- PALETTE (config, m_palette[0 ]).set_format (4 , >iclub_state::gticlub_XR5G5B5 , 16384 );
915
+ PALETTE (config, m_palette[0 ]).set_format (4 , raw_to_rgb_converter::standard_rgb_decoder< 5 , 5 , 5 , 10 , 5 , 0 > , 16384 );
922
916
923
917
K001604 (config, m_k001604[0 ], 0 );
924
918
m_k001604[0 ]->set_palette (m_palette[0 ]);
@@ -944,8 +938,9 @@ void gticlub_state::gticlub(machine_config &config)
944
938
rfsnd.add_route (1 , " rspeaker" , 1.0 );
945
939
946
940
KONPPC (config, m_konppc, 0 );
941
+ m_konppc->set_dsp_tag (0 , m_dsp[0 ]);
947
942
m_konppc->set_num_boards (1 );
948
- m_konppc->set_cbboard_type (konppc_device::CGBOARD_TYPE_GTICLUB);
943
+ m_konppc->set_cgboard_type (konppc_device::CGBOARD_TYPE_GTICLUB);
949
944
}
950
945
951
946
void thunderh_state::thunderh (machine_config &config)
@@ -978,11 +973,11 @@ void hangplt_state::hangplt(machine_config &config)
978
973
979
974
ADSP21062 (config, m_dsp[0 ], XTAL (36'000'000 ));
980
975
m_dsp[0 ]->set_boot_mode (adsp21062_device::BOOT_MODE_EPROM);
981
- m_dsp[0 ]->set_addrmap (AS_DATA, &hangplt_state::hangplt_sharc0_map );
976
+ m_dsp[0 ]->set_addrmap (AS_DATA, &hangplt_state::hangplt_sharc_map< 0 > );
982
977
983
978
ADSP21062 (config, m_dsp[1 ], XTAL (36'000'000 ));
984
979
m_dsp[1 ]->set_boot_mode (adsp21062_device::BOOT_MODE_EPROM);
985
- m_dsp[1 ]->set_addrmap (AS_DATA, &hangplt_state::hangplt_sharc1_map );
980
+ m_dsp[1 ]->set_addrmap (AS_DATA, &hangplt_state::hangplt_sharc_map< 1 > );
986
981
987
982
config.set_maximum_quantum (attotime::from_hz (6000 ));
988
983
@@ -1016,8 +1011,8 @@ void hangplt_state::hangplt(machine_config &config)
1016
1011
K033906 (config, " k033906_2" , 0 , m_voodoo[1 ]);
1017
1012
1018
1013
// video hardware
1019
- PALETTE (config, m_palette[0 ]).set_format (4 , >iclub_state::gticlub_XR5G5B5 , 16384 );
1020
- PALETTE (config, m_palette[1 ]).set_format (4 , >iclub_state::gticlub_XR5G5B5 , 16384 );
1014
+ PALETTE (config, m_palette[0 ]).set_format (4 , raw_to_rgb_converter::standard_rgb_decoder< 5 , 5 , 5 , 10 , 5 , 0 > , 16384 );
1015
+ PALETTE (config, m_palette[1 ]).set_format (4 , raw_to_rgb_converter::standard_rgb_decoder< 5 , 5 , 5 , 10 , 5 , 0 > , 16384 );
1021
1016
1022
1017
screen_device &lscreen (SCREEN (config, " lscreen" , SCREEN_TYPE_RASTER));
1023
1018
lscreen.set_refresh_hz (60 );
@@ -1048,8 +1043,16 @@ void hangplt_state::hangplt(machine_config &config)
1048
1043
rfsnd.add_route (1 , " rspeaker" , 1.0 );
1049
1044
1050
1045
KONPPC (config, m_konppc, 0 );
1046
+ m_konppc->set_dsp_tag (0 , m_dsp[0 ]);
1047
+ m_konppc->set_dsp_tag (1 , m_dsp[1 ]);
1048
+ m_konppc->set_k033906_tag (0 , " k033906_1" );
1049
+ m_konppc->set_k033906_tag (1 , " k033906_2" );
1050
+ m_konppc->set_voodoo_tag (0 , m_voodoo[0 ]);
1051
+ m_konppc->set_voodoo_tag (1 , m_voodoo[1 ]);
1052
+ m_konppc->set_texture_bank_tag (0 , m_cgboard_bank[0 ]);
1053
+ m_konppc->set_texture_bank_tag (1 , m_cgboard_bank[1 ]);
1051
1054
m_konppc->set_num_boards (2 );
1052
- m_konppc->set_cbboard_type (konppc_device::CGBOARD_TYPE_HANGPLT);
1055
+ m_konppc->set_cgboard_type (konppc_device::CGBOARD_TYPE_HANGPLT);
1053
1056
}
1054
1057
1055
1058
/* ************************************************************************/
@@ -1348,7 +1351,7 @@ ROM_START( hangplt ) // Japan version JAB
1348
1351
ROM_LOAD ( " 685a09.9s" , 0x000000 , 0x400000 , CRC(b8ae40aa) SHA1(eee27a8929e0e805f1045fd9638e661b36a1e3c7) )
1349
1352
ROM_LOAD ( " 685a10.7s" , 0x400000 , 0x400000 , CRC(fef3dc36) SHA1(566c7469fc452b5965a31fa42291082ec8e48a24) )
1350
1353
1351
- ROM_REGION (0x800000 , " master_cgboard " , 0 ) // texture roms
1354
+ ROM_REGION (0x1000000 , " cgboard_0 " , ROMREGION_ERASE00 ) // texture roms
1352
1355
ROM_LOAD32_WORD ( " 685a13.4w" , 0x000002 , 0x400000 , CRC(06329af4) SHA1(76cad9db604751ce48bb67bfd29e57bac0ee9a16) )
1353
1356
ROM_LOAD32_WORD ( " 685a14.12w" , 0x000000 , 0x400000 , CRC(87437739 ) SHA1(0d45637af40938a54d5efd29c125b0fafd55f9a4) )
1354
1357
@@ -1374,7 +1377,7 @@ ROM_START( hangpltu ) // USA version UAA
1374
1377
ROM_LOAD ( " 685a09.9s" , 0x000000 , 0x400000 , CRC(b8ae40aa) SHA1(eee27a8929e0e805f1045fd9638e661b36a1e3c7) )
1375
1378
ROM_LOAD ( " 685a10.7s" , 0x400000 , 0x400000 , CRC(fef3dc36) SHA1(566c7469fc452b5965a31fa42291082ec8e48a24) )
1376
1379
1377
- ROM_REGION (0x800000 , " master_cgboard " , 0 ) // texture roms
1380
+ ROM_REGION (0x1000000 , " cgboard_0 " , ROMREGION_ERASE00 ) // texture roms
1378
1381
ROM_LOAD32_WORD ( " 685a13.4w" , 0x000002 , 0x400000 , CRC(06329af4) SHA1(76cad9db604751ce48bb67bfd29e57bac0ee9a16) )
1379
1382
ROM_LOAD32_WORD ( " 685a14.12w" , 0x000000 , 0x400000 , CRC(87437739 ) SHA1(0d45637af40938a54d5efd29c125b0fafd55f9a4) )
1380
1383
@@ -1390,8 +1393,8 @@ void gticlub_state::init_gticlub()
1390
1393
1391
1394
void hangplt_state::init_hangplt_common ()
1392
1395
{
1393
- m_konppc-> set_cgboard_texture_bank (0 , " master_cgboard_bank " , memregion (" master_cgboard " )->base ());
1394
- m_konppc-> set_cgboard_texture_bank ( 1 , " slave_cgboard_bank " , memregion (" master_cgboard " )->base ());
1396
+ m_cgboard_bank[ 0 ]-> configure_entries (0 , 2 , memregion (" cgboard_0 " )->base (), 0x800000 );
1397
+ m_cgboard_bank[ 1 ]-> configure_entries ( 0 , 2 , memregion (" cgboard_0 " )->base (), 0x800000 );
1395
1398
}
1396
1399
1397
1400
void hangplt_state::init_hangplt () // fixme: remove hacks and actually emulate the step lock. Possibly similar to Alpine Racer 1/2 and Alpine Surfer?
0 commit comments