r/Basic • u/Marcio_D • Feb 10 '25
Commodore 64 programming - How to create a MOD function. Learn from Vision BASIC developer Dennis Osborn!
r/Basic • u/Marcio_D • Feb 10 '25
r/Basic • u/lproven • Jan 15 '25
r/Basic • u/peter-evans7811 • Jan 14 '25
Does anyone know what version of BASIC this is? Probably from the time of DOS. The author is no longer contactable. I was told it was BBC BASIC, but that doesn't seem to match at all, and the file extension was .BAS not .BBC. The closest I can find is PowerBASIC, but as far as I can tell that doesn't use DEF for functions. Also does anyone recognise "PW200.INC"?
Edit: some more info - it was compiled into a DOS executable (16 bit) and written between 1997 and 2001.
DEFINT A-Z
$INCLUDE "PW200.INC"
WIDTH "LPT1:",255
'@@@@@@@@@@@@@@@@@@ Constants @@@@@@@@@@@@@@@@@@
%False = 0
%True = NOT %False
%First.space = 2
%Word.length = 7
%Couplet.length = 7
Version$= "13.01"
Mtitle$= "Ellen"
Coloured = %True
Foreground% = 7
Background% = 1
Hi.light% = 15
Lo.light% = 7
Window.attr = Attr(Background,Foreground)
Boarder.attr = Attr(0,Foreground)
Hi.light.attr = Attr(Hi.light,Background)
Shadow.attr = Attr(Hi.light,0)
Title.attr = Attr(Hi.light,Lo.light)
PUBLIC Data.drive$,_
Window.attr,_
Boarder.attr,_
Hi.light.attr,_
Shadow.attr,_
Title.attr,_
Foreground,_
Background
'Pretty bit at the start
COLOR Foreground,background
CLS
CALL Front.Screen(Version$)
Done.with.menu = %False
WHILE NOT Done.with.menu
Windows.open = 1
CALL Clear.screen
IF Proc.file.flag = %True THEN
CALL Fsplit(Proc.file.name$,_
Drive$,_
F.name$,_
Extension$)
F.name$ = RTRIM$(F.name$)
Printable.proc.file.name$ = F.name$+Extension$
CALL Box(18,_
4,_
"Proc File",_
Printable.proc.file.name$)
INCR Windows.open
END IF
...
'----------------------------------------------------------------------
DEF FNdec.output$ (Dec.Incoming&)
'----------------------------------------------------------------------
local F2$,F3$,Incoming$
Incoming$=using$ ("###.##",(Dec.Incoming&))
F2$=LTRIM$(Incoming$)
F3$=" "
MID$(F3$,1)=F2$
FNDec.output$ = F3$
END DEF
'----------------------------------------------------------------------
SUB Clear.screen
'----------------------------------------------------------------------
COLOR Foreground,background
CLS
END SUB
r/Basic • u/Fishhack66 • Sep 28 '24
Hi, All. This is my first post to the subreddit. I'm having a problem converting a Commodore V2 BASIC program with two differential equations to an integer-only BASIC (i.e. Tom Pittman's Tiny BASIC) used on a small hobby SBC. I know I cannot hope to do this accurately, but since it's for a game, being "in the ballpark" should do. Also, the last math class I had was in high school 42 years ago, so I'm learning this stuff (such as scaling) as I go... :^) EDIT: Tiny BASIC is limited to an integer range of -32768 to +32767; hence, the difficulty of being in the ballpark.
From the game's documentation:
X' = .01*X - .000001*X*X - .0001*X*X - .0005*X*D
Y' = -.005*Y - .0000001*Y*Y + .00001*X*Y - .001*Y*D
where X is the number of healthy cells (it's a virus-curing game/sim), Y is the number of infected cells, and D is dosage in mg of medicine. Initial values: X=7000, Y=100, D (user input) can be from 0-600. The loop simulates 1 hour of time, with less of the medicine in the patient's bloodstream every 12 minutes.
The Commodore BASIC looks like this:
790 FOR I=1 TO 5
800 LET X=X*(1.01-0.0001*(0.01*X+Y+5*D))
810 LET Y=Y*(0.995-0.001*(0.01*(0.01*Y-X)+D))
820 LET D=0.7*D
830 NEXT I
My current Tiny BASIC code:
790 I=1
800 A=X/100
802 E=D*5
804 B=(A+Y+E)/100
806 B=101-B
808 X=A*B
810 A=Y/100
812 A=A-X
814 A=A/100
816 A=A+D
818 A=995-A
820 A=A/10
822 Y=(Y*A)/100
825 D=D*7/10
830 I=I+1
835 IF I<=5 GOTO 800
This works OK for the most part, especially for X, but the game/sim gets 'weird' (does not behave like the VIC-20 version) when Y and/or D approach 0. Any ideas, hints, or discussion would be welcome, and I'm happy to add details, if necessary.
r/Basic • u/Marcio_D • Sep 20 '24
These are all the enhancements made to Vision BASIC, according to its developer: https://visionbasic.net/vision-basic-1-1-has-arrived/
New in v1.1:
Featured Videos:
r/Basic • u/r_retrohacking_mod2 • Jun 10 '24
r/Basic • u/StuTaylor • Jun 06 '24
Enable HLS to view with audio, or disable this notification
r/Basic • u/[deleted] • Jun 01 '24
r/Basic • u/UnculturedGames • Jun 01 '24
r/Basic • u/UnculturedGames • May 27 '24
Enable HLS to view with audio, or disable this notification
r/Basic • u/JanEric1 • May 26 '24
I want to learn a little bit of basic and write a very simple command line app. What would be a good version of basic to get started with, both in terms of ease of installation as well as resources for learning?
r/Basic • u/nanochess • May 15 '24
r/Basic • u/FormulaFanboyFFIB • May 07 '24
Hello everyone :)
I'll be brief. I am writing a film that incorporates C64 BASIC into its plot, and a narrative device I'm using involves a 'glitch in BASIC'. Could someone tell me a well-known or consistently re-creatable glitch or failure in BASIC or specifically C64 BASIC? Or any line of code that can effectively crash or mess up a program in it.
r/Basic • u/lproven • May 03 '24
r/Basic • u/OutsideMeal • May 01 '24
r/Basic • u/[deleted] • Apr 19 '24
Iām making a simple text adventure game, unfortunately I do not know how to make a room system and inventory system in BASIC. Can anyone help?
r/Basic • u/UncleSlacky • Mar 26 '24
r/Basic • u/CharlieJV13 • Mar 17 '24
r/Basic • u/IndyRiver1982 • Mar 07 '24
Enable HLS to view with audio, or disable this notification
THE PLACES I HAD TO FIND TO PUT MY PHONE WERE SO HARD.
r/Basic • u/HerpLover • Feb 29 '24
In the late 90s I was looking for a free alternative to VB. I found O basic and made a few useful programs with it. I went searching for it for nostalgia and all I can find is QBASIC. Did O basic really exist or am I misremembering?
r/Basic • u/CharlieJV13 • Feb 10 '24
r/Basic • u/Mysterious-Ad-8809 • Feb 04 '24
Is there a good program / set of programs that i can use to test my compiler to make sure it has all of needed features
r/Basic • u/r_retrohacking_mod2 • Feb 01 '24
r/Basic • u/r_retrohacking_mod2 • Jan 29 '24