![]() |
![]() |
#1 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
How to shrink an area of reserved memory
OK here's my problem, I have loaded in a file into Fast Mem that contains some data that needs to be in Chip, so I copy it out. The Chip data is at the end of this block of data, so I want to free it up and get that fast mem back, without freeing up the whole block because I still need the rest of the stuff. In other words to shrink the allocated space, keeping the first part and discarding the latter part.
I know this must be possible because AMOS has a Bank Shrink function that preserves the address of the data. But how do I do this with Exec calls? If I try to "freemem" half way into an allocated area it seems to work but eventually crashes. I tried freeing the whole block and then AllocAbs it again, that doesn't work either ![]() |
![]() |
![]() |
#2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,643
|
free/allocabs should work as long as you surround them with forbid/permit.. what do you mean by "doesn't work" ?
|
![]() |
![]() |
#3 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
well it just seems to hang, AllocAbs doesn't clear the memory to zeroes does it?
|
![]() |
![]() |
#4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
|
Ugly Forbid()+FreeMem()+AllocAbs()+Permit() is the only working method. (EDIT: only if mungwall or similar program is not active..)
Note that first 8 bytes of FreeMem()'d memory region will be modified (Replaced with struct MemChunk). |
![]() |
![]() |
#5 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Thanks Toni! That was just the tip I needed, those first 8 bytes were really important!
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Enable RDB mode and Surfaces/Sectors/Reserved | mark_k | support.WinUAE | 1 | 17 February 2013 17:51 |
PFS3 continuosly giving "Block outside reserved area" -errors | emuola | project.ClassicWB | 15 | 19 August 2012 19:47 |
Help, how do I shrink posted images?? | DDNI | support.Other | 3 | 26 September 2011 01:02 |
Some rare-ish (possibly MIA or un-SPS'd) and/or shrink-wrapped Amiga games for sale | eLowar | MarketPlace | 0 | 13 July 2009 12:41 |
Any utilities to shrink or stretch WB bg pics? | Mojo2000 | New to Emulation or Amiga scene | 14 | 29 January 2003 23:39 |
|
|