diff --git a/Capy64/Runtime/Libraries/GPU.cs b/Capy64/Runtime/Libraries/GPU.cs index ccd6335..ddf6241 100644 --- a/Capy64/Runtime/Libraries/GPU.cs +++ b/Capy64/Runtime/Libraries/GPU.cs @@ -387,7 +387,14 @@ public class GPU : IComponent var t = L.CheckString(4); Utils.UnpackRGB((uint)c, out var r, out var g, out var b); - _game.Drawing.DrawString(new Vector2(x, y), t, new Color(r, g, b)); + try + { + _game.Drawing.DrawString(new Vector2(x, y), t, new Color(r, g, b)); + } + catch (ArgumentException ex) // UTF-16 fuckery + { + L.Error(ex.Message); + } return 0; } diff --git a/Capy64/Runtime/Libraries/Term.cs b/Capy64/Runtime/Libraries/Term.cs index 19638ea..0036e7e 100644 --- a/Capy64/Runtime/Libraries/Term.cs +++ b/Capy64/Runtime/Libraries/Term.cs @@ -316,7 +316,14 @@ internal class Term : IComponent if (!L.IsNone(1)) str = L.ToString(1); - Write(str); + try + { + Write(str); + } + catch (ArgumentException ex) // UTF-16 fuckery + { + L.Error(ex.Message); + } return 0; }