mirror of
https://github.com/holub/mame
synced 2025-05-31 10:01:51 +03:00
gatron.cpp: output_finder (nw)
This commit is contained in:
parent
359d86c537
commit
6762946a67
@ -133,7 +133,7 @@
|
||||
You must to RESET (F3) the machine to initialize the NVRAM properly.
|
||||
|
||||
NOTE: These games are intended to be for amusement only.
|
||||
There is not such a payout system, so... Dont ask about it!
|
||||
There is not such a payout system, so... Don't ask about it!
|
||||
|
||||
|
||||
* Four In One Poker:
|
||||
@ -195,14 +195,14 @@
|
||||
3x Stars 75 3x Oranges 100 3x Bars 75
|
||||
3x Hearts 8 3x Watermelons 25 3x Cherries 10
|
||||
3x Cups 4 3x Horseshoes 10 3x Pears 6
|
||||
3x Clubs 3 3x Licquors 5 3x Plums 4
|
||||
3x Clubs 3 3x Liquors 5 3x Plums 4
|
||||
3x Crowns 1 3x Bells 2 3x Bananas 2
|
||||
|
||||
...but the game seems to have inverted objects importance:
|
||||
|
||||
- Super Star - - Lady Luck - - Big Bar -
|
||||
3x Crowns 75 3x Bells 100 3x Bananas 75
|
||||
3x Clubs 8 3x Licquors 25 3x Plums 10
|
||||
3x Clubs 8 3x Liquors 25 3x Plums 10
|
||||
3x Cups 4 3x Horseshoes 10 3x Pears 6
|
||||
3x Hearts 3 3x Watermelons 5 3x Cherries 4
|
||||
3x Stars 1 3x Oranges 2 3x Bars 2
|
||||
@ -293,7 +293,7 @@
|
||||
- Switched the 8255 port C to be used as output port.
|
||||
- Adjusted the coin pulse timing.
|
||||
- Updated technical notes.
|
||||
- Splitted the driver to driver + video.
|
||||
- Split the driver to driver + video.
|
||||
- Final clean-up.
|
||||
|
||||
[2008-05-31]
|
||||
@ -416,13 +416,8 @@ WRITE8_MEMBER(gatron_state::output_port_0_w)
|
||||
.x.. .... --> Change Card / Take / Low.
|
||||
|
||||
*/
|
||||
output().set_lamp_value(0, (data) & 1); /* hold3 lamp */
|
||||
output().set_lamp_value(1, (data >> 1) & 1); /* hold4 lamp */
|
||||
output().set_lamp_value(2, (data >> 2) & 1); /* hold5 lamp */
|
||||
output().set_lamp_value(3, (data >> 3) & 1); /* ante/bet lamp */
|
||||
output().set_lamp_value(4, (data >> 4) & 1); /* start lamp */
|
||||
output().set_lamp_value(5, (data >> 5) & 1); /* deal/hit lamp */
|
||||
output().set_lamp_value(6, (data >> 6) & 1); /* stand/fbdraw lamp */
|
||||
for (uint8_t i = 0; i < 7; i++)
|
||||
m_lamps[i] = BIT(data, i);
|
||||
}
|
||||
|
||||
|
||||
@ -441,8 +436,8 @@ WRITE8_MEMBER(gatron_state::output_port_1_w)
|
||||
x... .... --> Inverted pulse. Related to counters.
|
||||
|
||||
*/
|
||||
output().set_lamp_value(7, (data) & 1); /* hold2 lamp */
|
||||
output().set_lamp_value(8, (data >> 1) & 1); /* hold1 lamp */
|
||||
for (uint8_t i = 0; i < 2; i++)
|
||||
m_lamps[i + 7] = BIT(data, i);
|
||||
}
|
||||
|
||||
/*************************
|
||||
@ -452,7 +447,7 @@ WRITE8_MEMBER(gatron_state::output_port_1_w)
|
||||
void gatron_state::gat_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x5fff).rom();
|
||||
map(0x6000, 0x63ff).ram().w(this, FUNC(gatron_state::gat_videoram_w)).share("videoram");
|
||||
map(0x6000, 0x63ff).ram().w(this, FUNC(gatron_state::videoram_w)).share("videoram");
|
||||
map(0x8000, 0x87ff).ram().share("nvram"); /* battery backed RAM */
|
||||
map(0xa000, 0xa000).w("snsnd", FUNC(sn76489_device::write)); /* PSG */
|
||||
map(0xe000, 0xe000).w(this, FUNC(gatron_state::output_port_0_w)); /* lamps */
|
||||
@ -587,13 +582,12 @@ MACHINE_CONFIG_START(gatron_state::gat)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(48*8, 16*16)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 16*16-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(gatron_state, screen_update_gat)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(gatron_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_gat)
|
||||
MCFG_PALETTE_ADD("palette", 8)
|
||||
MCFG_PALETTE_INIT_OWNER(gatron_state, gatron)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
@ -643,6 +637,6 @@ ROM_END
|
||||
*************************/
|
||||
|
||||
/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
|
||||
GAMEL( 1983, poker41, 0, gat, poker41, gatron_state, empty_init, ROT0, "Game-A-Tron", "Four In One Poker", 0, layout_poker41 )
|
||||
GAMEL( 1983, pulltabs, 0, gat, pulltabs, gatron_state, empty_init, ROT0, "Game-A-Tron", "Pull Tabs", 0, layout_pulltabs )
|
||||
GAMEL( 1983, bingo, 0, gat, bingo, gatron_state, empty_init, ROT0, "Game-A-Tron", "Bingo", 0, layout_bingo )
|
||||
GAMEL( 1983, poker41, 0, gat, poker41, gatron_state, empty_init, ROT0, "Game-A-Tron", "Four In One Poker", MACHINE_SUPPORTS_SAVE, layout_poker41 )
|
||||
GAMEL( 1983, pulltabs, 0, gat, pulltabs, gatron_state, empty_init, ROT0, "Game-A-Tron", "Pull Tabs", MACHINE_SUPPORTS_SAVE, layout_pulltabs )
|
||||
GAMEL( 1983, bingo, 0, gat, bingo, gatron_state, empty_init, ROT0, "Game-A-Tron", "Bingo", MACHINE_SUPPORTS_SAVE, layout_bingo )
|
||||
|
@ -7,20 +7,28 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode") { }
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_lamps(*this, "lamp%u", 0U) { }
|
||||
|
||||
required_shared_ptr<uint8_t> m_videoram;
|
||||
tilemap_t *m_bg_tilemap;
|
||||
DECLARE_WRITE8_MEMBER(output_port_0_w);
|
||||
DECLARE_WRITE8_MEMBER(gat_videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(output_port_1_w);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
void gat(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
DECLARE_PALETTE_INIT(gatron);
|
||||
uint32_t screen_update_gat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
private:
|
||||
required_shared_ptr<uint8_t> m_videoram;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
void gat(machine_config &config);
|
||||
output_finder<9> m_lamps;
|
||||
tilemap_t *m_bg_tilemap;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(output_port_0_w);
|
||||
DECLARE_WRITE8_MEMBER(videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(output_port_1_w);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void gat_map(address_map &map);
|
||||
void gat_portmap(address_map &map);
|
||||
};
|
||||
|
@ -23,16 +23,14 @@
|
||||
#include "includes/gatron.h"
|
||||
|
||||
|
||||
WRITE8_MEMBER(gatron_state::gat_videoram_w)
|
||||
WRITE8_MEMBER(gatron_state::videoram_w)
|
||||
{
|
||||
uint8_t *videoram = m_videoram;
|
||||
videoram[offset] = data;
|
||||
m_videoram[offset] = data;
|
||||
m_bg_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(gatron_state::get_bg_tile_info)
|
||||
{
|
||||
uint8_t *videoram = m_videoram;
|
||||
/* - bits -
|
||||
7654 3210
|
||||
xxxx xxxx tiles code.
|
||||
@ -40,22 +38,20 @@ TILE_GET_INFO_MEMBER(gatron_state::get_bg_tile_info)
|
||||
only one color code
|
||||
*/
|
||||
|
||||
int code = videoram[tile_index];
|
||||
int code = m_videoram[tile_index];
|
||||
|
||||
SET_TILE_INFO_MEMBER(0, code, 0, 0);
|
||||
}
|
||||
|
||||
void gatron_state::video_start()
|
||||
{
|
||||
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gatron_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 16, 48, 16);
|
||||
m_lamps.resolve();
|
||||
|
||||
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gatron_state::get_bg_tile_info), this), TILEMAP_SCAN_COLS, 8, 16, 48, 16);
|
||||
}
|
||||
|
||||
uint32_t gatron_state::screen_update_gat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
uint32_t gatron_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PALETTE_INIT_MEMBER(gatron_state, gatron)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user