Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Welcome to this tech-demo for the **RAD Expansion Unit**. The "RAD" is a Raspberry Pi-powered cartridge/expansion for the C64 and C128 and, for example, can be used to emulate memory expansions (please have a look at its [main page](https://github.com/frntc/RAD)).

In this tech-demo the **RAD replaces the MOS6510/8500/8502-CPU of your C64/C128** and natively runs DOOM on the ARM CPU. The purpose of the demo is to experiment with real-time graphics (on-the-fly color reduction and conversion from RGB-frame buffers), sound streaming to the SID, and using C64 peripherals such as keyboard, mouse and MIDI-interfaces. Note that it is currently set up for **PAL machines only**.
In this tech-demo the **RAD replaces the MOS6510/8500/8502-CPU of your C64/C128** and natively runs DOOM on the ARM CPU. The purpose of the demo is to experiment with real-time graphics (on-the-fly color reduction and conversion from RGB-frame buffers), sound streaming to the SID, and using C64 peripherals such as keyboard, joystick, mouse and MIDI-interfaces. Note that it is currently set up for **PAL machines only**.

In short, here is what you can experience:

Expand Down Expand Up @@ -37,16 +37,17 @@ In short, here is what you can experience:

Obviously you need a RAD Expansion Unit (see [project page](https://github.com/frntc/RAD) on how to build and setup one) and a Raspberry Pi 3A+/3B+/Zero 2. To play Doom, first download the release archive of this project and copy it to a FAT-formatted SD-card.

Second, you need to download the "doom1.wad" of the shareware version of Doom (e.g. from [doomwiki.org](https://doomwiki.org/wiki/DOOM1.WAD)) and copy it into the "RADDOOM" folder on the SD-card.
Second, you need to download the "doom1.wad" of the shareware version of Doom (e.g. from [doomwiki.org](https://doomwiki.org/wiki/DOOM1.WAD)) and copy it into the "RADDOOM" folder on the SD-card. If you own a copy of Doom, Doom II, Final Doom: Plutonia Experiment, Final Doom: TNT: Evilution, Chex Quest, FreeDM, Freedoom: Phase 1 + 2, the WAD files from those games should also work. Any errors starting the game will be written into debug.txt on the SD-card.

You also need a *sound font* in *.sf2*-format for the built-in MIDI synthesizer which plays via the SID or Digimax (the sound synthesis uses [TinySoundFont](https://github.com/schellingb/TinySoundFont)). This file also has to be copied to the "RADDOOM"-folder and named *"soundfont.sf2"*. One freely available sound font (but there are many others) is the [GeneralUser GS](http://schristiancollins.com/generaluser.php), which is also included in the [mt32pi](https://github.com/dwhinham/mt32-pi) release. mt32pi is a MIDI-synthesizer based on a Raspberry Pi which can be used with MIDI interfaces for the C64/C128. Note that the size of the sound font-file dominates the loading time.

Speaking of MIDI interfaces: external MIDI interfaces will requires a cartridge expander. The [SIDKick](https://github.com/frntc/SIDKick) provides a MIDI interface while keeping the expansion port free. The Digimax output expects the device connected to the user port.

To **configure the sound output**, check the *config.txt* on the SD-card. In case the RAD needs some timing adjustments, please follow the instructions on the RAD main page and adjust timings first with the standard RAD software.

Pressing *F1* while running Doom shows a help screen, *F3* toggles between mouse (port #2) and keyboard controls.
Pressing *F1* while running Doom shows a help screen, *F3* toggles between mouse (port #2) and keyboard + joystick (also port #2) controls.

Pressing 'U' will toggle a C64/C128 friendly version of the ingame UI / HUD.

## Technical Details

Expand Down
10 changes: 4 additions & 6 deletions Source/Doom/d_iwad.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,7 @@ char *D_TryFindWADByName(char *filename)
// should be executed (notably loading PWADs).
//

char d1wad[] = "RADDOOM/doom1.wad";

char *D_FindIWAD(int mask, GameMission_t *mission)
char *D_FindIWAD(int mask, GameMission_t *mission, char *wadLocation)
{
char *result;
char *iwadfile;
Expand All @@ -723,9 +721,9 @@ char *D_FindIWAD(int mask, GameMission_t *mission)
{
// Search through IWAD dirs for an IWAD with the given name.

iwadfile = d1wad;

result = D_FindWADByName( "RADDOOM/doom1.wad" );
iwadfile = wadLocation;
result = D_FindWADByName( iwadfile );

if (result == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Doom/d_iwad.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ typedef struct

char *D_FindWADByName(char *filename);
char *D_TryFindWADByName(char *filename);
char *D_FindIWAD(int mask, GameMission_t *mission);
char *D_FindIWAD(int mask, GameMission_t *mission, char *wadLocation);
const iwad_t **D_FindAllIWADs(int mask);
char *D_SaveGameIWADName(GameMission_t gamemission);
char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);
Expand Down
64 changes: 32 additions & 32 deletions Source/Doom/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ void D_DoAdvanceDemo (void)
break;
}

// Let the c64UI know of the new state
setGameState(gamestate);

// The Doom 3: BFG Edition version of doom2.wad does not have a
// TITLETPIC lump. Use INTERPIC instead as a workaround.
if (bfgedition && !strcasecmp(pagename, "TITLEPIC")
Expand Down Expand Up @@ -788,7 +791,7 @@ void D_IdentifyVersion(void)
// detecting it based on the filename. Valid values are: "doom2",
// "tnt" and "plutonia".
//
p = M_CheckParmWithArgs("-pack", 1);
p = 0; //M_CheckParmWithArgs("-pack", 1);
if (p > 0)
{
SetMissionForPackName(myargv[p + 1]);
Expand Down Expand Up @@ -1157,7 +1160,7 @@ static void LoadIwadDeh(void)
//
// D_DoomMain
//
void D_DoomMain (void)
void D_DoomMain (char* wadPath)
{
int p;
char file[256];
Expand Down Expand Up @@ -1359,9 +1362,8 @@ void D_DoomMain (void)
// Save configuration at exit.
I_AtExit(M_SaveDefaults, false);

// Find main IWAD file and load it.
#if 1
iwadfile = D_FindIWAD(IWAD_MASK_DOOM, &gamemission);
iwadfile = D_FindIWAD(IWAD_MASK_DOOM, &gamemission, wadPath);

// None found?

Expand All @@ -1382,10 +1384,8 @@ extern lumpinfo_t **lumphash;
lumphash = NULL;



DEH_printf("W_Init: Init WADfiles.\n");
D_AddFile(iwadfile);
//D_AddFile("RADDOOM/doom1.wad");
#if ORIGCODE
numiwadlumps = numlumps;
#endif
Expand Down Expand Up @@ -1572,26 +1572,26 @@ lumphash = NULL;
// Check for -file in shareware
if (modifiedgame)
{
// These are the lumps that will be checked in IWAD,
// if any one is not present, execution will be aborted.
char name[23][8]=
{
"e2m1","e2m2","e2m3","e2m4","e2m5","e2m6","e2m7","e2m8","e2m9",
"e3m1","e3m3","e3m3","e3m4","e3m5","e3m6","e3m7","e3m8","e3m9",
"dphoof","bfgga0","heada1","cybra1","spida1d1"
};
int i;
if ( gamemode == shareware)
I_Error(DEH_String("\nYou cannot -file with the shareware "
"version. Register!"));
// These are the lumps that will be checked in IWAD,
// if any one is not present, execution will be aborted.
char name[23][8]=
{
"e2m1","e2m2","e2m3","e2m4","e2m5","e2m6","e2m7","e2m8","e2m9",
"e3m1","e3m3","e3m3","e3m4","e3m5","e3m6","e3m7","e3m8","e3m9",
"dphoof","bfgga0","heada1","cybra1","spida1d1"
};
int i;
if ( gamemode == shareware)
I_Error(DEH_String("\nYou cannot -file with the shareware "
"version. Register!"));

// Check for fake IWAD with right name,
// but w/o all the lumps of the registered version.
if (gamemode == registered)
for (i = 0;i < 23; i++)
if (W_CheckNumForName(name[i])<0)
I_Error(DEH_String("\nThis is not the registered version."));
// Check for fake IWAD with right name,
// but w/o all the lumps of the registered version.
if (gamemode == registered)
for (i = 0;i < 23; i++)
if (W_CheckNumForName(name[i])<0)
I_Error(DEH_String("\nThis is not the registered version."));
}

if (W_CheckNumForName("SS_START") >= 0
Expand Down Expand Up @@ -1651,8 +1651,8 @@ lumphash = NULL;

if (p)
{
startskill = myargv[p+1][0]-'1';
autostart = true;
startskill = myargv[p+1][0]-'1';
autostart = true;
}

//!
Expand All @@ -1666,9 +1666,9 @@ lumphash = NULL;

if (p)
{
startepisode = myargv[p+1][0]-'0';
startmap = 1;
autostart = true;
startepisode = myargv[p+1][0]-'0';
startmap = 1;
autostart = true;
}

timelimit = 0;
Expand All @@ -1685,7 +1685,7 @@ lumphash = NULL;

if (p)
{
timelimit = atoi(myargv[p+1]);
timelimit = atoi(myargv[p+1]);
}

//!
Expand All @@ -1699,7 +1699,7 @@ lumphash = NULL;

if (p)
{
timelimit = 20;
timelimit = 20;
}

//!
Expand Down
Loading