dodicat wrote:Are you setting a graphics screen before bload?
screen 20,32 or something similar
Yes
Code: Select all
using LISP
dim lsp AS LispModule, expr as string
BIND_FUNC( lsp.functions, "setvideo", SetVideo)
BIND_FUNC( lsp.functions, "setpixel", SetPixel)
BIND_FUNC( lsp.functions, "setline", SetLine)
BIND_FUNC( lsp.functions, "setres", SetRes)
BIND_FUNC( lsp.functions, "loadimage", LoadImage)
with lsp
.eval $"(setq x 0)"
.eval $"(setq y1 0)"
.eval $"(setq y2 599)"
.eval $"(setq page 0)"
.eval $"(setres 800 600 16)"
.eval $"(loadimage ""./test.bmp"")"
rem .eval $"(while (< x 799) " + _
rem "(setline x y1 x y2 (+ x (* 256 x) (* 65536 x))) " + _
rem "(setq x (+ x 1)))"
end with
sleep
It now compiles and executes with the following warnings:
test.bas(154) warning 1(1): Passing scalar as pointer, at parameter 2 of BLOAD()
test.bas(154) warning 1(1): Passing scalar as pointer, at parameter 3 of BLOAD()
Code: Select all
define_lisp_function(LoadImage, args)
_OBJ(p1) = _EVAL(_CAR(args))
_OBJ(p2) = _EVAL(_CAR(_CDR(args)))
_OBJ(p3) = _EVAL(_CAR(_CDR(_CDR(args))))
_OBJ(res) = any
if( _LENGTH(args) < 1) then
_RAISEERROR(LISP_ERR_TOO_FEW_ARGUMENTS)
end if
if(_IS_STRING(p1)) then
res = _NEW(OBJECT_TYPE_INTEGER)
res ->value.int = -1
Dim As String filename = *p1->value.str
Dim As Integer dest = p2->value.int
Dim As Integer pal = p3->value.int
Bload filename, dest, pal
function = res
else
function = _NIL_
end if
end_lisp_function()