diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mame/ces/cesclass.cpp | 143 | ||||
| -rw-r--r-- | src/mame/layout/ces_ccclass.lay | 156 | ||||
| -rw-r--r-- | src/mame/layout/ces_hrclass.lay | 81 | ||||
| -rw-r--r-- | src/mame/layout/ces_tsclass.lay | 115 |
4 files changed, 464 insertions, 31 deletions
diff --git a/src/mame/ces/cesclass.cpp b/src/mame/ces/cesclass.cpp index 0b7033445a2..416cef1aed3 100644 --- a/src/mame/ces/cesclass.cpp +++ b/src/mame/ces/cesclass.cpp @@ -9,22 +9,16 @@ Notes: When you release the strobe, batter does the swing. TODO: -- artwork; -- hookup extra DMD sections; +- complete artworks; +\- confirm LED colors; +\- remaining lamps; +\- image bezel for each game; - extra lamps, cfr. hrclass reference; - irq sources & timings are unknown \- cfr. ccclass, being really slow on continue screen; - sound doesn't play most samples; - hookup m68681 + 2x max232; -- tsclass: runs on a single LCD, needs mods - tsclass: throws bad U43 and U44 at POST, should also be two roms not one. -- tsclass: understand how it draws score and trophy segments -\- cfr. artwork, doesn't seem from lamps but more like an FPGA extra transfer "in 1bpp" for - 3 digits (2x score, 1x "trophy"): - - $40ce88-$40ceb8 player 1 side - - $40ceba player 1 lamps - - $40cebe-$40cec2 control words? - - $40cec4 player 2 side, same as above **************************************************************************************************/ @@ -37,6 +31,10 @@ TODO: #include "screen.h" #include "speaker.h" +#include "ces_ccclass.lh" +#include "ces_hrclass.lh" +#include "ces_tsclass.lh" + namespace { @@ -50,36 +48,57 @@ public: , m_workram(*this, "work_ram") , m_palette(*this, "palette") , m_screen(*this, { "l_lcd", "r_lcd" }) + , m_led_matrix(*this, "ledmatrix%u", 0U) { } - void irq2_ack_w(uint16_t data); - void irq3_ack_w(uint16_t data); - void lamps_w(uint16_t data); - void outputs_w(uint16_t data); + void ccclass(machine_config &config); + void tsclass(machine_config &config); - void palette_init(palette_device &palette) const; - void cesclassic(machine_config &config); - void main_map(address_map &map) ATTR_COLD; protected: + virtual void machine_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD; virtual void video_reset() override ATTR_COLD; + void cesclassic(machine_config &config); + + virtual void lamps_w(u16 data); + void led_update(u32 src_offset, u16 dst_offset); + + void palette_init(palette_device &palette) const; + void main_map(address_map &map) ATTR_COLD; private: required_device<cpu_device> m_maincpu; required_device<okim6295_device> m_oki; - required_shared_ptr<uint16_t> m_workram; + required_shared_ptr<u16> m_workram; required_device<palette_device> m_palette; required_device_array<screen_device, 2> m_screen; + output_finder<25 * 8 * 2> m_led_matrix; bitmap_rgb32 m_lcd_bitmap[2]{}; bool m_lcd_display = false; + void irq2_ack_w(u16 data); + void irq3_ack_w(u16 data); + void outputs_w(u16 data); + void dma_trigger_w(offs_t offset, u16 data, u16 mem_mask=~0); template <unsigned N> uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; +class hrclass_state : public cesclassic_state +{ +public: + hrclass_state(const machine_config &mconfig, device_type type, const char *tag) + : cesclassic_state(mconfig, type, tag) + { } + + void hrclass(machine_config &config); +private: + virtual void lamps_w(u16 data) override; +}; + void cesclassic_state::video_start() { @@ -96,7 +115,8 @@ void cesclassic_state::video_reset() // TODO: not instant void cesclassic_state::dma_trigger_w(offs_t offset, u16 data, u16 mem_mask) { - // all games just pings here with $d + // all games just pings here with 0x000d + // TODO: which may really be just enable flags rather than work RAM base if (data != 0xd) popmessage("dma_trigger_w %04x & %04x", data, mem_mask); @@ -134,19 +154,57 @@ template <unsigned N> uint32_t cesclassic_state::screen_update(screen_device &sc return 0; } -void cesclassic_state::irq2_ack_w(uint16_t data) +void cesclassic_state::irq2_ack_w(u16 data) { m_maincpu->set_input_line(2, CLEAR_LINE); } -void cesclassic_state::irq3_ack_w(uint16_t data) +void cesclassic_state::irq3_ack_w(u16 data) { m_maincpu->set_input_line(3, CLEAR_LINE); } -void cesclassic_state::lamps_w(uint16_t data) +/* + * LED (or DMD?) matrix used for holding score + * + * - $40ce88-$40ceb8 player 1 side + * - $40ceba player 1 lamps + * - $40cebe-$40cec2 control words? + * - $40cec4 player 2 side, same as above + */ +void cesclassic_state::led_update(u32 src_offset, u16 dst_offset) +{ + const u16 *digit_ram = &m_workram[src_offset]; + + for (int x = 0; x < 25; x++) + { + const u16 cell = digit_ram[x]; + + for(int yi = 0; yi < 8; yi++) + { + // tri-color + const u8 color = BIT(cell, 15 - yi) | (BIT(cell, 7 - yi) << 1); + + m_led_matrix[dst_offset + yi + x * 8] = color; + } + } + + // TODO: 26th word is actually wired to informative lamps (cfr. after LED tests) +} + +void cesclassic_state::lamps_w(u16 data) +{ + // TODO: pinpoint how this really triggers + // data sent here or in $640000 should select data transfer + led_update(0xce88 / 2, 0); + led_update(0xcec4 / 2, 25 * 8); +} + +// TODO: how hrclass manages to configure a different format? +void hrclass_state::lamps_w(u16 data) { - //popmessage("%04x",data); + led_update(0xce9a / 2, 0); + led_update(0xcec4 / 2, 25 * 8); } /* @@ -154,11 +212,11 @@ void cesclassic_state::lamps_w(uint16_t data) * --x- ---- enable screen transfers? * ---- --x- coin counter */ -void cesclassic_state::outputs_w(uint16_t data) +void cesclassic_state::outputs_w(u16 data) { - m_oki->set_rom_bank((data & 0x40) >> 6); + m_oki->set_rom_bank(BIT(data, 6)); m_lcd_display = bool(BIT(data, 5)); - machine().bookkeeping().coin_counter_w(0, data & 2); + machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); if(data & ~0x62) logerror("Output: %02x\n",data); } @@ -225,7 +283,7 @@ static INPUT_PORTS_START( cesclassic ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_SERVICE ) - PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) // select button in ccclass PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) // hit strobe PORT_START("DSW") @@ -291,6 +349,11 @@ void cesclassic_state::palette_init(palette_device &palette) const palette.set_pen_color(idx, 0x3f * idx, 0x2a * idx, 0); } +void cesclassic_state::machine_start() +{ + m_led_matrix.resolve(); +} + void cesclassic_state::cesclassic(machine_config &config) { M68000(config, m_maincpu, 24000000/2); @@ -298,11 +361,12 @@ void cesclassic_state::cesclassic(machine_config &config) m_maincpu->set_vblank_int("l_lcd", FUNC(cesclassic_state::irq2_line_assert)); // TODO: unknown sources m_maincpu->set_periodic_int(FUNC(cesclassic_state::irq3_line_assert), attotime::from_hz(60*8)); - // tsclass wants 1 fill for init correctly, other games don't seem to care + // tsclass wants 1-fill for init correctly, other games don't seem to care NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); // DS1232 MicroMonitor + // LCD screen section (2bpp) screen_device &l_screen(SCREEN(config, "l_lcd", SCREEN_TYPE_LCD)); l_screen.set_refresh_hz(60); l_screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); @@ -323,6 +387,23 @@ void cesclassic_state::cesclassic(machine_config &config) OKIM6295(config, m_oki, 24000000/16, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.5); } +void cesclassic_state::ccclass(machine_config &config) +{ + cesclassic(config); + config.set_default_layout(layout_ces_ccclass); +} + +void hrclass_state::hrclass(machine_config &config) +{ + cesclassic(config); + config.set_default_layout(layout_ces_hrclass); +} + +void cesclassic_state::tsclass(machine_config &config) +{ + cesclassic(config); + config.set_default_layout(layout_ces_tsclass); +} ROM_START(hrclass) ROM_REGION( 0x100000, "maincpu", 0 ) @@ -353,6 +434,6 @@ ROM_END } // anonymous namespace -GAME(1997, hrclass, 0, cesclassic, cesclassic, cesclassic_state, empty_init, ROT0, "Creative Electronics and Software", "Home Run Classic (v1.21 12-feb-1997)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) -GAME(1997, ccclass, 0, cesclassic, cesclassic, cesclassic_state, empty_init, ROT0, "Creative Electronics and Software", "Country Club Classic (v1.10 03-apr-1997)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) -GAME(1997, tsclass, 0, cesclassic, cesclassic, cesclassic_state, empty_init, ROT0, "Creative Electronics and Software", "Trap Shoot Classic (v1.0 21-mar-1997)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) +GAME(1997, hrclass, 0, hrclass, cesclassic, hrclass_state, empty_init, ROT0, "Creative Electronics and Software", "Home Run Classic (v1.21 12-feb-1997)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) +GAME(1997, ccclass, 0, ccclass, cesclassic, cesclassic_state, empty_init, ROT0, "Creative Electronics and Software", "Country Club Classic (v1.10 03-apr-1997)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) +GAME(1997, tsclass, 0, tsclass, cesclassic, cesclassic_state, empty_init, ROT0, "Creative Electronics and Software", "Trap Shoot Classic (v1.0 21-mar-1997)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) diff --git a/src/mame/layout/ces_ccclass.lay b/src/mame/layout/ces_ccclass.lay new file mode 100644 index 00000000000..ffcf60a5514 --- /dev/null +++ b/src/mame/layout/ces_ccclass.lay @@ -0,0 +1,156 @@ +<?xml version="1.0"?> +<!-- +license: CC0-1.0 +copyright-holders: Angelo Salese + +Country Club Classic layout + +--> +<mamelayout version="2"> + <element name="temp_color"> + <rect> + <color red="0.0" green="0.05" blue="0.0"/> + </rect> + </element> + + <element name="ledmatrixdot"> + <rect> + <color red="0" green="0" blue="0" /> + <bounds left="-0.05" top="-0.05" right="1.05" bottom="1.05" /> + </rect> + <disk> + <color state="0" red="0.125" green="0.125" blue="0.125" /> + <color state="1" red="0.125" green="1.0" blue="0.125" /> + <color state="2" red="1.0" green="0.125" blue="0.125" /> + <color state="3" red="1.0" green="1.0" blue="0.125" /> + </disk> + </element> + + <group name="led_player1"> + <repeat count="10"> + <param name="s" start="0" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_player2"> + <repeat count="10"> + <param name="s" start="200" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_player3"> + <repeat count="10"> + <param name="s" start="80" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_player4"> + <repeat count="10"> + <param name="s" start="280" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_holenum"> + <repeat count="5"> + <param name="s" start="160" increment="8" /> + <param name="y" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="x" start="7" increment="-1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_par"> + <repeat count="5"> + <param name="s" start="360" increment="8" /> + <param name="y" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="x" start="7" increment="-1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <view name="Wall Layout"> + <element ref="temp_color"> + <bounds x="0" y="0" width="594" height="300"/> + </element> + + <group ref="led_player1"> + <bounds x="56" y="47" width="32" height="28" /> + </group> + + <group ref="led_player2"> + <bounds x="124" y="47" width="32" height="28" /> + </group> + + <group ref="led_player3"> + <bounds x="56" y="84" width="32" height="28" /> + </group> + + <group ref="led_player4"> + <bounds x="124" y="84" width="32" height="28" /> + </group> + + <group ref="led_holenum"> + <bounds x="56" y="126" width="26" height="17" /> + </group> + + <group ref="led_par"> + <bounds x="124" y="126" width="26" height="17" /> + </group> + + <screen index="0"> + <bounds x="32" y="211" width="128" height="64" /> + </screen> + + <screen index="1"> + <bounds x="434" y="211" width="128" height="64" /> + </screen> + </view> +</mamelayout> diff --git a/src/mame/layout/ces_hrclass.lay b/src/mame/layout/ces_hrclass.lay new file mode 100644 index 00000000000..7eb82301c9a --- /dev/null +++ b/src/mame/layout/ces_hrclass.lay @@ -0,0 +1,81 @@ +<?xml version="1.0"?> +<!-- +license: CC0-1.0 +copyright-holders: Angelo Salese + +Home Run Classic layout + +--> +<mamelayout version="2"> + <element name="temp_color"> + <rect> + <color red="0.0" green="0.05" blue="0.0"/> + </rect> + </element> + + <element name="ledmatrixdot"> + <rect> + <color red="0" green="0" blue="0" /> + <bounds left="-0.05" top="-0.05" right="1.05" bottom="1.05" /> + </rect> + <disk> + <color state="0" red="0.125" green="0.125" blue="0.125" /> + <color state="1" red="0.125" green="1.0" blue="0.125" /> + <color state="2" red="1.0" green="0.125" blue="0.125" /> + <color state="3" red="1.0" green="1.0" blue="0.125" /> + </disk> + </element> + + <!-- subtract -8 to both of these for upper bitplane --> + <group name="dmd_upper"> + <repeat count="20"> + <param name="s" start="8" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="dmd_lower"> + <repeat count="20"> + <param name="s" start="200" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <view name="Wall Layout"> + <element ref="temp_color"> + <bounds x="0" y="0" width="594" height="300"/> + </element> + + <group ref="dmd_upper"> + <bounds x="276" y="19" width="53" height="20" /> + </group> + + <group ref="dmd_lower"> + <bounds x="276" y="39" width="53" height="20" /> + </group> + + <screen index="0"> + <bounds x="32" y="211" width="128" height="64" /> + </screen> + + <screen index="1"> + <bounds x="434" y="211" width="128" height="64" /> + </screen> + </view> +</mamelayout> diff --git a/src/mame/layout/ces_tsclass.lay b/src/mame/layout/ces_tsclass.lay new file mode 100644 index 00000000000..e3845c56232 --- /dev/null +++ b/src/mame/layout/ces_tsclass.lay @@ -0,0 +1,115 @@ +<?xml version="1.0"?> +<!-- +license: CC0-1.0 +copyright-holders: Angelo Salese + +Trap Shoot Classic layout + +--> +<mamelayout version="2"> + <element name="temp_color"> + <rect> + <color red="0.0" green="0.05" blue="0.0"/> + </rect> + </element> + + <element name="ledmatrixdot"> + <rect> + <color red="0" green="0" blue="0" /> + <bounds left="-0.05" top="-0.05" right="1.05" bottom="1.05" /> + </rect> + <disk> + <color state="0" red="0.125" green="0.125" blue="0.125" /> + <color state="1" red="0.125" green="1.0" blue="0.125" /> + <color state="2" red="1.0" green="0.125" blue="0.125" /> + <color state="3" red="1.0" green="1.0" blue="0.125" /> + </disk> + </element> + + <!-- NOTE: tsclass uses lower bank for left score/trophy --> + <group name="led_rscore"> + <repeat count="10"> + <param name="s" start="0" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_rtrophy"> + <repeat count="10"> + <param name="s" start="80" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_lscore"> + <repeat count="10"> + <param name="s" start="200" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <group name="led_ltrophy"> + <repeat count="10"> + <param name="s" start="280" increment="8" /> + <param name="x" start="0" increment="1" /> + <repeat count="8"> + <param name="n" start="~s~" increment="1" /> + <param name="y" start="0" increment="1" /> + <element name="ledmatrix~n~" ref="ledmatrixdot" state="0"> + <bounds x="~x~" y="~y~" width="1" height="1" /> + <color red="1.0" green="1.0" blue="1.0" /> + </element> + </repeat> + </repeat> + </group> + + <view name="Wall Layout"> + <element ref="temp_color"> + <bounds x="0" y="0" width="594" height="300"/> + </element> + + <group ref="led_lscore"> + <bounds x="47" y="186" width="32" height="28" /> + </group> + + <group ref="led_ltrophy"> + <bounds x="47" y="217" width="32" height="28" /> + </group> + + <group ref="led_rscore"> + <bounds x="526" y="186" width="32" height="28" /> + </group> + + <group ref="led_rtrophy"> + <bounds x="526" y="217" width="32" height="28" /> + </group> + + <screen index="0"> + <bounds x="176" y="204" width="128" height="64" /> + </screen> + </view> +</mamelayout> |
