Skip to content

Commit 022bed2

Browse files
committed
Lucky Line III improvements:
- Reverted the port 10h protection hack. - Hooked the port 10h to the video register and arranged the system to use it instead of hardcoded values. - Reworked part of the inputs, getting the missing stop buttons working properly.
1 parent 440ccee commit 022bed2

File tree

1 file changed

+47
-31
lines changed

1 file changed

+47
-31
lines changed

src/mame/igs/goldstar.cpp

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ class cmaster_state : public goldstar_state
512512
void coincount_w(uint8_t data);
513513
void pkm_out0_w(uint8_t data);
514514
void jkm_vid_reg_w(uint8_t data);
515+
void ll3_vid_reg_w(uint8_t data);
515516

516517
uint32_t screen_update_amcoe1a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
517518
uint32_t screen_update_cmast91(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -539,6 +540,7 @@ class cmaster_state : public goldstar_state
539540
void jkrmast_map(address_map &map) ATTR_COLD;
540541
void jkrmast_portmap(address_map &map) ATTR_COLD;
541542
void ll3_map(address_map &map) ATTR_COLD;
543+
void ll3_portmap(address_map &map) ATTR_COLD;
542544
void nfm_map(address_map &map) ATTR_COLD;
543545
void nfm_portmap(address_map &map) ATTR_COLD;
544546
void pkrmast_portmap(address_map &map) ATTR_COLD;
@@ -2559,6 +2561,29 @@ void cmaster_state::pkm_out0_w(uint8_t data)
25592561
void cmaster_state::jkm_vid_reg_w(uint8_t data)
25602562
{
25612563
m_enable_reg = bitswap<8>(data, 7, 6, 5, 4, 2, 3, 1, 0);
2564+
// popmessage("outport data:%02x", m_enable_reg );
2565+
2566+
}
2567+
2568+
void cmaster_state::ll3_vid_reg_w(uint8_t data)
2569+
{
2570+
/*
2571+
---- ---x global enable
2572+
---- --x- fg enable
2573+
---- -x-- girl enable
2574+
---- x--- reels enable
2575+
---x --- bg enable
2576+
xxx- ---- unused
2577+
2578+
All the writes have masked the register, getting
2579+
the video totally disabled. Surely for protection.
2580+
2581+
*/
2582+
if(data > 0)
2583+
data = data + 0x01;
2584+
m_enable_reg = data;
2585+
2586+
// popmessage("outport data:%02x", m_enable_reg );
25622587
}
25632588

25642589

@@ -2751,6 +2776,20 @@ void cmaster_state::jkrmast_portmap(address_map &map)
27512776
map(0x18, 0x18).w(FUNC(cmaster_state::jkm_vid_reg_w)); // enable reg?
27522777
}
27532778

2779+
void cmaster_state::ll3_portmap(address_map &map)
2780+
{
2781+
map.global_mask(0xff);
2782+
map(0x01, 0x01).r("aysnd", FUNC(ay8910_device::data_r));
2783+
map(0x02, 0x03).w("aysnd", FUNC(ay8910_device::data_address_w));
2784+
map(0x04, 0x07).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); // Inputs
2785+
map(0x08, 0x0b).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); // DIP switches
2786+
map(0x10, 0x10).w(FUNC(cmaster_state::ll3_vid_reg_w));
2787+
map(0x11, 0x11).w(FUNC(cmaster_state::coincount_w));
2788+
map(0x12, 0x12).w(FUNC(cmaster_state::p1_lamps_w));
2789+
map(0x13, 0x13).w(FUNC(cmaster_state::background_col_w));
2790+
map(0x14, 0x14).w(FUNC(cmaster_state::girl_scroll_w));
2791+
}
2792+
27542793
void cmaster_state::eldoraddoa_portmap(address_map &map) // TODO: incomplete!
27552794
{
27562795
map.global_mask(0xff);
@@ -4027,17 +4066,17 @@ static INPUT_PORTS_START( ll3 )
40274066
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CODE(KEYCODE_B) PORT_NAME("Big")
40284067
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
40294068
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_CODE(KEYCODE_X) PORT_NAME("Take")
4030-
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_C) PORT_NAME("Bet / D-UP")
4069+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_C) PORT_NAME("Bet / D-UP") // mapped also in C for compatibility
40314070
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_CODE(KEYCODE_V) PORT_NAME("Small / Info")
40324071
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_CODE(KEYCODE_N) PORT_NAME("Start")
40334072

40344073
PORT_START("IN1")
4035-
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CODE(KEYCODE_K) PORT_CODE(KEYCODE_2_PAD) // Stop B
4036-
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CODE(KEYCODE_J) PORT_CODE(KEYCODE_1_PAD) // Stop A
4037-
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_NAME("Coin B")
4038-
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_L) PORT_CODE(KEYCODE_3_PAD) // Stop C
4039-
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_IMPULSE(2) PORT_NAME("Coin D")
4040-
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) PORT_NAME("Coin C")
4074+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CODE(KEYCODE_K) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Stop B / D-UP") // Stop B & D-UP
4075+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CODE(KEYCODE_J) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Stop A") // Stop A
4076+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CODE(KEYCODE_M) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Stop All") // Stop All
4077+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_L) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Stop C") // Stop C
4078+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_IMPULSE(2) PORT_NAME("Coin D")
4079+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) PORT_NAME("Coin C")
40414080
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
40424081
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_NAME("Coin A")
40434082

@@ -12274,6 +12313,7 @@ void cmaster_state::ll3(machine_config &config)
1227412313
cm(config);
1227512314

1227612315
m_maincpu->set_addrmap(AS_PROGRAM, &cmaster_state::ll3_map);
12316+
m_maincpu->set_addrmap(AS_IO, &cmaster_state::ll3_portmap);
1227712317
}
1227812318

1227912319

@@ -25441,18 +25481,6 @@ void cmaster_state::init_ll3() // verified with ICE dump
2544125481
rom[0x8a] = 0;
2544225482
rom[0x8b] = 0;
2544325483
rom[0x8c] = 0;
25444-
25445-
/*
25446-
NOP'ing the writes to port 10h (video register)
25447-
all the writes have masked the bit1 ON, getting
25448-
the video totally disabled. Surely for protection.
25449-
25450-
The most probably thing is that bit1 are inverted.
25451-
Need to be checked...
25452-
25453-
*/
25454-
rom[0x0b2c] = 0x00;
25455-
rom[0x0b2d] = 0x00;
2545625484
}
2545725485

2545825486
void cmaster_state::init_ll3b() // verified with ICE dump
@@ -25468,18 +25496,6 @@ void cmaster_state::init_ll3b() // verified with ICE dump
2546825496
rom[0x8a] = 0;
2546925497
rom[0x8b] = 0;
2547025498
rom[0x8c] = 0;
25471-
25472-
/*
25473-
NOP'ing the writes to port 10h (video register)
25474-
all the writes have masked the bit1 ON, getting
25475-
the video totally disabled. Surely for protection.
25476-
25477-
The most probably thing is that bit1 are inverted.
25478-
Need to be checked...
25479-
25480-
*/
25481-
rom[0x0b2c] = 0x00;
25482-
rom[0x0b2d] = 0x00;
2548325499
}
2548425500

2548525501

0 commit comments

Comments
 (0)