Page 1 of 1

Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 4:25 pm
by funkheld
Hello, good day, nice helper.

I don't understand the 320x240 screen.
- Where is the address please so that I can upload data from a bank there?
- How many colors does this screen have please?
- how many colors can 1 byte represent?
- how are the bytes arranged on the screen?

so:
1 --- 1----1......
2 --- 2----2.....
3 --- 3.....
4 --- 4
5 --- 5
6 --- 6
7 ----7
8 ----8
1 ----1....
2 ----2....
...........

or:
1---- 2---3----4 ---5.......
41---42----43----44......

thanks for help
greeting

Re: Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 4:51 pm
by TomXP411
Have you read the VERA Programmer's Reference yet?

https://github.com/X16Community/x16-doc ... ference.md

Re: Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 7:14 pm
by funkheld
oha.....oha..... :shock: :shock: :shock: :shock: :shock: :shock: :shock:

that's a lot...... :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll:

thanks
greeting

Re: Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 7:29 pm
by desertfish
Yeah you can configure the graphics modes virtually any way you like , if you want or need to.

However, to start with it might be helpful to begin with only the "default" 320x240 256color mode, you can tinker with it in BASIC .

Use SCREEN 128 to enable it.

It is 320 by 240 pixels in 256 colors, every pixel is a single byte. The byte is the color of the pixel: it's the color index in the 256 color palette (which you can modify to get different color tones on the screen.)
The bytes start at the top left and go across horizontally 0..319 and then continue on the next line 320..639 and so on.

You can set pixels with PSET, for example PSET 160,120,2 will put a single red pixel in the middle of the screen.

The video ram in this mode simply starts at address $0:0000.
So if you want to plot pixels by writing directly to video ram, you need to use the VPOKE command for example VPOKE 0,0,2 will make the pixel in the top left red. Note that this is VPOKE, not a normal POKE: the video ram is not directly accessible by the cpu it has to go through the Vera's data ports to read and write to it.

The basic commands mentioned above are described here https://github.com/X16Community/x16-doc ... rogramming

Re: Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 8:34 pm
by funkheld
Hello, thank you for the good explanation.

Thanks
greeting

Re: Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 8:38 pm
by funkheld
where are x1,y1-x2-y2 etc. stored for the graphic:
FF2C: GRAPH_draw_line - draw a line

Thanks

-------------------------------------
Graphics

The high-level graphics API exposes a set of standard functions. It allows applications to easily perform some common high-level actions like drawing lines, rectangles and images, as well as moving parts of the screen. All commands are completely implemented on top of the framebuffer API, that is, they will continue working after replacing the framebuffer driver with one that supports a different resolution, color depth or even graphics device.

$FF20: GRAPH_init - initialize graphics
$FF23: GRAPH_clear - clear screen
$FF26: GRAPH_set_window - set clipping region
$FF29: GRAPH_set_colors - set stroke, fill and background colors
$FF2C: GRAPH_draw_line - draw a line
$FF2F: GRAPH_draw_rect - draw a rectangle (optionally filled)
$FF32: GRAPH_move_rect - move pixels
$FF35: GRAPH_draw_oval - draw an oval or circle
$FF38: GRAPH_draw_image - draw a rectangular image
$FF3B: GRAPH_set_font - set the current font
$FF3E: GRAPH_get_char_size - get size and baseline of a character
$FF41: GRAPH_put_char - print a character
--------------------------------------------------

Re: Grafik 320x240 , Adress? Color?

Posted: Tue Feb 27, 2024 11:30 pm
by desertfish
Those are 32 bytes in the zero page , $02 - $21 inclusive.

They are mentioned here https://github.com/X16Community/x16-doc ... mander-x16

and you can also see them in the section about the Zero page in the Memory Map chapter of the documentation.