Enterprise Forever

:UK => Programming => Topic started by: Sdw on 2016.September.11. 23:49:20

Title: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2016.September.11. 23:49:20
While programming my demo "First Contact", I was limited to what I could fit into a single tape-load (48kb) since loading from tape via audio-port from PC is the only way I can load things into my Enterprise.
I think I could have fit a bit more in if I loaded a smaller .com file, and then did file-loading from EXOS? Still, the limiting factor is still what fits into memory.
I had some ideas for effects that simply used too much memory (they would need to us almost all VRAM, and then quite a bit of stuff in normal RAM as well).
One solution would be to simply rely on a memory expansion being installed, but that seems like a "cheating" solution, and also not in the spirit of using what was available at the time (mid 80ies) when the computer was out.
However, if I understand correctly, the EXDOS expansion which allowed you to connect diskdrives was actually available back in those days?

On the C64 (which is what I grew up with) we have this technique called "IRQ-loading", which is where you can have an IRQ playing music that keeps running, even while you load new content from disk. That allows you to have longer demos with a continuous flow (music doesn't stop) while still using large amounts of RAM for each part.

Does anyone know if this is technically possible to do on the Enterprise?
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: endi on 2016.September.12. 00:13:06
it is possible to make special code for tape load, but with disk... I dont know

and check scroll demo, it has a nice lpt animation on loading
http://ep128.hu/Ep_Demo/Prg/Scroll_demo.rar
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: lgb on 2016.September.12. 01:44:03
There is one issue with IRQ-loading. On platforms like C64, everybody would expect for IEC-serial 1541 compatible drive or something like that. Even custom "disk turbo" routines are written, and everything is known how it works to the last time fragment precisions. However, on EP, because of the nice EXOS, it's really easy to use almost every possible storage methods. Some can have a real EXDOS card with floppy drive. Others use IDE hard disks. Nowadays, people like SD-card cartridge. These are transparent, thanks to the EXOS/EXDOS. However if you want something, like an IRQ loader, you should do things at the hardware level, because EXOS/EXDOS would be too "complicated" and also requires intact system segment, maybe enough RAM to be allocated during the process etc. But you can't expect for every possible solutions in your program, to do it at your own.

I'm not sure about this, but maybe you can try to have a simple effect, and only update it from IRQ, letting EXDOS/EXOS do its work to load meanwhile. But I guess it can even disable interrupts and other problems you would face ...

These are just my ideas, do not get me word-by-word ...
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: ergoGnomik on 2016.September.12. 07:35:07
Although what lgb (https://enterpriseforever.com/profile/?u=6) wrote is absolutely true, I don't see the picture that black. What Sdw (https://enterpriseforever.com/profile/?u=410) could do is setting system requirements. Every IRQ-loading C64 demo expect 1541 compatible disk drive, although recent loader system support a wide variety of IEC drives, that is a restriction in itself. It is obvious that those demos won't run from tape or IEEE-488 drives.

The original EXDOS is built on WD177[0|2] FDCs. These support 250kbps and 125kbps data streams. This means that on an unmodified Enterprise there are 128 or 256 clock cycles between two data bytes read from the disk. He should pick a fixed format and produce his demo in that, setting system requirements something like for example 5.25" disk formatted in 125kbps. If he does that there maybe won't occur insurmountable difficulties in loading during running some kind of effect or simply playing music. Obviously, he'll have to directly program the FDC. But this is only theory. There will be numerous challenges to face, and this will deny EXOS compatibility. Sdw will have to walk an untrodden path.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: IstvanV on 2016.September.12. 08:07:45
When programming the FDC directly, other tricks may also be used, like reducing the sector size to 128 bytes. That way, it is possible to read sectors between 50 Hz interrupts. Of course, it would require non-standard formatting, and also lower level FDC emulation in emulators (ep128emu only has that for the CPC, where many games and demos require it). :oops:

But not using IRQ loading is also less of a problem than on the C64, instead of only a few KB/s, you can read at more than 20 KB/s from a DD disk, so the next part can be loaded in a few seconds.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: lgb on 2016.September.12. 08:11:40
You're right, just some people don't have or don't want even to have floppy drive, because using an SD-card is so much easier :) Think about IDE64 for C64. Its IDEDOS is nice enough though it will fail every time if software doesn't use standard KERNAL entry points, and doing direct (ie: hardware level) access, or even just the IEC related KERNAL functions. By depending on some hardware you risk the same situation happening. With EP exactly because the EXOS/EXDOS (as OS too) people usually don't worry about issues like this. At the other hand, that's also true, that direct hardware programming is the way to "extract" the max out of the machine ... Hmmmm.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: ergoGnomik on 2016.September.12. 08:57:35
You're right, just some people don't have or don't want even to have floppy drive, because using an SD-card is so much easier :) Think about IDE64 for C64. Its IDEDOS is nice enough though it will fail every time if software doesn't use standard KERNAL entry points, and doing direct (ie: hardware level) access, or even just the IEC related KERNAL functions. By depending on some hardware you risk the same situation happening. With EP exactly because the EXOS/EXDOS (as OS too) people usually don't worry about issues like this. At the other hand, that's also true, that direct hardware programming is the way to "extract" the max out of the machine ... Hmmmm.
You are absolutely right. However, the fact regarding C64 demos is that, although there are modern storage solutions, the standard is the old obsolete floppy disk. IDEDOS or SD2IEC demos are not the norm but the exception. Usually, there is only KERNAL fallback to support these. Depending on obsolete hardware makes the retro feeling complete. If it was not an important point of view the old computers could have been replaced with emulators completely. And if I see it right, the Spanish section is insistently working on cloning the original EXDOS cards.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: lgb on 2016.September.12. 09:24:53
You are absolutely right. However, the fact regarding C64 demos is that, although there are modern storage solutions, the standard is the old obsolete floppy disk. IDEDOS or SD2IEC demos are not the norm but the exception. Usually, there is only KERNAL fallback to support these. Depending on obsolete hardware makes the retro feeling complete. If it was not an important point of view the old computers could have been replaced with emulators completely. And if I see it right, the Spanish section is insistently working on cloning the original EXDOS cards.

Well I can't agree with this, sorry, but there is nothing wrong about that :D I mean, EP exactly has the so modern/versatile/modular/etc (compared to its age) OS that it won't cause problem at all. It's not the case of C64, since it simply hasn't got anything like this, so there couldn't be a standard "strong" software level interface (at least nothing like on EP) thus of course nobody wanted to push things through some primitive/slow/etc kernal functions cannot be even compared to the EXOS/EXDOS (I mean the software part of EXDOS here now) infrastructure.

One thing is clear: I wouldn't ever want a real floppy for EP :) I know, that is *MY* problem :) But for C64 as well, I would use SD2IEC if that's enough (and if it's not, maybe 1541 ultimate, though it's kinda expensive, so I have to forget it). Retro feeling is interesting, from some aspects I am great fan of retro computing, but not because the storage methods, that's something I am very sure about :) "Making the feeling complete" - that's a subjective topic. For me, this way it's complete. We're not in the past. We can't just deny our present, I want to combine things, for me, that's the complete. However, others can feel otherwise.

I can't get your point though, what kind of "emulators" do you mean here? We're talking about the real EP ...
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: lgb on 2016.September.12. 09:32:14
But anyway that was only a note from me (I just mentioned since I remember I was confused with EP a lot because its so versatile OS compared to other 8 bit micros), that not everybody has or want to have "real floppy drive" stuff. Still, it would be interesting to see a software to "exploit" everything, ie with direct hw access :D Even like using floppy drives.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2016.September.12. 09:42:03
When programming the FDC directly, other tricks may also be used, like reducing the sector size to 128 bytes. That way, it is possible to read sectors between 50 Hz interrupts.
I worked on this thing about 22 years ago :-) It is used real 8 sectored disk (formated with FAFO) and played MusicBox music. And yes, I used own low level disk I/O.
It was near to good. Probably using smaller sectors will be more realiable.

But as the others say: todays not a good idea develop floppy only softwares.

Soo, loading music not easy*, but the Enterprise can do another trick: Nick chip with multi screen LPT can play small animations without CPU usage. These can work with any loading source, including tape. Some demos using this trick (for example most of Nasa&Guy demos).

* easy with SD or IDE :-)
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: geco on 2016.September.12. 09:49:14
Soo, loading music not easy*, but the Enterprise can do another trick: Nick chip with multi screen LPT can play small animations without CPU usage. These can work with any loading source, including tape. Some demos using this trick (for example most of Nasa&Guy demos).

