Skip to content

Commit

Permalink
Updated 7800basic to latest release (v0.32)
Browse files Browse the repository at this point in the history
  • Loading branch information
chunkypixel committed Nov 5, 2023
1 parent 124523c commit 4e679c0
Show file tree
Hide file tree
Showing 57 changed files with 102 additions and 61 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The following enhancements and changes have been made to Atari Dev Studio:

## 0.9.5

* Updated 7800basic to v0.32 (Windows, Linux, macOS)

## 0.9.4

* Updated 7800basic to v0.31 (Windows, Linux, macOS)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ batari Basic created by Fred 'batari' Quimby is a BASIC-like language used in th

batari Basic is an external project is kindly currently maintained by Mike Saarna (RevEng) and can be downloaded separately [here](https://github.com/batari-Basic/batari-Basic). Further information is about this release is available here at [AtariAge](https://atariage.com/forums/topic/300856-official-home-for-batari-basic).

### 7800basic (release 0.31 - 20231031)
### 7800basic (release 0.32 - 20231105)
7800basic is a BASIC-like language for creating Atari 7800 games. It is a compiled language that runs on a computer, and it creates a binary file that can be run with an Atari 7800 emulator, or the binary file may be used to make a cartridge that will operate on a real Atari 7800. 7800basic is derived from batari basic, a BASIC-like language for creating Atari 2600 games. Special thanks to the bB creator, Fred Quimby, and all of the the bB contributors!

7800basic is included as part of this extension with many thanks to Mike Saarna (RevEng). 7800basic is an external project and can be downloaded separately [here](https://github.com/7800-devtools/7800basic). Further information about this release is available here at [AtariAge](http://atariage.com/forums/topic/222638-7800basic-beta-the-release-thread).
Expand Down
7 changes: 3 additions & 4 deletions out/bin/compilers/7800basic/7800bas.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@echo off
if X"%bas7800dir%" == X goto nobasic
:tryanyway
rem 7800preprocess <"%~f1" | 7800basic.exe -i "%bas7800dir%" -b "%1"
7800preprocess.exe <"%~f1" >"%~f1.pre"
7800basic.exe -i "%bas7800dir%" -b "%1" -p "%1.pre"
7800preprocess.exe <"%~f1" >"%~1.pre"
7800basic.exe -i "%bas7800dir%" -b "%~1" -p "%~1.pre"
if errorlevel 1 goto basicerror
del "%1.pre"
del "%~1.pre"
if X%2 == X-O goto optimize
7800postprocess -i "%bas7800dir%" > "%~f1.asm"
goto nooptimize
Expand Down
2 changes: 1 addition & 1 deletion out/bin/compilers/7800basic/7800bas.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern int firstcompress;
extern int dumpgraphics_index;
int maxpasses = 2;

#define BASIC_VERSION_INFO "7800basic v0.31"
#define BASIC_VERSION_INFO "7800basic v0.32"

int main (int argc, char *argv[])
{
Expand Down
Binary file modified out/bin/compilers/7800basic/7800basic Guide.pdf
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800basic.Darwin.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800basic.Darwin.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800basic.Linux.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800basic.Linux.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800basic.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800basic.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800filter.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800filter.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800header.Darwin.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800header.Darwin.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800header.Linux.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800header.Linux.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800header.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800header.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800makecc2.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800makecc2.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800optimize.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800optimize.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800postprocess.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800postprocess.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800preprocess.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800preprocess.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmt2asm.Darwin.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmt2asm.Darwin.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmt2asm.Linux.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmt2asm.Linux.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmt2asm.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmt2asm.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmtfix.Darwin.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmtfix.Darwin.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmtfix.Linux.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmtfix.Linux.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmtfix.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800rmtfix.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800sign.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/7800sign.exe
Binary file not shown.
14 changes: 11 additions & 3 deletions out/bin/compilers/7800basic/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
-bug - banners larger than 128 in 160B don't plot correctly.
-data with trailing comment and comma's don't get the trailing comma stripped
-bug - can't stick compression files into a directory.
-data with trailing comment and commas don't get the trailing comma stripped
-horizontal scrolling
-vertical scrolling
-resizezone
-incspritemapfile
-can create table of tile indexes (how?)
-can create a table of sprite hi-addresses
-can create a table of sprite lo-addresses
-animatesprites
Run through a specified number of lines of sprites each frame, and
animate. Sprites using palettes 0 and 4 are animated.
-callback: drawline

======================================================================

Horizontal Scrolling Notes

- uses sprites-as-tiles design
- sprite tiles are always 16 pixels wide
- 11 sprites cover the screen and the one edge.
- if the tiles aren't aligned at 16 pixel boundaries, just do the fine scroll.
- if the tiles are aligned at 16 pixel boundaries, setup the tile greater than 159 at the correct X, depending on scroll direction, with new graphics scroll, then do the fine scroll.
Binary file modified out/bin/compilers/7800basic/banksetsymbols.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/banksetsymbols.exe
Binary file not shown.
86 changes: 55 additions & 31 deletions out/bin/compilers/7800basic/includes/lzsa1compression.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
; Changes intruduced by Mike Saarna, 2023:
; -converted to DASM format.
; -generalised memory locations, for easier incorporation into 7800basic
; -removed self-modifying code, for use on rom-based platforms.
; -removed self-modifying code, for execution from rom.
; -added LZSAFASTCOPYBYTE optimisation ; +24 bytes rom, ~10% quicker
;
; get the original unmodified code from:
; https://raw.githubusercontent.com/emmanuel-marty/lzsa
Expand All @@ -52,22 +53,22 @@
;

LZSA_SMALL_SIZE = 0
LZSAFASTCOPYBYTE = 1 ; +11 bytes rom
LZSAFASTCOPYBYTE = 1 ; +24 bytes rom, ~10% quicker

; ***************************************************************************
; ***************************************************************************
;
; ZP memory allocations... (temp1-temp9 are 7800basic ZP locations)
LSZA1ZPRAM = temp1
lzsa_winptr = LSZA1ZPRAM ; 1 word.
lzsa_srcptr = LSZA1ZPRAM + 2 ; 1 word.
lzsa_dstptr = LSZA1ZPRAM + 4 ; 1 word.
LSZA1ZPRAM = temp1
lzsa_winptr = LSZA1ZPRAM ; 1 word (temp1+temp2)
lzsa_srcptr = LSZA1ZPRAM + 2 ; 1 word (temp3+temp4)
lzsa_dstptr = LSZA1ZPRAM + 4 ; 1 word (temp5+temp6)

; Doesn't need to be ZP allocations...
LSZA1TEMPRAM = temp7
lzsa_cmdbuf = LSZA1TEMPRAM ; 1 byte.
lzsa_cp_npages = LSZA1TEMPRAM + 1
lzsa_lz_npages = LSZA1TEMPRAM + 2
lzsa_cmdbuf = LSZA1TEMPRAM ; 1 byte (temp7)
lzsa_cp_npages = LSZA1TEMPRAM + 1 ; 1 byte (temp8)
lzsa_lz_npages = LSZA1TEMPRAM + 2 ; 1 byte (temp9)

; Alternate names for previous allocations...
lzsa_offset = lzsa_winptr
Expand All @@ -80,6 +81,25 @@ LZSA_DST_HI = lzsa_dstptr+1

lzsa1modulestart

if LZSAFASTCOPYBYTE = 1
.cp_fixpointer
; the optimised pointer adjustment fails if .cp_byte copied a whole page.
; so we deal with it as a special case here, out of the regular .cp_byte flow.
; this seems to happen so rarely that I have as of yet to see it with real data.
inc lzsa_srcptr+1 ; CC
inc lzsa_dstptr+1
bcc .cp_skip3 ; always taken
; each of these happen infrequently (~1 in 256 byte copies)
.cp_fixsrc1
inc lzsa_srcptr+1
clc
bcc .cp_skip1
.cp_fixsrc2
inc lzsa_dstptr+1
clc
bcc .cp_skip2
endif

; ***************************************************************************
; ***************************************************************************
;
Expand All @@ -89,6 +109,7 @@ lzsa1modulestart
; Args: lzsa_dstptr = ptr to output buffer
;


DECOMPRESS_LZSA1_FAST
lzsa1_unpack
ldy #0 ; Initialize source index.
Expand Down Expand Up @@ -134,7 +155,7 @@ lzsa1_unpack
.cp_got_len
tax ; Lo-byte of length.

ifnconst LZSAFASTCOPYBYTE
if LZSAFASTCOPYBYTE = 0

.cp_byte ; CC throughout the execution of this .cp_page loop.
lda (lzsa_srcptr),y ; 5
Expand All @@ -149,41 +170,44 @@ lzsa1_unpack
.cp_skip2
dex ; 2
bne .cp_byte ; 3
; ~29 cycles for X=1
; ~58 cycles for X=2
; ~87 cycles for X=3
; ~29 cycles overall for X=1
; ~58 cycles overall for X=2
; ~87 cycles overall for X=3
; ...
; ~174 cycles overall for X=6

else ; LZSAFASTCOPYBYTE
else ; LZSAFASTCOPYBYTE != 0

; according to 7800heat, this loop is hot. It runs on average ~6x.
.cp_byte ; CC throughout the execution of this .cp_page loop.
lda (lzsa_srcptr),y ; 5
sta (lzsa_dstptr),y ; 5

.cp_byte ; CC throughout the execution of this .cp_page loop.
lda (lzsa_srcptr),y ; 5+
sta (lzsa_dstptr),y ; 5+
iny ; 2
dex ; 2
bne .cp_byte ; 3
; ~17 cycles per iteration
bne .cp_byte ; 3/2
; ~17 cycles each iteration
tya ; 2
beq .cp_fixpointer ; 2 unlikely branch - only if we just copied a full page
adc lzsa_srcptr+0 ; 3
sta lzsa_srcptr+0 ; 3
bcc .cp_skip1 ; 3
inc lzsa_srcptr+1
clc
bcs .cp_fixsrc1 ; 2 (typical)
.cp_skip1
tya ; 2
adc lzsa_dstptr+0 ; 3
sta lzsa_dstptr+0 ; 3
bcc .cp_skip2 ; 3
inc lzsa_dstptr+1
clc
bcs .cp_fixsrc2 ; 2 (typical)
.cp_skip2
ldy #0 ; 2
; ~22 cycles overhead

; ~39 cycles for X=1
; ~56 cycles for X=2 (break-even)
; ~73 cycles for X=3
endif ; LZSAFASTCOPYBYTE
.cp_skip3
; ~24 cycles overhead, typical

; ~41 cycles for X=1 (+12 cycles vs non-optimized)
; ~58 cycles for X=2 ( 0 cycles vs non-optimized)
; ~75 cycles for X=3 (-12 cycles vs non-optimized)
; ...
; ~126 cycles for X=6 (-48 cycles vs non-optimized)
endif ; ! LZSAFASTCOPYBYTE = 0

.cp_npages
lda lzsa_cp_npages ; Any full pages left to copy?
Expand Down
2 changes: 1 addition & 1 deletion out/bin/compilers/7800basic/release.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.31
0.32
Binary file modified out/bin/compilers/7800basic/snip.Darwin.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/snip.Darwin.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/snip.Linux.x64
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/snip.Linux.x86
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/snip.Windows.x64.exe
Binary file not shown.
Binary file modified out/bin/compilers/7800basic/snip.exe
Binary file not shown.
39 changes: 21 additions & 18 deletions out/bin/compilers/7800basic/statements.c
Original file line number Diff line number Diff line change
Expand Up @@ -11308,26 +11308,29 @@ void set (char **statement)
}
else if (!strncmp (statement[2], "backupfile", 10))
{
assertminimumargs (statement, "set backupfile", 1);
// set backupname to statement[3]
removeCR (statement[3]);
char *backupstr=statement[3];
if (*backupstr == '\'')
backupstr++;
int t;
for(t=0;t<SIZEOFSTATEMENT;t++)
if (!backupflag)
{
if(backupstr[t]==0)
break;
if(backupstr[t]=='^')
backupstr[t]=' ';
}
if(backupstr[t-1]=='\'')
assertminimumargs (statement, "set backupfile", 1);
// set backupname to statement[3]
removeCR (statement[3]);
char *backupstr=statement[3];
if (*backupstr == '\'')
backupstr++;
int t;
for(t=0;t<SIZEOFSTATEMENT;t++)
{
if(backupstr[t]==0)
break;
if(backupstr[t]=='^')
backupstr[t]=' ';
}
if(backupstr[t-1]=='\'')
backupstr[t-1]=0;
if(OpenArchive(backupstr)==FALSE)
prerror ("set backupfile failed - couldn't write to '%s'",backupstr);
backupflag = TRUE;
backupthisfile(backupname);
if(OpenArchive(backupstr)==FALSE)
prerror ("set backupfile failed - couldn't write to '%s'",backupstr);
backupflag = TRUE;
backupthisfile(backupname);
}
}
else if (!strncmp (statement[2], "screenheight", 12))
{
Expand Down
1 change: 1 addition & 0 deletions out/compilers/seventyEightHundredBasicCompiler.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e679c0

Please sign in to comment.