Skip to content

Commit fb70be5

Browse files
committed
Updated 7800basic to 0.39
Updated readme and changelog
1 parent a3474d8 commit fb70be5

14 files changed

Lines changed: 114 additions & 24 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The following enhancements and changes have been made to Atari Dev Studio:
44

55
## 0.11.7
66

7+
* Updated 7800basic to v0.39 (wasm)
8+
* Combined verification of compiler files and permissions process
79
* Restored file permission validation for Linux & macOS regardless of whether using included or custom compilers (just in case)
810
* Added stopwatch timer for batari Basic and 7800basic build compilation
911

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ batari Basic created by Fred 'batari' Quimby is a BASIC-like language used in th
194194

195195
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).
196196

197-
### 7800basic (release 0.38 - 20250923 [WASM])
197+
### 7800basic (release 0.39 - 20251031 [WASM])
198198
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!
199199

200200
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).
-12.1 KB
Binary file not shown.
16.6 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

out/bin/compilers/7800basic/dasm

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
#!/bin/sh
2-
# Wrapper for wasmtime
3-
4-
if [ -z "$bas7800dir" ]; then
5-
echo "### ERROR: bas7800dir not set"
6-
exit 1
7-
fi
2+
# Wrapper for wasmtime with dynamic include directories
83

94
if ! command -v wasmtime >/dev/null 2>&1; then
105
echo "### ERROR: wasmtime not found in PATH"
116
exit 1
127
fi
138

14-
BNAME=$(basename "$0"|cut -d. -f1)
15-
wasmtime run --dir=. --dir="$bas7800dir" "$bas7800dir/$BNAME.wasm" "$@"
9+
BNAME=$(basename "$0" | cut -d. -f1)
10+
11+
# Build up list of --dir arguments
12+
DIRS="--dir=. "
13+
14+
for arg in "$@"; do
15+
case "$arg" in
16+
-I*)
17+
inc="${arg#-I}"
18+
DIRS="$DIRS --dir=$inc"
19+
;;
20+
esac
21+
done
22+
23+
# Run wasmtime with all dirs and original arguments
24+
exec wasmtime run $DIRS "$bas7800dir/$BNAME.wasm" "$@"
1625

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
@echo off
2-
REM Generic wrapper for running WASM tools via wasmtime
2+
REM Wrapper for running WASM tools via wasmtime with dynamic include directories
33

4-
setlocal
5-
6-
if "%bas7800dir%"=="" (
7-
echo ### ERROR: bas7800dir not set
8-
exit /b 1
9-
)
4+
setlocal enabledelayedexpansion
105

