Skip to content

Commit 31eb0d8

Browse files
committed
corrected parameters used for NewStick()
corrected initial value of swcha_p in riot. this fixes the problem of some single button joystick using ROMs from not responding to button presses. this seems odd because swcha has nothing to do with the fire button. without investigating I can only guess that the code is branching on what looks like an impossible joystick position and thereby preventing checking the fire button
1 parent 0ad6900 commit 31eb0d8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hardware/console.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (con *Console) Insert(c external.CartridgeInsertor) error {
140140
}
141141
if _, ok := con.players[1].(*peripherals.Stick); !ok {
142142
con.players[1].Unplug()
143-
con.players[1] = peripherals.NewStick(con.RIOT, con.TIA, false, true)
143+
con.players[1] = peripherals.NewStick(con.RIOT, con.TIA, true, true)
144144
con.players[1].Reset()
145145
}
146146
case "paddle":
@@ -173,7 +173,7 @@ func (con *Console) Insert(c external.CartridgeInsertor) error {
173173
}
174174
if _, ok := con.players[1].(*peripherals.Stick); !ok {
175175
con.players[1].Unplug()
176-
con.players[1] = peripherals.NewStick(con.RIOT, con.TIA, false, true)
176+
con.players[1] = peripherals.NewStick(con.RIOT, con.TIA, true, false)
177177
con.players[1].Reset()
178178
}
179179
case "snes2atari":
@@ -184,7 +184,7 @@ func (con *Console) Insert(c external.CartridgeInsertor) error {
184184
}
185185
if _, ok := con.players[1].(*peripherals.Stick); !ok {
186186
con.players[1].Unplug()
187-
con.players[1] = peripherals.NewStick(con.RIOT, con.TIA, false, true)
187+
con.players[1] = peripherals.NewStick(con.RIOT, con.TIA, true, true)
188188
con.players[1].Reset()
189189
}
190190
}

hardware/riot/riot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ func (riot *RIOT) Reset() {
7878
riot.swcha_w = 0x00
7979
riot.swcha_mux = 0xff
8080
riot.swacnt = 0x00
81-
riot.swcha_p = 0x00
81+
riot.swcha_p = 0xff
8282

8383
// amateur pro switch selected by default (pro would be 0xff)
8484
riot.swchb_w = 0x00
8585
riot.swchb_mux = 0x3f
8686
riot.swbcnt = 0x00
87-
riot.swchb_p = 0x00
87+
riot.swchb_p = 0xff
8888

8989
riot.timint = timintPA7
9090
riot.lastReadReg = 0

0 commit comments

Comments
 (0)