diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e5a951e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/orix-sdk"] + path = deps/orix-sdk + url = https://github.com/assinie/orix-sdk.git diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bcbc525 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# 2022.2 + +Built in order to manage fd file open \ No newline at end of file diff --git a/Makefile b/Makefile index 4b35f36..3b7d564 100644 --- a/Makefile +++ b/Makefile @@ -3,19 +3,35 @@ CFLAGS=-ttelestrat PROGRAM=file SOURCE=src/file.c -ASFLAGS=-C -W -e error.txt -l xa_labels.txt -DTARGET_ORIX +ASFLAGS=-C -W -e error.txt -l xa_labels.txt ifdef TRAVIS_BRANCH -ifeq ($(TRAVIS_BRANCH), master) +ifeq ($(TRAVIS_BRANCH), main) RELEASE:=$(shell cat VERSION) else RELEASE=alpha endif endif +ifeq ($(CC65_HOME),) + CC = cl65 + AS = ca65 + LD = ld65 + AR = ar65 +else + CC = $(CC65_HOME)/bin/cl65 + AS = $(CC65_HOME)/bin/ca65 + LD = $(CC65_HOME)/bin/ld65 + AR = $(CC65_HOME)/bin/ar65 +endif + $(PROGRAM): $(SOURCE) - $(CC) -o $(PROGRAM) $(CFLAGS) $(LDFILES) $(SOURCE) + $(CC) -o 800 $(CFLAGS) $(LDFILES) $(SOURCE) + $(CC) -o 900 $(CFLAGS) --config deps/orix-sdk/cfg/telestrat_900.cfg $(LDFILES) $(SOURCE) + + # Reloc + python deps/orix-sdk/bin/relocbin.py3 800 900 $(PROGRAM) 3 test: mkdir -p build/bin/ diff --git a/README.md b/README.md index e106113..f18cb41 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/oric-software/file.svg?branch=master)](https://travis-ci.org/oric-software/file) +[![build](https://github.com/orix-software/file/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/orix-software/file/actions/workflows/main.yml) File tool for Orix : http://orix.oric.org @@ -18,4 +18,5 @@ Changelog : 31/08/2017 * VHI files management display number of frames - the size of the frame \ No newline at end of file + the size of the frame + \ No newline at end of file diff --git a/VERSION b/VERSION index 3ad13fe..bb4b488 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2021.1 \ No newline at end of file +2022.2 \ No newline at end of file diff --git a/deps/orix-sdk b/deps/orix-sdk new file mode 160000 index 0000000..9d3ad50 --- /dev/null +++ b/deps/orix-sdk @@ -0,0 +1 @@ +Subproject commit 9d3ad504dffb6727c134eb62e4857c3e244ff731 diff --git a/make.bat b/run.bat similarity index 94% rename from make.bat rename to run.bat index 0190a55..f2e7dd1 100644 --- a/make.bat +++ b/run.bat @@ -2,7 +2,7 @@ SET BINARYFILE=file SET PATH_RELEASE=build\usr\share\%BINARYFILE%\ -SET ORICUTRON="..\..\..\oricutron-iss2-debug\" +SET ORICUTRON="D:\Users\plifp\Onedrive\oric\oricutron_twilighte" set VERSION=1.0.2 SET ORIGIN_PATH=%CD% echo %osdk% diff --git a/src/file.c b/src/file.c index d079d5c..27fdafc 100644 --- a/src/file.c +++ b/src/file.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "version.h" @@ -121,8 +122,7 @@ NOTES IMPORTANTES : Les octets des mots sont stockés sous la forme (c.-à-d., -void vhi_file() -{ +void vhi_file() { printf("VHI file\n"); printf("Format : "); if (chars[3]==0) @@ -140,8 +140,7 @@ void vhi_file() -void orix_file() -{ +void orix_file() { if (chars[2]=='o' && chars[3]=='r' && chars[4]=='i') { printf("Orix File\n"); printf("CPU Type : "); @@ -155,30 +154,29 @@ void orix_file() printf("Unknown CPU type\n.Orix won't start this binary\n"); return; } - if (chars[7]==SEDORIC_FILE) { - printf("Sedoric File (encapsulated in Orix header)\n"); - if (chars[13]==1) - printf("- Machine code\n"); + // Version 1 + if (chars[5]==1) { + printf("Loading adress : $%02hhX%02hhX\n",chars[15],chars[14]); + printf("End of loading adress : $%02hhX%02hhX\n",chars[17],chars[16]); + printf("Starting adress : $%02hhX%02hhX\n",chars[19],chars[18]); + printf("Size : %u bytes\n",(chars[16]+chars[17]*256)-(chars[14]+chars[15]*256)); + return; } - if (chars[7]==STRATSED_FILE) - printf("Stratsed File (encapsulated in Orix header)\n"); - if (chars[7]==FTDOS_FILE) - printf("FTDOS File (encapsulated in Orix header)\n"); - - printf("Loading adress : $%02hhX%02hhX\n",chars[15],chars[14]); - printf("End of loading adress : $%02hhX%02hhX\n",chars[17],chars[16]); - printf("Starting adress : $%02hhX%02hhX\n",chars[19],chars[18]); - printf("Size : %u bytes\n",(chars[16]+chars[17]*256)-(chars[14]+chars[15]*256)); + + if (chars[5]==2) { + printf("Format version 2 : reloc binary\n"); + printf("Map size : $%02hhX%02hhX\n",chars[19],chars[18]); + return; + } + + printf("Unknown format"); return; } - else - raw_file(); - - return; + printf("Unknown format"); +return; } -void usage() -{ +void usage() { printf("usage:\n"); printf("file FILENAME\n"); printf("file -v|--version : displays version\n"); @@ -190,24 +188,19 @@ int main(int argc,char *argv[]) { FILE *fp; int nb; - unsigned char val; - - if (argc==2 && (strcmp(argv[1],"--version")==0 || strcmp(argv[1],"-v")==0)) - { + if (argc==2 && (strcmp(argv[1],"--version")==0 || strcmp(argv[1],"-v")==0)) { version(); return 0; } - if (argc==2 && (strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-h")==0)) - { + if (argc==2 && (strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-h")==0)) { usage(); return 0; } - if (argc!=2) - { + if (argc!=2) { usage(); return(1); } @@ -218,23 +211,18 @@ int main(int argc,char *argv[]) printf("%c",val); } */ + fp=fopen(argv[1],"r"); - if (fp==NULL) - { + if (fp==NULL) { printf("Can't open %s\n",argv[1]); - /* - for (nb=0;nb<10;nb++) - { - val=PEEK(0x0590+nb); - printf("%c",val); - } */ return (1); } - + + + nb=fread(chars,SIZE_HEADER_TO_READ,1,fp); - switch (chars[0]) - { + switch (chars[0]) { case '#': if (chars[1]=='!') script_file(); @@ -249,8 +237,7 @@ int main(int argc,char *argv[]) break; case 1: - if (chars[1]==0) - { + if (chars[1]==0) { orix_file(); } break; @@ -274,4 +261,4 @@ int main(int argc,char *argv[]) fclose(fp); return 0; -} \ No newline at end of file +} diff --git a/src/version.h b/src/version.h index d94b668..ba9165e 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define VERSION "2021.1" +#define VERSION "2022.2"