aboutsummaryrefslogtreecommitdiff
path: root/lib/DATS/writer.dats
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-07-28 21:38:35 +0200
committerXander <xander@biltopia.org>2023-07-28 21:38:35 +0200
commitb78762c92afee705e618f29f89897db8b45df3dd (patch)
tree90833dc90cd3b58ee84d19357fb1d945d40823ec /lib/DATS/writer.dats
parentc6ad352a25b6b1d45e56090ccc0432d123b043bc (diff)
downloadats-os-b78762c92afee705e618f29f89897db8b45df3dd.tar.xz
ats-os-b78762c92afee705e618f29f89897db8b45df3dd.zip
optional implementation of multboot 1
Diffstat (limited to 'lib/DATS/writer.dats')
-rw-r--r--lib/DATS/writer.dats28
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/DATS/writer.dats b/lib/DATS/writer.dats
index 9b2fd78..b8625f4 100644
--- a/lib/DATS/writer.dats
+++ b/lib/DATS/writer.dats
@@ -97,31 +97,27 @@ in
in
implement put_string (str : string) : void = let
- val (vbox pf | p) = ref_get_viewptr(writer_ref)
- implement init_exec$fwork<writer_t>(v) = let
+ implement exec_void$fwork<writer_t>(v) = let
implement string_foreach$fwork<writer_t> (c,env) = put_char(c,env)
val _ = $effmask_all(string_foreach_env<writer_t> (g1ofg0(str),v))
in
end
in
- init_exec<writer_t>(!p)
+ $effmask_ref(exec_void<writer_t>(writer_ref))
end
implement clear_screen() : void = let
- val (vbox pf | p) = ref_get_viewptr(writer_ref)
- implement init_exec$fwork<writer_t>(v) = _clear_screen(v)
+ implement exec_void$fwork<writer_t>(v) = _clear_screen(v)
+ implement initialize$fwork<writer_t>(v) =
+ (
+ v := @{position = 0, color_code = code_value(White,Black)};
+ let prval() = opt_some v in true end
+ )
in
- if p->initialized then
- init_exec<writer_t> (!p)
- else
- let
- prval () = opt_unnone p->obj
- val () = p->obj := @{position = 0, color_code = code_value(White,Black)}
- val () = p->initialized := true
- val () = _clear_screen(p->obj)
- prval () = opt_some p->obj
- in
- end
+ if not writer_ref->initialized then
+ initialize<writer_t>(writer_ref);
+
+ exec_void<writer_t>(writer_ref)
end
end