From b5ae34bbb0f8543df44a23f44ec48fb840430da3 Mon Sep 17 00:00:00 2001 From: cxy004 Date: Tue, 17 Aug 2021 17:08:21 +0800 Subject: [PATCH] game fix --- resources/ping-pong-mips32/game/game/game.S | 2 ++ resources/ping-pong-mips32/game/game/trap.S | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/resources/ping-pong-mips32/game/game/game.S b/resources/ping-pong-mips32/game/game/game.S index 1c18c99..005ff58 100644 --- a/resources/ping-pong-mips32/game/game/game.S +++ b/resources/ping-pong-mips32/game/game/game.S @@ -207,11 +207,13 @@ kb_readbuffer: srl t3, random, 2 la t2, spx_table andi t3, t3, 0x7 + sll t3, t3, 2 addu t3, t3, t2 lw ball_spx, 0(t3) srl t3, random, 5 la t2, spy_table andi t3, t3, 0x7 + sll t3, t3, 2 addu t3, t3, t2 sub ball_x, ball_x, ball_dx lw ball_spy, 0(t3) diff --git a/resources/ping-pong-mips32/game/game/trap.S b/resources/ping-pong-mips32/game/game/trap.S index 2d3ff50..20b3cba 100644 --- a/resources/ping-pong-mips32/game/game/trap.S +++ b/resources/ping-pong-mips32/game/game/trap.S @@ -10,15 +10,10 @@ .section .text.ebase180 .p2align 2 - mfc0 k1, CP0_STATUS - li k0, 0 - mtc0 k0, CP0_STATUS - lui k0, %hi(current_thread) + mfc0 k1, CP0_STATUS lw k0, %lo(current_thread)(k0) - sw k1, TF_STATUS(k0) - mfc0 k0, CP0_CAUSE andi k1, k0, CAUSEF_EXCCODE bnez k1, SYSCALL