summaryrefslogtreecommitdiff
path: root/roms/openbios/drivers/tcx.fs
blob: 19fa5551c5b8a67f0d70e55ff038333a58c43d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\
\ Fcode payload for QEMU TCX graphics card
\
\ This is the Forth source for an Fcode payload to initialise
\ the QEMU TCX graphics card.
\

fcode-version3

\
\ Instead of using fixed values for the framebuffer address and the width
\ and height, grab the ones passed in by QEMU/generated by OpenBIOS
\

: openbios-video-addr
  " openbios-video-addr" $find if
    cell+ @
  then
;

: openbios-video-width
  " openbios-video-width" $find if
    cell+ @
  then
;

: openbios-video-height
  " openbios-video-height" $find if
    cell+ @
  then
;

: qemu-tcx-driver-install ( -- )
  openbios-video-addr to frame-buffer-adr
  default-font set-font
  openbios-video-width openbios-video-height over char-width / over char-height /
  fb8-install
;

: qemu-tcx-driver-init
  ['] qemu-tcx-driver-install is-install
;

qemu-tcx-driver-init

end0