* easy with SD or IDE :-)
Or slow music with Floppy also by loading small packages, it could be work also, no?
Trantor used also animation during loading, and I used it also in Buzzsaw conversion, and Wavplayer is using it during wav play.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: ergoGnomik on 2016.September.12. 09:52:11
/OFF
Well I can't agree with this, sorry, but there is nothing wrong about that :D I mean, EP exactly has the so modern/versatile/modular/etc (compared to its age) OS that it won't cause problem at all. It's not the case of C64, since it simply hasn't got anything like this, so there couldn't be a standard "strong" software level interface (at least nothing like on EP) thus of course nobody wanted to push things through some primitive/slow/etc kernal functions cannot be even compared to the EXOS/EXDOS (I mean the software part of EXDOS here now) infrastructure.

One thing is clear: I wouldn't ever want a real floppy for EP :) I know, that is *MY* problem :) But for C64 as well, I would use SD2IEC if that's enough (and if it's not, maybe 1541 ultimate, though it's kinda expensive, so I have to forget it). Retro feeling is interesting, from some aspects I am great fan of retro computing, but not because the storage methods, that's something I am very sure about :) "Making the feeling complete" - that's a subjective topic. For me, this way it's complete. We're not in the past. We can't just deny our present, I want to combine things, for me, that's the complete. However, others can feel otherwise.

