Skip to content
This repository was archived by the owner on Jun 13, 2026. It is now read-only.

Commit 366da20

Browse files
committed
New utilities and fixes [v4.0.0]
New utilities and some fixes
1 parent b3551c4 commit 366da20

14 files changed

Lines changed: 1691 additions & 390 deletions
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Imports System.ComponentModel
2+
3+
Public Class ComboBoxHDDDrive
4+
5+
Implements INotifyPropertyChanged
6+
7+
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
8+
9+
Public Sub NotifyPropertyChanged(propName As String)
10+
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
11+
End Sub
12+
13+
Private _DevicePath As String
14+
Private _DeviceSize As ULong
15+
Private _DeviceInterfaceType As String
16+
Private _DeviceMediaType As String
17+
Private _DeviceCaption As String
18+
Private _ComboBoxDisplayText As String
19+
20+
Public Property DevicePath As String
21+
Get
22+
Return _DevicePath
23+
End Get
24+
Set
25+
_DevicePath = Value
26+
NotifyPropertyChanged("DevicePath")
27+
End Set
28+
End Property
29+
30+
Public Property DeviceSize As ULong
31+
Get
32+
Return _DeviceSize
33+
End Get
34+
Set
35+
_DeviceSize = Value
36+
NotifyPropertyChanged("DeviceSize")
37+
End Set
38+
End Property
39+
40+
Public Property DeviceInterfaceType As String
41+
Get
42+
Return _DeviceInterfaceType
43+
End Get
44+
Set
45+
_DeviceInterfaceType = Value
46+
NotifyPropertyChanged("DeviceInterfaceType")
47+
End Set
48+
End Property
49+
50+
Public Property DeviceMediaType As String
51+
Get
52+
Return _DeviceMediaType
53+
End Get
54+
Set
55+
_DeviceMediaType = Value
56+
NotifyPropertyChanged("DeviceMediaType")
57+
End Set
58+
End Property
59+
60+
Public Property DeviceCaption As String
61+
Get
62+
Return _DeviceCaption
63+
End Get
64+
Set
65+
_DeviceCaption = Value
66+
NotifyPropertyChanged("DeviceCaption")
67+
End Set
68+
End Property
69+
70+
Public Property ComboBoxDisplayText As String
71+
Get
72+
Return _ComboBoxDisplayText
73+
End Get
74+
Set
75+
_ComboBoxDisplayText = Value
76+
NotifyPropertyChanged("ComboBoxDisplayText")
77+
End Set
78+
End Property
79+
80+
End Class

PSX XMB Manager/Classes/Structs.vb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Private _HDLDriveName As String
55
Private _NBDDriveName As String
66
Private _DriveID As String
7+
Private _ConnectedOnIP As String
78

89
Public Property DriveID As String
910
Get
@@ -31,6 +32,15 @@
3132
_NBDDriveName = Value
3233
End Set
3334
End Property
35+
36+
Public Property ConnectedOnIP As String
37+
Get
38+
Return _ConnectedOnIP
39+
End Get
40+
Set
41+
_ConnectedOnIP = Value
42+
End Set
43+
End Property
3444
End Structure
3545

3646
Public Structure HDL_Dump_Args

PSX XMB Manager/Classes/Utils.vb

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,14 @@ Public Class Utils
234234

235235
Public Shared Function GetResizedBitmap(ImageLocation As String, NewWidth As Integer, NewHeight As Integer) As Bitmap
236236
Try
237-
If NetworkInterface.GetIsNetworkAvailable Then
238-
Dim Request As WebRequest = WebRequest.Create(ImageLocation)
239-
Dim Response As WebResponse = Request.GetResponse()
240-
Dim ResponseStream As Stream = Response.GetResponseStream()
237+
Dim Request As WebRequest = WebRequest.Create(ImageLocation)
238+
Dim Response As WebResponse = Request.GetResponse()
239+
Dim ResponseStream As Stream = Response.GetResponseStream()
241240

