You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
deferred prints!
This commit is contained in:
1
init.c
1
init.c
@@ -13,5 +13,6 @@ void s2d_stop(void) {
|
||||
gSPLoadUcode(gdl_head++, zex_text, zex_data);
|
||||
my_rdp_init();
|
||||
my_rsp_init();
|
||||
s2d_reset_defer_index();
|
||||
}
|
||||
|
||||
|
||||
39
s2d_buffer.c
Normal file
39
s2d_buffer.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "config.h"
|
||||
#include "s2d_error.h"
|
||||
#include "s2d_print.h"
|
||||
|
||||
#define S2D_BUFFERSIZE 100
|
||||
|
||||
struct s2d_pos {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
static struct s2d_pos s2d_positions[S2D_BUFFERSIZE];
|
||||
static char *s2d_charBuffer[S2D_BUFFERSIZE];
|
||||
static int s2d_charBuffer_index = 0;
|
||||
|
||||
void s2d_reset_defer_index(void) {
|
||||
s2d_charBuffer_index = 0;
|
||||
}
|
||||
|
||||
// TODO: these DO NOT work
|
||||
// pls debug :)
|
||||
void s2d_print_deferred(int x, int y, const char *str) {
|
||||
s2d_charBuffer[s2d_charBuffer_index] = str;
|
||||
s2d_positions[s2d_charBuffer_index].x = x;
|
||||
s2d_positions[s2d_charBuffer_index].y = y;
|
||||
|
||||
s2d_charBuffer_index++;
|
||||
}
|
||||
|
||||
void s2d_handle_deferred(void) {
|
||||
for (int i = 0; i < s2d_charBuffer_index; i++) {
|
||||
s2d_print_alloc(
|
||||
s2d_positions[i].x,
|
||||
s2d_positions[i].y,
|
||||
ALIGN_LEFT,
|
||||
s2d_charBuffer[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
10
s2d_draw.c
10
s2d_draw.c
@@ -19,10 +19,12 @@ Gfx s2d_text_init_dl[] = {
|
||||
|
||||
// IA8
|
||||
// TODO: add more formats
|
||||
gsDPSetCombineLERP(0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0,
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0),
|
||||
gsDPSetCombineLERP(
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0,
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0
|
||||
),
|
||||
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user