Page 40 of 44

Re: gtBASIC screen buffering

Posted: 01 Apr 2023, 15:47
by wbushby
Is it possible to draw a screen in memory then switch a pointer to that memory to display the screen ?

Re: gtBASIC

Posted: 02 Apr 2023, 00:35
by bmwtcu
https://forum.gigatron.io/viewtopic.php?p=30#p30 Marcel alluded to being able to do double buffering by sacrificing some horizontal resolution.

Re: gtBASIC

Posted: 02 Apr 2023, 03:48
by at67
In gtBASIC you can do full screen double buffering pretty easily, but there are some major caveats, the main one being you lose another 19k or so of RAM; but probably more importantly you chop up 32k of contiguous RAM, (in the extra 32k page page), into the same segmented fashion as the first 32k page of RAM.

This means you not only lose a large chunk of your RAM, but you reduce the size of data structures you can have drastically.

It's also not free as you are not just modifying one pointer per 60Hz, you are modifying all 120 scanline pointers in the VTable per scan line, (in pre ROMvX0 you have to do this in a loop, in ROMvX0 there is a SYS call to do it for you). So you probably lose 10% of your CPU cycles per 60Hz frame, (depending on video mode pre ROMvX0 and 2-3% for ROMvX0.

Look at the example in the examples folder gbas/graphics/Cub64k_ROMvX.gbas, it does full flicker free double buffering.

P.S. You can also do it like Marcel suggested as bmwtcu pointed above, but it has it's own limitations, mainly being you are drawing to half the screen while the other half is hidden and is the back buffer.

Re: gtBASIC

Posted: 02 Apr 2023, 13:27
by wbushby
I think I need a newer version of vX0 as Cub64k_RIMvX is not in my version

Re: gtBASIC

Posted: 02 Apr 2023, 16:50
by at67

Re: gtBASIC

Posted: 03 Apr 2023, 12:52
by lb3361
There is another way of doing double buffering on the Gigatron hardware (128k extended) using the trick of dev128k7.rom which swaps the selected bank during the video loop so that the one seen by the vCPU is not the same as the one seen by the video generation code in the ROM. This means we set videoTable to point to memory above 0x8000, we can have up to three screen buffers (at the same addresses in banks 1, 2, and 3), display the one we want, and work on another one at the same time. This gives true double buffering while leaving 30K of contiguous memory available in bank0 for code and data. This might in fact be a good way to take advantage of the extra memory of the extension board. The experimental version of dev128k7 can do this but otherwise lacks the graphics goodies that make romvx0.

New Game Release - Pitfall v1.00

Posted: 09 Apr 2023, 08:28
by wbushby
Here is the latest port I have done. It is Pitfall from the Atari 2600 and it includes the full game.

This game requires 64k on the Gigatron and the latest ROM vX0.

It works with joystick only

Feel free to make suggestions to improve this version and I will endeavour to include them.

I don't have access to a real Gigatron at moment so I am not sure how well the screens transition. If someone could let me know that would be great.

**** DOWNLOAD REMOVED DUE TO FAULT WITH JOYSTICK ****

Re: Pitfall v1.00

Posted: 09 Apr 2023, 18:35
by wbushby
It has been reported that joystick is not working on a real Gigatron. Can anyone else confirm this please ?

Re: gtBASIC

Posted: 09 Apr 2023, 19:30
by Hans61
I can confirm no response to controller inputs on a real Gigatron.

Re: gtBASIC

Posted: 09 Apr 2023, 19:36
by axelb
No reaction to joystick inputs on my system, either. Also I donĀ“t have sound so far...