More improvements to misc/vpoker.cpp driver: [Roberto Fresca, Grull Osgo]

- Rewrote the lamps scheme.
 - Fixed the button-lamps layouts.
 - Added workaround for the NMI routine (vpoker).
 - Fixed vpoker NVRAM issues.
 - Fixed mech counters support per game.
This commit is contained in:
Roberto Fresca 2025-03-06 00:49:20 +01:00
parent 8715486243
commit 6ab47fbba3
3 changed files with 79 additions and 32 deletions

View File

@ -116,10 +116,10 @@ copyright-holders: Roberto Fresca, Grull Osgo.
</element> </element>
<!-- Bet button-lamp --> <!-- Bet button-lamp -->
<element name="lamp7" ref="buttonedge_w" inputtag="IN0" inputmask="0x02"> <element name="lamp8" ref="buttonedge_w" inputtag="IN0" inputmask="0x02">
<bounds x="0.775" y="3.50" width="0.35" height="0.30" /> <bounds x="0.775" y="3.50" width="0.35" height="0.30" />
</element> </element>
<element name="lamp7" ref="L7" inputtag="IN0" inputmask="0x02"> <element name="lamp8" ref="L7" inputtag="IN0" inputmask="0x02">
<bounds x="0.795" y="3.52" width="0.31" height="0.26" /> <bounds x="0.795" y="3.52" width="0.31" height="0.26" />
</element> </element>

View File

@ -117,42 +117,42 @@ copyright-holders: Roberto Fresca, Grull Osgo.
<!-- define button-lamps --> <!-- define button-lamps -->
<!-- Hold 1 button-lamp --> <!-- Hold 1 button-lamp -->
<element name="lamp6" ref="buttonedge_w" inputtag="IN1" inputmask="0x01"> <element name="lamp7" ref="buttonedge_w" inputtag="IN1" inputmask="0x01">
<bounds x="0.425" y="3.10" width="0.35" height="0.30" /> <bounds x="0.425" y="3.10" width="0.35" height="0.30" />
</element> </element>
<element name="lamp6" ref="L0" inputtag="IN1" inputmask="0x01"> <element name="lamp7" ref="L0" inputtag="IN1" inputmask="0x01">
<bounds x="0.445" y="3.12" width="0.31" height="0.26" /> <bounds x="0.445" y="3.12" width="0.31" height="0.26" />
</element> </element>
<!-- Bet button-lamp --> <!-- Bet button-lamp -->
<element name="lamp7" ref="buttonedge_w" inputtag="IN0" inputmask="0x02"> <element name="lamp8" ref="buttonedge_w" inputtag="IN0" inputmask="0x02">
<bounds x="0.775" y="3.50" width="0.35" height="0.30" /> <bounds x="0.775" y="3.50" width="0.35" height="0.30" />
</element> </element>
<element name="lamp7" ref="L6" inputtag="IN0" inputmask="0x02"> <element name="lamp8" ref="L6" inputtag="IN0" inputmask="0x02">
<bounds x="0.795" y="3.52" width="0.31" height="0.26" /> <bounds x="0.795" y="3.52" width="0.31" height="0.26" />
</element> </element>
<!-- Hold 2 button-lamp --> <!-- Hold 2 button-lamp -->
<element name="lamp6" ref="buttonedge_w" inputtag="IN1" inputmask="0x02"> <element name="lamp7" ref="buttonedge_w" inputtag="IN1" inputmask="0x02">
<bounds x="1.125" y="3.10" width="0.35" height="0.30" /> <bounds x="1.125" y="3.10" width="0.35" height="0.30" />
</element> </element>
<element name="lamp6" ref="L1" inputtag="IN1" inputmask="0x02"> <element name="lamp7" ref="L1" inputtag="IN1" inputmask="0x02">
<bounds x="1.145" y="3.12" width="0.31" height="0.26" /> <bounds x="1.145" y="3.12" width="0.31" height="0.26" />
</element> </element>
<!-- Cancel button-lamp --> <!-- Cancel button-lamp -->
<element name="lamp6" ref="buttonedge_w" inputtag="IN1" inputmask="0x80"> <element name="lamp7" ref="buttonedge_w" inputtag="IN1" inputmask="0x80">
<bounds x="1.475" y="3.50" width="0.35" height="0.30" /> <bounds x="1.475" y="3.50" width="0.35" height="0.30" />
</element> </element>
<element name="lamp6" ref="L5" inputtag="IN1" inputmask="0x80"> <element name="lamp7" ref="L5" inputtag="IN1" inputmask="0x80">
<bounds x="1.495" y="3.52" width="0.31" height="0.26" /> <bounds x="1.495" y="3.52" width="0.31" height="0.26" />
</element> </element>
<!-- Hold 3 button-lamp --> <!-- Hold 3 button-lamp -->
<element name="lamp6" ref="buttonedge_w" inputtag="IN1" inputmask="0x04"> <element name="lamp7" ref="buttonedge_w" inputtag="IN1" inputmask="0x04">
<bounds x="1.825" y="3.10" width="0.35" height="0.30" /> <bounds x="1.825" y="3.10" width="0.35" height="0.30" />
</element> </element>
<element name="lamp6" ref="L2" inputtag="IN1" inputmask="0x04"> <element name="lamp7" ref="L2" inputtag="IN1" inputmask="0x04">
<bounds x="1.845" y="3.12" width="0.31" height="0.26" /> <bounds x="1.845" y="3.12" width="0.31" height="0.26" />
</element> </element>
@ -165,10 +165,10 @@ copyright-holders: Roberto Fresca, Grull Osgo.
</element> </element>
<!-- Hold 4 button-lamp --> <!-- Hold 4 button-lamp -->
<element name="lamp6" ref="buttonedge_w" inputtag="IN1" inputmask="0x08"> <element name="lamp7" ref="buttonedge_w" inputtag="IN1" inputmask="0x08">
<bounds x="2.525" y="3.10" width="0.35" height="0.30" /> <bounds x="2.525" y="3.10" width="0.35" height="0.30" />
</element> </element>
<element name="lamp6" ref="L3" inputtag="IN1" inputmask="0x08"> <element name="lamp7" ref="L3" inputtag="IN1" inputmask="0x08">
<bounds x="2.545" y="3.12" width="0.31" height="0.26" /> <bounds x="2.545" y="3.12" width="0.31" height="0.26" />
</element> </element>
@ -181,10 +181,10 @@ copyright-holders: Roberto Fresca, Grull Osgo.
</element> </element>
<!-- Hold 5 button-lamp --> <!-- Hold 5 button-lamp -->
<element name="lamp6" ref="buttonedge_w" inputtag="IN1" inputmask="0x10"> <element name="lamp7" ref="buttonedge_w" inputtag="IN1" inputmask="0x10">
<bounds x="3.225" y="3.10" width="0.35" height="0.30" /> <bounds x="3.225" y="3.10" width="0.35" height="0.30" />
</element> </element>
<element name="lamp6" ref="L4" inputtag="IN1" inputmask="0x10"> <element name="lamp7" ref="L4" inputtag="IN1" inputmask="0x10">
<bounds x="3.245" y="3.12" width="0.31" height="0.26" /> <bounds x="3.245" y="3.12" width="0.31" height="0.26" />
</element> </element>

