From 57e90efb25fd836713611b38ec36a60b9a5994ab Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sat, 9 Mar 2024 03:50:15 +0200 Subject: [PATCH] fixed --- .gitignore | 1 + Makefile | 12 +++++++----- psx.ld | 8 ++++++-- src/startup.S | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9e3b2a3..147abfb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *.elf *.psx *.map +*.exe diff --git a/Makefile b/Makefile index c0a1ea4..9cbaf72 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,11 @@ ssrc = $(wildcard src/*.S) obj = $(csrc:.c=.o) $(ssrc:.S=.o) dep = $(csrc:.c=.d) $(ssrc:.S=.d) -elf = test1.elf -bin = test1.psx -iso = test1.iso +name = test1 +elf = $(name).elf +bin = $(name).psx +iso = $(name).bin +cue = $(name).cue TCPREFIX = mipsel-linux-gnu- @@ -39,7 +41,7 @@ iso: $(iso) .PHONY: clean clean: - rm -f $(obj) $(bin) $(elf) link.map + rm -f $(obj) $(bin) $(elf) $(iso) $(cue) link.map .PHONY: cleandep cleandep: @@ -51,4 +53,4 @@ run: $(bin) .PHONY: runiso runiso: $(iso) - mednafen test1.cue + mednafen $(cue) diff --git a/psx.ld b/psx.ld index fc5a306..74fd857 100644 --- a/psx.ld +++ b/psx.ld @@ -29,12 +29,16 @@ SECTIONS { _gp = ALIGN(16) + 0x7ff0; .sdata : { * (.sdata*); - KEEP(*(.keep)); + } >ram + + .padding : { + BYTE(0); + . = ALIGN(0x800); } >ram _imgend = .; - .bss ALIGN(4) : { + .bss ALIGN(4) (NOLOAD) : { _bss_start = .; /* .sbss first to be reachable by _gp */ * (.sbss*); diff --git a/src/startup.S b/src/startup.S index afce04b..a058ea5 100644 --- a/src/startup.S +++ b/src/startup.S @@ -38,7 +38,7 @@ _start: li t0, 0x02302010 # cmd 2: fill area (BBGGRR) sw t0, REG_GP0(a0) sw zero, REG_GP0(a0) # ... top left 0,0 (YYYYXXXX) - li t0, 0x00ef013f # ... size 319x239 (HHHHWWWW) + li t0, 0x0108013f # ... size 319x239 (HHHHWWWW) sw t0, REG_GP0(a0) # draw gouraud triangle -- 1.7.10.4