From 611de6ba170d78423e05bbb5a1a36246079305d8 Mon Sep 17 00:00:00 2001 From: David Proskin Date: Fri, 25 Oct 2024 10:33:53 -0400 Subject: [PATCH] Add support for virtual controller for Intellivision in Bliss --- .../PVCoreLoader/Resources/systems.plist | 116 +++++++++++- .../Sources/PVLibrary/Resources/systems.plist | 172 ++++++++++++++---- ...ntellivisionControllerViewController.swift | 41 ++++- 3 files changed, 285 insertions(+), 44 deletions(-) diff --git a/PVCoreLoader/Sources/PVCoreLoader/Resources/systems.plist b/PVCoreLoader/Sources/PVCoreLoader/Resources/systems.plist index 8ff38e612e..d2bfafab87 100644 --- a/PVCoreLoader/Sources/PVCoreLoader/Resources/systems.plist +++ b/PVCoreLoader/Sources/PVCoreLoader/Resources/systems.plist @@ -6503,7 +6503,7 @@ PVControlType PVButtonGroup PVControlSize - {320,180} + {320,350} PVGroupedButtons @@ -6512,7 +6512,7 @@ PVControlTitle L PVControlFrame - {{8,24},{60,60}} + {{8,16},{60,60}} PVControlTint #f96763 @@ -6522,10 +6522,120 @@ PVControlTitle R PVControlFrame - {{96,16},{60,60}} + {{70,16},{60,60}} PVControlTint #f96763 + + PVControlType + PVButton + PVControlTitle + T + PVControlFrame + {{156,16},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 1 + PVControlFrame + {{8,80},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 2 + PVControlFrame + {{70,80},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 3 + PVControlFrame + {{156,80},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 4 + PVControlFrame + {{8,150},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 5 + PVControlFrame + {{70,150},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 6 + PVControlFrame + {{156,150},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 7 + PVControlFrame + {{8,220},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 8 + PVControlFrame + {{70,220},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 9 + PVControlFrame + {{156,220},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 0 + PVControlFrame + {{70,290},{60,60}} + PVControlTint + #f96763 + diff --git a/PVLibrary/Sources/PVLibrary/Resources/systems.plist b/PVLibrary/Sources/PVLibrary/Resources/systems.plist index cbbc72dc11..11f6504c56 100644 --- a/PVLibrary/Sources/PVLibrary/Resources/systems.plist +++ b/PVLibrary/Sources/PVLibrary/Resources/systems.plist @@ -6499,40 +6499,150 @@ PVControlLayout - - PVControlType - PVButtonGroup - PVControlSize - {180,180} - PVGroupedButtons - - - PVControlType - PVButton - PVControlTitle - L - PVControlFrame - {{8,24},{60,60}} - PVControlTint - #f96763 - - - PVControlType - PVButton - PVControlTitle - R - PVControlFrame - {{76,16},{60,60}} - PVControlTint - #f96763 - - - + + PVControlType + PVButtonGroup + PVControlSize + {320,350} + PVGroupedButtons + + + PVControlType + PVButton + PVControlTitle + L + PVControlFrame + {{8,16},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + R + PVControlFrame + {{70,16},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + T + PVControlFrame + {{156,16},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 1 + PVControlFrame + {{8,80},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 2 + PVControlFrame + {{70,80},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 3 + PVControlFrame + {{156,80},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 4 + PVControlFrame + {{8,150},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 5 + PVControlFrame + {{70,150},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 6 + PVControlFrame + {{156,150},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 7 + PVControlFrame + {{8,220},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 8 + PVControlFrame + {{70,220},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 9 + PVControlFrame + {{156,220},{60,60}} + PVControlTint + #f96763 + + + PVControlType + PVButton + PVControlTitle + 0 + PVControlFrame + {{70,290},{60,60}} + PVControlTint + #f96763 + + + PVControlType PVStartButton PVControlTitle - Pause + Enter PVControlSize {62,22} @@ -6540,7 +6650,7 @@ PVControlType PVSelectButton PVControlTitle - Option + Clear PVControlSize {62,22} diff --git a/PVUI/Sources/PVUIBase/Controller/Systems/PVIntellivisionControllerViewController.swift b/PVUI/Sources/PVUIBase/Controller/Systems/PVIntellivisionControllerViewController.swift index f24fa716a6..64b3856f30 100644 --- a/PVUI/Sources/PVUIBase/Controller/Systems/PVIntellivisionControllerViewController.swift +++ b/PVUI/Sources/PVUIBase/Controller/Systems/PVIntellivisionControllerViewController.swift @@ -26,17 +26,38 @@ final class PVIntellivisionControllerViewController: PVControllerViewController< guard let button = $0 as? JSButton, let title = button.titleLabel?.text else { return } -// if title == "Fire" || title == "" { -// button.buttonTag = .fire1 -// } else if title == "Select" { -// button.buttonTag = .select -// } else if title == "Reset" { -// button.buttonTag = .reset -// } + + if button.titleLabel?.text == "L" { + button.buttonTag = .bottomLeftAction + } else if (button.titleLabel?.text == "R") { + button.buttonTag = .bottomRightAction + } else if (button.titleLabel?.text == "T") { + button.buttonTag = .topAction + } else if button.titleLabel?.text == "1" { + button.buttonTag = .button1 + } else if (button.titleLabel?.text == "2") { + button.buttonTag = .button2 + } else if (button.titleLabel?.text == "3") { + button.buttonTag = .button3 + } else if button.titleLabel?.text == "4" { + button.buttonTag = .button4 + } else if (button.titleLabel?.text == "5") { + button.buttonTag = .button5 + } else if (button.titleLabel?.text == "6") { + button.buttonTag = .button6 + } else if button.titleLabel?.text == "7" { + button.buttonTag = .button7 + } else if (button.titleLabel?.text == "8") { + button.buttonTag = .button8 + } else if (button.titleLabel?.text == "9") { + button.buttonTag = .button9 + } else if (button.titleLabel?.text == "0") { + button.buttonTag = .button9 + } } -// -// startButton?.buttonTag = .reset -// selectButton?.buttonTag = .select + + selectButton?.buttonTag = .clear + startButton?.buttonTag = .enter } override func dPad(_: JSDPad, didPress direction: JSDPadDirection) {