Skip to content

Commit

Permalink
Work on paddles
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jun 2, 2024
1 parent 19ef011 commit 26935b6
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 24 deletions.
10 changes: 5 additions & 5 deletions Emulator/Peripherals/Paddle/Paddle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Paddle::setPosXY(isize nr, double x, double y)
switch (config.orientation) {

case PADDLE_HORIZONTAL: pos[nr] = x; break;
case PADDLE_HORIZONTAL_FLIPPED: pos[nr] = -x; break;
case PADDLE_HORIZONTAL_FLIPPED: pos[nr] = x; break;
case PADDLE_VERTICAL: pos[nr] = y; break;
case PADDLE_VERTICAL_FLIPPED: pos[nr] = -y; break;
case PADDLE_VERTICAL_FLIPPED: pos[nr] = y; break;

default:
fatalError;
Expand All @@ -55,10 +55,10 @@ Paddle::setPosDxDy(isize nr, double x, double y)

switch (config.orientation) {

case PADDLE_HORIZONTAL: pos[nr] += x; break;
case PADDLE_HORIZONTAL_FLIPPED: pos[nr] += -x; break;
case PADDLE_HORIZONTAL: pos[nr] -= x; break;
case PADDLE_HORIZONTAL_FLIPPED: pos[nr] += x; break;
case PADDLE_VERTICAL: pos[nr] += y; break;
case PADDLE_VERTICAL_FLIPPED: pos[nr] += -y; break;
case PADDLE_VERTICAL_FLIPPED: pos[nr] -= y; break;

default:
fatalError;
Expand Down
34 changes: 17 additions & 17 deletions GUI/Panels/Inspector/CIAPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ extension Inspector {

if full {

ciaPA7.title = (cia1 ? "C0,JB0" : "VA14")
ciaPA6.title = (cia1 ? "C1,JB1" : "VA15")
ciaPA5.title = (cia1 ? "C2,JB2" : "User M")
ciaPA4.title = (cia1 ? "C3,JB4" : "ATN")
ciaPA3.title = (cia1 ? "C4,BTNB" : "CLK")
ciaPA2.title = (cia1 ? "C5" : "DATA")
ciaPA1.title = (cia1 ? "C6" : "CLK")
ciaPA0.title = (cia1 ? "C7" : "DATA")

ciaPB7.title = (cia1 ? "R0, JOYA0" : "User C")
ciaPB6.title = (cia1 ? "R1, JOYA1" : "User D")
ciaPB5.title = (cia1 ? "R2, JOYA2" : "User E")
ciaPB4.title = (cia1 ? "R3, JOYA3" : "User F")
ciaPB3.title = (cia1 ? "R4, BTNA" : "User H")
ciaPB2.title = (cia1 ? "R5" : "User J")
ciaPB1.title = (cia1 ? "R6" : "User K")
ciaPB0.title = (cia1 ? "R7" : "User L")
ciaPA0.title = (cia1 ? "C0,JB0" : "VA14")
ciaPA1.title = (cia1 ? "C1,JB1" : "VA15")
ciaPA2.title = (cia1 ? "C2,JB2" : "User M")
ciaPA3.title = (cia1 ? "C3,JB4" : "ATN")
ciaPA4.title = (cia1 ? "C4,BTNB" : "CLK")
ciaPA5.title = (cia1 ? "C5" : "DATA")
ciaPA6.title = (cia1 ? "C6" : "CLK")
ciaPA7.title = (cia1 ? "C7" : "DATA")

ciaPB0.title = (cia1 ? "R0, JOYA0" : "User C")
ciaPB1.title = (cia1 ? "R1, JOYA1" : "User D")
ciaPB2.title = (cia1 ? "R2, JOYA2" : "User E")
ciaPB3.title = (cia1 ? "R3, JOYA3" : "User F")
ciaPB4.title = (cia1 ? "R4, BTNA" : "User H")
ciaPB5.title = (cia1 ? "R5" : "User J")
ciaPB6.title = (cia1 ? "R6" : "User K")
ciaPB7.title = (cia1 ? "R7" : "User L")

ciaPRAbinary.assignFormatter(fmt8b)
ciaDDRAbinary.assignFormatter(fmt8b)
Expand Down
1 change: 1 addition & 0 deletions GUI/Peripherals/GamePad.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class GamePad {
// References to other objects
var manager: GamePadManager
var prefs: Preferences { return manager.parent.pref }
var config: Configuration { return manager.parent.config }
var db: DeviceDatabase { return myAppDelegate.database }

// The control port this device is connected to (0, 1, or nil)
Expand Down
12 changes: 11 additions & 1 deletion GUI/Peripherals/GamePadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,17 @@ class GamePadManager {
}

func icon(slot: Int) -> NSImage {
return gamePads[slot]?.icon ?? NSImage(named: "devGamepad1Template")!

if let gamePad = gamePads[slot] {

if gamePad.isMouse && parent.config.mouseModel >= 3 {
return NSImage(named: "devPaddleTemplate")!
} else {
return gamePad.icon!
}
}

return NSImage(named: "devGamepad1Template")!
}

//
Expand Down
2 changes: 1 addition & 1 deletion GUI/XIB files/Inspector.xib
Original file line number Diff line number Diff line change
Expand Up @@ -2267,7 +2267,7 @@
<nil key="backgroundColor"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="J5z-hy-zmV">
<rect key="frame" x="1" y="165" width="628" height="15"/>
<rect key="frame" x="1" y="163" width="638" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="Mv8-Mj-2md">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "templateImages.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

0 comments on commit 26935b6

Please sign in to comment.