gtBASIC

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC screen buffering

Post by wbushby »

Is it possible to draw a screen in memory then switch a pointer to that memory to display the screen ?
bmwtcu
Posts: 145
Joined: 01 Nov 2018, 12:02

Re: gtBASIC

Post 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.
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post 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.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

I think I need a newer version of vX0 as Cub64k_RIMvX is not in my version
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

lb3361
Posts: 360
Joined: 17 Feb 2021, 23:07

Re: gtBASIC

Post 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.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

New Game Release - Pitfall v1.00

Post 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 ****
Attachments
Pitfall.jpg
Pitfall.jpg (363.3 KiB) Viewed 856 times
Last edited by wbushby on 09 Apr 2023, 20:23, edited 1 time in total.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: Pitfall v1.00

Post by wbushby »

It has been reported that joystick is not working on a real Gigatron. Can anyone else confirm this please ?
Hans61
Posts: 102
Joined: 29 Dec 2020, 16:15
Location: Saxonia
Contact:

Re: gtBASIC

Post by Hans61 »

I can confirm no response to controller inputs on a real Gigatron.
axelb
Posts: 41
Joined: 07 Jan 2021, 06:27

Re: gtBASIC

Post by axelb »

No reaction to joystick inputs on my system, either. Also I don´t have sound so far...
Post Reply