1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-07-31 02:10:35 +02:00

32x fixes (#488)

* 32x: fix reset by adjusting slave irq mask to not block VRES

Otherwise the reset sequence can't complete because always has all irqs
masked.

* 32x: fix a deadlock on some versions of gcc

gcc doesn't know that gFrameIndex can change from irq and some gcc
versions overoptimize to not re-read gFrameIndex.

Alternative is to mark gFrameIndex volatile but that produces
redundant read instructions.
This commit is contained in:
notaz
2024-05-14 00:18:35 +03:00
committed by GitHub
parent 05361d3d37
commit 28ee7ac923
2 changed files with 2 additions and 2 deletions

View File

@@ -776,7 +776,7 @@ sec_start:
mov.l _sec_adapter,r1 mov.l _sec_adapter,r1
mov #0x00,r0 mov #0x00,r0
mov.b r0,@(1,r1) /* set int enables (different from primary despite same address!) */ mov.b r0,@(1,r1) /* set int enables (different from primary despite same address!) */
mov #0x0F,r0 mov #0x0D,r0
shll2 r0 shll2 r0
shll2 r0 shll2 r0
ldc r0,sr /* disallow ints */ ldc r0,sr /* disallow ints */

View File

@@ -204,7 +204,7 @@ int main()
while (1) while (1)
{ {
int32 frame = gFrameIndex; int32 frame = *(volatile int32 *)&gFrameIndex;
if (frame - fpsFrame >= vsyncRate) if (frame - fpsFrame >= vsyncRate)
{ {