mirror of
https://github.com/holub/mame
synced 2025-10-07 17:27:06 +03:00
playch10: expose countdown LEDs through output system and render with artwork
This commit is contained in:
parent
5b939d1d37
commit
af7aba7d6f
@ -101,6 +101,7 @@ public:
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw_do_enable);
|
||||
|
||||
void intellec4(machine_config &config);
|
||||
|
||||
protected:
|
||||
intellec4_state(machine_config const &mconfig, device_type type, char const *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
|
@ -304,6 +304,8 @@ Notes & Todo:
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include "playch10.lh"
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
@ -339,12 +341,10 @@ WRITE8_MEMBER(playch10_state::sprite_dma_w)
|
||||
|
||||
WRITE8_MEMBER(playch10_state::time_w)
|
||||
{
|
||||
if(data == 0xf)
|
||||
data = 0;
|
||||
constexpr static uint8_t DIGIT_MAP[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
m_timedata[offset] = data;
|
||||
|
||||
popmessage("Time: %d%d%d%d",m_timedata[3],m_timedata[2],m_timedata[1],m_timedata[0]);
|
||||
m_timedigits[offset] = DIGIT_MAP[data & 0x0f];
|
||||
}
|
||||
|
||||
|
||||
@ -669,7 +669,7 @@ MACHINE_CONFIG_START(playch10_state::playch10)
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", playch10)
|
||||
MCFG_PALETTE_ADD("palette", 256+8*4*16)
|
||||
MCFG_PALETTE_INIT_OWNER(playch10_state, playch10)
|
||||
MCFG_DEFAULT_LAYOUT(layout_dualhuov)
|
||||
MCFG_DEFAULT_LAYOUT(layout_playch10)
|
||||
|
||||
MCFG_SCREEN_ADD("top", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
|
@ -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,9 +22,98 @@ public:
|
||||
, m_work_ram(*this, "work_ram")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_vrom_region(*this, "gfx2")
|
||||
, m_timedigits(*this, "digit_%u", 0U)
|
||||
{
|
||||
}
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(up8w_w);
|
||||
DECLARE_READ8_MEMBER(ram_8w_r);
|
||||
DECLARE_WRITE8_MEMBER(ram_8w_w);
|
||||
DECLARE_WRITE8_MEMBER(sprite_dma_w);
|
||||
DECLARE_WRITE8_MEMBER(time_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(sdcs_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(cntrl_mask_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(disp_mask_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_mask_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(nmi_enable_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(dog_di_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(ppu_reset_w);
|
||||
DECLARE_READ8_MEMBER(pc10_detectclr_r);
|
||||
DECLARE_WRITE8_MEMBER(cart_sel_w);
|
||||
DECLARE_READ8_MEMBER(pc10_prot_r);
|
||||
DECLARE_WRITE8_MEMBER(pc10_prot_w);
|
||||
DECLARE_WRITE8_MEMBER(pc10_in0_w);
|
||||
DECLARE_READ8_MEMBER(pc10_in0_r);
|
||||
DECLARE_READ8_MEMBER(pc10_in1_r);
|
||||
DECLARE_WRITE8_MEMBER(pc10_nt_w);
|
||||
DECLARE_READ8_MEMBER(pc10_nt_r);
|
||||
DECLARE_WRITE8_MEMBER(pc10_chr_w);
|
||||
DECLARE_READ8_MEMBER(pc10_chr_r);
|
||||
DECLARE_WRITE8_MEMBER(mmc1_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(aboard_vrom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(bboard_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(cboard_vrom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(eboard_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(gboard_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(iboard_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(hboard_rom_switch_w);
|
||||
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);
|
||||
DECLARE_DRIVER_INIT(pcbboard);
|
||||
DECLARE_DRIVER_INIT(pccboard);
|
||||
DECLARE_DRIVER_INIT(pcdboard);
|
||||
DECLARE_DRIVER_INIT(pcdboard_2);
|
||||
DECLARE_DRIVER_INIT(pceboard);
|
||||
DECLARE_DRIVER_INIT(pcfboard);
|
||||
DECLARE_DRIVER_INIT(pcfboard_2);
|
||||
DECLARE_DRIVER_INIT(virus);
|
||||
DECLARE_DRIVER_INIT(ttoon);
|
||||
DECLARE_DRIVER_INIT(pcgboard);
|
||||
DECLARE_DRIVER_INIT(pcgboard_type2);
|
||||
DECLARE_DRIVER_INIT(pchboard);
|
||||
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);
|
||||
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 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;
|
||||
@ -38,6 +126,8 @@ public:
|
||||
|
||||
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;
|
||||
@ -72,75 +162,6 @@ public:
|
||||
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);
|
||||
DECLARE_WRITE8_MEMBER(sprite_dma_w);
|
||||
DECLARE_WRITE8_MEMBER(time_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(sdcs_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(cntrl_mask_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(disp_mask_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_mask_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(nmi_enable_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(dog_di_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(ppu_reset_w);
|
||||
DECLARE_READ8_MEMBER(pc10_detectclr_r);
|
||||
DECLARE_WRITE8_MEMBER(cart_sel_w);
|
||||
DECLARE_READ8_MEMBER(pc10_prot_r);
|
||||
DECLARE_WRITE8_MEMBER(pc10_prot_w);
|
||||
DECLARE_WRITE8_MEMBER(pc10_in0_w);
|
||||
DECLARE_READ8_MEMBER(pc10_in0_r);
|
||||
DECLARE_READ8_MEMBER(pc10_in1_r);
|
||||
DECLARE_WRITE8_MEMBER(pc10_nt_w);
|
||||
DECLARE_READ8_MEMBER(pc10_nt_r);
|
||||
DECLARE_WRITE8_MEMBER(pc10_chr_w);
|
||||
DECLARE_READ8_MEMBER(pc10_chr_r);
|
||||
DECLARE_WRITE8_MEMBER(mmc1_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(aboard_vrom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(bboard_rom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(cboard_vrom_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(eboard_rom_switch_w);
|
||||
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);
|
||||
DECLARE_DRIVER_INIT(pcbboard);
|
||||
DECLARE_DRIVER_INIT(pccboard);
|
||||
DECLARE_DRIVER_INIT(pcdboard);
|
||||
DECLARE_DRIVER_INIT(pcdboard_2);
|
||||
DECLARE_DRIVER_INIT(pceboard);
|
||||
DECLARE_DRIVER_INIT(pcfboard);
|
||||
DECLARE_DRIVER_INIT(pcfboard_2);
|
||||
DECLARE_DRIVER_INIT(virus);
|
||||
DECLARE_DRIVER_INIT(ttoon);
|
||||
DECLARE_DRIVER_INIT(pcgboard);
|
||||
DECLARE_DRIVER_INIT(pcgboard_type2);
|
||||
DECLARE_DRIVER_INIT(pchboard);
|
||||
DECLARE_DRIVER_INIT(pciboard);
|
||||
DECLARE_DRIVER_INIT(pckboard);
|
||||
DECLARE_DRIVER_INIT(pc_hrz);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
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);
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_PLAYCH10_H
|
||||
|
86
src/mame/layout/playch10.lay
Normal file
86
src/mame/layout/playch10.lay
Normal file
@ -0,0 +1,86 @@
|
||||
<?xml version="1.0"?>
|
||||
<mamelayout version="2">
|
||||
<element name="digit" defstate="0">
|
||||
<led7seg>
|
||||
<color red="0.15" green="1.0" blue="0.25" />
|
||||
</led7seg>
|
||||
</element>
|
||||
|
||||
<view name="Screen 0 Standard (4:3)">
|
||||
<screen index="0">
|
||||
<bounds left="0" top="0" right="4" bottom="3" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Screen 1 Standard (4:3)">
|
||||
<screen index="1">
|
||||
<bounds left="0" top="0" right="4" bottom="3" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Screen 0 Pixel Aspect (~scr0nativexaspect~:~scr0nativeyaspect~)">
|
||||
<screen index="0">
|
||||
<bounds left="0" top="0" right="~scr0width~" bottom="~scr0height~" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Screen 1 Pixel Aspect (~scr1nativexaspect~:~scr1nativeyaspect~)">
|
||||
<screen index="1">
|
||||
<bounds left="0" top="0" right="~scr1width~" bottom="~scr1height~" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Single Screen">
|
||||
<bezel name="digit_3" element="digit">
|
||||
<bounds x="25" y="0" width="2" height="3.2" />
|
||||
</bezel>
|
||||
<bezel name="digit_2" element="digit">
|
||||
<bounds x="27.5" y="0" width="2" height="3.2" />
|
||||
</bezel>
|
||||
<bezel name="digit_1" element="digit">
|
||||
<bounds x="30" y="0" width="2" height="3.2" />
|
||||
</bezel>
|
||||
<bezel name="digit_0" element="digit">
|
||||
<bounds x="32.5" y="0" width="2" height="3.2" />
|
||||
</bezel>
|
||||
<screen index="0">
|
||||
<bounds left="0" top="3.5" right="40" bottom="33.5" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Dual Under-Over">
|
||||
<screen index="1">
|
||||
<bounds x="0" y="-3.03" width="4" height="3" />
|
||||
</screen>
|
||||
<screen index="0">
|
||||
<bounds x="0" y="0" width="4" height="3" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Dual Under-Over (Gapless)">
|
||||
<screen index="1">
|
||||
<bounds x="0" y="-3" width="4" height="3" />
|
||||
</screen>
|
||||
<screen index="0">
|
||||
<bounds x="0" y="0" width="4" height="3" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Dual Side-by-Side">
|
||||
<screen index="1">
|
||||
<bounds x="0" y="0" width="4" height="3" />
|
||||
</screen>
|
||||
<screen index="0">
|
||||
<bounds x="4.03" y="0" width="4" height="3" />
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<view name="Dual Side-by-Side (Gapless)">
|
||||
<screen index="1">
|
||||
<bounds x="0" y="0" width="4" height="3" />
|
||||
</screen>
|
||||
<screen index="0">
|
||||
<bounds x="4" y="0" width="4" height="3" />
|
||||
</screen>
|
||||
</view>
|
||||
</mamelayout>
|
@ -1,10 +1,12 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Ernesto Corvi,Brad Oliver
|
||||
#include "emu.h"
|
||||
#include "video/ppu2c0x.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "includes/playch10.h"
|
||||
|
||||
#include "machine/nvram.h"
|
||||
#include "video/ppu2c0x.h"
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Init machine
|
||||
@ -35,6 +37,8 @@ void playch10_state::machine_reset()
|
||||
|
||||
void playch10_state::machine_start()
|
||||
{
|
||||
m_timedigits.resolve();
|
||||
|
||||
m_vrom = (m_vrom_region != nullptr) ? m_vrom_region->base() : nullptr;
|
||||
|
||||
/* allocate 4K of nametable ram here */
|
||||
|
Loading…
Reference in New Issue
Block a user