elf = test1.elf
bin = test1.psx
+iso = test1.iso
TCPREFIX = mipsel-linux-gnu-
$(elf): $(obj)
$(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
+$(iso): cd/cd.xml cd/system.cnf $(bin)
+ mkpsxiso -o $@ -y $<
+
-include $(dep)
%.s: %.c
$(CC) $(CFLAGS) -S -o $@ $<
+.PHONY: iso
+iso: $(iso)
+
.PHONY: clean
clean:
rm -f $(obj) $(bin) $(elf) link.map
.PHONY: run
run: $(bin)
mednafen $<
+
+.PHONY: runiso
+runiso: $(iso)
+ mednafen test1.cue
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<iso_project image_name="test1.iso" cue_sheet="test1.cue" no_xa="0">
+ <track type="data">
+ <identifiers system="PLAYSTATION" application="PLAYSTATION" publisher="SCEE"/>
+ <license file="licensee.dat"/>
+ <directory_tree>
+ <file name="system.cnf" source="system.cnf" type="data"/>
+ <file name="psx.exe" source="../test1.psx" type="data"/>
+ <dummy sectors="1024"/>
+ </directory_tree>
+ </track>
+
+ <!--track type="audio" trackid="02" source="myaudio.wav"/-->
+</iso_project>
dcache : ORIGIN = 0x1f800000, LENGTH = 0x400
}
-_stacktop = ORIGIN(ram) + LENGTH(ram);
+_stacktop = ORIGIN(ram) + LENGTH(ram) - 16;
_dcache = ORIGIN(dcache);
_dcache_end = ORIGIN(dcache) + LENGTH(dcache);
_progsize = _imgend - _start;
lui a0, REG_BASE
# setup screen mode
- li t0, 0
- sw t0, REG_GP1(a0) # GP1 0: reset
+ sw zero, REG_GP1(a0) # GP1 0: reset
li t0, 0x03000000 # GP1 3: display enable
sw t0, REG_GP1(a0)
# clear screen
li t0, 0x02302010 # cmd 2: fill area (BBGGRR)
sw t0, REG_GP0(a0)
- li t0, 0
- sw t0, REG_GP0(a0) # ... top left 0,0 (YYYYXXXX)
+ sw zero, REG_GP0(a0) # ... top left 0,0 (YYYYXXXX)
li t0, 0x00ef013f # ... size 319x239 (HHHHWWWW)
sw t0, REG_GP0(a0)
# draw gouraud triangle
- li t0, 0x30ff0000
+ li t0, 0x30ff0000 # cmd 30: draw gouraud triangle (+BBGGRR vert0)
sw t0, REG_GP0(a0)
- li t0, 160 | (16 << 16)
+ li t0, 160 | (16 << 16) # ... vertex(160, 16)
sw t0, REG_GP0(a0)
- li t0, 0x0000ff00
+ li t0, 0x0000ff00 # ... color vert1
sw t0, REG_GP0(a0)
- li t0, 32 | (180 << 16)
+ li t0, 32 | (180 << 16) # ... vertex(32, 180)
sw t0, REG_GP0(a0)
- li t0, 0x000000ff
+ li t0, 0x000000ff # ... color vert2
sw t0, REG_GP0(a0)
- li t0, 280 | (220 << 16)
+ li t0, 280 | (220 << 16) # ... vertex(220, 280)
sw t0, REG_GP0(a0)
#jal main