I can't get your point though, what kind of "emulators" do you mean here? We're talking about the real EP ...
OK, but this simplifies the answer of Sdw's question to "not at all, or maybe in some botched way". I can't see enough resources in the EP that would enable doing under EXOS what he'd like to do. But proving me wrong is welcome anytime. I only offered a theory about a different solution that seems to be feasible, although it goes against the beauty of the EXOS system.

Well, yes. Discussing taste is an endless exercise in futility.

My point about emulators generically was that if we start arbitrarily omitting parts of these obsolete systems we may shortly arrive to using emulators only, or giving it up altogether. And as the man said himself:
One solution would be to simply rely on a memory expansion being installed, but that seems like a "cheating" solution, and also not in the spirit of using what was available at the time (mid 80ies) when the computer was out.
However, if I understand correctly, the EXDOS expansion which allowed you to connect diskdrives was actually available back in those days?
/ON
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: lgb on 2016.September.12. 10:12:45
/OFFOK, but this simplifies the answer of Sdw's question to "not at all, or maybe in some botched way". I can't see enough resources in the EP that would enable doing under EXOS what he'd like to do. But proving me wrong is welcome anytime. I only offered a theory about a different solution that seems to be feasible, although it goes against the beauty of the EXOS system.

Well, yes. Discussing taste is an endless exercise in futility.

My point about emulators generically was that if we start arbitrarily omitting parts of these obsolete systems we may shortly arrive to using emulators only, or giving it up altogether. And as the man said himself:/ON

I see. Not the same, but it's again *my* taste :) For me the computer is over at its case. Floppy disk etc, not the part of the computer, so can be replaced. Memory expansion is more tightly integrated part of the system though, than "only" the storage solution (OK, that is a bit "because I think this way" kind of statement, but anyway ...). However even that is a kinda odd in case of EP. Not in a negative way ... Just think about C64 again, which was not so much designed to have more memory, and kinda awkward solutions are needed. EP has the clean design of 4Mbyte address space "built-in" and "already" and even you should not assume "where is the RAM" (which segment, I mean, surely the 64K VRAM can be treated as "always there"), since even 128K can be constructed (even when you would think, EP128 has 128K a same way, that's not true, or at least not always!) using different segment numbers. So even this is a thing, you should rely on OS, to allocate RAM, and not just start reading/writing, you think RAM is. So I just wanted to note, that EP has the "magical" feeling, that it's more versatile compared to other 8 bit micros, that can cause even problems, if you are about using the hardware directly. In same cases, at least :) But yes, the 128K RAM stuff maybe a bit extreme idea (but not so much, there are EP64s expanded to 128, maybe also EXOS replaced, so they are "almost EP128" but maybe not the same memory segment layout ... EXOS - I think - wouldn't have problem with this, but you will, if you think RAM should be there as you think), the question of storage is a more common "problem" at least in this topic.

But again: I would love to see some tricks using WD177x, demo effect etc, together :)
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2016.September.12. 10:21:13
And if I see it right, the Spanish section is insistently working on cloning the original EXDOS cards.

This is true, but it  can change soon when almost all of them get SD-adapters. The same people that build the clone Exdos are now eager of getting the most modern and easy approach of the SD-cartridge. Soon, if Pear doesn't remedies it(joke...), Szorg's will be THE STANDARD on most EPs.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2016.September.12. 10:27:48
Interesting discussion, thanks for all your answers!

