Skip to content

Commit eed3293

Browse files
committed
2 parents feeff96 + 3b01be6 commit eed3293

3 files changed

Lines changed: 235 additions & 3 deletions

File tree

docs/crystal-chips/cc-files.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,177 @@ Apps Included and updated as of 3/7/2027:
119119
- Can only be ran from USB!
120120
- OSDXMB can only be ran from USB!
121121

122+
## APPINFO.PBT SAS (SAVE APPLICATION SUPPORT) Example
123+
124+
??? note "APPINFO.PBT SAS Example
125+
```
126+
# SAS (Save Application Support) compliant BM Script:
127+
# Due to wildcard bug on memory card, APPINFO.PBT can not be in root folders where elf exists, so APPINFO.PBT will be in mc?:/BM/APPS/
128+
# Memory Card structure mc?:/BM/APPS/$SAS$/APPINFO.PBT and elf in mc?:/$SAS$/APPINFO.PBT
129+
# Non-Memory Card Structure: device:/$SAS$/APPINFO.PBT or device:/APPS/$SAS$/APPINFO.PBT NOTE: $PWD$ should work for both.
130+
131+
# Change this information to describe the application and where it should be ran from for memcard (SAS) or other devices (SAS_NON_MC)
132+
# SAS is the App folder name. SAS_NON_MC defines if app is in root of non-memcard device (non_mc:/$SAS$) or APP folder (non_mc:/APPS/$SAS$)
133+
# This is so that you do not have to edit any info below line 20.
134+
#
135+
# Some devices are case sensitive! Make sure you case matches!
136+
#
137+
SET "TITLE" "PS2Temps"
138+
SET "VERSION" "1.0"
139+
SET "AUTHOR" "jolek and akuhak"
140+
SET "DESC" "Monitor your PS2 CPU and Mechacon Temps (if applicable)"
141+
SET "MEDIAS" ""
142+
SET "ELF" "PS2Temps.elf"
143+
SET "SAS" "DST_PS2TEMPS"
144+
# Comment out 1 of the 2 lines below. If app is in non-mc:/$SAS$ comment out line 19. If app is in non-mc:/APPS/$SAS$ comment out line 18
145+
# SET "SAS_NON_MC" "$SAS$"
146+
SET "SAS_NON_MC" "APPS/$SAS$"
147+
#
148+
149+
150+
# Do not change these 2 lines!
151+
GOTO "$ARG1$"
152+
RETURN -1
153+
154+
# :LABEL_NAME
155+
# ADDWIDGET "LABEL" "$ARG2$$TITLE$ v$VERSION$"
156+
# EXIT 0
157+
158+
:QUERY
159+
ADDWIDGET "CALL" "$TITLE$" "$BM.TXT_VERSION$: $VERSION$ $BM.TXT_AUTHOR$: $AUTHOR$ $BM.TXT_DESC$: $DESC$" $ARG2$ "$ARG0$" "$ARG3$" "$ARG4$" "$ARG5$"
160+
EXIT 0
161+
162+
:INSTALL
163+
PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
164+
165+
IF MATCHES "mc?" "$SRC_DEV$"
166+
IF MATCHES "mc?" "$ARG2$"
167+
GOTO "INSTALL_MC_TO_MC"
168+
ELSEIF NOT MATCHES "mc?" "$ARG2$"
169+
GOTO "INSTALL_MC_TO_NONMC"
170+
ENDIF
171+
ELSEIF NOT MATCHES "mc?" "$SRC_DEV$"
172+
IF MATCHES "mc?" "$ARG2$"
173+
GOTO "INSTALL_NONMC_TO_MC"
174+
ELSEIF NOT MATCHES "mc?" "$ARG2$"
175+
GOTO "INSTALL_NONMC_TO_NONMC"
176+
ENDIF
177+
178+
:INSTALL_MC_TO_MC
179+
# Copies where APPINFO.PBT can be found in mc?:/BM/APPS/$SAS$
180+
IF FAIL COPY "$PWD$" "$ARG2$:/BM/APPS/$SAS$"
181+
MESSAGE "Failed installing APPINFO.PBT"
182+
RRM "$ARG2$:/BM/APPS/$SAS$"
183+
RETURN -1
184+
# Copies SAS app folder from root of mc? for SAS support
185+
ELSEIF FAIL COPY "$SRC_DEV$:/$SAS$" "$ARG2$:/$SAS$"
186+
MESSAGE "Failed installing $TITLE$"
187+
RRM "$ARG2$:/$SAS$"
188+
RETURN -1
189+
ELSEIF NOT EXISTS "$ARG2$:/BM/bman.icn"
190+
GOTO "INSTALL_MC_ICON"
191+
ELSEIF NOT EXISTS "$ARG2$:/BM/icon.sys"
192+
GOTO "INSTALL_MC_ICON"
193+
ENDIF
194+
EXIT 0
195+
196+
:INSTALL_MC_TO_NONMC
197+
IF FAIL COPY "$SRC_DEV$:/$SAS$" "$ARG2$:/$SAS_NON_MC$"
198+
MESSAGE "Failed installing $TITLE$"
199+
RRM "$ARG2$:/$SAS_NON_MC$"
200+
RETURN -1
201+
ENDIF
202+
EXIT 0
203+
204+
:INSTALL_NONMC_TO_NONMC
205+
IF FAIL COPY "$PWD$" "$ARG2$:/$SAS_NON_MC$"
206+
MESSAGE "Failed installing $TITLE$"
207+
RRM "$ARG2$:/$SAS_NON_MC$"
208+
RETURN -1
209+
ENDIF
210+
EXIT 0
211+
212+
:INSTALL_NONMC_TO_MC
213+
# Creates folder and copies where APPINFO.PBT can be found in mc?:/BM/APPS/$SAS$
214+
# NOTE: COPY function below fails HOWEVER does create the $SAS$ folder with nothing in it...
215+
# this is why I (R3Z3N) do not use IF FAIL COPY. Trust me, I tried the usual way as found in the BM installer APPINFO.PBT with MKDIR
216+
# Odd. Had to use a bug to create this folder...notice the slash at end of destination
217+
COPY "$PWD$" "$ARG2$:/BM/APPS/$SAS$/"
218+
# Copies where APPINFO.PBT can be found in mc?:/BM/APPS/$SAS$/APPINFO.PBT
219+
IF FAIL COPY "$ARG0$" "$ARG2$:/BM/APPS/$SAS$/APPINFO.PBT"
220+
MESSAGE "Failed installing APPINFO.PBT"
221+
RRM "$ARG2$:/BM/APPS/$SAS$"
222+
RETURN -1
223+
# Copies SAS app folder to root of mc? for SAS support
224+
ELSEIF FAIL COPY "$PWD$" "$ARG2$:/$SAS$"
225+
ECHO "Failed installing $TITLE$"
226+
MESSAGE "Failed installing $TITLE$"
227+
RRM "$ARG2$:/$SAS$"
228+
RETURN -1
229+
# Create icons if needed so OSDSYS does not show corrupt
230+
ELSEIF NOT EXISTS "$ARG2$:/BM/bman.icn"
231+
GOTO "INSTALL_MC_ICON"
232+
ELSEIF NOT EXISTS "$ARG2$:/BM/icon.sys"
233+
GOTO "INSTALL_MC_ICON"
234+
ENDIF
235+
EXIT 0
236+
237+
:INSTALL_MC_ICON
238+
IF FAIL COPY "$BM.BM_PATH$/bman.icn" "$ARG2$:/BM/bman.icn"
239+
MESSAGE "Failed to install $BM.BM_PATH$/bman.icn"
240+
RETURN -1
241+
ELSEIF FAIL COPY "$BM.BM_PATH$/icon.sys" "$ARG2$:/BM/icon.sys"
242+
MESSAGE "Failed to install $BM.BM_PATH$/bman.icn"
243+
RETURN -1
244+
ENDIF
245+
EXIT 0
246+
247+
:REMOVE
248+
PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
249+
250+
IF MATCHES "mc?" "$SRC_DEV$"
251+
GOTO "REMOVE_MC"
252+
ELSEIF NOT MATCHES "mc?" "$SRC_DEV$"
253+
GOTO "REMOVE_PWD"
254+
ENDIF
255+
256+
:REMOVE_MC
257+
IF FAIL RRM "$SRC_DEV$:/$SAS$"
258+
MESSAGE "Failed removing $SRC_DEV$:/$SAS$"
259+
RETURN -1
260+
ENDIF
261+
GOTO "REMOVE_PWD"
262+
263+
:REMOVE_PWD
264+
# Odd bug: needs to loop 2x to remove contents, otherwise first run only APPINFO.PBT is removed
265+
IF FAIL RRM "$PWD$"
266+
GOTO "REMOVE_PWD"
267+
MESSAGE "Failed removing $TITLE$"
268+
RETURN -1
269+
ENDIF
270+
EXIT 0
271+
272+
:RUN
273+
PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
274+
275+
IF MATCHES "mc?" "$SRC_DEV$"
276+
LOADEXEC "PBAT" "$BM.SCRIPTS$/LOADEXEC.PBT" "$SRC_DEV$:/$SAS$/$ELF$"
277+
EXIT 0
278+
ELSEIF MATCHES "host" "$SRC_DEV$"
279+
MESSAGE "Run with PS2Client instead!"
280+
EXIT 0
281+
ELSEIF NOT MATCHES "mc?" "$SRC_DEV$"
282+
IF MATCHES "host" "$SRC_DEV$"
283+
MESSAGE "Run with PS2Client instead on PC!"
284+
EXIT 0
285+
ELSE
286+
LOADEXEC "PBAT" "$BM.SCRIPTS$/LOADEXEC.PBT" "$PWD$/$ELF$"
287+
EXIT 0
288+
ENDIF
289+
ENDIF
290+
EXIT 0
291+
```
292+
122293

