Skip to content

Commit 0947745

Browse files
authored
Merge pull request #2 from orix-software/develop
Develop
2 parents e68df01 + e030317 commit 0947745

File tree

9 files changed

+64
-53
lines changed

9 files changed

+64
-53
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "deps/orix-sdk"]
2+
path = deps/orix-sdk
3+
url = https://github.com/assinie/orix-sdk.git

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 2022.2
2+
3+
Built in order to manage fd file open

Makefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,35 @@ CFLAGS=-ttelestrat
33
PROGRAM=file
44
SOURCE=src/file.c
55

6-
ASFLAGS=-C -W -e error.txt -l xa_labels.txt -DTARGET_ORIX
6+
ASFLAGS=-C -W -e error.txt -l xa_labels.txt
77

88
ifdef TRAVIS_BRANCH
9-
ifeq ($(TRAVIS_BRANCH), master)
9+
ifeq ($(TRAVIS_BRANCH), main)
1010
RELEASE:=$(shell cat VERSION)
1111
else
1212
RELEASE=alpha
1313
endif
1414
endif
1515

16+
ifeq ($(CC65_HOME),)
17+
CC = cl65
18+
AS = ca65
19+
LD = ld65
20+
AR = ar65
21+
else
22+
CC = $(CC65_HOME)/bin/cl65
23+
AS = $(CC65_HOME)/bin/ca65
24+
LD = $(CC65_HOME)/bin/ld65
25+
AR = $(CC65_HOME)/bin/ar65
26+
endif
27+
1628

1729
$(PROGRAM): $(SOURCE)
18-
$(CC) -o $(PROGRAM) $(CFLAGS) $(LDFILES) $(SOURCE)
30+
$(CC) -o 800 $(CFLAGS) $(LDFILES) $(SOURCE)
31+
$(CC) -o 900 $(CFLAGS) --config deps/orix-sdk/cfg/telestrat_900.cfg $(LDFILES) $(SOURCE)
32+
33+
# Reloc
34+
python deps/orix-sdk/bin/relocbin.py3 800 900 $(PROGRAM) 3
1935

