From 737a9e7ec5532175efa4215cc7c40c92a32c5bcc Mon Sep 17 00:00:00 2001 From: indigoparadox Date: Thu, 15 Feb 2024 22:49:15 -0500 Subject: [PATCH 1/2] More DOS memory scrimping. --- dosstubs/mfmt.c | 6 ++++-- dosstubs/mhtml.c | 10 +++++++--- dosstubs/mhtmr.c | 6 ------ dosstubs/mjson.c | 8 +++++--- dosstubs/mplug.c | 6 ++++-- dosstubs/retrogui.c | 12 +++++++----- dosstubs/retrogxc.c | 13 +++++++------ dosstubs/retrotil.c | 16 +++++++++------- src/retroflt.h | 5 ++++- src/retrosnd.h | 5 +++-- 10 files changed, 50 insertions(+), 37 deletions(-) delete mode 100644 dosstubs/mhtmr.c diff --git a/dosstubs/mfmt.c b/dosstubs/mfmt.c index 9590fdad..b2ff1810 100644 --- a/dosstubs/mfmt.c +++ b/dosstubs/mfmt.c @@ -1,4 +1,6 @@ -#define MFMT_C -#include +#ifndef MAUG_NO_MFMT +# define MFMT_C +# include +#endif /* !MAUG_NO_MFMT */ diff --git a/dosstubs/mhtml.c b/dosstubs/mhtml.c index 5e9c492e..83c352ca 100644 --- a/dosstubs/mhtml.c +++ b/dosstubs/mhtml.c @@ -1,5 +1,9 @@ -#define MHTML_C -#include -#include +#ifndef MAUG_NO_MHTML +# define MHTML_C +# define MHTMR_C +# include +# include +# include +#endif /* !MAUG_NO_MHTML */ diff --git a/dosstubs/mhtmr.c b/dosstubs/mhtmr.c deleted file mode 100644 index 19a086ab..00000000 --- a/dosstubs/mhtmr.c +++ /dev/null @@ -1,6 +0,0 @@ - -#define MHTMR_C -#include -#include -#include - diff --git a/dosstubs/mjson.c b/dosstubs/mjson.c index 58a41a43..3452b43a 100644 --- a/dosstubs/mjson.c +++ b/dosstubs/mjson.c @@ -1,5 +1,7 @@ -#define MJSON_C -#include -#include +#ifndef MAUG_NO_MJSON +# define MJSON_C +# include +# include +#endif /* !MAUG_NO_MJSON */ diff --git a/dosstubs/mplug.c b/dosstubs/mplug.c index 23a3091f..ea53fe68 100644 --- a/dosstubs/mplug.c +++ b/dosstubs/mplug.c @@ -1,4 +1,6 @@ -#define MPLUG_C -#include +#ifndef MAUG_NO_MPLUG +# define MPLUG_C +# include +#endif /* !MAUG_NO_MPLUG */ diff --git a/dosstubs/retrogui.c b/dosstubs/retrogui.c index 76340d84..92a70744 100644 --- a/dosstubs/retrogui.c +++ b/dosstubs/retrogui.c @@ -1,7 +1,9 @@ -#define MAUG_NO_RETRO -#include -#include -#define RETROGUI_C -#include +#ifndef RETROFLAT_NO_RETROGUI +# define MAUG_NO_RETRO +# include +# include +# define RETROGUI_C +# include +#endif /* !RETROFLAT_NO_RETROGUI */ diff --git a/dosstubs/retrogxc.c b/dosstubs/retrogxc.c index c05b3105..150478c7 100644 --- a/dosstubs/retrogxc.c +++ b/dosstubs/retrogxc.c @@ -1,8 +1,9 @@ -#define MAUG_NO_RETRO -#include -#include -#include -#define RETROGXC_C -#include +#ifndef RETROFLAT_NO_RETROGXC +# define MAUG_NO_RETRO +# include +# include +# define RETROGXC_C +# include +#endif /* !RETROFLAT_NO_RETROGXC */ diff --git a/dosstubs/retrotil.c b/dosstubs/retrotil.c index 6e352fc0..8f3907aa 100644 --- a/dosstubs/retrotil.c +++ b/dosstubs/retrotil.c @@ -1,9 +1,11 @@ -#define MAUG_NO_RETRO -#include -#include -#include -#define RETROTIL_C -#include -#include +#ifndef RETROFLAT_NO_RETROTILE +# define MAUG_NO_RETRO +# include +# include +# include +# define RETROTIL_C +# include +# include +#endif /*! RETROFLAT_NO_RETROTILE */ diff --git a/src/retroflt.h b/src/retroflt.h index a37a9e0c..3a48c56b 100644 --- a/src/retroflt.h +++ b/src/retroflt.h @@ -1294,7 +1294,6 @@ struct RETROFLAT_BITMAP { }; LPSTR* retroflat_win_cli( LPSTR cmd_line, int* argc_out ); -char retroflat_vk_to_ascii( RETROFLAT_IN_KEY k, uint8_t flags ); # ifdef RETROFLAT_OPENGL @@ -2328,6 +2327,10 @@ retroflat_ms_t retroflat_get_ms(); uint32_t retroflat_get_rand(); +# if !defined( RETROFLAT_NO_KEYBOARD ) +char retroflat_vk_to_ascii( RETROFLAT_IN_KEY k, uint8_t flags ); +# endif /* !RETROFLAT_NO_KEYBOARD */ + /** * \addtogroup maug_retroflt_bitmap * \{ diff --git a/src/retrosnd.h b/src/retrosnd.h index 8a8f1dc2..adeae098 100644 --- a/src/retrosnd.h +++ b/src/retrosnd.h @@ -136,7 +136,7 @@ void retrosnd_shutdown(); #ifdef RETROSND_C -MAUG_CONST uint8_t adlib_ch[] = {0, 1, 2, 8, 9, 10, 16, 17, 18}; +MAUG_CONST uint8_t SEG_MCONST adlib_ch[] = {0, 1, 2, 8, 9, 10, 16, 17, 18}; struct RETROSND_STATE g_retrosnd_state; @@ -555,7 +555,8 @@ void retrosnd_midi_set_voice( uint8_t channel, uint8_t voice ) { } debug_printf( - RETROSND_TRACE_LVL, "channel: %d, reg: %d", channel, adlib_ch[channel] ); + RETROSND_TRACE_LVL, "channel: %d, reg: %d", channel, + adlib_ch[channel] ); /* TODO: Decouple voices so we can have 10/12 channels? */ From 4c9a909ef77a78a63d99927b7f3d9f235474122a Mon Sep 17 00:00:00 2001 From: indigoparadox Date: Thu, 15 Feb 2024 23:25:11 -0500 Subject: [PATCH 2/2] mhtml and mhtmr too large to coexist. --- dosstubs/mhtml.c | 2 -- dosstubs/mhtmr.c | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 dosstubs/mhtmr.c diff --git a/dosstubs/mhtml.c b/dosstubs/mhtml.c index 83c352ca..3d0ad7db 100644 --- a/dosstubs/mhtml.c +++ b/dosstubs/mhtml.c @@ -1,9 +1,7 @@ #ifndef MAUG_NO_MHTML # define MHTML_C -# define MHTMR_C # include # include -# include #endif /* !MAUG_NO_MHTML */ diff --git a/dosstubs/mhtmr.c b/dosstubs/mhtmr.c new file mode 100644 index 00000000..aba4e67d --- /dev/null +++ b/dosstubs/mhtmr.c @@ -0,0 +1,8 @@ + +#ifndef MAUG_NO_MHTML +# define MHTMR_C +# include +# include +# include +#endif /* !MAUG_NO_MHTML */ +