SDL_Surface format
In my opinion, one of the most serious limitations of Matrix Brandy is not being able to display proportional-spaced text, in an arbitrary font.
I thought I had found a neat solution: now the native SDL_Surface pointer is exposed, and there is support for calling shared objects (e.g. DLLs in Windows), I should be able to use the functions in SDL2_ttf to blit proportional-spaced characters to Matrix Brandy's canvas.
But it doesn't work. After some frustrating debugging I discovered why: annoyingly (and for no obvious reason) SDL 1.2's surfaces are in a different format from SDL 2.0's surfaces! So the blit operation inevitably fails, because it's trying to blit a SDL 2.0 surface onto a SDL 1.2 surface.
Trying to munge an SDL 2.0 surface into an SDL 1.2 surface, in BASIC, would be messy and probably hit performance too severely. So I've come to rather a dead end - unless Matrix Brandy could be modified. I think porting it to SDL 2.0 has been discussed, so is that a possibility?
I thought I had found a neat solution: now the native SDL_Surface pointer is exposed, and there is support for calling shared objects (e.g. DLLs in Windows), I should be able to use the functions in SDL2_ttf to blit proportional-spaced characters to Matrix Brandy's canvas.
But it doesn't work. After some frustrating debugging I discovered why: annoyingly (and for no obvious reason) SDL 1.2's surfaces are in a different format from SDL 2.0's surfaces! So the blit operation inevitably fails, because it's trying to blit a SDL 2.0 surface onto a SDL 1.2 surface.
Trying to munge an SDL 2.0 surface into an SDL 1.2 surface, in BASIC, would be messy and probably hit performance too severely. So I've come to rather a dead end - unless Matrix Brandy could be modified. I think porting it to SDL 2.0 has been discussed, so is that a possibility?
0
Comments
-
I have briefly looked at it, though graphsdl.c will need a considerable rewrite as will keyboard.c.
There is also an SDL_ttf library which I believe is intended to be used against libSDL-1.2 but to be fair I have never played with it.
The display architecture of Matrix Brandy uses two layers, one is "modescreen", which has the pixel dimensions of the mode being displayed (e.g. MODE 2 has a 160x256 surface), and the actual surface that is blitted to the screen is a scaled up version such that MODEs 0, 1, 2, 4, 5 (and others) use 640x512 and blit_scaled does the upscaling based on the screen mode. if you write directly to the outermost layer it is likely to get splatted by the blit-scaler from modescreen, and writing to modescreen needs to take into account any scaling. (MODEs 18-21, 25-28 are mapped 1:1)0 -
There is also an SDL_ttf library which I believe is intended to be used against libSDL-1.2The display architecture of Matrix Brandy uses two layers
That's one of the reasons why in my BASICs (which of course are not designed to be 'emulators') MODEs 3 and 6 do not have 'gaps', and indeed you can happily draw graphics in them! They only differ from the other modes in having an artificially-increased row spacing.if you write directly to the outermost layer it is likely to get splatted by the blit-scaler
There's not a lot of point exposing the surface pointer if you can't actually use it to blit to the 'screen'!
0