Page 1 of 1

prog8 : vpoke not function with %import syslib

Posted: Tue Mar 05, 2024 10:44 pm
by funkheld
Hi good afternoon.

I would like to please set a value in video with prog8 and vpoke.
it doesn't work.
what's wrong?

ps : sys.set_rasterline(150) is ok.

Thanks.
greeting

---------------------------------
%import gfx2
%import syslib

main {
uword address
ubyte wert
ubyte bank

sub start() {
gfx2.screen_mode(1)

address=100
bank=0
wert=255

sys.vpoke(bank,address,wert) >>>>>>>>>>>>>>> is error

repeat {
}
}
}
---------------------------------------

Re: prog8 : vpoke not function with %import syslib

Posted: Tue Mar 05, 2024 11:14 pm
by desertfish
vpoke (and many , many other symbols related to the Commander X16) can be found in the "cx16" namespace instead.

cx16.vpoke(1, $fa02, $0)


it shares the same module source file with sys and cbm namespaces. Note that the module file name is only used in the %import directive, after that, it is no longer visible - only the block names remain (sys, cbm, cx16 ...)
https://github.com/irmen/prog8/blob/mas ... ib.p8#L756

Re: prog8 : vpoke not function with %import syslib

Posted: Wed Mar 06, 2024 7:46 am
by funkheld
Thanks for the info.

How can you make data visible on which screen with the vpoke? I would then like, for example, Send data from bank 45 to the video ram.
I'm still walking in the fog... and can't see much on the video screen.

Thanks.
greeting

Re: prog8 : vpoke not function with %import syslib

Posted: Wed Mar 06, 2024 6:57 pm
by desertfish
I don't understand the question. You'll have to be more specific please. What did you try? What did you expect to happen? What happened instead?

Note that VPOKE really is not the best thing to put stuff on the screen: it'll be very slow or cumbersome or both, compared to the alternatives:
For text output there is txt.print/ txt.chrout, or txt.setcc and friends. For bitmap output you're much better off just using one of the graphics modules, or perhaps the GRAPH_* routines that exist in the kernal.

Re: prog8 : vpoke not function with %import syslib

Posted: Thu Mar 07, 2024 8:20 am
by funkheld
Thanks, I mean the routines in the kernel too.

I don't know where I put which data in, for example to draw a line, write a text or set a point with certain colors.
It's all still so foggy to me.

Thanks.

-------------------------------
For bitmap output you're much better off just using one of the graphics modules, or perhaps
the GRAPH_* routines that exist in the kernal.
------------------------------

Re: prog8 : vpoke not function with %import syslib

Posted: Thu Mar 07, 2024 8:47 am
by ahenry3068
funkheld wrote: Thu Mar 07, 2024 8:20 am Thanks, I mean the routines in the kernel too.

I don't know where I put which data in, for example to draw a line, write a text or set a point with certain colors.
It's all still so foggy to me.

Thanks.

-------------------------------
For bitmap output you're much better off just using one of the graphics modules, or perhaps
the GRAPH_* routines that exist in the kernal.
------------------------------
You should study the routines here: https://github.com/X16Community/x16-doc ... 0KERNAL.md Most of the procedure names that pertain to Mode 128 (The graphics 256 color mode) start with either FB or GRAPH.

Re: prog8 : vpoke not function with %import syslib

Posted: Thu Mar 07, 2024 5:26 pm
by funkheld
hello thanks for info and help.

greeting.

Re: prog8 : vpoke not function with %import syslib

Posted: Thu Mar 07, 2024 11:35 pm
by desertfish
You could also study the source code for the "graphics" module to get an idea of how to do things?
https://github.com/irmen/prog8/blob/mas ... raphics.p8