summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/playch10.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-01-27 19:29:02 +1100
committer Vas Crabb <vas@vastheman.com>2018-01-27 19:29:02 +1100
commitaf7aba7d6fccf682158a3ab764dc9ee6de159d25 (patch)
tree89dcf27456d96860348e33a1851a4c1263df5909 /src/mame/includes/playch10.h
parent5b939d1d375ec6157b8305c8a22431d95a2a27ef (diff)
playch10: expose countdown LEDs through output system and render with artwork
Diffstat (limited to 'src/mame/includes/playch10.h')
-rw-r--r--src/mame/includes/playch10.h139
1 files changed, 80 insertions, 59 deletions
diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h
index 99fad14825b..8afea34a16d 100644
--- a/src/mame/includes/playch10.h
+++ b/src/mame/includes/playch10.h
@@ -1,14 +1,13 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi,Brad Oliver
+#ifndef MAME_INCLUDES_PLAYCH10_H
+#define MAME_INCLUDES_PLAYCH10_H
+
+#pragma once
+
#include "machine/rp5h01.h"
#include "video/ppu2c0x.h"
-struct chr_bank
-{
- int writable; // 1 for RAM, 0 for ROM
- uint8_t* chr; // direct access to the memory
-};
-
class playch10_state : public driver_device
{
public:
@@ -23,55 +22,10 @@ public:
, m_work_ram(*this, "work_ram")
, m_gfxdecode(*this, "gfxdecode")
, m_vrom_region(*this, "gfx2")
+ , m_timedigits(*this, "digit_%u", 0U)
{
}
- required_device<cpu_device> m_maincpu;
- required_device<ppu2c0x_device> m_ppu;
- optional_device<rp5h01_device> m_rp5h01;
-
- required_shared_ptr<uint8_t> m_ram_8w;
- required_shared_ptr<uint8_t> m_videoram;
- required_shared_ptr<uint8_t> m_timedata;
- required_shared_ptr<uint8_t> m_work_ram;
- required_device<gfxdecode_device> m_gfxdecode;
-
- optional_memory_region m_vrom_region;
-
- int m_up_8w;
- int m_pc10_nmi_enable;
- int m_pc10_dog_di;
- int m_pc10_sdcs;
- int m_pc10_dispmask;
- int m_pc10_int_detect;
- int m_pc10_game_mode;
- int m_pc10_dispmask_old;
- int m_pc10_gun_controller;
- int m_cart_sel;
- int m_cntrl_mask;
- int m_input_latch[2];
- int m_mirroring;
- int m_MMC2_bank[4];
- int m_MMC2_bank_latch[2];
- uint8_t* m_vrom;
- std::unique_ptr<uint8_t[]> m_vram;
- uint8_t* m_nametable[4];
- std::unique_ptr<uint8_t[]> m_nt_ram;
- chr_bank m_chr_page[8];
- int m_mmc1_shiftreg;
- int m_mmc1_shiftcount;
- int m_mmc1_rom_mask;
- int m_gboard_scanline_counter;
- int m_gboard_scanline_latch;
- int m_gboard_banks[2];
- int m_gboard_4screen;
- int m_gboard_last_bank;
- int m_gboard_command;
- int m_IRQ_count;
- uint8_t m_IRQ_count_latch;
- int m_IRQ_enable;
- int m_pc10_bios;
- tilemap_t *m_bg_tilemap;
DECLARE_WRITE_LINE_MEMBER(up8w_w);
DECLARE_READ8_MEMBER(ram_8w_r);
DECLARE_WRITE8_MEMBER(ram_8w_w);
@@ -103,9 +57,9 @@ public:
DECLARE_WRITE8_MEMBER(gboard_rom_switch_w);
DECLARE_WRITE8_MEMBER(iboard_rom_switch_w);
DECLARE_WRITE8_MEMBER(hboard_rom_switch_w);
- void pc10_set_mirroring(int mirroring);
DECLARE_WRITE8_MEMBER(playch10_videoram_w);
DECLARE_CUSTOM_INPUT_MEMBER(pc10_int_detect_r);
+
DECLARE_DRIVER_INIT(playch10);
DECLARE_DRIVER_INIT(pc_gun);
DECLARE_DRIVER_INIT(pcaboard);
@@ -124,23 +78,90 @@ public:
DECLARE_DRIVER_INIT(pciboard);
DECLARE_DRIVER_INIT(pckboard);
DECLARE_DRIVER_INIT(pc_hrz);
+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
+
+ // machine configuration builders
+ void playch10(machine_config &config);
+ void playchnv(machine_config &config);
+ void playch10_hboard(machine_config &config);
+
+protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
+
+private:
+ struct chr_bank
+ {
+ int writable; // 1 for RAM, 0 for ROM
+ uint8_t* chr; // direct access to the memory
+ };
+
DECLARE_PALETTE_INIT(playch10);
DECLARE_MACHINE_START(playch10_hboard);
DECLARE_VIDEO_START(playch10_hboard);
- uint32_t screen_update_playch10_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_playch10_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_playch10_single(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(playch10_interrupt);
+
void pc10_set_videorom_bank( int first, int count, int bank, int size );
void set_videoram_bank( int first, int count, int bank, int size );
void gboard_scanline_cb( int scanline, int vblank, int blanked );
void ppu_irq(int *ppu_regs);
void mapper9_latch(offs_t offset);
- void playch10(machine_config &config);
- void playchnv(machine_config &config);
- void playch10_hboard(machine_config &config);
+ void pc10_set_mirroring(int mirroring);
+
+ uint32_t screen_update_playch10_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_playch10_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_playch10_single(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ppu2c0x_device> m_ppu;
+ optional_device<rp5h01_device> m_rp5h01;
+
+ required_shared_ptr<uint8_t> m_ram_8w;
+ required_shared_ptr<uint8_t> m_videoram;
+ required_shared_ptr<uint8_t> m_timedata;
+ required_shared_ptr<uint8_t> m_work_ram;
+ required_device<gfxdecode_device> m_gfxdecode;
+
+ optional_memory_region m_vrom_region;
+
+ output_finder<4> m_timedigits;
+
+ int m_up_8w;
+ int m_pc10_nmi_enable;
+ int m_pc10_dog_di;
+ int m_pc10_sdcs;
+ int m_pc10_dispmask;
+ int m_pc10_int_detect;
+ int m_pc10_game_mode;
+ int m_pc10_dispmask_old;
+ int m_pc10_gun_controller;
+ int m_cart_sel;
+ int m_cntrl_mask;
+ int m_input_latch[2];
+ int m_mirroring;
+ int m_MMC2_bank[4];
+ int m_MMC2_bank_latch[2];
+ uint8_t* m_vrom;
+ std::unique_ptr<uint8_t[]> m_vram;
+ uint8_t* m_nametable[4];
+ std::unique_ptr<uint8_t[]> m_nt_ram;
+ chr_bank m_chr_page[8];
+ int m_mmc1_shiftreg;
+ int m_mmc1_shiftcount;
+ int m_mmc1_rom_mask;
+ int m_gboard_scanline_counter;
+ int m_gboard_scanline_latch;
+ int m_gboard_banks[2];
+ int m_gboard_4screen;
+ int m_gboard_last_bank;
+ int m_gboard_command;
+ int m_IRQ_count;
+ uint8_t m_IRQ_count_latch;
+ int m_IRQ_enable;
+ int m_pc10_bios;
+ tilemap_t *m_bg_tilemap;
};
+
+#endif // MAME_INCLUDES_PLAYCH10_H