summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/balsente.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/balsente.h')
-rw-r--r--src/mame/includes/balsente.h270
1 files changed, 123 insertions, 147 deletions
diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h
index 7692272846f..b5fa0467412 100644
--- a/src/mame/includes/balsente.h
+++ b/src/mame/includes/balsente.h
@@ -8,6 +8,7 @@
***************************************************************************/
+#include "machine/pit8253.h"
#include "machine/timer.h"
#include "machine/74259.h"
#include "sound/cem3394.h"
@@ -35,28 +36,126 @@ class balsente_state : public driver_device
{
public:
balsente_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_scanline_timer(*this, "scan_timer"),
- m_counter_0_timer(*this, "8253_0_timer"),
- m_cem1(*this, "cem1"),
- m_cem2(*this, "cem2"),
- m_cem3(*this, "cem3"),
- m_cem4(*this, "cem4"),
- m_cem5(*this, "cem5"),
- m_cem6(*this, "cem6") ,
- m_spriteram(*this, "spriteram"),
- m_videoram(*this, "videoram"),
- m_shrike_io(*this, "shrike_io"),
- m_shrike_shared(*this, "shrike_shared"),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_68k(*this, "68k"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette"),
- m_outlatch(*this, "outlatch"),
- m_generic_paletteram_8(*this, "paletteram") { }
+ : driver_device(mconfig, type, tag)
+ , m_scanline_timer(*this, "scan_timer")
+ , m_pit(*this, "pit")
+ , m_counter_0_timer(*this, "8253_0_timer")
+ , m_cem_device(*this, "cem%u", 1U)
+ , m_spriteram(*this, "spriteram")
+ , m_videoram(*this, "videoram")
+ , m_shrike_io(*this, "shrike_io")
+ , m_shrike_shared(*this, "shrike_shared")
+ , m_maincpu(*this, "maincpu")
+ , m_audiocpu(*this, "audiocpu")
+ , m_68k(*this, "68k")
+ , m_screen(*this, "screen")
+ , m_palette(*this, "palette")
+ , m_outlatch(*this, "outlatch")
+ , m_generic_paletteram_8(*this, "paletteram")
+ { }
+
+ void shrike(machine_config &config);
+ void balsente(machine_config &config);
+ DECLARE_CUSTOM_INPUT_MEMBER(nstocker_bits_r);
+ void init_otwalls();
+ void init_triviaes();
+ void init_nstocker();
+ void init_sentetst();
+ void init_rescraid();
+ void init_minigolf();
+ void init_stompin();
+ void init_snakepit();
+ void init_spiker();
+ void init_hattrick();
+ void init_teamht();
+ void init_toggle();
+ void init_snakjack();
+ void init_grudge();
+ void init_sfootbal();
+ void init_triviag2();
+ void init_cshift();
+ void init_gimeabrk();
+ void init_stocker();
+ void init_triviag1();
+ void init_shrike();
+ void init_minigolf2();
+ void init_nametune();
+ void init_gghost();
+
+private:
+ DECLARE_WRITE8_MEMBER(random_reset_w);
+ DECLARE_READ8_MEMBER(random_num_r);
+ DECLARE_WRITE8_MEMBER(rombank_select_w);
+ DECLARE_WRITE8_MEMBER(rombank2_select_w);
+ DECLARE_WRITE_LINE_MEMBER(out0_w);
+ DECLARE_WRITE_LINE_MEMBER(out1_w);
+ DECLARE_WRITE_LINE_MEMBER(out2_w);
+ DECLARE_WRITE_LINE_MEMBER(out3_w);
+ DECLARE_WRITE_LINE_MEMBER(out4_w);
+ DECLARE_WRITE_LINE_MEMBER(out5_w);
+ DECLARE_WRITE_LINE_MEMBER(out6_w);
+ DECLARE_WRITE_LINE_MEMBER(nvrecall_w);
+ DECLARE_READ8_MEMBER(m6850_r);
+ DECLARE_WRITE8_MEMBER(m6850_w);
+ DECLARE_READ8_MEMBER(m6850_sound_r);
+ DECLARE_WRITE8_MEMBER(m6850_sound_w);
+ DECLARE_READ8_MEMBER(adc_data_r);
+ DECLARE_WRITE8_MEMBER(adc_select_w);
+ DECLARE_READ8_MEMBER(counter_state_r);
+ DECLARE_WRITE8_MEMBER(counter_control_w);
+ DECLARE_WRITE8_MEMBER(chip_select_w);
+ DECLARE_WRITE8_MEMBER(dac_data_w);
+ DECLARE_WRITE8_MEMBER(register_addr_w);
+ DECLARE_WRITE8_MEMBER(spiker_expand_w);
+ DECLARE_READ8_MEMBER(spiker_expand_r);
+ DECLARE_READ8_MEMBER(grudge_steering_r);
+ DECLARE_READ8_MEMBER(shrike_shared_6809_r);
+ DECLARE_WRITE8_MEMBER(shrike_shared_6809_w);
+ DECLARE_WRITE16_MEMBER(shrike_io_68k_w);
+ DECLARE_READ16_MEMBER(shrike_io_68k_r);
+ DECLARE_READ8_MEMBER(teamht_extra_r);
+ DECLARE_WRITE8_MEMBER(teamht_multiplex_select_w);
+ DECLARE_WRITE_LINE_MEMBER(counter_0_set_out);
+
+ void update_counter_0_timer();
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE8_MEMBER(palette_select_w);
+ DECLARE_WRITE8_MEMBER(paletteram_w);
+ DECLARE_WRITE8_MEMBER(shrike_sprite_select_w);
+
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+ uint32_t screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(update_analog_inputs);
+ TIMER_CALLBACK_MEMBER(irq_off);
+ TIMER_CALLBACK_MEMBER(m6850_data_ready_callback);
+ TIMER_CALLBACK_MEMBER(m6850_w_callback);
+ TIMER_CALLBACK_MEMBER(adc_finished);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(clock_counter_0_ff);
+ void draw_one_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *sprite);
+ void poly17_init();
+ void m6850_update_io();
+ DECLARE_WRITE_LINE_MEMBER(set_counter_0_ff);
+ void update_grudge_steering();
+ void expand_roms(uint8_t cd_rom_mask);
+ inline void config_shooter_adc(uint8_t shooter, uint8_t adc_shift);
+ inline void noise_gen_chip(int chip, int count, short *buffer);
+ CEM3394_EXT_INPUT(noise_gen_0);
+ CEM3394_EXT_INPUT(noise_gen_1);
+ CEM3394_EXT_INPUT(noise_gen_2);
+ CEM3394_EXT_INPUT(noise_gen_3);
+ CEM3394_EXT_INPUT(noise_gen_4);
+ CEM3394_EXT_INPUT(noise_gen_5);
+
+ void cpu1_map(address_map &map);
+ void cpu2_io_map(address_map &map);
+ void cpu2_map(address_map &map);
+ void shrike68k_map(address_map &map);
required_device<timer_device> m_scanline_timer;
+ required_device<pit8253_device> m_pit;
/* global data */
uint8_t m_shooter;
@@ -64,26 +163,12 @@ public:
uint8_t m_shooter_y;
uint8_t m_adc_shift;
- /* 8253 counter state */
- struct
- {
- timer_device *timer;
- uint8_t timer_active;
- int32_t initial;
- int32_t count;
- uint8_t gate;
- uint8_t out;
- uint8_t mode;
- uint8_t readbyte;
- uint8_t writebyte;
- } m_counter[3];
-
-
/* manually clocked counter 0 states */
uint8_t m_counter_control;
- uint8_t m_counter_0_ff;
+ bool m_counter_0_ff;
+ bool m_counter_0_out;
required_device<timer_device> m_counter_0_timer;
- uint8_t m_counter_0_timer_active;
+ bool m_counter_0_timer_active;
/* random number generator states */
uint8_t m_poly17[POLY17_SIZE + 1];
@@ -113,13 +198,7 @@ public:
/* noise generator states */
uint32_t m_noise_position[6];
- required_device<cem3394_device> m_cem1;
- required_device<cem3394_device> m_cem2;
- required_device<cem3394_device> m_cem3;
- required_device<cem3394_device> m_cem4;
- required_device<cem3394_device> m_cem5;
- required_device<cem3394_device> m_cem6;
- cem3394_device *m_cem_device[6];
+ required_device_array<cem3394_device, 6> m_cem_device;
/* game-specific states */
uint8_t m_nstocker_bits;
@@ -142,103 +221,6 @@ public:
required_shared_ptr<uint8_t> m_videoram;
optional_shared_ptr<uint16_t> m_shrike_io;
optional_shared_ptr<uint16_t> m_shrike_shared;
-
- DECLARE_WRITE8_MEMBER(balsente_random_reset_w);
- DECLARE_READ8_MEMBER(balsente_random_num_r);
- DECLARE_WRITE8_MEMBER(balsente_rombank_select_w);
- DECLARE_WRITE8_MEMBER(balsente_rombank2_select_w);
- DECLARE_WRITE_LINE_MEMBER(out0_w);
- DECLARE_WRITE_LINE_MEMBER(out1_w);
- DECLARE_WRITE_LINE_MEMBER(out2_w);
- DECLARE_WRITE_LINE_MEMBER(out3_w);
- DECLARE_WRITE_LINE_MEMBER(out4_w);
- DECLARE_WRITE_LINE_MEMBER(out5_w);
- DECLARE_WRITE_LINE_MEMBER(out6_w);
- DECLARE_WRITE_LINE_MEMBER(nvrecall_w);
- DECLARE_READ8_MEMBER(balsente_m6850_r);
- DECLARE_WRITE8_MEMBER(balsente_m6850_w);
- DECLARE_READ8_MEMBER(balsente_m6850_sound_r);
- DECLARE_WRITE8_MEMBER(balsente_m6850_sound_w);
- DECLARE_READ8_MEMBER(balsente_adc_data_r);
- DECLARE_WRITE8_MEMBER(balsente_adc_select_w);
- DECLARE_READ8_MEMBER(balsente_counter_8253_r);
- DECLARE_WRITE8_MEMBER(balsente_counter_8253_w);
- DECLARE_READ8_MEMBER(balsente_counter_state_r);
- DECLARE_WRITE8_MEMBER(balsente_counter_control_w);
- DECLARE_WRITE8_MEMBER(balsente_chip_select_w);
- DECLARE_WRITE8_MEMBER(balsente_dac_data_w);
- DECLARE_WRITE8_MEMBER(balsente_register_addr_w);
- DECLARE_WRITE8_MEMBER(spiker_expand_w);
- DECLARE_READ8_MEMBER(spiker_expand_r);
- DECLARE_READ8_MEMBER(grudge_steering_r);
- DECLARE_READ8_MEMBER(shrike_shared_6809_r);
- DECLARE_WRITE8_MEMBER(shrike_shared_6809_w);
- DECLARE_WRITE16_MEMBER(shrike_io_68k_w);
- DECLARE_READ16_MEMBER(shrike_io_68k_r);
- DECLARE_READ8_MEMBER(teamht_extra_r);
- DECLARE_WRITE8_MEMBER(teamht_multiplex_select_w);
-
- void counter_set_out(int which, int out);
- void counter_start(int which);
- void counter_stop( int which);
- void counter_update_count(int which);
- void counter_set_gate(int which, int gate);
- void update_counter_0_timer();
- DECLARE_WRITE8_MEMBER(balsente_videoram_w);
- DECLARE_WRITE8_MEMBER(balsente_palette_select_w);
- DECLARE_WRITE8_MEMBER(balsente_paletteram_w);
- DECLARE_WRITE8_MEMBER(shrike_sprite_select_w);
- DECLARE_CUSTOM_INPUT_MEMBER(nstocker_bits_r);
- void init_otwalls();
- void init_triviaes();
- void init_nstocker();
- void init_sentetst();
- void init_rescraid();
- void init_minigolf();
- void init_stompin();
- void init_snakepit();
- void init_spiker();
- void init_hattrick();
- void init_teamht();
- void init_toggle();
- void init_snakjack();
- void init_grudge();
- void init_sfootbal();
- void init_triviag2();
- void init_cshift();
- void init_gimeabrk();
- void init_stocker();
- void init_triviag1();
- void init_shrike();
- void init_minigolf2();
- void init_nametune();
- void init_gghost();
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
- uint32_t screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(balsente_update_analog_inputs);
- TIMER_CALLBACK_MEMBER(irq_off);
- TIMER_CALLBACK_MEMBER(m6850_data_ready_callback);
- TIMER_CALLBACK_MEMBER(m6850_w_callback);
- TIMER_CALLBACK_MEMBER(adc_finished);
- TIMER_DEVICE_CALLBACK_MEMBER(balsente_interrupt_timer);
- TIMER_DEVICE_CALLBACK_MEMBER(balsente_counter_callback);
- TIMER_DEVICE_CALLBACK_MEMBER(balsente_clock_counter_0_ff);
- void draw_one_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *sprite);
- void poly17_init();
- void m6850_update_io();
- void set_counter_0_ff(timer_device &timer, int newstate);
- void update_grudge_steering();
- void expand_roms(uint8_t cd_rom_mask);
- inline void config_shooter_adc(uint8_t shooter, uint8_t adc_shift);
- inline void noise_gen_chip(int chip, int count, short *buffer);
- CEM3394_EXT_INPUT(noise_gen_0);
- CEM3394_EXT_INPUT(noise_gen_1);
- CEM3394_EXT_INPUT(noise_gen_2);
- CEM3394_EXT_INPUT(noise_gen_3);
- CEM3394_EXT_INPUT(noise_gen_4);
- CEM3394_EXT_INPUT(noise_gen_5);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_68k;
@@ -246,12 +228,6 @@ public:
required_device<palette_device> m_palette;
required_device<ls259_device> m_outlatch;
required_shared_ptr<uint8_t> m_generic_paletteram_8;
- void shrike(machine_config &config);
- void balsente(machine_config &config);
- void cpu1_map(address_map &map);
- void cpu2_io_map(address_map &map);
- void cpu2_map(address_map &map);
- void shrike68k_map(address_map &map);
};