-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic: use FreeBASIC/fbc for qbasic mode
- Update Dockerfile to Ubuntu 24.04. - Install FreeBASIC 1.10.1 instead of qb64. - Convert basicpp.py to remove qb64 specific console vs UI support. - Convert to use freebasic file open (and error handling specifically), and TIMER call. - Fix bug in step0 revealed by FreeBASIC: X% is not declared. Call DIM_MEMORY during startup. - Remove the whole line version of readline. The character at a time version works now for both implementations (and has the ability to backspace the line and exit with Ctrl-D).
- Loading branch information
Showing
11 changed files
with
67 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:wily | ||
FROM ubuntu:24.04 | ||
MAINTAINER Joel Martin <[email protected]> | ||
|
||
########################################################## | ||
|
@@ -9,10 +9,8 @@ MAINTAINER Joel Martin <[email protected]> | |
RUN apt-get -y update | ||
|
||
# Required for running tests | ||
RUN apt-get -y install make python | ||
|
||
# Some typical implementation and test requirements | ||
RUN apt-get -y install curl libreadline-dev libedit-dev | ||
RUN apt-get -y install make python3 | ||
RUN ln -fs /usr/bin/python3 /usr/local/bin/python | ||
|
||
RUN mkdir -p /mal | ||
WORKDIR /mal | ||
|
@@ -21,26 +19,25 @@ WORKDIR /mal | |
# Specific implementation requirements | ||
########################################################## | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
ca-certificates curl gcc g++ libasound2-dev \ | ||
libglu1-mesa-dev mesa-common-dev patch unzip wget \ | ||
xz-utils libncurses-dev | ||
|
||
# cbmbasic | ||
RUN apt-get install -y gcc unzip patch | ||
# Remove duplicate RAM (https://github.com/mist64/cbmbasic/commit/352a313313dd0a15a47288c8f8031b54ac8c92a2). | ||
RUN cd /tmp && \ | ||
curl -L https://github.com/kanaka/cbmbasic/archive/master.zip -o cbmbasic.zip && \ | ||
unzip cbmbasic.zip && \ | ||
cd cbmbasic-master && \ | ||
sed -i '/unsigned char RAM.65536.;/d' runtime.c && \ | ||
make && \ | ||
cp cbmbasic /usr/bin/cbmbasic && \ | ||
mv cbmbasic /usr/local/bin && \ | ||
cd .. && \ | ||
rm -r cbmbasic* | ||
|
||
RUN apt-get install -y g++ mesa-common-dev libglu1-mesa-dev libasound2-dev wget | ||
RUN cd /tmp && \ | ||
curl -L http://www.qb64.net/release/official/2017_02_09__02_14_38-1.1-20170120.51/linux/qb64-1.1-20170120.51-lnx.tar.gz | tar xzf - && \ | ||
cd qb64 && \ | ||
find . -name '*.sh' -exec sed -i "s/\r//g" {} \; && \ | ||
env EUID=1 ./setup_lnx.sh && \ | ||
mkdir -p /usr/share/qb64 && \ | ||
cp -a qb64 internal LICENSE programs source /usr/share/qb64/ && \ | ||
echo '#!/bin/sh\ncd /usr/share/qb64\n./qb64 "${@}"' > /usr/bin/qb64 && \ | ||
chmod +x /usr/bin/qb64 | ||
|
||
# qbasic (using freebasic: `fbc -lang qb`) | ||
RUN cd /opt && \ | ||
curl -L https://sourceforge.net/projects/fbc/files/FreeBASIC-1.10.1/Binaries-Linux/FreeBASIC-1.10.1-ubuntu-22.04-x86_64.tar.xz | tar xvJf - && \ | ||
ln -sf /opt/FreeBASIC-1.10.1-ubuntu-22.04-x86_64/bin/fbc /usr/local/bin/fbc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
REM READLINE(A$) -> R$ | ||
READLINE: | ||
EZ=0 | ||
PRINT A$; | ||
C$="":R$="":C=0 | ||
READCH: | ||
#cbm GET C$ | ||
#qbasic C$=INKEY$ | ||
IF C$="" THEN GOTO READCH | ||
C=ASC(C$) | ||
#qbasic IF ASC(C$)=8 THEN C=20:C$=CHR$(20) | ||
IF C=4 OR C=0 THEN EZ=1:GOTO RL_DONE: REM EOF | ||
IF C=127 OR C=20 THEN GOSUB RL_BACKSPACE | ||
IF C=127 OR C=20 THEN GOTO READCH | ||
IF (C<32 OR C>127) AND C<>13 THEN GOTO READCH | ||
PRINT C$; | ||
IF LEN(R$)<255 AND C$<>CHR$(13) THEN R$=R$+C$ | ||
IF LEN(R$)<255 AND C$<>CHR$(13) THEN GOTO READCH | ||
RL_DONE: | ||
#qbasic PRINT | ||
RETURN | ||
|
||
REM Assumes R$ has input buffer | ||
RL_BACKSPACE: | ||
IF LEN(R$)=0 THEN RETURN | ||
R$=LEFT$(R$,LEN(R$)-1) | ||
#cbm PRINT CHR$(157)+" "+CHR$(157); | ||
#qbasic LOCATE ,POS(0)-1 | ||
#qbasic PRINT " "; | ||
#qbasic LOCATE ,POS(0)-1 | ||
RETURN | ||
|
||
#cbm REM $INCLUDE: 'readline_char.in.bas' | ||
#qbasic-ui REM $INCLUDE: 'readline_char.in.bas' | ||
#qbasic-noui REM $INCLUDE: 'readline_line.in.bas' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters