mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
PS1: Clear initial screen to grey
This commit is contained in:
parent
c892cfb5dc
commit
4e0f762c3c
@ -15,6 +15,7 @@ enum gpu_status_flags {
|
|||||||
|
|
||||||
|
|
||||||
enum gp0_cmd_type {
|
enum gp0_cmd_type {
|
||||||
|
GP0_CMD_MEM_FILL = 0x02000000,
|
||||||
GP0_CMD_CLEAR_VRAM_CACHE = 0x01000000,
|
GP0_CMD_CLEAR_VRAM_CACHE = 0x01000000,
|
||||||
GP0_CMD_TRANSFER_TO_VRAM = 0xA0000000,
|
GP0_CMD_TRANSFER_TO_VRAM = 0xA0000000,
|
||||||
GP0_CMD_POLYGON = 0x20000000,
|
GP0_CMD_POLYGON = 0x20000000,
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <gx2r/buffer.h>
|
#include <gx2r/buffer.h>
|
||||||
#include <whb/gfx.h>
|
#include <whb/gfx.h>
|
||||||
#include <coreinit/memdefaultheap.h>
|
#include <coreinit/memdefaultheap.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*------------------------------------------------------Fetch shaders------------------------------------------------------*
|
*------------------------------------------------------Fetch shaders------------------------------------------------------*
|
||||||
|
@ -952,6 +952,17 @@ void LBackend_TableFlagAdded(struct LTable* w) {
|
|||||||
LBackend_NeedsRedraw(w);
|
LBackend_NeedsRedraw(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Works out top and height of the scrollbar */
|
||||||
|
static void LTable_GetScrollbarCoords(struct LTable* w, int* y, int* height) {
|
||||||
|
float scale;
|
||||||
|
if (!w->rowsCount) { *y = 0; *height = 0; return; }
|
||||||
|
|
||||||
|
scale = w->height / (float)w->rowsCount;
|
||||||
|
*y = Math_Ceil(w->topRow * scale);
|
||||||
|
*height = Math_Ceil(w->visibleRows * scale);
|
||||||
|
*height = min(*y + *height, w->height) - *y;
|
||||||
|
}
|
||||||
|
|
||||||
/* Draws background behind column headers */
|
/* Draws background behind column headers */
|
||||||
static void LTable_DrawHeaderBackground(struct LTable* w) {
|
static void LTable_DrawHeaderBackground(struct LTable* w) {
|
||||||
BitmapCol gridColor = BitmapColor_RGB(20, 20, 10);
|
BitmapCol gridColor = BitmapColor_RGB(20, 20, 10);
|
||||||
|
@ -556,16 +556,6 @@ void LTable_FormatUptime(cc_string* dst, int uptime) {
|
|||||||
String_Format2(dst, "%i%r", &uptime, &unit);
|
String_Format2(dst, "%i%r", &uptime, &unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LTable_GetScrollbarCoords(struct LTable* w, int* y, int* height) {
|
|
||||||
float scale;
|
|
||||||
if (!w->rowsCount) { *y = 0; *height = 0; return; }
|
|
||||||
|
|
||||||
scale = w->height / (float)w->rowsCount;
|
|
||||||
*y = Math_Ceil(w->topRow * scale);
|
|
||||||
*height = Math_Ceil(w->visibleRows * scale);
|
|
||||||
*height = min(*y + *height, w->height) - *y;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LTable_ClampTopRow(struct LTable* w) {
|
void LTable_ClampTopRow(struct LTable* w) {
|
||||||
if (w->topRow > w->rowsCount - w->visibleRows) {
|
if (w->topRow > w->rowsCount - w->visibleRows) {
|
||||||
w->topRow = w->rowsCount - w->visibleRows;
|
w->topRow = w->rowsCount - w->visibleRows;
|
||||||
|
@ -241,8 +241,6 @@ void LTable_Sort(struct LTable* table);
|
|||||||
void LTable_ShowSelected(struct LTable* table);
|
void LTable_ShowSelected(struct LTable* table);
|
||||||
|
|
||||||
void LTable_FormatUptime(cc_string* dst, int uptime);
|
void LTable_FormatUptime(cc_string* dst, int uptime);
|
||||||
/* Works out top and height of the scrollbar */
|
|
||||||
void LTable_GetScrollbarCoords(struct LTable* w, int* y, int* height);
|
|
||||||
/* Ensures top/first visible row index lies within table */
|
/* Ensures top/first visible row index lies within table */
|
||||||
void LTable_ClampTopRow(struct LTable* w);
|
void LTable_ClampTopRow(struct LTable* w);
|
||||||
/* Returns index of selected row in currently visible rows */
|
/* Returns index of selected row in currently visible rows */
|
||||||
|
@ -1148,7 +1148,7 @@ static void ChatScreen_DrawChatBackground(struct ChatScreen* s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ChatScreen_DrawChat(struct ChatScreen* s, float delta) {
|
static void ChatScreen_DrawChat(struct ChatScreen* s, float delta) {
|
||||||
struct Texture tex;
|
GfxResourceID texID;
|
||||||
double now;
|
double now;
|
||||||
int i, logIdx;
|
int i, logIdx;
|
||||||
|
|
||||||
@ -1165,16 +1165,17 @@ static void ChatScreen_DrawChat(struct ChatScreen* s, float delta) {
|
|||||||
Widget_Render2(&s->chat, 0);
|
Widget_Render2(&s->chat, 0);
|
||||||
} else {
|
} else {
|
||||||
/* Only render recent chat */
|
/* Only render recent chat */
|
||||||
for (i = 0; i < s->chat.lines; i++) {
|
for (i = 0; i < s->chat.lines; i++)
|
||||||
tex = s->chat.textures[i];
|
{
|
||||||
|
texID = s->chat.textures[i].ID;
|
||||||
|
if (!texID) continue;
|
||||||
logIdx = s->chatIndex + i;
|
logIdx = s->chatIndex + i;
|
||||||
if (!tex.ID) continue;
|
|
||||||
|
|
||||||
if (logIdx < 0 || logIdx >= Chat_Log.count) continue;
|
if (logIdx < 0 || logIdx >= Chat_Log.count) continue;
|
||||||
/* Only draw chat within last 10 seconds */
|
/* Only draw chat within last 10 seconds */
|
||||||
if (Chat_GetLogTime(logIdx) + 10 < now) continue;
|
if (Chat_GetLogTime(logIdx) + 10 < now) continue;
|
||||||
|
|
||||||
Gfx_BindTexture(tex.ID);
|
Gfx_BindTexture(texID);
|
||||||
Gfx_DrawVb_IndexedTris_Range(4, i * 4, DRAW_HINT_SPRITE);
|
Gfx_DrawVb_IndexedTris_Range(4, i * 4, DRAW_HINT_SPRITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <psxetc.h>
|
#include <psxetc.h>
|
||||||
#include <psxgpu.h>
|
#include <psxgpu.h>
|
||||||
#include <psxpad.h>
|
#include <psxpad.h>
|
||||||
|
#include "../misc/ps1/ps1defs.h"
|
||||||
|
|
||||||
#define SCREEN_XRES 320
|
#define SCREEN_XRES 320
|
||||||
#define SCREEN_YRES 240
|
#define SCREEN_YRES 240
|
||||||
@ -47,6 +48,19 @@ void Window_Init(void) {
|
|||||||
|
|
||||||
void Window_Free(void) { }
|
void Window_Free(void) { }
|
||||||
|
|
||||||
|
// Resets screen to an initial grey colour
|
||||||
|
static void ClearScreen(void)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 10000; i++)
|
||||||
|
{
|
||||||
|
if (GPU_GP1 & GPU_STATUS_CMD_READY) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
GPU_GP0 = GP0_CMD_MEM_FILL | (0xCC << 16) | (0xCC << 8) | 0xCC;
|
||||||
|
GPU_GP0 = 0 | ( 0 << 16);
|
||||||
|
GPU_GP0 = 320 | (200 << 16);
|
||||||
|
}
|
||||||
|
|
||||||
void Window_Create2D(int width, int height) {
|
void Window_Create2D(int width, int height) {
|
||||||
ResetGraph(0);
|
ResetGraph(0);
|
||||||
launcherMode = true;
|
launcherMode = true;
|
||||||
@ -54,6 +68,7 @@ void Window_Create2D(int width, int height) {
|
|||||||
SetDefDispEnv(&disp, 0, 0, SCREEN_XRES, SCREEN_YRES);
|
SetDefDispEnv(&disp, 0, 0, SCREEN_XRES, SCREEN_YRES);
|
||||||
PutDispEnv(&disp);
|
PutDispEnv(&disp);
|
||||||
SetDispMask(1);
|
SetDispMask(1);
|
||||||
|
ClearScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window_Create3D(int width, int height) {
|
void Window_Create3D(int width, int height) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user