Sadly it seems like the conclusion I can draw is that it is not possible to do it, at least not in a way that works for all setups.
And since the target audience for an Enterprise demo is very small from the beginning, doing something that only works on a very specific setup seems like a bad idea.
If I were to buy something myself, it would probably be the SD-adapter (as I think that is more reasonably priced than trying to get an EXDOS, and also seems like a much more convinent setup) - and then I would like to do a demo that worked on that, but also on something that was available in the 80ies.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2016.September.12. 10:32:56
While programming my demo "First Contact", I was limited to what I could fit into a single tape-load (48kb) since loading from tape via audio-port from PC is the only way I can load things into my Enterprise.
Ask SzörG about SD adapter. But there is a long wait list :-(
Another idea: ask Pear or the spanish team about EXDOS clone.

Quote
I think I could have fit a bit more in if I loaded a smaller .com file, and then did file-loading from EXOS? Still, the limiting factor is still what fits into memory.
Yes. Many demos using multi parts mode, for example the Small Demo are about 640K total, but running on 128 machine.

Quote
One solution would be to simply rely on a memory expansion being installed, but that seems like a "cheating" solution, and also not in the spirit of using what was available at the time (mid 80ies) when the computer was out.
It is true. But - for probably later projects: many expanded machine waiting for a programs which realy use the more memory :-) And there are also a turbo machines... will be interesting to see waht the Enterprise can do on 6-7.12-10Mhz with 512K-1M memory :-)

Quote
However, if I understand correctly, the EXDOS expansion which allowed you to connect diskdrives was actually available back in those days?
Yes, EXDOS system used with real floppy drives, or hard disk/SD card. On software side no difference (just the drive letter like as the PC), EXDOS originally designed (http://ep128.hu/Ep_Konyv/Pic/Exdos.gif) for handling disk expansions.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: ergoGnomik on 2016.September.12. 10:39:20
EXDOS + Lotharek's floppy emulator?
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: pear on 2016.September.12. 10:53:53
I already proposed something similar (https://enterpriseforever.com/hardware/creating-exdos-card-clone/msg57697/#msg57697) (based on Gotek), but Zozo said that it makes no sense.
And rightly so.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: lgb on 2016.September.12. 11:30:19
This is true, but it  can change soon when almost all of them get SD-adapters. The same people that build the clone Exdos are now eager of getting the most modern and easy approach of the SD-cartridge. Soon, if Pear doesn't remedies it(joke...), Szorg's will be THE STANDARD on most EPs.

Well, yes, I wanted to say this more or less too, that it seems, everybody uses SD card soon :) Well not literally, but ... kind of the "new standard" ... It seems for *me* at least! And not even counting the filesystem issue, what will happen, if EXDOS ROM (for SD, for example) will have FAT16 support ... then even, if some can do direct hw access, must deal with the filesystem. Even sticking with FAT12, on SD you have partitions, on floppy you don't have ... On C64 it's "easier" as the 1541/SD2IEC/whatever are "smart" devices as well, they are really computer at its own too (SD2IEC is maybe not a fair example but it's that too, just an Atmel AVR ... but the real 1541 is a better example).

That's interesting though, if low level (DISKIO?) routines can be used directly in the OS, bypassing the large amount of EXDOS etc code ...
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.14. 17:31:04
I've been thinking a bit more about this. Now that I have a SD-card reader, it would be cool to make something that works with that, but that also works for older storage solutions.

If the SD-card reading is fast enough, could you do something like this?

Code: [Select]
1) Load N bytes, where N is a number that you know is going to take less than one frame to read from SD card
2) Wait for VBL (to keep timing for music correct)
3) Call music player
4) Goto 1 until all data is loaded

That way if you run the demo on something that is slower than the target, the only thing that happens is that the music will slow down considerably while loading (step 1 will take more than one frame). Music will still be in sync when next part starts, since the number of calls to the music player is always the same.

