1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
This commit is contained in:
julianb0 2019-06-20 12:58:24 +02:00
parent 054ce35bd0
commit d882e0362a
No known key found for this signature in database
GPG Key ID: DDF8325C95299A62
2 changed files with 16 additions and 2 deletions

4
ka/ABI
View File

@ -109,8 +109,8 @@ To the variadic function, argN can be accessed the following way:
mov reg, [rbp + N*8 + 16]
For instance:
mov rax, [rbp + 16] ; arg1
mov rdx, [rbp + 24] ; arg2
mov rax, [rbp + 16] ; arg0
mov rdx, [rbp + 24] ; arg1
It is recommended to use the reg+reg*imm16+imm16 memory format:
mov rax, [rbp + rcx * 8 + 16] ; accesses arg#rcx

View File

@ -114,6 +114,12 @@ void console_putat(ctx_t *ctx, char ch, int x, int y)
surf = TTF_RenderText_Solid(scr_font, scr_lines[y], scr_text_color);
if (!surf)
{
logerr("console_putat: couldn't render TTF font\n");
die(-1);
}
if (scr_texts[y])
{
if (scr_rects[y])
@ -128,10 +134,18 @@ void console_putat(ctx_t *ctx, char ch, int x, int y)
scr_texts[y] = SDL_CreateTextureFromSurface(scr_rend, surf);
scr_rects[y] = malloc(sizeof(SDL_Rect));
if (scr_texts[y] == NULL)
{
logerr("console_putat: couldn't create texture from surface\n");
SDL_FreeSurface(surf);
die(-1);
}
if (scr_rects[y] == NULL)
{
logerr("console_putat: not enough memory\n");
SDL_FreeSurface(surf);
SDL_DestroyTexture(scr_texts[y]);
die(-1);
}