This commit is contained in:
cxy004 2021-08-16 05:04:51 +08:00
parent 62e8ef7488
commit 55fc776df6
4 changed files with 12 additions and 10 deletions

View File

@ -3,13 +3,6 @@ OUTPUT("game.elf")
OUTPUT_ARCH("mips:isa32r2") OUTPUT_ARCH("mips:isa32r2")
OUTPUT_FORMAT("elf32-tradlittlemips") OUTPUT_FORMAT("elf32-tradlittlemips")
PROVIDE(SPVR_STACK_INIT = 0x807E0000);
PROVIDE(GAME_STACK_INIT = 0x807F0000);
PROVIDE(SEG7 = 0xBFAFF010);
PROVIDE(SWITCH = 0xBFAFF020);
PROVIDE(BUTTON = 0xBFAFF028);
PROVIDE(UART0 = 0xBFE40000);
PROVIDE(UART1 = 0xBFE40010);
SECTIONS SECTIONS
{ {
. = 0x807F0000; . = 0x807F0000;

View File

@ -214,9 +214,9 @@ bss_init_done:
jal WRITESERIAL jal WRITESERIAL
nop nop
lui t0, %hi(SEG7) + 1 // lui t0, %hi(SEG7) + 1
li t1, 0 // li t1, 0
sw t1, %lo(SEG7)(t0) // sw t1, %lo(SEG7)(t0)
j RESTART_LOAD j RESTART_LOAD
nop nop

View File

@ -1,6 +1,7 @@
#include <regdef.h> #include <regdef.h>
#include <mipsregs.h> #include <mipsregs.h>
#include <exception.h> #include <exception.h>
#include <game.h>
.set noreorder .set noreorder
.set noat .set noat

View File

@ -1,6 +1,14 @@
#ifndef GAME_H #ifndef GAME_H
#define GAME_H #define GAME_H
#define SPVR_STACK_INIT 0x807E0000
#define GAME_STACK_INIT 0x807F0000
#define SEG7 0xBFAFF010
#define SWITCH 0xBFAFF020
#define BUTTON 0xBFAFF028
#define UART0 0xBFE40000
#define UART1 0xBFE40010
#define KB_UP 0xCB #define KB_UP 0xCB
#define KB_DOWN 0xCF #define KB_DOWN 0xCF
#define KB_PAUSE 0xD3 #define KB_PAUSE 0xD3