mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
Wii: Add a console to display startup messages to the screen instead of showing the user a black screen while the game initializes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4820 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bd813831b0
commit
8d115df01e
7 changed files with 121 additions and 23 deletions
|
@ -67,6 +67,9 @@ ifeq ($(PLATFORM),WINDOWS)
|
|||
ENGINE_OBJS+= winbits
|
||||
ENGINE_EDITOR_OBJS+= startwin.editor
|
||||
endif
|
||||
ifeq ($(PLATFORM),WII)
|
||||
ENGINE_OBJS+= wiibits
|
||||
endif
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ENGINE_OBJS+= sdlayer
|
||||
|
||||
|
|
|
@ -24,13 +24,14 @@ $(ENGINE_OBJ)/lz4.$o: $(ENGINE_SRC)/lz4.c $(ENGINE_INC)/lz4.h
|
|||
$(ENGINE_OBJ)/osd.$o: $(ENGINE_SRC)/osd.c $(ENGINE_INC)/build.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/baselayer.h
|
||||
$(ENGINE_OBJ)/pragmas.$o: $(ENGINE_SRC)/pragmas.c $(ENGINE_INC)/compat.h
|
||||
$(ENGINE_OBJ)/scriptfile.$o: $(ENGINE_SRC)/scriptfile.c $(ENGINE_INC)/scriptfile.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/compat.h
|
||||
$(ENGINE_OBJ)/sdlayer.$o: $(ENGINE_SRC)/sdlayer.c $(ENGINE_INC)/compat.h $(ENGINE_INC)/sdlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/a.h $(ENGINE_INC)/build.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/glbuild.h
|
||||
$(ENGINE_OBJ)/sdlayer.$o: $(ENGINE_SRC)/sdlayer.c $(ENGINE_SRC)/sdlayer12.c $(ENGINE_INC)/compat.h $(ENGINE_INC)/sdlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/a.h $(ENGINE_INC)/build.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/glbuild.h
|
||||
$(ENGINE_OBJ)/winlayer.$o: $(ENGINE_SRC)/winlayer.c $(ENGINE_INC)/compat.h $(ENGINE_INC)/winlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/build.h $(ENGINE_INC)/a.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/dxdidf.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/rawinput.h $(ENGINE_INC)/winbits.h
|
||||
$(ENGINE_OBJ)/gtkbits.$o: $(ENGINE_SRC)/gtkbits.c $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/build.h $(ENGINE_INC)/dynamicgtk.h
|
||||
$(ENGINE_OBJ)/dynamicgtk.$o: $(ENGINE_SRC)/dynamicgtk.c $(ENGINE_INC)/dynamicgtk.h
|
||||
$(ENGINE_OBJ)/polymer.$o: $(ENGINE_SRC)/polymer.c $(ENGINE_INC)/polymer.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/build.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/mdsprite.h $(ENGINE_INC)/polymost.h
|
||||
$(ENGINE_OBJ)/mutex.$o: $(ENGINE_SRC)/mutex.c $(ENGINE_INC)/mutex.h
|
||||
$(ENGINE_OBJ)/rawinput.$o: $(ENGINE_SRC)/rawinput.c $(ENGINE_INC)/rawinput.h
|
||||
$(ENGINE_OBJ)/wiibits.$o: $(ENGINE_SRC)/wiibits.c $(ENGINE_INC)/wiibits.h
|
||||
$(ENGINE_OBJ)/winbits.$o: $(ENGINE_SRC)/winbits.c $(ENGINE_INC)/winbits.h
|
||||
$(ENGINE_OBJ)/xxhash.$o: $(ENGINE_SRC)/xxhash.c $(ENGINE_INC)/xxhash.h
|
||||
|
||||
|
|
15
polymer/eduke32/build/include/wiibits.h
Normal file
15
polymer/eduke32/build/include/wiibits.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
#define HW_RVL
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void wii_open(void);
|
||||
void wii_initgamevideo(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -41,6 +41,9 @@
|
|||
#include <android/log.h>
|
||||
#endif
|
||||
#if defined GEKKO
|
||||
# include "wiibits.h"
|
||||
# include <ogc/lwp.h>
|
||||
# include <ogc/lwp_watchdog.h>
|
||||
# define SDL_DISABLE_8BIT_BUFFER
|
||||
#endif
|
||||
|
||||
|
@ -284,24 +287,6 @@ void wm_setapptitle(const char *name)
|
|||
//
|
||||
//
|
||||
|
||||
#if defined GEKKO
|
||||
# define HW_RVL
|
||||
# include <ogc/lwp.h>
|
||||
# include <ogc/lwp_watchdog.h>
|
||||
|
||||
#include "gctypes.h" // for bool
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void L2Enhance();
|
||||
extern void CON_EnableGecko(int channel,int safe);
|
||||
extern bool fatInit(uint32_t cacheSize, bool setAsDefaultDevice);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void attach_debugger_here(void) {}
|
||||
|
||||
/* XXX: libexecinfo could be used on systems without gnu libc. */
|
||||
|
@ -363,10 +348,7 @@ int32_t main(int32_t argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
#elif defined(GEKKO)
|
||||
L2Enhance();
|
||||
CON_EnableGecko(1, 1);
|
||||
Bprintf("Console started\n");
|
||||
fatInit(28, true);
|
||||
wii_open();
|
||||
#elif defined(HAVE_GTK2)
|
||||
// Pre-initialize SDL video system in order to make sure XInitThreads() is called
|
||||
// before GTK starts talking to X11.
|
||||
|
@ -1285,6 +1267,11 @@ int32_t setvideomode_sdlcommon(int32_t *x, int32_t *y, int32_t c, int32_t fs, in
|
|||
if (checkvideomode(x, y, c, fs, 0) < 0)
|
||||
return -1;
|
||||
|
||||
#ifdef GEKKO
|
||||
if (!sdl_surface) // only run this the first time we set a video mode
|
||||
wii_initgamevideo();
|
||||
#endif
|
||||
|
||||
startwin_close();
|
||||
|
||||
if (mousegrab)
|
||||
|
|
92
polymer/eduke32/build/src/wiibits.c
Normal file
92
polymer/eduke32/build/src/wiibits.c
Normal file
|
@ -0,0 +1,92 @@
|
|||
|
||||
#include "wiibits.h"
|
||||
#include "baselayer.h"
|
||||
#include "common.h"
|
||||
|
||||
#include <ogc/system.h>
|
||||
#include <ogc/video.h>
|
||||
#include <ogc/video_types.h>
|
||||
#include <ogc/gx.h>
|
||||
#include <ogc/pad.h>
|
||||
#include <ogc/consol.h>
|
||||
#include <ogc/lwp.h>
|
||||
#include <ogc/lwp_watchdog.h>
|
||||
#include <ogc/lwp_threads.h>
|
||||
#include <ogc/ios.h>
|
||||
#include <ogc/color.h>
|
||||
#include <gctypes.h> // for bool
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void L2Enhance();
|
||||
extern void CON_EnableGecko(int channel,int safe);
|
||||
extern bool fatInit(uint32_t cacheSize, bool setAsDefaultDevice);
|
||||
|
||||
extern void WII_InitVideoSystem(void);
|
||||
|
||||
extern unsigned char *xfb;
|
||||
extern GXRModeObj *vmode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
Black = 0,
|
||||
Red = 1,
|
||||
Green = 2,
|
||||
Yellow = 3,
|
||||
Blue = 4,
|
||||
Magenta = 5,
|
||||
Cyan = 6,
|
||||
White = 7
|
||||
};
|
||||
|
||||
static void ConsoleColor(uint8_t bgcolor, uint8_t bgbold, uint8_t fgcolor, uint8_t fgbold)
|
||||
{
|
||||
Bprintf("\x1b[%u;%dm\x1b[%u;%dm", fgcolor + 30, fgbold, bgcolor + 40, bgbold);
|
||||
}
|
||||
|
||||
static void print_centered(const int32_t width, const char *part1, const char *part2)
|
||||
{
|
||||
const int32_t length = Bstrlen(part1) + Bstrlen(part2) + 1;
|
||||
const int32_t leftbuf = (width-1 - length) / 2;
|
||||
const int32_t rightbuf = width-1 - leftbuf - length;
|
||||
|
||||
Bprintf("%*s%s %s%*s\n", leftbuf, " ", part1, part2, rightbuf, " ");
|
||||
}
|
||||
|
||||
void wii_open(void)
|
||||
{
|
||||
vec2_t ConsoleExtent;
|
||||
|
||||
L2Enhance();
|
||||
CON_EnableGecko(1, 1);
|
||||
Bprintf("Console started\n");
|
||||
fatInit(28, true);
|
||||
|
||||
// init the console for the title bar
|
||||
CON_InitEx(vmode, 0, 12, vmode->viWidth, 68);
|
||||
ConsoleColor(Blue, 0, White, 0);
|
||||
|
||||
CON_GetMetrics(&ConsoleExtent.x, &ConsoleExtent.y);
|
||||
print_centered(ConsoleExtent.x, AppProperName, s_buildRev);
|
||||
print_centered(ConsoleExtent.x, "Compiled", s_buildTimestamp);
|
||||
|
||||
VIDEO_WaitVSync();
|
||||
if (vmode->viTVMode&VI_NON_INTERLACE)
|
||||
VIDEO_WaitVSync();
|
||||
|
||||
// reinit console below the title bar
|
||||
CON_InitEx(vmode, 8, 50, vmode->viWidth - 16, vmode->viHeight - 62);
|
||||
ConsoleColor(Black, 0, White, 0);
|
||||
}
|
||||
|
||||
// Reset the video system to remove the startup console.
|
||||
void wii_initgamevideo(void)
|
||||
{
|
||||
WII_InitVideoSystem();
|
||||
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue