Code: Select all
' SWITCH - routines and small library for usage of a doublebuffered screen
' (c) 2005 by Simon Sunnyboy / Paradize http://paradize.atari.org/
' This routine gives you two additional screens in memory so you
' can draw a picture on one screen while displaying another.
' Additionally you get a third screen as a buffer for a background
' or to scroll things around.
' I used similar routines for about 10 years but I never bothered
' to make a library or include file out of it.
' USE AT YOUR OWN RISK!
' call initpage23 once at the start of your program
' make sure to call reset23 even in case of error (ON ERROR GOSUB ...)
' or you probably will disturb normal screen management
> PROCEDURE initpage23
' get address of current screen, it is reused by our routines!
' get memory for two additional screens
' feel free to rewrite it to use MALLOC() :)
logbase%=(hilf2%+256) AND &HFFFFFF00
background%=(hilf3%+256) AND &HFFFFFF00
' coyp contents of screen src% to screen dest%
> PROCEDURE scopy(pagea%,pageb%)
' use this to flip screens
' screen physbase% is displayed, draw things to logbase%
' GFA commands will from now on automatically draw to logbase%
> PROCEDURE switch
' use this to flip screens and copy your third background to the
' new workscreen in one go
> PROCEDURE switch_background
' show screen physbase% but draw to screen logbase%
> PROCEDURE draw_hidden
' show and draw to physbase% (all GFA output is directly visible)
> PROCEDURE draw_normal
' clean up and go back to the initial screen
> PROCEDURE reset23
Hartzok wrote:Hey, thanks for the code and for the advice. Unfortunately for me, and upon examination of the code, it seem that it will take some assembler/hardware knowledge to solve the problem in the DOS version. I got as far as using a BIOS interrupt call to select the active display page, but GFA kept drawing to the same address as before (I should 've known better:)). You seem to redirect the drawing routines using an XBIOS() command, which should be equivalent to some form of BIOS interrupt call. Here it is:
This is the key for redirecting graphics, right? Let me check if there is something similar in the DOS version's command listing.
Users browsing this forum: No registered users and 3 guests