Merge branch 'sh4-build' into 'master'

Draft: SH4 build

See merge request STJr/SRB2!2188
This commit is contained in:
Alam Ed Arias 2025-04-13 02:02:58 +00:00
commit c2d9a389ff
4 changed files with 74 additions and 9 deletions

View file

@ -0,0 +1,39 @@
Debian stable:sh4:
extends: .srb2ci
stage: build
when: manual
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian arm64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-sh4"
variables:
CC: sh4-linux-gnu-gcc
OBJCOPY: sh4-linux-gnu-objcopy
OBJDUMP: sh4-linux-gnu-objdump
WFLAGS: -Wno-cast-align
CFLAGS: -Wno-cast-align
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-sh4-linux-gnu
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 SDL=0 NOHW=1 NOZLIB=1 NOCURL=1 NOGME=1 NOOPENMPT=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 SDL=0 NOHW=1 NOZLIB=1 NOCURL=1 NOGME=1 NOOPENMPT=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -155,7 +155,7 @@ static char addonsdir[MAX_WADPATH];
event_t events[MAXEVENTS];
INT32 eventhead, eventtail;
boolean dedicated = false;
boolean dedicated = true;
//
// D_PostEvent
@ -670,9 +670,9 @@ static void D_Display(void)
s[sizeof s - 1] = '\0';
snprintf(s, sizeof s - 1, "get %d b/s", getbps);
snprintf(s, sizeof s - 1, "get %ld b/s", (long)getbps);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-40, V_YELLOWMAP, s);
snprintf(s, sizeof s - 1, "send %d b/s", sendbps);
snprintf(s, sizeof s - 1, "send %ld b/s", (long)sendbps);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-30, V_YELLOWMAP, s);
snprintf(s, sizeof s - 1, "GameMiss %.2f%%", gamelostpercent);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-20, V_YELLOWMAP, s);
@ -1726,7 +1726,7 @@ void D_SRB2Main(void)
pstartmap = bootmap;
if (pstartmap < 1 || pstartmap > NUMMAPS)
I_Error("Cannot warp to map %d (out of range)\n", pstartmap);
I_Error("Cannot warp to map %ld (out of range)\n", (long)pstartmap);
else
{
autostart = true;

View file

@ -1,3 +1,6 @@
#include <stdarg.h>
#include <stdio.h>
#include "../doomdef.h"
#include "../doomtype.h"
#include "../i_system.h"
@ -54,10 +57,22 @@ void I_Quit(void)
exit(0);
}
void I_Error(const char *error, ...)
void I_Error(const char *fmt, ...)
{
(void)error;
#if 1
char txt[8192];
va_list argptr;
va_start(argptr, fmt);
vsprintf(txt, fmt, argptr);
va_end(argptr);
fprintf(stderr, "%s", txt);
exit(-1);
#else
(void)fmt;
#endif
}
void I_Tactile(FFType Type, const JoyFF_t *Effect)
@ -99,9 +114,20 @@ void I_UpdateMumble(const mobj_t *mobj, const listener_t listener)
}
#endif
void I_OutputMsg(const char *error, ...)
void I_OutputMsg(const char *fmt, ...)
{
(void)error;
#if 1
char txt[8192];
va_list argptr;
va_start(argptr,fmt);
vsprintf(txt, fmt, argptr);
va_end(argptr);
printf("%s", txt);
#else
(void)fmt;
#endif
}
void I_StartupMouse(void){}

View file

@ -122,7 +122,7 @@ static int lib_setMouseGrab(lua_State *L)
static int lib_getCursorPosition(lua_State *L)
{
int x, y;
INT32 x, y;
I_GetCursorPosition(&x, &y);
lua_pushinteger(L, x);
lua_pushinteger(L, y);