Would this work? Or does the EXDOS disk routine not give you that kind of control (ie. that you can tell it to load exactly N bytes from a file)
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: geco on 2017.April.14. 20:27:10
You can tell to EXDOS also to load N byte, but if you use EXOS you can tell there also to load N byte, EXOS fill 1st a buffer, and if it is filled then N byte is read from there, I do not know what is the size of this buffer for DISC, I guess it is 256 or 512 bytes, I do not know if EXDOS works in the same way, or there you can load directly smaller portions, but I think your plan works, the main question is how fast, within 1-4 frames?
I think it will be loaded within 1 frame by SD.
Even your method works with tape also, the tape loads a 4K block to the buffer, your program reads n byte, wait video IRQ, call music player loop until ends, just who uses tape have to wait 16 sec between 4K blocks ;)
I made a test program, file buffer is 512 bytes if floppy is used, my SD card config does not work in the emulator :(
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.14. 23:19:09
Thanks for looking into this!

I must admit that I'm not quite sure about the differences between EXOS (which I assume is the built in Enterprise ROM OS) and EXDOS.

Something I did think about though is that in addition to the loading, there must be some kidn of file-seek/setup operation, and that might be a big problem as well.

So in essence, what would happen would be something like:

1 ) Effect 1 has finished
2 ) Time to load
3 ) Seek file "PART2.BIN"
4 ) WaitVBL
5 ) Play music
6 ) Load 512 bytes from PART2.bin
7 ) WaitVBL
8 ) Play music
9 ) Load next 512 bytes from PART2.BIN
etc.

The thing is, step 3 must also not take more than one frame, otherwise the music will skip.

Also I did some calculations, and loading 512 bytes per frame might ot sound much, but that is actually 25600 bytes per second! That's quite a lot for an old 8-bit system, I'm not sure if even the SD-card solution can keep up with that?

-edit-

I found some interesting stuff here:
http://ep.homeserver.hu/Dokumentacio/Konyvek/EXOS_2.1_technikal_information/exos/kernel/Ch4.html#4.1
Are these the calls that could be used?
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: geco on 2017.April.15. 09:15:57
Yes, file seeking can, and if the floppy head is in wrong position when the program wants to read next block can cause delay in sound playback, but file seeking can be done once, you can make extremely big files on enterprise if you need.
EXDOS is the disc operating system, EXOS is the operating system of ep :-)
Yes, EXOS n calls (rst 30h n) can be used for loading:
  LD A,channel number
  LD DE,file nam address
  EXOS 1            ;open file
  LD A,channel number
  LD BC,load length
  LD DE,load address
  EXOS 6           ;load data (this can be repeated before closing the file)
  LD A,channel number
  EXOS 3           ;close file

If EXOS call successful, A register is zero, and Z flag set, otherwise Z clear, and A contains án error code.

back to sound playback, you need to create an own interrupt before loading, because EXOS interrupt would overwrite Dave sound registers, and after loading Restore EXOS interrupt, if you do not use another custom interrupt.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.15. 13:14:45
I am taking the first steps in trying to test this, but I am getting stuck right away. The first thing I wanted to try was to simply load a file.
My code is essentially this:

Code: [Select]
        ld a,0
ld de,filename
EXOS 1
ld a,0
ld bc,4096
ld de,data
EXOS 6
ld a,0
EXOS 3

filename:
db "FILE.BIN"
db 0

data:
block 4096,0

And I get an error immediately on the very first EXOS call 1, the return code in A is 0xFD which the documentation says is  "Invalid EXOS string"

My test setup is simply in ep128emu so far, TapeFILE_IO config, I have a working directory where both the binary exe I start and the FILE.BIN is located.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2017.April.15. 13:27:51
An  Enterprise string, for example a file name, is made of two parts, the first byte is the length of the string without this count byte, then it follows the string itself:

filename:
             db 8,"FILE.BIN"

You don't need to put a "0" as "End of String".

But on some other calls, the length of a string is put on b register.