View File

@ -142,16 +142,25 @@
- Promoted 5acespkr to working. - Promoted 5acespkr to working.
- Added technical notes. - Added technical notes.
Updates [2025-03-06]:
- Rewrote the lamps scheme.
- Fixed the button-lamps layouts.
- Added workaround for the NMI routine (vpoker).
- Fixed vpoker NVRAM issues.
- Fixed mech counters support per game.
TODO: TODO:
- Check NVRAM issues. - Add workaround for the NMI routine (5acespkr).
- Fix the 5acespkr NVRAM issues.
- Find why vectors are changed in 5acespkr. - Find why vectors are changed in 5acespkr.
- Investigate about what seems to be a custom processor - Investigate about what seems to be a custom processor
due to the weird routines related to interrupts, and the due to the weird routines related to interrupts, and the
complete lack of SWI triggers. complete lack of SWI triggers.
**************************************************************************************************************/ **************************************************************************************************************/
@ -194,11 +203,14 @@ protected:
virtual void video_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD;
private: private:
uint8_t nvram_r(offs_t offset);
void nvram_w(offs_t offset, u8 data);
std::unique_ptr<uint8_t[]> m_videoram; std::unique_ptr<uint8_t[]> m_videoram;
uint8_t m_blit_ram[8]; uint8_t m_blit_ram[8];
uint8_t blitter_r(offs_t offset); uint8_t blitter_r(offs_t offset);
void blitter_w(offs_t offset, uint8_t data); void blitter_w(offs_t offset, uint8_t data);
void ptm_irq(int state); void ptm_irq(int state);
void ptm_5_irq(int state);
void swi_int(int state); void swi_int(int state);
uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
@ -209,6 +221,8 @@ private:
required_ioport m_in1; required_ioport m_in1;
output_finder<9> m_lamps; output_finder<9> m_lamps;
void main_map(address_map &map) ATTR_COLD; void main_map(address_map &map) ATTR_COLD;
std::unique_ptr<u8[]> m_nvram_data;
}; };
@ -263,9 +277,9 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data)
if(offset == 1) if(offset == 1)
{ {
machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); // coin_in machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); // coin_in
machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // coin_out machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // coin_out (5aces)
machine().bookkeeping().coin_counter_w(1, BIT(data, 6)); // coin_out (vpoker)
m_lamps[7] = BIT(data, 7); // bet lamp m_lamps[8] = BIT(data, 7); // bet lamp
} }
if(offset == 2) if(offset == 2)
{ {
@ -276,13 +290,14 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data)
} }
if(offset == 3) if(offset == 3)
{ {
m_lamps[0] = BIT(data, 0); // hold 1 lamp m_lamps[0] = BIT(data, 0); // hold 1 lamp (5acespkr)
m_lamps[1] = BIT(data, 1); // hold 2 lamp m_lamps[1] = BIT(data, 1); // hold 2 lamp (5acespkr)
m_lamps[2] = BIT(data, 2); // hold 3 lamp m_lamps[2] = BIT(data, 2); // hold 3 lamp (5acespkr)
m_lamps[3] = BIT(data, 3); // hold 4 lamp m_lamps[3] = BIT(data, 3); // hold 4 lamp (5acespkr)
m_lamps[4] = BIT(data, 4); // hold 5 lamp m_lamps[4] = BIT(data, 4); // hold 5 lamp (5acespkr)
m_lamps[5] = BIT(data, 5); // deal lamp m_lamps[5] = BIT(data, 5); // deal lamp (common)
m_lamps[6] = BIT(data, 6); // draw lamp m_lamps[6] = BIT(data, 6); // draw lamp (common)
m_lamps[7] = BIT(data, 7); // holds + cancel (vpoker)
} }
else else
{ {
@ -290,6 +305,16 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data)
} }
} }
uint8_t vpoker_state::nvram_r(offs_t offset)
{
return m_nvram_data[offset];
}
void vpoker_state::nvram_w(offs_t offset, u8 data)
{
m_nvram_data[offset] = data;
}
/*********************************** /***********************************
* Machine Start * * Machine Start *
@ -297,6 +322,9 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data)
void vpoker_state::machine_start() void vpoker_state::machine_start()
{ {
m_nvram_data = make_unique_clear<u8[]>(0x200);
subdevice<nvram_device>("nvram")->set_base(&m_nvram_data[0], 0x200);
save_pointer(NAME(m_nvram_data), 0x200);
m_lamps.resolve(); m_lamps.resolve();
} }
@ -308,7 +336,7 @@ void vpoker_state::machine_start()
void vpoker_state::main_map(address_map &map) void vpoker_state::main_map(address_map &map)
{ {
map.global_mask(0x3fff); map.global_mask(0x3fff);
map(0x0000, 0x01ff).ram().share("nvram"); // vpoker has 0x100, 5acespkr has 0x200 map(0x0000, 0x01ff).rw(FUNC(vpoker_state::nvram_r), FUNC(vpoker_state::nvram_w));
map(0x0400, 0x0407).rw("6840ptm", FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); map(0x0400, 0x0407).rw("6840ptm", FUNC(ptm6840_device::read), FUNC(ptm6840_device::write));
map(0x0800, 0x0807).r(FUNC(vpoker_state::blitter_r)).w(FUNC(vpoker_state::blitter_w)); map(0x0800, 0x0807).r(FUNC(vpoker_state::blitter_r)).w(FUNC(vpoker_state::blitter_w));
map(0x2000, 0x3fff).rom(); map(0x2000, 0x3fff).rom();
@ -397,8 +425,29 @@ GFXDECODE_END
void vpoker_state::ptm_irq(int state) void vpoker_state::ptm_irq(int state)
{ {
m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
if(state == 0)
{
// do de job that must be done by NMI.
uint8_t sum = 0;
nvram_w(0x4f, 0x5a);
nvram_w(0x91, 0xa5);
nvram_w(0x9f, 0x00);
for(int i = 0x40; i < 0xa0; i++)
sum += nvram_r(i);
sum = ~sum + 1;
nvram_w(0x9f, sum);
sum = 0;
}
} }
void vpoker_state::ptm_5_irq(int state)
{
m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
void vpoker_state::swi_int(int state) void vpoker_state::swi_int(int state)
{ {
if(m_in0->read() == 0xfe) if(m_in0->read() == 0xfe)
@ -406,7 +455,6 @@ void vpoker_state::swi_int(int state)
} }
/***************************************** /*****************************************
* Machine Driver * * Machine Driver *
*****************************************/ *****************************************/
@ -416,7 +464,6 @@ void vpoker_state::vpoker(machine_config &config)
// basic machine hardware // basic machine hardware
MC6809(config, m_maincpu, XTAL(4'000'000)); MC6809(config, m_maincpu, XTAL(4'000'000));
m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map); m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(vpoker_state::irq0_line_assert));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@ -468,7 +515,7 @@ void vpoker_state::fiveaces(machine_config &config)
// 6840 PTM // 6840 PTM
ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4));
ptm.set_external_clocks(500, 0, 1000000); ptm.set_external_clocks(500, 0, 1000000);
ptm.irq_callback().set(FUNC(vpoker_state::ptm_irq)); ptm.irq_callback().set(FUNC(vpoker_state::ptm_5_irq));
ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w));
// sound hardware // sound hardware