Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-free committed Nov 4, 2022
0 parents commit 928c16b
Show file tree
Hide file tree
Showing 30 changed files with 1,402 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# APrip GNUMakefile by Alex Free
CC=gcc
CFLAGS=-Wall -Werror -Ofast
VER=1.0

aprip: clean
$(CC) $(CFLAGS) aprip.c -o aprip

clean:
rm -rf aprip.exe aprip

linux-x86:
make aprip CFLAGS="-m32 -static -Wall -Werror -Ofast"

linux-x86_64:
make aprip CFLAGS="-static -Wall -Werror -Ofast"

windows-x86:
make aprip CC="i686-w64-mingw32-gcc"

windows-x86_64:
make aprip CC="x86_64-w64-mingw32-gcc"

linux-release:
rm -rf aprip-$(VER)-$(PLATFORM) aprip-$(VER)-$(PLATFORM).zip
mkdir aprip-$(VER)-$(PLATFORM)
cp -rv aprip images readme.html readme.md cd-command-logger.sh ap-type-checker.sh license.txt aprip-$(VER)-$(PLATFORM)
chmod -R 777 aprip-$(VER)-$(PLATFORM)
zip -r aprip-$(VER)-$(PLATFORM).zip aprip-$(VER)-$(PLATFORM)
rm -rf aprip-$(VER)-$(PLATFORM)

windows-release:
rm -rf aprip-$(VER)-$(PLATFORM) aprip-$(VER)-$(PLATFORM).zip
mkdir aprip-$(VER)-$(PLATFORM)
cp -rv aprip.exe images readme.html readme.md cd-command-logger.bat ap-type-checker.bat license.txt aprip-$(VER)-$(PLATFORM)
chmod -R 777 aprip-$(VER)-$(PLATFORM)
zip -r aprip-$(VER)-$(PLATFORM).zip aprip-$(VER)-$(PLATFORM)
rm -rf aprip-$(VER)-$(PLATFORM)

linux-x86-release: linux-x86
make linux-release PLATFORM=linux_x86_static

linux-x86_64-release: linux-x86_64
make linux-release PLATFORM=linux_x86_64_static

windows-x86-release: windows-x86
make windows-release PLATFORM=windows_x86

windows-x86_64-release: windows-x86_64
make windows-release PLATFORM=windows_x86_64

clean-zip: clean
rm -rf *.zip

all: linux-x86-release linux-x86_64-release windows-x86-release windows-x86_64-release
55 changes: 55 additions & 0 deletions ap-type-checker.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@echo off

echo DuckStation AP Type Checker v1.0 For Windows
echo By Alex Free
set argC=0
for %%x in (%*) do Set /A argC+=1
IF NOT "%argC%" == "2" (
echo Error: Incorrect number of arguments given to %0%.
echo Usage:
echo %0% ^<duckstation .exe file^> ^<game cue file^>
echo.
cmd /k
)

IF NOT EXIST "%~f1" (
echo Error: Can't open the DuckStation executable file: "%~f1"
echo.
pause
cmd /k
) ELSE (
echo Got DuckStation executable: "%~f1"
)

IF NOT EXIST "%~f2" (
echo Error: Can't open the PSX game cue file: "%~f2"
echo.
pause
cmd /k
) ELSE (
echo Got PSX game cue file: "%~f2"
)

FOR /F "tokens=3 delims= " %%G IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal"') DO (SET docsdir=%%G)
set log="%docsdir%\DuckStation\duckstation.log"
del %log% 2> nul
"%~f1" "%~f2"
echo.
echo Number Of 0x19 Test Commands Sent:
find /C "CDROM executing command 0x19" %log%
echo.
find "CDROM executing command 0x19" %log%
echo.
echo Number Of 0x1E ReadTOC Commands Sent:
find /C "CDROM executing command 0x1E" %log%
echo.
find "CDROM executing command 0x1E" %log%
echo Number Of 0x13 GetTN Commands Sent:
find /C "CDROM executing command 0x13" %log%
echo.
find "CDROM executing command 0x13" %log%
echo.
echo Number Of 0x14 GetTD Commands Sent:
find /C "CDROM executing command 0x14" %log%
echo.
find "CDROM executing command 0x14" %log%
46 changes: 46 additions & 0 deletions ap-type-checker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

echo -e "DuckStation AP Type Checker v1.0 For Linux\nBy Alex Free\n"

if [ $# -ne 2 ]; then
echo -e "Error: Incorrect number of arguments.\nUsage:\n<duckstation .exe file> <game cue file>\n"
exit 1
fi

if [ ! -f "$1" ]; then
echo -e "Error: Can't open the DuckStation executable file: "$1"\n"
else
echo "Got DuckStation executable file: "$1""
fi

if [ ! -f "$2" ]; then
echo -e "Error: Can't open the PSX game cue file: "$2"\n"
exit 1
else
echo "Got PSX game cue file: "$1""
fi

log="$HOME/.local/share/duckstation/duckstation.log"
rm $log
"$1" "$2"


echo "Number Of 0x19 Test Commands Sent:"
grep -rc "CDROM executing command 0x19" $log
echo
grep -r "CDROM executing command 0x19" $log
echo
echo "Number Of 0x1E ReadTOC Commands Sent:"
grep -rc "CDROM executing command 0x1E" $log
echo
grep -r "CDROM executing command 0x1E" $log
echo
echo "Number Of 0x13 GetTN Commands Sent:"
grep -rc "CDROM executing command 0x13" $log
echo
grep -r "CDROM executing command 0x13" $log
echo
echo "Number Of 0x14 GetTD Commands Sent:"
grep -rc "CDROM executing command 0x14" $log
echo
grep -r "CDROM executing command 0x14" $log
Loading

0 comments on commit 928c16b

Please sign in to comment.