English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 20 October 2014, 01:21   #1
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
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  
Old 20 October 2014, 08:28   #2
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
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: 49
Posts: 26,505
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 offline  
Old 20 October 2014, 12:39   #4
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
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.

Ta
Galahad/FLT is offline  
 


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 23:52.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06765 seconds with 15 queries