242-
Dim OriginalBitmap As New Bitmap(ResponseStream)
243-
Dim ResizedBitmap As New Bitmap(OriginalBitmap, New Size(NewWidth, NewHeight))
241+
Dim OriginalBitmap As New Bitmap(ResponseStream)
242+
Dim ResizedBitmap As New Bitmap(OriginalBitmap, New Size(NewWidth, NewHeight))
244243

245-
Return ResizedBitmap
246-
Else
247-
Return Nothing
248-
End If
244+
Return ResizedBitmap
249245
Catch Ex As Exception
250246
Return Nothing
251247
End Try

PSX XMB Manager/Game/GameEditor.xaml.vb

Lines changed: 101 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -23,88 +23,125 @@ Public Class GameEditor
2323

2424
Private Sub SaveButton_Click(sender As Object, e As RoutedEventArgs) Handles SaveButton.Click
2525
If Not String.IsNullOrEmpty(ProjectDirectory) Then
26+
27+
Dim Quantizer As New WuQuantizer()
28+
29+
'Create the res\image directory
2630
If Not Directory.Exists(ProjectDirectory + "\res\image") Then
2731
Directory.CreateDirectory(ProjectDirectory + "\res\image")
2832
End If
2933

30-
Dim Quantizer As New WuQuantizer()
31-
3234
'Save selected XMB cover as compressed PNG
3335
If CoverPictureBox.Tag IsNot Nothing AndAlso Not File.Exists(ProjectDirectory + "\res\jkt_001.png") Then
34-
Dim Cover1Bitmap As Bitmap = Utils.GetResizedBitmap(CoverPictureBox.Tag.ToString(), 140, 200)
35-
Dim Cover2Bitmap As Bitmap = Utils.GetResizedBitmap(CoverPictureBox.Tag.ToString(), 74, 108)
36-
37-
If Cover1Bitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
38-
Utils.ConvertTo32bppAndDisposeOriginal(Cover1Bitmap)
39-
End If
40-
If Cover2Bitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
41-
Utils.ConvertTo32bppAndDisposeOriginal(Cover2Bitmap)
36+
If TypeOf CoverPictureBox.Tag Is String Then
37+
Dim Cover1Bitmap As Bitmap = Utils.GetResizedBitmap(CoverPictureBox.Tag.ToString(), 140, 200)
38+
Dim Cover2Bitmap As Bitmap = Utils.GetResizedBitmap(CoverPictureBox.Tag.ToString(), 74, 108)
39+
40+
If Cover1Bitmap IsNot Nothing AndAlso Cover2Bitmap IsNot Nothing Then
41+
If Cover1Bitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
42+
Utils.ConvertTo32bppAndDisposeOriginal(Cover1Bitmap)
43+
End If
44+
If Cover2Bitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
45+
Utils.ConvertTo32bppAndDisposeOriginal(Cover2Bitmap)
46+
End If
47+
48+
Try
49+
Using CompressedImage = Quantizer.QuantizeImage(Cover1Bitmap)
50+
CompressedImage?.Save(ProjectDirectory + "\res\jkt_001.png", Imaging.ImageFormat.Png)
51+
End Using
52+
Using CompressedImage = Quantizer.QuantizeImage(Cover2Bitmap)
53+
CompressedImage?.Save(ProjectDirectory + "\res\jkt_002.png", Imaging.ImageFormat.Png)
54+
End Using
55+
Catch ex As Exception
56+
MsgBox("Could not resize the selected cover. Please save it manually in the project folder:" + vbCrLf +
57+
"""\res\jkt_001.png"" 140 x 200" + vbCrLf +
58+
"""\res\jkt_002.png"" 74 x 108", MsgBoxStyle.Exclamation, "Cover Warning")
59+
Finally
60+
Cover1Bitmap.Dispose()
61+
Cover2Bitmap.Dispose()
62+
End Try
63+
Else
64+
MsgBox("Could not resize the selected cover. Please save it manually in the project folder:" + vbCrLf +
65+
"""\res\jkt_001.png"" 140 x 200" + vbCrLf +
66+
"""\res\jkt_002.png"" 74 x 108", MsgBoxStyle.Exclamation, "Cover Warning")
67+
End If
4268
End If
43-
44-
Try
45-
Using CompressedImage = Quantizer.QuantizeImage(Cover1Bitmap)
46-
CompressedImage.Save(ProjectDirectory + "\res\jkt_001.png", Imaging.ImageFormat.Png)
47-
End Using
48-
Using CompressedImage = Quantizer.QuantizeImage(Cover2Bitmap)
49-
CompressedImage.Save(ProjectDirectory + "\res\jkt_002.png", Imaging.ImageFormat.Png)
50-
End Using
51-
Catch ex As Exception
52-
MsgBox("Could not compress PNG." + vbCrLf + ex.Message, MsgBoxStyle.Exclamation)
53-
Finally
54-
Cover1Bitmap.Dispose()
55-
Cover2Bitmap.Dispose()
56-
End Try
5769
End If
5870

71+
'Background image
5972
If BackgroundImagePictureBox.Tag IsNot Nothing AndAlso Not File.Exists(ProjectDirectory + "\res\image\0.png") Then
60-
Dim BackgroundImageBitmap As Bitmap = Utils.GetResizedBitmap(BackgroundImagePictureBox.Tag.ToString, 640, 350)
61-
If BackgroundImageBitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
62-
Utils.ConvertTo32bppAndDisposeOriginal(BackgroundImageBitmap)
73+
If TypeOf BackgroundImagePictureBox.Tag Is String Then
74+
Dim BackgroundImageBitmap As Bitmap = Utils.GetResizedBitmap(BackgroundImagePictureBox.Tag.ToString, 640, 350)
75+
If BackgroundImageBitmap IsNot Nothing Then
76+
If BackgroundImageBitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
77+
Utils.ConvertTo32bppAndDisposeOriginal(BackgroundImageBitmap)
78+
End If
79+
80+
Try
81+
Using CompressedImage = Quantizer.QuantizeImage(BackgroundImageBitmap)
82+
CompressedImage?.Save(ProjectDirectory + "\res\image\0.png", Imaging.ImageFormat.Png)
83+
End Using
84+
Catch ex As Exception
85+
MsgBox("Could not resize the selected background. Please save it manually in the project folder:" + vbCrLf +
86+
"""\res\image\0.png"" 640 x 350", MsgBoxStyle.Exclamation, "Background Warning")
87+
Finally
88+
BackgroundImageBitmap.Dispose()
89+
End Try
90+
Else
91+
MsgBox("Could not resize the selected background. Please save it manually in the project folder:" + vbCrLf +
92+
"""\res\image\0.png"" 640 x 350", MsgBoxStyle.Exclamation, "Background Warning")
93+
End If
6394
End If
64-
65-
Try
66-
Using CompressedImage = Quantizer.QuantizeImage(BackgroundImageBitmap)
67-
CompressedImage.Save(ProjectDirectory + "\res\image\0.png", Imaging.ImageFormat.Png)
68-
End Using
69-
Catch ex As Exception
70-
MsgBox("Could not compress PNG." + vbCrLf + ex.Message, MsgBoxStyle.Exclamation)
71-
Finally
72-
BackgroundImageBitmap.Dispose()
73-
End Try
7495
End If
7596

97+
'Screenshots
7698
If ScreenshotImage1PictureBox.Tag IsNot Nothing AndAlso Not File.Exists(ProjectDirectory + "\res\image\1.png") Then
77-
Dim ScreenshotImageBitmap As Bitmap = Utils.GetResizedBitmap(ScreenshotImage1PictureBox.Tag.ToString, 640, 350)
78-
If ScreenshotImageBitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
79-
Utils.ConvertTo32bppAndDisposeOriginal(ScreenshotImageBitmap)
99+
If TypeOf ScreenshotImage1PictureBox.Tag Is String Then
100+
Dim ScreenshotImageBitmap As Bitmap = Utils.GetResizedBitmap(ScreenshotImage1PictureBox.Tag.ToString, 640, 350)
101+
If ScreenshotImageBitmap IsNot Nothing Then
102+
If ScreenshotImageBitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
103+
Utils.ConvertTo32bppAndDisposeOriginal(ScreenshotImageBitmap)
104+
End If
105+
106+
Try
107+
Using CompressedImage = Quantizer.QuantizeImage(ScreenshotImageBitmap)
108+
CompressedImage?.Save(ProjectDirectory + "\res\image\1.png", Imaging.ImageFormat.Png)
109+
End Using
110+
Catch ex As Exception
111+
MsgBox("Could not resize the selected screenshot 1. Please save it manually in the project folder:" + vbCrLf +
112+
"""\res\image\1.png"" 640 x 350", MsgBoxStyle.Exclamation, "Screenshot 1 Warning")
113+
Finally
114+
ScreenshotImageBitmap.Dispose()
115+
End Try
116+
Else
117+
MsgBox("Could not resize the selected screenshot 1. Please save it manually in the project folder:" + vbCrLf +
118+
"""\res\image\1.png"" 640 x 350", MsgBoxStyle.Exclamation, "Screenshot 1 Warning")
119+
End If
80120
End If
81-
82-
Try
83-
Using CompressedImage = Quantizer.QuantizeImage(ScreenshotImageBitmap)
84-
CompressedImage.Save(ProjectDirectory + "\res\image\1.png", Imaging.ImageFormat.Png)
85-
End Using
86-
Catch ex As Exception
87-
MsgBox("Could not compress PNG." + vbCrLf + ex.Message, MsgBoxStyle.Exclamation)
88-
Finally
89-
ScreenshotImageBitmap.Dispose()
90-
End Try
91121
End If
92122
If ScreenshotImage2PictureBox.Tag IsNot Nothing AndAlso Not File.Exists(ProjectDirectory + "\res\image\2.png") Then
93-
Dim ScreenshotImageBitmap As Bitmap = Utils.GetResizedBitmap(ScreenshotImage2PictureBox.Tag.ToString, 640, 350)
94-
95-
If ScreenshotImageBitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
96-
Utils.ConvertTo32bppAndDisposeOriginal(ScreenshotImageBitmap)
123+
If TypeOf ScreenshotImage2PictureBox.Tag Is String Then
124+
Dim ScreenshotImageBitmap As Bitmap = Utils.GetResizedBitmap(ScreenshotImage2PictureBox.Tag.ToString, 640, 350)
125+
If ScreenshotImageBitmap IsNot Nothing Then
126+
If ScreenshotImageBitmap.PixelFormat <> Imaging.PixelFormat.Format32bppArgb Then
127+
Utils.ConvertTo32bppAndDisposeOriginal(ScreenshotImageBitmap)
128+
End If
129+
130+
Try
131+
Using CompressedImage = Quantizer.QuantizeImage(ScreenshotImageBitmap)
132+
CompressedImage?.Save(ProjectDirectory + "\res\image\2.png", Imaging.ImageFormat.Png)
133+
End Using
134+
Catch ex As Exception
135+
MsgBox("Could not resize the selected screenshot 2. Please save it manually in the project folder:" + vbCrLf +
136+
"""\res\image\2.png"" 640 x 350", MsgBoxStyle.Exclamation, "Screenshot 2 Warning")
137+
Finally
138+
ScreenshotImageBitmap.Dispose()
139+
End Try
140+
Else
141+
MsgBox("Could not resize the selected screenshot 2. Please save it manually in the project folder:" + vbCrLf +
142+
"""\res\image\2.png"" 640 x 350", MsgBoxStyle.Exclamation, "Screenshot 2 Warning")
143+
End If
97144
End If
98-
99-
Try
100-
Using CompressedImage = Quantizer.QuantizeImage(ScreenshotImageBitmap)
101-
CompressedImage.Save(ProjectDirectory + "\res\image\2.png", Imaging.ImageFormat.Png)
102-
End Using
103-
Catch ex As Exception
104-
MsgBox("Could not compress PNG." + vbCrLf + ex.Message, MsgBoxStyle.Exclamation)
105-
Finally
106-
ScreenshotImageBitmap.Dispose()
107-
End Try
108145
End If
109146

110147
'Write info.sys to res directory

0 commit comments

Comments
 (0)