Skip to content

Commit

Permalink
lib: boost display SPI to 80 MHz
Browse files Browse the repository at this point in the history
doom: more or less good FPS!
  • Loading branch information
and3rson committed Feb 14, 2024
1 parent 1f50e3e commit dc7dbf1
Show file tree
Hide file tree
Showing 43 changed files with 197 additions and 128 deletions.
12 changes: 6 additions & 6 deletions firmware-doom/lib/doomgeneric/src/d_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
#include "r_bsp.h"

void D_AllocBuffers() {
printf("D_AllocBuffers: Allocating buffers\n");
printf("R_AllocMain: allocated %d bytes\n", R_AllocMain());
printf("R_AllocPlanes: allocated %d bytes\n", R_AllocPlanes());
printf("R_AllocThings: allocated %d bytes\n", R_AllocThings());
printf("R_AllocBSP: allocated %d bytes\n", R_AllocBSP());
DG_printf("D_AllocBuffers: Allocating buffers\n");
DG_printf("R_AllocMain: allocated %d bytes\n", R_AllocMain());
DG_printf("R_AllocPlanes: allocated %d bytes\n", R_AllocPlanes());
DG_printf("R_AllocThings: allocated %d bytes\n", R_AllocThings());
DG_printf("R_AllocBSP: allocated %d bytes\n", R_AllocBSP());
}

void D_FreeBuffers() {
printf("D_FreeBuffers: Freeing buffers\n");
DG_printf("D_FreeBuffers: Freeing buffers\n");
R_FreeMain();
R_FreePlanes();
R_FreeThings();
Expand Down
2 changes: 2 additions & 0 deletions firmware-doom/lib/doomgeneric/src/d_alloc.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#include "d_log.h"

extern void D_AllocBuffers (void);
extern void D_FreeBuffers (void);
4 changes: 2 additions & 2 deletions firmware-doom/lib/doomgeneric/src/d_iwad.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static char *CheckDirectoryHasIWAD(char *dir, char *iwadname)
filename = M_StringJoin(dir, DIR_SEPARATOR_S, iwadname, NULL);
}

printf("Trying IWAD file:%s\n", filename);
DG_printf("Trying IWAD file:%s\n", filename);

if (M_FileExists(filename))
{
Expand Down Expand Up @@ -735,7 +735,7 @@ char *D_FindIWAD(int mask, GameMission_t *mission)
{
// Search through the list and look for an IWAD

printf("-iwad not specified, trying a few iwad names\n");
DG_printf("-iwad not specified, trying a few iwad names\n");

result = NULL;

Expand Down
1 change: 1 addition & 0 deletions firmware-doom/lib/doomgeneric/src/d_iwad.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef __D_IWAD__
#define __D_IWAD__

#include "d_log.h"
#include "d_mode.h"

#define IWAD_MASK_DOOM ((1 << doom) \
Expand Down
6 changes: 6 additions & 0 deletions firmware-doom/lib/doomgeneric/src/d_log.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef __D_LOG__
#define __D_LOG__

extern void DG_printf(const char *fmt, ...);

#endif
10 changes: 5 additions & 5 deletions firmware-doom/lib/doomgeneric/src/d_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static void D_Disconnected(void)

// disconnected from server

printf("Disconnected from server.\n");
DG_printf("Disconnected from server.\n");
}

//
Expand Down Expand Up @@ -434,7 +434,7 @@ void D_StartNetGame(net_gamesettings_t *settings,
// TODO: Message disabled until we fix new_sync.
//if (!new_sync)
//{
// printf("Syncing netgames like Vanilla Doom.\n");
// DG_printf("Syncing netgames like Vanilla Doom.\n");
//}
#else
settings->consoleplayer = 0;
Expand Down Expand Up @@ -538,7 +538,7 @@ boolean D_InitNetGame(net_connect_data_t *connect_data)
NET_AddrToString(addr));
}

printf("D_InitNetGame: Connected to %s\n", NET_AddrToString(addr));
DG_printf("D_InitNetGame: Connected to %s\n", NET_AddrToString(addr));

// Wait for launch message received from server.

Expand Down Expand Up @@ -623,7 +623,7 @@ static void OldNetSync(void)
if (maketic <= recvtic)
{
lasttime--;
// printf ("-");
// DG_printf ("-");
}

frameskip[frameon & 3] = oldnettics > recvtic;
Expand All @@ -632,7 +632,7 @@ static void OldNetSync(void)
if (frameskip[0] && frameskip[1] && frameskip[2] && frameskip[3])
{
skiptics = 1;
// printf ("+");
// DG_printf ("+");
}
}
}
Expand Down
1 change: 1 addition & 0 deletions firmware-doom/lib/doomgeneric/src/d_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef __D_LOOP__
#define __D_LOOP__

#include "d_log.h"
#include "net_defs.h"

