prog8 : vpoke not function with %import syslib

All aspects of programming on the Commander X16.
Post Reply
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

prog8 : vpoke not function with %import syslib

Post 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 {
}
}
}
---------------------------------------
Attachments
vpoke.jpg
vpoke.jpg (49.17 KiB) Viewed 1454 times
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: prog8 : vpoke not function with %import syslib

Post 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
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: prog8 : vpoke not function with %import syslib

Post 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
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: prog8 : vpoke not function with %import syslib

Post 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.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: prog8 : vpoke not function with %import syslib

Post 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.
------------------------------
User avatar
ahenry3068
Posts: 1193
Joined: Tue Apr 04, 2023 9:57 pm

Re: prog8 : vpoke not function with %import syslib

Post 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.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: prog8 : vpoke not function with %import syslib

Post by funkheld »

hello thanks for info and help.

greeting.
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: prog8 : vpoke not function with %import syslib

Post 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
Post Reply