Move stdio_init_all() to before video initialization

This commit is contained in:
Wayne Venables
2025-09-28 17:21:28 -07:00
parent f2dc01f699
commit f5a6ca0ce4
16 changed files with 62 additions and 62 deletions

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

@@ -254,7 +254,10 @@ void MonoList()
int main()
{
char c;
// initialize stdio
stdio_init_all();
char c;
// run VGA core
StartVgaCore();
@@ -262,9 +265,6 @@ int main()
// run default video mode VGA 640x480
MonoInit(22);
// initialize stdio
stdio_init_all();
while (true)
{
// print list

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