From 6c8cdf4008875cd84989b3eb23ca5ce371610e8c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 13 Jul 2022 18:48:27 +0200 Subject: - fgoal.cpp: used finders for I/O ports and other smal cleanups - some drivers and devices: removed leftover timer enums --- src/devices/bus/a2bus/agat_fdc.h | 7 - src/devices/bus/abckb/abc77.h | 6 - src/devices/machine/corvushd.h | 5 - src/devices/sound/bsmt2000.h | 7 - src/devices/sound/mos6560.h | 5 - src/devices/sound/msm5205.h | 6 - src/devices/video/imagetek_i4100.h | 5 - src/devices/video/tms9927.h | 6 - src/devices/video/upd7220.h | 7 - src/mame/atari/asic65.h | 5 - src/mame/atari/atarist.cpp | 6 - src/mame/atari/lynx.h | 8 - src/mame/efo/nightmare.cpp | 5 - src/mame/metro/rabbit.cpp | 5 - src/mame/midcoin/wallc.cpp | 33 ++++- src/mame/misc/artmagic.h | 5 - src/mame/motorola/mekd1.cpp | 6 - src/mame/motorola/mekd5.cpp | 5 - src/mame/namco/gaplus.h | 6 - src/mame/rare/btoads.h | 7 - src/mame/sega/segaybd.cpp | 6 +- src/mame/taito/fgoal.cpp | 295 ++++++++++++++++++++++++++++++------- src/mame/taito/fgoal.h | 91 ------------ src/mame/taito/fgoal_v.cpp | 120 --------------- src/mame/taito/undrfire.h | 5 - src/mame/taito/volfied.h | 5 - 26 files changed, 273 insertions(+), 394 deletions(-) delete mode 100644 src/mame/taito/fgoal.h delete mode 100644 src/mame/taito/fgoal_v.cpp diff --git a/src/devices/bus/a2bus/agat_fdc.h b/src/devices/bus/a2bus/agat_fdc.h index 950027151cd..84bfd82b268 100644 --- a/src/devices/bus/a2bus/agat_fdc.h +++ b/src/devices/bus/a2bus/agat_fdc.h @@ -57,13 +57,6 @@ protected: virtual void write_c0nx(uint8_t offset, uint8_t data) override; virtual uint8_t read_cnxx(uint8_t offset) override; - enum - { - TIMER_ID_LSS = 0, - TIMER_ID_SEEK, - TIMER_ID_MOTOR - }; - required_device m_d14; required_device m_d15; diff --git a/src/devices/bus/abckb/abc77.h b/src/devices/bus/abckb/abc77.h index f6147c52c66..4982c746570 100644 --- a/src/devices/bus/abckb/abc77.h +++ b/src/devices/bus/abckb/abc77.h @@ -50,12 +50,6 @@ protected: virtual void txd_w(int state) override; private: - enum - { - TIMER_SERIAL, - TIMER_RESET - }; - void serial_output(int state); void key_down(int state); diff --git a/src/devices/machine/corvushd.h b/src/devices/machine/corvushd.h index 13a86a40378..074b761eb60 100644 --- a/src/devices/machine/corvushd.h +++ b/src/devices/machine/corvushd.h @@ -44,11 +44,6 @@ protected: private: static constexpr unsigned MAX_COMMAND_SIZE = 4096; // The maximum size of a command packet (the controller only has 5K of RAM...) - enum - { - TIMER_COMMAND - }; - // Sector addressing scheme for Rev B/H drives used in various commands (Called a DADR in the docs) struct dadr_t { uint8_t address_msn_and_drive;// Most significant nibble: Most significant nibble of sector address, Least significant nibble: Drive # diff --git a/src/devices/sound/bsmt2000.h b/src/devices/sound/bsmt2000.h index 777a06c8ac6..459a83bb86c 100644 --- a/src/devices/sound/bsmt2000.h +++ b/src/devices/sound/bsmt2000.h @@ -72,13 +72,6 @@ public: void tms_right_w(uint16_t data); private: - // timers - enum - { - TIMER_ID_REG_WRITE, - TIMER_ID_DATA_WRITE - }; - // configuration state ready_callback m_ready_callback; diff --git a/src/devices/sound/mos6560.h b/src/devices/sound/mos6560.h index fa950450389..bf1b8604695 100644 --- a/src/devices/sound/mos6560.h +++ b/src/devices/sound/mos6560.h @@ -111,11 +111,6 @@ protected: TYPE_ATTACK_UFO // NTSC-M, less features }; - enum - { - TIMER_LINE - }; - mos6560_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant); // device-level overrides diff --git a/src/devices/sound/msm5205.h b/src/devices/sound/msm5205.h index d38fc6e530d..46052aaffcb 100644 --- a/src/devices/sound/msm5205.h +++ b/src/devices/sound/msm5205.h @@ -48,12 +48,6 @@ public: void s2_w(int state); protected: - enum - { - TIMER_VCK, - TIMER_ADPCM_CAPTURE - }; - msm5205_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 dac_bits); // device-level overrides diff --git a/src/devices/video/imagetek_i4100.h b/src/devices/video/imagetek_i4100.h index 94635dee733..8f11b055f12 100644 --- a/src/devices/video/imagetek_i4100.h +++ b/src/devices/video/imagetek_i4100.h @@ -141,11 +141,6 @@ protected: void blt_write(const int tmap, const offs_t offs, const u16 data, const u16 mask); - enum - { - TIMER_BLIT_END = 1 - }; - emu_timer *m_blit_done_timer; // I/O operations diff --git a/src/devices/video/tms9927.h b/src/devices/video/tms9927.h index 79e42685494..5b517f7f78a 100644 --- a/src/devices/video/tms9927.h +++ b/src/devices/video/tms9927.h @@ -51,12 +51,6 @@ protected: TIMER_CALLBACK_MEMBER(toggle_hsync); private: - enum - { - TIMER_VSYNC, - TIMER_HSYNC - }; - void recompute_parameters(bool postload); void generic_access(offs_t offset); diff --git a/src/devices/video/upd7220.h b/src/devices/video/upd7220.h index fa476bb3662..af203e2fdd7 100644 --- a/src/devices/video/upd7220.h +++ b/src/devices/video/upd7220.h @@ -97,13 +97,6 @@ protected: void stop_dma(); private: - enum - { - TIMER_VSYNC, - TIMER_HSYNC, - TIMER_BLANK - }; - inline uint16_t readword(offs_t address); inline void writeword(offs_t address, uint16_t data); inline void fifo_clear(); diff --git a/src/mame/atari/asic65.h b/src/mame/atari/asic65.h index 8599620235f..16950cf47e6 100644 --- a/src/mame/atari/asic65.h +++ b/src/mame/atari/asic65.h @@ -43,11 +43,6 @@ public: void stat_w(u16 data); u16 stat_r(); - enum - { - TIMER_M68K_ASIC65_DEFERRED_W - }; - void asic65_io_map(address_map &map); void asic65_program_map(address_map &map); protected: diff --git a/src/mame/atari/atarist.cpp b/src/mame/atari/atarist.cpp index 4f933d1bea1..fdc49ef8b77 100644 --- a/src/mame/atari/atarist.cpp +++ b/src/mame/atari/atarist.cpp @@ -276,12 +276,6 @@ public: class ste_state : public st_state { public: - enum - { - TIMER_DMASOUND_TICK, - TIMER_MICROWIRE_TICK - }; - ste_state(const machine_config &mconfig, device_type type, const char *tag) : st_state(mconfig, type, tag), m_lmc1992(*this, LMC1992_TAG) diff --git a/src/mame/atari/lynx.h b/src/mame/atari/lynx.h index ffce5bdb741..92e0bb361fc 100644 --- a/src/mame/atari/lynx.h +++ b/src/mame/atari/lynx.h @@ -211,14 +211,6 @@ private: bool timer_active = false; }; - enum - { - TIMER_BLITTER, - TIMER_SHOT, - TIMER_UART_LOOPBACK, - TIMER_UART - }; - // devices required_shared_ptr m_dram; // 2 64Kx4 bit DRAMs connected to CPU required_device m_maincpu; diff --git a/src/mame/efo/nightmare.cpp b/src/mame/efo/nightmare.cpp index 64ffc9da820..6149f79af17 100644 --- a/src/mame/efo/nightmare.cpp +++ b/src/mame/efo/nightmare.cpp @@ -219,11 +219,6 @@ class nightmare_state : public driver_device { public: - enum - { - TIMER_SET_CPU_MODE - }; - nightmare_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "cdp1802") diff --git a/src/mame/metro/rabbit.cpp b/src/mame/metro/rabbit.cpp index f726f96ce4e..ceef4c1952f 100644 --- a/src/mame/metro/rabbit.cpp +++ b/src/mame/metro/rabbit.cpp @@ -92,11 +92,6 @@ Custom: Imagetek I5000 (2ch video & 2ch sound) class rabbit_state : public driver_device { public: - enum - { - TIMER_BLIT_DONE - }; - rabbit_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), diff --git a/src/mame/midcoin/wallc.cpp b/src/mame/midcoin/wallc.cpp index 051d0bdfbda..c02556bd9e5 100644 --- a/src/mame/midcoin/wallc.cpp +++ b/src/mame/midcoin/wallc.cpp @@ -467,6 +467,25 @@ static INPUT_PORTS_START( sidampkr ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) INPUT_PORTS_END +static INPUT_PORTS_START( sidampkra ) + PORT_INCLUDE(unkitpkr) + + PORT_MODIFY("DSW1") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) + PORT_DIPNAME( 0x60, 0x60, "Min/Max Bet" ) PORT_DIPLOCATION("SW1:6,7") + PORT_DIPSETTING( 0x00, "Min:1; Max:5" ) + PORT_DIPSETTING( 0x20, "Min:1; Max:10" ) + PORT_DIPSETTING( 0x40, "Min:1; Max:20" ) + PORT_DIPSETTING( 0x60, "Min:1; Max:40" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x00, DEF_STR( English ) ) + PORT_DIPSETTING( 0x80, DEF_STR( French ) ) +INPUT_PORTS_END + static const gfx_layout charlayout = { 8,8, /* 8*8 characters */ @@ -809,11 +828,11 @@ void wallc_state::init_unkitpkr() } // anonymous namespace -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1984, wallc, 0, wallc, wallc, wallc_state, init_wallc, ROT0, "Midcoin", "Wall Crash (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, wallca, wallc, wallca, wallc, wallc_state, init_wallca, ROT0, "Midcoin", "Wall Crash (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, brkblast, wallc, wallc, wallc, wallc_state, init_wallca, ROT0, "bootleg (Fadesa)", "Brick Blast (bootleg of Wall Crash)", MACHINE_SUPPORTS_SAVE ) // Spanish bootleg board, Fadesa stickers / text on various components +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS +GAME( 1984, wallc, 0, wallc, wallc, wallc_state, init_wallc, ROT0, "Midcoin", "Wall Crash (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, wallca, wallc, wallca, wallc, wallc_state, init_wallca, ROT0, "Midcoin", "Wall Crash (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, brkblast, wallc, wallc, wallc, wallc_state, init_wallca, ROT0, "bootleg (Fadesa)", "Brick Blast (bootleg of Wall Crash)", MACHINE_SUPPORTS_SAVE ) // Spanish bootleg board, Fadesa stickers / text on various components -GAME( 1984, sidampkr, 0, sidampkr, sidampkr, wallc_state, init_sidam, ROT270, "Sidam", "unknown Sidam poker (vertical)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // colors should be verified -GAME( 1984, sidampkra, sidampkr, sidampkra, sidampkr, wallc_state, init_sidam, ROT0, "Sidam", "unknown Sidam poker (horizontal)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // colors should be verified, cards GFX look wrong -GAME( 198?, unkitpkr, 0, unkitpkr, unkitpkr, wallc_state, init_unkitpkr, ROT0, "", "unknown Italian poker game", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, sidampkr, 0, sidampkr, sidampkr, wallc_state, init_sidam, ROT270, "Sidam", "unknown Sidam poker (vertical)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // colors should be verified +GAME( 1984, sidampkra, sidampkr, sidampkra, sidampkra, wallc_state, init_sidam, ROT0, "Sidam", "unknown Sidam poker (horizontal)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // colors should be verified, cards GFX look wrong +GAME( 198?, unkitpkr, 0, unkitpkr, unkitpkr, wallc_state, init_unkitpkr, ROT0, "", "unknown Italian poker game", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/artmagic.h b/src/mame/misc/artmagic.h index 8d8c5e7b8a3..6cbee3d3a71 100644 --- a/src/mame/misc/artmagic.h +++ b/src/mame/misc/artmagic.h @@ -12,11 +12,6 @@ class artmagic_state : public driver_device { public: - enum - { - TIMER_IRQ_OFF - }; - artmagic_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") diff --git a/src/mame/motorola/mekd1.cpp b/src/mame/motorola/mekd1.cpp index d530168f718..594eb7b1cee 100644 --- a/src/mame/motorola/mekd1.cpp +++ b/src/mame/motorola/mekd1.cpp @@ -111,12 +111,6 @@ public: void mekd1(machine_config &config); - enum - { - TIMER_BIT_RATE, - TIMER_BIT_RATE_HALF - }; - private: virtual void machine_reset() override; virtual void machine_start() override; diff --git a/src/mame/motorola/mekd5.cpp b/src/mame/motorola/mekd5.cpp index 36c4a8e3e11..17d9f8e8068 100644 --- a/src/mame/motorola/mekd5.cpp +++ b/src/mame/motorola/mekd5.cpp @@ -94,11 +94,6 @@ FS 0 to F class mekd5_state : public driver_device { public: - enum - { - TIMER_TRACE - }; - mekd5_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") diff --git a/src/mame/namco/gaplus.h b/src/mame/namco/gaplus.h index 7d31c3f9fb0..b731d7147aa 100644 --- a/src/mame/namco/gaplus.h +++ b/src/mame/namco/gaplus.h @@ -22,12 +22,6 @@ public: int col = 0, set = 0; }; - enum - { - TIMER_NAMCOIO0_RUN, - TIMER_NAMCOIO1_RUN - }; - gaplus_base_state(const machine_config &mconfig, device_type type, const char *tag, const char *namco56xx_tag, const char *namco58xx_tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") diff --git a/src/mame/rare/btoads.h b/src/mame/rare/btoads.h index 4e55b288454..7c507b2bbf0 100644 --- a/src/mame/rare/btoads.h +++ b/src/mame/rare/btoads.h @@ -48,13 +48,6 @@ protected: TIMER_CALLBACK_MEMBER(audio_sync) { } private: - // timer IDs - enum - { - TIMER_ID_NOP, - TIMER_ID_DELAYED_SOUND - }; - // shared pointers memory_share_creator m_vram_fg0; memory_share_creator m_vram_fg1; diff --git a/src/mame/sega/segaybd.cpp b/src/mame/sega/segaybd.cpp index cc8c00374ec..b9d657fce44 100644 --- a/src/mame/sega/segaybd.cpp +++ b/src/mame/sega/segaybd.cpp @@ -128,8 +128,8 @@ Drive Board ----------- This board is used to control the feedback motors on the deluxe moving cabinet. -837-6565 (printed on PCB) -839-0123 (sticker on top of the above number) +839-0161 (printed on PCB) +839-0213 (sticker on top of the above number) REV A (sticker) |------------------------------------| |CN3 CN4 CN1 CN2 | @@ -145,7 +145,7 @@ REV A (sticker) Notes: D71054 - NEC D71054 Programmable Timer/Counter MB8464 - Fujitsu MB8464 8kBx8-bit SRAM -EPR-11???.IC27 - 27C256 EPROM (Z80 program) +EPR-11???.IC27 - 27C256 EPROM (Z80 program) - supposedly EPR-11485 but original label was lost Z80A - NEC D780C-1 Z80A CPU. Clock input 4.000MHz 8255 - NEC D8255AC-2 Programmable Peripheral Interface (PPI) ADC0804 - National ADC0804 8-Bit Microprocessor-Compatible Analog-to-Digital Converter diff --git a/src/mame/taito/fgoal.cpp b/src/mame/taito/fgoal.cpp index 9f58d92e8e5..7e20b080eb2 100644 --- a/src/mame/taito/fgoal.cpp +++ b/src/mame/taito/fgoal.cpp @@ -19,15 +19,215 @@ Differences between these sets include ***************************************************************************/ #include "emu.h" -#include "fgoal.h" + #include "cpu/m6800/m6800.h" +#include "machine/mb14241.h" + +#include "emupal.h" +#include "screen.h" + + +namespace { + +class fgoal_state : public driver_device +{ +public: + fgoal_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_mb14241(*this, "mb14241"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_video_ram(*this, "video_ram"), + m_in1(*this, "IN1"), + m_paddle(*this, "PADDLE%u", 0U) + { } + + void fgoal(machine_config &config); + + DECLARE_READ_LINE_MEMBER(_80_r); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // devices + required_device m_maincpu; + required_device m_mb14241; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + // memory pointers + required_shared_ptr m_video_ram; + + // I/O ports + required_ioport m_in1; + required_ioport_array<2> m_paddle; + + // video-related + bitmap_ind16 m_bgbitmap{}; + bitmap_ind16 m_fgbitmap{}; + uint8_t m_xpos = 0U; + uint8_t m_ypos = 0U; + uint8_t m_current_color = 0U; + + // misc + uint8_t m_player = 0U; + uint8_t m_row = 0U; + uint8_t m_col = 0U; + uint8_t m_prev_coin = 0U; + emu_timer *m_interrupt_timer = nullptr; + + uint8_t analog_r(); + uint8_t nmi_reset_r(); + uint8_t irq_reset_r(); + uint8_t row_r(); + void row_w(uint8_t data); + void col_w(uint8_t data); + uint8_t address_hi_r(); + uint8_t address_lo_r(); + uint8_t shifter_reverse_r(); + void sound1_w(uint8_t data); + void sound2_w(uint8_t data); + void color_w(uint8_t data); + void ypos_w(uint8_t data); + void xpos_w(uint8_t data); + + TIMER_CALLBACK_MEMBER(interrupt_callback); + + void palette(palette_device &palette) const; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + static int intensity(int bits); + unsigned video_ram_address(); + + void cpu_map(address_map &map); +}; + + +// video + +void fgoal_state::color_w(uint8_t data) +{ + m_current_color = data & 3; +} + + +void fgoal_state::ypos_w(uint8_t data) +{ + m_ypos = data; +} + + +void fgoal_state::xpos_w(uint8_t data) +{ + m_xpos = data; +} + + +void fgoal_state::video_start() +{ + m_screen->register_screen_bitmap(m_fgbitmap); + m_screen->register_screen_bitmap(m_bgbitmap); + + save_item(NAME(m_fgbitmap)); + save_item(NAME(m_bgbitmap)); +} + +uint32_t fgoal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t const *VRAM = m_video_ram; + + // draw color overlay foreground and background + + if (m_player == 1 && (m_in1->read() & 0x40)) + { + m_gfxdecode->gfx(0)->zoom_opaque(m_fgbitmap, cliprect, + 0, (m_player << 2) | m_current_color, + 1, 1, + 0, 16, + 0x40000, + 0x40000); + + m_gfxdecode->gfx(1)->zoom_opaque(m_bgbitmap, cliprect, + 0, 0, + 1, 1, + 0, 16, + 0x40000, + 0x40000); + } + else + { + m_gfxdecode->gfx(0)->zoom_opaque(m_fgbitmap, cliprect, + 0, (m_player << 2) | m_current_color, + 0, 0, + 0, 0, + 0x40000, + 0x40000); + + m_gfxdecode->gfx(1)->zoom_opaque(m_bgbitmap, cliprect, + 0, 0, + 0, 0, + 0, 0, + 0x40000, + 0x40000); + } + + // the ball has a fixed color + + for (int y = m_ypos; y < m_ypos + 8; y++) + { + for (int x = m_xpos; x < m_xpos + 8; x++) + { + if (y < 256 && x < 256) + { + m_fgbitmap.pix(y, x) = 128 + 16; + } + } + } + + // draw bitmap layer + + for (int y = 0; y < 256; y++) + { + uint16_t *const p = &bitmap.pix(y); + + uint16_t const *const FG = &m_fgbitmap.pix(y); + uint16_t const *const BG = &m_bgbitmap.pix(y); + + for (int x = 0; x < 256; x += 8) + { + uint8_t v = *VRAM++; + + for (int n = 0; n < 8; n++) + { + if (v & (1 << n)) + { + p[x + n] = FG[x + n]; + } + else + { + p[x + n] = BG[x + n]; + } + } + } + } + return 0; +} + + +// machine int fgoal_state::intensity(int bits) { int v = 0; - // contrary to the schems pull-up resistors are 270 and not 390 + // contrary to the schematics pull-up resistors are 270 and not 390 if (1) v += 0x2e; // 100 + 270 @@ -42,7 +242,7 @@ int fgoal_state::intensity(int bits) } -void fgoal_state::fgoal_palette(palette_device &palette) const +void fgoal_state::palette(palette_device &palette) const { // for B/W screens PCB can be jumpered to use lower half of PROM @@ -55,8 +255,8 @@ void fgoal_state::fgoal_palette(palette_device &palette) const for (int i = 0; i < 8; i++) { - palette.set_pen_color(128 + 0*8 + i, rgb_t(0x2e, 0x80, 0x2e)); - palette.set_pen_color(128 + 1*8 + i, rgb_t(0x2e, 0x2e, 0x2e)); + palette.set_pen_color(128 + 0 * 8 + i, rgb_t(0x2e, 0x80, 0x2e)); + palette.set_pen_color(128 + 1 * 8 + i, rgb_t(0x2e, 0x2e, 0x2e)); } // ball is a fixed color @@ -66,8 +266,7 @@ void fgoal_state::fgoal_palette(palette_device &palette) const TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback) { - int scanline; - int coin = (ioport("IN1")->read() & 2); + int coin = (m_in1->read() & 2); m_maincpu->set_input_line(0, ASSERT_LINE); @@ -76,7 +275,7 @@ TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback) m_prev_coin = coin; - scanline = m_screen->vpos() + 128; + int scanline = m_screen->vpos() + 128; if (scanline > 256) scanline = 0; @@ -85,7 +284,7 @@ TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback) } -unsigned fgoal_state::video_ram_address( ) +unsigned fgoal_state::video_ram_address() { return 0x4000 | (m_row << 5) | (m_col >> 3); } @@ -93,15 +292,13 @@ unsigned fgoal_state::video_ram_address( ) uint8_t fgoal_state::analog_r() { - return ioport(m_player ? "PADDLE1" : "PADDLE0")->read(); /* PCB can be jumpered to use a single dial */ + return m_paddle[m_player]->read(); // PCB can be jumpered to use a single dial } READ_LINE_MEMBER(fgoal_state::_80_r) { - uint8_t ret = (m_screen->vpos() & 0x80) ? 1 : 0; - - return ret; + return BIT(m_screen->vpos(), 7); } uint8_t fgoal_state::nmi_reset_r() @@ -148,13 +345,6 @@ uint8_t fgoal_state::address_lo_r() return video_ram_address() & 0xff; } -uint8_t fgoal_state::shifter_r() -{ - uint8_t v = m_mb14241->shift_result_r(); - - return bitswap<8>(v, 7, 6, 5, 4, 3, 2, 1, 0); -} - uint8_t fgoal_state::shifter_reverse_r() { uint8_t v = m_mb14241->shift_result_r(); @@ -165,25 +355,25 @@ uint8_t fgoal_state::shifter_reverse_r() void fgoal_state::sound1_w(uint8_t data) { - /* BIT0 => SX2 */ - /* BIT1 => SX1 */ - /* BIT2 => SX1 */ - /* BIT3 => SX1 */ - /* BIT4 => SX1 */ - /* BIT5 => SX1 */ - /* BIT6 => SX1 */ - /* BIT7 => SX1 */ + // BIT0 => SX2 + // BIT1 => SX1 + // BIT2 => SX1 + // BIT3 => SX1 + // BIT4 => SX1 + // BIT5 => SX1 + // BIT6 => SX1 + // BIT7 => SX1 } void fgoal_state::sound2_w(uint8_t data) { - /* BIT0 => CX0 */ - /* BIT1 => SX6 */ - /* BIT2 => N/C */ - /* BIT3 => SX5 */ - /* BIT4 => SX4 */ - /* BIT5 => SX3 */ + // BIT0 => CX0 + // BIT1 => SX6 + // BIT2 => N/C + // BIT3 => SX5 + // BIT4 => SX4 + // BIT5 => SX3 m_player = data & 1; } @@ -199,7 +389,7 @@ void fgoal_state::cpu_map(address_map &map) map(0x00f3, 0x00f3).portr("IN1"); map(0x00f4, 0x00f4).r(FUNC(fgoal_state::address_hi_r)); map(0x00f5, 0x00f5).r(FUNC(fgoal_state::address_lo_r)); - map(0x00f6, 0x00f6).r(FUNC(fgoal_state::shifter_r)); + map(0x00f6, 0x00f6).r(m_mb14241, FUNC(mb14241_device::shift_result_r)); map(0x00f7, 0x00f7).r(FUNC(fgoal_state::shifter_reverse_r)); map(0x00f8, 0x00fb).r(FUNC(fgoal_state::nmi_reset_r)); map(0x00fc, 0x00ff).r(FUNC(fgoal_state::irq_reset_r)); @@ -213,7 +403,7 @@ void fgoal_state::cpu_map(address_map &map) map(0x00fc, 0x00ff).w(FUNC(fgoal_state::sound2_w)); map(0x0100, 0x03ff).ram(); - map(0x4000, 0x7fff).ram().share("video_ram"); + map(0x4000, 0x7fff).ram().share(m_video_ram); map(0x8000, 0x8000).w(FUNC(fgoal_state::ypos_w)); map(0x8001, 0x8001).w(FUNC(fgoal_state::xpos_w)); @@ -233,7 +423,7 @@ static INPUT_PORTS_START( fgoal ) PORT_DIPNAME( 0x20, 0x00, DEF_STR( Lives )) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x20, "5" ) - PORT_DIPNAME( 0x18, 0x18, "Options" ) /* bit #4 comes from a jumper */ + PORT_DIPNAME( 0x18, 0x18, "Options" ) // bit #4 comes from a jumper PORT_DIPSETTING( 0x00, "Clear All Helmets" ) PORT_DIPSETTING( 0x08, "No Extra Ball" ) PORT_DIPSETTING( 0x10, "No Extra Credit" ) @@ -247,10 +437,10 @@ static INPUT_PORTS_START( fgoal ) PORT_DIPSETTING( 0x05, "65000" ) PORT_DIPSETTING( 0x06, "79000" ) PORT_DIPSETTING( 0x07, "93000" ) - /* extra credit score changes depending on player's performance */ + // extra credit score changes depending on player's performance PORT_START("IN1") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fgoal_state, _80_r) /* 128V */ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fgoal_state, _80_r) // 128V PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet )) PORT_DIPSETTING( 0x00, DEF_STR( Upright )) PORT_DIPSETTING( 0x40, DEF_STR( Cocktail )) @@ -267,7 +457,7 @@ static INPUT_PORTS_START( fgoal ) PORT_DIPSETTING( 0x01, DEF_STR( Off )) PORT_DIPSETTING( 0x00, DEF_STR( On )) - /* game freezes when analog controls read $00 or $ff */ + // game freezes when analog controls read $00 or $ff PORT_START("PADDLE0") PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(1, 254) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1) @@ -314,8 +504,8 @@ static const gfx_layout gfxlayout = static GFXDECODE_START( gfx_fgoal ) - GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0x00, 8 ) /* foreground */ - GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0x80, 1 ) /* background */ + GFXDECODE_ENTRY( "tiles", 0, gfxlayout, 0x00, 8 ) // foreground + GFXDECODE_ENTRY( "tiles", 0, gfxlayout, 0x80, 1 ) // background GFXDECODE_END @@ -348,14 +538,14 @@ void fgoal_state::machine_reset() void fgoal_state::fgoal(machine_config &config) { - /* basic machine hardware */ - M6800(config, m_maincpu, 10065000 / 10); /* ? */ + // basic machine hardware + M6800(config, m_maincpu, 10065000 / 10); // ? m_maincpu->set_addrmap(AS_PROGRAM, &fgoal_state::cpu_map); - /* add shifter */ - MB14241(config, "mb14241"); + // add shifter + MB14241(config, m_mb14241); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_size(256, 263); @@ -364,9 +554,10 @@ void fgoal_state::fgoal(machine_config &config) m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_fgoal); - PALETTE(config, m_palette, FUNC(fgoal_state::fgoal_palette), 128 + 16 + 1); + PALETTE(config, m_palette, FUNC(fgoal_state::palette), 128 + 16 + 1); - /* sound hardware */ + // sound hardware + // TODO: netlist } @@ -381,7 +572,7 @@ ROM_START( fgoal ) ROM_LOAD( "tf01.m46", 0xb800, 0x0800, CRC(1b0bfa5c) SHA1(768e14f08063cc022d7e18a9cb2197d64a9e1b8d) ) ROM_RELOAD( 0xf800, 0x0800 ) - ROM_REGION( 0x1000, "gfx1", 0 ) /* overlay proms */ + ROM_REGION( 0x1000, "tiles", 0 ) // overlay PROMs ROM_LOAD( "tf05.m11", 0x0000, 0x0400, CRC(925b78ab) SHA1(97d6e572658715dc4f6c37b98ba5352643fc8e27) ) ROM_LOAD( "tf06.m4", 0x0400, 0x0400, CRC(3d2f007b) SHA1(7f4b6f3f08be8c886af3e2ccd3c0d93ae54d4649) ) ROM_LOAD( "tf07.m12", 0x0800, 0x0400, CRC(0b1d01c4) SHA1(8680602fecd412e5136e1107618a2e0a59b37d08) ) @@ -405,7 +596,7 @@ ROM_START( fgoala ) ROM_RELOAD( 0xf800, 0x0800 ) ROM_LOAD( "mf05.m22", 0xd800, 0x0800, CRC(58082b8b) SHA1(72cd4153f7939cd33fc69ba82b44391fc19ae152) ) - ROM_REGION( 0x1000, "gfx1", 0 ) /* overlay proms */ + ROM_REGION( 0x1000, "tiles", 0 ) // overlay PROMs ROM_LOAD( "tf05.m11", 0x0000, 0x0400, CRC(925b78ab) SHA1(97d6e572658715dc4f6c37b98ba5352643fc8e27) ) ROM_LOAD( "tf06.m4", 0x0400, 0x0400, CRC(3d2f007b) SHA1(7f4b6f3f08be8c886af3e2ccd3c0d93ae54d4649) ) ROM_LOAD( "tf07.m12", 0x0800, 0x0400, CRC(0b1d01c4) SHA1(8680602fecd412e5136e1107618a2e0a59b37d08) ) @@ -416,6 +607,8 @@ ROM_START( fgoala ) ROM_LOAD_NIB_HIGH( "tf10.m6", 0x0000, 0x0100, CRC(7b30b15d) SHA1(e9826a107b209e18d891ead341eda3d4523ce195) ) ROM_END +} // anonymous namespace + GAME( 1979, fgoal, 0, fgoal, fgoal, fgoal_state, empty_init, ROT90, "Taito", "Field Goal (set 1)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1979, fgoala, fgoal, fgoal, fgoal, fgoal_state, empty_init, ROT90, "Taito", "Field Goal (set 2)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/fgoal.h b/src/mame/taito/fgoal.h deleted file mode 100644 index 7543236a487..00000000000 --- a/src/mame/taito/fgoal.h +++ /dev/null @@ -1,91 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Stefan Jokisch -#ifndef MAME_INCLUDES_FGOAL_H -#define MAME_INCLUDES_FGOAL_H - -#pragma once - -#include "machine/mb14241.h" -#include "emupal.h" -#include "screen.h" - -class fgoal_state : public driver_device -{ -public: - fgoal_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_mb14241(*this, "mb14241"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_video_ram(*this, "video_ram") - { } - - void fgoal(machine_config &config); - - DECLARE_READ_LINE_MEMBER(_80_r); - -protected: - enum - { - TIMER_INTERRUPT - }; - - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - -private: - /* devices */ - required_device m_maincpu; - required_device m_mb14241; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - /* memory pointers */ - required_shared_ptr m_video_ram; - - /* video-related */ - bitmap_ind16 m_bgbitmap{}; - bitmap_ind16 m_fgbitmap{}; - uint8_t m_xpos = 0U; - uint8_t m_ypos = 0U; - int m_current_color = 0; - - /* misc */ - int m_player = 0; - uint8_t m_row = 0U; - uint8_t m_col = 0U; - int m_prev_coin = 0; - emu_timer *m_interrupt_timer = nullptr; - - uint8_t analog_r(); - uint8_t nmi_reset_r(); - uint8_t irq_reset_r(); - uint8_t row_r(); - void row_w(uint8_t data); - void col_w(uint8_t data); - uint8_t address_hi_r(); - uint8_t address_lo_r(); - uint8_t shifter_r(); - uint8_t shifter_reverse_r(); - void sound1_w(uint8_t data); - void sound2_w(uint8_t data); - void color_w(uint8_t data); - void ypos_w(uint8_t data); - void xpos_w(uint8_t data); - - TIMER_CALLBACK_MEMBER(interrupt_callback); - - void fgoal_palette(palette_device &palette) const; - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static int intensity(int bits); - unsigned video_ram_address(); - - void cpu_map(address_map &map); -}; - -#endif // MAME_INCLUDES_FGOAL_H diff --git a/src/mame/taito/fgoal_v.cpp b/src/mame/taito/fgoal_v.cpp deleted file mode 100644 index e45d57a9a53..00000000000 --- a/src/mame/taito/fgoal_v.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Stefan Jokisch -/*************************************************************************** - - Taito Field Goal video emulation - -***************************************************************************/ - -#include "emu.h" -#include "fgoal.h" - - -void fgoal_state::color_w(uint8_t data) -{ - m_current_color = data & 3; -} - - -void fgoal_state::ypos_w(uint8_t data) -{ - m_ypos = data; -} - - -void fgoal_state::xpos_w(uint8_t data) -{ - m_xpos = data; -} - - -void fgoal_state::video_start() -{ - m_screen->register_screen_bitmap(m_fgbitmap); - m_screen->register_screen_bitmap(m_bgbitmap); - - save_item(NAME(m_fgbitmap)); - save_item(NAME(m_bgbitmap)); -} - - -uint32_t fgoal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t const *VRAM = m_video_ram; - - /* draw color overlay foreground and background */ - - if (m_player == 1 && (ioport("IN1")->read() & 0x40)) - { - m_gfxdecode->gfx(0)->zoom_opaque(m_fgbitmap,cliprect, - 0, (m_player << 2) | m_current_color, - 1, 1, - 0, 16, - 0x40000, - 0x40000); - - m_gfxdecode->gfx(1)->zoom_opaque(m_bgbitmap,cliprect, - 0, 0, - 1, 1, - 0, 16, - 0x40000, - 0x40000); - } - else - { - m_gfxdecode->gfx(0)->zoom_opaque(m_fgbitmap,cliprect, - 0, (m_player << 2) | m_current_color, - 0, 0, - 0, 0, - 0x40000, - 0x40000); - - m_gfxdecode->gfx(1)->zoom_opaque(m_bgbitmap,cliprect, - 0, 0, - 0, 0, - 0, 0, - 0x40000, - 0x40000); - } - - /* the ball has a fixed color */ - - for (int y = m_ypos; y < m_ypos + 8; y++) - { - for (int x = m_xpos; x < m_xpos + 8; x++) - { - if (y < 256 && x < 256) - { - m_fgbitmap.pix(y, x) = 128 + 16; - } - } - } - - /* draw bitmap layer */ - - for (int y = 0; y < 256; y++) - { - uint16_t *const p = &bitmap.pix(y); - - uint16_t const *const FG = &m_fgbitmap.pix(y); - uint16_t const *const BG = &m_bgbitmap.pix(y); - - for (int x = 0; x < 256; x += 8) - { - uint8_t v = *VRAM++; - - for (int n = 0; n < 8; n++) - { - if (v & (1 << n)) - { - p[x + n] = FG[x + n]; - } - else - { - p[x + n] = BG[x + n]; - } - } - } - } - return 0; -} diff --git a/src/mame/taito/undrfire.h b/src/mame/taito/undrfire.h index 9fcf139fb15..5f9d12a4ddd 100644 --- a/src/mame/taito/undrfire.h +++ b/src/mame/taito/undrfire.h @@ -38,11 +38,6 @@ public: void cbombers(machine_config &config); protected: - enum - { - TIMER_INTERRUPT5 - }; - virtual void video_start() override; private: diff --git a/src/mame/taito/volfied.h b/src/mame/taito/volfied.h index 705213b7c50..72842847176 100644 --- a/src/mame/taito/volfied.h +++ b/src/mame/taito/volfied.h @@ -31,11 +31,6 @@ public: void volfied(machine_config &config); protected: - enum - { - TIMER_VOLFIED - }; - virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; -- cgit v1.2.3