2 Commits

Author SHA1 Message Date
yair
315e2e4a9f Set vga_monoscope default boot mode to PAL 720x576 and add build instructions 2026-02-18 09:52:19 +02:00
Wayne Venables
f5a6ca0ce4 Move stdio_init_all() to before video initialization 2025-09-28 17:21:28 -07:00
17 changed files with 126 additions and 65 deletions

61
BUILD_INSTRUCTIONS.md Normal file
View File

@@ -0,0 +1,61 @@
# Build Instructions
This project uses CMake with the Raspberry Pi Pico SDK and an ARM cross-toolchain.
## Prerequisites (Ubuntu/Debian)
Install required packages:
```bash
sudo apt-get update
sudo apt-get install -y \
cmake \
ninja-build \
gcc-arm-none-eabi \
binutils-arm-none-eabi
```
## Configure
From the repository root:
```bash
cmake -S . -B build -G Ninja -DPICO_SDK_FETCH_FROM_GIT=ON
```
Notes:
- `PICO_SDK_FETCH_FROM_GIT=ON` automatically downloads the Pico SDK into `build/_deps`.
- If you already have a local Pico SDK, set `PICO_SDK_PATH` instead.
## Build the Monoscope Example
```bash
cmake --build build --target vga_monoscope -j
```
## Output Artifacts
After a successful build, files are generated here:
- `build/examples/vga_monoscope/vga_monoscope.uf2`
- `build/examples/vga_monoscope/vga_monoscope.hex`
- `build/examples/vga_monoscope/vga_monoscope.bin`
- `build/examples/vga_monoscope/build/vga_monoscope.elf`
## Rebuild
To rebuild after source changes:
```bash
cmake --build build --target vga_monoscope
```
## Clean Build
To start from a clean state:
```bash
rm -rf build
cmake -S . -B build -G Ninja -DPICO_SDK_FETCH_FROM_GIT=ON
cmake --build build --target vga_monoscope -j
```

View File

