clean up warnings

This commit is contained in:
Patrick Surry
2024-12-30 07:19:04 -05:00
parent c72a8a94b6
commit ce59a1c6bb
4 changed files with 65 additions and 59 deletions

View File

@@ -1151,8 +1151,8 @@ void DrawImg(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* s = src->img + xs/4 + ys*wbs; u8* s = src->img + xs/4 + ys*wbs;
u8* d0; u8* d0;
u8* s0; u8* s0;
u8 b, b2, ms, md; u8 b, b2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
// faster mode // faster mode
if (((xs & 0x03) == 0) && ((xd & 0x03) == 0) && ((w & 0x03) == 0)) if (((xs & 0x03) == 0) && ((xd & 0x03) == 0) && ((w & 0x03) == 0))
@@ -1219,8 +1219,8 @@ void DrawImg(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* s = src->img + xs/8 + ys*wbs; u8* s = src->img + xs/8 + ys*wbs;
u8* d0; u8* d0;
u8* s0; u8* s0;
u8 b, b2, ms, md; u8 b, b2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
// faster mode // faster mode
if (((xs & 0x07) == 0) && ((xd & 0x07) == 0) && ((w & 0x07) == 0)) if (((xs & 0x07) == 0) && ((xd & 0x07) == 0) && ((w & 0x07) == 0))
@@ -1291,8 +1291,8 @@ void DrawImg(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* d02; u8* d02;
u8* s0; u8* s0;
u8* s02; u8* s02;
u8 b, b2, bb, bb2, ms, md; u8 b, b2, bb, bb2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
// faster mode // faster mode
if (((xs & 0x07) == 0) && ((xd & 0x07) == 0) && ((w & 0x07) == 0)) if (((xs & 0x07) == 0) && ((xd & 0x07) == 0) && ((w & 0x07) == 0))
@@ -1385,8 +1385,8 @@ void DrawImg(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* s0; u8* s0;
u8* d02; u8* d02;
u8* s02; u8* s02;
u8 b, b2, bb, ms, md; u8 b, b2, bb;
int i, rs, rd, xs2, xd2; int i, rs, rd;
// faster mode // faster mode
if (((xs & 0x07) == 0) && ((xd & 0x07) == 0) && ((w & 0x07) == 0)) if (((xs & 0x07) == 0) && ((xd & 0x07) == 0) && ((w & 0x07) == 0))
@@ -1555,8 +1555,8 @@ void DrawBlit(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* s = src->img + xs/2 + ys*wbs; u8* s = src->img + xs/2 + ys*wbs;
u8* d0; u8* d0;
u8* s0; u8* s0;
u8 b, b1, b2, ms, md; u8 b, b1, b2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
for (; h > 0; h--) for (; h > 0; h--)
{ {
@@ -1611,8 +1611,8 @@ void DrawBlit(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* s = src->img + xs/4 + ys*wbs; u8* s = src->img + xs/4 + ys*wbs;
u8* d0; u8* d0;
u8* s0; u8* s0;
u8 b, b1, b2, ms, md; u8 b, b1, b2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
for (; h > 0; h--) for (; h > 0; h--)
{ {
@@ -1667,8 +1667,8 @@ void DrawBlit(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* s = src->img + xs/8 + ys*wbs; u8* s = src->img + xs/8 + ys*wbs;
u8* d0; u8* d0;
u8* s0; u8* s0;
u8 b, b1, b2, ms, md; u8 b, b1, b2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
for (; h > 0; h--) for (; h > 0; h--)
{ {
@@ -1727,8 +1727,8 @@ void DrawBlit(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys, int
u8* d02; u8* d02;
u8* s0; u8* s0;
u8* s02; u8* s02;
u8 b, b1, b12, b2, bb, bb2, ms, md; u8 b, b1, b12, b2, bb, bb2;
int i, rs, rd, xs2, xd2; int i, rs, rd;
for (; h > 0; h--) for (; h > 0; h--)
{ {
@@ -1953,8 +1953,8 @@ void DrawImgMat(sCanvas* canvas, const sCanvas* src, int x, int y, int w, int h,
else if (mode == DRAWIMG_CLAMP) else if (mode == DRAWIMG_CLAMP)
{ {
// source image dimension // source image dimension
u32 ww = src->w - 1; int ww = src->w - 1;
u32 hh = src->h - 1; int hh = src->h - 1;
for (; h > 0; h--) for (; h > 0; h--)
{ {
@@ -2168,20 +2168,23 @@ void DrawTileMap(sCanvas* canvas, const sCanvas* src, const u8* map, int mapwbit
mat->ExportInt(m); mat->ExportInt(m);
// prepare variables // prepare variables
int wbs = src->wb; // source width bytes
const u8* s = src->img; // source image const u8* s = src->img; // source image
int xy0m, yy0m; // temporary Y members int xy0m, yy0m; // temporary Y members
u8* d = canvas->img + canvas->wb*y + x; // destination image u8* d = canvas->img + canvas->wb*y + x; // destination image
int wbd = canvas->wb - w; // destination width bytes int wbd = canvas->wb - w; // destination width bytes
int i, x2, y2; int i;
int tilesize = 1 << tilebits; // tile size
#if DRAW_HWINTER
int tilebits2 = tilebits*2; int tilebits2 = tilebits*2;
#else
int tilesize = 1 << tilebits; // tile size
int tilemask = tilesize - 1; // tile mask int tilemask = tilesize - 1; // tile mask
int tileinx; // tile index int tileinx; // tile index
int mapw = 1<<mapwbits; int mapw = 1<<mapwbits;
int maph = 1<<maphbits; int maph = 1<<maphbits;
int mapmaskx = (mapw * tilesize) - 1; // mask of map width int mapmaskx = (mapw * tilesize) - 1; // mask of map width
int mapmasky = (maph * tilesize) - 1; // mask of map height int mapmasky = (maph * tilesize) - 1; // mask of map height
#endif
#if DRAW_HWINTER // 1=use hardware interpolator #if DRAW_HWINTER // 1=use hardware interpolator
@@ -2261,6 +2264,8 @@ void DrawTileMap(sCanvas* canvas, const sCanvas* src, const u8* map, int mapwbit
for (i = w; i > 0; i--) for (i = w; i > 0; i--)
{ {
int x2, y2;
// pixel X coordinate on the map // pixel X coordinate on the map
x2 = (xy0m>>FRACT) & mapmaskx; x2 = (xy0m>>FRACT) & mapmaskx;
xy0m += m11; xy0m += m11;
@@ -2307,7 +2312,7 @@ void DrawImgLine(sCanvas* canvas, sCanvas* src, int xd, int yd, int xs, int ys,
int wbs = src->wb; // source width bytes int wbs = src->wb; // source width bytes
u8* d = canvas->img + xd + yd*wbd; // destination address u8* d = canvas->img + xd + yd*wbd; // destination address
u8* s = src->img + xs + ys*wbs; // source address u8* s = src->img + xs + ys*wbs; // source address
int i, j; int i;
#if DRAW_HWINTER // 1=use hardware interpolator to draw images #if DRAW_HWINTER // 1=use hardware interpolator to draw images

View File

@@ -13,7 +13,7 @@
// convert image from 16-color to 8x8 attribute format // convert image from 16-color to 8x8 attribute format
void Attr8Conv(u8* dst, u8* attr, const u8* src, int w, int h, const u8* pal) void Attr8Conv(u8* dst, u8* attr, const u8* src, int w, int h, const u8* pal)
{ {
int x, y, i, j, bestnum, best2num; int x, y, i, bestnum, best2num;
int hist[16]; int hist[16];
u8 b, b2, b3, best, best2, bestcol, best2col; u8 b, b2, b3, best, best2, bestcol, best2col;
const u8 *s; const u8 *s;

View File

@@ -8,6 +8,7 @@
#include "pico/stdlib.h" #include "pico/stdlib.h"
#include "pico/printf.h" #include "pico/printf.h"
#include "pico/multicore.h" #include "pico/multicore.h"
#include "hardware/clocks.h"
#include "picovga.h" #include "picovga.h"
@@ -544,11 +545,11 @@ void VgaCfg(const sVgaCfg* cfg, sVmode* vmode)
// recalculate frequency if not locked // recalculate frequency if not locked
if (!cfg->lockfreq) if (!cfg->lockfreq)
{ {
int freq2 = (int)(cpp*wfull*1000/hfull + 0.5f) + 200; u32 freq2 = (u32)(cpp*wfull*1000/hfull + 0.5f) + 200;
if (freq2 < freq) if (freq2 < freq)
{ {
cpp++; cpp++;
freq2 = (int)(cpp*wfull*1000/hfull + 0.5f) + 200; freq2 = (u32)(cpp*wfull*1000/hfull + 0.5f) + 200;
} }
if (freq2 >= freq) freq = freq2; if (freq2 >= freq) freq = freq2;
if (freq > cfg->fmax) freq = cfg->fmax; if (freq > cfg->fmax) freq = cfg->fmax;