Skip to content

Commit

Permalink
#407 OT processing optimizations (next/prev vertex index pre-fill)
Browse files Browse the repository at this point in the history
  • Loading branch information
XProger committed Jul 2, 2022
1 parent ea021e0 commit 32a5459
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 181 deletions.
9 changes: 5 additions & 4 deletions src/platform/32x/asm/rasterize.i
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
.align 4
.global _rasterize_asm
_rasterize_asm:
mov tile, r7
mov tile, r7 // set 4th arg for proc
mov flags, type
shll2 type
shlr16 type
extu.b type, proc

cmp/eq #FACE_TYPE_F, type // cmp/eq #imm is 8-bit
bf/s .getProc
mov L, R
mov L, R // [delay slot]
extu.b flags, R

.getProc: // proc = table[type]
Expand All @@ -29,13 +29,14 @@ _rasterize_asm:

// pixel = fb + y * 320 = fb + y * 256 + y * 64
mov.w @(VERTEX_Y, L), y
// FRAME_WIDTH = 320 = 256 + 64
mov.l var_fb, pixel
shll8 y
add y, pixel // pixel += y * 256
shar y
shar y
jmp @proc
add y, pixel // pixel += y * 64
add y, pixel // [delay slot] pixel += y * 64

.align 2
var_fb:
Expand All @@ -49,7 +50,7 @@ var_table:
.long 0xC0000000 + _rasterizeFT_asm - _block_render_start
.long 0xC0000000 + _rasterizeFT_asm - _block_render_start
.long 0xC0000000 + _rasterizeGT_asm - _block_render_start
.long 0xC0000000 + _rasterizeGT_asm - _block_render_start
.long 0xC0000000 + _rasterizeGT_asm - _block_render_start
#else
.long _rasterizeS_asm
.long _rasterizeF_asm
Expand Down
11 changes: 8 additions & 3 deletions src/platform/32x/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ void updateInput()
if (mask & SEGA_CTRL_MODE) keys |= IK_SELECT;
}

void* osLoadLevel(const char* name)
const void* osLoadScreen(LevelID id)
{
return (void*)LEVEL1_PKD;
return TITLE_SCR;
}

const void* osLoadLevel(LevelID id)
{
return (void*)LEVEL1_PKD; // TODO
}

uint16 pageIndex = 0;
Expand Down Expand Up @@ -190,7 +195,7 @@ int main()

MARS_SYS_COMM4 = 0;

gameInit(gLevelInfo[gLevelID].name);
gameInit();

int32 lastFrame = (gFrameIndex >> 1) - 1;
int32 fpsCounter = 0;
Expand Down
Loading

0 comments on commit 32a5459

Please sign in to comment.