Proposal to extend @platform% for the Raspberry Pi Pico

Discussions related to the BB4W & BBCSDL interpreters and run-time engines
Hated Moron

Proposal to extend @platform% for the Raspberry Pi Pico

Post by Hated Moron »

Over at GitHub, 'Memotech Bill' is proposing to extend the @platform% system variable to indicate not only the 'platform' (he's suggesting 6 in the LS byte for the Raspberry Pi Pico) but also to use the next byte to indicate variants as follows:

Code: Select all

@platform% = 6 + ( is_pico_w () << 8 )
where is_pico_w() returns:

Code: Select all

0 = Standard Pico
1 = Pico W without CYW43 support
2 = Pico W with CYW43 GPIO support
3 = Pico W with CYW43 poll support
4 = Pico W with CYW43 threadsafe background support
Since the MS 24-bits of @platform% have only been used to date in the GUI editions (they hold the SDL2 version number) I can't see any major objections to this, but as with any globally-allocated ID we don't want to burn our boats through lack of proper consideration.

Can anybody see any issues with Bill's proposal?
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: Proposal to extend @platform% for the Raspberry Pi Pico

Post by KenDown »

To be honest, I didn't realise there was such a variable until I read your post. *I* can't see any problem with the proposal, but my opinion on the matter is probably not worth very much!
Soruk
Posts: 23
Joined: Mon 30 Jul 2018, 20:24

Re: Proposal to extend @platform% for the Raspberry Pi Pico

Post by Soruk »

Very late to this party, but makes sense to me. One thing I'd suggest is that non-SDL versions keep the most significant byte at 0, in common with BB4C this is indicating that no SDL is present.

We could go as far to "redefine" the top 3 bytes of @platform% such that if the top byte is non-zero, these 3 bytes contain the SDL version number. If zero, the next two bytes could be something more platform-specific, perhaps based on the content of the LSB. This shouldn't break the current usage of @platform%.

It's just an idea, it's probably about as bonkers as most of my others.