[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Allocation of video RAM



31 maj 2010 kl. 15.38 skrev Jo Even Skarstein:
>> In theory, the memory could be used for other stuff as well. This is an FPGA design.
>> And there could very well be a good reason to have low level access to a block of VRAM in the future.
> 
> So basically you need something like the xbios-call ct60_vmalloc() on the CT60/63, except that it needs to be handled by MiNT to allow memory protection to work also for this bit of RAM?

I think memory protection would be neat, yes. The point is to have a standard call for it, instead of re-inventing the wheel for every new graphics solution, and while at it, why not make it with style :)

The CT60_vmalloc() call is part of XBIOS. Some XBIOS calls (Vsetscreen()) call GEMDOS for allocation - which is bloody ugly imo. Freemint seems to leave XBIOS alone for the most part, but most of the GEMDOS functions are replaced with modern ditos... so why not have a GEMDOS function for this.

> 
>> A good example of this is the Hades. It doesn't have any low level APIs for allocation of video ram,
>> no low level APIs for screen resolutions etc. In the end, if I want to make a 320x200x8bpp game,
>> I have to resort to hardware banging. All because there is no API to do what I want. In the end that is
>> such a mess that I'd rather just avoid using fullscreen graphics on that platform. And that's a pity,
>> because it's a great machine.
> 
> Well, is memory protection important to these people? Aren't these the same people that wrote directly to the shifter registers on the ST? ;-)

You have a point, but then again, if there is a clean and easy to use API for this, people won't hesitate to use it. They usually use Malloc() and Mxalloc(), after all.

> Anyway, perhaps this xbios-call does what you need. I don't know how it fits with memory protection though.

It won't support memory protection because it's implemented in TOS and not the kernel, unfortunately. Also, Mfree() won't free this kind of memory, at least not when the kernel has been loaded. And if an application crashes or forgets to explicitly free video memory, that memory will never be freed.

-- PeP