Your MODE 7 has different high-bit characters as shown by your screenshot. Mine is using a 16x20 bitmap based on what RISC OS 5 generates. A 16x20 gives the same character positioning as MODE 6 (8x8 with 2 blank lines, and pixel doubled). I've posted character maps on the Matrix Brandy thread.Richard Russell wrote: ↑Sat Jan 18, 2020 12:53 pmSo how does that differ from mine? I presume that Matrix Brandy has the same restriction as BBC BASIC for SDL 2.0, i.e. that pixels have to be 'square', so it's not possible to reproduce the MODE 7 font without using anti-aliasing (MODE 7 uses a 12 MHz 'pixel' clock compared with 8 MHz for MODEs 1 & 6 or 16 MHz for MODEs 0 & 3)? I chose the 16x16 font as being as close as I could reasonably get within that square-pixel restriction.
BBC BASIC for SDL 2.0 version 1.09a released
Re: BBC BASIC for SDL 2.0 version 1.09a released
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Re: BBC BASIC for SDL 2.0 version 1.09a released
My screenshot wasn't of MODE 7, it was of the internal 16x16 ANSI character set. It's used in MODE 7 as well, by default, but of course there are no high-bit-set characters in that case (MODE 7 is 7-bits only as far as the character generator is concerned.) and some characters are different.
OK, that confirms it's not like the BBC Micro's MODE 7 (which is 12x20). The extra 4 lines compared with my 16x16 characters may help you with some tall characters, such as the fractions, but fundamentally you and I have the same square-pixel limitation which can only be overcome using an anti-aliased font like Bedstead, if you want a better match to the real MODE 7.Mine is using a 16x20 bitmap based on what RISC OS 5 generates.
Are there any IPR issues affecting the MODE 7 font you are using? If I wanted to tweak mine to be more similar to yours could I get into trouble?
Re: BBC BASIC for SDL 2.0 version 1.09a released
Shouldn't be, a recent announcement put RISC OS under the Apache 2.0 licence (open source), and Apache licensed code can be used under the GPL (which Brandy is licensed under) - and the font was manually generated taking a screenshot from RPCEmu with RISC OS source code being used. As for being "like" the BBC Micro, I was referring to the character set, and the effective character sizing on a 640x500 display. I can select a 12x20 font, but it is horizontally squashed (SDL1.2 can't do smooth resizing) which is based on Bedstead. You can see the effect of this in my Telstar app, by pressing CTRL-W. Pressing it again toggles it back.Richard Russell wrote: ↑Sat Jan 18, 2020 2:33 pmMy screenshot wasn't of MODE 7, it was of the internal 16x16 ANSI character set. It's used in MODE 7 as well, by default, but of course there are no high-bit-set characters in that case (MODE 7 is 7-bits only as far as the character generator is concerned.) and some characters are different.
OK, that confirms it's not like the BBC Micro's MODE 7 (which is 12x20). The extra 4 lines compared with my 16x16 characters may help you with some tall characters, such as the fractions, but fundamentally you and I have the same square-pixel limitation which can only be overcome using an anti-aliased font like Bedstead, if you want a better match to the real MODE 7.Mine is using a 16x20 bitmap based on what RISC OS 5 generates.
Are there any IPR issues affecting the MODE 7 font you are using? If I wanted to tweak mine to be more similar to yours could I get into trouble?
I did attempt a while back to do a "nearest neighbour" stretch of the 12x20 font to 16x20 but it looked hideous.
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Re: BBC BASIC for SDL 2.0 version 1.09a released
OK. I don't think fonts count as 'code' from an IPR viewpoint but the Apache licence is quite permissive (more so than GPL).
MODE 7 gives neither of us any leeway in that respect, it has to meet the Videotex character set requirements (as for example given in the Broadcast Teletext Specification).As for being "like" the BBC Micro, I was referring to the character set
Indeed, and even stretching with a more sophisticated interpolation algorithm won't necessarily be as nice as what an anti-aliased font with hints can achieve. Bedstead comes pretty close to matching the SAA5050 character generator used in the BBC Micro, given the limitation of square pixels.I did attempt a while back to do a "nearest neighbour" stretch of the 12x20 font to 16x20 but it looked hideous.
Re: BBC BASIC for SDL 2.0 version 1.09a released
I was looking at it through the lens of the font being defined in the RISC OS source code, but as Apache allows use under the GPL, Matrix is OK. However, with regard to zlib licence, I'm not so sure. But, as I said, my implementation is a 16x20 pixmap font taken from a screenshot of RPCEmu running RISC OS 5. (The older RISC OS versions use an 8x10 font that I also used in my early Teletext implementation, this was based on the SAA5050 look but looked horribly pixelly.)Richard Russell wrote: ↑Sat Jan 18, 2020 3:45 pmOK. I don't think fonts count as 'code' from an IPR viewpoint but the Apache licence is quite permissive (more so than GPL).
My other option, but probably far too much work, would be to use an 8bpp 16x20 "sprite" or similar for each character, based on the SAA5050 stretched out. (If I were to do this, I'd probably screenshot your client with the Engineering Test Page from Telstar as that has all the glyphs in it it would also probably be even slower than it already is!)Richard Russell wrote: ↑Sat Jan 18, 2020 3:45 pmIndeed, and even stretching with a more sophisticated interpolation algorithm won't necessarily be as nice as what an anti-aliased font with hints can achieve. Bedstead comes pretty close to matching the SAA5050 character generator used in the BBC Micro, given the limitation of square pixels.I did attempt a while back to do a "nearest neighbour" stretch of the 12x20 font to 16x20 but it looked hideous.
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Re: BBC BASIC for SDL 2.0 version 1.09a released
SDL_ttf (there are both SDL 1.2 and SDL 2.0 versions) will create such 'sprites' for you from the Bedstead (or any other TTF or OTF) font. Indeed that's exactly how BBCSDL handles such fonts: SDL2_ttf creates a surface for each character 'on demand' and those surfaces are converted to textures, which are cached for efficiency.
You could do that 'off line' and just store the surfaces as bitmaps if you wanted to (assuming the font's licence permits that). The only reason I don't do it that way myself is because of the way BBCSDL was developed. Long before I knew anything about SDL2_ttf or the Bedstead font I was using SDL2_gfx (which supports bitmapped fonts) for the characters in MODEs 0-7, and that remains the case by default.
Re: BBC BASIC for SDL 2.0 version 1.09a released
Following up from a post in the Matrix Brandy thread:
With ever-increasing display resolutions, including 'retina' screens on many mobile devices and some laptops, it was a lack of foresight on Acorn's part for graphics statements like LINE and CIRCLE to draw only one-pixel-thick lines.
OK. Generally I have not implemented RISC OS-specific VDU commands (VDU 23,16... is the only one I think); this is in keeping with my general ignorance of RISC OS, having never owned or used a machine running that OS. I have however added a few VDU commands of my own:
Code: Select all
VDU 23,22... Set a custom screen mode, including the ability to select UTF-8 character encoding.
VDU 23,23,n| Set the line thickness for straight lines and outline shapes (a major omission from Acorn versions, IMHO).
VDU 23,24,n| Set the inter-character spacing adjustment (used only with OTF/TTF fonts).
Re: BBC BASIC for SDL 2.0 version 1.09a released
I believe VDU23,16 was introduced on the Master.Richard Russell wrote: ↑Thu Jan 23, 2020 5:26 pm Following up from a post in the Matrix Brandy thread:
OK. Generally I have not implemented RISC OS-specific VDU commands (VDU 23,16... is the only one I think);
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Re: BBC BASIC for SDL 2.0 version 1.09a released
Could be (I think VDU 23,7 was). In which case I'm happy to say that I've not implemented any RISC OS-specific VDU commands (not counting the graphics extensions as RISC OS-specific, since they were available for the BBC Micro in the GXR ROM)!
I know I probably shouldn't be so sniffy about RISC OS, but it has never interested me. Also, as previously discussed, I think Acorn went seriously astray in the way RGB colours were handled, not least in bypassing the VDU queue, which should have been forbidden (BBCSDL is reliant on the VDU queue for serialising graphics commands so they can be sent from the interpreter's thread to the GUI thread).
To some extent a lack of oversight by the BBC may have been responsible for fundamentals being forgotten. Although the original Archimedes was still a 'BBC' machine, responsibility for its development was more devolved to Acorn than had been the case for the BBC Micro.
Re: BBC BASIC for SDL 2.0 version 1.09a released
Btw, I notice that VDU7 doesn't produce any sound at all in BBCSDL 1.09a on macOS Mojave 10.14.6. (The SOUND command works normally and produces sounds.)
Is this to be expected?
Is this to be expected?
Re: BBC BASIC for SDL 2.0 version 1.09a released
Probably.
VDU 7, rather predictably, converts to printf ("\7") so what happens, if anything, is entirely down to how the OS handles that BEL character being sent to stdout. I don't have a lot of choice in the matter, because although the SOUND system is functional there's quite an overhead in initialising it and sending a WAV file to the audio driver, which is not something that you're going to want to do just to sound a short beep.
Some platforms provide a simple beep API function (for example MessageBeep() in Windows) but not all. Is there one in MacOS that you know of that I could call? Such a function in SDL itself has been asked for but none has ever been provided. On a quick test Matrix Brandy is also silent on VDU 7 (in Windows, anyway).
Re: BBC BASIC for SDL 2.0 version 1.09a released
Matrix Brandy also effectively does a VDU7 to the controlling terminal - which is fine in Linux (but if started from a menu with no controlling terminal, it's also silent). I didn't know about MessageBeep, then again I don't really know the first thing about the Windows API! But thanks for the tipRichard Russell wrote: ↑Fri Jan 24, 2020 4:39 pmProbably.
VDU 7, rather predictably, converts to printf ("\7") so what happens, if anything, is entirely down to how the OS handles that BEL character being sent to stdout. I don't have a lot of choice in the matter, because although the SOUND system is functional there's quite an overhead in initialising it and sending a WAV file to the audio driver, which is not something that you're going to want to do just to sound a short beep.
Some platforms provide a simple beep API function (for example MessageBeep() in Windows) but not all. Is there one in MacOS that you know of that I could call? Such a function in SDL itself has been asked for but none has ever been provided. On a quick test Matrix Brandy is also silent on VDU 7 (in Windows, anyway).
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Re: BBC BASIC for SDL 2.0 version 1.09a released
I'm way out of my depth here, but it's possible that the macOS equivalent of MessageBeep is the function NSBeep() in the NSBeep class in the AppKit framework. I may be using some or all of the terminology in that last sentence wrongly.Richard Russell wrote: ↑Fri Jan 24, 2020 4:39 pmSome platforms provide a simple beep API function (for example MessageBeep() in Windows) but not all. Is there one in MacOS that you know of that I could call?
What I do know is that the following AppleScript does produce the "system beep" or "system alert" noise:
Code: Select all
use framework "AppKit"
current application's NSBeep()
Code: Select all
printf "\a"
Re: BBC BASIC for SDL 2.0 version 1.09a released
Me too. The beauty of SDL2 is that it provides an abstraction layer that makes all the platforms look the same to my app. I don't need to be able to write native code for any of them, and with the exception of Windows I can't. Realistically the only way I could implement VDU 7 would be if there's an off-the-shelf multi-platform solution in the same vein as SDL2_gfx, SDL2_ttf and SDL2_net (if somebody fancies writing one they could call it SDL2_beep).
Anyway it seems to me to be a low priority: in more than thirty-five years of BBC BASIC programming I'm not sure I've ever used VDU 7 to do anything other than to sound an audible alert to accompany an error message.
Re: BBC BASIC for SDL 2.0 version 1.09a released
The use of VDU7 for that and other purposes was quite popular:Richard Russell wrote: ↑Fri Jan 24, 2020 10:07 pm in more than thirty-five years of BBC BASIC programming I'm not sure I've ever used VDU 7 to do anything other than to sound an audible alert to accompany an error message.
Re: BBC BASIC for SDL 2.0 version 1.09a released
I don't worry too much because of course 'my' BASICs aren't - and don't pretend to be - BBC Micro emulators, but rather versions of BBC BASIC adapted and optimised for modern platforms. So there are many detailed differences compared with Acorn versions, and if VDU 7 does nothing I can simply lump that in with the others!
Re: BBC BASIC for SDL 2.0 version 1.09a released
Can't seem to get the Compile option to work on Mac:Richard Russell wrote: ↑Sun Jan 12, 2020 12:56 pm I've released version 1.09a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.
[EDIT: video deleted]
Last edited by lurkio on Mon Feb 10, 2020 1:27 pm, edited 1 time in total.
Re: BBC BASIC for SDL 2.0 version 1.09a released
Error 254 is "Bad command" so my guess is that a command it needs is not available for some reason. Please add line numbers to examples/tools/compiler.bbc (File...Load, Utilities...Renumber, File...Save) and then repeat the exercise to discover at which line it is failing.
Re: BBC BASIC for SDL 2.0 version 1.09a released
It's line 2610:Richard Russell wrote: ↑Sun Feb 09, 2020 3:31 pm Error 254 is "Bad command" so my guess is that a command it needs is not available for some reason. Please add line numbers to examples/tools/compiler.bbc (File...Load, Utilities...Renumber, File...Save) and then repeat the exercise to discover at which line it is failing.
Code: Select all
2610 OSCLI "run cp -R " + @lib$ + "../../Frameworks/* " + folder$ + "Contents/Frameworks/"
Re: BBC BASIC for SDL 2.0 version 1.09a released
Could it be the old issue of paths containing spaces? If you PRINT @lib$ does the path that is printed contain any spaces or punctuation characters? If that is the problem, try changing line 2610 as follows (all the other similar commands do contain extra quotes to cover this situation, but it looks as though this one was missed):lurkio wrote: ↑Sun Feb 09, 2020 3:47 pmIt's line 2610:Code: Select all
2610 OSCLI "run cp -R " + @lib$ + "../../Frameworks/* " + folder$ + "Contents/Frameworks/"
Code: Select all
2610 OSCLI "run cp -R """ + @lib$ + "../../Frameworks/*"" """ + folder$ + "Contents/Frameworks/"""
Re: BBC BASIC for SDL 2.0 version 1.09a released
Yes, one space.Richard Russell wrote: ↑Sun Feb 09, 2020 3:59 pm Could it be the old issue of paths containing spaces? If you PRINT @lib$ does the path that is printed contain any spaces or punctuation characters?
I think it's paths with spaces that are the cause of the error, but your amendment to the line in question didn't fix the problem. (Same error message.)Richard Russell wrote: ↑Sun Feb 09, 2020 3:59 pmIf that is the problem, try changing line 2610 as follows (all the other similar commands do contain extra quotes to cover this situation, but it looks as though this one was missed):
Code: Select all
2610 OSCLI "run cp -R """ + @lib$ + "../../Frameworks/*"" """ + folder$ + "Contents/Frameworks/"""
I was able to get the program to compile by moving the app itself (BBCBasic.app) to a path without spaces!
Re: BBC BASIC for SDL 2.0 version 1.09a released
Did I mess up adding the quotes then? I'm far from being a Mac OS expert, but I'm assuming that this is valid syntax for the copy command:
Code: Select all
cp -R "source perhaps with spaces" "destination perhaps with spaces"
Re: BBC BASIC for SDL 2.0 version 1.09a released
So am I!Richard Russell wrote: ↑Sun Feb 09, 2020 4:28 pmDid I mess up adding the quotes then? I'm far from being a Mac OS expert
After experimenting with filesystem navigation commands on the commandline in the Terminal app on macOS, I found that I could remove the asterisk from the cp command on line 2610 in compiler.bbc, and the Compile then worked. I think the -R option takes care of the required exhaustive recursivity. (I do wonder if the specific Unix shell that I'm using might have something to do with it though..?)Richard Russell wrote: ↑Sun Feb 09, 2020 4:28 pmbut I'm assuming that this is valid syntax for the copy command:
Code: Select all
cp -R "source perhaps with spaces" "destination perhaps with spaces"
Code: Select all
2610 OSCLI "run cp -R """ + @lib$ + "../../Frameworks/"" """ + folder$ + "Contents/Frameworks/"""
Didn't work.Richard Russell wrote: ↑Sun Feb 09, 2020 4:28 pmAnother thing you could try is omitting the 'run' from the command so that it reads OSCLI "cp -R ....."
EDIT: Hang on!: The compiled program doesn't actually run properly!
EDIT2: The compiled program runs and allows the player to input their name but then crashes with a "No such line" error, after which you're dropped to the BASIC prompt but you can't LIST the program ("Mistake")!
Re: BBC BASIC for SDL 2.0 version 1.09a released
It works for me (at least, the version of your program here). Does it run from the Test button on the Compile dialogue (I would always advise trying that first before building your app bundle)?
You can always uncheck all the Crunch options, just in case you've got something incompatible with crunching (such as a GOTO a REM line).
Re: BBC BASIC for SDL 2.0 version 1.09a released
Here's the DMG I built, which seems to run here. I've no idea why it would be different from yours:
Re: BBC BASIC for SDL 2.0 version 1.09a released
I thought that I'd tried the Test button and that the program had worked, but apparently not:Richard Russell wrote: ↑Sun Feb 09, 2020 5:53 pm It works for me (at least, the version of your program here). Does it run from the Test button on the Compile dialogue (I would always advise trying that first before building your app bundle)?
[EDIT: video deleted]
I don't think I GOTO any REMs, but it was turning off all the Crunch options that got the compiled program to work. Thanks.Richard Russell wrote: ↑Sun Feb 09, 2020 5:53 pmYou can always uncheck all the Crunch options, just in case you've got something incompatible with crunching (such as a GOTO a REM line).
EDIT: Looks like it's the "Concatenate lines" option that causes the problem in this case.
Last edited by lurkio on Mon Feb 10, 2020 1:27 pm, edited 1 time in total.
Re: BBC BASIC for SDL 2.0 version 1.09a released
It works here with all crunch options enabled, so I reckon the program you're compiling is different from what can currently be downloaded from your original thread; maybe you'd care to make the current version available so I can try it myself?
Re: BBC BASIC for SDL 2.0 version 1.09a released
I think you're right that I was using a slightly different version of the listing. However, I've now tried copying and pasting the listing from the original Nellan thread, and I still can't get the Compiled program to run successfully unless I untick the "Concatenate" option.Richard Russell wrote: ↑Sun Feb 09, 2020 6:47 pmIt works here with all crunch options enabled, so I reckon the program you're compiling is different from what can currently be downloaded from your original thread; maybe you'd care to make the current version available so I can try it myself?
Re: BBC BASIC for SDL 2.0 version 1.09a released
Thanks. There's no particular urgency from my point of view though.Richard Russell wrote: ↑Sun Feb 09, 2020 8:04 pmIf you want me to investigate further, send me a non-working DMG so I can find out exactly what has gone wrong.
Here's the .DMG. The app inside was created with all Crunch options ON. The BASIC program will run but, after you enter your name and then try to enter a command such as HELP, the program will crash: