English Amiga Board

Go Back   English Amiga Board > Main > Amiga scene

Thread Tools
Old 20 October 2014, 01:21   #1
Going nowhere

Galahad/FLT's Avatar
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,909
CD32 - File reading / closing query

I've just done something for CD32, and it has a problem. On Amiga hard drive, it works exactly as expected, but on CD32 it crashes.

Basically i'm loading a big-ish file (768K), and using AmigaDOS to do it all, and as soon as the file is loaded, I kill the system, transfer some code low down in memory and make sure everything relocates as it should.

However, if I allow this to happen from loading from the CD32 it will crash after loading the file.

If however, everything is copied to RAM: and then run from there, it works perfectly.

I'm assuming its got something to do with having to wait until the CD spins down or gets the signal from the CD32 to stop spinning.

Is there a required wait period thats supposed to occur before system shutdown after reading a file?
Galahad/FLT is offline  
AdSense AdSense  
Old 20 October 2014, 08:28   #2
move.w #$4489,$dff07e
musashi5150's Avatar
Join Date: Sep 2005
Location: Norfolk, UK
Age: 37
Posts: 2,289
I've heard this mentioned before - but never heard a concrete period that should be waited before killing the system. I guess it's a couple of seconds.

When initially booting your first executable the problem can be avoided by opening and then immediately closing the freeanim.library to remove the startup animation correctly. The OS will block execution of your code until the animation is complete, which is also more than enough time for the cd.device to finish any caching it might be doing before you bin the system.
musashi5150 is offline  
Old 20 October 2014, 08:52   #3
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,372
It happens because cd device always prefetches next 16 CD sectors and each sector causes level 2 interrupt which can be only cleared by writing to Akiko interrupt register.

I don't know if there is any official method, perhaps sending CMD_STOP or CD_MOTOR IO command stops it or at least IO call returns only after prefetch has finished.

Some CD32 games have CPU busy wait..
Toni Wilen is online now  
Old 20 October 2014, 12:39   #4
Going nowhere

Galahad/FLT's Avatar
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,909
Thanks chaps, i've now put in a close for the opened Intuition library and put in a couple of seconds delay in there and it appears to have done the trick.

Obviously if I wasn't shutting down the system it wouldn't have been a problem as the multitasking would have enabled everything to sort itself out in the background.

Galahad/FLT is offline  
AdSense AdSense  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD32 Not Reading Discs darkwave support.Hardware 25 22 June 2012 16:37
cd32 reading problem jolly11 support.Hardware 2 15 December 2009 20:47
CD32 Reading errors. Charlie support.Hardware 2 28 October 2007 23:23
jst file reading problem pbareges support.Apps 8 03 November 2006 19:33
CD32 Power Supply Query ben111g Retrogaming General Discussion 4 07 April 2006 11:48

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 10:13.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06766 seconds with 13 queries