Winter Simulator

Basic and Machine Language

Moderator: Moderators

Post Reply
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Winter Simulator

Post by Boray »

Here is a little program I made a couple of days ago:
http://home.worldonline.se/boray/datormuseum/winter.zip

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I just updated the program (same link) with user defined graphics in the tape buffer! (Just like Mobsie's tip in the programming forum). How cool! My first program with graphics that works on both expanded and unexpanded vic20!!!

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

i can't wait to show this to my daughter, she will freak!

maybe i will get her and i to pop in a christmas tree on the screen, in time for santa
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Here is a compiled version:
http://home.worldonline.se/boray/datorm ... inter2.zip

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Woo, it's getting rather fast. For comparison, I'm working on a complete ML rewrite of your little demo to see how much faster/smoother it can get. If I finish it, I will of course post it here with some commented source.
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Here is a version that is even a little bit faster
(to give you a little better competition ;) ) :
http://home.worldonline.se/boray/datorm ... inter3.zip

I tested out that when compiling with Austro compiler,
integers will be faster than floating point numbers
(quite excpected) and constants will be faster
than variables. Quite the opposite to the normal
interpretive CBM Basic where variables are faster
than constants and floating point numbers are faster than
integers....

So I changed all variables (that could be changed) into
integers and all variables that I just had used for speeding
up the basic was replaced with constants. It got a little
faster. Not overwhelmingly much, but a little.

I also noticed that you can't use integers in
FOR loops...? FOR A%=1 TO 1000 is not allowed...
(in the normal CBM basic - probably not in Austro either
because it seems to be 100% compatible).

I also tested the speed agains the normal basic, and
when running a compiled program on a PAL Vic-20, it
gets about as fast as running a normal basic program on
a 4MHz Vic-20!!!


Explanations:
Integers: For example A%=5, can only handle whole numbers.
Floating point numbers: For example A=5, can handle decimal numbers,
like A=5.23
Constants: For example 34, 123 etc... ;)

(I know you know this Anders, but in case someone who didn't
know is reading this...)

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Yes, it is true that you can not use integer variables in FOR loops, and the alternative (10 A%=A%+1:IF A%<xx THEN 10) is even slower. I think some other (non-Commodore) Basic dialects may allow those loops, but it doesn't matter here.

I'll return to this thread when I'm finished - got a little bored yesterday and were coughing too much to be productive.
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Here is a new version, and again, it's faster!
http://home.worldonline.se/boray/datorm ... inter4.zip

It turns out Austro compiler supports integers in
FOR loops as an extra feature! And this version is
now 1.4 times faster compared to the first compiled
version.

The only problem is that you can't test run a program
using integers in FOR loops before compiling it... But as
always there is a solution... When writing your program,
use a special variable that you use in all
FOR loops, for example called FFF. (FOR FFF=1TO200 etc...)
Then when your program is ready for the final compilation,
load it on your C64+Final Cartridge that is standing next
to your Vic20. On it, use the REPLACE command:
REPLACE FFF,F%
Save, and then compile it on the vic20...
Boray wrote:it
gets about as fast as running a normal basic program on
a 4MHz Vic-20!!!
Well, 3.4MHz is more like it....

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Mobsie
Vic 20 Drifter
Posts: 32
Joined: Mon Apr 26, 2004 7:51 am
Location: Germany

Post by Mobsie »

Yes,

it goes faster and faster. But now what can you do with the saved time ???

Maybe sometimes a Santaclaus who jump trugh the screen ?

It is wery interesting what people can do with good/clever programming. We can see this great in this Programm.

I often talk with modern/aktuel programmers, and when i see their programms wow. Wow i mean wow Bad.

If the programm is to slow, the customers must buy new computers, thats all.

Cheers
Mike
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

That last file seems to be a bit corrupt.... Sorry....
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

The latest version as well as a c64 version can be downloaded here:
http://home.worldonline.se/boray/datormuseum/snow.html

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

would be real nice if you can put an xmas tree in the middle ;)

chris
Post Reply