Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
Created August 1, 2016 02:38
OC2 GPU idea
DRAFT.
The op names have not been assigned numbers. This is a deliberate decision.
It's likely that not all of these ops will exist.
It's likely that ops not listed here will exist.
----
Copy_Block, destx.w, desty.w, srcx.w, srcy.w, width.w, height.w:
Copies a block in VRAM (memmove-style).
Copy_Block_Forward, destx.w, desty.w, srcx.w, srcy.w, width.w, height.w:
Copy_Block_Backward, destx.w, desty.w, srcx.w, srcy.w, width.w, height.w:
Copies a block in VRAM (REP MOVSx-style).
Useful for e.g. LZSS decompression.
Exec_Commands, addr.w, length.w:
Execute a command list located in VRAM.
Frame_Advance, 0xND:
Advance by N.D MC ticks.
* 0x10 = 1.0decimal ticks - 20FPS
* 0x08 = 0.5decimal ticks - 40FPS
* 0x01 = 320FPS
This will be trackable by some hardware register,
mostly so you can detect lag,
or build up a large buffer of frames.
Pen_Both_4bpp, 0xBF:
Pen_Both_8bpp, 0xBB, 0xFF:
Set the background and foreground pen colour.
Pen_BG_8bpp, 0xBB:
Pen_FG_8bpp, 0xFF:
Set the background or foreground pen colour.
Rect_Fill_FG, x.w, y.w, width.w, height.w:
Rect_Fill_BG, x.w, y.w, width.w, height.w:
Rect_Fill_Imm8, x.w, y.w, width.w, height.w, color:
Draws a filled rectangle with the given colour.
Text_Draw_Imm8, x.w, y.w, length.w, string[length]:
Text_Draw_Imm16, x.w, y.w, length.w, string.w[length]:
Draws a string to the screen using the current FG and BG colours.
Text_Draw_Transp_Imm8, x.w, y.w, length.w, string[length]:
Text_Draw_Transp_Imm16, x.w, y.w, length.w, string.w[length]:
Draws a string to the screen using the current FG colour.
Upload_Data, addr16.w, length.w, data[length.w]:
Upload data directly to VRAM.
Video_Window_Set, addr_beg.w, width.w, height.w, pitch.w, vmode.w:
Window_Set, addr_beg.w, width.w, height.w, pitch.w, vmode.w:
Window_Source_Set, addr_beg.w, width.w, height.w, pitch.w, vmode.w:
Window_Target_Set, addr_beg.w, width.w, height.w, pitch.w, vmode.w:
Sets the window for drawing and clipping.
Window_Set sets both source and target.
Source and Target are useful for copies.
All reads are from Source.
All writes are to Target.
vmode defines the effective video mode.
This variable has no definition at this stage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment