Open a1batross opened 5 years ago
FWIW, the sdl2 branch was in an incomplete state when I stopped work on it. I think. It's been multiple years since I last looked at this. I vaguely remember that I was having problems with getting the audio to be the right pitch and it was a sampling issue (hence trying to pull a resampling library in, but I don't remember what state that work was in).
I don't remember also, but didn't heard any pitch issues. Maybe I'm too deaf. :)
I just found this on my old laptop and I decided to upload here and... I don't have time to continue porting yet. :(
What about this isn't done @a1batross? I just came across this and got interested.
@JeodC nothing really, I guess. You're free to take this branch and continue working on it.
@JeodC nothing really, I guess. You're free to take this branch and continue working on it.
I compiled it in bullseye and it works, so it's functional lol.
I run into two problems when using clannad from the "safe" branch (2015) off steam. Note that I'm using gl4es and mali drivers.
global.sav.gz
. This is a regression from the upstream.I've been fiddling with glViewport etc in sdl_graphics_system.cc
for a while, but to no avail. Related to the texture scaling problem, I did end up having to remove most of void SDLGraphicsSystem::RedrawLastFrame
since it would scale textures too large each time it was called.
An update to this for posterity:
I intend to distribute a rlvm binary for use on retro handheld devices running linux, with mali blobs and gl4es wrapper.
I ended up going with the SDL1 version (upstream) for my distributions. SDL2 is incomplete and has other issues outlined above. For SDL1, I ran into two major problems which I managed to resolve:
Textbox shaders - Marking the textbox for transparency effects resolves the texture splitting issue imaged above. This made the textbox a solid color though, not transparent. I updated the shaders.cc file with modern function names, and it resolved that problem.
Effects texture rendering larger than screen - On aspect ratios other than 4:3, textures rendered during effects would be drawn too large for the screen. To resolve this, I did the following in src/effects/effect.cc
:
bool Effect::operator()(RLMachine& machine) {
unsigned int time = machine.system().event().GetTicks();
unsigned int current_frame = time - start_time_;
bool fast_forward = machine.system().ShouldFastForward();
if (current_frame >= duration_ || fast_forward) {
return true;
} else {
// We don't have glOrtho here, so just forget this bit since it's the cause of a render bug.
/*
GraphicsSystem& graphics = machine.system().graphics();
graphics.BeginFrame();
if (BlitOriginalImage()) {
dst_surface().RenderToScreen(
Rect(Point(0, 0), size()), Rect(Point(0, 0), size()), 255);
}
PerformEffectForTime(machine, current_frame);
graphics.EndFrame();
return false;
*/
return true;
}
}
This effectively removes effects from the game. I realize these are band-aids and I realize gl4es probably didn't exist back in 2014. Anyway, notes for whoever might need them in the future.
This is not finished yet and probably will be updated for proper Linux support.