17 September 2012, 11:35 | #1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 746
|
Listing files, loading files and allocating all available chip ram.
Hi Guys. I need to do the following..
1. Allocate the largest available chunk of chip ram (largest continuous block) 2. List all files (preferablly starting with mod.) in the EXE folder 3. Load a file 4. Deallocate that block of chip ram (just to be nice) All calls using dos library etc. PMC gave me a Doc which shows example assembly calls to these functions but I've since lost it. Also, the system will be shut down, however I seem to remember Stinger saying that as long as the ports and timers are still on, loading from the hard drive should still be possible? Any help would be greatly appreciated. Cheers |
17 September 2012, 13:56 | #2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
|
what do you mean by "the system will be shut down" ? using forbid/permit? if so, that will be void, because using dos library open/read/etc will re-enable multitasking..
If I were you, I would take over the display, but leave multitasking on and raise the priority of your task to avoid anybody else stealing cpu.. that way there will be no problems with listing/loading files. also, don't allocate more chipram than you actually need.. the crude way to find the largest chunk is to traverse the chipram free list (I don't remember if there is an exec function that will perform this sort of thing). |
17 September 2012, 15:37 | #3 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
2. Lock the directory and use Examine() (dos.library), then use the info in the FIB (file info block). Then use ExNext() in a loop to examine the next entry, if you get NO_MORE_FILES as return code you have checked all files in the directory. If you need more help let me know, I do have code which does exactly what I just described (needed it for an IFF to chunky converter some years ago). 3. Re-enable ports/timer interrupts and you can happily load a file, I did that in countless demos. And yes, it was me who told you that. 4. Should be obvious. I actually never liked the "set task priority very high" approach, IMHO demos should kill the system and re-enable it when they need parts of it. Guess it's a matter of taste. |
|
17 September 2012, 17:34 | #4 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
|
Quote:
btw, does loading from harddrive not require interrupts (or is that covered by what you call "ports") ? I seem to remember that at least A4000 internal IDE uses INT6.. |
|
18 September 2012, 00:46 | #5 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 746
|
Cheers Stinger, between you and PMC, the ProTracker DJ Player will become a reality sooner rather than later, even if its a dirty bangs on the chips while reaching around the OS old school style app!
|
18 September 2012, 20:43 | #6 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 746
|
Ok, after basically copying some code, I've managed to build a file lister, mem allocator and loader.
However, for some reason, now when I run the file lister, the file info block seems to be missing the first two bytes?! Its really odd, first time I ran it, the file name was at offset 8, now its at 6?? Anyone know why this might be??? |
18 September 2012, 20:47 | #7 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
FIB needs to be longword aligned IIRC. So add a CNOP 0,4 in front of your FIB buffer and it should work.
Level 2 interrupt (ports/timers) is enough, at least I never needed a level 6 interrupt to load from HD. |
18 September 2012, 23:16 | #8 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
|
Quote:
I wonder if any controllers attached directly to accelerator boards interrupts its cpu directly, thereby circumventing paula!? |
|
19 September 2012, 00:57 | #9 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 746
|
Cheers stinger, wondered if that might be the case, never use cnop before! Manage to get all the mod. files in the exe folder, allocate the chip ram for the files size and load it! I know not the most complex of tasks but it's one step closer for the PT-1210 MK1 turntable
|
16 October 2012, 20:29 | #10 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,627
|
|
16 October 2012, 21:27 | #11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
|
|
16 October 2012, 21:54 | #12 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
16 October 2012, 23:03 | #13 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 869
|
Since BCPL uses 64 bit per address, SCNR
|
07 February 2013, 12:08 | #14 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
Is this method works fine for kick1.3 ? Edit: Especially I mean about loading files from DF0: Regards Last edited by Asman; 07 February 2013 at 17:33. Reason: added Edit |
|
08 March 2013, 01:08 | #15 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
I re-enable interrupts for loading on Mr Beanbag, works fine from floppy.
Also I recently added directory listing to the special levels menu, I allocate the file info block buffer with exec.AllocMem; seems to work. |
23 March 2013, 01:33 | #16 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,627
|
Thread moved to Asm.System!
|
04 April 2013, 21:24 | #17 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
Now loading from floppy, works fine (re-enable PORTS with DMAF_DISK set into dmacon ), but under WinUAE debugger I obtained exception messages (not too many) when I opened file. I'm not sure if this is ok - but files were loaded correctly. Edit: One more thing on Kick 1.3. If blitter was taken with OwBlitter (graphics.library) then to load file do DissownBlitter (graphics.library). Last edited by Asman; 07 April 2013 at 19:54. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Would loading WWP files directly be possible? | MethodGit | support.WinUAE | 3 | 17 October 2010 20:26 |
Allocating Fast RAM as Chip? | Fingerlickin_B | support.Hardware | 22 | 20 November 2008 22:15 |
Loading configuration files problem in 1.5.0 | trackah123 | support.WinUAE | 4 | 29 July 2008 17:12 |
Loading configuration files | Pantzoid | support.WinUAE | 3 | 25 June 2007 21:12 |
IDE HD freezing when loading big files. | pbareges | support.Hardware | 6 | 29 May 2006 07:12 |
|
|