Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillou68310 committed Dec 3, 2024
1 parent 9eae21d commit 0693040
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/code0/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240

#ifdef WIDESCREEN
#define ASPECT_RATIO (16.0f / 9.0f)
#else
#define ASPECT_RATIO (4.0f / 3.0f)
#endif

#define GFX_TASKS 2
#define DISPLAY_LIST_SIZE 0x1400
Expand Down
7 changes: 6 additions & 1 deletion src/code0/4600.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ void scanSectors(s32 posx, s32 posy, s32 posz, f32 arg3, s16 sectnum)
s32 i, j;

D_8012FC40 = 1;
viewrange = (klabs(D_8016A15C) * 0.7999999999999999)/*(1/1.25)*/ + 0.6283185307179999/*(PI/5)*/;
#ifdef WIDESCREEN
/*TODO: understand magic value*/
viewrange = (klabs(D_8016A15C) * 0.7999999999999999) /*(1/1.25)*/ + (PI / 4);
#else
viewrange = (klabs(D_8016A15C) * 0.7999999999999999) /*(1/1.25)*/ + 0.6283185307179999 /*(PI/5)*/;
#endif

if (sinf(D_801AC8E0) > 0.0f)
f2 = sinf(D_801AC8E0);
Expand Down
6 changes: 6 additions & 0 deletions src/code0/FDE0.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,14 @@ void func_80011180(void)
{
f32 f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14;
s32 i;
#ifdef WIDESCREEN
/*TODO: understand magic value*/
f1 = sinf(0.75f);
f2 = cosf(0.75f);
#else
f1 = sinf(0.61086524f);
f2 = cosf(0.61086524f);
#endif
f3 = ((SCREEN_WIDTH / 2.f) - 1.f) / (f1 / f2);
f5 = ((SCREEN_HEIGHT / 2.f) - 1.f);
f4 = 1.0 / sqrt(SQ(f3) + SQ(f5));
Expand Down

0 comments on commit 0693040

Please sign in to comment.