From 7ee821461501a1b8c2f5e6272f59df80a9168641 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Mon, 5 May 2025 19:08:45 -0700 Subject: [PATCH 01/22] update firmwares to send info to controlling computer --- .../Firmware-8Valve.ino} | 16 ++- ...nkConnection2-Firmware-Servo-GuestStar.ino | 104 ------------------ .../Firmware-Servo-ChuckEHelenGuestStar.ino | 61 ++++++++++ .../Firmware-Servo-HelenMitzi.ino} | 14 ++- .../{ => Servo}/ServoWorker/ServoWorker.ino | 0 Future Goals.md | 2 +- 6 files changed, 84 insertions(+), 113 deletions(-) rename Arduino Firmware/{PinkConnection2-Firmware-8Valve/PinkConnection2-Firmware-8Valve.ino => Firmware-8Valve/Firmware-8Valve.ino} (81%) delete mode 100644 Arduino Firmware/PinkConnection2-Firmware-Servo-GuestStar/PinkConnection2-Firmware-Servo-GuestStar.ino create mode 100644 Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino rename Arduino Firmware/{PinkConnection2-Firmware-Servo-HelenMitzi/PinkConnection2-Firmware-Servo-HelenMitzi.ino => Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino} (95%) rename Arduino Firmware/{ => Servo}/ServoWorker/ServoWorker.ino (100%) diff --git a/Arduino Firmware/PinkConnection2-Firmware-8Valve/PinkConnection2-Firmware-8Valve.ino b/Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino similarity index 81% rename from Arduino Firmware/PinkConnection2-Firmware-8Valve/PinkConnection2-Firmware-8Valve.ino rename to Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino index 2de1ab0..e86b46c 100644 --- a/Arduino Firmware/PinkConnection2-Firmware-8Valve/PinkConnection2-Firmware-8Valve.ino +++ b/Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino @@ -1,9 +1,10 @@ -// PINKCONNECTION2 Client Program for Valve Systems +// PINKCONNECTION2 Client Program for 8 Valve Systems int byte1 = 0; int byte2 = 0; -void setup() { +void setup() +{ pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); @@ -13,13 +14,18 @@ void setup() { pinMode(8, OUTPUT); pinMode(9, OUTPUT); Serial.begin(9600); + Serial.write("PC2,8,Universal"); } -void loop() { - if (Serial.available() > 1) { +void loop() +{ + if (Serial.available() > 1) + { byte1 = Serial.read(); byte2 = Serial.read(); - if ((byte1 & 64) && (byte2 & 64)) { + + if ((byte1 & 64) && (byte2 & 64)) + { if (byte1 & 1) digitalWrite(2, 1); else digitalWrite(2, 0); diff --git a/Arduino Firmware/PinkConnection2-Firmware-Servo-GuestStar/PinkConnection2-Firmware-Servo-GuestStar.ino b/Arduino Firmware/PinkConnection2-Firmware-Servo-GuestStar/PinkConnection2-Firmware-Servo-GuestStar.ino deleted file mode 100644 index c24303c..0000000 --- a/Arduino Firmware/PinkConnection2-Firmware-Servo-GuestStar/PinkConnection2-Firmware-Servo-GuestStar.ino +++ /dev/null @@ -1,104 +0,0 @@ -// PINKCONNECTION2 Client Program for Helen Henny/Chuck E./Guest Star Cyberamic Servo - -#include -#include - -Servo servoChannel[8]; -byte onDegrees[8] = { 90, 0, 0, 0, 45, 135, 0, 0 }; // these are incomplete, i need to tune them when i get the servos in -byte offDegrees[8] = { 0, 0, 0, 0, 90, 90, 0, 0 }; - -int byte1 = 0; -int byte2 = 0; - -void setup() { - servoChannel[0].attach(2); - servoChannel[1].attach(3); - servoChannel[2].attach(4); - servoChannel[3].attach(5); - servoChannel[4].attach(6); - servoChannel[5].attach(7); - servoChannel[6].attach(8); - servoChannel[7].attach(9); - pinMode(A0, OUTPUT); - pinMode(A1, OUTPUT); - pinMode(A2, OUTPUT); - pinMode(A3, OUTPUT); - pinMode(A4, OUTPUT); - pinMode(A5, OUTPUT); - pinMode(10, OUTPUT); - pinMode(11, OUTPUT); - for (int i = 0; i < 8; i++) servoChannel[i].write(offDegrees[i]); - Serial.begin(9600); -} - -void loop() { - if (Serial.available() > 1) { - byte1 = Serial.read(); - byte2 = Serial.read(); - if ((byte1 & 64) && (byte2 & 64)) - if (byte1 & 1) { - servoChannel[0].write(onDegrees[0]); - digitalWrite(A0, 1); - } else { - servoChannel[0].write(offDegrees[0]); - digitalWrite(A0, 0); - } - - if (byte1 & 2) { - servoChannel[1].write(onDegrees[1]); - digitalWrite(A1, 1); - } else { - servoChannel[1].write(offDegrees[1]); - digitalWrite(A1, 0); - } - - if (byte1 & 4) { - servoChannel[2].write(onDegrees[2]); - digitalWrite(A2, 1); - } else { - servoChannel[2].write(offDegrees[2]); - digitalWrite(A2, 0); - } - - if (byte1 & 8) { - servoChannel[2].write(onDegrees[3]); - digitalWrite(A3, 1); - } else { - //servoChannel[2].write(offDegrees[3]); dont - digitalWrite(A3, 0); - } - - if (byte2 & 1) { - servoChannel[4].write(onDegrees[4]); - digitalWrite(A4, 1); - } else { - servoChannel[4].write(offDegrees[4]); - digitalWrite(A4, 0); - } - - if (byte2 & 2) { - servoChannel[4].write(onDegrees[5]); - digitalWrite(A5, 1); - } else { - //servoChannel[4].write(offDegrees[5]); dont - digitalWrite(A5, 0); - } - - if (byte2 & 4) { - servoChannel[6].write(onDegrees[6]); - digitalWrite(10, 1); - } else { - servoChannel[6].write(offDegrees[6]); - digitalWrite(10, 0); - } - - if (byte2 & 8) { - servoChannel[7].write(onDegrees[7]); - digitalWrite(11, 1); - } else { - servoChannel[7].write(offDegrees[7]); - digitalWrite(11, 0); - } - - } -} diff --git a/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino b/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino new file mode 100644 index 0000000..deffabd --- /dev/null +++ b/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino @@ -0,0 +1,61 @@ +// PINKCONNECTION2 Client Program for Helen Henny/Chuck E./Guest Star Cyberamic Servo + +#include + +Servo servoChannel[6]; +byte onDegrees[8] = { 90, 0, 0, 0, 45, 135, 0, 0 }; // these are incomplete +byte offDegrees[8] = { 0 , 0, 0, 0, 90, 90 , 0, 0 }; +byte mapping[8] = { 0 , 1, 1, 2, 3 , 3 , 4, 5 }; + +int byte1 = 0; +int byte2 = 0; + +void setup() +{ + servoChannel[0].attach(2); + servoChannel[1].attach(3); + servoChannel[2].attach(4); + servoChannel[3].attach(5); + servoChannel[4].attach(6); + servoChannel[5].attach(7); + for (int i = 0; i < 8; i++) servoChannel[mapping[i]].write(offDegrees[i]); + Serial.begin(9600); + Serial.write("PC2,8,Helen/Guest Star"); +} + +void loop() +{ + if (Serial.available() > 1) + { + byte1 = Serial.read(); + byte2 = Serial.read(); + + if ((byte1 & 64) && (byte2 & 64)) + { + if (byte1 & 1) servoChannel[mapping[0]].write(onDegrees[0]); + else servoChannel[mapping[0]].write(offDegrees[0]); + + if (byte1 & 2) servoChannel[mapping[1]].write(onDegrees[1]); + else servoChannel[mapping[1]].write(offDegrees[1]); + + if (byte1 & 4) servoChannel[mapping[2]].write(onDegrees[2]); + else servoChannel[mapping[2]].write(offDegrees[2]); + + if (byte1 & 8) servoChannel[mapping[3]].write(onDegrees[3]); + else servoChannel[mapping[3]].write(offDegrees[3]); + + + if (byte2 & 1) servoChannel[mapping[4]].write(onDegrees[4]); + else servoChannel[mapping[4]].write(offDegrees[4]); + + if (byte2 & 2) servoChannel[mapping[5]].write(onDegrees[5]); + else servoChannel[mapping[5]].write(offDegrees[5]); + + if (byte2 & 4) servoChannel[mapping[6]].write(onDegrees[6]); + else servoChannel[mapping[6]].write(offDegrees[6]); + + if (byte2 & 8) servoChannel[mapping[7]].write(onDegrees[7]); + else servoChannel[mapping[7]].write(offDegrees[7]); + } + } +} diff --git a/Arduino Firmware/PinkConnection2-Firmware-Servo-HelenMitzi/PinkConnection2-Firmware-Servo-HelenMitzi.ino b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino similarity index 95% rename from Arduino Firmware/PinkConnection2-Firmware-Servo-HelenMitzi/PinkConnection2-Firmware-Servo-HelenMitzi.ino rename to Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino index aa12af9..a7269e6 100644 --- a/Arduino Firmware/PinkConnection2-Firmware-Servo-HelenMitzi/PinkConnection2-Firmware-Servo-HelenMitzi.ino +++ b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino @@ -1,7 +1,6 @@ // PINKCONNECTION2 Client Program for Helen Henny/Mitzi Mozzarella Servo #include -#include Servo servoChannel[11]; // mouth earL earR eyelidL eyelidR eyeL eyeR headR headL headUp armUpL armUpR elbowR elbowL armTwistL armTwistR bodyTwistR bodyTwistL bodyLean byte onDegrees[19] = { 45, 0, 0, 0, 0, 0, 0, 45, 135, 135, 90, 90, 90, 90, 90, 90, 0, 0, 0 }; @@ -13,8 +12,12 @@ int byte2 = 0; int byte3 = 0; int byte4 = 0; int byte5 = 0; +int byte6 = 0; +int byte7 = 0; +int byte8 = 0; -void setup() { +void setup() +{ servoChannel[0].attach(2); servoChannel[1].attach(3); servoChannel[2].attach(4); @@ -26,15 +29,20 @@ void setup() { servoChannel[8].attach(10); for (int i = 0; i < 19; i++) servoChannel[mapping[i]].write(offDegrees[i]); Serial.begin(9600); + Serial.write("PC2,32,Mitzi/Helen"); } void loop() { - if (Serial.available() > 4) { + if (Serial.available() > 7) + { byte1 = Serial.read(); byte2 = Serial.read(); byte3 = Serial.read(); byte4 = Serial.read(); byte5 = Serial.read(); + byte6 = Serial.read(); + byte7 = Serial.read(); + byte8 = Serial.read(); if ((byte1 & 64) && (byte2 & 64) && (byte3 & 64) && (byte4 & 64) && (byte5 & 64)) { diff --git a/Arduino Firmware/ServoWorker/ServoWorker.ino b/Arduino Firmware/Servo/ServoWorker/ServoWorker.ino similarity index 100% rename from Arduino Firmware/ServoWorker/ServoWorker.ino rename to Arduino Firmware/Servo/ServoWorker/ServoWorker.ino diff --git a/Future Goals.md b/Future Goals.md index 55e623f..fe0777e 100644 --- a/Future Goals.md +++ b/Future Goals.md @@ -14,4 +14,4 @@ ## Firmwares - - Send controlling computer information about the number of outputs and which character it is set up for + - ~~Send controlling computer information about the number of outputs and which character it is set up for~~ Done! From 271be04b987199d25a0ec6a9172a311a858f8546 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Mon, 5 May 2025 19:36:58 -0700 Subject: [PATCH 02/22] Update Firmware-Servo-ChuckEHelenGuestStar.ino --- .../Firmware-Servo-ChuckEHelenGuestStar.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino b/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino index deffabd..f56fd0f 100644 --- a/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino +++ b/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino @@ -20,7 +20,7 @@ void setup() servoChannel[5].attach(7); for (int i = 0; i < 8; i++) servoChannel[mapping[i]].write(offDegrees[i]); Serial.begin(9600); - Serial.write("PC2,8,Helen/Guest Star"); + Serial.write("PC2,8,Chuck E./Helen/Guest Star"); } void loop() From 8ef01ea1aa62cd6f819fb39a00639fd526fc14cd Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Mon, 5 May 2025 19:38:13 -0700 Subject: [PATCH 03/22] Update ServoWorker.ino --- Arduino Firmware/Servo/ServoWorker/ServoWorker.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Arduino Firmware/Servo/ServoWorker/ServoWorker.ino b/Arduino Firmware/Servo/ServoWorker/ServoWorker.ino index d74c247..d30ba35 100644 --- a/Arduino Firmware/Servo/ServoWorker/ServoWorker.ino +++ b/Arduino Firmware/Servo/ServoWorker/ServoWorker.ino @@ -1,4 +1,4 @@ -// tp1sm +// Ensure that a servo works, and get it to its 0 position #include @@ -14,5 +14,5 @@ void loop() servoChannel.write(0); delay(1000); servoChannel.write(180); - delay(1000); + delay(2000); } From 1fb697626ed17dc2d1975a7ed421598178b8e7a8 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 10 May 2025 14:02:28 -0700 Subject: [PATCH 04/22] player kinda works --- .../Firmware-8Valve/Firmware-8Valve.ino | 2 +- .../Firmware-Servo-ChuckEHelenGuestStar.ino | 2 +- .../Firmware-Servo-HelenMitzi.ino | 8 +- PC2Player/PC2Player/MainForm.cs | 327 ++++++++++++++++-- PC2Player/PC2Player/PC2Player.csproj | 3 +- 5 files changed, 298 insertions(+), 44 deletions(-) diff --git a/Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino b/Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino index e86b46c..9c4fd69 100644 --- a/Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino +++ b/Arduino Firmware/Firmware-8Valve/Firmware-8Valve.ino @@ -14,7 +14,7 @@ void setup() pinMode(8, OUTPUT); pinMode(9, OUTPUT); Serial.begin(9600); - Serial.write("PC2,8,Universal"); + Serial.write("PC2,8,Universal,END"); } void loop() diff --git a/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino b/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino index f56fd0f..17c095e 100644 --- a/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino +++ b/Arduino Firmware/Servo/Firmware-Servo-ChuckEHelenGuestStar/Firmware-Servo-ChuckEHelenGuestStar.ino @@ -20,7 +20,7 @@ void setup() servoChannel[5].attach(7); for (int i = 0; i < 8; i++) servoChannel[mapping[i]].write(offDegrees[i]); Serial.begin(9600); - Serial.write("PC2,8,Chuck E./Helen/Guest Star"); + Serial.write("PC2,8,Chuck E./Helen/Guest Star,END"); } void loop() diff --git a/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino index a7269e6..6dfb626 100644 --- a/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino +++ b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino @@ -2,10 +2,10 @@ #include -Servo servoChannel[11]; // mouth earL earR eyelidL eyelidR eyeL eyeR headR headL headUp armUpL armUpR elbowR elbowL armTwistL armTwistR bodyTwistR bodyTwistL bodyLean -byte onDegrees[19] = { 45, 0, 0, 0, 0, 0, 0, 45, 135, 135, 90, 90, 90, 90, 90, 90, 0, 0, 0 }; +Servo servoChannel[11]; // mouth earL earR eyelidL eyelidR eyeL eyeR headL headR headUp armUpL armUpR elbowR elbowL armTwistL armTwistR bodyTwistR bodyTwistL bodyLean +byte onDegrees[19] = { 45, 0, 0, 0, 0, 0, 0, 135, 45, 135, 90, 90, 90, 90, 90, 90, 0, 0, 0 }; byte offDegrees[19] = { 0, 0, 0, 0, 0, 0, 0, 90, 90, 90, 180, 0, 0, 180, 180, 0 , 0, 0, 0 }; -byte mapping[19] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 6, 3, 4, 7, 8, 5, 0, 0, 0 }; +byte mapping[19] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 6, 3, 4, 7, 8, 5, 9, 9, 10 }; int byte1 = 0; int byte2 = 0; @@ -29,7 +29,7 @@ void setup() servoChannel[8].attach(10); for (int i = 0; i < 19; i++) servoChannel[mapping[i]].write(offDegrees[i]); Serial.begin(9600); - Serial.write("PC2,32,Mitzi/Helen"); + Serial.write("PC2,32,Mitzi/Helen,END"); } void loop() { diff --git a/PC2Player/PC2Player/MainForm.cs b/PC2Player/PC2Player/MainForm.cs index f3bc1a3..1a03aaf 100644 --- a/PC2Player/PC2Player/MainForm.cs +++ b/PC2Player/PC2Player/MainForm.cs @@ -1,4 +1,11 @@ using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.IO.Ports; +using System.Timers; + using Eto.Forms; using Eto.Drawing; @@ -6,52 +13,298 @@ namespace PC2Player { public partial class MainForm : Form { + SerialPort Port = null; + string[] Signals; + System.Timers.Timer FrameTimer; + long Index = 0; + int FrameSkip = 6; + byte[] AudioData; + + string ShowtapeName = ""; + string ShowtapeStageType = ""; + string ShowtapeCharacter = ""; + string ShowtapeBits = ""; + string ShowtapeFormattedLength = ""; + + string ControllerCharacter = ""; + string ControllerBits = ""; + + string ControllerHeader = ""; + + bool ControllerConnected = false; + bool ShowtapeLoaded = false; + + bool Playing = false; + + DropDown SerialPortDropDown = new DropDown(); + + Label ShowtapeNameLabel = new Label { Text = "Show Name: Not Loaded" }; + Label ShowtapeStageTypeLabel = new Label { Text = "Stage Type: Not Loaded" }; + Label ShowtapeCharacterLabel = new Label { Text = "Character: Not Loaded" }; + Label ShowtapeBitsLabel = new Label { Text = "Bits: Not Loaded" }; + Label ShowtapeLengthLabel = new Label { Text = "Length: Not Loaded" }; + + Label ControllerCharacterLabel = new Label { Text = "Character: Disconnected" }; + Label ControllerBitsLabel = new Label { Text = "Bits: Disconnected" }; + + Button RefreshPortsButton = new Button { Text = "Refresh Ports", Width = 150 }; + Button LoadShowtapeButton = new Button { Text = "Load Showtape", Width = 150 }; + + Button PlayButton = new Button { Text = "Play" }; + Button StopButton = new Button { Text = "Stop" }; + public MainForm() { - Title = "My Eto Form"; - MinimumSize = new Size(200, 200); + Title = "PinkConnection2 Showtape Player"; + Size = new Size(500, 450); + Maximizable = false; + Resizable = false; - Content = new StackLayout + foreach (string s in SerialPort.GetPortNames()) { - Padding = 10, - Items = + SerialPortDropDown.Items.Add(s); + } + SerialPortDropDown.SelectedValueChanged += (sender, e) => Event_SelectSerialPort(); + + FrameTimer = new System.Timers.Timer((1000d/60d)*FrameSkip); + FrameTimer.Elapsed += Event_FrameTimerTick; + FrameTimer.AutoReset = true; + + PlayButton.Enabled = false; + StopButton.Enabled = false; + + PlayButton.Command = new Command( (sender, e) => Event_PlayButton() ); + StopButton.Command = new Command( (sender, e) => Event_StopButton() ); + RefreshPortsButton.Command = new Command( (sender, e) => Event_RefreshPortsButton() ); + LoadShowtapeButton.Command = new Command( (sender, e) => Event_LoadShowtapeButton() ); + + Content = BuildLayout(); + } + + DynamicLayout BuildLayout() + { + GroupBox showtapeInfoGroupBox = new GroupBox{ Text = "Showtape" }; + DynamicLayout showtapeInfoGroupLayout = new DynamicLayout { DefaultSpacing = new Size(5, 5), DefaultPadding = new Padding(5, 5, 5, 5) }; + showtapeInfoGroupLayout.AddRow(ShowtapeNameLabel); + showtapeInfoGroupLayout.AddRow(ShowtapeStageTypeLabel); + showtapeInfoGroupLayout.AddRow(ShowtapeCharacterLabel); + showtapeInfoGroupLayout.AddRow(ShowtapeBitsLabel); + showtapeInfoGroupLayout.AddRow(ShowtapeLengthLabel); + showtapeInfoGroupBox.Content = showtapeInfoGroupLayout; + + GroupBox controllerInfoGroupBox = new GroupBox{ Text = "Controller" }; + DynamicLayout controllerInfoGroupLayout = new DynamicLayout { DefaultSpacing = new Size(5, 5), DefaultPadding = new Padding(5, 5, 5, 5) }; + controllerInfoGroupLayout.AddRow(ControllerCharacterLabel); + controllerInfoGroupLayout.AddRow(ControllerBitsLabel); + controllerInfoGroupBox.Content = controllerInfoGroupLayout; + + DynamicLayout layout = new DynamicLayout { DefaultSpacing = new Size(10, 10), DefaultPadding = new Padding(5, 5, 5, 5) }; + + layout.BeginVertical(); + layout.BeginHorizontal(); + layout.Add(PlayButton, true); + layout.Add(StopButton, true); + layout.EndHorizontal(); + layout.EndVertical(); + + layout.BeginVertical(); + + layout.BeginHorizontal(); + layout.Add(new Label { Text = "Serial Port" }); + layout.EndHorizontal(); + + layout.BeginHorizontal(); + layout.Add(SerialPortDropDown, true); + layout.EndHorizontal(); + + layout.BeginHorizontal(); + layout.Add(showtapeInfoGroupBox, true); + layout.EndHorizontal(); + + layout.BeginHorizontal(); + layout.Add(controllerInfoGroupBox, true); + layout.EndHorizontal(); + + layout.EndVertical(); + + layout.BeginVertical(); + layout.BeginHorizontal(); + layout.Add(null, true); + layout.Add(RefreshPortsButton); + layout.Add(LoadShowtapeButton); + layout.EndHorizontal(); + layout.EndVertical(); + + layout.BeginVertical(); + layout.Add(null, true); + layout.EndVertical(); + + return layout; + } + + void CheckReady() + { + if (ControllerConnected && ShowtapeLoaded) + { + PlayButton.Enabled = true; + StopButton.Enabled = true; + } + else + { + PlayButton.Enabled = false; + StopButton.Enabled = false; + } + } + + void Event_SelectSerialPort() + { + if (Port != null) Port.Close(); + Port = new SerialPort((string)SerialPortDropDown.SelectedKey, 9600, Parity.None, 8, StopBits.One); + Port.DataReceived += new SerialDataReceivedEventHandler(Event_PortRecievedData); + ControllerHeader = ""; + ControllerCharacterLabel.Text = "Character: Disconnected"; + ControllerBitsLabel.Text = "Bits: Disconnected"; + ControllerConnected = false; + CheckReady(); + Port.Open(); + } + + void Event_PortRecievedData(object sender, SerialDataReceivedEventArgs e) + { + ControllerHeader += Port.ReadExisting(); + if (ControllerHeader.EndsWith(",END")) + { + ControllerBits = ControllerHeader.Split(',')[1]; + ControllerCharacter = ControllerHeader.Split(',')[2]; + + ControllerCharacterLabel.Text = $"Character: {ControllerCharacter}"; + ControllerBitsLabel.Text = $"Bits: {ControllerBits}"; + ControllerConnected = true; + CheckReady(); + } + } + + void Event_RefreshPortsButton() + { + foreach (string s in SerialPort.GetPortNames()) + { + SerialPortDropDown.Items.Add(s); + } + } + + void Event_LoadShowtapeButton() + { + OpenFileDialog fileDialog = new OpenFileDialog(); + fileDialog.Filters.Add(new FileFilter("UST Files (.ust)", new string[]{ ".ust" })); + fileDialog.Title = "Select Show File."; + fileDialog.ShowDialog(this); + + string tempUSTData = File.ReadAllText(fileDialog.FileName); + if (!tempUSTData.StartsWith("UST,1,")) + { + MessageBox.Show("This is not a UST Version 1 showtape."); + return; + } + + string[] headerData = tempUSTData.Split(';')[0].Split(','); + string[] stringyBits = tempUSTData.Split(';')[1].Split(','); + AudioData = Convert.FromBase64String(tempUSTData.Split(';')[2]); + + ShowtapeName = headerData[2]; + ShowtapeBits = headerData[3]; + ShowtapeStageType = headerData[4]; + ShowtapeCharacter = headerData[5]; + + if (headerData[3] == "256") + { + MessageBox.Show("Can't load a full stage showtape right now!"); + return; + } + + TimeSpan time = TimeSpan.FromSeconds(stringyBits.Length/60); + ShowtapeFormattedLength = time.ToString(@"hh\:mm\:ss"); + + ShowtapeNameLabel.Text = $"Show Name: {ShowtapeName}"; + ShowtapeStageTypeLabel.Text = $"Stage Type: {ShowtapeStageType}"; + ShowtapeCharacterLabel.Text = $"Character: {ShowtapeCharacter}"; + ShowtapeBitsLabel.Text = $"Bits: {ShowtapeBits}"; + ShowtapeLengthLabel.Text = $"Length: {ShowtapeFormattedLength}"; + + List tmpOut = new List(); + foreach (string frame in stringyBits) + { + int b = int.Parse(frame, NumberStyles.HexNumber); + char[] bytesOut = { (char)64 }; + if (ShowtapeBits == "8") { - "Hello World!", - // add more controls here + bytesOut = new char[]{ + (char)(64 | ((b & 8) | (b & 4) | (b & 2) | (b & 1))), + (char)(64 | (((b & 128) | (b & 64) | (b & 32) | (b & 16)) >> 4)) + }; } - }; + else if (ShowtapeBits == "32") + { + bytesOut = new char[]{ + (char)(64 | ((b & 8) | (b & 4) | (b & 2) | (b & 1))), + (char)(64 | (((b & 128) | (b & 64) | (b & 32) | (b & 16)) >> 4)), + (char)(64 | (((b & 2048) | (b & 1024) | (b & 512) | (b & 256)) >> 8)), + (char)(64 | (((b & 32768) | (b & 16384) | (b & 8192) | (b & 4096)) >> 12)), + (char)(64 | (((b & 524288) | (b & 262144) | (b & 131072) | (b & 65536)) >> 16)), + (char)(64 | (((b & 8388608) | (b & 4194304) | (b & 2097152) | (b & 1048576)) >> 20)), + (char)(64 | (((b & 134217728) | (b & 67108864) | (b & 33554432) | (b & 16777216)) >> 24)), + (char)(64 | (((b & 2147483648) | (b & 1073741824) | (b & 536870912) | (b & 268435456)) >> 28)) + }; + } + tmpOut.Add(new string(bytesOut)); + } + Signals = tmpOut.ToArray(); + ShowtapeLoaded = true; + CheckReady(); + } - // create a few commands that can be used for the menu and toolbar - var clickMe = new Command { MenuText = "Click Me!", ToolBarText = "Click Me!" }; - clickMe.Executed += (sender, e) => MessageBox.Show(this, "I was clicked!"); - - var quitCommand = new Command { MenuText = "Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q }; - quitCommand.Executed += (sender, e) => Application.Instance.Quit(); - - var aboutCommand = new Command { MenuText = "About..." }; - aboutCommand.Executed += (sender, e) => new AboutDialog().ShowDialog(this); - - // create menu - Menu = new MenuBar + void Event_PlayButton() + { + if (Playing) return; + if (ShowtapeBits != ControllerBits) { - Items = - { - // File submenu - new SubMenuItem { Text = "&File", Items = { clickMe } }, - // new SubMenuItem { Text = "&Edit", Items = { /* commands/items */ } }, - // new SubMenuItem { Text = "&View", Items = { /* commands/items */ } }, - }, - ApplicationItems = - { - // application (OS X) or file menu (others) - new ButtonMenuItem { Text = "&Preferences..." }, - }, - QuitItem = quitCommand, - AboutItem = aboutCommand - }; + MessageBox.Show("This showtape does not have the correct amount of bits for your controller."); + return; + } + File.WriteAllBytes("tmp.wav", AudioData); + Process.Start("mpv", "tmp.wav"); + FrameTimer.Start(); - // create toolbar - ToolBar = new ToolBar { Items = { clickMe } }; + Playing = true; + + PlayButton.Enabled = false; + RefreshPortsButton.Enabled = false; + LoadShowtapeButton.Enabled = false; + SerialPortDropDown.Enabled = false; + } + + void Event_StopButton() + { + FrameTimer.Stop(); + File.Delete("tmp.wav"); + Playing = false; + + PlayButton.Enabled = true; + RefreshPortsButton.Enabled = true; + LoadShowtapeButton.Enabled = true; + SerialPortDropDown.Enabled = true; + Index = 0; + } + + void Event_FrameTimerTick(Object sender, ElapsedEventArgs e) + { + if (Index >= Signals.Length) + { + Event_StopButton(); + return; + } + + Port.Write(Signals[Index]); + Index += FrameSkip; } } } diff --git a/PC2Player/PC2Player/PC2Player.csproj b/PC2Player/PC2Player/PC2Player.csproj index f8e4f2a..2542e44 100644 --- a/PC2Player/PC2Player/PC2Player.csproj +++ b/PC2Player/PC2Player/PC2Player.csproj @@ -6,6 +6,7 @@ + - \ No newline at end of file + From 854d6e4c378d459e85b524f88c536865f0199b83 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 10 May 2025 14:11:37 -0700 Subject: [PATCH 05/22] handle on process --- PC2Player/PC2Player/MainForm.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PC2Player/PC2Player/MainForm.cs b/PC2Player/PC2Player/MainForm.cs index 1a03aaf..cf887b6 100644 --- a/PC2Player/PC2Player/MainForm.cs +++ b/PC2Player/PC2Player/MainForm.cs @@ -19,6 +19,7 @@ namespace PC2Player long Index = 0; int FrameSkip = 6; byte[] AudioData; + Process MPVProcess; string ShowtapeName = ""; string ShowtapeStageType = ""; @@ -66,6 +67,10 @@ namespace PC2Player } SerialPortDropDown.SelectedValueChanged += (sender, e) => Event_SelectSerialPort(); + MPVProcess = new Process(); + MPVProcess.StartInfo.FileName = "mpv"; + MPVProcess.StartInfo.Arguments = "tmp.wav"; + FrameTimer = new System.Timers.Timer((1000d/60d)*FrameSkip); FrameTimer.Elapsed += Event_FrameTimerTick; FrameTimer.AutoReset = true; @@ -271,7 +276,7 @@ namespace PC2Player return; } File.WriteAllBytes("tmp.wav", AudioData); - Process.Start("mpv", "tmp.wav"); + MPVProcess.Start(); FrameTimer.Start(); Playing = true; @@ -285,6 +290,7 @@ namespace PC2Player void Event_StopButton() { FrameTimer.Stop(); + MPVProcess.Kill(); File.Delete("tmp.wav"); Playing = false; From 31bedffa2975b5d631932e75a0c6de3aca1487ce Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 10 May 2025 17:25:48 -0700 Subject: [PATCH 06/22] fix helen fw mappings --- .../Firmware-Servo-HelenMitzi.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino index 6dfb626..e17e30c 100644 --- a/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino +++ b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino @@ -2,10 +2,10 @@ #include -Servo servoChannel[11]; // mouth earL earR eyelidL eyelidR eyeL eyeR headL headR headUp armUpL armUpR elbowR elbowL armTwistL armTwistR bodyTwistR bodyTwistL bodyLean -byte onDegrees[19] = { 45, 0, 0, 0, 0, 0, 0, 135, 45, 135, 90, 90, 90, 90, 90, 90, 0, 0, 0 }; -byte offDegrees[19] = { 0, 0, 0, 0, 0, 0, 0, 90, 90, 90, 180, 0, 0, 180, 180, 0 , 0, 0, 0 }; -byte mapping[19] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 6, 3, 4, 7, 8, 5, 9, 9, 10 }; +Servo servoChannel[11]; // mouth earL earR eyelidL eyelidR eyeL eyeR headL headR headUp armUpL armTwistL elbowL armUpR armTwistR elbowR bodyTwistR bodyTwistL bodyLean +byte onDegrees[19] = { 45, 0, 0, 0, 0, 0, 0, 135, 45, 135, 90, 90, 90, 90, 90, 90, 0, 0, 0 }; +byte offDegrees[19] = { 0, 0, 0, 0, 0, 0, 0, 90, 90, 90, 180, 180, 180, 0, 0, 0 , 0, 0, 0 }; +byte mapping[19] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 9, 10 }; int byte1 = 0; int byte2 = 0; From 6f53e6dab4b0a0e71753cc59de80d729a2f41743 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 10 May 2025 22:02:21 -0700 Subject: [PATCH 07/22] thank you lexi for your wonderful improvement --- PC2Player/PC2Player/MainForm.cs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/PC2Player/PC2Player/MainForm.cs b/PC2Player/PC2Player/MainForm.cs index cf887b6..0cd1f77 100644 --- a/PC2Player/PC2Player/MainForm.cs +++ b/PC2Player/PC2Player/MainForm.cs @@ -238,27 +238,15 @@ namespace PC2Player List tmpOut = new List(); foreach (string frame in stringyBits) { - int b = int.Parse(frame, NumberStyles.HexNumber); - char[] bytesOut = { (char)64 }; - if (ShowtapeBits == "8") + uint b = uint.Parse(frame, NumberStyles.HexNumber); + char[] bytesOut = new char[8]; + int bytes = int.Parse(ShowtapeBits)/4; + for (int i = 0; i < bytes; i++) { - bytesOut = new char[]{ - (char)(64 | ((b & 8) | (b & 4) | (b & 2) | (b & 1))), - (char)(64 | (((b & 128) | (b & 64) | (b & 32) | (b & 16)) >> 4)) - }; - } - else if (ShowtapeBits == "32") - { - bytesOut = new char[]{ - (char)(64 | ((b & 8) | (b & 4) | (b & 2) | (b & 1))), - (char)(64 | (((b & 128) | (b & 64) | (b & 32) | (b & 16)) >> 4)), - (char)(64 | (((b & 2048) | (b & 1024) | (b & 512) | (b & 256)) >> 8)), - (char)(64 | (((b & 32768) | (b & 16384) | (b & 8192) | (b & 4096)) >> 12)), - (char)(64 | (((b & 524288) | (b & 262144) | (b & 131072) | (b & 65536)) >> 16)), - (char)(64 | (((b & 8388608) | (b & 4194304) | (b & 2097152) | (b & 1048576)) >> 20)), - (char)(64 | (((b & 134217728) | (b & 67108864) | (b & 33554432) | (b & 16777216)) >> 24)), - (char)(64 | (((b & 2147483648) | (b & 1073741824) | (b & 536870912) | (b & 268435456)) >> 28)) - }; + uint offset = 4 * i; + uint mask = 0b1111 << offset; + uint masked_value = (b & mask) >> offset; + bytesOut[i] = (char)(64 | masked_value); } tmpOut.Add(new string(bytesOut)); } From f167c0fcb1e8a20723ec8833af257e697dd103f0 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 11 May 2025 09:38:50 -0700 Subject: [PATCH 08/22] i should maybe actually test these things --- PC2Player/PC2Player/MainForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PC2Player/PC2Player/MainForm.cs b/PC2Player/PC2Player/MainForm.cs index 0cd1f77..8063dd7 100644 --- a/PC2Player/PC2Player/MainForm.cs +++ b/PC2Player/PC2Player/MainForm.cs @@ -238,14 +238,14 @@ namespace PC2Player List tmpOut = new List(); foreach (string frame in stringyBits) { - uint b = uint.Parse(frame, NumberStyles.HexNumber); + int b = int.Parse(frame, NumberStyles.HexNumber); char[] bytesOut = new char[8]; int bytes = int.Parse(ShowtapeBits)/4; for (int i = 0; i < bytes; i++) { - uint offset = 4 * i; - uint mask = 0b1111 << offset; - uint masked_value = (b & mask) >> offset; + int offset = 4 * i; + int mask = 0b1111 << offset; + int masked_value = (b & mask) >> offset; bytesOut[i] = (char)(64 | masked_value); } tmpOut.Add(new string(bytesOut)); From f756c70c1c0750322f2cc7f1cfc40bf0c7600e5d Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 11 May 2025 12:39:24 -0700 Subject: [PATCH 09/22] arduino mega --- .../Firmware-32Valve-Mega.ino | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino diff --git a/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino b/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino new file mode 100644 index 0000000..401c848 --- /dev/null +++ b/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino @@ -0,0 +1,138 @@ +// PINKCONNECTION2 Client Program for 32 Valve Systems (Arduino Mega) + +int byte1 = 0; +int byte2 = 0; +int byte3 = 0; +int byte4 = 0; +int byte5 = 0; +int byte6 = 0; +int byte7 = 0; +int byte8 = 0; + +void setup() +{ + for (int i = 22; i <= 53; i++) pinMode(i, OUTPUT); + Serial.begin(9600); + Serial.write("PC2,32,Universal,END"); +} + +void loop() +{ + if (Serial.available() > 7) + { + byte1 = Serial.read(); + byte2 = Serial.read(); + byte3 = Serial.read(); + byte4 = Serial.read(); + byte5 = Serial.read(); + byte6 = Serial.read(); + byte7 = Serial.read(); + byte8 = Serial.read(); + + if ((byte1 & 64) && (byte2 & 64) && (byte3 & 64) && (byte4 & 64) && (byte5 & 64) && (byte6 & 64) && (byte7 & 64) && (byte8 & 64)) + { + if (byte1 & 1) digitalWrite(22, 1); + else digitalWrite(22, 0); + + if (byte1 & 2) digitalWrite(23, 1); + else digitalWrite(23, 0); + + if (byte1 & 4) digitalWrite(24, 1); + else digitalWrite(24, 0); + + if (byte1 & 8) digitalWrite(25, 1); + else digitalWrite(25, 0); + + + if (byte2 & 1) digitalWrite(26, 1); + else digitalWrite(26, 0); + + if (byte2 & 2) digitalWrite(27, 1); + else digitalWrite(27, 0); + + if (byte2 & 4) digitalWrite(28, 1); + else digitalWrite(28, 0); + + if (byte2 & 8) digitalWrite(29, 1); + else digitalWrite(29, 0); + + + if (byte3 & 1) digitalWrite(30, 1); + else digitalWrite(30, 0); + + if (byte3 & 2) digitalWrite(31, 1); + else digitalWrite(31, 0); + + if (byte3 & 4) digitalWrite(32, 1); + else digitalWrite(32, 0); + + if (byte3 & 8) digitalWrite(33, 1); + else digitalWrite(33, 0); + + + if (byte4 & 1) digitalWrite(34, 1); + else digitalWrite(34, 0); + + if (byte4 & 2) digitalWrite(35, 1); + else digitalWrite(35, 0); + + if (byte4 & 4) digitalWrite(36, 1); + else digitalWrite(36, 0); + + if (byte4 & 8) digitalWrite(37, 1); + else digitalWrite(37, 0); + + + if (byte5 & 1) digitalWrite(38, 1); + else digitalWrite(22, 0); + + if (byte5 & 2) digitalWrite(39, 1); + else digitalWrite(23, 0); + + if (byte5 & 4) digitalWrite(40, 1); + else digitalWrite(24, 0); + + if (byte5 & 8) digitalWrite(41, 1); + else digitalWrite(25, 0); + + + if (byte6 & 1) digitalWrite(42, 1); + else digitalWrite(42, 0); + + if (byte6 & 2) digitalWrite(43, 1); + else digitalWrite(43, 0); + + if (byte6 & 4) digitalWrite(44, 1); + else digitalWrite(44, 0); + + if (byte6 & 8) digitalWrite(45, 1); + else digitalWrite(45, 0); + + + if (byte7 & 1) digitalWrite(46, 1); + else digitalWrite(46, 0); + + if (byte7 & 2) digitalWrite(47, 1); + else digitalWrite(47, 0); + + if (byte7 & 4) digitalWrite(48, 1); + else digitalWrite(48, 0); + + if (byte7 & 8) digitalWrite(49, 1); + else digitalWrite(49, 0); + + + if (byte8 & 1) digitalWrite(50, 1); + else digitalWrite(50, 0); + + if (byte8 & 2) digitalWrite(51, 1); + else digitalWrite(51, 0); + + if (byte8 & 4) digitalWrite(52, 1); + else digitalWrite(52, 0); + + if (byte8 & 8) digitalWrite(53, 1); + else digitalWrite(53, 0); + } + } +} From 29799820e2ac004e1f360023ecd5faeef0511d30 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 18 May 2025 11:07:18 -0700 Subject: [PATCH 10/22] update goals file --- Future Goals.md | 6 ++++-- .../PinkConnection2-TestApp/MainForm.cs | 6 +++--- PC2Player/PC2Player/MainForm.cs | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Future Goals.md b/Future Goals.md index fe0777e..30f46c1 100644 --- a/Future Goals.md +++ b/Future Goals.md @@ -4,13 +4,15 @@ - .SHW (ProgramBlue) input format - .3ST/.R12/.C&R (APS) input format - - Biphase (Pianocorder and Cyberstar) from tape input format (unlikely) + - Biphase (Pianocorder and Cyberstar) from tape input format - Studio C from Floppy Disk input format - UST Full Stage to Single Character Stripper ## PC2Player - - Make the program. + - ~~make the program~~ done!! + - fix memory leak issue + - make audio player work on windows ## Firmwares diff --git a/Legacy Tools/PinkConnection2-TestApp/PinkConnection2-TestApp/MainForm.cs b/Legacy Tools/PinkConnection2-TestApp/PinkConnection2-TestApp/MainForm.cs index 29338ee..2e19620 100644 --- a/Legacy Tools/PinkConnection2-TestApp/PinkConnection2-TestApp/MainForm.cs +++ b/Legacy Tools/PinkConnection2-TestApp/PinkConnection2-TestApp/MainForm.cs @@ -11,7 +11,7 @@ namespace PinkConnection2_TestApp SerialPort port = null; byte b = 0; - TextBox CommandTextBox = new TextBox { MaxLength = 2 }; + TextBox CommandTextBox = new TextBox { MaxLength = 8 }; DropDown SerialPortDropDown = new DropDown(); public MainForm() @@ -92,9 +92,9 @@ namespace PinkConnection2_TestApp void sendRawSafe() { - if (CommandTextBox.Text.Length != 2) + if (CommandTextBox.Text.Length != 8) { - MessageBox.Show("Command length must not be less than 2"); + MessageBox.Show("Command length must not be less than 8"); return; } if (port == null) diff --git a/PC2Player/PC2Player/MainForm.cs b/PC2Player/PC2Player/MainForm.cs index 8063dd7..81b2bf3 100644 --- a/PC2Player/PC2Player/MainForm.cs +++ b/PC2Player/PC2Player/MainForm.cs @@ -21,6 +21,8 @@ namespace PC2Player byte[] AudioData; Process MPVProcess; + int SkipSeconds = 0; + string ShowtapeName = ""; string ShowtapeStageType = ""; string ShowtapeCharacter = ""; @@ -69,7 +71,7 @@ namespace PC2Player MPVProcess = new Process(); MPVProcess.StartInfo.FileName = "mpv"; - MPVProcess.StartInfo.Arguments = "tmp.wav"; + MPVProcess.StartInfo.Arguments = $"--start={SkipSeconds} tmp.wav"; FrameTimer = new System.Timers.Timer((1000d/60d)*FrameSkip); FrameTimer.Elapsed += Event_FrameTimerTick; @@ -264,6 +266,8 @@ namespace PC2Player return; } File.WriteAllBytes("tmp.wav", AudioData); + Index = SkipSeconds*60; + MPVProcess.StartInfo.Arguments = $"--start={SkipSeconds} tmp.wav"; MPVProcess.Start(); FrameTimer.Start(); From 0ed3491e3fccc8914bc919bfc36c825088422a8f Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Mon, 26 May 2025 08:59:59 -0700 Subject: [PATCH 11/22] add option to compress audio to mp3 when converting rshw --- PC2Converter/PC2Converter/MainForm.cs | 52 +++++++++++++++++++++------ 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/PC2Converter/PC2Converter/MainForm.cs b/PC2Converter/PC2Converter/MainForm.cs index 171d3f3..296aa21 100644 --- a/PC2Converter/PC2Converter/MainForm.cs +++ b/PC2Converter/PC2Converter/MainForm.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Diagnostics; using System.IO; using Eto.Forms; @@ -15,12 +16,16 @@ namespace PC2Converter TextBox FilePathTextBox = new TextBox(); Button BrowseFileButton = new Button { Text = "Browse", Width = 100 }; Button ConvertButton = new Button { Text = "Convert", Width = 100 }; + CheckBox CompressAudioCheckBox = new CheckBox { Text = "Compress Audio", Width = 100 }; - string[] InputTypes = { "RSHW File (RR Engine)", "CSHW File (RR Engine)", "SSHW File (RR Engine)" }; + string[] InputTypes = { + "RSHW File (RR Engine)", "CSHW File (RR Engine)", "SSHW File (RR Engine)"/*, + "3ST File (APS)", "ROA/R12/C&R File (APS)"*/ + }; - string[] RSHWOutputTypes = { "UST 32 Bits (Single Bot RAE/3st)", "UST 8 Bits (Single Bot Cybers Rosetta)", "UST 256 Bits (Full RAE/3st)" , "UST 256 Bits (Full Cybers Rosetta)" }; - string[] CSHWOutputTypes = { "UST 8 Bits (Single Bot Cybers)", "UST 256 Bits (Full Cybers)" }; - string[] SSHWOutputTypes = { "UST 32 Bits (Single Bot Studio C)", "UST 256 Bits (Full Studio C)" }; + string[] RAE3stOutputTypes = { "UST 32 Bits (Single Bot RAE/3st)", "UST 8 Bits (Single Bot Cybers Rosetta)", "UST 256 Bits (Full RAE/3st)" , "UST 256 Bits (Full Cybers Rosetta)" }; + string[] CyberOutputTypes = { "UST 8 Bits (Single Bot Cybers)", "UST 256 Bits (Full Cybers)" }; + string[] StudioCOutputTypes = { "UST 32 Bits (Single Bot Studio C)", "UST 256 Bits (Full Studio C)" }; string[] RAE3stCharacters = { "Rolfe/Chuck E.", "Mitzi/Helen", "Fatz/Munch", "Beach Bear/Jasper", "Dook/Pasqually", "Billy Bob", "Looney Bird/PizzaCam"}; string[] CyberCharacters = { "Chuck E.", "Helen/Guest Star", "Munch", "Jasper", "Pasqually" }; @@ -44,8 +49,6 @@ namespace PC2Converter /* pasqually */ new int[]{ 30, 25, 21, 28, 29, 26, 31, 35 } }; - int[] CyberRosettaInvertedBits = { 2, 8, 181, 169, 41, 59, 58, 151, 158, 26, 35, 31 }; - int[][] SC_RAE3stBitMap = { /* rolfe/chuck */ new int[]{ 1, 9, 10, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 18, 19, 14, 15, 16, 20, 36, 37 }, @@ -62,6 +65,9 @@ namespace PC2Converter /* chuck e. */ new int[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 } }; + int[] CyberRosettaInvertedBits = { 2, 8, 181, 169, 41, 59, 58, 151, 158, 26, 35, 31 }; + int[] RAE3stAPSDescrambleTable = { 10, 11, 0, 1, 2, 3, 4, 12, 13, 5, 6, 7, 8, 9, 14, 15}; + bool FullStage = false; const int USTVersion = 1; @@ -130,6 +136,7 @@ namespace PC2Converter layout.BeginVertical(); layout.BeginHorizontal(); layout.Add(null, true); + layout.Add(CompressAudioCheckBox); layout.Add(ConvertButton); layout.EndHorizontal(); layout.EndVertical(); @@ -184,7 +191,7 @@ namespace PC2Converter fullStage = true; break; } - if (fullStage) headerOut += "N/A,"; + if (fullStage) headerOut += "All,"; else headerOut += character + ";"; return headerOut; } @@ -196,7 +203,7 @@ namespace PC2Converter case 0: OutputTypeSelector.Items.Clear(); CharacterSelector.Items.Clear(); - foreach (string s in RSHWOutputTypes) + foreach (string s in RAE3stOutputTypes) { OutputTypeSelector.Items.Add(s); } @@ -204,7 +211,7 @@ namespace PC2Converter case 1: OutputTypeSelector.Items.Clear(); CharacterSelector.Items.Clear(); - foreach (string s in CSHWOutputTypes) + foreach (string s in CyberOutputTypes) { OutputTypeSelector.Items.Add(s); } @@ -212,7 +219,7 @@ namespace PC2Converter case 2: OutputTypeSelector.Items.Clear(); CharacterSelector.Items.Clear(); - foreach (string s in SSHWOutputTypes) + foreach (string s in StudioCOutputTypes) { OutputTypeSelector.Items.Add(s); } @@ -440,9 +447,32 @@ namespace PC2Converter } writeOut.Add(frameByte.ToString($"X{(bitsCount/4).ToString()}")); } - File.WriteAllText(outFilePath, MakeHeader(Path.GetFileNameWithoutExtension(outFilePath), outputType, CharacterSelector.SelectedKey)+String.Join(",", writeOut.ToArray())+";"+Convert.ToBase64String(file.audioData)); + + byte[] audioOut = file.audioData; + if ((bool)CompressAudioCheckBox.Checked) + { + if (File.Exists("tmp.mp3")) File.Delete("tmp.mp3"); + File.WriteAllBytes("tmp.wav", audioOut); + Process ffmpegProcess = new Process(); + ffmpegProcess.StartInfo.FileName = "ffmpeg"; + ffmpegProcess.StartInfo.Arguments = "-i tmp.wav -c:a mp3 -b:a 128 tmp.mp3"; + ffmpegProcess.Start(); + ffmpegProcess.WaitForExit(); + audioOut = File.ReadAllBytes("tmp.mp3"); + File.Delete("tmp.wav"); + File.Delete("tmp.mp3"); + } + + File.WriteAllText(outFilePath, MakeHeader(Path.GetFileNameWithoutExtension(outFilePath), outputType, CharacterSelector.SelectedKey)+String.Join(",", writeOut.ToArray())+";"+Convert.ToBase64String(audioOut)); } MessageBox.Show("Conversion complete!"); } + + int RRtoAPSBit(int rrBit) // aps lower drawer starts at 129 instead of 151 + { + int outAPSBit = rrBit; + if (rrBit > 150) outAPSBit = rrBit - 22; + return outAPSBit; + } } } From 1cb4b77f9ab5d5ad0452b546e55758066ff236a2 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Mon, 26 May 2025 18:25:47 -0700 Subject: [PATCH 12/22] complete bit mapping for 3st/rae --- Bit Mappings.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/Bit Mappings.md b/Bit Mappings.md index 8f8d6d8..724b55f 100644 --- a/Bit Mappings.md +++ b/Bit Mappings.md @@ -170,6 +170,109 @@ Entire bot was removed during Concept Unification. Hand movement was removed during Concept Unification. +### Props + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ------------------- | ------------------ | ------------- | ----------- | ---------- | ------------ | +| Sun/Building Raise | 118 | 39 | 1-39 | | | +| Sun/Building Mouth | 119 | 38 | 1-38 | | | +| Moon Raise | 120 | 47 | 1-47 | | | +| Moon Mouth | 121 | 46 | 1-46 | | | +| Antioch/Wink | 122 | 49 | 1-49 | TB2 3-4 H1 | No | +| Choo-Choo/Munch Jr. | 123 | 50 | 1-50 | | | + +### Spots + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| --------------------------------- | ------------------ | ------------- | ----------- | ------------ | ------------ | +| Rolfe/Chuck Spot | 124 | 88 | 1-88 | TB1 15-16 H7 | No | +| Dook/Helen Spot | 125 | 86 | 1-86 | TB1 11-12 H7 | No | +| Fatz/Munch Spot | 126 | 85 | 1-85 | TB2 9-10 H7 | No | +| Beach Bear/Jasper Spot | 127 | 82 | 1-82 | TB2 5-6 H7 | No | +| Beach Bear/Jasper Guitar Spot | 128 | 242 | 2-96 | | | +| Billy Bob/Pasqually Spot | 129 | 84 | 1-84 | TB1 7-8 H7 | No | +| Looney Bird/Pizzacam Spot | 130 | 83 | 1-83 | | | +| Mitzi/Wink Spot | 131 | 81 | 1-81 | TB2 5-6 H8 | No | +| Sun/Building Spot | 132 | 238 | 2-88 | | | +| Moon Spot | 133 | 239 | 2-89 | | | +| Antioch/Munch Jr. Spot/Gobo Light | 134 | 240 | 2-90 | TB1 7-8 H8 | No | +| Earl Spot/Helicopter Light/Gemini | 135 | 87 | 1-87 | TB2 3-4 H8 | No | + +### Curtains + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ------------------ | ------------------ | ------------- | ----------- | ------------------------- | ------------ | +| Stage Left Open | 136 | 93 | 1-93 | TB2 5-6 H2 & TB2 1-2 H2 | No | +| Stage Left Close | 137 | 94 | 1-94 | TB2 7-8 H2 & TB2 3-4 H2 | No | +| Center Stage Open | 138 | 91 | 1-91 | TB2 9-10 H2 & TB2 1-2 H2 | No | +| Center Stage Close | 139 | 92 | 1-92 | TB2 11-12 H2 & TB2 3-4 H2 | No | +| Stage Right Open | 140 | 89 | 1-89 | TB2 9-10 H2 & TB2 1-2 H2 | No | +| Stage Right Close | 141 | 90 | 1-90 | TB2 11-12 H2 & TB2 3-4 H2 | No | + +### Floods + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ------------------ | ------------------ | ------------- | ----------- | ------------ | ------------ | +| Stage Left Red | 142 | 229 | 2-79 | TB1 15-16 H8 | No | +| Stage Left Amber | 143 | 228 | 2-78 | TB1 7-8 H8 | No | +| Stage Left Green | 144 | 227 | 2-77 | | | +| Stage Left Blue | 145 | 226 | 2-76 | TB2 13-14 H8 | No | +| Center Stage Red | 146 | 224 | 2-74 | TB1 11-12 H8 | No | +| Center Stage Amber | 147 | 223 | 2-73 | TB1 9-10 H8 | No | +| Center Stage Blue | 148 | 221 | 2-71 | TB1 13-14 H8 | No | +| Stage Right Red | 149 | 219 | 2-69 | | | +| Stage Right Amber | 150 | 218 | 2-68 | | | +| Stage Right Green | 151 | 217 | 2-67 | | | +| Stage Right Blue | 152 | 216 | 2-66 | | | +| Live Flood | 153 | 222 | 2-72 | TB1 1-2 H7 | No | + +### Backdrop + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ---------------------- | ------------------ | ------------- | ----------- | ---------- | ------------ | +| Backdrop Red | 154 | 235 | 2-85 | TB1 3-4 H8 | No | +| Backdrop Yellow | 155 | 232 | 2-82 | TB1 1-2 H8 | No | +| Backdrop Green | 156 | 231 | 2-81 | | | +| Backdrop Blue | 157 | 234 | 2-84 | TB2 5-6 H8 | No | +| Backdrop Red Outer | 158 | 236 | 2-86 | | | +| Backdrop Blue Outer | 159 | 237 | 2-87 | | | +| Backdrop Red Buildings | 160 | 233 | 2-83 | | | +| Stage Right Red Floor | 161 | 242 | 2-92 | | | +| Stage Right Blue Floor | 162 | 243 | 2-93 | | | + +### Organ + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ----------------- | ------------------ | ------------- | ----------- | ------------ | ------------ | +| Organ Face Red | 163 | 67 | 1-67 | TB2 11-12 H7 | No | +| Organ Face Amber | 164 | 68 | 1-68 | TB2 7-8 H7 | No | +| Organ Face Green | 165 | 69 | 1-69 | | | +| Organ Face Blue | 166 | 66 | 1-66 | | | +| Organ Legs Top | 167 | 71 | 1-71 | TB1 9-10 H7 | No | +| Organ Legs Middle | 168 | 72 | 1-72 | TB2 3-4 H7 | No | +| Organ Legs Bottom | 169 | 73 | 1-73 | TB2 13-14 H7 | No | + +### Sign + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ----------- | ------------------ | ------------- | ----------- | ------------ | ------------ | +| Sign Outer | 170 | 78 | 1-78 | | | +| Sign Middle | 171 | 77 | 1-77 | TB2 11-12 H8 | No | +| Sign Inner | 172 | 76 | 1-76 | | | +| Sign Strobe | 173 | 79 | 1-79 | | | +| Sign Flash | 174 | 80 | 1-80 | | | + +### Special + +| Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| ------------------- | ------------------ | ------------- | ----------- | ------------ | ------------ | +| Chuck E. Star | 175 | 220 | 2-70 | TB1 13-14 H7 | No | +| Chuck E. Neon | 176 | 244 | 2-94 | TB2 1-2 H7 | No | +| Jukebox Topper | 177 | 245 | 2-95 | TB2 9-10 H8 | No | +| Fiber Optic Curtain | 178 | 225 | 2-75 | TB2 1-2 H8 | No | +| Snare Drum Light | 179 | 230 | 2-80 | | | +| Kick Drum Light | 180 | 241 | 2-91 | TB1 5-6 H7 | No | + ## R12 (Road/1-Stage/2-Stage) ### Chuck E. Cheese From 6678780ef6dbb5e4d85af506f0c3c5894e537ba8 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Mon, 26 May 2025 19:21:00 -0700 Subject: [PATCH 13/22] full 3 stage bit map and 256 bit conversion --- PC2Converter/PC2Converter/MainForm.cs | 31 ++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/PC2Converter/PC2Converter/MainForm.cs b/PC2Converter/PC2Converter/MainForm.cs index 296aa21..af76e5d 100644 --- a/PC2Converter/PC2Converter/MainForm.cs +++ b/PC2Converter/PC2Converter/MainForm.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Diagnostics; +using System.Numerics; using System.IO; using Eto.Forms; @@ -65,6 +66,24 @@ namespace PC2Converter /* chuck e. */ new int[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 } }; + int[] FS_RAE3stBitMap = { + 1, 9, 10, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 18, 19, 14, 15, 16, 20, 36, 37, + 185, 176, 177, 181, 182, 183, 184, 178, 179, 180, 173, 175, 174, 168, 170, 169, 186, 187, 188, + 45, 41, 42, 43, 44, 54, 55, 51, 52, 53, 57, 59, 58, 60, 61, 62, + 166, 151, 152, 153, 156, 157, 158, 161, 162, 163, 164, 154, 155, 159, 160, 165, + 30, 23, 24, 26, 27, 28, 29, 25, 21, 22, 33, 35, 34, 31, 32, 63, 64, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 189, 190, 194, 211, 212, 213, + 167, 191, 192, 193, 171, 172, 48, + 39, 38, 47, 46, 49, 50, + 88, 86, 85, 82, 242, 84, 83, 81, 238, 239, 240, 87, + 93, 94, 91, 92, 89, 90, + 229, 228, 227, 226, 224, 223, 221, 219, 218, 217, 216, 222, + 235, 232, 231, 234, 236, 237, 233, 242, 243, + 67, 68, 69, 66, 71, 72, 73, + 78, 77, 76, 79, 80, + 220, 244, 245, 225, 230, 241 + }; + int[] CyberRosettaInvertedBits = { 2, 8, 181, 169, 41, 59, 58, 151, 158, 26, 35, 31 }; int[] RAE3stAPSDescrambleTable = { 10, 11, 0, 1, 2, 3, 4, 12, 13, 5, 6, 7, 8, 9, 14, 15}; @@ -346,9 +365,9 @@ namespace PC2Converter return; } - if (FullStage) + if (FullStage && (string)OutputTypeSelector.SelectedKey != "UST 256 Bits (Full RAE/3st)") { - MessageBox.Show("Fatal: Full Stage mode is not supported at this time."); + MessageBox.Show("Fatal: Full Stage mode is not supported for cybers and studio c at this time."); return; } @@ -417,6 +436,7 @@ namespace PC2Converter break; case "UST 256 Bits (Full RAE/3st)": bitsCount = 256; + targetBits = FS_RAE3stBitMap; break; case "UST 256 Bits (Full Cybers Rosetta)": bitsCount = 256; @@ -440,10 +460,10 @@ namespace PC2Converter List writeOut = new List(); foreach (BitArray bits in rshwBits) { - int frameByte = 0; + BigInteger frameByte = 0; for (int i = 0; i < targetBits.Length; i++) { - if (bits.Get(targetBits[i])) frameByte += 1 << i; + if (bits.Get(targetBits[i])) frameByte += BigInteger.Pow(2, i); } writeOut.Add(frameByte.ToString($"X{(bitsCount/4).ToString()}")); } @@ -451,11 +471,12 @@ namespace PC2Converter byte[] audioOut = file.audioData; if ((bool)CompressAudioCheckBox.Checked) { + MessageBox.Show("press ok to start compressing audio"); if (File.Exists("tmp.mp3")) File.Delete("tmp.mp3"); File.WriteAllBytes("tmp.wav", audioOut); Process ffmpegProcess = new Process(); ffmpegProcess.StartInfo.FileName = "ffmpeg"; - ffmpegProcess.StartInfo.Arguments = "-i tmp.wav -c:a mp3 -b:a 128 tmp.mp3"; + ffmpegProcess.StartInfo.Arguments = "-i tmp.wav -c:a mp3 -b:a 128k tmp.mp3"; ffmpegProcess.Start(); ffmpegProcess.WaitForExit(); audioOut = File.ReadAllBytes("tmp.mp3"); From 1d387b56798efbab828844d9679a7d2d86a38a23 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 31 May 2025 20:19:26 -0700 Subject: [PATCH 14/22] finish cybers bit mapping --- Bit Mappings.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/Bit Mappings.md b/Bit Mappings.md index 724b55f..9dd3908 100644 --- a/Bit Mappings.md +++ b/Bit Mappings.md @@ -185,7 +185,7 @@ Hand movement was removed during Concept Unification. | Name | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | | --------------------------------- | ------------------ | ------------- | ----------- | ------------ | ------------ | -| Rolfe/Chuck Spot | 124 | 88 | 1-88 | TB1 15-16 H7 | No | +| Rolfe/Chuck E. Spot | 124 | 88 | 1-88 | TB1 15-16 H7 | No | | Dook/Helen Spot | 125 | 86 | 1-86 | TB1 11-12 H7 | No | | Fatz/Munch Spot | 126 | 85 | 1-85 | TB2 9-10 H7 | No | | Beach Bear/Jasper Spot | 127 | 82 | 1-82 | TB2 5-6 H7 | No | @@ -273,7 +273,7 @@ Hand movement was removed during Concept Unification. | Snare Drum Light | 179 | 230 | 2-80 | | | | Kick Drum Light | 180 | 241 | 2-91 | TB1 5-6 H7 | No | -## R12 (Road/1-Stage/2-Stage) +## Cyberamics ### Chuck E. Cheese @@ -339,3 +339,87 @@ Hand movement was removed during Concept Unification. | Eyelids | 6 | 38 | 38 | TB1 11-12 H3 | | Right Arm | 7 | 39 | 39 | TB1 13-14 H3 | | Left Arm | 8 | 40 | 36 | TB1 7-8 H3 | + +### Props + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| ------------------------- | ------------------ | ------------- | ------------ | +| Warblettes/Flower Mouth 1 | 41 | 9 | TB2 1-2 H1 | +| Flower Mouth 2 | 42 | 46 | TB2 11-12 H3 | +| Flower Mouth 3 | 43 | 62 | TB2 11-12 H4 | +| Warblettes Body Rock/Wink | 44 | 10 | TB2 3-4 H1 | +| Flag 1 | 45 | 74 | TB2 3-4 H5 | +| Flag 2 | 46 | 75 | TB2 5-6 H5 | +| Flag 3 | 47 | 76 | TB2 7-8 H5 | +| Flag 4 | 48 | 77 | TB2 9-10 H5 | +| Flag 5 | 49 | 78 | TB2 11-12 H5 | + +### Spots + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| ----------------------- | ------------------ | ------------- | ------------ | +| Chuck E. Spot | 50 | 104 | TB1 15-16 H7 | +| Helen Spot | 51 | 102 | TB1 11-12 H7 | +| Munch Spot | 52 | 109 | TB2 9-10 H7 | +| Jasper Spot | 53 | 107 | TB2 5-6 H7 | +| Pasqually Spot | 54 | 100 | TB1 7-8 H7 | +| Wink Spot | 55 | 123 | TB2 5-6 H8 | +| Flowers/Warblettes Spot | 56 | 41 | TB2 1-2 H3 | + +### Curtains + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| ------------------------ | ------------------ | ------------- | ------------ | +| CEC Stage Curtain Open | 57 | 27 | TB2 5-6 H2 | +| CEC Stage Curtain Close | 58 | 28 | TB2 7-8 H2 | +| Main Stage Curtain Open | 59 | 29 | TB2 9-10 H2 | +| Main Stage Curtain Close | 60 | 30 | TB2 11-12 H2 | +| 1-Stage Curtain Open | 61 | 25 | TB2 1-2 H2 | +| 1-Stage Curtain Close | 62 | 26 | TB2 3-4 H2 | +| Turntable Bot Side | 63 | 57 | TB2 1-2 H4 | +| Turntable Live Side | 64 | 58 | TB2 3-4 H4 | + +### Floods + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| ------------------------- | ------------------ | ------------- | ------------ | +| CEC Stage Red Overhead | 65 | 120 | TB1 15-16 H8 | +| CEC Stage Amber Overhead | 66 | 116 | TB1 7-8 H8 | +| CEC Stage Blue Overhead | 67 | 127 | TB2 13-14 H8 | +| Main Stage Red Overhead | 68 | 118 | TB1 11-12 H8 | +| Main Stage Amber Overhead | 69 | 117 | TB1 9-10 H8 | +| Main Stage Blue Overhead | 70 | 119 | TB1 13-14 H8 | + +### Backdrop + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| -------------- | ------------------ | ------------- | ---------- | +| Red Backdrop | 71 | 114 | TB1 3-4 H8 | +| Amber Backdrop | 72 | 113 | TB1 1-2 H8 | +| Blue Backdrop | 73 | 115 | TB1 5-6 H8 | + +### Organ + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| ----------------- | ------------------ | ------------- | ------------ | +| Organ Face Amber | 74 | 110 | TB2 11-12 H7 | +| Organ Face Blue | 75 | 108 | TB2 7-8 H7 | +| Organ Legs Outer | 76 | 101 | TB1 9-10 H7 | +| Organ Legs Middle | 77 | 106 | TB2 3-4 H7 | +| Organ Legs Inner | 78 | 111 | TB2 13-14 H7 | + +### Special + +| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| -------------------- | ------------------ | ------------- | ------------ | +| CEC Star/Rope Lights | 79 | 103 | TB1 13-14 H7 | +| CEC Sign | 80 | 105 | TB2 1-2 H7 | +| Jukebox Topper | 81 | 125 | TB2 9-10 H8 | +| Fiber Curtain | 82 | 121 | TB2 1-2 H8 | +| Band Sign | 83 | 126 | TB2 11-12 H8 | +| Kick Drum | 84 | 99 | TB1 5-6 H7 | +| Gobo Light | 85 | 124 | TB2 7-8 H8 | +| Helicopter/Gemini | 86 | 122 | TB2 3-4 H8 | +| Live Flood | 87 | 97 | TB1 1-2 H7 | +| Live Strobe | 88 | 98 | TB1 3-4 H7 | + From a79a5e54c536036b0e23a430d379b4f4d5ed4b5b Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 31 May 2025 23:28:23 -0700 Subject: [PATCH 15/22] cybers bit mappings in converter --- Bit Mappings.md | 6 +-- PC2Converter/PC2Converter/MainForm.cs | 60 ++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/Bit Mappings.md b/Bit Mappings.md index 9dd3908..b462d38 100644 --- a/Bit Mappings.md +++ b/Bit Mappings.md @@ -17,7 +17,7 @@ This information was sourced from Cheese-E-Pedia, the Showbiz Pizza Cyberstar In | Eyes Right | 7 | 7 | 5 | 1-5 | TB1 9-10 H1 | No | | Head Left | 8 | 8 | 6 | 1-6 | TB1 3-4 H1 | No | | Head Right | 9 | 9 | 7 | 1-7 | TB1 5-6 H1 | No | -| Head Up | 10 | 10 | 8 | 1-8 | TB1 7-8 H1 | Yes | +| Head Up | 10 | 10 | 8 | 1-8 | TB1 7-8 H1 | No | | Left Arm Up | 11 | 11 | 11 | 1-11 | | | | Left Arm Twist | 12 | 12 | 12 | 1-12 | | | | Left Elbow | 13 | 13 | 13 | 1-13 | | | @@ -46,7 +46,7 @@ Earl's movements were removed during Concept Unification. | Eyes Right | 7 | 29 | 184 | 2-34 | TB1 9-10 H5 | No | | Head Left | 8 | 30 | 178 | 2-28 | TB1 3-4 H5 | No | | Head Right | 9 | 31 | 179 | 2-29 | TB1 5-6 H5 | No | -| Head Up | 10 | 32 | 180 | 2-30 | TB1 7-8 H5 | Yes | +| Head Up | 10 | 32 | 180 | 2-30 | TB1 7-8 H5 | No | | Left Arm Up | 11 | 33 | 173 | 2-23 | | | | Left Arm Twist | 12 | 34 | 175 | 2-25 | | | | Left Elbow | 13 | 35 | 174 | 2-24 | | | @@ -92,7 +92,7 @@ No movements were removed during Concept Unification. | Eyes Cross | 4 | 61 | 153 | 2-3 | | | | Head Left | 5 | 62 | 156 | 2-6 | TB1 3-4 H2 & TB1 15-16 H2 | No | | Head Right | 6 | 63 | 157 | 2-7 | TB1 5-6 H2 & TB1 9-10 H2 | No | -| Head Up | 7 | 64 | 158 | 2-8 | TB1 7-8 H2 | Yes | +| Head Up | 7 | 64 | 158 | 2-8 | TB1 7-8 H2 | No | | Right Arm Raise | 8 | 65 | 161 | 2-11 | | | | Right Arm Twist | 9 | 66 | 162 | 2-12 | | | | Right Elbow | 10 | 67 | 163 | 2-13 | TB1 13-14 H2 | No | diff --git a/PC2Converter/PC2Converter/MainForm.cs b/PC2Converter/PC2Converter/MainForm.cs index af76e5d..510ebcc 100644 --- a/PC2Converter/PC2Converter/MainForm.cs +++ b/PC2Converter/PC2Converter/MainForm.cs @@ -32,7 +32,7 @@ namespace PC2Converter string[] CyberCharacters = { "Chuck E.", "Helen/Guest Star", "Munch", "Jasper", "Pasqually" }; string[] StudioCCharacters = { "Chuck E." }; - int[][] SC_CyberBitMapR12 = + int[][] SC_CyberBitMap = { /* chuck */ new int[]{ 1, 2, 3, 4, 8, 5, 6, 7 }, /* helen */ new int[]{ 65, 66, 67, 68, 72, 69, 70, 71 }, @@ -85,9 +85,41 @@ namespace PC2Converter }; int[] CyberRosettaInvertedBits = { 2, 8, 181, 169, 41, 59, 58, 151, 158, 26, 35, 31 }; + int[] FS_CyberBitMap = { + 1, 2, 3, 4, 8, 5, 6, 7, + 65, 66, 67, 68, 72, 69, 70, 71, + 49, 50, 51, 56, 53, 54, 55, 52, + 17, 18, 19, 20, 24, 21, 22, 23, + 33, 34, 35, 40, 37, 38, 39, 36, + 9, 46, 62, 10, 74, 75, 76, 77, 78, + 104, 102, 109, 107, 100, 123, 41, + 27, 28, 29, 30, 25, 26, 57, 58, + 120, 116, 127, 118, 117, 119, + 114, 113, 115, + 110, 108, 101, 106, 111, + 103, 105, 125, 121, 126, 99, 124, 122, 97, 98 + }; + + int[] FS_CyberBitMapRosetta = { + 1, 6, 7, 8, 4, 5, 2, 19, + 185, 178, 179, 180, 183, 184, 181, 169, + 45, 54, 55, 43, 44, 41, 58, 59, + 166, 156, 157, 158, 156, 157, 151, 163, + 30, 25, 21, 28, 29, 26, 31, 35, + 0, 0, 0, 49, 0, 0, 0, 0, 0, + 88, 86, 85, 82, 84, 81, 0, + 93, 94, 91, 92, 91, 92, 0, 0, + 229, 228, 226, 224, 223, 221, + 235, 232, 234, + 67, 68, 71, 72, 73, + 220, 244, 245, 225, 77, 241, 240, 87, 222, 0 + }; + + int[] CyberRosettaInvertedBits = { 2, 181, 41, 59, 58, 151, 163, 26, 35, 31 }; int[] RAE3stAPSDescrambleTable = { 10, 11, 0, 1, 2, 3, 4, 12, 13, 5, 6, 7, 8, 9, 14, 15}; bool FullStage = false; + bool Rosetta = false; const int USTVersion = 1; public MainForm() @@ -260,6 +292,7 @@ namespace PC2Converter CharacterSelector.Items.Add(s); } CharacterSelector.Enabled = true; + Rosetta = false; FullStage = false; break; case 1: @@ -269,16 +302,19 @@ namespace PC2Converter CharacterSelector.Items.Add(s); } CharacterSelector.Enabled = true; + Rosetta = true; FullStage = false; break; case 2: CharacterSelector.Items.Clear(); CharacterSelector.Enabled = false; + Rosetta = false; FullStage = true; break; case 3: CharacterSelector.Items.Clear(); CharacterSelector.Enabled = false; + Rosetta = true; FullStage = true; break; } @@ -293,11 +329,13 @@ namespace PC2Converter CharacterSelector.Items.Add(s); } CharacterSelector.Enabled = true; + Rosetta = false; FullStage = false; break; case 1: CharacterSelector.Items.Clear(); CharacterSelector.Enabled = false; + Rosetta = false; FullStage = true; break; } @@ -312,11 +350,13 @@ namespace PC2Converter CharacterSelector.Items.Add(s); } CharacterSelector.Enabled = true; + Rosetta = false; FullStage = false; break; case 1: CharacterSelector.Items.Clear(); CharacterSelector.Enabled = false; + Rosetta = false; FullStage = true; break; } @@ -365,12 +405,6 @@ namespace PC2Converter return; } - if (FullStage && (string)OutputTypeSelector.SelectedKey != "UST 256 Bits (Full RAE/3st)") - { - MessageBox.Show("Fatal: Full Stage mode is not supported for cybers and studio c at this time."); - return; - } - SaveFileDialog fileDialog = new SaveFileDialog(); fileDialog.Filters.Add(new FileFilter("UST Files (.ust)", new string[]{".ust"})); fileDialog.Title = "Select Show File."; @@ -440,13 +474,15 @@ namespace PC2Converter break; case "UST 256 Bits (Full Cybers Rosetta)": bitsCount = 256; + targetBits = FS_CyberBitMapRosetta; break; case "UST 8 Bits (Single Bot Cybers)": bitsCount = 8; - targetBits = SC_CyberBitMapR12[Array.IndexOf(CyberCharacters, CharacterSelector.SelectedKey)]; + targetBits = SC_CyberBitMap[Array.IndexOf(CyberCharacters, CharacterSelector.SelectedKey)]; break; case "UST 256 Bits (Full Cybers)": bitsCount = 256; + targetBits = FS_CyberBitMap; break; case "UST 32 Bits (Single Bot Studio C)": bitsCount = 32; @@ -463,15 +499,19 @@ namespace PC2Converter BigInteger frameByte = 0; for (int i = 0; i < targetBits.Length; i++) { - if (bits.Get(targetBits[i])) frameByte += BigInteger.Pow(2, i); + if (Rosetta && CyberRosettaInvertedBits.Contains(targetBits[i])) + { + if (!bits.Get(targetBits[i])) frameByte += BigInteger.Pow(2, i); + } + else { if (bits.Get(targetBits[i])) frameByte += BigInteger.Pow(2, i); } } writeOut.Add(frameByte.ToString($"X{(bitsCount/4).ToString()}")); } + writeOut[0] = (0).ToString($"X{(bitsCount/4).ToString()}"); byte[] audioOut = file.audioData; if ((bool)CompressAudioCheckBox.Checked) { - MessageBox.Show("press ok to start compressing audio"); if (File.Exists("tmp.mp3")) File.Delete("tmp.mp3"); File.WriteAllBytes("tmp.wav", audioOut); Process ffmpegProcess = new Process(); From 91aa378769f5f3c16d059bcf16ba145c3866dcc7 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sat, 31 May 2025 23:28:48 -0700 Subject: [PATCH 16/22] Update MainForm.cs --- PC2Converter/PC2Converter/MainForm.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/PC2Converter/PC2Converter/MainForm.cs b/PC2Converter/PC2Converter/MainForm.cs index 510ebcc..07f6616 100644 --- a/PC2Converter/PC2Converter/MainForm.cs +++ b/PC2Converter/PC2Converter/MainForm.cs @@ -84,7 +84,6 @@ namespace PC2Converter 220, 244, 245, 225, 230, 241 }; - int[] CyberRosettaInvertedBits = { 2, 8, 181, 169, 41, 59, 58, 151, 158, 26, 35, 31 }; int[] FS_CyberBitMap = { 1, 2, 3, 4, 8, 5, 6, 7, 65, 66, 67, 68, 72, 69, 70, 71, From 424d9331cd469742914c5800cb0eb8913b131912 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 1 Jun 2025 13:00:52 -0700 Subject: [PATCH 17/22] studio c --- Bit Mappings.md | 122 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 115 insertions(+), 7 deletions(-) diff --git a/Bit Mappings.md b/Bit Mappings.md index b462d38..0dccecc 100644 --- a/Bit Mappings.md +++ b/Bit Mappings.md @@ -342,7 +342,7 @@ Hand movement was removed during Concept Unification. ### Props -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------------------- | ------------------ | ------------- | ------------ | | Warblettes/Flower Mouth 1 | 41 | 9 | TB2 1-2 H1 | | Flower Mouth 2 | 42 | 46 | TB2 11-12 H3 | @@ -356,7 +356,7 @@ Hand movement was removed during Concept Unification. ### Spots -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ----------------------- | ------------------ | ------------- | ------------ | | Chuck E. Spot | 50 | 104 | TB1 15-16 H7 | | Helen Spot | 51 | 102 | TB1 11-12 H7 | @@ -368,7 +368,7 @@ Hand movement was removed during Concept Unification. ### Curtains -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------------------ | ------------------ | ------------- | ------------ | | CEC Stage Curtain Open | 57 | 27 | TB2 5-6 H2 | | CEC Stage Curtain Close | 58 | 28 | TB2 7-8 H2 | @@ -381,7 +381,7 @@ Hand movement was removed during Concept Unification. ### Floods -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------------------- | ------------------ | ------------- | ------------ | | CEC Stage Red Overhead | 65 | 120 | TB1 15-16 H8 | | CEC Stage Amber Overhead | 66 | 116 | TB1 7-8 H8 | @@ -392,7 +392,7 @@ Hand movement was removed during Concept Unification. ### Backdrop -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | -------------- | ------------------ | ------------- | ---------- | | Red Backdrop | 71 | 114 | TB1 3-4 H8 | | Amber Backdrop | 72 | 113 | TB1 1-2 H8 | @@ -400,7 +400,7 @@ Hand movement was removed during Concept Unification. ### Organ -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ----------------- | ------------------ | ------------- | ------------ | | Organ Face Amber | 74 | 110 | TB2 11-12 H7 | | Organ Face Blue | 75 | 108 | TB2 7-8 H7 | @@ -410,7 +410,7 @@ Hand movement was removed during Concept Unification. ### Special -| Movement Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Name | UST Full Stage Bit | RR Engine Bit | CCS Bit | | -------------------- | ------------------ | ------------- | ------------ | | CEC Star/Rope Lights | 79 | 103 | TB1 13-14 H7 | | CEC Sign | 80 | 105 | TB2 1-2 H7 | @@ -423,3 +423,111 @@ Hand movement was removed during Concept Unification. | Live Flood | 87 | 97 | TB1 1-2 H7 | | Live Strobe | 88 | 98 | TB1 3-4 H7 | +## Studio C + +### Chuck E. + +| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | DTU Bit | 16M | +| ----------------- | ------------------------ | ------------------ | ------------- | ------- | --- | +| Mouth | 1 | 1 | 21 | 1-21 | Yes | +| Nose | 2 | 2 | 28 | 1-28 | No | +| Eyelids Up | 3 | 3 | 25 | 1-25 | No | +| Eyelids Down | 4 | 4 | 24 | 1-24 | Yes | +| Eyes Left | 5 | 5 | 26 | 1-26 | Yes | +| Eyes Right | 6 | 6 | 27 | 1-27 | Yes | +| Eyebrows Up | 7 | 7 | 29 | 1-29 | No | +| Eyebrows Down | 8 | 8 | 30 | 1-30 | No | +| Ears | 9 | 9 | 31 | 1-31 | No | +| Head Turn Left | 10 | 10 | 18 | 1-18 | Yes | +| Head Turn Right | 11 | 11 | 19 | 1-19 | Yes | +| Head Tilt Left | 12 | 12 | 23 | 1-23 | No | +| Head Tilt Right | 13 | 13 | 22 | 1-22 | No | +| Head Up | 14 | 14 | 20 | 1-20 | Yes | +| Left Arm Out | 15 | 15 | 6 | 1-6 | No | +| Left Arm Swing | 16 | 16 | 7 | 1-7 | Yes | +| Left Arm Forward | 17 | 17 | 11 | 1-11 | No | +| Left Elbow | 18 | 18 | 8 | 1-8 | Yes | +| Left Wrist | 19 | 19 | 9 | 1-9 | No | +| Left Hand Wave | 20 | 20 | 10 | 1-10 | Yes | +| Right Arm Out | 21 | 21 | 1 | 1-1 | No | +| Right Arm Swing | 22 | 22 | 2 | 1-2 | Yes | +| Right Arm Forward | 23 | 23 | 17 | 1-17 | No | +| Right Elbow | 24 | 24 | 3 | 1-3 | Yes | +| Right Wrist | 25 | 25 | 4 | 1-4 | No | +| Right Hand Wave | 26 | 26 | 5 | 1-5 | Yes | +| Body Forward | 27 | 27 | 12 | 1-12 | Yes | +| Body Turn Left | 28 | 28 | 16 | 1-16 | Yes | +| Body Turn Right | 29 | 29 | 15 | 1-15 | Yes | +| Body Tilt Left | 30 | 30 | 13 | 1-13 | No | +| Body Tilt Right | 31 | 31 | 14 | 1-14 | No | +| Foot Tap | 32 | 32 | 32 | 1-32 | No | + +### Props + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| ------------- | ------------------ | ------------- | ------- | +| Bird Mouth | 33 | 33 | 1-33 | +| Bird Wings | 34 | 36 | 1-36 | +| Bird Bow | 35 | 34 | 1-34 | +| Bird Turn | 36 | 35 | 1-35 | +| Phone Swing | 37 | 40 | 1-40 | +| Clock Forward | 38 | 160 | 2-10 | +| Clock Reverse | 39 | 161 | 2-11 | + +### Spots + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| ------------- | ------------------ | ------------- | ------- | +| Chuck E. Spot | 40 | 177 | 2-27 | +| Bird Spot | 41 | 178 | 2-28 | + +### Curtains + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| -------------- | ------------------ | ------------- | ------- | +| Curtains Open | 42 | 44 | 1-44 | +| Curtains Close | 43 | 45 | 1-45 | + +### Floods + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| ------------------------ | ------------------ | ------------- | ------- | +| CEC Red Floods | 44 | 151 | 2-1 | +| CEC Amber Floods | 45 | 154 | 2-4 | +| CEC Green Floods | 46 | 152 | 2-2 | +| CEC Blue Floods | 47 | 153 | 2-3 | +| Blue Screen Red Floods | 48 | 155 | 2-5 | +| Blue Screen Amber Floods | 49 | 157 | 2-7 | +| Blue Screen Green Floods | 50 | 156 | 2-6 | +| Room Pink Floods | 51 | 181 | 2-31 | +| Room Amber Floods | 52 | 180 | 2-30 | +| Room Blue Floods | 53 | 182 | 2-32 | + +### Monitor + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| ------------- | ------------------ | ------------- | ------- | +| Monitor Pink | 54 | 172 | 2-22 | +| Monitor Green | 55 | 174 | 2-24 | +| Monitor Blue | 56 | 173 | 2-23 | +| Monitor Chase | 57 | 171 | 2-21 | + +### Desk + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| ----------- | ------------------ | ------------- | ------- | +| Desk Outer | 58 | 166 | 2-16 | +| Desk Middle | 59 | 165 | 2-15 | +| Desk Inner | 60 | 164 | 2-14 | + +### Special + +| Name | UST Full Stage Bit | RR Engine Bit | DTU Bit | +| -------------------- | ------------------ | ------------- | ------- | +| Clock Neon | 61 | 159 | 2-9 | +| City Lights | 62 | 163 | 2-13 | +| Phone Handset Lights | 63 | 167 | 2-17 | +| Phone Dial Lights | 64 | 168 | 2-18 | +| Gemini | 65 | 176 | 2-26 | +| On Air Sign | 66 | 169 | 2-19 | +| Applause Sign | 67 | 170 | 2-20 | From 7896e1d0a3ab4e8d5e68f6b69f027d7423ed5b1e Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 1 Jun 2025 13:04:15 -0700 Subject: [PATCH 18/22] oops --- Bit Mappings.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Bit Mappings.md b/Bit Mappings.md index 0dccecc..c3571f9 100644 --- a/Bit Mappings.md +++ b/Bit Mappings.md @@ -531,3 +531,5 @@ Hand movement was removed during Concept Unification. | Gemini | 65 | 176 | 2-26 | | On Air Sign | 66 | 169 | 2-19 | | Applause Sign | 67 | 170 | 2-20 | +| Strobe | 68 | 162 | 2-12 | +| Live Floods | 69 | 179 | 2-29 | From 4ec6533971b87acc40d837ad79620ae6290b4006 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 1 Jun 2025 13:23:21 -0700 Subject: [PATCH 19/22] add studio c bit maps to converter --- PC2Converter/PC2Converter/MainForm.cs | 50 +++++++++++++++++---------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/PC2Converter/PC2Converter/MainForm.cs b/PC2Converter/PC2Converter/MainForm.cs index 07f6616..696c2bf 100644 --- a/PC2Converter/PC2Converter/MainForm.cs +++ b/PC2Converter/PC2Converter/MainForm.cs @@ -63,25 +63,7 @@ namespace PC2Converter int[][] SC_StudioCBitMap = { - /* chuck e. */ new int[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 } - }; - - int[] FS_RAE3stBitMap = { - 1, 9, 10, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 18, 19, 14, 15, 16, 20, 36, 37, - 185, 176, 177, 181, 182, 183, 184, 178, 179, 180, 173, 175, 174, 168, 170, 169, 186, 187, 188, - 45, 41, 42, 43, 44, 54, 55, 51, 52, 53, 57, 59, 58, 60, 61, 62, - 166, 151, 152, 153, 156, 157, 158, 161, 162, 163, 164, 154, 155, 159, 160, 165, - 30, 23, 24, 26, 27, 28, 29, 25, 21, 22, 33, 35, 34, 31, 32, 63, 64, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 189, 190, 194, 211, 212, 213, - 167, 191, 192, 193, 171, 172, 48, - 39, 38, 47, 46, 49, 50, - 88, 86, 85, 82, 242, 84, 83, 81, 238, 239, 240, 87, - 93, 94, 91, 92, 89, 90, - 229, 228, 227, 226, 224, 223, 221, 219, 218, 217, 216, 222, - 235, 232, 231, 234, 236, 237, 233, 242, 243, - 67, 68, 69, 66, 71, 72, 73, - 78, 77, 76, 79, 80, - 220, 244, 245, 225, 230, 241 + /* chuck e. */ new int[]{ 21, 28, 25, 24, 26, 27, 29, 30, 31, 18, 19, 23, 22, 20, 6, 7, 11, 8, 9, 10, 1, 2, 17, 3, 4, 5, 12, 16, 15, 13, 14, 32 } }; int[] FS_CyberBitMap = { @@ -114,6 +96,35 @@ namespace PC2Converter 220, 244, 245, 225, 77, 241, 240, 87, 222, 0 }; + int[] FS_RAE3stBitMap = { + 1, 9, 10, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 18, 19, 14, 15, 16, 20, 36, 37, + 185, 176, 177, 181, 182, 183, 184, 178, 179, 180, 173, 175, 174, 168, 170, 169, 186, 187, 188, + 45, 41, 42, 43, 44, 54, 55, 51, 52, 53, 57, 59, 58, 60, 61, 62, + 166, 151, 152, 153, 156, 157, 158, 161, 162, 163, 164, 154, 155, 159, 160, 165, + 30, 23, 24, 26, 27, 28, 29, 25, 21, 22, 33, 35, 34, 31, 32, 63, 64, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 189, 190, 194, 211, 212, 213, + 167, 191, 192, 193, 171, 172, 48, + 39, 38, 47, 46, 49, 50, + 88, 86, 85, 82, 242, 84, 83, 81, 238, 239, 240, 87, + 93, 94, 91, 92, 89, 90, + 229, 228, 227, 226, 224, 223, 221, 219, 218, 217, 216, 222, + 235, 232, 231, 234, 236, 237, 233, 242, 243, + 67, 68, 69, 66, 71, 72, 73, + 78, 77, 76, 79, 80, + 220, 244, 245, 225, 230, 241 + }; + + int[] FS_StudioCBitMap = { + 21, 28, 25, 24, 26, 27, 29, 30, 31, 18, 19, 23, 22, 20, 6, 7, 11, 8, 9, 10, 1, 2, 17, 3, 4, 5, 12, 16, 15, 13, 14, 32, + 33, 36, 34, 35, 40, 160, 161, + 177, 178, + 44, 45, + 151, 154, 152, 153, 155, 157, 156, 181, 180, 182, + 172, 174, 173, 171, + 166, 165, 164, + 159, 163, 167, 168, 176, 169, 170, 162, 179 + }; + int[] CyberRosettaInvertedBits = { 2, 181, 41, 59, 58, 151, 163, 26, 35, 31 }; int[] RAE3stAPSDescrambleTable = { 10, 11, 0, 1, 2, 3, 4, 12, 13, 5, 6, 7, 8, 9, 14, 15}; @@ -489,6 +500,7 @@ namespace PC2Converter break; case "UST 256 Bits (Full Studio C)": bitsCount = 256; + targetBits = FS_StudioCBitMap; break; } From 5d216840dbe845f2f3c3b1c579c7b5e6720b216a Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 1 Jun 2025 13:55:57 -0700 Subject: [PATCH 20/22] discontinue single character file format --- Bit Mappings.md | 28 +- Future Goals.md | 7 +- .../PC2Player.Gtk/PC2Player.Gtk.csproj | 0 .../PC2Player.Old}/PC2Player.Gtk/Program.cs | 0 .../PC2Player.Old/PC2Player.Mac}/Icon.icns | Bin .../PC2Player.Old}/PC2Player.Mac/Info.plist | 0 .../PC2Player.Mac/PC2Player.Mac.csproj | 0 .../PC2Player.Old}/PC2Player.Mac/Program.cs | 0 .../PC2Player.Wpf/PC2Player.Wpf.csproj | 0 .../PC2Player.Old}/PC2Player.Wpf/Program.cs | 0 .../PC2Player.Old}/PC2Player/MainForm.cs | 0 .../PC2Player.Old}/PC2Player/PC2Player.csproj | 0 .../USTConverter.Gtk}/Program.cs | 2 +- .../USTConverter.Gtk/USTConverter.Gtk.csproj | 2 +- .../USTConverter.Mac}/Icon.icns | Bin .../USTConverter.Mac}/Info.plist | 6 +- .../USTConverter.Mac}/Program.cs | 2 +- .../USTConverter.Mac/USTConverter.Mac.csproj | 2 +- .../USTConverter.Wpf}/Program.cs | 2 +- .../USTConverter.Wpf/USTConverter.Wpf.csproj | 2 +- .../USTConverter}/MainForm.cs | 246 +++--------------- .../USTConverter}/RSHWFile.cs | 1 - .../USTConverter/USTConverter.csproj | 0 23 files changed, 56 insertions(+), 244 deletions(-) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Gtk/PC2Player.Gtk.csproj (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Gtk/Program.cs (100%) rename {PC2Converter/PC2Converter.Mac => Legacy Tools/PC2Player.Old/PC2Player.Mac}/Icon.icns (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Mac/Info.plist (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Mac/PC2Player.Mac.csproj (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Mac/Program.cs (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Wpf/PC2Player.Wpf.csproj (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player.Wpf/Program.cs (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player/MainForm.cs (100%) rename {PC2Player => Legacy Tools/PC2Player.Old}/PC2Player/PC2Player.csproj (100%) rename {PC2Converter/PC2Converter.Gtk => USTConverter/USTConverter.Gtk}/Program.cs (81%) rename PC2Converter/PC2Converter.Gtk/PC2Converter.Gtk.csproj => USTConverter/USTConverter.Gtk/USTConverter.Gtk.csproj (83%) rename {PC2Player/PC2Player.Mac => USTConverter/USTConverter.Mac}/Icon.icns (100%) rename {PC2Converter/PC2Converter.Mac => USTConverter/USTConverter.Mac}/Info.plist (81%) rename {PC2Converter/PC2Converter.Mac => USTConverter/USTConverter.Mac}/Program.cs (81%) rename PC2Converter/PC2Converter.Mac/PC2Converter.Mac.csproj => USTConverter/USTConverter.Mac/USTConverter.Mac.csproj (84%) rename {PC2Converter/PC2Converter.Wpf => USTConverter/USTConverter.Wpf}/Program.cs (81%) rename PC2Converter/PC2Converter.Wpf/PC2Converter.Wpf.csproj => USTConverter/USTConverter.Wpf/USTConverter.Wpf.csproj (83%) rename {PC2Converter/PC2Converter => USTConverter/USTConverter}/MainForm.cs (53%) rename {PC2Converter/PC2Converter => USTConverter/USTConverter}/RSHWFile.cs (97%) rename PC2Converter/PC2Converter/PC2Converter.csproj => USTConverter/USTConverter/USTConverter.csproj (100%) diff --git a/Bit Mappings.md b/Bit Mappings.md index c3571f9..d1a1a4a 100644 --- a/Bit Mappings.md +++ b/Bit Mappings.md @@ -1,4 +1,4 @@ -# PINKCONNECTION2 Bit Mappings +# UST Bit Mappings This information was sourced from Cheese-E-Pedia, the Showbiz Pizza Cyberstar Install Manual, and the Chuck E. Cheese 2-Stage Install Manual. @@ -6,7 +6,7 @@ This information was sourced from Cheese-E-Pedia, the Showbiz Pizza Cyberstar In ### Rolfe Dewolfe & Earl Schmerle/Chuck E. Cheese -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | ------------ | ------------ | | Mouth | 1 | 1 | 1 | 1-1 | TB1 1-2 H1 | No | | Left Ear | 2 | 2 | 9 | 1-9 | | | @@ -35,7 +35,7 @@ Earl's movements were removed during Concept Unification. ### Mitzi Mozzarella/Helen Henny -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | ------------ | ------------ | | Mouth | 1 | 23 | 185 | 2-35 | TB1 1-2 H5 | No | | Left Ear | 2 | 24 | 176 | 2-26 | | | @@ -61,7 +61,7 @@ No movements were removed during Concept Unification. ### Fatz Geronimo/Mr. Munch -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | ------------ | ------------ | | Mouth | 1 | 42 | 45 | 1-45 | TB1 1-2 H4 | No | | Left Eyelid | 2 | 43 | 41 | 1-41 | TB1 11-12 H4 | Yes | @@ -84,7 +84,7 @@ No movements were removed during Concept Unification. ### Beach Bear/Jasper T. Jowls -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | ------------------------- | ------------ | | Mouth | 1 | 58 | 166 | 2-16 | TB1 1-2 H2 | No | | Left Eyelid | 2 | 59 | 151 | 2-1 | TB1 11-12 H2 | Yes | @@ -107,7 +107,7 @@ No movements were removed during Concept Unification. ### Dook Larue/Pasqually -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | R12 Bit | R12 Inverted | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | ------------ | ------------ | | Mouth | 1 | 74 | 30 | 1-30 | TB1 1-2 H3 | No | | Left Ear | 2 | 75 | 23 | 1-23 | | | @@ -131,7 +131,7 @@ Ear movements and Kick Drum were removed during Concept Unification. ### Billy Bob -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | | Mouth | 1 | 91 | 196 | 2-46 | | Left Eyelid | 2 | 92 | 197 | 2-47 | @@ -158,7 +158,7 @@ Entire bot was removed during Concept Unification. ### Looney Bird/Pizzacam -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | Greybox Bit | | --------------- | ------------------------ | ------------------ | ------------- | ----------- | | Mouth | 1 | 111 | 167 | 2-17 | | Left Eyelid | 2 | 112 | 191 | 2-41 | @@ -277,7 +277,7 @@ Hand movement was removed during Concept Unification. ### Chuck E. Cheese -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Movement Name | Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------- | ------------------------ | ------------------ | ------------- | ------------ | | Mouth | 1 | 1 | 1 | TB1 1-2 H1 | | Head Left | 2 | 2 | 2 | TB1 3-4 H1 | @@ -290,7 +290,7 @@ Hand movement was removed during Concept Unification. ### Helen Henny/Guest Star -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------- | ------------------------ | ------------------ | ------------- | ------------ | | Mouth | 1 | 9 | 65 | TB1 1-2 H5 | | Head Left | 2 | 10 | 66 | TB1 3-4 H5 | @@ -303,7 +303,7 @@ Hand movement was removed during Concept Unification. ### Mr. Munch -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------- | ------------------------ | ------------------ | ------------- | ------------ | | Mouth | 1 | 17 | 49 | TB1 1-2 H4 | | Head Left | 2 | 18 | 50 | TB1 3-4 H4 | @@ -316,7 +316,7 @@ Hand movement was removed during Concept Unification. ### Jasper T. Jowls -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------- | ------------------------ | ------------------ | ------------- | ------------ | | Mouth | 1 | 25 | 17 | TB1 1-2 H2 | | Head Left | 2 | 26 | 18 | TB1 3-4 H2 | @@ -329,7 +329,7 @@ Hand movement was removed during Concept Unification. ### Pasqually -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | CCS Bit | | ------------- | ------------------------ | ------------------ | ------------- | ------------ | | Mouth | 1 | 33 | 33 | TB1 1-2 H3 | | Head Left | 2 | 34 | 34 | TB1 3-4 H3 | @@ -427,7 +427,7 @@ Hand movement was removed during Concept Unification. ### Chuck E. -| Movement Name | UST Single Character Bit | UST Full Stage Bit | RR Engine Bit | DTU Bit | 16M | +| Movement Name | UST Character Bit | UST Full Stage Bit | RR Engine Bit | DTU Bit | 16M | | ----------------- | ------------------------ | ------------------ | ------------- | ------- | --- | | Mouth | 1 | 1 | 21 | 1-21 | Yes | | Nose | 2 | 2 | 28 | 1-28 | No | diff --git a/Future Goals.md b/Future Goals.md index 30f46c1..de584cb 100644 --- a/Future Goals.md +++ b/Future Goals.md @@ -1,18 +1,15 @@ # Future Goals -## PC2Converter +## USTConverter - .SHW (ProgramBlue) input format - .3ST/.R12/.C&R (APS) input format - Biphase (Pianocorder and Cyberstar) from tape input format - Studio C from Floppy Disk input format - - UST Full Stage to Single Character Stripper ## PC2Player - - ~~make the program~~ done!! - - fix memory leak issue - - make audio player work on windows + - burn the damn thing to the ground and start over ## Firmwares diff --git a/PC2Player/PC2Player.Gtk/PC2Player.Gtk.csproj b/Legacy Tools/PC2Player.Old/PC2Player.Gtk/PC2Player.Gtk.csproj similarity index 100% rename from PC2Player/PC2Player.Gtk/PC2Player.Gtk.csproj rename to Legacy Tools/PC2Player.Old/PC2Player.Gtk/PC2Player.Gtk.csproj diff --git a/PC2Player/PC2Player.Gtk/Program.cs b/Legacy Tools/PC2Player.Old/PC2Player.Gtk/Program.cs similarity index 100% rename from PC2Player/PC2Player.Gtk/Program.cs rename to Legacy Tools/PC2Player.Old/PC2Player.Gtk/Program.cs diff --git a/PC2Converter/PC2Converter.Mac/Icon.icns b/Legacy Tools/PC2Player.Old/PC2Player.Mac/Icon.icns similarity index 100% rename from PC2Converter/PC2Converter.Mac/Icon.icns rename to Legacy Tools/PC2Player.Old/PC2Player.Mac/Icon.icns diff --git a/PC2Player/PC2Player.Mac/Info.plist b/Legacy Tools/PC2Player.Old/PC2Player.Mac/Info.plist similarity index 100% rename from PC2Player/PC2Player.Mac/Info.plist rename to Legacy Tools/PC2Player.Old/PC2Player.Mac/Info.plist diff --git a/PC2Player/PC2Player.Mac/PC2Player.Mac.csproj b/Legacy Tools/PC2Player.Old/PC2Player.Mac/PC2Player.Mac.csproj similarity index 100% rename from PC2Player/PC2Player.Mac/PC2Player.Mac.csproj rename to Legacy Tools/PC2Player.Old/PC2Player.Mac/PC2Player.Mac.csproj diff --git a/PC2Player/PC2Player.Mac/Program.cs b/Legacy Tools/PC2Player.Old/PC2Player.Mac/Program.cs similarity index 100% rename from PC2Player/PC2Player.Mac/Program.cs rename to Legacy Tools/PC2Player.Old/PC2Player.Mac/Program.cs diff --git a/PC2Player/PC2Player.Wpf/PC2Player.Wpf.csproj b/Legacy Tools/PC2Player.Old/PC2Player.Wpf/PC2Player.Wpf.csproj similarity index 100% rename from PC2Player/PC2Player.Wpf/PC2Player.Wpf.csproj rename to Legacy Tools/PC2Player.Old/PC2Player.Wpf/PC2Player.Wpf.csproj diff --git a/PC2Player/PC2Player.Wpf/Program.cs b/Legacy Tools/PC2Player.Old/PC2Player.Wpf/Program.cs similarity index 100% rename from PC2Player/PC2Player.Wpf/Program.cs rename to Legacy Tools/PC2Player.Old/PC2Player.Wpf/Program.cs diff --git a/PC2Player/PC2Player/MainForm.cs b/Legacy Tools/PC2Player.Old/PC2Player/MainForm.cs similarity index 100% rename from PC2Player/PC2Player/MainForm.cs rename to Legacy Tools/PC2Player.Old/PC2Player/MainForm.cs diff --git a/PC2Player/PC2Player/PC2Player.csproj b/Legacy Tools/PC2Player.Old/PC2Player/PC2Player.csproj similarity index 100% rename from PC2Player/PC2Player/PC2Player.csproj rename to Legacy Tools/PC2Player.Old/PC2Player/PC2Player.csproj diff --git a/PC2Converter/PC2Converter.Gtk/Program.cs b/USTConverter/USTConverter.Gtk/Program.cs similarity index 81% rename from PC2Converter/PC2Converter.Gtk/Program.cs rename to USTConverter/USTConverter.Gtk/Program.cs index 3297df7..1d1b0b0 100644 --- a/PC2Converter/PC2Converter.Gtk/Program.cs +++ b/USTConverter/USTConverter.Gtk/Program.cs @@ -1,7 +1,7 @@ using System; using Eto.Forms; -namespace PC2Converter.Gtk +namespace USTConverter.Gtk { class Program { diff --git a/PC2Converter/PC2Converter.Gtk/PC2Converter.Gtk.csproj b/USTConverter/USTConverter.Gtk/USTConverter.Gtk.csproj similarity index 83% rename from PC2Converter/PC2Converter.Gtk/PC2Converter.Gtk.csproj rename to USTConverter/USTConverter.Gtk/USTConverter.Gtk.csproj index 7e86dbd..3832d00 100644 --- a/PC2Converter/PC2Converter.Gtk/PC2Converter.Gtk.csproj +++ b/USTConverter/USTConverter.Gtk/USTConverter.Gtk.csproj @@ -7,7 +7,7 @@ - + diff --git a/PC2Player/PC2Player.Mac/Icon.icns b/USTConverter/USTConverter.Mac/Icon.icns similarity index 100% rename from PC2Player/PC2Player.Mac/Icon.icns rename to USTConverter/USTConverter.Mac/Icon.icns diff --git a/PC2Converter/PC2Converter.Mac/Info.plist b/USTConverter/USTConverter.Mac/Info.plist similarity index 81% rename from PC2Converter/PC2Converter.Mac/Info.plist rename to USTConverter/USTConverter.Mac/Info.plist index 6157797..667bce4 100644 --- a/PC2Converter/PC2Converter.Mac/Info.plist +++ b/USTConverter/USTConverter.Mac/Info.plist @@ -3,11 +3,11 @@ CFBundleName - PC2Converter + USTConverter CFBundleIdentifier - com.example.PC2Converter + me.kawaiizenbo.USTConverter CFBundleShortVersionString - 1.0 + 1.3 LSMinimumSystemVersion 10.15 CFBundleDevelopmentRegion diff --git a/PC2Converter/PC2Converter.Mac/Program.cs b/USTConverter/USTConverter.Mac/Program.cs similarity index 81% rename from PC2Converter/PC2Converter.Mac/Program.cs rename to USTConverter/USTConverter.Mac/Program.cs index 973dc3d..089435e 100644 --- a/PC2Converter/PC2Converter.Mac/Program.cs +++ b/USTConverter/USTConverter.Mac/Program.cs @@ -1,7 +1,7 @@ using System; using Eto.Forms; -namespace PC2Converter.Mac +namespace USTConverter.Mac { class Program { diff --git a/PC2Converter/PC2Converter.Mac/PC2Converter.Mac.csproj b/USTConverter/USTConverter.Mac/USTConverter.Mac.csproj similarity index 84% rename from PC2Converter/PC2Converter.Mac/PC2Converter.Mac.csproj rename to USTConverter/USTConverter.Mac/USTConverter.Mac.csproj index 437ecec..2f87570 100644 --- a/PC2Converter/PC2Converter.Mac/PC2Converter.Mac.csproj +++ b/USTConverter/USTConverter.Mac/USTConverter.Mac.csproj @@ -8,7 +8,7 @@ - + diff --git a/PC2Converter/PC2Converter.Wpf/Program.cs b/USTConverter/USTConverter.Wpf/Program.cs similarity index 81% rename from PC2Converter/PC2Converter.Wpf/Program.cs rename to USTConverter/USTConverter.Wpf/Program.cs index 8a370b0..df54590 100644 --- a/PC2Converter/PC2Converter.Wpf/Program.cs +++ b/USTConverter/USTConverter.Wpf/Program.cs @@ -1,7 +1,7 @@ using System; using Eto.Forms; -namespace PC2Converter.Wpf +namespace USTConverter.Wpf { class Program { diff --git a/PC2Converter/PC2Converter.Wpf/PC2Converter.Wpf.csproj b/USTConverter/USTConverter.Wpf/USTConverter.Wpf.csproj similarity index 83% rename from PC2Converter/PC2Converter.Wpf/PC2Converter.Wpf.csproj rename to USTConverter/USTConverter.Wpf/USTConverter.Wpf.csproj index 32ab58c..89efd4b 100644 --- a/PC2Converter/PC2Converter.Wpf/PC2Converter.Wpf.csproj +++ b/USTConverter/USTConverter.Wpf/USTConverter.Wpf.csproj @@ -7,7 +7,7 @@ - + diff --git a/PC2Converter/PC2Converter/MainForm.cs b/USTConverter/USTConverter/MainForm.cs similarity index 53% rename from PC2Converter/PC2Converter/MainForm.cs rename to USTConverter/USTConverter/MainForm.cs index 696c2bf..9ef6e9e 100644 --- a/PC2Converter/PC2Converter/MainForm.cs +++ b/USTConverter/USTConverter/MainForm.cs @@ -1,19 +1,17 @@ -using System; using System.Collections; using System.Diagnostics; -using System.Numerics; using System.IO; +using System.Numerics; using Eto.Forms; using Eto.Drawing; -namespace PC2Converter +namespace USTConverter { public partial class MainForm : Form { DropDown InputTypeSelector = new DropDown(); DropDown OutputTypeSelector = new DropDown(); - DropDown CharacterSelector = new DropDown(); TextBox FilePathTextBox = new TextBox(); Button BrowseFileButton = new Button { Text = "Browse", Width = 100 }; Button ConvertButton = new Button { Text = "Convert", Width = 100 }; @@ -24,49 +22,12 @@ namespace PC2Converter "3ST File (APS)", "ROA/R12/C&R File (APS)"*/ }; - string[] RAE3stOutputTypes = { "UST 32 Bits (Single Bot RAE/3st)", "UST 8 Bits (Single Bot Cybers Rosetta)", "UST 256 Bits (Full RAE/3st)" , "UST 256 Bits (Full Cybers Rosetta)" }; - string[] CyberOutputTypes = { "UST 8 Bits (Single Bot Cybers)", "UST 256 Bits (Full Cybers)" }; - string[] StudioCOutputTypes = { "UST 32 Bits (Single Bot Studio C)", "UST 256 Bits (Full Studio C)" }; + string[] RAE3stOutputTypes = { "UST (Rock-afire Explosion/3-Stage)" , "UST (Cyberamics Rosetta)" }; + string[] CyberOutputTypes = { "UST (Cyberamics)" }; + string[] StudioCOutputTypes = { "UST (Studio C)" }; - string[] RAE3stCharacters = { "Rolfe/Chuck E.", "Mitzi/Helen", "Fatz/Munch", "Beach Bear/Jasper", "Dook/Pasqually", "Billy Bob", "Looney Bird/PizzaCam"}; - string[] CyberCharacters = { "Chuck E.", "Helen/Guest Star", "Munch", "Jasper", "Pasqually" }; - string[] StudioCCharacters = { "Chuck E." }; - int[][] SC_CyberBitMap = - { - /* chuck */ new int[]{ 1, 2, 3, 4, 8, 5, 6, 7 }, - /* helen */ new int[]{ 65, 66, 67, 68, 72, 69, 70, 71 }, - /* munch */ new int[]{ 49, 50, 51, 56, 53, 54, 55, 52 }, - /* jasper */ new int[]{ 17, 18, 19, 20, 24, 21, 22, 23 }, - /* pasqually */ new int[]{ 33, 34, 35, 40, 37, 38, 39, 36 } - }; - - int[][] SC_CyberBitMapRosetta = - { - /* chuck */ new int[]{ 1, 6, 7, 8, 4, 5, 2, 19 }, - /* helen */ new int[]{ 185, 178, 179, 180, 183, 184, 181, 169 }, - /* munch */ new int[]{ 45, 54, 55, 43, 44, 41, 58, 59 }, - /* jasper */ new int[]{ 166, 156, 157, 158, 156, 157, 151, 163 }, - /* pasqually */ new int[]{ 30, 25, 21, 28, 29, 26, 31, 35 } - }; - - int[][] SC_RAE3stBitMap = - { - /* rolfe/chuck */ new int[]{ 1, 9, 10, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 18, 19, 14, 15, 16, 20, 36, 37 }, - /* mitzi/helen */ new int[]{ 185, 176, 177, 181, 182, 183, 184, 178, 179, 180, 173, 175, 174, 168, 170, 169, 186, 187, 188 }, - /* fatz/munch */ new int[]{ 45, 41, 42, 43, 44, 54, 55, 51, 52, 53, 57, 59, 58, 60, 61, 62 }, - /* beach bear/jasper */ new int[]{ 166, 151, 152, 153, 156, 157, 158, 161, 162, 163, 164, 154, 155, 159, 160, 165 }, - /* dook/pasqually */ new int[]{ 30, 23, 24, 26, 27, 28, 29, 25, 21, 22, 33, 35, 34, 31, 32, 63, 64 }, - /* billy bob */ new int[]{ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 189, 190, 194, 211, 212, 213 }, - /* looney/pizzacam */ new int[]{ 167, 191, 192, 193, 171, 172, 48 } - }; - - int[][] SC_StudioCBitMap = - { - /* chuck e. */ new int[]{ 21, 28, 25, 24, 26, 27, 29, 30, 31, 18, 19, 23, 22, 20, 6, 7, 11, 8, 9, 10, 1, 2, 17, 3, 4, 5, 12, 16, 15, 13, 14, 32 } - }; - - int[] FS_CyberBitMap = { + int[] CyberBitMap = { 1, 2, 3, 4, 8, 5, 6, 7, 65, 66, 67, 68, 72, 69, 70, 71, 49, 50, 51, 56, 53, 54, 55, 52, @@ -81,7 +42,7 @@ namespace PC2Converter 103, 105, 125, 121, 126, 99, 124, 122, 97, 98 }; - int[] FS_CyberBitMapRosetta = { + int[] CyberBitMapRosetta = { 1, 6, 7, 8, 4, 5, 2, 19, 185, 178, 179, 180, 183, 184, 181, 169, 45, 54, 55, 43, 44, 41, 58, 59, @@ -96,7 +57,7 @@ namespace PC2Converter 220, 244, 245, 225, 77, 241, 240, 87, 222, 0 }; - int[] FS_RAE3stBitMap = { + int[] RAE3stBitMap = { 1, 9, 10, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 18, 19, 14, 15, 16, 20, 36, 37, 185, 176, 177, 181, 182, 183, 184, 178, 179, 180, 173, 175, 174, 168, 170, 169, 186, 187, 188, 45, 41, 42, 43, 44, 54, 55, 51, 52, 53, 57, 59, 58, 60, 61, 62, @@ -114,7 +75,7 @@ namespace PC2Converter 220, 244, 245, 225, 230, 241 }; - int[] FS_StudioCBitMap = { + int[] StudioCBitMap = { 21, 28, 25, 24, 26, 27, 29, 30, 31, 18, 19, 23, 22, 20, 6, 7, 11, 8, 9, 10, 1, 2, 17, 3, 4, 5, 12, 16, 15, 13, 14, 32, 33, 36, 34, 35, 40, 160, 161, 177, 178, @@ -130,12 +91,12 @@ namespace PC2Converter bool FullStage = false; bool Rosetta = false; - const int USTVersion = 1; + const int USTVersion = 2; public MainForm() { - Title = "PinkConnection2 Showtape Converter"; - Size = new Size(512, 384); + Title = "UST Showtape Converter"; + Size = new Size(500, 300); Maximizable = false; Resizable = false; @@ -143,7 +104,6 @@ namespace PC2Converter ConvertButton.Command = new Command((sender, e) => { Event_ConvertFileButton(); }); InputTypeSelector.SelectedValueChanged += (sender, e) => Event_ChangeInputType(); - OutputTypeSelector.SelectedValueChanged += (sender, e) => Event_ChangeOutputType(); foreach (string s in InputTypes) { @@ -173,14 +133,6 @@ namespace PC2Converter layout.BeginHorizontal(); layout.Add(OutputTypeSelector, true); layout.EndHorizontal(); - - layout.BeginHorizontal(); - layout.Add(new Label { Text = "Character" }); - layout.EndHorizontal(); - - layout.BeginHorizontal(); - layout.Add(CharacterSelector, true); - layout.EndHorizontal(); layout.EndVertical(); layout.BeginVertical(); @@ -209,51 +161,24 @@ namespace PC2Converter return layout; } - string MakeHeader(string showName, string outputType, string character) + string MakeHeader(string showName, string outputType) { string headerOut = $"UST,{USTVersion.ToString()},{showName.Replace(",", "_").Replace(";", "_")},"; - bool fullStage = false; switch (outputType) { - case "UST 32 Bits (Single Bot RAE/3st)": - headerOut += "32,"; - headerOut += "Rockafire Explosion/3-Stage (Single Character),"; + case "UST (Rock-afire Explosion/3-Stage)": + headerOut += "Rockafire Explosion/3-Stage;"; break; - case "UST 8 Bits (Single Bot Cybers Rosetta)": - headerOut += "8,"; - headerOut += "Cyberamics (Single Character),"; + case "UST (Cyberamics Rosetta)": + headerOut += "Cyberamics;"; break; - case "UST 256 Bits (Full RAE/3st)": - headerOut += "256,"; - headerOut += "Rockafire Explosion/3-Stage (Full Stage),"; - fullStage = true; + case "UST (Cyberamics)": + headerOut += "Cyberamics;"; break; - case "UST 256 Bits (Full Cybers Rosetta)": - headerOut += "256,"; - headerOut += "Cyberamics (Full Stage),"; - fullStage = true; - break; - case "UST 8 Bits (Single Bot Cybers)": - headerOut += "8,"; - headerOut += "Cyberamics (Single Character),"; - break; - case "UST 256 Bits (Full Cybers)": - headerOut += "256,"; - headerOut += "Cyberamics (Full Stage),"; - fullStage = true; - break; - case "UST 32 Bits (Single Bot Studio C)": - headerOut += "32,"; - headerOut += "Studio C (Single Character),"; - break; - case "UST 256 Bits (Full Studio C)": - headerOut += "256,"; - headerOut += "Studio C (Full Stage),"; - fullStage = true; + case "UST (Studio C)": + headerOut += "Studio C;"; break; } - if (fullStage) headerOut += "All,"; - else headerOut += character + ";"; return headerOut; } @@ -263,7 +188,6 @@ namespace PC2Converter { case 0: OutputTypeSelector.Items.Clear(); - CharacterSelector.Items.Clear(); foreach (string s in RAE3stOutputTypes) { OutputTypeSelector.Items.Add(s); @@ -271,7 +195,6 @@ namespace PC2Converter break; case 1: OutputTypeSelector.Items.Clear(); - CharacterSelector.Items.Clear(); foreach (string s in CyberOutputTypes) { OutputTypeSelector.Items.Add(s); @@ -279,7 +202,6 @@ namespace PC2Converter break; case 2: OutputTypeSelector.Items.Clear(); - CharacterSelector.Items.Clear(); foreach (string s in StudioCOutputTypes) { OutputTypeSelector.Items.Add(s); @@ -288,92 +210,6 @@ namespace PC2Converter } } - void Event_ChangeOutputType() - { - switch(InputTypeSelector.SelectedIndex) - { - case 0: - switch(OutputTypeSelector.SelectedIndex) - { - case 0: - CharacterSelector.Items.Clear(); - foreach (string s in RAE3stCharacters) - { - CharacterSelector.Items.Add(s); - } - CharacterSelector.Enabled = true; - Rosetta = false; - FullStage = false; - break; - case 1: - CharacterSelector.Items.Clear(); - foreach (string s in CyberCharacters) - { - CharacterSelector.Items.Add(s); - } - CharacterSelector.Enabled = true; - Rosetta = true; - FullStage = false; - break; - case 2: - CharacterSelector.Items.Clear(); - CharacterSelector.Enabled = false; - Rosetta = false; - FullStage = true; - break; - case 3: - CharacterSelector.Items.Clear(); - CharacterSelector.Enabled = false; - Rosetta = true; - FullStage = true; - break; - } - break; - case 1: - switch(OutputTypeSelector.SelectedIndex) - { - case 0: - CharacterSelector.Items.Clear(); - foreach (string s in CyberCharacters) - { - CharacterSelector.Items.Add(s); - } - CharacterSelector.Enabled = true; - Rosetta = false; - FullStage = false; - break; - case 1: - CharacterSelector.Items.Clear(); - CharacterSelector.Enabled = false; - Rosetta = false; - FullStage = true; - break; - } - break; - case 2: - switch(OutputTypeSelector.SelectedIndex) - { - case 0: - CharacterSelector.Items.Clear(); - foreach (string s in StudioCCharacters) - { - CharacterSelector.Items.Add(s); - } - CharacterSelector.Enabled = true; - Rosetta = false; - FullStage = false; - break; - case 1: - CharacterSelector.Items.Clear(); - CharacterSelector.Enabled = false; - Rosetta = false; - FullStage = true; - break; - } - break; - } - } - void Event_BrowseFileButton() { OpenFileDialog fileDialog = new OpenFileDialog(); @@ -399,11 +235,6 @@ namespace PC2Converter MessageBox.Show("Fatal: You must select an output type."); return; } - if (CharacterSelector.SelectedIndex == -1 && !FullStage) - { - MessageBox.Show("Fatal: You must select a character."); - return; - } if (FilePathTextBox.Text.Trim() == "") { MessageBox.Show("Fatal: You must select an input file."); @@ -470,37 +301,22 @@ namespace PC2Converter int[] targetBits = { 0 }; switch (outputType) { - case "UST 32 Bits (Single Bot RAE/3st)": - bitsCount = 32; - targetBits = SC_RAE3stBitMap[Array.IndexOf(RAE3stCharacters, CharacterSelector.SelectedKey)]; - break; - case "UST 8 Bits (Single Bot Cybers Rosetta)": - bitsCount = 8; - targetBits = SC_CyberBitMapRosetta[Array.IndexOf(CyberCharacters, CharacterSelector.SelectedKey)]; - break; - case "UST 256 Bits (Full RAE/3st)": + case "UST (Rock-afire Explosion/3-Stage)": bitsCount = 256; - targetBits = FS_RAE3stBitMap; + targetBits = RAE3stBitMap; break; - case "UST 256 Bits (Full Cybers Rosetta)": + case "UST (Cyberamics Rosetta)": bitsCount = 256; - targetBits = FS_CyberBitMapRosetta; + targetBits = CyberBitMapRosetta; + Rosetta = true; break; - case "UST 8 Bits (Single Bot Cybers)": - bitsCount = 8; - targetBits = SC_CyberBitMap[Array.IndexOf(CyberCharacters, CharacterSelector.SelectedKey)]; - break; - case "UST 256 Bits (Full Cybers)": + case "UST (Cyberamics)": bitsCount = 256; - targetBits = FS_CyberBitMap; + targetBits = CyberBitMap; break; - case "UST 32 Bits (Single Bot Studio C)": - bitsCount = 32; - targetBits = SC_StudioCBitMap[Array.IndexOf(StudioCCharacters, CharacterSelector.SelectedKey)]; - break; - case "UST 256 Bits (Full Studio C)": + case "UST (Studio C)": bitsCount = 256; - targetBits = FS_StudioCBitMap; + targetBits = StudioCBitMap; break; } @@ -535,7 +351,7 @@ namespace PC2Converter File.Delete("tmp.mp3"); } - File.WriteAllText(outFilePath, MakeHeader(Path.GetFileNameWithoutExtension(outFilePath), outputType, CharacterSelector.SelectedKey)+String.Join(",", writeOut.ToArray())+";"+Convert.ToBase64String(audioOut)); + File.WriteAllText(outFilePath, MakeHeader(Path.GetFileNameWithoutExtension(outFilePath), outputType)+String.Join(",", writeOut.ToArray())+";"+Convert.ToBase64String(audioOut)); } MessageBox.Show("Conversion complete!"); } diff --git a/PC2Converter/PC2Converter/RSHWFile.cs b/USTConverter/USTConverter/RSHWFile.cs similarity index 97% rename from PC2Converter/PC2Converter/RSHWFile.cs rename to USTConverter/USTConverter/RSHWFile.cs index d155ddf..8e09a5f 100644 --- a/PC2Converter/PC2Converter/RSHWFile.cs +++ b/USTConverter/USTConverter/RSHWFile.cs @@ -1,4 +1,3 @@ -using System.IO; using System.Reflection; using System.Runtime.Serialization.Formatters.Binary; diff --git a/PC2Converter/PC2Converter/PC2Converter.csproj b/USTConverter/USTConverter/USTConverter.csproj similarity index 100% rename from PC2Converter/PC2Converter/PC2Converter.csproj rename to USTConverter/USTConverter/USTConverter.csproj From d44ae827573e6c8e0d748ce226457420f5a4754c Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 1 Jun 2025 14:00:22 -0700 Subject: [PATCH 21/22] further clean up stuff --- USTConverter/USTConverter/MainForm.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/USTConverter/USTConverter/MainForm.cs b/USTConverter/USTConverter/MainForm.cs index 9ef6e9e..bc73a1b 100644 --- a/USTConverter/USTConverter/MainForm.cs +++ b/USTConverter/USTConverter/MainForm.cs @@ -89,7 +89,6 @@ namespace USTConverter int[] CyberRosettaInvertedBits = { 2, 181, 41, 59, 58, 151, 163, 26, 35, 31 }; int[] RAE3stAPSDescrambleTable = { 10, 11, 0, 1, 2, 3, 4, 12, 13, 5, 6, 7, 8, 9, 14, 15}; - bool FullStage = false; bool Rosetta = false; const int USTVersion = 2; @@ -248,7 +247,7 @@ namespace USTConverter SaveFileDialog fileDialog = new SaveFileDialog(); fileDialog.Filters.Add(new FileFilter("UST Files (.ust)", new string[]{".ust"})); - fileDialog.Title = "Select Show File."; + fileDialog.Title = "Select Output File."; fileDialog.ShowDialog(this); if (fileDialog.FileName.Trim() == "") return; string outFilePath = fileDialog.FileName; @@ -297,25 +296,20 @@ namespace USTConverter } // pick which target bits to use and how many bytes the output should be - int bitsCount = 0; int[] targetBits = { 0 }; switch (outputType) { case "UST (Rock-afire Explosion/3-Stage)": - bitsCount = 256; targetBits = RAE3stBitMap; break; case "UST (Cyberamics Rosetta)": - bitsCount = 256; targetBits = CyberBitMapRosetta; Rosetta = true; break; case "UST (Cyberamics)": - bitsCount = 256; targetBits = CyberBitMap; break; case "UST (Studio C)": - bitsCount = 256; targetBits = StudioCBitMap; break; } @@ -332,9 +326,9 @@ namespace USTConverter } else { if (bits.Get(targetBits[i])) frameByte += BigInteger.Pow(2, i); } } - writeOut.Add(frameByte.ToString($"X{(bitsCount/4).ToString()}")); + writeOut.Add(frameByte.ToString($"X{(64).ToString()}")); } - writeOut[0] = (0).ToString($"X{(bitsCount/4).ToString()}"); + writeOut[0] = (0).ToString($"X{(64).ToString()}"); byte[] audioOut = file.audioData; if ((bool)CompressAudioCheckBox.Checked) From b9fd99de54fd638ec517bde04be6062a9c11c903 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 1 Jun 2025 14:10:28 -0700 Subject: [PATCH 22/22] Update MainForm.cs --- USTConverter/USTConverter/MainForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USTConverter/USTConverter/MainForm.cs b/USTConverter/USTConverter/MainForm.cs index bc73a1b..66a1bd5 100644 --- a/USTConverter/USTConverter/MainForm.cs +++ b/USTConverter/USTConverter/MainForm.cs @@ -15,7 +15,7 @@ namespace USTConverter TextBox FilePathTextBox = new TextBox(); Button BrowseFileButton = new Button { Text = "Browse", Width = 100 }; Button ConvertButton = new Button { Text = "Convert", Width = 100 }; - CheckBox CompressAudioCheckBox = new CheckBox { Text = "Compress Audio", Width = 100 }; + CheckBox CompressAudioCheckBox = new CheckBox { Text = "Compress Audio" }; string[] InputTypes = { "RSHW File (RR Engine)", "CSHW File (RR Engine)", "SSHW File (RR Engine)"/*,