Not long ago I updated the Android build of BBC BASIC for SDL 2.0 to include a 64-bit ARM binary as well as 32-bit. This was necessary because a few recent Android devices (notably some Google Pixel devices) won't run 32-bit apps, and there will inevitably be increasingly more. Having a 64-bit executable is also a requirement for the Play Store.
I warned at the time that this would introduce a potential incompatibility because special care must be taken to ensure that BBC BASIC code will run on a 64-bit platform. Although all the supplied example programs are necessarily compatible (MacOS and iOS have both been 64-bit-only for a long time) that might not be true of user's code.
But today I discovered a completely unexpected consequence of this change. The BBC2APK utility, which creates an Android app from a BBC BASIC program, optionally crunches the program using the BB4W cruncher (it's a Windows app). But whilst the BB4W cruncher has no known bugs, that's only true when crunching 32-bit programs and it can (very rarely) fail when crunching 64-bit programs.
As a result it's possible that an Android app created by BBC2APK won't run. There's no simple solution, other than disabling the Abbreviate names crunch option entirely. The proper way to fix it is to replace the BB4W cruncher, which BBC2APK currently uses, with the BBCSDL cruncher, but that's a complicated and risky change.
The law of unintended consequences
Re: The law of unintended consequences
I've bitten the bullet by transplanting the BBCSDL cruncher into BBC2APK, replacing the BB4W cruncher. This is a much bigger change than I normally like to make to a 'stable' utility, but it was the only satisfactory way of achieving full 64-bit compatibility.Hated Moron wrote: ↑Tue 17 Jan 2023, 20:07 The proper way to fix it is to replace the BB4W cruncher, which BBC2APK currently uses, with the BBCSDL cruncher, but that's a complicated and risky change.
The few tests I've carried out suggest it is working, but if you use BBC2APK please try rebuilding your apps using this new version (1.10). If you've not done that recently, remember that any misbehaviour could be due to 64-bit incompatibility and nothing to do with the cruncher change.
All being well you might see a small performance improvement (the BBCSDL cruncher performs better than the BB4W cruncher in using 'fast' variables wherever it can) but if you do see anything that makes you think the cruncher is misbehaving let me know.
- hellomike
- Posts: 184
- Joined: Sat 09 Jun 2018, 09:47
- Location: Amsterdam
Re: The law of unintended consequences
Nice work.
Rebuilding my App after also installing Java 1.8 worked.
Rebuilding my App after also installing Java 1.8 worked.