mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-09 07:18:34 -04:00
N64: Minorly simplify RSP texture size multiply
This commit is contained in:
parent
157c538a08
commit
abbfe4181b
@ -196,8 +196,8 @@ upload_vertex:
|
|||||||
slv vtex, SCREEN_VTX_S_T, vtx
|
slv vtex, SCREEN_VTX_S_T, vtx
|
||||||
|
|
||||||
# 32-bit right shift by 5, to keep the clip space coordinates unscaled
|
# 32-bit right shift by 5, to keep the clip space coordinates unscaled
|
||||||
vmudm vcspos_i, vcspos_i, vshift8.e4
|
vmudm vcspos_i, vcspos_i, K2048
|
||||||
vmadl vcspos_f, vcspos_f, vshift8.e4
|
vmadl vcspos_f, vcspos_f, K2048
|
||||||
|
|
||||||
addi vcount, -1
|
addi vcount, -1
|
||||||
addi src_ptr, 16
|
addi src_ptr, 16
|
||||||
@ -405,13 +405,11 @@ GL_TnL:
|
|||||||
#vmadh vst, vtexoffset, K1
|
#vmadh vst, vtexoffset, K1
|
||||||
#vmudl vst, vst, vtexsize
|
#vmudl vst, vst, vtexsize
|
||||||
|
|
||||||
vmudh v___, vst, vtexsize
|
vmudn vst_f, vst, vtexsize # ACC = vst * vtexsize, VST_F = ACC & 0xFFFF
|
||||||
vsar vst_i, COP2_ACC_HI
|
vmadh vst_i, vzero, vzero # ACC += zero * zero, VST_I = ACC >> 16
|
||||||
vsar vst_f, COP2_ACC_MD
|
|
||||||
|
|
||||||
vmudl vst_f, vst_f, K8192
|
vmudm v___, vst_i, K8192 # ACC = (vst_i * 8192)
|
||||||
vmadm vst_i, vst_i, K8192
|
vmadl vst, vst_f, K8192 # ACC += (vst_f * 8192) >> 16, VST = ACC & 0xFFFF
|
||||||
vmadn vst, vzero, vzero
|
|
||||||
|
|
||||||
#undef vst_i
|
#undef vst_i
|
||||||
#undef vst_f
|
#undef vst_f
|
||||||
|
@ -24,11 +24,6 @@
|
|||||||
#include <sys/fcntl.h>
|
#include <sys/fcntl.h>
|
||||||
#include "_PlatformConsole.h"
|
#include "_PlatformConsole.h"
|
||||||
|
|
||||||
// These functions are private in libdragon. FatFs functions are instead recommanded.
|
|
||||||
int open( const char *file, int flags, ... );
|
|
||||||
int stat( const char *file, struct stat *st );
|
|
||||||
int mkdir( const char * path, mode_t mode );
|
|
||||||
|
|
||||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||||
@ -95,6 +90,7 @@ static cc_string root_path_rom = String_FromConst("rom:/");
|
|||||||
void Platform_EncodePath(cc_filepath* dst, const cc_string* path) {
|
void Platform_EncodePath(cc_filepath* dst, const cc_string* path) {
|
||||||
char* str = dst->buffer;
|
char* str = dst->buffer;
|
||||||
cc_string path_ = *path;
|
cc_string path_ = *path;
|
||||||
|
|
||||||
if (Platform_ReadonlyFilesystem) { // read from rom root
|
if (Platform_ReadonlyFilesystem) { // read from rom root
|
||||||
int idx = String_IndexOf(path, '/');
|
int idx = String_IndexOf(path, '/');
|
||||||
if (idx >= 0) path_ = String_UNSAFE_SubstringAt(&path_, idx + 1);
|
if (idx >= 0) path_ = String_UNSAFE_SubstringAt(&path_, idx + 1);
|
||||||
@ -297,6 +293,7 @@ void Platform_Init(void) {
|
|||||||
dfs_init(DFS_DEFAULT_LOCATION);
|
dfs_init(DFS_DEFAULT_LOCATION);
|
||||||
timer_init();
|
timer_init();
|
||||||
rtc_init();
|
rtc_init();
|
||||||
|
|
||||||
if (!debug_init_sdfs("sd:/", -1)) {
|
if (!debug_init_sdfs("sd:/", -1)) {
|
||||||
String_Copy(&root_path, &root_path_rom);
|
String_Copy(&root_path, &root_path_rom);
|
||||||
Platform_ReadonlyFilesystem = true;
|
Platform_ReadonlyFilesystem = true;
|
||||||
|
@ -157,6 +157,8 @@ static void VirtualKeyboard_Draw(struct Context2D* ctx) {
|
|||||||
w = kb_tileWidth * KB_GetCellWidth(i);
|
w = kb_tileWidth * KB_GetCellWidth(i);
|
||||||
h = kb_tileHeight;
|
h = kb_tileHeight;
|
||||||
|
|
||||||
|
/* Note: Make sure that the virtual keyboard ends up using 16 colours or less, so that */
|
||||||
|
/* some console graphics backends can allocate the rendered texture as a 4bpp texture */
|
||||||
Gradient_Noise(ctx, i == selected ? KB_SELECTED_COLOR : KB_NORMAL_COLOR, 2, x, y, w, h);
|
Gradient_Noise(ctx, i == selected ? KB_SELECTED_COLOR : KB_NORMAL_COLOR, 2, x, y, w, h);
|
||||||
LWidget_DrawBorder(ctx, KB_BACKGROUND_COLOR, 1, 1, x, y, w, h);
|
LWidget_DrawBorder(ctx, KB_BACKGROUND_COLOR, 1, 1, x, y, w, h);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user