<div dir="ltr">On Sat, 3 Feb 2024 at 16:14, Michael Bernstein <span class="gmail_default" style="font-family:courier new,monospace"></span>wrote:<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Cyprian,<br>
<br>
> I'm working on a small application which operates on offscreen graphics <br>
> data, that I transfer via vro_cpyfm to the screen.<br>
<br>
There is one step missing in your handling.<br>
<br>
> Now I wonder how to distinguish video mode: bitplane vs packed pixels. <br>
> Do you have any tips?<br>
<br>
Do you speak about the graphic format of the Video RAM itself used by <br>
the hardware? Then the answer is: you should take it as unknown. But <br>
there is no need for applications to have this information.<br>
<br>
The VDI distinguish between the hardware-dependent format which is used <br>
by hardware and the VDI graphics driver. And the standard format which <br>
is well defined and a bitplane mode. You can query the number of planes <br>
with the VDI function vq_extnd()<br>
<br>
So the proper handling of offscreen bitmap is:<br>
<br>
- Make your graphic handling with a buffer in the standard format. The <br>
field fd_stand of the MFDB structure for this buffer is 1.<br>
- Then call <span class="gmail_default" style="font-family:courier new,monospace"></span>vr_trnfm() to transform the standard format graphic buffer <br>
to a <span class="gmail_default" style="font-family:courier new,monospace"></span>device-dependant buffer (fd_stand = 0 for destination MFDB). This <br>
transformation may be done in place. But this took a longer time. So <br>
better use a second buffer for the destination.<br>
- Then use <span class="gmail_default" style="font-family:courier new,monospace"></span>vro_cpyfm() to copy the graphic buffer in hardware dependant <br>
format to the screen buffer. The field fd_addr of the destination MFDB <br>
is set to NULL (0) and all other field can stay uninitialized.<br></blockquote><div><br></div><div><div style="font-family:courier new,monospace" class="gmail_default">good point,</div><div style="font-family:courier new,monospace" class="gmail_default">
Initially I had a plan to do that conversion on myself due to performance and memory limitations, but I'll try to do that in a proper way: image --> 
<span class="gmail_default" style="font-family:courier new,monospace"></span>vr_trnfm --> 
<span class="gmail_default" style="font-family:courier new,monospace"></span>vro_cpyf.

</div><div style="font-family:courier new,monospace" class="gmail_default">It might work in low color video modes, but it may run out of RAM in 256 color modes. 
I need 1x buffer for loaded image, 1x buffer for standard image, 1x optional buffer in device-dependent buffer. 

</div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

Atari ST/TT/Falcon computers use with GEM the same graphic system. So <br>
you can use the GEM part of <a href="https://toshyp.atari.org/" rel="noreferrer" target="_blank">https://toshyp.atari.org/</a> also as a <br>
documentation. This documentation is available in german and english. <br>
Another source of information is the Atari Profibuch, which is now <br>
available for download in pdf format. But this is only in german. The <br>
Profibuch contains an example function how to calcuate the RAM size of a <br>
graphic buffer for the actual graphic resolution.<br></blockquote><div><br></div><div></div><div><div style="font-family:courier new,monospace" class="gmail_default">Actually I'm quite familiar with Atari stuff. I have paper Profibuch book, I'm on daily basis on TosHyp and Atari-forum.com.<br></div><div style="font-family:courier new,monospace" class="gmail_default">But I'm here to learn more about the root of our beloved OS - Intel GEM and GEMDOS (DOS Plus?).<br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default">btw nice website<br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default">Regards</div><div style="font-family:courier new,monospace" class="gmail_default">Cyprian<br><a href="https://260ste.atari.org">https://260ste.atari.org</a></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><br></div></div></div>