File: fcdisp.fs

package info (click to toggle)
fcode-utils 1.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 46,768 kB
  • sloc: ansic: 9,717; csh: 241; makefile: 129; sh: 17
file content (72 lines) | stat: -rw-r--r-- 2,410 bytes parent folder | download | duplicates (5)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
\ This file has been created with codegen's ccfcode

fcode-version2
headers

\ C runtime
variable $frame 0 $frame !
 " dev /pci" evaluate
 ( asm ) new-device
 ( asm )
\ function screen_open
: screen_open recursive
 24 $frame @ >r alloc-mem $frame !
 " "(61737369676E65642D616464726573736573)" get-my-property ( asm ) if
 " "(63616E6E6F742066696E642061737369676E65642D6164647265737365732070726F70657274790A)" type
 abort then

 begin decode-int ( asm ) dup $frame @ 8 + ( physhi ) l! drop
 decode-int ( asm ) dup $frame @ 16 + ( physmid ) l! drop
 decode-int ( asm ) dup $frame @ 20 + ( physlo ) l! drop
 decode-int ( asm ) dup $frame @ ( sizehi ) l! drop
 decode-int ( asm ) dup $frame @ 4 + ( sizelo ) l! drop
 dup ( top ) ( asm ) 0 > 1 and 0<> if $frame @ 8 + ( physhi ) l@ 24 >>a 7 and 2 <> 1 and then while repeat
 2drop
 ( asm )
 4 " "(636F6E6669672D6C40)" $call-parent ( asm )
 ( pop ) ( asm )
 24 $frame @ swap free-mem r> $frame ! exit dup $frame @ 12 + ( cfg ) l! drop
 4 $frame @ 12 + ( cfg ) l@ 65535 and 1 or 2 or " "(636F6E6669672D6C21)" $call-parent ( asm )
 $frame @ 8 + ( physhi ) l@ $frame @ 16 + ( physmid ) l@ $frame @ 20 + ( physlo ) l@ 480 640 * " "(6D61702D696E)" $call-parent ( asm )
 ( pop ) ( asm )
 24 $frame @ swap free-mem r> $frame ! exit to frame-buffer-adr ( asm )
 default-font ( asm )
 set-font ( asm )
 640 480 80 25 fb8-install ( asm )
 24 $frame @ swap free-mem r> $frame !
 ; \ end screen_open

\ function screen_close
: screen_close recursive
 4 $frame @ >r alloc-mem $frame !
 4 " "(636F6E6669672D6C40)" $call-parent ( asm )
 ( pop ) ( asm )
 4 $frame @ swap free-mem r> $frame ! exit dup $frame @ ( cfg ) l! drop
 4 $frame @ ( cfg ) l@ 65528 and " "(636F6E6669672D6C21)" $call-parent ( asm )
 frame-buffer-adr ( asm ) 480 640 * " "(6D61702D6F7574)" $call-parent ( asm )
 4 $frame @ swap free-mem r> $frame !
 ; \ end screen_close

\ function screen_selftest
: screen_selftest recursive
 " "(73637265656E2073656C66746573740A)" type
 0 exit
 ; \ end screen_selftest

\ function main
: main recursive
 " "(73637265656E)" device-name ( asm )
 " "(646973706C6179)" device-type ( asm )
 " "(6D616B652D70726F70657274696573)" evaluate
 " "()" " "(69736F363432392D313938332D636F6C6F7273)" property
 0 1 0 8 reg
 ['] screen_open is-install ( asm )
 ['] screen_close is-remove ( asm )
 ['] screen_selftest is-selftest ( asm )
 finish-device
 ( asm )
 ; \ end main

main

fcode-end