![]() |
![]() |
#1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 768
|
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 |
![]() |
![]() |
#2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,642
|
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). |
![]() |
![]() |
#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. ![]() Quote:
![]() |
||
![]() |
![]() |
#4 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,642
|
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.. |
|
![]() |
![]() |
#5 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 768
|
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!
![]() |
![]() |
![]() |
#6 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 768
|
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??? |
![]() |
![]() |
#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. |
![]() |
![]() |
#8 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,642
|
Quote:
I wonder if any controllers attached directly to accelerator boards interrupts its cpu directly, thereby circumventing paula!? |
|
![]() |
![]() |
#9 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 768
|
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
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,658
|
|
![]() |
![]() |
#11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,570
|
|
![]() |
![]() |
#12 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
![]() |
![]() |
#13 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 875
|
Since BCPL uses 64 bit per address, SCNR
|
![]() |
![]() |
#14 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
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 |
|
![]() |
![]() |
#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. |
![]() |
![]() |
#16 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,658
|
Thread moved to Asm.System!
|
![]() |
![]() |
#17 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
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 | |
![]() |
||||
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 |
|
|