[Coco] GFX2("DEFBUFF"

L. Curtis Boyle curtisboyle at sasktel.net
Thu Feb 25 21:43:58 EST 2021


On Feb 25, 2021, at 8:25 PM, coco at jechar.ca wrote:
> 
> 
> If you have defined a graphics buffer with DEFBUFF is there some
> way to determine it's actual address in your process space
> so that you can poke values directly to the buffer.
> 
> Charlie.
> 
Defbuff doesn’t map the buffer in; it merely allocates it from the computer's memory and lets you define the group/buffer #’s, and the size of the buffer itself. To map it in (and map it out), use the GetStat call SS.MpGPB. 

An example in BASIC09 to get group 4, buffer 1 as an example (set up as a callable module: Call with RUN GetGPAddress(buffptr,buffsize):
PROCEDURE GetGPAddress
PARAM gpptr,gpsize:INTEGER
TYPE registers=cc,a,b,dp:BYTE;x,y,u:INTEGER
DIM regs:registers
(* Std Out
regs.a=1
regs.b=$84
(* group & buffer #’s
regs.x+$0401
(* Map it in (regs.y=0 to map it back out again)
regs.y=1
RUN SYSCALL($8d,regs)
IF LAND(regs.cc <http://regs.cc/>,1)=1 THEN
  PRINT “ERROR #”;regs.b
  gpptr=0
  gpsize=0
ELSE
  gpptr=regs.x
  gpsize=regs.y
ENDIF
END



L. Curtis Boyle
curtisboyle at sasktel.net

TRS-80 Color Computer Games website
http://www.lcurtisboyle.com/nitros9/coco_game_list.html

NitrOS-9 Ease of Use (EOU) Project
http://www.lcurtisboyle.com/nitros9/nitros9.html






More information about the Coco mailing list