Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
01082 DIP/Input Trivial Have not tried Feb 9, 2008, 12:39 Feb 9, 2008, 12:39
Tester TriggerFin View Status Public Platform
Assigned To Resolution Open OS
Status [?] Confirmed Driver
Version 0.36b16 Fixed in Version Build
Fixed in Git Commit Github Pull Request #
Summary 01082: baluba: [possible] Cabinet DIP setting and players input.
Description With cabinet dipswitch set to "Upright", both players use Player1 controls. With dip set to "Cocktail", both players use Player2 controls.

Updated by stephh in 0.107u3: When it's possible to remove (or at least update) inputs or Dip Switches bugs which are in MAME for ages, it's sometimes better having a look at a DASM file to try to spot what's wrong ...

Details:
From the Z80 game code :


[u]Part 1[/u] (before the game begins)

[code]
BEGIN:
3009: CD A9 03      call A9
300C: CD C4 32      call C4
300F: CD C0 35      call C0
3012: CD C2 34      call C2
3015: 21 00 80      ld   hl,00
3018: CB 46         bit  0,(hl)
301A: 28 ED         jr   z,09
301C: AF            xor  a
301D: 32 3D 80      ld   (3D),a
3020: CB 66         bit  4,(hl)
3022: 20 1C         jr   nz,40
3024: CB E6         set  4,(hl)
3026: AF            xor  a
3027: 32 3E 80      ld   (3E),a
302A: 21 02 80      ld   hl,02
302D: CB E6         set  4,(hl)
302F: CD A9 03      call A9
3032: 21 02 80      ld   hl,02
3035: CB EE         set  5,(hl)
3037: CD A9 03      call A9
303A: CD 83 34      call 83
303D: CD A9 03      call A9
3040: CD E8 30      call E8
3043: 3A 1C 80      ld   a,(1C)    check IN2
3046: E6 0C         and  
From the Z80 game code :


[u]Part 1[/u] (before the game begins)

[code]
BEGIN:
3009: CD A9 03 call $03A9
300C: CD C4 32 call $32C4
300F: CD C0 35 call $35C0
3012: CD C2 34 call $34C2
3015: 21 00 80 ld hl,$8000
3018: CB 46 bit 0,(hl)
301A: 28 ED jr z,$3009
301C: AF xor a
301D: 32 3D 80 ld ($803D),a
3020: CB 66 bit 4,(hl)
3022: 20 1C jr nz,$3040
3024: CB E6 set 4,(hl)
3026: AF xor a
3027: 32 3E 80 ld ($803E),a
302A: 21 02 80 ld hl,$8002
302D: CB E6 set 4,(hl)
302F: CD A9 03 call $03A9
3032: 21 02 80 ld hl,$8002
3035: CB EE set 5,(hl)
3037: CD A9 03 call $03A9
303A: CD 83 34 call $3483
303D: CD A9 03 call $03A9
3040: CD E8 30 call $30E8
3043: 3A 1C 80 ld a,($801C) check IN2
3046: E6 0C and $0C isolate START buttons
3048: 28 BF jr z,$3009 go to BEGIN if none are pressed
304A: 21 00 80 ld hl,$8000
304D: CB 5F bit 3,a check which start button is pressed
304F: 28 0B jr z,$305C if START1 is pressed go to CONTINUE
3051: 4F ld c,a
3052: 3A 18 80 ld a,($8018) check number of credits
3055: FE 02 cp $02 are there 2 credits ?
3057: 79 ld a,c
3058: 38 AF jr c,$3009 go to BEGIN if less than 2 credits
305A: CB CE set 1,(hl) set bit 1 of 0x8000 to tell it's a 2 players game
CONTINUE:
305C: CB FE set 7,(hl)
[/code]

[u]Part 2[/u] (when you are playing)

[code]
BEGIN:
0137: 3A 00 D0 ld a,($D000) read player 1 inputs
013A: 21 00 80 ld hl,$8000
013D: CB 4E bit 1,(hl) check number of players
013F: 28 0B jr z,$014C go to CONTINUE if it's a 1 player game
0141: 21 04 D0 ld hl,$D004
0144: 4E ld c,(hl) load DSW0
0145: CB 71 bit 6,c check "Cabinet" Dip Switch
0147: 20 03 jr nz,$014C go to CONTINUE if "Upright"
0149: 3A 01 D0 ld a,($D001) read player 2 inputs
CONTINUE:
014C: 32 20 80 ld ($8020),a
[/code]

So, this is not a bug according to the current memory mapping, but I think, if it fits the schematics I don't understand, that you could have, for this game ONLY, specific read/write handlers at 0xd000 and 0xd001 to handle which joystick to select according to the state of the screen (flipped or not) ... There is something similar in machine/arkanoid.c and vidhrdw/arkanoid.c to handle which paddle to select ...

I now hope that a Dev will have a look at the driver and the schematics to fix this bug or to tell it can be removed ...
C isolate START buttons 3048: 28 BF jr z,09 go to BEGIN if none are pressed 304A: 21 00 80 ld hl,00 304D: CB 5F bit 3,a check which start button is pressed 304F: 28 0B jr z,5C if START1 is pressed go to CONTINUE 3051: 4F ld c,a 3052: 3A 18 80 ld a,(18) check number of credits 3055: FE 02 cp are there 2 credits ? 3057: 79 ld a,c 3058: 38 AF jr c,09 go to BEGIN if less than 2 credits 305A: CB CE set 1,(hl) set bit 1 of 0x8000 to tell it's a 2 players game CONTINUE: 305C: CB FE set 7,(hl) [/code] [u]Part 2[/u] (when you are playing) [code] BEGIN: 0137: 3A 00 D0 ld a,($D000) read player 1 inputs 013A: 21 00 80 ld hl,00 013D: CB 4E bit 1,(hl) check number of players 013F: 28 0B jr z,4C go to CONTINUE if it's a 1 player game 0141: 21 04 D0 ld hl,$D004 0144: 4E ld c,(hl) load DSW0 0145: CB 71 bit 6,c check "Cabinet" Dip Switch 0147: 20 03 jr nz,4C go to CONTINUE if "Upright" 0149: 3A 01 D0 ld a,($D001) read player 2 inputs CONTINUE: 014C: 32 20 80 ld (20),a [/code] So, this is not a bug according to the current memory mapping, but I think, if it fits the schematics I don't understand, that you could have, for this game ONLY, specific read/write handlers at 0xd000 and 0xd001 to handle which joystick to select according to the state of the screen (flipped or not) ... There is something similar in machine/arkanoid.c and vidhrdw/arkanoid.c to handle which paddle to select ... I now hope that a Dev will have a look at the driver and the schematics to fix this bug or to tell it can be removed ...
Steps To Reproduce
Additional Information
Github Commit
Flags Possible
Regression Version
Affected Sets / Systems baluba
Attached Files
 
Relationships
related to 01706Confirmed  starforc, megaforc, starforcb, starforce: star force 2nd player problem 
Notes
0
There are no notes attached to this issue.