So... If I'm parsing what you're doing correctly, with SDL, you're blitting a BMP file that's of size 320x240 to the screen directly, right?
With your KOS code, you're blitting a PNG file that appears to be 512x512 in size, resizing it down to 320x240, if I'm reading it properly. That's where your problem is right there, if that's the case -- you've resized the image to a different size (which probably introduced its own set of weird artifact patterns to the image), then the video hardware is being forced to resize it once again back to the original size. You're definitely going to lose something in those conversions!
If this is indeed what you're doing, why not simply take the BMP, convert it to a PNG, then take the image and set the size to 512x256. I'm not suggesting to scale the image here, but rather just to increase the size the image while leaving the image data of the same size and keeping it aligned to the top-left corner of the image. Then you can use the u and v coordinates of each vertex to select the correct portion of the image to display (the top left u, v would still be 0, 0; the bottom right would then be 320.0f / 512, 240.0f / 256 -- you should be able to figure out what to do for the rest from that).
To give you an idea of what I'm suggesting (in case it isn't clear), here's the title screen code (and I've attached the image file too) from an emulator I wrote where I use the same technique (although, I'm displaying a 640x480 image, but the math works out the same either way). I only display the 640x480 pixels from the top left corner of the image...
Code: Select all
static void draw_textured_quad(pvr_poly_hdr_t *hdr, float x, float y, float z,
float w, float h, float umax, float vmax) {
pvr_vertex_t vert;
pvr_prim(hdr, sizeof(pvr_poly_hdr_t));
vert.flags = PVR_CMD_VERTEX;
vert.argb = 0xFFFFFFFF;
vert.oargb = 0x00000000;
vert.x = x;
vert.y = y + h;
vert.z = z;
vert.u = 0.0f;
vert.v = vmax;
pvr_prim(&vert, sizeof(pvr_vertex_t));
vert.y = y;
vert.v = 0.0f;
pvr_prim(&vert, sizeof(pvr_vertex_t));
vert.x = x + w;
vert.y = y + h;
vert.u = umax;
vert.v = vmax;
pvr_prim(&vert, sizeof(pvr_vertex_t));
vert.flags = PVR_CMD_VERTEX_EOL;
vert.y = y;
vert.v = 0.0f;
pvr_prim(&vert, sizeof(pvr_vertex_t));
}
Code: Select all
pvr_wait_ready();
pvr_scene_begin();
pvr_list_begin(PVR_LIST_OP_POLY);
draw_textured_quad(&hdr_title, 0.0f, 0.0f, 1.0f, 640.0f, 480.0f,
640.0f / 1024.0f, 480.0f / 512.0f);
pvr_list_finish();
pvr_scene_finish();