finally fix 3D rendering on console

sadly this breaks compatibility with high-level emulators
such as project and mupen, but that ought to be easier to fix
than this damned bug that escaped me for literally a month.
This commit is contained in:
Connor Olding 2018-10-02 05:05:18 +02:00
parent ddfb8eb503
commit 7ccccbc06d
2 changed files with 18 additions and 7 deletions

View File

@ -1,7 +1,7 @@
// settings:
constant K_DEBUG(0) // slows down interrupt handling to enable debug routines
constant HIRES(1)
constant HICOLOR(1)
constant HIRES(0)
constant HICOLOR(0)
constant MAIN_DECOMP_IMAGE(HIRES & HICOLOR)
@ -21,11 +21,22 @@ if HIRES {
constant HEIGHT(240)
}
if HICOLOR {
constant VIDEO_MODE(BPP32 | INTERLACE | AA_MODE_2)
if HIRES {
if HICOLOR {
// 640x480, 32-bit
constant VIDEO_MODE(BPP32 | INTERLACE | AA_MODE_3 | PIXEL_ADV_3)
} else {
// 640x480, 16-bit
constant VIDEO_MODE(BPP16 | INTERLACE | AA_MODE_2 | PIXEL_ADV_3)
}
} else {
// constant VIDEO_MODE(BPP16 | AA_MODE_2)
constant VIDEO_MODE(BPP16 | GAMMA_EN | GAMMA_DITHER_EN | AA_MODE_1 | DIVOT_EN | PIXEL_ADV_3)
if HICOLOR {
// 320x240, 32-bit
constant VIDEO_MODE(BPP32 | AA_MODE_2 | DIVOT_EN | PIXEL_ADV_3)
} else {
// 320x240, 16-bit
constant VIDEO_MODE(BPP16 | AA_MODE_1 | DIVOT_EN | PIXEL_ADV_3)
}
}
constant TASK_YIELDED(0x0001)

View File

@ -22,7 +22,7 @@ PushVideoTask:
li t0, VIDEO_STACK & ADDR_MASK // used for DList calls and returns?
li t1, VIDEO_STACK_SIZE
li t2, VIDEO_OUTPUT & ADDR_MASK
li t2, (VIDEO_OUTPUT & ADDR_MASK) | UNCACHED
// most commercial games re-use the yield pointer, so i assume it's fine:
li t3, VIDEO_YIELD & ADDR_MASK // stores output buffer size
li t4, ((MAIN_BASE << 16) | MAIN_DLIST_JUMPER) & ADDR_MASK // initial DList