Esppiral wrote:Super Mario 64 Dreamcast Widescreen
Code: Select all
FIND
54 85 30 F3 11 1F 5A 40 20 F2 45 C7 08 F1 3C F6
REPLACE
55 85 04 F3 11 1F 5A 40 20 F2 45 C7 08 F1 3C F6
sm64-port/src/pc/gfx/gfx_retro_dc.c:1187 , offset 0009001C, 0x8c0A001C
Code: Select all
FIND
4E F7 2D F0 4E F1 1C F4 3D C7 08 F1
REPLACE
4E F7 2D F0 4E F1 1C F4 3D C7 08 F6
sm64-port/src/pc/gfx/gfx_retro_dc.c:1187 ,offset 00090040, 0x8c0A0040
Code: Select all
static void gfx_calc_and_set_viewport(const Vp_t *viewport) {
// 2 bits fraction
float width = 2.0f * viewport->vscale[0] / 4.0f;
float height = 2.0f * viewport->vscale[1] / 4.0f;
/* LINE: 1187 */ float x = (viewport->vtrans[0] / 4.0f) - width / 2.0f;
float y = SCREEN_HEIGHT - ((viewport->vtrans[1] / 4.0f) + height / 2.0f);
width *= RATIO_X;
height *= RATIO_Y;
x *= RATIO_X;
y *= RATIO_Y;
rdp.viewport.x = x;
rdp.viewport.y = y;
rdp.viewport.width = width;
rdp.viewport.height = height;
rdp.viewport_or_scissor_changed = true;
}
and RATIO_X + RATIO_Y are sourced from here
static void gfx_dc_get_dimensions(uint32_t *width, uint32_t *height) {
*width = SCR_WIDTH; /* 640 */
*height = SCR_HEIGHT; /* 480 */
}
what values there would i be aiming for? 854x480 for 16:9 ?
Code: Select all
FIND
4C 41 EB 8C AB AA AA 3F
REPLACE
4C 41 EB 8C 00 00 80 3F
sm64-port/src/game/skybox.c:286, offset 000116E6, 0x8c0216E6
Code: Select all
void *create_skybox_ortho_matrix(s8 player) {
f32 left = sSkyBoxInfo[player].scaledX;
f32 right = sSkyBoxInfo[player].scaledX + SCREEN_WIDTH;
f32 bottom = sSkyBoxInfo[player].scaledY - SCREEN_HEIGHT;
f32 top = sSkyBoxInfo[player].scaledY;
Mtx *mtx = alloc_display_list(sizeof(*mtx));
#ifdef WIDESCREEN
f32 half_width = (4.0f / 3.0f) / GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_WIDTH / 2;
f32 center = (sSkyBoxInfo[player].scaledX + SCREEN_WIDTH / 2);
if (half_width < SCREEN_WIDTH / 2) {
// A wider screen than 4:3
left = center - half_width;
right = center + half_width;
}
#endif
if (mtx != NULL) {
#if defined(TARGET_DC)
guOrtho(mtx, left, right, bottom, top, -20.0f, 1.01f, 1.0f);
#else
guOrtho(mtx, left, right, bottom, top, 0.0f, 3.0f, 1.0f);
#endif
} else {
}
return mtx;
}
which could easily be changed here in guOrtho
Code: Select all
void guOrtho(Mtx *m, float left, float right, float bottom, float top, float near, float far,
float scale) {
float sp28[4][4];
guOrthoF(sp28, left, right, bottom, top, near, far, scale);
guMtxF2L(sp28, m);
}
like for the PSP for example, note my old comment
Code: Select all
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far,
float scale) {
float mat[4][4];
/* Really this is a native 16:9 aspect rendering hack, could be used on dc for anamophic */
#if defined(TARGET_PSP)
guPerspectiveF(mat, perspNorm, fovy, aspect*(1.0f/0.75555555555f), near, far, scale);
#else
guPerspectiveF(mat, perspNorm, fovy, aspect, near, far, scale);
#endif
guMtxF2L(mat, m);
}
Code: Select all
FIND
AB AA AA 3F 00 00 02 00 FF 88 01 89 A5 AE FF 70
REPLACE
00 00 80 3F 00 00 02 00 FF 88 01 89 A5 AE FF 70
sm64-port/src/pc/gfx/gfx_retro_dc.c:728, offset 0008FB4C, 0x8c09FB4C
i think you're hitting this.
Code: Select all
float x = v->ob[0] * rsp.MP_matrix[0][0] + v->ob[1] * rsp.MP_matrix[1][0] + v->ob[2] * rsp.MP_matrix[2][0] + rsp.MP_matrix[3][0];
float y = v->ob[0] * rsp.MP_matrix[0][1] + v->ob[1] * rsp.MP_matrix[1][1] + v->ob[2] * rsp.MP_matrix[2][1] + rsp.MP_matrix[3][1];
float z = v->ob[0] * rsp.MP_matrix[0][2] + v->ob[1] * rsp.MP_matrix[1][2] + v->ob[2] * rsp.MP_matrix[2][2] + rsp.MP_matrix[3][2];
float w = v->ob[0] * rsp.MP_matrix[0][3] + v->ob[1] * rsp.MP_matrix[1][3] + v->ob[2] * rsp.MP_matrix[2][3] + rsp.MP_matrix[3][3];
x = gfx_adjust_x_for_aspect_ratio(x);
but that is only used for polygon clipping, and would adjust if the first change was made, as gfx_adjust_x_for_aspect_ratio() also uses the reported screen height+width
Code: Select all
FIND
AB AA AA 3F 3C 41 DE 8C
REPLACE
00 00 80 3F 3C 41 DE 8C
couldnt find this at all, whats the meaning of the change?
for reference: id love to work with you on this
https://github.com/mrneo240/sm64-port/blob/master/src/pc/gfx/gfx_retro_dc.chttps://github.com/mrneo240/sm64-port/blob/master/src/pc/gfx/gfx_gldc.c