![]() |
![]() |
#1 |
Registered User
Join Date: Aug 2019
Location: uk
Posts: 16
|
Whats the best way to allocate bitplane memory?
To allocate memory for a bitmap I always used to do the following
Code:
section code,code_c lea bitplane,a0 etc etc rts section plane,data_c bitplane: ds.b (320*256)/8 So I have switched to using the allocmem library which solves this. But now Im wondering is there a "section" I can put in assembler that would allocate the memory when the program loads automatically? This would be ideal as it saves me handling of memory allocation. |
![]() |
![]() |
#2 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
|
This:
Code:
section code,code_c lea bitplane,a0 etc etc rts section plane,bss_c bitplane: ds.b (320*256)/8 |
![]() |
![]() |
#3 |
Registered User
Join Date: Aug 2019
Location: uk
Posts: 16
|
Great, thanks
![]() |
![]() |
![]() |
#4 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,436
|
Yup, ross gave a good answer there.
The alternative (assuming this is something you'd start from the CLI/Workbench) would be to dynamically allocate space using the Exec function AllocMem (and free it afterwards using FreeMem). Generally, I find the section method is easier to use and the Exec allocation method is more flexible. But your mileage might vary here - both work just fine. |
![]() |
![]() |
#5 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
|
Actually for this specific case there is another alternative:
Code:
section code,code_c lea bitplane(pc),a0 ... rts bitplane: dx.b (320*256)/8 end ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
WHDLOAD: Can't allocate Expmem (SKIDMARKS) | Nostromo | support.Games | 11 | 09 February 2023 21:52 |
Allocate/deallocate memory? | idrougge | Coders. Blitz Basic | 7 | 03 February 2017 10:21 |
SWOS 96/97 - cannot allocate ShadowRam | gingerbeardman | project.WHDLoad | 37 | 11 February 2011 17:49 |
Could not allocate 'shadow ram'? | NovaCoder | project.WHDLoad | 4 | 28 August 2008 01:09 |
Whats your 1st memory of your/an amiga? | mrbob2 | Nostalgia & memories | 44 | 28 April 2007 00:03 |
|
|