Tiny C64 (old school)
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Tiny C64 (old school)
[ESC] = quit
[F2] = load
[F3] = save
Download right click and save as: c64.bas
A little bit about the C64 BASIC
first all what you type on the C64 are in upper case
print "hello"
are
PRINT "HELLO"
In "direct mode"
BASIC commands can be typed and are directly executed after you press [enter]
command[:command][enter]
Example: show the number of free bytes for BASIC in direct mode
PRINT FRE(0)+65536[enter]
In "program mode"
BASIC commands are entered after a line number and stored in BASIC memory
number command [: command]
Example: print the numbers 1-10
10 FOR I=1 to 10
20 PRINT I
30 NEXT I
RUN[enter]
A BASIC program can be "list"ed
LIST[enter]
many commands have a shortcut
for example RUN or LIST
R[shift]+U
L[shift]+I
If your C64 BASIC program are longer than the screen
you can "list" only program lines you are looking for:
list 20
20 PRINT I
list -20
10 FOR I=1 to 10
20 PRINT I
list 20-
20 PRINT I
30 NEXT I
list 10-20
10 FOR I=1 to 10
20 PRINT I
In C64 BASIC you don't have label's or sub's
you jump from current executed line to another with:
goto linenumber
or you jump to a sub routine with:
gosub linenumber
the end of a sub routine must be marked with:
return
here are a short gosub example
10 print "line 10"
20 gosub 100
30 print "line 30"
40 end
100 print "line 100"
110 return
This mini C64 emulator I wrote in one night
has no fancy sprites or sound but you can
create fumy games with the famous Commodore font chars
the chars and colors can be poked directly in the video and color ram.
All about the C64 BASIC commands !
german:
https://www.c64-wiki.de/wiki/BASIC
english:
https://www.c64-wiki.com/wiki/BASIC
Joshy
Last edited by D.J.Peters on Oct 12, 2022 19:40, edited 16 times in total.
oldschool.bas
What version of freebasic does this use? I have 0.16 . . . doesn't compile - something to do with public? Regards Drew
-
- Posts: 5494
- Joined: Sep 12, 2005 20:06
- Location: California
Re: oldschool.bas
FB Dinosaur (.16)... >.>;;DrewPee70 wrote:What version of freebasic does this use? I have 0.16 . . . doesn't compile - something to do with public? Regards Drew
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Yeah, there have been a lot of features added since version 0.16, so it's not unusual now for code not to work in old compiler versions.
In version 0.18 though, there's been more effort made to provide compatibility with older programs, and the compiler offers multiple dialects - fb (the new default), deprecated (approximately compatible to version 0.16b and qb (designed to be more compatible with QBASIC). Currently, deprecated is probably the option that will best suit your code.
See this page for more details:
http://www.freebasic.net/wiki/wikka.php ... erdialects
What sort of problems have you had trying to upgrade? We're hoping to try and reduce the compatibility issues with older compiler versions.
In version 0.18 though, there's been more effort made to provide compatibility with older programs, and the compiler offers multiple dialects - fb (the new default), deprecated (approximately compatible to version 0.16b and qb (designed to be more compatible with QBASIC). Currently, deprecated is probably the option that will best suit your code.
See this page for more details:
http://www.freebasic.net/wiki/wikka.php ... erdialects
What sort of problems have you had trying to upgrade? We're hoping to try and reduce the compatibility issues with older compiler versions.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
If any plays with the Commodore 64 BASIC i added save and load
[F2] save basic prg
[F3] load basic prg
the BASIC tokens are saved not the ASCII text
Joshy
[F2] save basic prg
[F3] load basic prg
the BASIC tokens are saved not the ASCII text
Joshy
Code: Select all
10 FOR I=0 to 999
20 POKE 55269+I,I and 15
30 NEXT
totally bluffed
Gosh, I'm totally astonished by the elegance of the code, this is by far the best code posted on these forums for a while... This is a machine I knew very well and your program covers a lot of subjects. However the rom should not be made public like this, should it ?
-
- Posts: 5494
- Joined: Sep 12, 2005 20:06
- Location: California
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
A really great great program!
Thanks for the code.
@Hezad: i think so, my try was uncomplete http://www.freebasic.net/forum/viewtopic.php?t=9807
Thanks for the code.
@Hezad: i think so, my try was uncomplete http://www.freebasic.net/forum/viewtopic.php?t=9807
-
- Posts: 1706
- Joined: May 27, 2005 6:34
- Location: Cambodia, Thailand, Lao, Ireland etc.
- Contact: