View Single Post
Old 19 April 2024, 13:06   #4
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,049
Yeah, if you are using absolute addresses (AllocAbs() or ORG/LOAD). Otherwise (AllocMem() or relative sections) you don't know where the bitmap will be in memory during compile time, and since the segment loader cannot handle splitting a 32-bit address into 2 parts you have to do it manually with the CPU in run-time (which is what you want to avoid).
For example:
Code:
ABS_BITMAP EQU $70000

; version1
  SECTION Code,CODE
  move.l 4.w,a6
  move.l #(320/8)*256,d0
  lea ABS_BITMAP,a1
  jsr _LVOAllocAbs(a6)  ; +handle error

; version2
; absolute section, will not be added to executable as a hunk (ok for OS-killer demos/games and similar)!!
  ORG ABS_BITMAP
  LOAD ABS_BITMAP
  DS.B (320/8)*256

; now you can hardcode it in copperlist
  SECTION DataChip,CHIP
Copper:
  DC.W $00e0,ABS_BITMAP>>16,$00e2,ABS_BITMAP&$ffff
...
a/b is offline  
 
Page generated in 0.05543 seconds with 11 queries