Jump to content
Sign in to follow this  
Qwe

How to make a sector counter?

Recommended Posts

Hi friends,
is there somebody who knows how to show a sector counter while the program is loading?

Share this post


Link to post
Share on other sites

An XEX won't know what DOS or media it's loading from so it there's no general way to show a sector counter. However, you could break the XEX into many approximately sector-sized segments with INI segments in between. Each INI segment could call a routine to update a "sector" counter. That routine would be in one of the first segments that's loaded at the start of the XEX. The downside is that all these segments may cause inefficient disk reading behavior with possible redundant sector reads in some DOSes. Big segments usually load more efficiently.

 

If you create an ATR, you can write your own DOS which can show the sector counter efficiently. But many people prefer XEXs since they don't tie you to Floppy Disk hardware or emulations thereof.

Share this post


Link to post
Share on other sites
with xB (http://xxl.atari.pl/) it easy. xBUFSIZE stores sector size. xSEGMENT - amount of data to load. with this, you can calculate how many sectors file has. change of sectors check in variable xDAUX1 / 2 but simplest base on data in xSEGMENT.


like this:



  • Like 2

Share this post


Link to post
Share on other sites

That has a potentiall big colour change area, how does it handle IRQs at that time? Or is it using SIO polling method.

 

Another idea is the progress bar - it can be done by using some of the calculations of the Bresenham's line-draw algorithm to determine what the current X-pos of the line should be, given that you know the current buffer full state vs what it will be on full load.

Share this post


Link to post
Share on other sites

Or is it using SIO polling method.

 

yes, polling ( jsr xBIOS_SET_DEFAULT_DEVICE )

Share this post


Link to post
Share on other sites

Hi,
Thanks for your answers.
I though I did not understand properly, I was convinced that it was a resident task.
Is there no way to have an example commented in English? I don't know Polish.

Share this post


Link to post
Share on other sites

How it's implemented can depend on how the program loads and what media it's on.

 

In the old days the media was either floppy or tape in almost all cases and turbo loading was a rarity. But today we have the IDE class devices and turbo SIO is more common than standard.

Plus you have boot media vs executable file which in itself might be via simple boot menu, more complex boot menu or full blown Dos.

 

File loads are somewhat hard since you don't have any idea what the origin sector will be or what speed the data is coming down at.

Another possible method could be a short VBlank routine that monitors landmark memory locations where you know what data is expected then updates a progress meter or counter to suit.

It's not like you need exact 10th of a percantage accuracy, few progress meters even in the modern day are like that. Something that updates every 5% would be more than enough.

Edited by Rybags

Share this post


Link to post
Share on other sites

question is for what do you need a sector counter... to show how long it takes to load? or something else?

 

because checking the change of the sector registers of OS could trigger a counter.

Share this post


Link to post
Share on other sites

With file load by Dos or menu though you don't have the determination of what sector size is in use (could easily enough be deducted with a few closely packed Init segments).

Also you don't know the file ordering. A sector jump might take place e.g. from 100 to 300 in the space of 2 records but be due to fragmentation, not load speed.

 

I think - with specific media (disk) boot you're close to the hardware anyway and telling it directly what sectors you want which makes a counter easy.

With file based loads you're going through unknown layers of abstraction so the way to go would be landmark monitoring of pieces of memory.

Share this post


Link to post
Share on other sites

in Arsantica etc I only implemented sector counter loader... because it was released as ATRs so I new the layout and in Arsantica 3 I even had a custom IO loader so again... full control.

Share this post


Link to post
Share on other sites

Hi,

Thanks for your answers.

I though I did not understand properly, I was convinced that it was a resident task.

Is there no way to have an example commented in English? I don't know Polish.

 

It isn't an example, but at the start of this year I got all the different xBIOS documents at the time, translated them (with Google Translate) where it was required, cleaned them up and put them together into this:

https://atariwiki.org/wiki/Wiki.jsp?page=XBIOS

 

I'm not expert in xBios myself so feel free to update the documents if you would like to, though you'll need to get an AtariWiki account.

  • Like 4

Share this post


Link to post
Share on other sites

That's great, Snicklin. I've been interested in xbios, but severely handicapped by being "Polish language challenged!" Thanks for the link and your translation efforts.

Larry

  • Like 1

Share this post


Link to post
Share on other sites

Is this a standard size font sector counter or are you looking for a big Demo type counter?

 

Also are you talking BASIC or Machine code?

 

A machine code one should be pretty easy if its a standard normal size font one, as long as you know sector number, loading location and can do the simple incremental maths with a simple routine that updates your display then its not a huge task, I remember doing it many years ago for a disk copier I wrote (was a 2 drive copier simultaneous r/w rather than read X sectors and then write x sectors and it really was quite rubbish :)

 

 

Paul....

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...