Skip to content

Commit 787890f

Browse files
authored
Merge pull request #13 from ryangray/on-err-fix_add-delete
Fix TS2068 ON ERR and add TS2068 DELETE
2 parents 837737c + 2decf63 commit 787890f

File tree

8 files changed

+48
-26
lines changed

8 files changed

+48
-26
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
- name: build_rman
1616
id: build_rman
1717
run: make -f Makefile
18-
- uses: actions/upload-artifact@v3
18+
- uses: actions/upload-artifact@v4
1919
with:
2020
name: rman
2121
path: ./rman
2222
- uses: actions/checkout@v2
2323
- name: Download rman
24-
uses: actions/download-artifact@v3
24+
uses: actions/download-artifact@v4
2525
with:
2626
name: rman
2727
path: rman
@@ -30,7 +30,7 @@ jobs:
3030
run: |
3131
chmod a+x ./rman/rman
3232
make -f Makefile
33-
- uses: actions/upload-artifact@v3
33+
- uses: actions/upload-artifact@v4
3434
with:
3535
name: zmakebas.guide
3636
path: ./zmakebas.guide
@@ -44,7 +44,7 @@ jobs:
4444
- name: build_os4
4545
id: build_os4
4646
run: make -f Makefile zmakebas
47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
with:
4949
name: zmakebas_os4
5050
path: zmakebas
@@ -58,7 +58,7 @@ jobs:
5858
- name: buildos3
5959
id: buildos3
6060
run: make -f Makefile.68k zmakebas
61-
- uses: actions/upload-artifact@v1
61+
- uses: actions/upload-artifact@v4
6262
with:
6363
name: zmakebas_os3
6464
path: zmakebas

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
make -f Makefile zmakebas
2121
mv ./zmakebas ./zmakebas_amigaos4
2222
- name: Upload Amiga PPC build
23-
uses: actions/upload-artifact@v3
23+
uses: actions/upload-artifact@v4
2424
with:
2525
name: zmakebas_os4
2626
path: ./zmakebas_amigaos4
@@ -37,7 +37,7 @@ jobs:
3737
make -f Makefile.68k zmakebas
3838
mv ./zmakebas ./zmakebas_amigaos3
3939
- name: Upload Amiga 68k build
40-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@v4
4141
with:
4242
name: zmakebas_os3
4343
path: ./zmakebas_amigaos3
@@ -53,13 +53,13 @@ jobs:
5353
- name: build_rman
5454
id: build_rman
5555
run: make -f Makefile
56-
- uses: actions/upload-artifact@v3
56+
- uses: actions/upload-artifact@v4
5757
with:
5858
name: rman
5959
path: ./rman
6060
- uses: actions/checkout@v3
6161
- name: Download rman
62-
uses: actions/download-artifact@v3
62+
uses: actions/download-artifact@v4
6363
with:
6464
name: rman
6565
path: rman
@@ -68,10 +68,10 @@ jobs:
6868
run: |
6969
chmod a+x ./rman/rman
7070
make -f Makefile
71-
- uses: actions/download-artifact@v3
71+
- uses: actions/download-artifact@v4
7272
with:
7373
name: zmakebas_os3
74-
- uses: actions/download-artifact@v3
74+
- uses: actions/download-artifact@v4
7575
with:
7676
name: zmakebas_os4
7777
- uses: "marvinpinto/action-automatic-releases@latest"

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2025-06-16 ryangray
2+
* Fix bug handling the TS2068 "ON ERR" keyword. It was changing toknum/
3+
toklen from ON to ON ERR, causing it to skip handling other tokens,
4+
notably RESET. Instead, just skip past "ERR" and stay with token "ON",
5+
handling the "ON ERR"/"ONERR" token later.
6+
* Add support for the TS2068 DELETE keyword (overlooked in v1.7.0).
7+
* Version 1.8.6
8+
19
2023-07-31 ryangray
210
* Fix bug of numbers after a + or - which followed a $ didn't include
311
the inline floating point bytes (such as: CODE a$-32)

Makefile.68k

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ zmakebas.guide: zmakebas.1
3838

3939
# The stuff below makes the distribution tgz.
4040

41-
VERS=1.8.5
41+
VERS=1.8.6
4242

4343
dist: tgz
4444
tgz: ../zmakebas-$(VERS).tar.gz

zmakebas.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.\"
66
.\" zmakebas.1 - man page
77
.\"
8-
.TH zmakebas 1 "31st July, 2023" "Version 1.8.5" "Retrocomputing Tools"
8+
.TH zmakebas 1 "16th June, 2025" "Version 1.8.6" "Retrocomputing Tools"
99
.\"
1010
.\"------------------------------------------------------------------
1111
.\"

zmakebas.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define MSDOS
2323
#endif
2424

25-
#define VERSION "1.8.5"
25+
#define VERSION "1.8.6"
2626
#define DEFAULT_OUTPUT "out.tap"
2727
#define REM_TOKEN_NUM 234
2828
#define PEEK_TOKEN_NUM 190 // :dbolli:20200420 19:00:13 Added ZX Spectrum PEEK token code (v1.5.2)
@@ -195,7 +195,8 @@ char *tokens[] = {
195195
"free", "",
196196
"sound", "",
197197
"stick", "",
198-
"onerr", "",
198+
"on err", "onerr", // code 123
199+
"delete", "", // code 12
199200
NULL
200201
};
201202

