animation during loading (in basic)?

Door kuuno

Master (231)

afbeelding van kuuno

20-06-2011, 10:17

Hi everybody,

Has anyone ever seen / made a progress animation during a file load from disk on the MSX 2?

I'm thinking of the following file sector reading construction.
file s = sector 100 - 200
So the ' s ' could be used in a ' next s ' loop, so you would have 100 steps for an animation.
I know that it will slow down the files loading proces, but i'm wondering if it can be done.

If you want to make it full automatic, I think you first need to figure out the total amount and the physical location of the sectors from the file.
Each sector needs to be put in the ram / vram and when done loading it needs to be executed.

How would this code look like in Basic?

Aangemeld of registreer om reacties te plaatsen


Enlighted (6980)

afbeelding van ARTRAG

20-06-2011, 13:35

which kind of file you want to load?
Using random access and records the thing you need is trivial
No need to go at sector level


Enlighted (6980)

afbeelding van ARTRAG

20-06-2011, 14:22

sample code

20 FIELD #1, 200 AS A$		: REM 200 is the line lenght
30 FOR I%=1 to 40 		: REM 40 is the number of lines
40  GET #1, I%
50  PRINT A$
70 CLOSE #1

use I%/40.0 as progress indicator

Van kuuno

Master (231)

afbeelding van kuuno

20-06-2011, 14:42

@artrag, I'm thinking about plain basic and image files, but perhaps also binary files (have some old psg sample here)
Damn. My basic knowledge is leaving me and so is my basic manual.
Trying to google for a MSX 2 basic manual now..
Let me try the code on my TR. Curious though, if this code is so simple, why did no one use it while loading files?
At least it would make watching a loading files screen more interesting to watch Wink


Enlighted (6980)

afbeelding van ARTRAG

20-06-2011, 20:19

my snippet cannot work for msx basic files
It could work for reading VRAM data if you read one line at time
or for reading data to be stored in basic arrays

Van Dreamerm42

Hero (625)

afbeelding van Dreamerm42

20-06-2011, 22:43

these subjects interest me, which is supposed to be "sample.dat?", which should go instead?

Van Salamander2

Expert (124)

afbeelding van Salamander2

21-06-2011, 07:43

games with animantion in loading screens:

arcus 2


Enlighted (6980)

afbeelding van ARTRAG

21-06-2011, 14:57

In the snippet, sample.dat is supposed to be a text file with 40 lines of lenght 200 characters each.
change the command FIELD #1, 200 AS A$
to have a different record format


Enlighted (6095)

afbeelding van NYYRIKKI

21-06-2011, 15:38

Sure it can be done but animation speed will be totally different on different machines... There are disk interfaces that will load only about 4KB/sec and the most fast HD interfaces can load almost 300KB/sec.