116
wasmtime --version >nul 2>&1
127
if errorlevel 1 (
@@ -15,7 +10,22 @@ if errorlevel 1 (
1510
)
1611

1712
set TOOL=%~n0
18-
wasmtime run --dir . --dir "%bas7800dir%" "%bas7800dir%\%TOOL%.wasm" %*
13+
set DIRS=--dir .
14+
set ARGS=
15+
16+
REM Parse command-line arguments
17+
for %%A in (%*) do (
18+
set "ARG=%%~A"
19+
REM Check if it starts with -I
20+
if "!ARG:~0,2!"=="-I" (
21+
set "INC=!ARG:~2!"
22+
REM Add this directory to --dir list
23+
set DIRS=!DIRS! --dir "!INC!"
24+
)
25+
)
26+
27+
REM Now run wasmtime
28+
wasmtime run %DIRS% "%bas7800dir%\%TOOL%.wasm" %*
1929

2030
endlocal
2131

out/bin/compilers/7800basic/includes/rmtplayer.asm

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ gsl_nextSongLine
498498
txa
499499
tay
500500
lda (ptrSongLines),y
501+
;* Check for special song line commands. Track numbers >= $FE are not real
502+
;* tracks, but control flow commands:
503+
;* $FE = Jump to a new song line pointer.
504+
;* $FF = Empty track line (handled in this 7800 port by setting a max pause).
501505
cmp #$fe ;* check for "goto line"
502506
bcs gsl_GotoOrEmpty ;* and handle it.
503507
;* (A) = Real track #
@@ -573,11 +577,12 @@ gtl_loopTracks
573577

574578
oo1i
575579
ldy trackn_idx,x
576-
;* Get a track data point
577-
;* 0 - 60 = Note, instr and volume data
578-
;* 61 - Volume only
579-
;* 62 = Pause/empty line
580-
;* 63 - Speed, go loop or end
580+
;* Get a track data point. The track data stream is a sequence of commands
581+
;* encoded by the first byte's value:
582+
;* 0-60 ($00-$3C): A new note. The next byte contains instrument/volume.
583+
;* 61 ($3D): Volume-only change for the current note.
584+
;* 62 ($3E): Pause. The next byte specifies duration.
585+
;* 63 ($3F): Control command (e.g., change speed, loop, or end track).
581586
lda (_ns),y
582587
sta rmtreg1
583588
iny
@@ -606,6 +611,10 @@ oo1i
606611
sta trackn_instrx2,x
607612

608613
gtl_ProcessVolumeData
614+
;* The note/instrument/volume data is packed into two bytes to save space.
615+
;* Byte 1: [vvnnnnnn] (v=volume bits 3&2, n=note)
616+
;* Byte 2: [iiiiii vv] (i=instrument, v=volume bits 1&0)
617+
;* This sequence unpacks the 4-bit volume from the two bytes.
609618
lda rmtreg2
610619
lsr
611620
ror rmtreg1
@@ -671,6 +680,15 @@ p2x2
671680
bne p2x1
672681
rts
673682

683+
;* rmt_play:
684+
;* This is the main player entry point, intended to be called once per frame
685+
;* It orchestrates all player state updates.
686+
;* The timing is controlled by two counters:
687+
;* 1. v_aspeed: Ticks per song line. When it reaches zero, a new line of
688+
;* track data is read by GetTrackLine. This is the "song tempo".
689+
;* 2. smc_silence_instrspeed: Ticks per instrument step. When it reaches
690+
;* zero, the instrument envelopes/effects are processed.
691+
;*
674692
rmt_play
675693
rmt_p0
676694
jsr SetPokey
@@ -759,6 +777,17 @@ returnfromInstrumentsEffects
759777
lda rmtreg2
760778
sta trackn_command,x
761779
and #$70
780+
;* This is the main instrument command dispatcher. The command number (0-7)
781+
;* is stored in the 3 bits of reg2 ($70 mask).
782+
;* The original player used self-modifying code here (sta jmx+1) to jump
783+
;* to the correct command handler.
784+
;* For a ROM-based system like the 7800:
785+
;* the jump has been changed to use a table of addresses (rts_tab). The code
786+
;* pushes the correct handler's address-1 onto the stack and executes an RTS,
787+
;* effectively performing a calculated JMP.
788+
;* For a RAM-based system:
789+
;* the jump uses self-modifying code to branch to the desired JMP
790+
;* instruction.
762791
lsr
763792
lsr
764793
IF ROM_BASED
@@ -998,6 +1027,15 @@ qq0 ora trackn_audctl,x
9981027
dex
9991028
bpl qq0
10001029
sta v_audctl
1030+
;* This section handles advanced audio effects that require multiple POKEY
1031+
;* channels. The priority system:
1032+
;* 1. Filters (highest priority): If a track enables a filter, it will
1033+
;* override the channel it needs (e.g., track 0 filter uses channel 2),
1034+
;* silencing whatever was playing there.
1035+
;* 2. 16-bit Bass (medium priority): If a filter is not active on a needed
1036+
;* channel, 16-bit bass can use it (e.g., track 1 bass uses channel 0).
1037+
;* 3. Normal Track Playback (lowest priority).
1038+
;* The code first checks for and applies filters, then checks for 16-bit bass.
10011039
qq1
10021040
ldx v_audctl
10031041
ELSE

0 commit comments

Comments
 (0)