@@ -916,6 +917,10 @@ int main(int argc, char *argv[]) {
916917
if (alttok) toknum--;
917918
alttok = !alttok;
918919
if (**tarrptr == 0) continue;
920+
if (toknum == 122) {
921+
// Skip from toknum 123 (ON ERR) down to 12 (DELETE) as there are no keywords between them in the tokens array
922+
toknum = 12;
923+
}
919924
toklen = strlen(*tarrptr);
920925
// Check for table partition splitting special commands from standard commands (Alistair Neil))
921926
if (strcmp(*tarrptr, "-----") == 0) {
@@ -942,17 +947,18 @@ int main(int argc, char *argv[]) {
942947
*/
943948
if ((*tarrptr)[0] == '<' || (*tarrptr)[1] == '=' ||
944949
((!isalpha(ptr[-1]) && !isalpha(ptr[toklen]) && !( !zx81mode && ( (toknum == PEEK_TOKEN_NUM) || (toknum == VAL_TOKEN_NUM) ) && ( ptr[toklen] == '$' ))) // :dbolli:20200420 18:54:45 Added check for PEEK that is actually PEEK$ (v1.5.2) // :ryangray:20221120 Added check for VAL that is actually VAL$ (v1.7.2)
945-
&& toknum >= 123)) { // :dbolli:20200331 14:48:51 Changed from toknum > 150 to include ZX Spectrum Next keywords (v1.5.2)
950+
&& toknum >= 12)) { // :dbolli:20200331 14:48:51 Changed from toknum > 150 to include ZX Spectrum Next keywords (v1.5.2) :ryangray:20250612 Moved toknum limit to 12 for TS2068 "delete"
946951

947-
/* handle the ON keyword that is used by both ZX Spectrum Next ON ERROR and the T/S 2000 ON ERR
948-
* if ON is followed by ERR then convert from the ZX Spectrum Next ON token to the T/S 2000 ON ERR token
952+
/* Handle the ON keyword that is used by both ZX Spectrum Next ON ERROR and the T/S 2000 ON ERR
953+
* If ON is followed by ERR then it's the T/S 2000 ON ERR token not the Spectrum Next ON token,
954+
* so skip past "ERR" and continue looking for ON tokens. We'll look for "ON ERR" token later.
949955
*/
950956
if (!zx81mode && toknum == ON_TOKEN_NUM) {
951957
ptr2 = ptr + toklen;
952958
while (*ptr2 == ' ') ptr2++;
953959
if (strncmp(ptr2, ERR_TOKEN, ERR_TOKEN_LEN) == 0) {
954-
toknum = ON_ERR_TOKEN_NUM;
955-
toklen = (ptr2 + ERR_TOKEN_LEN - 1) - ptr;
960+
ptr = (ptr2 + ERR_TOKEN_LEN - 1); /* skip past ERR */
961+
continue;
956962
}
957963
}
958964

zmakebas.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 1,8,5,0
55-
PRODUCTVERSION 1,8,5,0
54+
FILEVERSION 1,8,6,0
55+
PRODUCTVERSION 1,8,6,0
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
6868
BLOCK "040904b0"
6969
BEGIN
7070
VALUE "FileDescription", "zmakebas"
71-
VALUE "FileVersion", "1.8.5.0"
71+
VALUE "FileVersion", "1.8.6.0"
7272
VALUE "InternalName", "zmakebas.exe"
73-
VALUE "LegalCopyright", "Copyright (C) 2023"
73+
VALUE "LegalCopyright", "Copyright (C) 2025"
7474
VALUE "OriginalFilename", "zmakebas.exe"
7575
VALUE "ProductName", "zmakebas"
76-
VALUE "ProductVersion", "1.8.5.0"
76+
VALUE "ProductVersion", "1.8.6.0"
7777
END
7878
END
7979
BLOCK "VarFileInfo"

zmakebas.readme

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Short: BASIC Text to ZX Spectrum/ZX81 .TAP/.P
22
Uploader: [email protected] (Chris Young)
33
Author: Russell Marks and others
44
Type: util/conv
5-
Version: 1.8.5
5+
Version: 1.8.6
66
Architecture: m68k-amigaos >= 2.0.4; ppc-amigaos >= 4.0.0
77

88
Quick port/recompile of zmakebas.
@@ -13,6 +13,14 @@ format.
1313

1414
Changelog:
1515

16+
2025-06-16 ryangray
17+
* Fix bug handling the TS2068 "ON ERR" keyword. It was changing toknum/
18+
toklen from ON to ON ERR, causing it to skip handling other tokens,
19+
notably RESET. Instead, just skip past "ERR" and stay with token "ON",
20+
handling the "ON ERR"/"ONERR" token later.
21+
* Add support for the TS2068 DELETE keyword (overlooked in v1.7.0).
22+
* Version 1.8.6
23+
1624
2023-07-31 ryangray
1725
* Fix bug of numbers after a + or - which followed a $ didn't include
1826
the inline floating point bytes (such as: CODE a$-32)

0 commit comments

Comments
 (0)