123294
## APPINFO.PBT Example
124295

docs/crystal-chips/cc-scripting.md

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,17 @@ File manipulation is useful for installation scripts (in APPINFO.PBT). You can m
267267
#### COPY
268268
To copy file/directory from source to destination :
269269

270-
```COPY "host:/FOLDER/FILE.TXT" "mass:/FOLDER1/FOLDER2/FILE.TXT"```
270+
```COPY "host:/FOLDER/FILE.TXT" "mass:/FOLDER1/FOLDER2/FILE.TXT"``` will copy the single file, but will not create destination folder structure.
271+
272+
```COPY "host:/FOLDER" "mass:/FOLDER/FOLDER2"``` will copy contents source folder to destintaion folder
273+
274+
Notes: copying a file to a file only works if prior directories already exist on destination.
275+
276+
```COPY "host:/FOLDER" "mass:/FOLDER1/FOLDER2/FILE.TXT"``` DOES NOT WORK
277+
278+
```COPY "host:/FOLDER" "mass:/FOLDER1/FOLDER2/"``` This does work to create an empty mass:/FOLDER1 but will say it fails if used with ```IF COPY FAIL```
279+
280+
271281

272282
#### RM
273283
To delete a file or directory
@@ -288,6 +298,23 @@ To create a new folder.
288298

