VGA interface: How do I go from register documentation to xreg() function calls, and vice versa? #44
-
OK, I've been staring at the new VGA documentation and vgaprog and mandelbrot code examples for hours, and I am feeling really, really stupid! I simply cannot go from the VGA register documentation to the associated xreg() function call, or vice versa. The variable parameters xreg() function further confuses the issue, as there are no variable names beyond the first three in the header to give me a clue. The xreg() calls in vgaprog and mandelbot examples are uncommented, so no clues there either: // what the ???? Hopefully this will all be explained in an upcoming video. If any kind soul could enlighten me before then, I would really appreciate it. I'm completely stuck. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
The documentation has xreg samples with comments.
The variadic is also documented. It's not clear what you're stuck on. If you can narrow down the question, there might be an answer. |
Beta Was this translation helpful? Give feedback.
-
ill give it a shot , the first 3 parameters identify the register the 4th is the value // this sets several values at once device 1, channel 0, address 1 set to 3 (MODE 3 Bitmap) so now plane 0 is mode 3, 320x180 bitmap with 8bit color xreg(1, 0, 1, 0, 1, 140, 180); so now plane 1 is mode 0 console |
Beta Was this translation helpful? Give feedback.
-
Going through older posts... the pico-vga area was (and is) challenging for me in working to add simple graphics and text control mode CALL commands to EhBasic+. In addition to the RP6502-VGA docs and studying tonyvr's graphics library code (following michaelsarr's helpful explanation above), I put together a spreadsheet on the pico-vga graphics programming model to aid my understanding. It illustrates:
I'm sharing it here in the hopes it may be of value to others.... Pico6502_Video_Graphics_Modes_20240211.pdf The capabilities and potential of this humble machine Rumble put together continue to grab my attention.... |
Beta Was this translation helpful? Give feedback.
ill give it a shot ,
the first 3 parameters identify the register the 4th is the value
xreg(1, 0, 0, 2); //set register 1:0:0 with the value 2 , CANVAS. this is 320x180
device 1, channel 0, address 0 set it to 2
// this sets several values at once
// the first 3 parameters identify the device , channel and address
the 4th ,5th, 6th ... are the values to set... address is incremented
xreg(1, 0, 1, 3, 2, 0xFF00, 0, 0, 140);
device 1, channel 0, address 1 set to 3 (MODE 3 Bitmap)
(since we are mode 3 look up the following from the mode 3 section of the vga documentation)
device 1, channel 0, address 2 set to 2 (OPTIONS 2 - 8 bit color )
device 1, channel 0, address 3 set to 0xFF00 ( CONFIG a…