English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 31 July 2023, 17:54   #1
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
Image data and chipmem

Hi,

I noticed that ImageData from struct Image must point to chipmem otherwise it will not work (for use on a gadget or directly via intuition/DrawImage).
Now wondering if it is possible to remove this limitation -- other than creating temporary data in chipmem.
meynaf is offline  
Old 31 July 2023, 18:58   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,247
Two obvious answers. Obvious answer #1 is to redirect the blits to the CPU, for example with "Native" and P96. Obvious answer #2 is to use a Boopsi and there render the data with the CPU. A boopsi of the image class can be used in all places where an IntuiImage would work.
Thomas Richter is offline  
Old 31 July 2023, 19:15   #3
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
And... how do I redirect/render the blits to/with the cpu ?
On own screen i can take over planar data, but there it's a window on WB screen...
meynaf is offline  
Old 31 July 2023, 22:08   #4
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,247
You have to write your own blitter emulation, obviously. Roughly, you need to lock the layer of the target rastport, then perform a DoHookClipRects() on this layer, and implement the lower level rendering on the bitmap you receive from the above functions through your hook yourself.
Thomas Richter is offline  
Old 03 August 2023, 03:10   #5
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,649
Quote:
Originally Posted by meynaf View Post
Hi,

I noticed that ImageData from struct Image must point to chipmem otherwise it will not work (for use on a gadget or directly via intuition/DrawImage).
Now wondering if it is possible to remove this limitation -- other than creating temporary data in chipmem...

it's a window on WB screen...
What's wrong with doing it the normal way?
Bruce Abbott is online now  
Old 03 August 2023, 08:36   #6
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
Quote:
Originally Posted by Bruce Abbott View Post
What's wrong with doing it the normal way?
Not much, i just wanted to see if i could spare a few chipmem without making the thing needlessly complicated.
meynaf is offline  
Old 03 August 2023, 09:10   #7
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,247
Unfortunately, a CPU-based blitter implementation that covers all cases correctly is "needlessly complicated" - in particular if you want to cover also RTG in such cases.

It depends on what you want to actually render as image. If the image can be constructed by usual rendering calls to the graphics library (such as drawing lines and rectangles), then it is relatively easy as you do not need to simulate the blitter but can use what is there. The advantage of the boopsi would be then that you could plug it in wherever an IntuiImage is needed (e.g. in Gadgets).

If the input is a generic bitmap, it can become quite complex as it may also include changing the pixel mode, e.g. if the output is direct color (truecolor or highcolor), chunky or planar, and you need to perform clipping yourself, too.

As said earlier, I would suggest to look into DoHookClipRects() as this call at least provides you with the infrastructure of splitting the (potential) blit into all the cliprects a particular rastport can have, and there are really multiple of them (visible but clipped, invisible, and superbitmap cliprects) and it is easy to miss some of them. This function at least gives a nice interface for walking all the cliprects.

Anyhow. The easiest approach is probably just to depend on some other package providing CPU blitting. All you need then is a way to find out whether a bitmaps can be put into FastRAM. For that, check whether the screen bitmap is in chip. If not so, you are safe. Otherwise, if it is in chip ram, allocate a (throwaway) bitmap as invisible, non-displayable friend bitmap of the bitmap of the screen rastport. If that is in fast, you are also safe. If it is in chip, you need to put your bitmaps into chip as well.
Thomas Richter is offline  
Old 03 August 2023, 09:34   #8
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
I think it may be better for me to just allocate some temporary chipmem area for copying the bitmap. If used with DrawImage calls rather than integrated into gadgets, it doesn't even need to stay there and i can recycle the buffer immediately afterwards.
This gives the extra benefit of removing alignment restrictions on bitplane data located inside of the program.
meynaf is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
A1200 no chipmem imi2003 support.Hardware 3 01 October 2020 21:56
A3000 chipmem error? dalek support.Hardware 2 22 January 2020 00:27
hard drive image errors at 75% data corrupt ? Stratplayer support.Hardware 1 19 July 2018 20:01
Tool for examining raw image data roger_bratseth Coders. General 2 31 May 2018 18:36
ChipMEM Bug. FOL support.WinUAE 4 09 January 2013 22:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:50.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07292 seconds with 13 queries