30test.cpp, fortecar.cpp, funtech.cpp: output_finder (nw)

This commit is contained in:
Ivan Vangelista 2018-04-27 19:31:31 +02:00
parent 5ec49fc340
commit 6cac80efa4
3 changed files with 95 additions and 92 deletions

View File

@ -60,10 +60,23 @@ public:
, m_maincpu(*this, "maincpu")
, m_oki(*this, "oki")
, m_digits(*this, "digit%u", 0U)
, m_lamps(*this, "lamp%u", 0U)
{ }
void _30test(machine_config &config);
protected:
virtual void machine_start() override;
private:
required_device<cpu_device> m_maincpu;
required_device<okim6295_device> m_oki;
output_finder<72> m_digits;
output_finder<8> m_lamps;
uint8_t m_mux_data;
uint8_t m_oki_bank;
DECLARE_WRITE8_MEMBER(namco_30test_led_w);
DECLARE_WRITE8_MEMBER(namco_30test_led_rank_w);
DECLARE_WRITE8_MEMBER(namco_30test_lamps_w);
@ -72,14 +85,9 @@ public:
DECLARE_WRITE8_MEMBER(hc11_mux_w);
DECLARE_READ8_MEMBER(hc11_okibank_r);
DECLARE_WRITE8_MEMBER(hc11_okibank_w);
virtual void machine_start() override;
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
required_device<okim6295_device> m_oki;
void _30test(machine_config &config);
void namco_30test_io(address_map &map);
void namco_30test_map(address_map &map);
output_finder<72> m_digits;
};
@ -105,7 +113,7 @@ WRITE8_MEMBER(namco_30test_state::namco_30test_lamps_w)
{
// d0-d5: ranking, d6: game over, d7: assume marquee lamp
for (int i = 0; i < 8; i++)
output().set_lamp_value(i, data >> i & 1);
m_lamps[i] = BIT(data, i);
}
READ8_MEMBER(namco_30test_state::namco_30test_mux_r)
@ -240,15 +248,11 @@ INPUT_PORTS_END
void namco_30test_state::machine_start()
{
m_digits.resolve();
m_lamps.resolve();
save_item(NAME(m_mux_data));
save_item(NAME(m_oki_bank));
}
void namco_30test_state::machine_reset()
{
}
MACHINE_CONFIG_START(namco_30test_state::_30test)
/* basic machine hardware */

View File

