diff --git a/compiler/res/prog8lib/atari/textio.p8 b/compiler/res/prog8lib/atari/textio.p8 index a6a5c7af9..59c9ca29f 100644 --- a/compiler/res/prog8lib/atari/textio.p8 +++ b/compiler/res/prog8lib/atari/textio.p8 @@ -14,15 +14,19 @@ const ubyte DEFAULT_HEIGHT = 24 sub clear_screen() { - txt.chrout(125) + chrout(125) } sub nl() { - txt.chrout('\n') + chrout('\n') } sub spc() { - txt.chrout(' ') + chrout(' ') +} + +sub bell() { + chrout($fd) } sub column(ubyte col) { diff --git a/compiler/res/prog8lib/c128/textio.p8 b/compiler/res/prog8lib/c128/textio.p8 index 340c29550..204ac0d85 100644 --- a/compiler/res/prog8lib/c128/textio.p8 +++ b/compiler/res/prog8lib/c128/textio.p8 @@ -15,19 +15,23 @@ const ubyte DEFAULT_HEIGHT = 25 sub clear_screen() { - txt.chrout(147) + chrout(147) } sub home() { - txt.chrout(19) + chrout(19) } sub nl() { - txt.chrout('\n') + chrout('\n') } sub spc() { - txt.chrout(' ') + chrout(' ') +} + +sub bell() { + chrout(7) } asmsub column(ubyte col @A) clobbers(A, X, Y) { diff --git a/compiler/res/prog8lib/c64/textio.p8 b/compiler/res/prog8lib/c64/textio.p8 index aafcf7505..bdc1c01c9 100644 --- a/compiler/res/prog8lib/c64/textio.p8 +++ b/compiler/res/prog8lib/c64/textio.p8 @@ -15,19 +15,29 @@ const ubyte DEFAULT_HEIGHT = 25 sub clear_screen() { - txt.chrout(147) + chrout(147) } sub home() { - txt.chrout(19) + chrout(19) } sub nl() { - txt.chrout('\n') + chrout('\n') } sub spc() { - txt.chrout(' ') + chrout(' ') +} + +sub bell() { + ; beep + c64.MVOL = 11 + c64.AD1 = %00110111 + c64.SR1 = %00000000 + c64.FREQ1 = 8500 + c64.CR1 = %00010000 + c64.CR1 = %00010001 } asmsub column(ubyte col @A) clobbers(A, X, Y) { diff --git a/compiler/res/prog8lib/cx16/textio.p8 b/compiler/res/prog8lib/cx16/textio.p8 index 694f5b49c..60b55b81d 100644 --- a/compiler/res/prog8lib/cx16/textio.p8 +++ b/compiler/res/prog8lib/cx16/textio.p8 @@ -18,19 +18,23 @@ const uword VERA_TEXTMATRIX_ADDR = $b000 sub clear_screen() { - txt.chrout(147) + chrout(147) } sub home() { - txt.chrout(19) + chrout(19) } sub nl() { - txt.chrout('\n') + chrout('\n') } sub spc() { - txt.chrout(' ') + chrout(' ') +} + +sub bell() { + chrout(7) } asmsub column(ubyte col @A) clobbers(A, X, Y) { diff --git a/compiler/res/prog8lib/pet32/textio.p8 b/compiler/res/prog8lib/pet32/textio.p8 index 5f1991f9c..22193688b 100644 --- a/compiler/res/prog8lib/pet32/textio.p8 +++ b/compiler/res/prog8lib/pet32/textio.p8 @@ -14,21 +14,24 @@ const ubyte DEFAULT_HEIGHT = 25 sub clear_screen() { - txt.chrout(147) + chrout(147) } sub home() { - txt.chrout(19) + chrout(19) } sub nl() { - txt.chrout('\n') + chrout('\n') } sub spc() { - txt.chrout(' ') + chrout(' ') } +sub bell() { + chrout(7) +} asmsub get_column() -> ubyte @Y { diff --git a/compiler/res/prog8lib/virtual/textio.p8 b/compiler/res/prog8lib/virtual/textio.p8 index 84fb9dcb6..fdb59ec00 100644 --- a/compiler/res/prog8lib/virtual/textio.p8 +++ b/compiler/res/prog8lib/virtual/textio.p8 @@ -22,11 +22,11 @@ sub clear_screen() { } sub nl() { - txt.chrout('\n') + chrout('\n') } sub spc() { - txt.chrout(' ') + chrout(' ') } sub lowercase() { @@ -44,6 +44,10 @@ sub chrout(ubyte char) { }} } +sub bell() { + chrout(7) +} + sub print (str text) { %ir {{ loadm.w r65535,txt.print.text diff --git a/examples/test.p8 b/examples/test.p8 index 45c855002..7cce0475f 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -11,9 +11,11 @@ main { if pointer>value { cx16.r0L++ } - if pointer>50000 { - cx16.r0L++ - } +; if pointer>50000 { +; cx16.r0L++ +; } + + txt.bell() } }