Difference between revisions of "PicoVGA01"

From Land Boards Wiki
Jump to navigation Jump to search
Line 29: Line 29:
 
* PWM mono audio output
 
* PWM mono audio output
 
* Joystick connector(S)
 
* Joystick connector(S)
 
== Software ==
 
 
The PicoVGA library is written in C/C++ and allows output from the Raspberry Pico to a VGA monitor or PAL/NTSC TV, with a focus on ease of use in technical and gaming applications. It provides 4 graphic overlay layers with transparency, nearly 30 frame buffer formats that can be freely combined with each other, making do with limited RAM memory size. The limitation of output to 8 bits also contributes to RAM saving.
 
 
* [https://github.com/Panda381/PicoVGA PicoVGA GitHub repository]
 
* [https://github.com/land-boards/RasPiPico/tree/main/PicoVGA Our PicoVGA GitHub repository]
 
 
=== PicoVGA examples ===
 
 
* ProgramNameJS = My Joystick version of the programs
 
 
<pre>
 
Ants - card game
 
keyboard control: 'J' left, 'L' right, space select, 'D' discard, 'H' help, 'Q' quit
 
 
AntsJS - card game
 
JoyPad control: left, right, centerFire=select, upperLeft=discard, Fire=help move, upperRight=quit
 
 
Balloons - sprite demo, floating balloons
 
 
Draw - draw graphics demo
 
 
Earth - rotating Earth globe
 
 
Eggs - game of Eggs+Chickens+Hens, variant of the Reversi game
 
keyboard control: 'L' right, 'I' up, 'J' left, 'K' down, 'H' help, 'Q' quit, 'P' 2 players, 'D' demo, space stone, Enter ok
 
 
EggsJS - game of Eggs+Chickens+Hens, variant of the Reversi game
 
  JoyPad control: right, up, left, down, fire=help, upoerRight=quit, centerFire=stone, upperLeft=ok
 
  keyboard control: 'P' 2 players, 'D' demo
 
 
Fifteen - game
 
keyboard control: 'L' right, 'I' up, 'J' left, 'K' down, 'Q' new game
 
 
FifteenJS - game
 
    JoyPad control: right, up, left, down, upperRight=new game
 
 
Flag - animation of flag fluttering in the wind
 
 
Ghost Racing - car racing game, racing with player's ghost copy, demonstration of 3D perspective projection
 
keyboard control: 'I' gear up, 'K' gear down, 'J' turn left, 'L' turn right
 
 
Ghost RacingJS - car racing game, racing with player's ghost copy, demonstration of 3D perspective projection
 
JoyPad control: up=gear up, down=gear down, left=turn left, right=turn right
 
 
Ginger House - picture fairy tale book
 
keyboard control: 'J' previous page, 'L' next page
 
 
Ginger HouseJS - picture fairy tale book
 
JoyPad control: left=previous page, right=next page
 
 
Hello - simple demonstration, print text "Hello world!" on the screen
 
 
Hypno - hypnotizing rotating pattern
 
 
Level Meter - demo of music volume level indication
 
 
Life - game, reproducing cells
 
keyboard control: 'L' right, 'I' up, 'J' left, 'K' down, 'C' copy, 'V' paste, 'D' clear,
 
space flip state, Enter run life, 0..9 select slot
 
 
LifeJS - game, reproducing cells
 
JoyPad control: right=right, up=up, left=left, dowb=down, upperLeft=copy, Fire=paste, centerFire=flip state,
 
UpperRight=run life
 
keyboard control: 'D' clear, 0..9 select slot
 
 
Lines - moving line patterns
 
 
Mandelbrot - fractal pattern generator
 
keyboard control: 'E' up, 'S' left, 'D' right, 'X' down, 'Q' zoom in, 'A' zoom out,
 
'L' low resolution 132x100, 'M' medium resolution 264x200, 'H' high resolution 528x400,
 
'I' integer arithmetics, 'F' float arithmetics, 'B' double arithmetics,
 
'O' decrease number of steps, 'P' increase number of steps, 'U' increase system clock,
 
'T' decrease system clock, space redraw
 
 
MandelbrotJS - fractal pattern generator
 
JoyPad control: Up, left, right, down, Fire zoom in, upper left zoom out,
 
keyboard control: 'L' low resolution 132x100, 'M' medium resolution 264x200, 'H' high resolution 528x400,
 
'I' integer arithmetics, 'F' float arithmetics, 'B' double arithmetics,
 
'O' decrease number of steps, 'P' increase number of steps, 'U' increase system clock,
 
'T' decrease system clock, space redraw
 
 
Matrix Rain - simulation of Matrix code rain
 
 
Maze - game, simple maze with maze generator
 
keyboard control: 'J' left, 'I' up, 'L' right, 'K' down, 'H' help (show door)
 
 
MazeJS - game, simple maze with maze generator
 
JoyPad control: left, up, right, down, upperRight=help (show door)
 
 
Monoscope - test of various graphic modes
 
keyboard control: '0'..'9', 'A'..'U' select videomode
 
 
Oscilloscope - demo oscilloscope simulator
 
 
Pacman - game of popular Pac-man
 
keyboard control: 'J' left, 'I' up, 'L' right, 'K' down, 'A' pause
 
 
PacmanJS - game of popular Pac-man
 
JoyPad control: left, up, right, down, upper right pause
 
 
Pi - calculate Pi at 4800 digits
 
 
Pixels - random pixels
 
 
Raytrace - ray tracing 3D demonstration of mirror spheres
 
 
Sokoban - game with 3000 puzzles and with their solutions
 
keyboard control: 'L' right, 'I' up, 'J' left, 'K' down, 'H' help (solution),
 
'R' restart scene, 'Q' previous level, 'W' next level, 'P' info
 
 
SokobanJS - game with 3000 puzzles and with their solutions
 
JoyPad control: right, up, left, down, upperLeft=previous level, fire=next level, uppperRight=restart scene,
 
keyboard 'H' help (solution), 'P' info
 
 
Spheres - draw random spheres
 
 
Spots - draw random dot spots
 
 
Tetris - game
 
keyboard control: 'L' right, 'I' turn, 'J' left, 'K' drop, 'A' pause
 
 
TetrisJS - game
 
JoyPad control: right, center fire turn, left, down = drop, upper right = pause
 
 
Train - puzzle game with 50 levels and with their solutions
 
keyboard control: 'L' right, 'I' up, 'J' left, 'K' down, 'H' help (solution), Enter OK, Esc escape, BS backspace
 
 
TrainJS - puzzle game with 50 levels and with their solutions
 
JoyPad control: right, up, left, down, centerFire=OK, upperLeft=escape, fire=backspace, upperRight=help (solution),
 
 
Twister - deformable block covered with 4 textures
 
 
Water surface - simulation of a rippling water surface
 
</pre>
 
  
 
== Connectors ==
 
== Connectors ==

Revision as of 10:09, 24 July 2022

PicoVGA FRONT 3D.png

PicoVGA

PicoVGA uses a Raspberry Pi Pico to drive a VGA/TV display. PicoVGA was designed by Miroslav Nemecek.

The RP2040 processor contains 264 KB of RAM. This is not much for higher resolution image output and therefore RAM needs to be very sparing. In technical practice and for retro games (the processor does not have the power for more advanced games), 8-bit graphics output in R3G3B2 format (i.e. red 3 bits, green 3 bits and blue 2 bits) is fully sufficient. Output in 16 or 24 bits is not meaningful in normal practice, as the Raspberry Pico does not have enough memory or power to provide such large amounts of data in areas other than short demos. Using the dithering technique, interesting display results can be achieved even with 8-bit output.

PicoVGA diagram.jpg

Features

  • 1 base layer and 3 overlay layers with transparency
  • 8-bit output in R3G 3:3:2 format
  • VGA progressive output up to 1280x960 resolution
  • TV output in PAL or NTSC interlaced mode
  • 30 frame buffer formats: graphics, tiles, text, special
  • Colour palettes
  • Screen split into segments of different formats
  • RLE compression
  • Transparency with selectable key colour
  • Hardware sprites
  • Output layers to different color bits (color planes)
  • Automatic configuration video mode timings
  • Automatic overclocking of processor
  • Library uses the 2nd core, main program uses 1st core
  • PWM mono audio output
  • Joystick connector(S)

Connectors

J1/J3 Pico Breakout Headers

  • 2 of 1x20 headers

PicoVGA1 J1 J3.PNG

J2 - Mono Audio

  • 3.5mm stereo jack
  • Mono signal on both speakers

PicoVGA1 Audio J2.PNG

J4 - 5V USB B

  • Full-size USB B
  • 5V power

PicoVGA1 DC J4.PNG

J5 - JOYPAD Joystick

  • 1x12 Header matches pinout of JOYPAD card
  • JOYPAD card can be built without pull-up resistors

RasPiPico VGA J5 JOYPAD.PNG

// Init the JoyPad pins
// #define PB_UL 16		// Upper Left pushbutton
// #define PB_RT 17		// Right direction
// #define PB_FR 18		// Fire
// #define PB_LT 20		// Left direction
// #define PB_CF 21		// Center Fire
// #define PB_DN 22		// Down direction
// #define PB_UR 26		// Upper right
// #define PB_UP 27		// Up direction

J6 - Joystick (DB-9)

RasPiPico VGA J6 JOYSTICK.PNG

MSX Joystick Schematic Circuit 382px.png

  1. UP
  2. DOWN
  3. LEFT
  4. RIGHT
  5. +VCC
  6. BUTTON I
  7. BUTTON II
  8. BUTTON COMMON
  9. GND
// Init the Joystick pins
// #define PB_UL 16		// Upper Left pushbutton
// #define PB_RT 17		// Right direction
// #define PB_FR 18		// Fire
// #define PB_LT 20		// Left direction
// #define PB_CF 21		// Center Fire
// #define PB_DN 22		// Down direction
// #define PB_UR 26		// Upper right

J7 - 3.3V

  • 1x2 header
  • Additional power pins

PicoVGA1 3V J7.PNG

PicoVGA01 Mechanicals

PicoVGA01 Mechs.PNG

Prototype Build Hardware

PicoVGA P1080432-720px.jpg

Raspberry Pi Pico Breakout Card

RasPiPico.PNG

VGA Adapter Card

VGAX49 P901-cropped-720px.jpg

RasPiPico VGA J1.PNG

RasPiPico VGA Wiring.PNG

Audio Filter Card

RasPiPico AUDIO Wiring.PNG

Joy Stick (JoyPad)

P1826-CROPPED-720PX.jpg

Prototype Build Wiring

Pico Pin GPIO Signal Name Color Dest Pin
1 GP0 B3 BLU VGAX49 13
2 GP1 B4 BLU VGAX49 12
3 GND GND BRN VGAX49 20
4 GP2 G3 GRN VGAX49 8
5 GP3 G4 GRN VGAX49 7
6 GP4 G5 GRN VGAX49 6
7 GP5 R2 RED VGAX49 3
9 GP6 R3 RED VGAX49 2
10 GP7 R4 RED VGAX49 1
11 GP8 CSYNC GRY VGAX49 17
21 GP16 BRN JOYPAD 10
22 GP17 ORG JOYPAD 9
23 GND GND GRN AUD-FILT 2
24 GP18 YEL JOYPAD 8
25 GP19 AUDIO GRY AUD-FILT 1 or 3
26 GP20 GRN JOYPAD 7
27 GP21 BLU JOYPAD 6
28 GND GND BLK JOYPAD 11
29 GP22 VIO JOYPAD 5
31 GP26 GRY JOYPAD 4
32 GP27 WHT JOYPAD 3

Assembly Sheet