A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Loading files with a startup that shuts down system

 

Author Message
dodke
Member
#1 - Posted: 28 Sep 2017 12:32 - Edited
Reply Quote
Hi I was wondering if anyone might have an idea what the problem is with this code.

I'm trying to load files when the system has been shut down by the startup code.
I got this other bit of code from Stingray that enables the ports and IO interrupt before calling the system routines to read a file.

This seems to work fine on kickstart 2.0 and 3.x and also when loading files from HD on 1.3. It does not however work on 1.3 when trying to load files from a floppy disk. Seems to get stuck with the disk spinning sound playing. I don't have an amiga with 1.3 so only tested on FS-UAE but I'd imagine it doesn't work on real hw either.

I haven't been able to figure out which part of the startup code exactly makes it not work properly on 1.3 or what I'd need to enable for calling the file loading routines.

I uploaded a small test program here:
http://amiga.lauri.me.uk/loadfiletest.lha

Should compile fine with either phxass or vasm using:
vasmm68k -Fhunkexe -kick1hunks -o loadtest -nosym loadtest.s


Any help is much appreciated!
dodke
Member
#2 - Posted: 28 Sep 2017 13:34
Reply Quote
Alternatively what's YOUR favourite startup code for a500 that allows loading files?
noname
Member
#3 - Posted: 28 Sep 2017 17:45 - Edited
Reply Quote
I loaded with system-off from hard-drive (floppy did not work with my code) in Mnemonics. This worked fine with every machine from me and my friends back then, and still I managed to see it freeze on some other machine at MS99 when trying to show the demo to some more friends (machine owner had big boom speakers). Starting from Ram-disk on the same machine worked, so it was somehow related to the hard-drive. My suspicion was that it might have been a DMA-related problem. My solution was to not load with system off anymore.
dodke
Member
#4 - Posted: 28 Sep 2017 20:22
Reply Quote
I did actually figure out some workaround. kind of.

First of all, on 1.3 loading from floppy requires (in addition to the ports and IO int) disowning blitter. But probably I don't need to own it anyway if when I use it everything else should be shut down.

Second of all, it also does something in system level 3 interrupts. So I managed to get the loading running when I restored the system interrupts beforehand.

One issue with restoring system interrupts is that they are changing random things which I've set manually. At least secondary copperlist address register is cleared (sometimes at least) so that messed up the interlacing / bitplane setup that were not in the primary copperlist.
But doing simple things might be fine.

I can still set up a vblank interrupt with system routines which I will then run during loading. When not loading I can switch back to own stuff.

I guess a sane option would be to use system routines for everything if you want to load files etc with it but oh well.
dodke
Member
#5 - Posted: 29 Sep 2017 11:24
Reply Quote
Also, looks like if you've called Forbid() you need to call Permit() and leave it and system interrupts running for at least a few seconds after loading has finished. Otherwise the drive motor won't stop.
noname
Member
#6 - Posted: 29 Sep 2017 13:10 - Edited
Reply Quote
Some Amiga(D)OS versions decode MFM from disk using the blitter (c.f. adflib). IIRC v1.3 does that.

Turning drive motor off immediately for disabled multi-tasking can be done by poking the hardware directly (code) or OS legal (check).
dodke
Member
#7 - Posted: 2 Oct 2017 11:57
Reply Quote
Yes exactly. I guess later ones use CPU or at least have a fallback that doesn't need blitter. But this might be important for running effects while loading. If a600 doesn't use blitter it should have less CPU time.

Thanks! I'll add the hardware poking code to the routine that takes over the system again so it'll stop the motor in case it's still on.
Frog
Member
#8 - Posted: 6 Oct 2017 11:37
Reply Quote
dodke:
Alternatively what's YOUR favourite startup code for a500 that allows loading files?

I don't know if it can be useful for you in some way but there is the "classic" Sanity Operating System" http://aminet.net/package/dev/asm/SanityOperationSystem
Frog
Member
#9 - Posted: 6 Oct 2017 11:51
Reply Quote
i forgot :
PhotonMiniStartup : http://coppershade.org/articles/More!/Downloads/
LemonWinUAEDemoTool : http://www.pouet.net/prod.php?which=65625
There's also a thread on Pouet : http://www.pouet.net/topic.php?which=10537

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0