-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from Pinacolada64/scripts
Fix-ups for asm, readability, +.IM
- Loading branch information
Showing
19 changed files
with
461 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
# Loop through a directory of *.lbl filenames, fixing an issue where | ||
# DirMaster for Windows exports Commodore filenames with "/" in them | ||
# "i/lo.blah" -> "i- lo.blah" | ||
|
||
# http://tldp.org/LDP/abs/html/string-manipulation.html | ||
# (Substring Replacement) | ||
use_slashes=1 | ||
|
||
function translate_filename() | ||
# this translates the filename given and returns in $test | ||
{ | ||
stringZ=(basename "$1") | ||
# compare=(basename "$1") | ||
# // delimiter replaces globally; / replaces first occurrence | ||
echo "Input : $stringZ" | ||
test=${stringZ//plus/+} # plus to + | ||
echo "Step 1: $test" | ||
if [ "$use_slashes" == "1" ]; then | ||
test=${test//\ -\ /\/} # " - " to / -- escape " " and /! | ||
else | ||
test=${test//slash/-} # slash to - | ||
fi; | ||
echo "Step 2: $test" | ||
test=${test//./_} # . to _ | ||
echo "Step 3: $test $stringZ" | ||
[ "$stringZ" != "$test" ] && echo "Unequal."; exit 0 # success, git mv them | ||
echo "Strings equal." && exit 1 | ||
} | ||
|
||
CURRENT_DIR=$PWD | ||
cd ../v2/core/jack | ||
# can't use "find ../v2/core/jack/foo_bar.lbl" because ".." will be translated to "__" | ||
|
||
translate_filename "i - bla.bla"; echo $test | ||
|
||
find . -name '*.lbl' | \ | ||
while read fname ; | ||
fname=${fname//.lbl/} # strip .lbl extension to not transform to "_lbl" | ||
do translate_filename "$fname"; | ||
echo "Status: $?" | ||
if [ "$?" == "1" ]; then | ||
echo "$fname.lbl: No transformation required" | ||
else | ||
echo "git mv $fname.lbl $test.lbl" | ||
fi; | ||
done | ||
|
||
echo ${file##*/} | ||
|
||
# old_filename="$1" # "plusslashMM_load.lbl" | ||
|
||
translate_filename "$old_filename" # "+/MM.load.lbl" | ||
C64_FILE=${test//.lbl/} # remove .lbl extension | ||
|
||
# translate_filename "plusplus 2" # "++ 2.prg" | ||
echo "input_lbl=$input_lbl" | ||
echo "C64_FILE=$C64_FILE" | ||
|
||
# quote filenames since some have spaces in them | ||
echo "wine c64list3_05.exe \"$input_lbl\" -prg -ovr" | ||
|
||
# fluffy's sed script | ||
# find . -name '*.lua' | while read fname ; do sed s/cat/dog/g "$fname" > "$fname.new" ; mv "$fname.new" "$fname" ; done | ||
|
||
# find ../v2/core/jack -name '*.lbl' | while read fname ; | ||
# do translate_filename $fname ; | ||
# if [ "$?" = "1" ]; then | ||
# echo "git mv $fname $test"; | ||
# fi; | ||
# done | ||
|
||
cd $CURRENT_DIR # return to where we were |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{number:0} | ||
{step:1} | ||
n$=chr$(0):r$=chr$(13):goto {:100} | ||
{number:1} | ||
{:1} | ||
gosub {:2}:for s=1 to 50:next | ||
{number:2} | ||
{:2} | ||
print# 15,"p{$02}"chr$(x and 255)chr$(x/256)"{$01}":return | ||
{number:5} | ||
{:5} | ||
x=rn:gosub {:1}:ed$="" | ||
{number:6} | ||
{:6} | ||
get#2,b$:b$=chr$(asc(b$+n$)):if b$<>chr$(13) then ed$=ed$+b$:goto {:6} | ||
return | ||
{number:10} | ||
{:10} | ||
for i=1 to len(ed$):z$=mid$(ed$,i,1):a=asc(z$+n$) | ||
if (a>32 and a<128) or a>159 then print z$;:goto {:15} | ||
if a<>34 then print"{rvrs on}"chr$(a+64)"{rvrs off}";:goto {:15} | ||
print z$ chr$(20)z$;:goto {:15} | ||
{number:15} | ||
{:15} | ||
next:print:return | ||
{number:100} | ||
{:100} | ||
rn=.:print"{clear}{lower}Insert Your Etcetera Disk In Any{$a0}Drive." | ||
input"Device 8{left:3}";dv%:input" Drive 0{left:3}";dr$ | ||
open 15,dv%,15:open 2,dv%,2,dr$+":e.data":input# 15,a,a$:if a then {:900} | ||
{:103} | ||
rn=rn+1:if rn>32 then rn=32 | ||
{:104} | ||
print"{down:2}Record # To Edit, {rvrs on}L{rvrs off} To List All,":print"Or {rvrs on}Q{rvrs off}{$a0}to Quit "; | ||
print mid$(str$(rn),2)"{left:4}";:if rn<10 then print"{right}"; | ||
input a$:if a$="q" OR a$="Q" then close 2:close 15:end | ||
if a$="l" or a$="L" then {:350} | ||
rn=abs(int(val(left$(a$,2)))):if rn<1 or rn>32 then rn=1:goto {:104} | ||
gosub {:5}:gosub {:10}:b$="":print"{down}Type Changes. Return When Finished." | ||
{number:112} | ||
{step:2} | ||
{:112} | ||
if len(b$)=32 then {:126} | ||
{:114} | ||
print"{rvrs on} {rvrs off}{left}";:wait 198,1:get a$:a=asc(a$+n$):on -(a=34) goto {:122}:if a=13 then {:124} | ||
if (a>32 and a<128) or a>159 then b$=b$+a$:print a$;:goto {:112} | ||
if (a<>20 and a<>148) or peek(653)=4 then b$=b$+chr$(a):print"{rvrs on}"chr$(a+64)"{rvrs off}";:goto {:112} | ||
on len(b$)+1 goto {:114}:b$=left$(b$,len(b$)-1):print a$;:goto {:112} | ||
{:122} | ||
print a$ chr$(20)a$;:b$=b$+a$:goto {:112} | ||
{:124} | ||
IF LEN(b$)=. then b$=ed$:print"(Unchanged.)":goto {:103} | ||
{:126} | ||
print:print "Writing...":x=rn:gosub {:1}:print# 2,b$:goto {:103} | ||
{number:350} | ||
{:350} | ||
for rn=1 to 32:print rn":";:gosub {:5}:gosub {:10}:rn=rn+peek(198)*32:next:rn=1:goto {:104} | ||
{number:900} | ||
{:900} | ||
print"Disk Error: "a","a$:close 2:close 15:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.