@ -26,7 +26,7 @@
with the Bulgarian players. Improved versions were developed and were sold in Russia, Austria,
Brazil, Argentina and the Balkan peninsular.
In 1995, Fortex, first of all Bulgarian games manufacturers, exibited at the Plovdiv Fair a com-
In 1995, Fortex, first of all Bulgarian games manufacturers, exhibited at the Plovdiv Fair a com-
puter based version of Forte Card. The following years were times of hard teamwork, which resul-
ted in a variety of products: centralized cash desk, on-line jackpot and a network control and
management system for game centers.
@ -340,24 +340,34 @@ public:
m_vram(*this, "vram"),
m_eeprom(*this, "eeprom"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
m_palette(*this, "palette"),
m_lamps(*this, "lamp%u", 0U) { }
void fortecar(machine_config &config);
DECLARE_DRIVER_INIT(fortecar);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
required_device<cpu_device> m_maincpu;
required_device<watchdog_timer_device> m_watchdog;
required_shared_ptr<uint8_t> m_vram;
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
output_finder<8> m_lamps;
DECLARE_WRITE8_MEMBER(ppi0_portc_w);
DECLARE_READ8_MEMBER(ppi0_portc_r);
DECLARE_WRITE8_MEMBER(ayporta_w);
DECLARE_WRITE8_MEMBER(ayportb_w);
DECLARE_DRIVER_INIT(fortecar);
virtual void machine_reset() override;
virtual void video_start() override;
DECLARE_PALETTE_INIT(fortecar);
uint32_t screen_update_fortecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
void fortecar(machine_config &config);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void fortecar_map(address_map &map);
void fortecar_ports(address_map &map);
};
@ -367,24 +377,22 @@ public:
* Video Hardware *
***********************************/
void fortecar_state::video_start()
void fortecar_state::machine_start()
{
m_lamps.resolve();
}
uint32_t fortecar_state::screen_update_fortecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t fortecar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int x, y, count;
count = 0;
int count = 0;
for (y = 0; y < 0x1e; y++)
for (int y = 0; y < 0x1e; y++)
{
for(x = 0; x < 0x4b; x++)
for(int x = 0; x < 0x4b; x++)
{
int tile, color, bpp;
tile = (m_vram[(count*4)+1] | (m_vram[(count*4)+2]<<8)) & 0xfff;
color = m_vram[(count*4)+3] & 0x1f;
bpp = (m_vram[(count*4)+3] & 0x20) >> 5;
int tile = (m_vram[(count*4)+1] | (m_vram[(count*4)+2]<<8)) & 0xfff;
int color = m_vram[(count*4)+3] & 0x1f;
int bpp = (m_vram[(count*4)+3] & 0x20) >> 5;
if(bpp)
color &= 0x3;
@ -414,7 +422,6 @@ O8 (LS374) R220 BLUE
R = 82 Ohms Pull Down.
*/
int i;
static const int resistances_rg[3] = { 1000, 510, 220 };
static const int resistances_b [2] = { 510, 220 };
double weights_r[3], weights_g[3], weights_b[2];
@ -424,7 +431,7 @@ R = 82 Ohms Pull Down.
3, resistances_rg, weights_g, 82, 0,
2, resistances_b, weights_b, 82, 0);
for (i = 0; i < 512; i++)
for (int i = 0; i < 512; i++)
{
int bit0, bit1, bit2, r, g, b;
@ -500,10 +507,8 @@ WRITE8_MEMBER(fortecar_state::ayporta_w)
0x20 (hold1): IRQ test
0x40 (black): Stack RAM check
*/
int i;
for(i = 0; i < 8; i++)
output().set_lamp_value(i, (data >> i) & 1);
for (int i = 0; i < 8; i++)
m_lamps[i] = BIT(data, i);
}
@ -516,7 +521,7 @@ Bit7 of port B is a watchdog.
A square wave is fed to through resistor R to capacitor C, with a constant charge/discharge
time relative to the value of resistor R and value of capacitor C. If the square wave halts,
capacitor C will charge beyond the hysteresis threshhold of the TL7705 (leg 6), causing it to
capacitor C will charge beyond the hysteresis threshold of the TL7705 (leg 6), causing it to
trigger a reset.
Seems to work properly, but must be checked closely...
@ -665,10 +670,8 @@ GFXDECODE_END
void fortecar_state::machine_reset()
{
int i;
/* apparently there's a random fill in there (checked thru trojan TODO: extract proper algorythm) */
for(i = 0; i < m_vram.bytes(); i++)
/* apparently there's a random fill in there (checked thru trojan TODO: extract proper algorithm) */
for (int i = 0; i < m_vram.bytes(); i++)
m_vram[i] = machine().rand();
}
@ -694,7 +697,7 @@ MACHINE_CONFIG_START(fortecar_state::fortecar)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(640, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 600-1, 0, 240-1) /* driven by CRTC */
MCFG_SCREEN_UPDATE_DRIVER(fortecar_state, screen_update_fortecar)
MCFG_SCREEN_UPDATE_DRIVER(fortecar_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")
@ -760,7 +763,7 @@ ROM_START( fortecar )
ROM_LOAD( "fortecar.u39", 0x10000, 0x10000, CRC(fc3ddf4f) SHA1(4a95b24c4edb67f6d59f795f86dfbd12899e01b0) )
ROM_LOAD( "fortecar.u40", 0x20000, 0x10000, CRC(9693bb83) SHA1(e3e3bc750c89a1edd1072ce3890b2ce498dec633) )
/* took from the Spanish version, these are likely to be identical anyway */
/* taken from the Spanish version, these are likely to be identical anyway */
ROM_REGION( 0x0800, "nvram", 0 ) /* default NVRAM */
ROM_LOAD( "fortecrd_nvram.u6", 0x0000, 0x0800, BAD_DUMP CRC(7d3e7eb5) SHA1(788fe7adc381bcc6eaefed33f5aa1081340608a0) )

View File

@ -13,7 +13,7 @@ PROGRAM-VERSION:1.0
PROGRAM-DATE:09/23/1993
8x8 tiles and 8x32 reels, likely going to be very similar to skylncr.cpp or goldstar.cpp (which are both very similar anyway)
palette addresses are the same as unkch in goldtar.cpp, but the io stuff is definitely different here
palette addresses are the same as unkch in goldstar.cpp, but the io stuff is definitely different here
board has an M5255 for sound
and an unpopulated position for a YM2413 or UM3567
@ -48,8 +48,16 @@ public:
m_reel1_alt_scroll(*this, "reel1_alt_scroll"),
m_maincpu(*this, "maincpu"),
m_hopper(*this, "hopper"),
m_gfxdecode(*this, "gfxdecode") { }
m_gfxdecode(*this, "gfxdecode"),
m_lamps(*this, "lamp%u", 0U) { }
void funtech(machine_config &config);
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
required_shared_ptr<uint8_t> m_fgram;
required_shared_ptr<uint8_t> m_reel1_ram;
required_shared_ptr<uint8_t> m_reel2_ram;
@ -58,19 +66,21 @@ public:
required_shared_ptr<uint8_t> m_reel2_scroll;
required_shared_ptr<uint8_t> m_reel3_scroll;
required_shared_ptr<uint8_t> m_reel1_alt_scroll;
INTERRUPT_GEN_MEMBER(funtech_vblank_interrupt);
DECLARE_WRITE8_MEMBER(funtech_lamps_w);
DECLARE_WRITE8_MEMBER(funtech_coins_w);
DECLARE_WRITE8_MEMBER(funtech_vreg_w);
required_device<cpu_device> m_maincpu;
required_device<ticket_dispenser_device> m_hopper;
required_device<gfxdecode_device> m_gfxdecode;
output_finder<8> m_lamps;
uint8_t m_vreg;
tilemap_t *m_fg_tilemap;
INTERRUPT_GEN_MEMBER(vblank_interrupt);
DECLARE_WRITE8_MEMBER(lamps_w);
DECLARE_WRITE8_MEMBER(coins_w);
DECLARE_WRITE8_MEMBER(vreg_w);
DECLARE_WRITE8_MEMBER(fgram_w);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
@ -87,14 +97,8 @@ public:
TILE_GET_INFO_MEMBER(get_reel2_tile_info);
TILE_GET_INFO_MEMBER(get_reel3_tile_info);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_funtech(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<ticket_dispenser_device> m_hopper;
required_device<gfxdecode_device> m_gfxdecode;
void funtech(machine_config &config);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void funtech_io_map(address_map &map);
void funtech_map(address_map &map);
};
@ -175,12 +179,12 @@ WRITE8_MEMBER(fun_tech_corp_state::reel3_ram_w)
void fun_tech_corp_state::video_start()
{
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_fg_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_fg_tilemap->set_transparent_pen(0);
m_reel1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_reel1_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
m_reel2_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_reel2_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
m_reel3_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_reel3_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
m_reel1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_reel1_tile_info), this), TILEMAP_SCAN_ROWS, 8, 32, 64, 8);
m_reel2_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_reel2_tile_info), this), TILEMAP_SCAN_ROWS, 8, 32, 64, 8);
m_reel3_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(fun_tech_corp_state::get_reel3_tile_info), this), TILEMAP_SCAN_ROWS, 8, 32, 64, 8);
m_reel1_tilemap->set_scroll_cols(64);
m_reel2_tilemap->set_scroll_cols(64);
@ -195,7 +199,7 @@ WRITE8_MEMBER(fun_tech_corp_state::fgram_w)
}
uint32_t fun_tech_corp_state::screen_update_funtech(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t fun_tech_corp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
@ -234,7 +238,7 @@ uint32_t fun_tech_corp_state::screen_update_funtech(screen_device &screen, bitma
INTERRUPT_GEN_MEMBER(fun_tech_corp_state::funtech_vblank_interrupt)
INTERRUPT_GEN_MEMBER(fun_tech_corp_state::vblank_interrupt)
{
// if (m_nmi_enable)
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
@ -267,21 +271,15 @@ void fun_tech_corp_state::funtech_map(address_map &map)
}
WRITE8_MEMBER(fun_tech_corp_state::funtech_lamps_w)
WRITE8_MEMBER(fun_tech_corp_state::lamps_w)
{
output().set_lamp_value(0, (data >> 0) & 1);
output().set_lamp_value(1, (data >> 1) & 1);
output().set_lamp_value(2, (data >> 2) & 1);
output().set_lamp_value(3, (data >> 3) & 1);
output().set_lamp_value(4, (data >> 4) & 1);
output().set_lamp_value(5, (data >> 5) & 1);
output().set_lamp_value(6, (data >> 6) & 1);
output().set_lamp_value(7, (data >> 7) & 1);
for (int i = 0; i < 8; i++)
m_lamps[i] = BIT(data, i);
}
WRITE8_MEMBER(fun_tech_corp_state::funtech_coins_w)
WRITE8_MEMBER(fun_tech_corp_state::coins_w)
{
if (data & 0x01) printf("funtech_coins_w %02x\n", data);
if (data & 0x01) printf("coins_w %02x\n", data);
// 80 = hopper motor?
m_hopper->motor_w(BIT(data, 7));
@ -303,9 +301,9 @@ WRITE8_MEMBER(fun_tech_corp_state::funtech_coins_w)
// 02 = used when hopper is used (coin out counter?)
}
WRITE8_MEMBER(fun_tech_corp_state::funtech_vreg_w)
WRITE8_MEMBER(fun_tech_corp_state::vreg_w)
{
if (data & 0xb2) printf("funtech_vreg_w %02x\n", data);
if (data & 0xb2) printf("vreg_w %02x\n", data);
// -x-- rr-t
// t = text tile bank
@ -323,10 +321,10 @@ void fun_tech_corp_state::funtech_io_map(address_map &map)
{
map.global_mask(0xff);
// lamps?
map(0x00, 0x00).w(this, FUNC(fun_tech_corp_state::funtech_lamps_w));
map(0x01, 0x01).w(this, FUNC(fun_tech_corp_state::funtech_coins_w));
map(0x00, 0x00).w(this, FUNC(fun_tech_corp_state::lamps_w));
map(0x01, 0x01).w(this, FUNC(fun_tech_corp_state::coins_w));
map(0x03, 0x03).w(this, FUNC(fun_tech_corp_state::funtech_vreg_w));
map(0x03, 0x03).w(this, FUNC(fun_tech_corp_state::vreg_w));
map(0x04, 0x04).portr("IN0");
map(0x05, 0x05).portr("IN1");
@ -483,19 +481,17 @@ GFXDECODE_END
void fun_tech_corp_state::machine_start()
{
m_lamps.resolve();
}
void fun_tech_corp_state::machine_reset()
{
}
MACHINE_CONFIG_START(fun_tech_corp_state::funtech)
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(funtech_map)
MCFG_CPU_IO_MAP(funtech_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", fun_tech_corp_state, funtech_vblank_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", fun_tech_corp_state, vblank_interrupt)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@ -503,7 +499,7 @@ MACHINE_CONFIG_START(fun_tech_corp_state::funtech)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 8, 256-8-1)
MCFG_SCREEN_UPDATE_DRIVER(fun_tech_corp_state, screen_update_funtech)
MCFG_SCREEN_UPDATE_DRIVER(fun_tech_corp_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", funtech)