Speed up BASIC programs with Quikrunch
#1
Floppy 
In issue number 17 of Loadstar, they published a very useful utility program for BASIC, written by Jeff Johnson.  The program is called Quikrunch and what it does is, it takes your BASIC program and makes it as small and fast as possible, without having to turn it into Machine Language. It will analyze your program, line by line, and put as much of it as possible into one line.

The result is, a much more compact program that becomes much faster to load and sometimes runs faster, depending on it's function.

Quikrunch is smart enough to know not to “crunch” things like IF statements and other commands that could damage the logic of the program. To use it, simply:

Code:
LOAD“QUIKRUNCH”,8,1

and then,

Code:
NEW


The next thing you do is load your BASIC program normally. Once it's loaded, enter the command:

Code:
SYS49152

and then press RETURN.

I ran Quikrunch on my Tea Timer program with the following results:

[Image: fetch.php?w=500&tok=a8f08a&media=reviews...ols_13.jpg]


The thing to note about running Quikrunch on your programs is, make sure you keep a copy of them “un-crunched.” Once the crunching is done, they become very difficult to decipher if you ever need to make corrections or changes.

Also, the program strips all REM statements to save on space.  Give it a try on your next BASIC program and see if it makes it any faster in LOADing and RUNning speeds.  You can find it on the attached D64 file below.


Attached Files
.d64   basic_tools.d64 (Size: 170.75 KB / Downloads: 88)
Reply
#2
Back in the day, I started using little snippets of ML to enhance my BASIC games; like for reading the joystick, moving sprites and even scrolling the screen sideways. It would be cool if someone were to make a library of such routines to help BASIC coders today.

Even better would be if you could work it into a compiler for BASIC.
Reply
#3
If I had them or knew where they were.... I'd library it up! Big Grin I'll see what I can find. I know Loadstar had all sorts of programming snippets like that in their disks. I'll go through their library too.
Reply
#4
It's got to be a better way for the less technically minded creatives out there to make games than using the truly revolting SEUCK.

BASIC itself is too slow, but a compiled version with some generic routines should be able to outperform SEUCK at least.

Then again, that might present the case for a new cross-platform game scripting language.

Of course, it's not that assembly language is difficult, but rather, that bending the C64 to your will is generally awkward, especially if you want to do anything exotic (which would probably always have to remain the preserve of pure assembly coding only due the C64's parsimonious raster time and CPU speed).
Reply
#5
Hmmm... this looks promising: https://www.youtube.com/watch?v=ldDOqGH11e0
Reply
#6
And it transpires that Robot Jet Action was written in C and compiled to 6502. Wow, what an a amazing achievement for a game made via an abstraction.

Here's the link to KickC on the Clique's Scene DataBase site: https://csdb.dk/release/?id=176985
Reply
#7
I only discovered this today:


"Vision BASIC" he calls it . Looks good for those who don't want to get their hands dirty with ML.
Reply
#8
Cool!
Reply
#9
There are so many tricks to speed up Basic on the C64. The 8bit show and tell guy has done a few videos about them and I was surprised at the options available and their effects.
Reply
#10
I also discovered, from 8bit show and tell, another game dev system for C64 (and Vic20) called Turbo Rascal, and it's free: https://lemonspawn.com/turbo-rascal-synt...but-begin/

Strangely enough, I am far more comfortable with ML than any of these other options, but I like to see them documented for the sake of creatives out there who always wanted to make their own C64 game (no names being mentioned!!!) but who don't want to learn ML.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)