// Callback function invoked while waiting for the netgame to start.
Expand Down
36 changes: 18 additions & 18 deletions firmware-doom/lib/doomgeneric/src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void D_DoomLoop (void)
if (bfgedition &&
(demorecording || (gameaction == ga_playdemo) || netgame))
{
printf(" WARNING: You are playing using one of the Doom Classic\n"
DG_printf(" WARNING: You are playing using one of the Doom Classic\n"
" IWAD files shipped with the Doom 3: BFG Edition. These are\n"
" known to be incompatible with the regular IWAD files and\n"
" may cause demos and network games to get out of sync.\n");
Expand Down Expand Up @@ -657,7 +657,7 @@ static char *GetGameName(char *gamename)
int version;

// Has been replaced.
// We need to expand via printf to include the Doom version number
// We need to expand via DG_printf to include the Doom version number
// We also need to cut off spaces to get the basic name

gamename_size = strlen(deh_sub) + 10;
Expand Down Expand Up @@ -705,11 +705,11 @@ static void SetMissionForPackName(char *pack_name)
}
}

printf("Valid mission packs are:\n");
DG_printf("Valid mission packs are:\n");

for (i = 0; i < arrlen(packs); ++i)
{
printf("\t%s\n", packs[i].name);
DG_printf("\t%s\n", packs[i].name);
}

I_Error("Unknown mission pack name: %s", pack_name);
Expand Down Expand Up @@ -869,7 +869,7 @@ static boolean D_AddFile(char *filename)
{
wad_file_t *handle;

printf(" adding %s\n", filename);
DG_printf(" adding %s\n", filename);
handle = W_AddFile(filename);

return handle != NULL;
Expand Down Expand Up @@ -912,14 +912,14 @@ void PrintDehackedBanners(void)

if (deh_s != copyright_banners[i])
{
printf("%s", deh_s);
DG_printf("%s", deh_s);

// Make sure the modified banner always ends in a newline character.
// If it doesn't, add a newline. This fixes av.wad.

if (deh_s[strlen(deh_s) - 1] != '\n')
{
printf("\n");
DG_printf("\n");
}
}
}
Expand Down Expand Up @@ -973,11 +973,11 @@ static void InitGameVersion(void)

