Re: [hatari-devel] defaulting to SMALL_MEM |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Le 18/02/2022 à 21:33, Thomas Huth a écrit :
Am Thu, 17 Feb 2022 11:14:25 +0100 schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:
That is, instead of allocating STRamEnd bytes for STRam[], we allocate STRamEnd + SCREENBYTES_LINE*10 bytes and fill this extra space of SCREENBYTES_LINE*10 bytes with 0.After thinking about this for a while, I agree, it's like the best solution to add some margin to the allocation for this instead, to avoid that the code gets too ugly and to avoid regressions with the performance of the rendering functions. But shouldn't we rather allocate NUM_VISIBLE_LINE_PIXELS * NUM_VISIBLE_LINES / 2 bytes instead? ... in case a program sets the memory base to the very end of the RAM and then does some fullscreen tricks?
yes, SCREENBYTES_LINE*10 was an example, but a proper counting should be done. In all cases it would just add less than 100 kB for a whole screen, so even if we round it to 100 or 200 kB if we're too lazy to do a proper counting of bytes, it's quite negligible.
now if we want someday to really emulate what happens when video pointer goes just after a max of 512 kB of RAM for example, then we will need some special cases to render such lines and to display the latest word seen on the bus ; but that's a really different story :)
Anyway, we should add a proper comment to the allocation, otherwise we'll wonder in a couple of years why we did that change ;-)
that's quite possible :) Nicolas
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |