\ ---[ Code Addendum 02 ]-----------------------------[05/26/2008]---
\
\ For Graphics: VESA BIOS Extensions Part III
\
\ by Timothy Trussell
\
\ -------------------------------------------------------------------
\ This code is meant for use with the 32Forth system.
\ This is the DOS DPMI version of the compiler in Rick van Norman's
\ OS2FORTH.ZIP package, available on the Taygeta Scientific site at
\
\
ftp://ftp.taygeta.com/pub/Forth/Compilers/native/OS-2/
\ -------------------------------------------------------------------
\ Save as GVBE03.4th in your \os2forth\forth directory
\ -------------------------------------------------------------------
exists [GVBE03] [if]
forget [GVBE03]
[then]
: [GVBE03] ;
decimal
\ ---[Note]----------------------------------------------------------
\ This module requires the previous Code Addendum - GVBE02.4th
\ ------------------------------------------------------[End Note]---
include gvbe02.4th
\ ---[ Prototypes in GVBE02.4th ]------------------------------------
\ code AllocDOSMem ( -- 0/1 )
\ code FreeDOSMem ( -- )
\ code PokeDOSMem ( n offset -- )
\ code GetLowBuffer ( size &dst -- )
\ code IsVBE? ( -- 0/1 )
\ : VBEDetect ( -- 0/1 )
\ Demonstration code for GVBE02
\ : zprint ( &str -- )
\ : ShowInfo ( -- )
\ ---[ Prototypes in GVBE03.4th ]------------------------------------
\ code GetVBEModeInfo ( mode -- 0/1 )
\ : VBEGetModeInfo ( mode &dst -- 0/1 )
\ : DoFirst ( 1stmode# -- )
\ : AddNode ( mode# -- )
\ : BuildModeList ( -- )
\ : FindMode ( x y bpp -- 0/1 )
\ Demonstration code for GVBE03
\ : Format# ( n -- )
\ : ShowNodeData ( n -- n+1 )
\ : ListNodeData ( -- )
\ : ShowEntries ( -- )
\ : ModeList ( -- )
\ -----------------
\ ---[ Library Modules ]---------------------------------------------
\ -----------------
\ ---[ Modules in GVBE02 ]-------------------------------------------
\ EDO GT Hawkins Data Structure package
\ HeapAllot Static Heap memory allocation
\ ---[ Modules in GVBE02 ]-------------------------------------------
\ HeapAlloc Dynamic heap memory allocation
\ ---[ HeapAlloc ]---------------------------------------------------
\ Modified version of HeapAllot, which allows for dynamic allocation
\ of heap memory. Returns the starting address of the allocated
\ heap memory block, but does not create a dictionary entry.
: HeapAlloc ( size -- addr )
%%HeapPtr over - \ calculate new TOS
dup 16 mod - \ align to lower paragraph boundary
dup >R \ save addr for the moment
dup to %%HeapPtr \ update to new TOS
swap 0 fill \ zero the memory block