From nobody Fri Feb 16 04:00:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TbdWH1wf2z59ZK7; Fri, 16 Feb 2024 04:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TbdWG6Fjjz4HHh; Fri, 16 Feb 2024 04:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708056026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09RywJpyORvv3yoH/3bQk4JGW7+OsOc8Y5zzACFcVVw=; b=p6MMsHIxaUir63DUDvvSNhqLMLTXQvZDAjACetCMrnpJl0yv2F9J4lLoW9ubJyRMhlwPiN mB/WKn3ob5lDNEku5MOUPQVZAas8HZMjBMqFl+Vyt44k0718FtZ254lv0UPvwFMxKR6QcD Cz00CX5knZEy6RM6m/pMdmEwv9ZWxg59ePDu8QWG22ZFfLBsQrjx0XRKzbetVVrSw1kQ5B m46Owpd63bixl0XFmxZqM7xXiMqE4naXCjYF3JOVE7JcHovMV4lcCBw0E5YhVlFyqmz7i9 KjWL0cBlbvUm1OLZSSiQ2KbniJS5uHxC9e5f/cW96jtrsphcwOUJshw7Tztlrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708056026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09RywJpyORvv3yoH/3bQk4JGW7+OsOc8Y5zzACFcVVw=; b=JUJukx9hhcoz2rj7UK/Am5+AwyToucUc3KzMpVuay0JZ4/Q3ZrsRnmUvPtgMWLEoBLLBoK tx6UqTCtHlxYyxufNgzmZ4PWB59vYiEsmhp8mKVGH59/fqVCq0qMfIeX/37Nalc4BLCMVn AVysparFoJ5Yf5ysSohsSDD7Rgco2cc/VORgfKs3j7T2kWcM+aHPyZdo9DxtF8FxWnbTSN ih4OeCbUQwFpvi8PtS9bzIF8j6ZpQG0fuMH9AcCGcPfe+W6ZHPzqm68Lz6Car5RtgQfGQ3 +bmYC1qktnJyAHKiQlX/88xqVh3H3giiFj1kY1BQQb9UT6qnluYftZnsCOGhOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708056026; a=rsa-sha256; cv=none; b=FZDkZdshNlhbTfovXPWb2Tu12BOrOLncrdsTkf1aoCOmi6QwfIo8o283ACFCMHVpKXWul4 utXwKN4OIIFog4Kg84zTRorcHU1HmT4dtx6ymbTkkdjBI9rWR8imtlr98FldRNfbuE7BUa on8Vked5+HlHA5Pxco0Yr4OBpG90bjyuNpJ1xO5Tlsy7DLJaC2wWPTMiVn/aklWMvPJmWj zdWTQcDQo1yl0qrXOj9TgmCjir2KUEDR4403yUGQfxMqiYbr4EuXZr4JZ+Hmz5R35RFXQ/ azaMjjpYAGt5sgM//7RuusOPcxxVg3C0ReyNyXfpdrxSiTK8GC95rSrBhkWhVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TbdWG5GMXz18mY; Fri, 16 Feb 2024 04:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41G40QNJ019005; Fri, 16 Feb 2024 04:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41G40QUI019002; Fri, 16 Feb 2024 04:00:26 GMT (envelope-from git) Date: Fri, 16 Feb 2024 04:00:26 GMT Message-Id: <202402160400.41G40QUI019002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9c8bf69a53f6 - main - loader: Only create gfx 4th bindings when gfx is available List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c8bf69a53f628b62fb196182ea55fb34c1c19e1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9c8bf69a53f628b62fb196182ea55fb34c1c19e1 commit 9c8bf69a53f628b62fb196182ea55fb34c1c19e1 Author: Warner Losh AuthorDate: 2024-02-16 03:53:28 +0000 Commit: Warner Losh CommitDate: 2024-02-16 03:59:22 +0000 loader: Only create gfx 4th bindings when gfx is available Only create the gfx bindings for 4th when it's compiled into the loader. We do this with a linker set that only gets brought in to those loaders that call gfx_framework_init. This calls gfx_interp_md() will will drag in gfx_loader.c which will add to the linker set that registers these bindings. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43904 --- stand/common/gfx_fb.c | 1 + stand/ficl/Makefile | 5 +- stand/ficl/gfx_loader.c | 259 ++++++++++++++++++++++++++++++++++++++++++++++++ stand/ficl/loader.c | 188 ----------------------------------- 4 files changed, 263 insertions(+), 190 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index b61591bf3d45..3a5b851915e0 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -181,6 +181,7 @@ gfx_framework_init(void) * Setup font list to have builtin font. */ (void) insert_font(NULL, FONT_BUILTIN); + gfx_interp_md(); /* Draw in the gfx interpreter for this thing */ } static uint8_t * diff --git a/stand/ficl/Makefile b/stand/ficl/Makefile index a9b384024667..fe4ee03974b1 100644 --- a/stand/ficl/Makefile +++ b/stand/ficl/Makefile @@ -11,8 +11,8 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o -CFLAGS.loader.c += -I${SRCTOP}/sys/teken -CFLAGS.loader.c += -I${SRCTOP}/contrib/pnglite +CFLAGS.gfx_loader.c += -I${SRCTOP}/sys/teken +CFLAGS.gfx_loader.c += -I${SRCTOP}/contrib/pnglite .ifmake testmain CFLAGS= -DTESTMAIN -D_TESTMAIN CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} @@ -21,6 +21,7 @@ PROG= testmain .include .else LIB= ficl +BASE_SRCS+= gfx_loader.c # Not TESTMAINable .include .endif diff --git a/stand/ficl/gfx_loader.c b/stand/ficl/gfx_loader.c new file mode 100644 index 000000000000..a4501a7d3c39 --- /dev/null +++ b/stand/ficl/gfx_loader.c @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2024 Netflix, Inc + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* Copied from a file that likely shoulve have had this at the top */ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2020 Toomas Soome + * Copyright 2020 RackTop Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/******************************************************************* +** g f x _ l o a d e r . c +** Additional FICL words designed for FreeBSD's loader +** for graphics +*******************************************************************/ + +#include +#include "bootstrap.h" +#include +#include +#include "ficl.h" + +/* FreeBSD's loader interaction words and extras + * for graphics + * fb-bezier ( x0 y0 x1 y1 x2 y2 wd -- ) + * fb-drawrect ( x1 y1 x2 y2 fill -- ) + * fb-line ( x0 y0 x1 y1 wd -- ) + * fb-putimage ( flags x1 y1 x2 y2 -- flag ) + * fb-setpixel ( x y -- ) + * term-drawrect ( x1 y1 x2 y2 fill -- ) + * term-putimage ( flags x1 y1 x2 y2 -- flag ) + */ + +/* ( flags x1 y1 x2 y2 -- flag ) */ +void +ficl_term_putimage(FICL_VM *pVM) +{ + char *namep, *name; + int names; + unsigned long ret = FICL_FALSE; + uint32_t x1, y1, x2, y2, f; + png_t png; + int error; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 7, 1); +#endif + names = stackPopINT(pVM->pStack); + namep = (char *) stackPopPtr(pVM->pStack); + y2 = stackPopINT(pVM->pStack); + x2 = stackPopINT(pVM->pStack); + y1 = stackPopINT(pVM->pStack); + x1 = stackPopINT(pVM->pStack); + f = stackPopINT(pVM->pStack); + + x1 = gfx_state.tg_origin.tp_col + x1 * gfx_state.tg_font.vf_width; + y1 = gfx_state.tg_origin.tp_row + y1 * gfx_state.tg_font.vf_height; + if (x2 != 0) { + x2 = gfx_state.tg_origin.tp_col + + x2 * gfx_state.tg_font.vf_width; + } + if (y2 != 0) { + y2 = gfx_state.tg_origin.tp_row + + y2 * gfx_state.tg_font.vf_height; + } + + name = ficlMalloc(names + 1); + if (!name) + vmThrowErr(pVM, "Error: out of memory"); + (void) strncpy(name, namep, names); + name[names] = '\0'; + + if ((error = png_open(&png, name)) != PNG_NO_ERROR) { + if (f & FL_PUTIMAGE_DEBUG) + printf("%s\n", png_error_string(error)); + } else { + if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0) + ret = FICL_TRUE; /* success */ + (void) png_close(&png); + } + ficlFree(name); + stackPushUNS(pVM->pStack, ret); +} + +/* ( flags x1 y1 x2 y2 -- flag ) */ +void +ficl_fb_putimage(FICL_VM *pVM) +{ + char *namep, *name; + int names; + unsigned long ret = FICL_FALSE; + uint32_t x1, y1, x2, y2, f; + png_t png; + int error; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 7, 1); +#endif + names = stackPopINT(pVM->pStack); + namep = (char *) stackPopPtr(pVM->pStack); + y2 = stackPopINT(pVM->pStack); + x2 = stackPopINT(pVM->pStack); + y1 = stackPopINT(pVM->pStack); + x1 = stackPopINT(pVM->pStack); + f = stackPopINT(pVM->pStack); + + name = ficlMalloc(names + 1); + if (!name) + vmThrowErr(pVM, "Error: out of memory"); + (void) strncpy(name, namep, names); + name[names] = '\0'; + + if ((error = png_open(&png, name)) != PNG_NO_ERROR) { + if (f & FL_PUTIMAGE_DEBUG) + printf("%s\n", png_error_string(error)); + } else { + if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0) + ret = FICL_TRUE; /* success */ + (void) png_close(&png); + } + ficlFree(name); + stackPushUNS(pVM->pStack, ret); +} + +void +ficl_fb_setpixel(FICL_VM *pVM) +{ + FICL_UNS x, y; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 2, 0); +#endif + + y = stackPopUNS(pVM->pStack); + x = stackPopUNS(pVM->pStack); + gfx_fb_setpixel(x, y); +} + +void +ficl_fb_line(FICL_VM *pVM) +{ + FICL_UNS x0, y0, x1, y1, wd; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 5, 0); +#endif + + wd = stackPopUNS(pVM->pStack); + y1 = stackPopUNS(pVM->pStack); + x1 = stackPopUNS(pVM->pStack); + y0 = stackPopUNS(pVM->pStack); + x0 = stackPopUNS(pVM->pStack); + gfx_fb_line(x0, y0, x1, y1, wd); +} + +void +ficl_fb_bezier(FICL_VM *pVM) +{ + FICL_UNS x0, y0, x1, y1, x2, y2, width; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 7, 0); +#endif + + width = stackPopUNS(pVM->pStack); + y2 = stackPopUNS(pVM->pStack); + x2 = stackPopUNS(pVM->pStack); + y1 = stackPopUNS(pVM->pStack); + x1 = stackPopUNS(pVM->pStack); + y0 = stackPopUNS(pVM->pStack); + x0 = stackPopUNS(pVM->pStack); + gfx_fb_bezier(x0, y0, x1, y1, x2, y2, width); +} + +void +ficl_fb_drawrect(FICL_VM *pVM) +{ + FICL_UNS x1, x2, y1, y2, fill; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 5, 0); +#endif + + fill = stackPopUNS(pVM->pStack); + y2 = stackPopUNS(pVM->pStack); + x2 = stackPopUNS(pVM->pStack); + y1 = stackPopUNS(pVM->pStack); + x1 = stackPopUNS(pVM->pStack); + gfx_fb_drawrect(x1, y1, x2, y2, fill); +} + +void +ficl_term_drawrect(FICL_VM *pVM) +{ + FICL_UNS x1, x2, y1, y2; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 4, 0); +#endif + + y2 = stackPopUNS(pVM->pStack); + x2 = stackPopUNS(pVM->pStack); + y1 = stackPopUNS(pVM->pStack); + x1 = stackPopUNS(pVM->pStack); + gfx_term_drawrect(x1, y1, x2, y2); +} + +/************************************************************************** + f i c l C o m p i l e G f x +** Build FreeBSD platform extensions into the system dictionary +** for gfx +**************************************************************************/ +static void ficlCompileGfx(FICL_SYSTEM *pSys) +{ + ficlCompileFcn **fnpp; + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "fb-setpixel", ficl_fb_setpixel, FW_DEFAULT); + dictAppendWord(dp, "fb-line", ficl_fb_line, FW_DEFAULT); + dictAppendWord(dp, "fb-bezier", ficl_fb_bezier, FW_DEFAULT); + dictAppendWord(dp, "fb-drawrect", ficl_fb_drawrect, FW_DEFAULT); + dictAppendWord(dp, "fb-putimage", ficl_fb_putimage, FW_DEFAULT); + dictAppendWord(dp, "term-drawrect", ficl_term_drawrect, FW_DEFAULT); + dictAppendWord(dp, "term-putimage", ficl_term_putimage, FW_DEFAULT); + + return; +} +FICL_COMPILE_SET(ficlCompileGfx); + +void +gfx_interp_md(void) +{ +} diff --git a/stand/ficl/loader.c b/stand/ficl/loader.c index edde4f477d55..618d9483fbd9 100644 --- a/stand/ficl/loader.c +++ b/stand/ficl/loader.c @@ -44,8 +44,6 @@ #include "bootstrap.h" #include #include -#include -#include #include "ficl.h" /* FreeBSD's loader interaction words and extras @@ -65,182 +63,6 @@ * .# ( value -- ) */ -#ifndef TESTMAIN -/* ( flags x1 y1 x2 y2 -- flag ) */ -void -ficl_term_putimage(FICL_VM *pVM) -{ - char *namep, *name; - int names; - unsigned long ret = FICL_FALSE; - uint32_t x1, y1, x2, y2, f; - png_t png; - int error; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 7, 1); -#endif - names = stackPopINT(pVM->pStack); - namep = (char *) stackPopPtr(pVM->pStack); - y2 = stackPopINT(pVM->pStack); - x2 = stackPopINT(pVM->pStack); - y1 = stackPopINT(pVM->pStack); - x1 = stackPopINT(pVM->pStack); - f = stackPopINT(pVM->pStack); - - x1 = gfx_state.tg_origin.tp_col + x1 * gfx_state.tg_font.vf_width; - y1 = gfx_state.tg_origin.tp_row + y1 * gfx_state.tg_font.vf_height; - if (x2 != 0) { - x2 = gfx_state.tg_origin.tp_col + - x2 * gfx_state.tg_font.vf_width; - } - if (y2 != 0) { - y2 = gfx_state.tg_origin.tp_row + - y2 * gfx_state.tg_font.vf_height; - } - - name = ficlMalloc(names + 1); - if (!name) - vmThrowErr(pVM, "Error: out of memory"); - (void) strncpy(name, namep, names); - name[names] = '\0'; - - if ((error = png_open(&png, name)) != PNG_NO_ERROR) { - if (f & FL_PUTIMAGE_DEBUG) - printf("%s\n", png_error_string(error)); - } else { - if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0) - ret = FICL_TRUE; /* success */ - (void) png_close(&png); - } - ficlFree(name); - stackPushUNS(pVM->pStack, ret); -} - -/* ( flags x1 y1 x2 y2 -- flag ) */ -void -ficl_fb_putimage(FICL_VM *pVM) -{ - char *namep, *name; - int names; - unsigned long ret = FICL_FALSE; - uint32_t x1, y1, x2, y2, f; - png_t png; - int error; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 7, 1); -#endif - names = stackPopINT(pVM->pStack); - namep = (char *) stackPopPtr(pVM->pStack); - y2 = stackPopINT(pVM->pStack); - x2 = stackPopINT(pVM->pStack); - y1 = stackPopINT(pVM->pStack); - x1 = stackPopINT(pVM->pStack); - f = stackPopINT(pVM->pStack); - - name = ficlMalloc(names + 1); - if (!name) - vmThrowErr(pVM, "Error: out of memory"); - (void) strncpy(name, namep, names); - name[names] = '\0'; - - if ((error = png_open(&png, name)) != PNG_NO_ERROR) { - if (f & FL_PUTIMAGE_DEBUG) - printf("%s\n", png_error_string(error)); - } else { - if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0) - ret = FICL_TRUE; /* success */ - (void) png_close(&png); - } - ficlFree(name); - stackPushUNS(pVM->pStack, ret); -} - -void -ficl_fb_setpixel(FICL_VM *pVM) -{ - FICL_UNS x, y; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 2, 0); -#endif - - y = stackPopUNS(pVM->pStack); - x = stackPopUNS(pVM->pStack); - gfx_fb_setpixel(x, y); -} - -void -ficl_fb_line(FICL_VM *pVM) -{ - FICL_UNS x0, y0, x1, y1, wd; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 5, 0); -#endif - - wd = stackPopUNS(pVM->pStack); - y1 = stackPopUNS(pVM->pStack); - x1 = stackPopUNS(pVM->pStack); - y0 = stackPopUNS(pVM->pStack); - x0 = stackPopUNS(pVM->pStack); - gfx_fb_line(x0, y0, x1, y1, wd); -} - -void -ficl_fb_bezier(FICL_VM *pVM) -{ - FICL_UNS x0, y0, x1, y1, x2, y2, width; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 7, 0); -#endif - - width = stackPopUNS(pVM->pStack); - y2 = stackPopUNS(pVM->pStack); - x2 = stackPopUNS(pVM->pStack); - y1 = stackPopUNS(pVM->pStack); - x1 = stackPopUNS(pVM->pStack); - y0 = stackPopUNS(pVM->pStack); - x0 = stackPopUNS(pVM->pStack); - gfx_fb_bezier(x0, y0, x1, y1, x2, y2, width); -} - -void -ficl_fb_drawrect(FICL_VM *pVM) -{ - FICL_UNS x1, x2, y1, y2, fill; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 5, 0); -#endif - - fill = stackPopUNS(pVM->pStack); - y2 = stackPopUNS(pVM->pStack); - x2 = stackPopUNS(pVM->pStack); - y1 = stackPopUNS(pVM->pStack); - x1 = stackPopUNS(pVM->pStack); - gfx_fb_drawrect(x1, y1, x2, y2, fill); -} - -void -ficl_term_drawrect(FICL_VM *pVM) -{ - FICL_UNS x1, x2, y1, y2; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 4, 0); -#endif - - y2 = stackPopUNS(pVM->pStack); - x2 = stackPopUNS(pVM->pStack); - y1 = stackPopUNS(pVM->pStack); - x1 = stackPopUNS(pVM->pStack); - gfx_term_drawrect(x1, y1, x2, y2); -} -#endif /* TESTMAIN */ - void ficlSetenv(FICL_VM *pVM) { @@ -1042,16 +864,6 @@ void ficlCompilePlatform(FICL_SYSTEM *pSys) dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT); dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT); dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT); -#ifndef TESTMAIN - dictAppendWord(dp, "fb-setpixel", ficl_fb_setpixel, FW_DEFAULT); - dictAppendWord(dp, "fb-line", ficl_fb_line, FW_DEFAULT); - dictAppendWord(dp, "fb-bezier", ficl_fb_bezier, FW_DEFAULT); - dictAppendWord(dp, "fb-drawrect", ficl_fb_drawrect, FW_DEFAULT); - dictAppendWord(dp, "fb-putimage", ficl_fb_putimage, FW_DEFAULT); - dictAppendWord(dp, "term-drawrect", ficl_term_drawrect, FW_DEFAULT); - dictAppendWord(dp, "term-putimage", ficl_term_putimage, FW_DEFAULT); - dictAppendWord(dp, "isvirtualized?",ficlIsvirtualizedQ, FW_DEFAULT); -#endif SET_FOREACH(fnpp, Xficl_compile_set) (*fnpp)(pSys);