Fix misc GCC compatibility issues (#1463)

* Fix osGetMemSize being optimized to `return 8MB` by gcc

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: ariahiro64 <45049787+ariahiro64@users.noreply.github.com>

* Workaround f32 to s16 cast for binang being UB if binang doesn't fit s16

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: ariahiro64 <45049787+ariahiro64@users.noreply.github.com>

* osGetMemSize fixup

* include z64math in z64camera

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: ariahiro64 <45049787+ariahiro64@users.noreply.github.com>
This commit is contained in:
Dragorn421
2022-12-13 02:55:57 +01:00
committed by GitHub
parent da06e9a701
commit 83163f4d4b
3 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -3,13 +3,13 @@
#define STEP 0x100000
u32 osGetMemSize(void) {
u32* ptr;
vu32* ptr;
u32 size = 0x400000;
u32 data0;
u32 data1;
while (size < 0x800000) {
ptr = (u32*)(0xA0000000 + size);
ptr = (vu32*)(K1BASE + size);
data0 = *ptr;
data1 = ptr[STEP / 4 - 1];