Page 1 of 2

Build ScummDC attempt(s)

Posted: Tue Apr 14, 2020 12:26 pm
by kremiso
completely noob in compiling/build from source code here
biggest step i'm trying to do atm, using this sad lockdown period

hope this can become a noob tutorial in compiling ScummDC, starting from scratch

please correct me if you find some wrong steps, you'll avoid me future headaches lol

first infos, the compile ScummDC wiki page :

GCC, Binutils, Newlib, Libronin and Libmad are requested, and cross-compiled for sh-elf

Now, first doubts, i have installed the DreamSDK_R2, that grants pre built cross-compile with 3 of them (GCC, Binutils, Newlib)
but using KallistiOS; in the docs there is written that Libronin should work too but has not been tested at all - DOUBT 1

Second ,i have taken the Scumm2.0.0 source code, that has been developed using GCC4.6.3, Binutils2.18 and Newlib1.19.0,
when instead DreamSDK has installed GCC4.7.3, Binutils2.31.1 and Newlib2.0.0

DOUBT 2 - I should match the same releases to avoid issues, or i can freely try with the updates ones?

atm i'm doing lite 'make' attempts to construct only the SCUMMVM.ELF main file, keeping for now all the plugins disabled, obviously with ton of errors lol, expecially to make find Libmad libraries files

never said it would have been easy :)

Re: Build ScummDC attempt(s)

Posted: Tue Apr 14, 2020 1:21 pm
by Ian Micheal ... /Dreamcast this has all the tools you need precompiled to build it i would not use dreamsdk for it

use wayback machine to get the dead links

libmad (MPEG Audio Decoder, needed if you want to play MP3-compressed games) - Precompiled binaries of v0.15.1b

Re: Build ScummDC attempt(s)

Posted: Tue Apr 14, 2020 4:04 pm
by kremiso
Thanks Ian, i have already all the required libraries.
What do you recommend in alternative to DreamSDK, i mean to cross-build from Windows to Dreamcast ? Cygwin perhaps ?

Re: Build ScummDC attempt(s)

Posted: Tue Apr 14, 2020 5:02 pm
by Ian Micheal
I would have a base install of cygwin then use all the above why i have not done it mean building a whole new tool chain just for it..

Re: Build ScummDC attempt(s)

Posted: Wed Apr 15, 2020 12:56 am
by Anthony817
I just want to state my support to you kremiso, this makes me happy to see you taking a shot at this!

Re: Build ScummDC attempt(s)

Posted: Thu Apr 16, 2020 5:28 am
by kremiso
Thanks Anthony, appreciated

if i reach to toolchain libronin to sh-elf... PITA

i want share here what i have found about the Myst/Riven save issue, so maybe also some anonymous readers can help hopefully
(because the scumm download subforum is hidden to guest users)

examinating the source code, seem that the DC load/save process (vmsave.cpp) lead to the common Mohawk engine one,
splitted in two, one for Myst (myst_state.cpp) and one for Riven (riven_saveload.cpp)
inside those, a sad confirm, a name-match filename check, plus the number of the slot where the gamesave is, that imo
makes also Myst save unreadable (more than 12 chars)
imo because it's a chained string '$namefile'+'slot number'

so, that's what Myst check for :

Common::String MystGameState::buildSaveFilename(int slot) {
return Common::String::format("myst-%03d.mys", slot);

and that's Riven :

Common::String RivenSaveLoad::buildSaveFilename(const int slot) {
return Common::String::format("riven-%03d.rvn", slot);

so, here is needed to shorten the filename string to fix the issue imo
really a shame to leave this as it is :(
also strange that has not already been fixed

if anyone here around it's faster than me in build the source code, please help! :)

Re: Build ScummDC attempt(s)

Posted: Fri Apr 17, 2020 10:31 am
by kremiso
update news, both good and bad

i have probably found another way to go without recompile anything
hexediting the MOHAWK.PLG file, because it's basically an ELF packed file (also using i.e. PeaZip it's possible to extract all the files too)
i have already found the Riven savename string 'riven-%03d.rvn' and tried to change it...
but, again, the save works and also you have in the vmu the exactly name you choose, the load instead shows nothing as usual

don't know, i suspect the Mohawk load routine has not been implemented at all in the Dreamcast port :(

atm i'm doing other tries, also with games that use the same plugin, to at least check if the LOADsave works in any of them;
also, the main scummvm.bin (or 1st_read.bin) can be descrambled to try some modifies there too

Re: Build ScummDC attempt(s)

Posted: Sat Apr 18, 2020 9:08 am
by kremiso
finally, a good news only
i reached to fix the NEVERHOOD gamesave!
using the same Myst/Riven approach, only 1 byte value changed in the correct plugin
doing tries with Demul, it seems WORK :)

now, at least it's possible to test if it is completable first, and with which scummvm release for second :)
i'll upload a test release in the scummvm/download section

done, let me know how works on real hw :)

Re: Build ScummDC attempt(s)

Posted: Sat Apr 18, 2020 6:20 pm
by Anthony817
Sweet great to see you working so hard fixing these great titles! :mrgreen:

Re: Build ScummDC attempt(s)

Posted: Sat Apr 18, 2020 10:40 pm
by Nz17
Let me know if after this porting project you would then like to port the open-source Adventure Game Studio (AGS) to Dreamcast. If so, then it would help you to start with the PSP port of AGS. :-)