Please, read the EXOS Specifications (http://enterprise.iko.hu/technical.htm). Kernel section. EXOS calls.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.16. 01:33:14
Thank you, that solved it. Now I have "normal" loading working. Will be very interesting to test what happens when I start to split it up and try to play music inbetween 512-byte loads. I'll report back with my findings! :)
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.17. 19:14:07
OK, here's a first attempt at something!
This test is kind of a simple slideshow, with music running (same as I used in "First Contact", just because then it was easier for me to determine if something sounded off or not!) and loading different 256-col pictures from disk while music is playing.
It seems to work OK in emulator (though once I had some slowdowns while loading, never able to reproduce it) and on my SD-card-interface.
I would be really grateful if some of you could also try it on your SD-card readers and other loading methods (diskdrives, HD, ?).
Note though that even though I only used the standard EXOS-calls this is very experimental and could perhaps destroy the contents of your disk/HD so don't run it on something where you have valuable data!
Please report what you have tried it on, and if it works (music keeps playing without corruption, pictures keep showing) or not!

The whole solution turned out kind of strange. Exactly as geco had predicted, the EXOS calls does something weird with the sound registers if I ran without any IRQs (don't understand why though!)
So now I have my own IRQ set up instead, that really doesn't do anything but increment a counter every frame so I can know when an IRQ has completed.
The my code is essentially like this:

Code: [Select]
* Check counter that is in IRQ to know when it has run and finished
* Call music player
* Load 512 bytes
* Repeat

The really weird thing is that I thought since I just wait for the IRQ to be finished, then call the music player directly, I might as well call it from within the IRQ, right?
Nope, when I do that, the machine simply resets when trying to load at the same time.
Really weird, as I make sure to push/pop all registers in the IRQ.

Oh well, at least the method I have now seems to work (at least on my machine) - and I'm really eager to get some input on how it works for everyone else.
Keeping fingers crossed that we have found a method that would allow demos with tons of parts and data and continuous music!
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: geco on 2017.April.17. 21:19:19
Looks good :), sorry I checked it only on emulator with FILE I/O config.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2017.April.17. 22:26:16
I have checked it only on SD-reader, sorry not EXDOS controller.

But it works perfectly on 4Mhz and also on 10Mhz....
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: BruceTanner on 2017.April.18. 15:19:20
Please report what you have tried it on, and if it works (music keeps playing without corruption, pictures keep showing) or not!

It doesn't work with a real EXDOS card and a real floppy disk (EP128), perhaps not surprising as it takes a while to find/load sectors. The effect is that the music notes change very slowly when the disk is accessed, with the odd crackle, but there is sound (mostly a continuous note) throughout.

The reason I was doing it was to try it with my upcoming EPNET network card, but it crashed when it started to load pictures, I suspect my fault, will investigate further!
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2017.April.18. 15:57:15
You come, say that of "upcoming EPNET network card" and leave so calm....

Now I am getting a terrible desire to have some sort of Bus expansion card...
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: BruceTanner on 2017.April.18. 18:03:05
You come, say that of "upcoming EPNET network card" and leave so calm....

Now I am getting a terrible desire to have some sort of Bus expansion card...

I decided to re-spin the EPNET PCB before I let any out into the world (sorry for further delay though). I am hoping the new one will be able to sit between the EP and other expansion, and it will also have 512k RAM and a compact FLASH socket. So no expansion card normally needed :ds_icon_cheesygrin:
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2017.April.18. 18:51:42
Very good idea. Just like the Spectrum add-ons.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.18. 22:01:32
Thanks for testing!

Especially to BruceTanner for giving it a go on real disk! Is it a 3.5" 720kb drive?

As I suspected, it seems like it is too slow. If we are really lucky, it's only the initial seek that is slow, and the rest of the load is faster.
I've made a new version now, where all pictures are put into one binary, perhaps it will improve the situation somewhat?

If possible, could you give this new version a try as well? I would really appreciate it!

Note that since this one just does a seek at the beginning, it only cycles through the pictures once, so after the picture of the womans face nothing more happens.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2017.April.18. 23:02:38
It is still crazy slow on floppy :oops: I also tried real 8 sectored format (bigger GAPs between the sectors), but it is don't help.
10MHz also don't help :-(
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.18. 23:06:29
Thanks for testing!

Seems like I have to abandon my dream of a large multiload Enterprise demo, unless I set SD-card interface as a requirement. :/
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2017.April.18. 23:17:36
Many-many years ago I also tried floppy+music, the near to acceptable combination are using direct diskio, on real 8 sectored disk. Probably more better possible with special formated disk (for example using 256 bytes sector size, and/or less sectors. Using sliding sector numbering for avoid wait at track change.)

More easy idea: small animation with Nick chip during the loading. It is not need any CPU time.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: IstvanV on 2017.April.19. 09:28:59
Probably more better possible with special formated disk (for example using 256 bytes sector size, and/or less sectors. Using sliding sector numbering for avoid wait at track change.)

There are actually demos on the CPC that use similar tricks with 128 bytes per sector. If a single sector can be loaded in much shorter time than one frame, then it is possible to implement the reading between interrupts. There will be errors (data lost) in some of the sectors, but the program can just try reading them again (it is more efficient to read the remaining sectors on the track first, and then retry those that failed).

The test with all the pictures can also be compressed into a single .com file (< 48K), although a full demo would probably require a separate loader:
[attachurl=1]

Edit: reordering the image data allows for reducing the compressed size by more than 3K:
[attachurl=2]
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.19. 13:35:51
The problem with doing some special-formatted disk is (I think this was discussed earlier in the thread as well) that it severely limits the audience of the demo, as from the already few EP128 owners, even fewer would have that exact setup.
Not to mention that my own setup is with SD-card, so I would have no way of testing it, so that's a no-go.

Turning off the music (and perhaps displaying something with LPTs only) while easy, is simply not going to cut it for todays demowatching audience. A continuous show with music running all the time is the standard.

I'll have to consider how the acceptance for a demo which demands a modern piece of hardware (SD-card interface) would be, or just put the project to sleep altogether. One mitigating factor could perhaps be that it *will* run even on slower old disk interfaces, but the music will ofcourse be disrupted and sound bad while loading.

Approximately how long did the each picture load take when running from disk?
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2017.April.20. 08:23:26
I think the most of current Enterprise users use SD card (or hard disk) on real machine or ep128emu.
Then I think will be good if the programs add extra features when fast storage available. For example the load music :-)

