09 May 2020, 15:39 | #1 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 10
|
Problem with fread while booting game from adf
Hi guys!
I ran into a problem while trying to build my game into an adf file and booting it from WinUAE. I do some memory arena allocation on startup, so I have a space to read my files into. My goal is running the game on either 512 Chip + 512 Fast, or 1 MB Chip. I managed to trim all used memory to around ~900 MB, however there are some problems. On 512+512 the game simply refuses to read any files after allocating memory for the arenas, and on 1 MB it loads small 10 kB files i use as logos for splash screen, but chokes on bigger, 30 KB files I use for intro graphics. It works on bigger memory setups just fine, even on 1 MB+64 KB. Is there some finicky memory stuff I have to keep in mind when planning to read files, or could it be a problem with adf? I use WinUAE for testing, and when I boot the game from exe in Workbench it works just fine, when ~900 KB of memory is left while starting it up. For building into adf I use exe2adf. http://www.exe2adf.com/ |
09 May 2020, 16:52 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
|
Does it work if you manually copy files to formatted adf?
|
09 May 2020, 19:24 | #3 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 10
|
|
09 May 2020, 21:28 | #4 | ||||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,547
|
Quote:
There is "fread" in the subject, so I guess you're using fread() from a C-compiler's clib? Which? Why using fread() in an Amiga game anyway? It certainly doesn't need to be portable. So dos.library Read() would be the better choice, without pulling all of the compiler's clib code into the executable and wasting a lot of memory. Quote:
Quote:
Quote:
Last edited by phx; 09 May 2020 at 21:31. Reason: s/with/without/ |
||||
15 May 2020, 21:39 | #5 | |
Registered User
Join Date: Sep 2018
Location: Poland
Posts: 15
|
Since MacSpain uses ACE, Let me discuss my design decisions.
Quote:
Back to topic. It's funny that fread etc. doesn't work. IIRC Bebbo's libnix file functions doesn't allocate anything. It could be that there is too little room for stack and it's starting to trash fns / vars. |
|
16 May 2020, 11:34 | #6 | |||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,547
|
Quote:
Quote:
Quote:
|
|||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Booting adf with game crashes WinUAE | MacSpain | support.WinUAE | 3 | 26 March 2020 18:04 |
Booting more than one ADF/DMS from within ZIP/LHA archive | Foebane | support.WinUAE | 2 | 29 June 2018 18:26 |
Problem booting from HD | Hedefar | support.WinUAE | 14 | 20 July 2012 00:21 |
Problem booting with JIT... | Leo42 | support.WinUAE | 3 | 15 June 2009 21:25 |
DMS and ADF booting... | VermillioN | support.WinUAE | 7 | 28 October 2002 15:41 |
|
|