More progress on my task & getting close to the finish line

Hello! I was not as close to finish as I had estimated before. However, I have some more good progress on my task!

Right after my blog the previous week, I found the problem which was making me very concerned about my code. Whenever I ran ScummVM, it took about 20-30 seconds to start. I was worried that some of my code could be troublesome, but then I found out my configuration file was a little too big.


The configuration file (scummvm.ini) stores some useful information and is often low in size (~10KB) or so. In code, we interact with this file using “ConfMan”. For my previous task, I configured this to get a boolean from the .ini file to force the RTL-based GUI.

I think some of my temporary code would have caused this issue. The ini file was around 150MB big!

I was curious to see what it contained, so I opened it in sublime. It took ~15 minutes to open and it had this:

15 minutes! For my own amusement, I have saved this file in another location. I simply deleted the file and relaunched scummvm, and I was so happy when it was running smoothly! I was genuinely thinking I made a big mistake somewhere or my code is very poor. Phew!

Apart from this little incident, this week I also enabled all engines in my project. Previously I had only enabled one to speed up compile times on my potato pc.

The compilation times really took a lot. A lot of time. There were ~350 errors after the first time I enabled all (stable) engines. I solved all of them, and the project was now fully compilable!

I also had to add in support for my own version of printf, which took in U32Strings. To be honest, the existing code was really confusing to me, because I hadn’t really dealt with language-feature level code before. My mentor pointed out a good StackOverflow answer, which helped a bit to understand but I was still confused.

After getting nowhere on it for an hour or so, I thought I would just write a temporary code to get started. I passed in the code as U32String and used iterators to loop through and check for “%”, then switch according to characters. I did this only for 1 argument because I wasn’t really sure how to do it for a variable number of arguments.

Following along slowly side-by-side with the answer from StackOverflow and the existing code of ScummVM, I was able to do it!

So, what’s next? To adapt my code across the project, I am now nearly modifying ~210 files when compared to the master. This means that I have to be more careful of my code effects, and more testing. Even though I plan to open the PR soon, I am thinking it will be a few more days to test out everything and make sure there is no funny business (like the 150MB ini file!)

That’s it for this week’s progress! I have one more thing to say, though. My previous task – “RTL GUI” is near merge now. My mentors have told me that now is a good time to look back and reflect on my task because I have achieved the first milestone. It’s a great idea, and I will be writing a new post regarding this, and it will be going up shortly after this post!

Thanks for reading!