289299
will create a folder MYFOLDER in the USB mass storage.
290300

301+
Note: MKDIR will not create mutliple folders for example if MYFOLDER, FOLDER and FOLDER3 do not exist:
302+
303+
```
304+
IF NOT EXISTS "mass:/MYFOLDER/FOLDER2/FOLDER3"
305+
IF FAIL MKDIR "mass:/MYFOLDER/FOLDER2/FOLDER3"
306+
MESSAGE "FAILED TO CREATE DIRECTORY!"
307+
ENDIF
308+
ENDIF
309+
```
310+
311+
The workaround is to exploit a bug that thinks it failed
312+
313+
```COPY $PWD$ "mass:/MYFOLDER/MYFOLDER2/MYFOLDER3"```
314+
315+
DO NOT PRECEDE WITH `IF FAIL` as it does think it failed. Contents of folders will not be harmed in my testing if some of it exists.
316+
317+
291318
#### REDIRFILE
292319
To symlink a file to another location. Only works if the environment you use doesn't reboot IOP too soon IE PS2LINK
293320

@@ -388,4 +415,38 @@ LOADIMG/UNLOADIMG - load and unload an image for theming
388415

389416
```*``` wildcard(s)
390417

391-
```?``` single character wildcard
418+
```?``` single character wildcard
419+
420+
#### Useful Tips
421+
422+
When debugging paste variables where you want in the script. Then run PS2Client to see output via ECHO
423+
424+
425+
```
426+
PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
427+
428+
ECHO ""
429+
ECHO ""
430+
ECHO "PWD: $PWD$"
431+
ECHO "SRC_DEV: $SRC_DEV$"
432+
ECHO "SRC_PATH: $SRC_PATH$"
433+
ECHO "SRC_FILE: $SRC_FILE$"
434+
ECHO "ARG0: $ARG0$"
435+
ECHO "ARG1: $ARG1$"
436+
ECHO "ARG2: $ARG2$"
437+
ECHO "ARG3: $ARG3$"
438+
ECHO "ARG4: $ARG4$"
439+
ECHO "ARG5: $ARG5$"
440+
ECHO ""
441+
ECHO ""
442+
```
443+
444+
#### PS2Client
445+
446+
Paste and edit this text into plain text file saved as LauchBM2.bat
447+
448+
```ps2client -h IPADDRESS execee host:/BM/BM2.ELF```
449+
450+
In the folder that has PS2Client, paste your BM folder
451+
452+
You can then edit the scripts, and reload menu on Crystal Chip BootManager to see your changes

docs/misc/picfix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Why? In an attempt to curb piracy, $ony designed the laser to fail and burn up.
66
![Mermaid Chart](assets/picfix/whylaserburns_mermaid.jpg)
77
Courtesy of [El Isra](https://github.com/israpps)
88

9-
Invented by the Matrix Team, they designed a cheap and easy fix for V9-V12 PS2s, documented [here](https://github.com/MechaResearch/MechaPwn/blob/master/docs/PICfix.md) and refined by HaloSlayer255 and [ModzvillUSA](https://modzvilleusa.com/products/ps2-matrix-picfix-for-v9-v12-ps2-consoles). When the mechacon crashes, this shuts down the PS2 instead of letting the laser burn up.
9+
Invented by the Matrix Team, they designed a cheap and easy fix for V9-V12 PS2s, documented [here](https://github.com/MechaResearch/MechaPwn/blob/master/docs/PICfix.md) and refined by HaloSlayer255 and [ModzvillUSA](https://modzvilleusa.com/products/ps2-matrix-picfix-for-v9-v12-ps2-consoles). When the DSP (Digital Signal Processor) crashes, this shuts down the PS2 instead of letting the laser burn up.
1010

1111

1212
I (R3Z3N) simply applied some artistic touch to make this an easier install that will look professional with decent soldering skills. CLEAN YOUR FLUX BOYS!

0 commit comments

Comments
 (0)