Skip to content

Commit

Permalink
Merge pull request #13 from orix-software/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jedeoric authored Jan 2, 2022
2 parents 3297a66 + 24e1f11 commit e8ffcba
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 29 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,28 @@ jobs:
echo "::set-output name=VERSION::$(cat VERSION)"
echo "::set-output name=REPO_NAME::${GITHUB_REPOSITORY##*/}"
- name: Install sdk
uses: actions/cache@v2
with:
path: |
cc65/**/*
orix-sdk/**/*
md2hlp/**/*
orix-software/**/*
key: ${{ runner.os }}-orix-sdk_

- name: Prepare environment for project
run: mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../
# - name: Install sdk
# uses: actions/cache@v2
# with:
# path: |
# cc65/**/*
# orix-sdk/**/*
# md2hlp/**/*
# orix-software/**/*
# key: ${{ runner.os }}-orix-sdk_

#- name: Prepare environment for project
# run: mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../

- name: Compile project
run: |
sudo apt-get install curl -y
sudo apt-get install libcurl4-gnutls-dev -y
sudo apt-get install python3-pycurl -y
#python -m pip install --upgrade pip
#pip3 install pycurl==7.43.0.1 --global-option="--with-nss" --upgrade
#if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make
make
- name: List build directory content
run: ls -lR build
run: ls -lR build && pwd && ls -l ../

- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand All @@ -134,8 +131,8 @@ jobs:
build/**/*
!build/obj/*
- name: Post compilation
run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp .
#- name: Post compilation
# run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp .

upload:
needs: build
Expand Down Expand Up @@ -177,5 +174,6 @@ jobs:
- name: Upload to oric
run: |
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha ; fi
echo "upload to https://cdn.oric.org/publish.php?hash=$hash&path=/home/oricoujr/www/ftp/orix/dists/$VERSION/tgz/6502/${ARCHIVE_NAME}"
curl -X POST --data-binary "@${ARCHIVE_NAME}" "https://cdn.oric.org/publish.php?hash=$hash&path=/home/oricoujr/www/ftp/orix/dists/$VERSION/tgz/6502/${ARCHIVE_NAME}"
63 changes: 53 additions & 10 deletions tools/retrieveSoftwareOricOrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
nb_of_tools=0

def buildDbFileSoftwareSingle(destetc,letter,name_software,filenametap8bytesLength,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy):
print("Writting db file : "+destetc+"/"+letter+"/"+filenametap8bytesLength+".db")
f = open(destetc+"/"+letter+"/"+filenametap8bytesLength+".db", "wb")
f.write(DecimalToBinary(version_bin))
f.write(DecimalToBinary(rombasic11))
Expand Down Expand Up @@ -77,6 +78,10 @@ def removeFrenchChars(mystr):
mystr=mystr.replace(u'\xa8', u'e')

mystr=mystr.replace(u'\xbb', u'c') # ç
mystr=mystr.replace(u'\xb9', u'u') # ù
mystr=mystr.replace(u'\xb4', u'o') # ù



mystr=mystr.replace("é", "e")
mystr=mystr.replace("é", "e")
Expand Down Expand Up @@ -166,26 +171,49 @@ def BuildDsk(platform_software,letter,destpath,destetc,name_software,filenametap

def BuildTape(tmpfolderRetrieveSoftware,tail,dest,letter,filenametap8bytesLength,filenametapext,destroot,destetc,name_software,date_software,download_platform_software,programmer_software,junk_software,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy):
#Hobbit ROM we copy also the tape file at the root of the sdcard
print("Copy : "+tmpfolderRetrieveSoftware+tail+" to : "+dest+"/"+letter+"/"+filenametap8bytesLength+"."+filenametapext)
print("Copying tape : "+tmpfolderRetrieveSoftware+tail+" to : "+dest+"/"+letter+"/"+filenametap8bytesLength+"."+filenametapext)
print("Rom basic id : "+str(rombasic11))
copyfile(tmpfolderRetrieveSoftware+tail,dest+"/"+letter+"/"+filenametap8bytesLength+"."+filenametapext)
if rombasic11=="0":

#$trom["0"]="undefined";
#$trom["4"]="Rom Hobbit";
#$trom["1"]="Rom jeux atmos";
#$trom["2"]="Rom atmos normale";
#$trom["3"]="Rom Oric-1";
##$trom["99"]="NOK: no working ROM";
#$trom["253"]="NOK : Does not load";
#$trom["254"]="NOK : game ROM error: file not found";
#$trom["255"]="NOK : Game ROM altered charset";


# Rom hobbit
if rombasic11=="4":
print("Copy : "+tmpfolderRetrieveSoftware+tail+" to : "+destroot+"/"+filenametap8bytesLength+"."+filenametapext )
copyfile(tmpfolderRetrieveSoftware+tail,destroot+"/"+filenametap8bytesLength+"."+filenametapext )
# Force to ROM 0 : hobbit ROM
rombasic11=0
# In oric.org we have roms id to declare if a game is working or not, and if it's
if rombasic11!="0" and rombasic11!="1" and rombasic11!="2":
rombasic11=1
if not os.path.exists(destetc+"/"+letter):
os.mkdir(destetc+"/"+letter)
buildMdFile(filenametap8bytesLength,dest,letter,name_software,date_software,download_platform_software,programmer_software,junk_software)
buildDbFileSoftwareSingle(destetc,letter,name_software,filenametap8bytesLength,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy)

if not os.path.exists(destetc+"/"+letter):
os.mkdir(destetc+"/"+letter)
print("Writing in db file rom id : ",str(rombasic11))
buildMdFile(filenametap8bytesLength,dest,letter,name_software,date_software,download_platform_software,programmer_software,junk_software)
buildDbFileSoftwareSingle(destetc,letter,name_software,filenametap8bytesLength,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy)

def CheckTape(filename,tmpfolderRetrieveSoftware,tail,dest,letter,filenametap8bytesLength,filenametapext,destroot,destetc,name_software,date_software,download_platform_software,programmer_software,junk_software,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy):
if filename=="":
return 1

extension=filename[-3:].lower()

if extension=="tap":
print("Found tape file : "+removeFrenchChars(name_software))


BuildTape(tmpfolderRetrieveSoftware,tail,dest,letter,filenametap8bytesLength,filenametapext,destroot,destetc,name_software,date_software,download_platform_software,programmer_software,junk_software,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy)
# main db
print("Found tape file : "+removeFrenchChars(name_software))

return 0
return 1

Expand Down Expand Up @@ -446,11 +474,13 @@ def KeyboardMatrix(num):
CreateTargetFolder(dest,destetc,letter)


filenametap=tail.lower().replace(" ", "").replace("-", "").replace("_", "")


tcnf=filenametap.split('.')

print("###########################################################################################")
print("Generating : "+name_software+"/"+id_software)
filenametap=tail.lower().replace(" ", "").replace("-", "").replace("_", "")
tcnf=filenametap.split('.')
filenametapext=tcnf[1]
cnf=tcnf[0]+".db"
filenametapbase=tcnf[0]
Expand All @@ -470,6 +500,7 @@ def KeyboardMatrix(num):
# Download 1

if CheckTape(download_1_file,tmpfolderRetrieveSoftware,tail,dest,letter,filenametap8bytesLength,filenametapext,destroot,destetc,name_software,date_software,download_platform_software,programmer_software,junk_software,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy)==0:

print("# tape")
addSoftware=filenametap8bytesLength.upper()+';'+removeFrenchChars(name_software)+'\0'
basic_main_db_str=basic_main_db_str+addSoftware
Expand Down Expand Up @@ -520,8 +551,20 @@ def KeyboardMatrix(num):
print("Skipping first download trying second download : "+removeFrenchChars(name_software))
skipping_list_error=skipping_list_error+"Skipping first download : "+removeFrenchChars(name_software)+"/Flags : "+download_1_platform+" "+id_software+"\n"


if download_2_file!="":
extension=download_2_file[-3:].lower()
head, tail = os.path.split(download_2_file)
letter=tail[0:1].lower()
filenametap=tail.lower().replace(" ", "").replace("-", "").replace("_", "")
tcnf=filenametap.split('.')
filenametapext=tcnf[1]
RetriveSoftwareInTmpFolder(download_2_file,tmpfolderRetrieveSoftware)


if flag=="" and CheckTape(download_2_file,tmpfolderRetrieveSoftware,tail,dest,letter,filenametap8bytesLength,filenametapext,destroot,destetc,name_software,date_software,download_platform_software,programmer_software,junk_software,version_bin,rombasic11,fire2_joy,fire3_joy,down_joy,right_joy,left_joy,fire1_joy,up_joy)==0:
print("# tape")

addSoftware=filenametap8bytesLength.upper()+';'+removeFrenchChars(name_software)+'\0'
basic_main_db_str=basic_main_db_str+addSoftware
lenAddSoftware+=len(addSoftware)
Expand Down

0 comments on commit e8ffcba

Please sign in to comment.