From acc5c19043f884f8fa7e52290b3d803c7e8a26ad Mon Sep 17 00:00:00 2001 From: otya128 Date: Tue, 6 Dec 2016 18:56:18 +0900 Subject: [PATCH] Add WIDTH stub --- SMILEBASIC/builtinfunctions.d | 12 ++++++++++++ SMILEBASIC/console.d | 3 +++ 2 files changed, 15 insertions(+) diff --git a/SMILEBASIC/builtinfunctions.d b/SMILEBASIC/builtinfunctions.d index a850a85..56b9a8c 100644 --- a/SMILEBASIC/builtinfunctions.d +++ b/SMILEBASIC/builtinfunctions.d @@ -238,6 +238,18 @@ class BuiltinFunction throw new OutOfRange("ATTR", 1); p.console.attr = cast(otya.smilebasic.console.ConsoleAttribute)attr; } + static void WIDTH(PetitComputer p, int width) + { + if (width != 8 && width != 16) + { + throw new IllegalFunctionCall("WIDTH", 1); + } + p.console.width = width; + } + static int WIDTH(PetitComputer p) + { + return p.console.width; + } static void VSYNC(PetitComputer p, DefaultValue!int time) { time.setDefaultValue(1); diff --git a/SMILEBASIC/console.d b/SMILEBASIC/console.d index 3d0e52c..4d47785 100644 --- a/SMILEBASIC/console.d +++ b/SMILEBASIC/console.d @@ -76,6 +76,7 @@ class Console GraphicPage GRPF; PetitComputer petitcom; bool[2] visibles = [true, true]; + int width; bool visible() { return visibles[petitcom.displaynum]; @@ -118,6 +119,8 @@ class Console for(int i = 0; i < consoleColor.length; i++) consoleColorGL[i] = petitcom.toGLColor(consoleColor[i]); + + width = 8; } void createFontTable() {