if (gameversions[i].description == NULL)
{
printf("Supported game versions:\n");
DG_printf("Supported game versions:\n");

for (i=0; gameversions[i].description != NULL; ++i)
{
printf("\t%s (%s)\n", gameversions[i].cmdline,
DG_printf("\t%s (%s)\n", gameversions[i].cmdline,
gameversions[i].description);
}

Expand Down Expand Up @@ -1055,7 +1055,7 @@ void PrintGameVersion(void)
{
if (gameversions[i].version == gameversion)
{
printf("Emulating the behavior of the "
DG_printf("Emulating the behavior of the "
"'%s' executable.\n", gameversions[i].description);
break;
}
Expand Down Expand Up @@ -1190,7 +1190,7 @@ void D_DoomMain (void)

if (M_CheckParm("-dedicated") > 0)
{
printf("Dedicated server mode.\n");
DG_printf("Dedicated server mode.\n");
NET_DedicatedServer();

// Never returns
Expand Down Expand Up @@ -1312,7 +1312,7 @@ void D_DoomMain (void)

if (M_ParmExists("-cdrom"))
{
printf(D_CDROM);
DG_printf(D_CDROM);

M_SetConfigDir("c:\\doomdata\\");
}
Expand Down Expand Up @@ -1415,7 +1415,7 @@ void D_DoomMain (void)

if (W_CheckNumForName("dmenupic") >= 0)
{
printf("BFG Edition: Using workarounds as needed.\n");
DG_printf("BFG Edition: Using workarounds as needed.\n");
bfgedition = true;

// BFG Edition changes the names of the secret levels to
Expand Down Expand Up @@ -1509,7 +1509,7 @@ void D_DoomMain (void)
M_StringCopy(demolumpname, myargv[p + 1], sizeof(demolumpname));
}

printf("Playing demo %s.\n", file);
DG_printf("Playing demo %s.\n", file);
}

I_AtExit((atexit_func_t) G_CheckDemoStatus, true);
Expand Down Expand Up @@ -1540,7 +1540,7 @@ void D_DoomMain (void)
}
}

printf(" loaded %i DEHACKED lumps from PWAD files.\n", loaded);
DG_printf(" loaded %i DEHACKED lumps from PWAD files.\n", loaded);
}
#endif

Expand Down Expand Up @@ -1589,7 +1589,7 @@ void D_DoomMain (void)
|| W_CheckNumForName("FF_END") >= 0)
{
I_PrintDivider();
printf(" WARNING: The loaded WAD file contains modified sprites or\n"
DG_printf(" WARNING: The loaded WAD file contains modified sprites or\n"
" floor textures. You may want to use the '-merge' command\n"
" line option instead of '-file'.\n");
}
Expand All @@ -1602,7 +1602,7 @@ void D_DoomMain (void)
// message and give a link to the website.
if (W_CheckNumForName("FREEDOOM") >= 0 && W_CheckNumForName("FREEDM") < 0)
{
printf(" WARNING: You are playing using one of the Freedoom IWAD\n"
DG_printf(" WARNING: You are playing using one of the Freedoom IWAD\n"
" files, which might not work in this port. See this page\n"
" for more information on how to play using Freedoom:\n"
" http://www.chocolate-doom.org/wiki/index.php/Freedoom\n");
Expand All @@ -1617,7 +1617,7 @@ void D_DoomMain (void)
I_InitMusic();

#ifdef FEATURE_MULTIPLAYER
printf ("NET_Init: Init network subsystem.\n");
DG_printf ("NET_Init: Init network subsystem.\n");
NET_Init ();
#endif

Expand Down
7 changes: 4 additions & 3 deletions firmware-doom/lib/doomgeneric/src/d_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
#ifndef __D_MAIN__
#define __D_MAIN__

#include "d_log.h"
#include "doomdef.h"




// Read events from all input devices

void D_ProcessEvents (void);
void D_ProcessEvents (void);


//
// BASE LEVEL
Expand All @@ -38,7 +39,7 @@ void D_PageDrawer (void);
void D_AdvanceDemo (void);
void D_DoAdvanceDemo (void);
void D_StartTitle (void);

//
// GLOBAL VARIABLES
//
Expand Down
11 changes: 6 additions & 5 deletions firmware-doom/lib/doomgeneric/src/d_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "deh_main.h"

#include "d_loop.h"
#include "d_log.h"

ticcmd_t *netcmds;

Expand All @@ -62,7 +63,7 @@ static void PlayerQuitGame(player_t *player)

// TODO: check if it is sensible to do this:

if (demorecording)
if (demorecording)
{
G_CheckDemoStatus ();
}
Expand Down Expand Up @@ -123,7 +124,7 @@ static void LoadGameSettings(net_gamesettings_t *settings)

if (lowres_turn)
{
printf("NOTE: Turning resolution is reduced; this is probably "
DG_printf("NOTE: Turning resolution is reduced; this is probably "
"because there is a client recording a Vanilla demo.\n");
}

Expand Down Expand Up @@ -173,7 +174,7 @@ static void InitConnectData(net_connect_data_t *connect_data)
connect_data->drone = true;
}

//!
//!
// @category net
//
// Run as the right screen in three screen mode.
Expand Down Expand Up @@ -273,8 +274,8 @@ void D_CheckNetGame (void)
{
DEH_printf("Levels will end after %d minute", timelimit);
if (timelimit > 1)
printf("s");
printf(".\n");
DG_printf("s");
DG_printf(".\n");
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion firmware-doom/lib/doomgeneric/src/deh_str.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <stdio.h>

#include "doomfeatures.h"
#include "d_log.h"

// Used to do dehacked text substitutions throughout the program

Expand All @@ -36,7 +37,7 @@ void DEH_AddStringReplacement(char *from_text, char *to_text);
#else

#define DEH_String(x) (x)
#define DEH_printf printf
#define DEH_printf DG_printf
#define DEH_fprintf fprintf
#define DEH_snprintf snprintf
#define DEH_AddStringReplacement(x, y)
Expand Down
2 changes: 1 addition & 1 deletion firmware-doom/lib/doomgeneric/src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,7 @@ void G_DoPlayDemo (void)
" This appears to be %s.";

//I_Error(message, demoversion, G_VanillaVersionCode(),
printf(message, demoversion, G_VanillaVersionCode(),
DG_printf(message, demoversion, G_VanillaVersionCode(),
DemoVersionDescription(demoversion));
}

Expand Down
4 changes: 2 additions & 2 deletions firmware-doom/lib/doomgeneric/src/gusconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ boolean GUS_WriteConfig(char *path)

if (!strcmp(gus_patch_path, ""))
{
printf("You haven't configured gus_patch_path.\n");
printf("gus_patch_path needs to point to the location of "
DG_printf("You haven't configured gus_patch_path.\n");
DG_printf("gus_patch_path needs to point to the location of "
"your GUS patch set.\n"
"To get a copy of the \"standard\" GUS patches, "
"download a copy of dgguspat.zip.\n");
Expand Down
2 changes: 1 addition & 1 deletion firmware-doom/lib/doomgeneric/src/i_cdmus.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void I_CDMusPrintStartup(void)
#ifdef ORIGCODE
if (cd_name != NULL)
{
printf("I_CDMusInit: Using CD-ROM drive: %s\n", cd_name);
DG_printf("I_CDMusInit: Using CD-ROM drive: %s\n", cd_name);
}

if (startup_error != NULL)
Expand Down
2 changes: 2 additions & 0 deletions firmware-doom/lib/doomgeneric/src/i_cdmus.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#ifndef __ICDMUS__
#define __ICDMUS__

#include "d_log.h"

#define CDERR_NOTINSTALLED 10 // MSCDEX not installed
#define CDERR_NOAUDIOSUPPORT 11 // CD-ROM Doesn't support audio
#define CDERR_NOAUDIOTRACKS 12 // Current CD has no audio tracks
Expand Down
Loading

0 comments on commit dc7dbf1

Please sign in to comment.