@@ -277,7 +277,10 @@ void DispOpenSel()
// main function
int main()
{
char ch;
// initialize stdio
stdio_init_all();
char ch;
u32 t;
// initialize random number generator
@@ -289,9 +292,6 @@ int main()
// initialize canvases
InitImg();
// initialize stdio
stdio_init_all();
// initialize sound output
PWMSndInit();

View File

@@ -790,7 +790,10 @@ void PlayGame(Bool comp1, Bool comp2)
// main function
int main()
{
char ch;
// initialize stdio
stdio_init_all();
char ch;
// copy tiles images
memcpy(TilesImg_Copy, TilesImg, sizeof(TilesImg));
@@ -805,9 +808,6 @@ int main()
// initialize videomode
Video(DEV_VGA, RES_EGA, FORM_8BIT, Box);
// initialize stdio
stdio_init_all();
// initialize sound output
PWMSndInit();

View File

@@ -118,7 +118,10 @@ Bool Check()
// main function
int main()
{
int i;
// initialize stdio
stdio_init_all();
int i;
// initialize random number generator
RandInitSeed();
@@ -130,9 +133,6 @@ int main()
Video(DEV_VGA, RES_ZX, FORM_TILE48, Board, TilesImg_Copy);
pScreen->strip[0].seg[0].offx = -32;
// initialize stdio
stdio_init_all();
// initialize sound output
PWMSndInit();

View File

@@ -329,7 +329,10 @@ void FlushChar()
int main()
{
int t0, t2;
// initialize stdio
stdio_init_all();
int t0, t2;
float dt;
// copy images
@@ -350,9 +353,6 @@ int main()
// initialize videomode
VideoInit(170000);
// initialize stdio
stdio_init_all();
// initialize sound output
PWMSndInit();

View File

@@ -294,7 +294,10 @@ void VideoInit()
int main()
{
char ch;
// initialize stdio
stdio_init_all();
char ch;
// copy font to RAM buffer
memcpy(Font_Copy, FontBold8x8, sizeof(FontBold8x8));
@@ -309,9 +312,6 @@ int main()
Page = 0;
OpenPage();
// initialize stdio
stdio_init_all();
// main loop
while (true)
{

View File

@@ -343,6 +343,9 @@ void InitSlot()
int main()
{
// initialize stdio
stdio_init_all();
char ch;
// copy tiles images to RAM buffer (flash would be too slow)
@@ -369,9 +372,6 @@ int main()
// VideoInit();
Video(DEV_VGA, RES_VGA, FORM_TILE16, Board, TilesImg_Copy);
// initialize stdio
stdio_init_all();
// display help
DispHelp();

View File

@@ -380,7 +380,10 @@ void Help()
int main()
{
int c;
// initialize stdio
stdio_init_all();
int c;
// run VGA core
StartVgaCore();
@@ -388,9 +391,6 @@ int main()
// setup videomode
Init();
// initialize stdio
stdio_init_all();
// initialize debug LED
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);

View File

@@ -214,7 +214,10 @@ void Clear()
int main()
{
int i;
// initialize stdio
stdio_init_all();
int i;
char ch;
// initialize random number generator
@@ -228,9 +231,6 @@ int main()
if (MAZEW != MAPW) pScreen->strip[0].seg[0].offx = -4; // center image on the screen
if (MAZEH != MAPH) pScreen->strip[0].seg[0].offy = -4;
// initialize stdio
stdio_init_all();
// display help
DispHelp();

View File

@@ -53,7 +53,7 @@
u16 Rows[962]; // RLE rows
u8 Img[180000] __attribute__ ((aligned(4))); // RLE image
int MonoSel = 22; // selected videomode
int MonoSel = 1; // selected videomode (PAL 720x576)
// monoscope descriptor
typedef struct {
@@ -254,16 +254,16 @@ void MonoList()
int main()
{
char c;
// initialize stdio
stdio_init_all();
char c;
// run VGA core
StartVgaCore();
// run default video mode VGA 640x480
MonoInit(22);
// initialize stdio
stdio_init_all();
// run default video mode PAL 720x576
MonoInit(1);
while (true)
{

View File

@@ -200,7 +200,10 @@ void FlushChar()
int main()
{
// initialize random number generator
// initialize stdio
stdio_init_all();
// initialize random number generator
RandInitSeed();
// initialize buffers on program start
@@ -212,9 +215,6 @@ int main()
// initialize videomode
VideoInit();
// initialize stdio
stdio_init_all();
// some internal checks
while ((sizeof(SpritesImg) != SPRITE_NUM*SPRITEW*SPRITEH) ||
(sizeof(TilesImg) != TILE_NUM*TILESIZE*TILESIZE))

View File

@@ -143,7 +143,10 @@ void FlushChar()
int main()
{
int i;
// initialize stdio
stdio_init_all();
int i;
// initialize random number generator
RandInitSeed();
@@ -157,9 +160,6 @@ int main()
// initialize videomode
VideoInit();
// initialize stdio
stdio_init_all();
// initialize sound output
PWMSndInit();

View File

@@ -1006,7 +1006,10 @@ void PlayDemo()
int main()
{
// initialize random number generator
// initialize stdio
stdio_init_all();
// initialize random number generator
RandInitSeed();
// copy tiles images to RAM buffer
@@ -1022,10 +1025,7 @@ int main()
Canvas.wb = TILESIZE;
Canvas.format = CANVAS_8;
// initialize stdio
stdio_init_all();
// initialize sound output
// initialize sound output
PWMSndInit();
// display help

View File

@@ -97,7 +97,10 @@ void FlushChar()
int main()
{
int i;
// initialize stdio
stdio_init_all();
int i;
// initialize random number generator
RandInitSeed();
@@ -117,9 +120,6 @@ int main()
// initialize videomode
VideoInit();
// initialize stdio
stdio_init_all();
// initialize sound output
PWMSndInit();

View File

@@ -1 +1 @@
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = (16 * 1024 * 1024)
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = (2 * 1024 * 1024)

View File

@@ -73,14 +73,14 @@ typedef unsigned char Bool;
// Constants
// ----------------------------------------------------------------------------
#define B0 (1<<0)
#define B1 (1<<1)
#define B2 (1<<2)
#define B3 (1<<3)
#define B4 (1<<4)
#define B5 (1<<5)
#define B6 (1<<6)
#define B7 (1<<7)
#define B0 (1U<<0)
#define B1 (1U<<1)
#define B2 (1U<<2)
#define B3 (1U<<3)
#define B4 (1U<<4)
#define B5 (1U<<5)
#define B6 (1U<<6)
#define B7 (1U<<7)
#define B8 (1U<<8)
#define B9 (1U<<9)
#define B10 (1U<<10)

View File

@@ -54,7 +54,7 @@ extern u32 CtrlBuf2[CBUF_MAX]; // control pairs: u32 count, read address (must b
extern int CtrlBufSize[LAYERS_MAX]; // size of control buffers
// render font pixel mask
extern u32 RenderTextMask[512];
extern "C" u32 RenderTextMask[512];
// fill memory buffer with u32 words
// buf ... data buffer, must be 32-bit aligned