2036
test:
2137
mkdir -p build/bin/

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/oric-software/file.svg?branch=master)](https://travis-ci.org/oric-software/file)
1+
[![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)
22

33
File tool for Orix : http://orix.oric.org
44

@@ -18,4 +18,5 @@ Changelog :
1818
31/08/2017
1919
* VHI files management
2020
display number of frames
21-
the size of the frame
21+
the size of the frame
22+

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.1
1+
2022.2

deps/orix-sdk

Submodule orix-sdk added at 9d3ad50

make.bat renamed to run.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SET BINARYFILE=file
44
SET PATH_RELEASE=build\usr\share\%BINARYFILE%\
5-
SET ORICUTRON="..\..\..\oricutron-iss2-debug\"
5+
SET ORICUTRON="D:\Users\plifp\Onedrive\oric\oricutron_twilighte"
66
set VERSION=1.0.2
77
SET ORIGIN_PATH=%CD%
88
echo %osdk%

src/file.c

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
#include <conio.h>
23
#include <string.h>
34
#include <peekpoke.h>
45
#include "version.h"
@@ -121,8 +122,7 @@ NOTES IMPORTANTES : Les octets des mots sont stockés sous la forme (c.-à-d.,
121122

122123

123124

124-
void vhi_file()
125-
{
125+
void vhi_file() {
126126
printf("VHI file\n");
127127
printf("Format : ");
128128
if (chars[3]==0)
@@ -140,8 +140,7 @@ void vhi_file()
140140

141141

142142

143-
void orix_file()
144-
{
143+
void orix_file() {
145144
if (chars[2]=='o' && chars[3]=='r' && chars[4]=='i') {
146145
printf("Orix File\n");
147146
printf("CPU Type : ");
@@ -155,30 +154,29 @@ void orix_file()
155154
printf("Unknown CPU type\n.Orix won't start this binary\n");
156155
return;
157156
}
158-
if (chars[7]==SEDORIC_FILE) {
159-
printf("Sedoric File (encapsulated in Orix header)\n");
160-
if (chars[13]==1)
161-
printf("- Machine code\n");
157+
// Version 1
158+
if (chars[5]==1) {
159+
printf("Loading adress : $%02hhX%02hhX\n",chars[15],chars[14]);
160+
printf("End of loading adress : $%02hhX%02hhX\n",chars[17],chars[16]);
161+
printf("Starting adress : $%02hhX%02hhX\n",chars[19],chars[18]);
162+
printf("Size : %u bytes\n",(chars[16]+chars[17]*256)-(chars[14]+chars[15]*256));
163+
return;
162164
}
163-
if (chars[7]==STRATSED_FILE)
164-
printf("Stratsed File (encapsulated in Orix header)\n");
165-
if (chars[7]==FTDOS_FILE)
166-
printf("FTDOS File (encapsulated in Orix header)\n");
167-
168-
printf("Loading adress : $%02hhX%02hhX\n",chars[15],chars[14]);
169-
printf("End of loading adress : $%02hhX%02hhX\n",chars[17],chars[16]);
170-
printf("Starting adress : $%02hhX%02hhX\n",chars[19],chars[18]);
171-
printf("Size : %u bytes\n",(chars[16]+chars[17]*256)-(chars[14]+chars[15]*256));
165+
166+
if (chars[5]==2) {
167+
printf("Format version 2 : reloc binary\n");
168+
printf("Map size : $%02hhX%02hhX\n",chars[19],chars[18]);
169+
return;
170+
}
171+
172+
printf("Unknown format");
172173
return;
173174
}
174-
else
175-
raw_file();
176-
177-
return;
175+
printf("Unknown format");
176+
return;
178177
}
179178

180-
void usage()
181-
{
179+
void usage() {
182180
printf("usage:\n");
183181
printf("file FILENAME\n");
184182
printf("file -v|--version : displays version\n");
@@ -190,24 +188,19 @@ int main(int argc,char *argv[])
190188
{
191189
FILE *fp;
192190
int nb;
193-
unsigned char val;
194191

195-
196-
if (argc==2 && (strcmp(argv[1],"--version")==0 || strcmp(argv[1],"-v")==0))
197-
{
192+
if (argc==2 && (strcmp(argv[1],"--version")==0 || strcmp(argv[1],"-v")==0)) {
198193

199194
version();
200195
return 0;
201196
}
202197

203-
if (argc==2 && (strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-h")==0))
204-
{
198+
if (argc==2 && (strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-h")==0)) {
205199
usage();
206200
return 0;
207201
}
208202

209-
if (argc!=2)
210-
{
203+
if (argc!=2) {
211204
usage();
212205
return(1);
213206
}
@@ -218,23 +211,18 @@ int main(int argc,char *argv[])
218211
printf("%c",val);
219212
}
220213
*/
214+
221215
fp=fopen(argv[1],"r");
222-
if (fp==NULL)
223-
{
216+
if (fp==NULL) {
224217
printf("Can't open %s\n",argv[1]);
225-
/*
226-
for (nb=0;nb<10;nb++)
227-
{
228-
val=PEEK(0x0590+nb);
229-
printf("%c",val);
230-
} */
231218
return (1);
232219
}
233-
220+
221+
222+
234223
nb=fread(chars,SIZE_HEADER_TO_READ,1,fp);
235224

236-
switch (chars[0])
237-
{
225+
switch (chars[0]) {
238226
case '#':
239227
if (chars[1]=='!')
240228
script_file();
@@ -249,8 +237,7 @@ int main(int argc,char *argv[])
249237
break;
250238

251239
case 1:
252-
if (chars[1]==0)
253-
{
240+
if (chars[1]==0) {
254241
orix_file();
255242
}
256243
break;
@@ -274,4 +261,4 @@ int main(int argc,char *argv[])
274261
fclose(fp);
275262

276263
return 0;
277-
}
264+
}

src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define VERSION "2021.1"
1+
#define VERSION "2022.2"

0 commit comments

Comments
 (0)