Skip to content

Commit

Permalink
Merge pull request #2 from orix-software/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jedeoric authored May 8, 2022
2 parents e68df01 + e030317 commit 0947745
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "deps/orix-sdk"]
path = deps/orix-sdk
url = https://github.com/assinie/orix-sdk.git
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 2022.2

Built in order to manage fd file open
22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -18,4 +18,5 @@ Changelog :
31/08/2017
* VHI files management
display number of frames
the size of the frame
the size of the frame

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.1
2022.2
1 change: 1 addition & 0 deletions deps/orix-sdk
Submodule orix-sdk added at 9d3ad5
2 changes: 1 addition & 1 deletion make.bat → run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
77 changes: 32 additions & 45 deletions src/file.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <peekpoke.h>
#include "version.h"
Expand Down Expand Up @@ -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)
Expand All @@ -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 : ");
Expand All @@ -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");
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -249,8 +237,7 @@ int main(int argc,char *argv[])
break;

case 1:
if (chars[1]==0)
{
if (chars[1]==0) {
orix_file();
}
break;
Expand All @@ -274,4 +261,4 @@ int main(int argc,char *argv[])
fclose(fp);

return 0;
}
}
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION "2021.1"
#define VERSION "2022.2"

0 comments on commit 0947745

Please sign in to comment.