Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums

Forums > C64 Coding > Compile basic program to .prg
2020-09-08 01:30

Registered: Mar 2020
Posts: 17
Compile basic program to .prg

I'm trying to google but I can't find any simple solutions on how to convert/compile a basic program into a .prg?

I just want to add joystick to this release and compile it into a .prg I can send over codenet to my C64:


I'm trying with MOSpeed and it's not going so great!
... 1 post hidden. Click here to view all posts....
2020-09-08 08:47

Registered: Apr 2010
Posts: 18
If you've got a basic program in a text file and you just want to convert that text file into a real C64 basic .prg file, you can use petcat. petcat is part of Vice (WinVice):
2020-09-08 11:04

Registered: Mar 2020
Posts: 17
Thanks for the replies, but no cigar.

The basic is very particular: http://move.rupy.se/file/fallen.txt

bbcompile gives a tiny .prg that does nothing.

petcat gives a larger file that doesn't work either...

I think it's time for me to either roll up my sleeves and rewrite everything from scratch or abandon ship.
2020-09-08 11:33

Registered: Apr 2010
Posts: 18
I just tried it myself: petcat does work when I used:
petcat -w2 -o fallen.prg fallen.txt
The thing is, the input file "fallen.txt" has some quirks that percat cannot handle.
Some examples:
- In "fallen.txt" in line 1, there is a questionmark "?" used as the abbrevation for print. Somehow, petcat doesn't recognize this and keeps the questionmark instead of using the print token.
- In several lines in "fallen.txt", the variables used are in uppercase letters. For instance: CM%, GM$, CN$, PH, and maybe more. petcat thinks that these uppercase letters are tokens of basic commands. Uppercase letter variables wouldn't work when you enter them on a regular C64 keyboard either, so all occurences of these would have to be replaced by corresponding lowercase variables.
- In several lines, the function "int" is written as "INT". Again, that should be lowercase.
So, if you patch the input file somewhat, it should work with petcat.
-- Edit: I patched the input file myself, and after several tries I think I've found and replaced all uppercase variables at last. There were several more, including single letter "T" and "X" variables that I missed before.
Also there were some occurences of "TO" (as in FOR ... = ... TO ...) that I had to convert to lowercase. Now the game works and I was able to play it (in WinVice).
2020-09-08 13:22
Silver Dream !

Registered: Nov 2005
Posts: 51
Quoting rupy
Thanks for the replies, but no cigar.
The basic is very particular: http://move.rupy.se/file/fallen.txt

And not much of a surprise that things don't go too well with it. Putting aside that there are lines longer than 80 chars even with abbreviated keywords (which makes editing on the C64 a nono), there are uppercase variable names (another nono). Rewriting without uppercase variables would be a bare minimum to try but I'd also drop the keyword abbreviations on the way. It should then tokenise correctly.
2020-09-08 13:32

Registered: Dec 2001
Posts: 9711
would be interesting to know what kind of tool the original author used - so you can avoid it =P
2020-09-08 13:51

Registered: Mar 2009
Posts: 3066
Quote: would be interesting to know what kind of tool the original author used - so you can avoid it =P

The whole backstory and process is told in the full docs, that you get when you buy the game, but its is also added in Fallen +2D.
2020-09-08 15:20

Registered: Dec 2001
Posts: 9711
unfortunately the only hint regarding tools is "I've setup the CBM Prg development environment and grabbed me a copy of Vice". Perhaps that means "CBM PRG Studio"? *shrug*
2020-09-08 20:31

Registered: Mar 2009
Posts: 3066
rupy also failed to mention that he would like to add joystick controls and compile it because he wants to sell it (?!). I read that on Lemon. Wtf..

Well the author does not seem to care, but that makes me not wanna help out.

Good luck rupy.
2020-09-08 21:11

Registered: Jul 2009
Posts: 481
For fun I copied over the basic program in the link above into c64 studio, upper cased it, expanded tokens and fixed the long lines. ran like a charm. Doubt it would tak long to replace the keyboard buffer reader with a joyport reader. You guys in GP already "cracked it" so why not add a patch for the original game or re-release it with joy support in addition to your bugfixes. Guess the sales prognosis would look pretty grim for Mr rupy then...

The original author can get in touch if he wanted to expand his game to assembler. I've tinkered with the code for my own dungeon crawler (yeah with joystick support this time^^) but way to lazy to design levels so perhaps these level algorithm could be integrated there for a more varied and full game experience.
2020-09-09 09:27

Registered: Jul 2009
Posts: 272
>C:0800 @zha@.2076 austrospeed 1e

Austro Speed Compiler
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Users Online
Sh0ckTr00per/Hokuto ..
Radd Maxx/SWIM
Guests online: 92
Top Demos
1 Christmas Megademo  (9.7)
2 Uncensored  (9.6)
3 Edge of Disgrace  (9.6)
4 Coma Light 13  (9.6)
5 Memento Mori  (9.6)
6 Unboxed  (9.6)
7 Comaland 100%  (9.6)
8 Lunatico  (9.6)
9 The Shores of Reflec..  (9.5)
10 X Marks the Spot  (9.5)
Top onefile Demos
1 Copper Booze  (9.8)
2 To Norah  (9.8)
3 Lovecats  (9.6)
4 The Sprite Demo  (9.6)
5 Elite Code Mechanics  (9.6)
6 Square Booze  (9.6)
7 Daah, Those Acid Pil..  (9.5)
8 Quadrants  (9.5)
9 Dawnfall V1.1  (9.5)
10 For Your Sprites Only  (9.5)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.4)
3 Fossil  (9.4)
4 Oxyron  (9.3)
5 PriorArt  (9.3)
Top Cover Designers
1 Duce  (9.8)
2 Electric  (9.8)
3 Junkie  (9.7)
4 The Elegance  (9.4)
5 Mermaid  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2021
Page generated in: 0.052 sec.