Quote
Approximately how long did the each picture load take when running from disk?
This small blocks reading are very slow (because the disk rotating the sectors not continuosl readed, always need to wait next).
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.21. 14:13:33
I think the most of current Enterprise users use SD card (or hard disk) on real machine or ep128emu.
Then I think will be good if the programs add extra features when fast storage available. For example the load music :-)
This small blocks reading are very slow (because the disk rotating the sectors not continuosl readed, always need to wait next).

I wonder if a hard disk would be fast enough? Because IDE drives were available in the early 90ies at least, so if it would work on such a steup, it could still qualify as somewhat "period correct"...
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: ergoGnomik on 2017.April.21. 15:39:01
I wonder if a hard disk would be fast enough? Because IDE drives were available in the early 90ies at least, so if it would work on such a steup, it could still qualify as somewhat "period correct"...
If I were you, I'd do it like the 8-bit Atari guys. You see, there was already available an EXDOS card with 512kB memory expansion in '88. The 256kB modification to the internal memory expansion board was available in early '92. And a 1MB expander was documented at the beginning of '94. These are all "period correct" options. (576/640kB, 320kB, 1088/1152kB RAM) Load everything in one go and decompress the necessary parts as the demo progresses. Aim for a 320kB machine as default. Use normal loading without music as fallback for unexpanded machines.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.21. 20:30:06
Well, my primary target will be the system I have myself, a standard 128kb EP128 with an SD-card adapter. I had some hope that there would be a way to find an "old" config that could run the demo properly as well, to be a bit more historically accurate.
There is no way to configure those EXDOS RAM expansions to work as a RAM-drive? that way the loads would be really quick, quicker than SD-card even, but using the same code.
I really don't feel like writing a completely separate demo for RAM-expanded computers that loads everything at the beginning and the copies from extended RAM runtime instead of loading.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: geco on 2017.April.21. 20:45:27
There is no way to configure those EXDOS RAM expansions to work as a RAM-drive? that way the loads would be really quick, quicker than SD-card even, but using the same code.
It is possible, using RAMDISK :)
Just everything should be loaded into the ramdisk before starting the demo
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.22. 00:07:19
It is possible, using RAMDISK :)
Just everything should be loaded into the ramdisk before starting the demo

Cool! That would be awesome, then there would at least theoretically exist a way for 1988 machine to run the demo.
Is there a way that I can configure this in ep128emu and test it? (RAMDISK option)
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2017.April.22. 02:41:59
You only can create a Ramdisk if have installed some form of drive system on your EP: Floppy controller, SD-reader or IDE card.  All these share the EXDOS Rom, and the code to create the Ramdisk on virtual unit E:

(https://enterpriseforever.com/hardware/zx-spectrum-emulator-card/?action=dlattach;attach=17659;image)

Extracted from the EXDOS manual (http://enterprise.iko.hu/books/EXDOS-UserManual.pdf)

Type the command or write it on a batch file.



Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2017.April.22. 07:39:20
You see, there was already available an EXDOS card with 512kB memory expansion in '88.
1987 :-) (http://gafz.enterpriseforever.com/Galery/Bovitmenyek/Picture/EXDOS_Microteam-ISS4~1.jpg)

Also available the internal 512K expansion from Bugtronics (Netherland) (http://ep128.hu/Album/Pic/Internal_512K_RAM_expansion.jpg), the German company released a Enterprise 576K (http://enterprise.iko.hu/historical/Pricelist_1987Marc-1.jpg) with this expansion.
In Hungary also exist clone of this card, produced by Tibor Kulcsár and Tibor Koch. I added to my machine but also keept the original 64K expansion :-) (http://ep128.hu/Album/Pic/512ext1.jpg) Then I have 128K + 512K with this card, 512K on MICROTEAM EXDOS, + 2x 64K +1x 32K on other expansions = 1312K config. All these at the old good days.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.22. 12:30:29
Thanks for the link to the EXDOS manual gflorez!
I have been able to test in  in ep128emu now!
What is even better, this very nice emulator allowed me to actually use my real physical USB 1.44mb diskdrive in the emulator, I didn't know this before.
So first I tested by copying all the files to a 720kb disk and running it from there, and I could hear the music starting to skip while loading (but it wasn't that bad at all I think, it only took 1 or 2 seconds to load. I'm guessing perhaps the windows pc disk system does some caching or something, and that it's much worse on a real ep128+diskdrive?)
Anyway, then I created a RAM-disk, copied all the files to that and ran from it, no skipping in the sound at all.

-edit- whoops, wrong name!
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2017.April.22. 13:01:26
Yes, the ep128emu read whole track to cache.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: gflorez on 2017.April.22. 13:10:10
Better give thanks to Zozo, the manual is on his personal web page. Click the link under his nick to found a lot more information.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Zozosoft on 2017.April.22. 13:40:00
My suggestion for the loader:
Check EXOS variable 3 (DEF_TYPE) with EXOS 16 function call.
-If it is 0 then tape only configuration, disable loading music.
-If not 0 then EXDOS used or ep28emu FILE device.
Check EXOS variable 71 (DEF_UNIT) (=current drive number)
-If not exist, then non EXDOS configuration, ep128emu FILE device used, enable loading music.
-If it is 5, already running from RAMDISK, enable loading music.
-If it is 6 or more then SD or hard disk used, enable loading music.
-if it is 1 to 4 then floppy disk used then needed:
1)check memory size with EXOS 20. It is enough for running the program plus enough RAMDISK size?
2)if not then disable loading music
3)if yes then execute these EXDOS command with EXOS 26 function call:
RAMDISK n
COPY demofile E:
E:
Then enable loading music.
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: Sdw on 2017.April.23. 00:58:42
Thanks for the suggestions Zozosoft!

Though I think that adding an option to disable music will not make much sense. It's not like it's a separate loading music, it's the main music that will play through the entire demo.
If I were to stop calling the music player while loading, it will be out of sync totally anyway on slow loading systems when the next part starts (for example, if I want to load 10240 bytes, it will take 20 frames x 512 bytes. If I don't call the music player those 20 times while loading, it will be off by almost half a second when the next part starts).
Perhaps I could modify the music replayer to have an option to keep calling it the correct number of times while loading, but not outputting at all to the sound registers and have silence).
I don't think that would be good either, since my plan is to really have a high data flow, say 10-20 seconds of effect that can use the entire memory, then it's time to load 25-30kb of new packed code/data which will take a couple of seconds with my 512 byte/frame loader, and then the next effect and so on.
With a slow loader then it would be 10-20 seconds of effect and music, then maybe 10-20 seconds (with disk, I guess) or minutes even (with tape) with silence while the slow disk loader is loading, and then music resumes.
It would not be a good experience either way.

Perhaps something I will do it like this:

Use the probes you suggested, and then -
* If tape only or drive number 1-4 => Show warning "Demo will not work properly" - but let the viewer see it anyway, with crappy slow "music" (ie. notes that last several seconds...) while loading.
* If emu or 5/6 => Start demo as usual, no warning shown.

So for users with RAMDISK, it's up to them to copy the demo into it before starting the demo.

The truth is that I think most people will only watch the demo on YouTube, a few will use ep128emu and some real enthusiasts will use real Enterprise 128, but I think most of them will have either SD card or RAM expansion available!
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: geco on 2017.April.23. 10:25:52
I think it is a good idea to show a warning and keep going :-)
I will check it ön ep128emu, and if i put together my configuration then with SD :-)
A separate EXDOS.INI starter can be made for RAMDISK users, which will create the RAMDISK, copy everything ans start the semo.
Probably it could be the following 3 rows.
RAMDISK 8
COPY *.* E:/    (i did nőt find backslash ön my phone)
LOAD loader.com

I do not remember if : has to be placed at the beginning of each EXDOS commaand in EXDOS.INI
Title: Re: IRQ-loading - would this be possible on the EP?
Post by: IstvanV on 2017.April.23. 10:47:21
Creating the RAMDISK and copying the files can also be in the program itself, as Zozosoft suggested.