diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1c0d11..fdae5d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,8 @@ name: build on: # Triggers the workflow on push event only for all branches push: - # branches: [ main, master ] + # branches: [ main, master, develop ] + #pull_request: # branches: [ main, master ] @@ -14,37 +15,46 @@ on: jobs: # This workflow contains a single job called "build" setup-sdk: - runs-on: ubuntu-18.04 + runs-on: ubuntu-24.04 steps: - name: Cache sdk id: cache-sdk - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | cc65/**/* orix-sdk/**/* md2hlp/**/* orix-software/**/* - key: ${{ runner.os }}-orix-sdk_ + bpm/**/* + oricutron/**/* + key: ${{ secrets.CACHE_ID }}-orix-sdk - name: Checkout cc65 if: steps.cache-sdk.outputs.cache-hit != 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: cc65/cc65 path: cc65 + - name: Checkout bpm + if: steps.cache-sdk.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: orix-software/bpm + path: bpm + - name: Checkout orix-sdk if: steps.cache-sdk.outputs.cache-hit != 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: assinie/orix-sdk path: orix-sdk - name: Checkout md2hlp if: steps.cache-sdk.outputs.cache-hit != 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: assinie/md2hlp path: md2hlp @@ -68,6 +78,14 @@ jobs: echo "src/include" >> .git/info/sparse-checkout git checkout + - name: Prepare environment for oricutron + if: steps.cache-sdk.outputs.cache-hit != 'true' + run: | + sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev + git clone https://github.com/pete-gordon/oricutron.git + cd oricutron && make && pwd && cd .. && ls -l && echo ${GITHUB_WORKSPACE} + echo Timeout oricutron : ${secret}.TMOUT_ORICUTRON + - name: Compile orix-sdk if: steps.cache-sdk.outputs.cache-hit != 'true' working-directory: orix-sdk @@ -83,13 +101,16 @@ jobs: build: # The type of runner that the job will run on needs: setup-sdk - runs-on: ubuntu-18.04 + runs-on: ubuntu-24.04 + env: + hash: ${{ secrets.HASH }} outputs: version: ${{ steps.job_vars.outputs.VERSION }} repo_name: ${{ steps.job_vars.outputs.REPO_NAME }} + bpm_found: ${{ steps.bpm_upload.outputs.BPM_FOUND }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set job variables id: job_vars @@ -98,26 +119,38 @@ jobs: echo "::set-output name=REPO_NAME::${GITHUB_REPOSITORY##*/}" - name: Install sdk - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | cc65/**/* orix-sdk/**/* md2hlp/**/* orix-software/**/* - key: ${{ runner.os }}-orix-sdk_ + bpm/**/* + oricutron/**/* + key: ${{ secrets.CACHE_ID }}-orix-sdk - name: Prepare environment for project - run: mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../ + run: | + mkdir ~/bin + cd bpm && pip install -r requirements.txt && cd .. + mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../ && mv bpm ../ - name: Compile project - run: CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make + run: | + if [ -f "bpm.tml" ]; then + chmod 755 ../bpm/src/bpm + echo "../bpm/src/bpm" >> $GITHUB_PATH + export PATH=$PATH:../bpm/src/:${GITHUB_WORKSPACE}/../cc65/bin + bpm --force-update --replace-for-new-project -V + fi + CC65_HOME=${GITHUB_WORKSPACE}/../cc65 ./make.sh - name: List build directory content run: ls -lR build - name: Upload Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v5 with: name: ${{ steps.job_vars.outputs.REPO_NAME }} path: | @@ -127,45 +160,15 @@ jobs: - name: Post compilation run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp . - upload: - needs: build - runs-on: ubuntu-18.04 - defaults: - run: - shell: bash - env: - hash: ${{ secrets.HASH }} - version: ${{ needs.build.outputs.version }} - repo_name: ${{ needs.build.outputs.repo_name }} - - steps: - - name: Get branch name - if: github.event_name != 'pull_request' - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - # run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF##*/})" - - - name: Get branch name on pull request - if: github.event_name == 'pull_request' - run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> GITHUB_ENV - #run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})" - - - name: Get archive name - run: echo "ARCHIVE_NAME=${repo_name}.tgz" >> $GITHUB_ENV - - # On pourrait faire l'extraction directement à la racine si VERSION est dans l'artifact - - name: Download Artifact - id: download - uses: actions/download-artifact@v2 - with: - name: ${{ needs.build.outputs.repo_name }} - path: artifact - - - name: Make archive - working-directory: ${{steps.download.outputs.download-path}} - run: tar -zcvf $GITHUB_WORKSPACE/$ARCHIVE_NAME * - - - name: Upload to oric + - name: Upload if bpm + id: bpm_upload run: | - if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha ; fi - 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}" + ls -l + if [ -f "bpm.tml" ]; then + export BPM_PUBLISH_KEY=$hash + export PATH=$PATH:../bpm/src/:${GITHUB_WORKSPACE}/../cc65/bin + if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then bpm --force-update -V;--force-update publish --official; else bpm publish --alpha; fi + else + echo "bpm.tml not found, skipping bpm upload" + fi diff --git a/README.md b/README.md index a30f81b..3e32d23 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![build](https://github.com/orix-software/untar/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/orix-software/untar/actions/workflows/main.yml) + # Description Untar utility for Orix diff --git a/VERSION b/VERSION index 7a6125d..3a18665 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2022.2 +2025.4 diff --git a/bpm.tml b/bpm.tml new file mode 100644 index 0000000..4b6992d --- /dev/null +++ b/bpm.tml @@ -0,0 +1,34 @@ +[package] +name = "untar" +version = "2025.4" +authors = [ "Assinie",] +license = "" +edition = "2025" +cpu = "6502" +readme = "" +repository = "https://github.com/orix-software/untar" +documentation = "" +description = "Provide untar" +homepage = "" +buildfolder = "build" +packagetype = "tgz" +codetype = "bin" +templatecode = "" +pathsrc = "src" +oricutron_replace_autoboot_run = "True" +asm_bin_tpl_version = "2024.4" +asm_rom_tpl_version = "2024.4" +orixsdk_version = "2023.3.0" +default_github_action_version = "2025.2" +default_generatedoc_version = "2025.4" +orix_minimal_kernel_version = "2022.3" +orix_run_pre_script = "" +md2hlp = "yes" +enable_build = "False" +enable_publish = "True" + +[dependencies] + +[dynamiclibs] + +[srcfolders] diff --git a/docs/Makefile b/docs/Makefile index a3e4e46..acc4989 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -18,7 +18,7 @@ VERBOSE ?= 0 # Définition des outils # -MD2HLP = $(MD2HLP_PATH)/md2hlp.py +MD2HLP = $(MD2HLP_PATH)/md2hlp.py3 # # Définition des options pour les outils diff --git a/docs/untar.md b/docs/untar.md index 66cfb8c..dadc270 100644 --- a/docs/untar.md +++ b/docs/untar.md @@ -10,7 +10,8 @@ + untar -tf /home/test.tar ## DESCRIPTION -**untar** list and extract files in a TAR archive +**untar** list and extract files in a TAR archive. +**untar** manages only tar built with gnu format (from 'tar -c --format=gnu') ## OPTIONS * -h ^Bshow this help message and exit diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..b88b728 --- /dev/null +++ b/make.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# CC65_HOME=.. +# DEBUG=yes + +SDK_PATH="../orix-sdk" +PROGNAME="$(basename `pwd`)" + +make configure && make clean + +START_ADDR=0x0800 make + +if [ $? -eq 0 ] +then + mv build/bin/${PROGNAME} build/bin/${PROGNAME}-0800 + + START_ADDR=0x0900 make + + if [ $? -eq 0 ] + then + mv build/bin/${PROGNAME} build/bin/${PROGNAME}-0900 + + python3 ${SDK_PATH}/bin/relocbin.py3 -2 -o build/bin/${PROGNAME} build/bin/${PROGNAME}-0800 build/bin/${PROGNAME}-0900 + + if [ $? -eq 0 ] + then + rm build/bin/${PROGNAME}-0800 build/bin/${PROGNAME}-0900 + fi + fi +fi diff --git a/src/Makefile b/src/Makefile index 4d6d017..93ebee9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -23,6 +23,8 @@ VERBOSE ?= 0 # TARGET = telestrat +START_ADDR ?= 0x0900 + # # Définition des outils # @@ -45,11 +47,11 @@ endif ifeq ($(DEBUG),yes) ASFLAGS = -t $(TARGET) -I ../ -I $(BUILD_PATH) -I $(SDK_PATH)/macros -I $(SDK_PATH)/include -I $(SHELL_PATH) -I $(KERNEL_PATH) -D VERBOSE_LEVEL=$(VERBOSE) --auto-import --list-bytes 0 -l $(@:.o=.lst) --debug-info - LDFLAGS = -t $(TARGET) -Ln $(@).ca.sym -m $(@).map --lib-path $(LIB_PATH) + LDFLAGS = -t $(TARGET) -Ln $(@).ca.sym -m $(@).map --lib-path $(LIB_PATH) --start-addr $(START_ADDR) # LDFLAGS = -C "$(LD65_CFG)" -Ln $(BUILD_PATH)/$(PROJECT).ca.sym -m $(BUILD_PATH)/$(PROJECT).map --lib-path $(LIB_PATH) else ASFLAGS = -t $(TARGET) -I ../ -I $(BUILD_PATH) -I $(SDK_PATH)/macros -I $(SDK_PATH)/include -I $(SHELL_PATH) -I $(KERNEL_PATH) -D VERBOSE_LEVEL=$(VERBOSE) --auto-import - LDFLAGS = -t $(TARGET) --lib-path $(LIB_PATH) + LDFLAGS = -t $(TARGET) --lib-path $(LIB_PATH) --start-addr $(START_ADDR) # LDFLAGS = -C "$(LD65_CFG)" --lib-path $(LIB_PATH) endif diff --git a/src/cmnd/version.s b/src/cmnd/version.s index fc88533..9cf2298 100644 --- a/src/cmnd/version.s +++ b/src/cmnd/version.s @@ -56,7 +56,7 @@ ; - prints ;---------------------------------------------------------------------- .proc cmnd_version - prints "untar version 1.0 - 2022.2\r\n" + prints "untar version 1.0 - 2025.4\r\n" rts .endproc diff --git a/src/untar.s b/src/untar.s index 9d0a719..424857e 100644 --- a/src/untar.s +++ b/src/untar.s @@ -130,6 +130,9 @@ typedef .struct st_header unsigned char xtrk unsigned char psec + ; For XMAINARGS + unsigned short cbp_bkp + unsigned char argc ;---------------------------------------------------------------------- ; Variables @@ -169,20 +172,17 @@ typedef .struct st_header ; contient normalement des données sauvegardées par init qui est dans le segment "ONCE" ; init: ; rts + + startup: jsr zerobss - ; XMAINARGS - ; .byte $00, $2c - - ; sta argv - ; sty argv+1 - ; stx argc + initmainargs cbp_bkp, argc, 1 - lda #BUFEDT - sta cbp - sty cbp+1 + lda cbp_bkp + sta cbp + lda cbp_bkp+1 + sta cbp+1 ; Saute le nom de la commande ldy #$00 @@ -204,6 +204,7 @@ typedef .struct st_header adc cbp+1 jsr _main + mfree(cbp_bkp) rts .proc zerobss @@ -241,7 +242,7 @@ typedef .struct st_header L4: rts - rts + ; rts .endproc .segment "ONCE" @@ -319,6 +320,7 @@ MODULE , , startup jsr ermes end: crlf + rts .endproc