Skip to content

Releases: 32blit/32blit-sdk

Version 0.3.2

16 Aug 15:17
264b70c
Compare
Choose a tag to compare

Less is More

This release is all about removing things, but in a good way.

delete[] examples

The examples now live over at https://github.com/32blit/32blit-examples. However if you still want to build them with the SDK , you can clone that repo to [sdk root]/examples like it was before.

duplication--

Some code is now shared between 32blit-stm32 and 32blit-pico as part of the ongoing quest of adding more features to -pico.

broken = false

Finally, this release is less broken due to being built with the latest tools. There's also fixes for building with pico-sdk 2.0.

What's Changed

Full Changelog: v0.3.1...v0.3.2

v0.3.1

17 Jun 11:36
b43a2e3
Compare
Choose a tag to compare

A Pico... Vision?

Realising that it's been ages since the last release, changes have piled up and I can make releases now... Here's a release!

New Hardware

The biggest change in this release is support for the PicoVision, which includes USB HID input and SD card storage (also available on the VGA board). Most code should port over easily with the exception that you can't directly access screen.data. It's possible to blit a Surface in the same format as a partial workaround though.

static uint16_t temp_framebuffer[160 * 120];
static blit::Surface temp_screen((uint8_t *)temp_framebuffer, blit::PixelFormat::BGR555, {160, 120});
...
screen.blit(&temp_screen, {0, 0, 160, 120}, {0, 0});

The "pico" port also has a lot more configuration, making it a easier to support new devices with st7789 displays and buttons wired to GPIO pins. An example of this is the Tufty2040, which is now supported as much as it can be with only five buttons.

Other Additions

  • blit_executable(name INTERNAL_FLASH src.cpp) can be used to build a "firmware" executable for the 32blit. This was previously done with blit_executable_int_flash, which was internal to the SDK.
  • Surface::get_pixel allows reading back data from Surfaces, without needing to access data or know the format. It also works in the PicoVision port.
  • set_screen_mode now takes an optional resolution, currently only used for the PicoVision.
  • The launcher is a bit more helpful about incompatible blit files instead of just going "Oops".
  • The usual bug fixes all over.

Compatibility

As usual, old .blit files should continue to work. This version does contain a minor API bump though, so new .blit files will not run on older firmware.

Aditionally, some loooong-deprecated wrappers have been removed. (SpriteSheet -> Surface, a few blit variants and 32blit.cmake)

What's Changed

Full Changelog: v0.3.0...v0.3.1

Version 0.3.0

21 Feb 17:45
9adbf2e
Compare
Choose a tag to compare

Community Handover

Version 0.3.0 marks a major milestone in the 32blit project; its transfer into the capable hands of the most invested community members.

Why? There wont be another production run of the STM32-based 32blit handheld, and there may never be another handheld from Pimoroni bearing the 32blit moniker. We cannot sensibly afford to pour time into maintaining the 32blit tooling, but I think it's valuable enough that it deserves to live on.

The 32blit SDK has outlasted its namesake and now exists as a set of tools for building games targeting microcontrollers, with additional support for SDL to target Windows, Mac and Linux, and Emscripten for the web. We have hardware ports for the O.G. 32blit and many new RP2040/Raspberry Pi Pico based boards including PicoSystem.

The 32blit SDK is permissively licensed and we've handed the reins over to some community members so that they can continue to improve and build upon it while we might be busy elsewhere.

Thank You

You - the community - really took 32blit and ran, achieving something truly incredible and beyond our wildest expectations or imagination. Thank you!

I remain personally invested in the 32blit SDK and tooling, and will remain as a maintainer here. I will, however, take a back seat and let the community contributors guide the project. Where it goes from here is up to you.

But... I hope we'll see a full rebirth of the 32blit firmware/launcher on a PicoSystem someday.

What's Changed

Full Changelog: v0.2.3...v0.3.0

Version 0.2.3

10 Mar 16:17
8a4f36a
Compare
Choose a tag to compare

Some Light Maintenance

Swept up some bugfixes and improvements made by @Daft-Freak into a release for your viewing pleasure.

Should also fix some of the examples for Pico/RP2040 which previously suffered from an uninitiated screen!

What's Changed

Full Changelog: v0.2.2...v0.2.3

Version 0.2.2

27 Jan 15:43
8eded36
Compare
Choose a tag to compare

sudo Make My Code Faster

@Daft-Freak still seems to be finding things to tweak and fix, is code... ever done? This release includes lots of overdue cleanup, tidying and rejiggling of some untouched dark corners of the SDK plus some juicy new features to boot.

Perhaps the most notable is the availability of 30k of user ITCM RAM for 32blit hardware users.

ITCM RAM

ITCM stands for "Instruction Tightly Coupled Memory." This is super fast instruction RAM that's directly accessible to the ARM Cortex core on the STM32H750 in 32blit (This doesn't apply to PicoSystem, sorry!). That means it acts sort-of like an instruction cache, avoiding the actual instruction cache and making larger, time critical functions always fast without trampling the regular instruction cache (that sits between the CPU and QSPI flash to make it not utterly painful to use.)

Since QSPI accesses are - by comparison - low, putting some time critical code in ITCM can make an enormous difference to performance. Note this works best on chunks of code where you're negotiating a lot of instructions- Lua's bytecode interpreter is a good example -and wont have such a big impact to code that's bottlenecked by heavy computation or blocking on some other IO.

This change introduces blit_fast_code and blit_no_inline_fast_code which are convenience wrappers around the attributes that bump code into the .itcm section. Decorate up to 30K of your most sprawling, critical-path functions to turbo-boost your games.

See #737 for more information.

Screen Mode API Enhancements

The Screen Mode API has been changed to decouple resolution from colour depth bringing support for palette mode to both low/high resolution modes. There are six supported modes - two resolutions, and three pixel formats (RGB, RGB565, P) with different tradeoffs, the most memory efficient is - unsurprisingly - lores/paletted.

See #730

Let's Get Ready to Rumble

Thanks to @LordEidi we now have controller rumble support available in SDL builds. This makes testing rumble a little easier and means your rumble-enabled games can be shipped to regular ol' computer users without sacrificing your carefully crafted bzzt.

You don't need to change your code to take advantage of this. Just recompile against the latest SDK and your controllers should emit a little bzzzt when detected to let you know it's working.

See #729

Another World, another time?

The Another World game engine has been migrated to its own GitHub repository, complete with instructions for getting it up and running.

It hasn't worked properly for a long, long time now (ever?) and hopefully this should make it easier for an enterprising user to pop up and tinker with the code. Fancy a challenge? It lives here now: https://github.com/32blit/32blit-another-world

Save-b-Gone

Thanks to @Blackhawk-TA you can now remove savegames. Pooof. Gone. Self-destructing roguelike, anyone?

See #750

All The Things

New Contributors

Full Changelog: v0.2.1...v0.2.2

Version 0.2.1

29 Oct 13:58
5487da2
Compare
Choose a tag to compare

Pico Fixes

It's been a little over a month since we released @Daft-Freak's Pico SDK support as part of the 32blit SDK.

In the interim various rough edges have been bashed off and things tweaked. Nothing groundbreaking, but the ebb and flow of fixes that characterise a - I suppose - mature SDK.

PicoSystem users have been badgering away making games with the 32blit SDK, the PicoSystem C++ SDK and the PicoSystem MicroPython SDK. The 32blit SDK remains the best choice for games you want to ship on Itch.io and build cross-platform.

Moar Volts

Most notably we've raised the core voltage for RP2040 from 1.10v to 1.20v to help maintain a stable 250MHz clock on some marginal RP2040 chips. I think we've replaced most marginal PicoSystems (after figuring out that overclock was the issue) but this shouldd hopefully fix them once and for all. Note: I've run happily with 1.25v and 1.30v overclocks, and pushing the envelope is not uncommon with RP2040- this should have no noticable affect on battery or device lifespan.

Salient Changes

Special thanks to @ali1234 for fixing the Pico SDK cmake build, and adding a pico.toolchain.

@Daft-Freak has found and fixed an issue with GCC 10 which has been plaguing Arch users and Linux trailblazers for a while.

I've swapped us over to the new DFU tool built into the 32blit tools- and thus the minimum tools version is now 0.7.1. Don't forget to python3 -m pip install 32blit --upgrade.

That's it! That's the release.

All The Things

Full Changelog: v0.2.0...v0.2.1

Version 0.2.0

13 Sep 14:42
3789c78
Compare
Choose a tag to compare

RC-omg-it-supports-Pico-now?

We originally planned for the PicoSystem to be a simple, PCB-based, RP2040 handheld that we cast out into the world to see what people would make of it.

Due to a few design tweaks here and there, it turned out nicer than expected. As a consequence we felt it deserved a bit more fanfare and support.

Cue @Daft-Freak who had (is anyone surprised?) quietly ported the 32blit SDK to Pico/RP2040.

The community has made the Pico SDK and tools indespensible for working on embedded games, indeed it was painful trying to port a game without the 32blit SDK. It made sense to bring PicoSystem under the same umbrella.

A few PicoSystem specific tweaks to @Daft-Freak's port later, we could build many 32blit examples and games for PicoSystem. A little effort to support the screen resolutions (120x120 and 240x240) made many of them very playable.

It all sort of fell into place.

I'm hoping this will be a win/win situation between PicoSystem and 32blit, injecting a little gusto into the thriving (but admittedly small) 32blit community while also giving PicoSystem users a running start.

Targeting PicoSystem has already brought some minor improvements back to the 32blit SDK, and some significant improvements and performance tweaks to some games.

Porting Games

The PicoSystem is a subset of the 32blit, with fewer buttons, no analog stick, less grunt, less memory and less screen real estate. Here's a comparison:

32blit PicoSystem
CPU 480MHz 250MHz †
RAM 611K § 151K to 207K (lores only ¶)
FPU Yes No
Buttons 6 + reset 4 + power
Joystick Yes No
Tilt Yes No
Sound 8CH mini speaker 1CH piezo booper ‡
Storage 32MB XiP QSPI + 128K Flash 12MB XiP QSPI
SD card for data 4MB QSPI for data (FAT)
Screen 320x240 (160x120 lores) 240x240 (120x120 lores)
Firmware Yes No
Launcher Browse + Launch Games No
  • † - technically 2 cores overclocked from 133MHz to 250MHz but the 32Blit SDK uses only one
  • ‡ - makes a best-effort attempt to play any SQUARE waveforms (single-channel)
  • § - 362K main RAM, 64K D3 RAM, 127K DTCMRAM, 58K ITCMRAM
  • ¶ - setting ALLOW_HIRES=0 allocates a doubled buffered 120x120 16bit framebuffer (56.25k) and disables the hires screen mode.

The key differences between the RP2040 in the PicoSystem and STM32H750 in the 32blit are the slower CPU (32blit SDK doesn't use the second core), lack of FPU (floating point acellerator) and the single, small RAM region (the 32blit's main RAM is bigger than the PicoSystem's entire RAM!).

When porting games of any complexity you'll have to pay special attention to RAM usage and your use of floating point calculations. Simpler games will generally port over easily, with a little consideration for the smaller screen resolution.

Finally, the PicoSystem doesn't have a beefy speaker like 32blit. Audio is limited to a simple piezo sounder that can play a single channel at a time. PicoSystem will run the audio subsystem and make a best effort attempt output any channel configured with a SQUARE wave using the specified frequency and duty-cycle. Noise/sine/triangle waveforms, mp3s and wave audio are not compatible.

Example: Rainbow Ascent

Here's the complete diff for the Rainbow Ascent port: f35eab3

  • Some text strings were changed in consideration of the 120x120 screen resolution.
  • A simple camera transform was added to keep the player in focus as they move left/right in the 160px (16 tile) wide level on a 120px wide screen.
  • Collision was fixed to check against the game bounds, since the level is - on PicoSystem at least - larger than the screen.
  • The jump sound just works on PicoSystem, but the swooshing waves noise does not.

The port also required @Daft-Freak's performance optimisation: 0e88007

New Stuff

  • PicoSystem/RP2040 support
  • (limited) RGB565 Surface and bitmap support
  • Optimisations for PicoSystem which apply to 32blit, too!
  • Emscripten-based ports now have "image-rendering" set on the canvas to avoid blurry upscaling on hi-dpi screens
  • Bugfix to menu clip rectangle to avoid crashes when drawing out-of-bounds
  • Tweaks & fixes to SDL port video capture
  • Fixed final 99% bug for installing games using 32blit tools
  • Geometry is now a playable game
  • Faster scrolly-tile (Rainbow Ascent) rendering
  • Bugfix to the envelope generator that prevents audio from sticking on

Final 99% bug

This deserves a special mention, since it might be the last holdout 99% bug that plagued the game flashing process on 32blit.

@Daft-Freak finally found a .blit that would reliably fail at 99% and traced the cause of the bug. Flashing games should now be 100% reliable!

See 5368ff3 for more information.

Sticky Audio Bug

There was a bug that would result in an envelope generator never decaying fully to 0. The ADSR now clamps to the sustain volume when proceeding to the sustain phase. If sustain is 0, the ADSR will turn off.

Geometry

In part motivated by the PicoSystem, and by using it as an excuse to sink some time into the 32blit examples I've finally managed to turn Geometry from a tech demo into a loosely playable game.

Split the asteroids, collect them to score, and keep an eye on your energy levels.

Version bump to 0.2.0

Since the PicoSystem/RP2040 support is a big deal, I've bumped the minor version number from 1, to 2. Bold. I know.

This is to make it easier to disambiguate pre and post PicoSystem SDK versions at a glance, but doesn't mean anything much otherwise.

Summary

For the full list of changes see: v0.1.14...v0.2.0

Version 0.1.14 RC5

09 Aug 13:42
e6dc0db
Compare
Choose a tag to compare

RC5

We're still finding things to fix, including updating the FatFS library and making many, many little optimizations and quality of life improvements.

Timers

Prompted by me trying to shoe-horn "userdata" into Timers/Tweens so that I could the Lua state for 32blit-Lua, @Daft-Freak has made some fixes/tweaks to them both:

  • The blit::Timer callback is now a std::function giving timer callbacks access to the scope of your application
  • Loop count is now reset upon restarting a timer
  • Timers can now be paused. Inspired by commits from @Loxrie - https://github.com/Loxrie/32blit-beta/tree/feature/pause
  • Timers can be initialized through their constructor which now accepts callback, duration and loop. init is kept for backwards compatibility
  • The same applies to Tweens

File Metadata

Non .blit files can now have associated metadata by placing a <filename>.blmeta file alongside them. This is useful for identifying files such as game ROMs so they look shiny in the launcher.

FatFS & Filesystem

The FatFS library underpinning filesystem access to the SD card has been updated from R0.12C to R0.14b. This includes a number of fixes mostly for ExFAT (which we don't officially use) but for our purposes specifically fixes paths that include a tailing slash so that dir and dir/ are equivalent.

See the FatFS changelog for a complete list of fixes: http://www.elm-chan.org/fsw/ff/updates.txt

@Daft-Freak has added tracking of open files and ensured files are closed when switching game.

General Fixes & Tweaks

  • CMake will now check to see if the 32Blit tools fail and throw a fatal error rather than breaking
  • Emscripten version has been bumped from 2.0.4 to 2.0.18 fixing reliability issues downloading libjpeg. (This is forced to -O2 for faster CI builds)
  • transparent_index is now used by Palette to Palette blending operations
  • Rect.size is now const
  • Closing the system menu now avoids a huge timeskip in the game and Timers/Tweens are corrected
  • System name for 32Blit is now explicitly "32BLIT_HW" rather than "Generic"
  • Optimized hsv_to_rgba
  • Fixed SDL get_metadata description
  • Fix corner case off-by-one in RLE sprite unpacking
  • Fixes & tweaks to the battery I2C comms and status
  • Assorted preparations to bring 32blit-sdk support to PicoSystem

Raycaster

Working Bug spray! Plus lots of small tweaks and fixes.

All The Things

Once again, all of the changes in this release can be browsed in detail here: v0.1.13...v0.1.14

Version 0.1.13

26 May 14:59
dc79a90
Compare
Choose a tag to compare

RC4

Wow. It's been a while.

More of you have got hold of your 32Blits and started experimenting, running into some of the remaining rough edges. @Daft-Freak, @ahnlak and @davidskeck have stepped in with edge case bugfixes, quality of life improvements, documentation tweaks and typo fixes.

There's nothing too groundbreaking here, save for general improvements.

USB Serial

USB serial has been run through the ringer by those of you experimenting with web USB. Installing games to 32Blit is now more robust than it's ever been and I regularly get away with running for f in examples/*/*.blit; do 32blit install $f; done without error. Thanks to @Daft-Freak for getting suck in this seemingly never ending chasm of issues.

Android!?

Someone asked about building on Android... so of course @Daft-Freak took that as a challenge accepted moment and made some tweaks to the SDK. I've always wanted to see how far the 32Blit SDK could go in terms of third-party devices, so this is really cool. Right now we don't have official support for Android in the continuous-integration or releases, but at least we know it's not outside the realm of possibility.

Sleep

While the 32Blit doesn't really have a real sleep mode yet, it pretends to be off if left idle by dimming the screen. Some miscellaneous changes have improved this behaviour and given better idle battery life.

Additionally the system will really sleep between updates, albeit in practise the continuous audio interrupt makes a mockery of this.

Tiled/TMX Tweaks

Loading a TMX-style map from a Tiled asset is less breaky and flags have been added to denote 16-bit data and indicate if transform data is included. You will need to update the 32Blit Tools for your map data to build/load correcty.

All The Changes

Find the complete list of changes here: v0.1.12...v0.1.13

v0.1.12 RC3

25 Mar 18:07
250f6ae
Compare
Choose a tag to compare

RC3PO

How many release candidates does it take to make a final version?

This release includes yet more fixes and improvements, notably @Daft-Freak and @ali1234 have shaken up multiplayer support. This includes improvements to the SDL multiplayer that make it easier to develop multiplayer games without needing two 32blits handy.

Operating On Operators

@santtu has swept in and added some more comparison operators for Point and Rect. These are slowly making their way across the API and are super useful for simplifying your game code. In a similar vein you can also easily convert a Point to a Vec2 thanks to @Daft-Freak.

No More Sudden Loud Sounds

32blit has gained something of a reputation for demos that explode with loud sounds out of the blue, I've quelched this from audio-test now, making it quieter and slightly better. My composition skills still leave much to be desired though, ha!

Launcher Swooshes

Launcher swooshes now no longer render behind the credits screen or the screenshot browser, getting frame times to a more reasonable level. You'll probably never notice the difference!

Launcher swooshes have been modified, dropping the scanlines and optimising the draw to use h_span and draw in N-pixel chunks. They now - hopefully - look more intentional and less like a display glitch.

The launcher now has a frame-time meter you can toggle on in the credits screen by pressing "Y" (the left button). This helped identify where the frame time needed some tweaking and should help keep us more cognizant of frame times in the launcher... which is, after all, a critical feature of 32blit!

Optimisations

@Daft-Freak's attempt to make a game (a cool Mode7 cart racer) keeps pivoting to API improvements, optimisations and fixes.

Notably TileMap has seen some performance tweaks which you can read more about here: #626

Solid fills/blends are also optimised and TileMap can skip the "empty" tile.

Scaled sprite and surface blits have been sped up, too, by blending multiple batches of horizontal pixels.

What's The Time, Mr Wolf?

The microsecond timer has now been exposed with a now_us API function, there's also a handy us_diff for getting the difference between two times. For example, getting the elapsed time in microseconds since a previous time:

uint32_t elapsed = us_diff(start_time, now_us());

us_diff will attempt to handle overflows and give you a valid time difference.

On device now_us uses DWT->CYCCNT and should be good for measuring times up to ~8.94 seconds with microsecond accuracy.

MP3 Improvements

@Daft-Freak has made some just-in-time MP3 improvements for @ThePythonator to add sound to Super Square Bros. This includes a reduced buffer size to be more memory friendly, tweaks to avoid allocating unecessary buffers and bugfixes to fix the bugs these changes inevitably revealed.

Installing Blits

The .blit file install process has been tweaked slightly to avoid constant restarts of the running application. Games will now flash "in the background" regardless of what application is running, and resetting to the flashed application is optional.

SDL --help

SDL builds now have a --help and a --credits argument. These will print command line help information, and the full list of user credits in turn.

--help gives better visibility to sekret super SDL multiplayer debug features:

./examples/scrolly-tile/scrolly-tile --help
Rainbow Ascent v1.1.0
Powered by 32Blit SDL2 runtime - github.com/32blit/32blit-sdk

Usage: ./examples/scrolly-tile/scrolly-tile <options>

 --connect <addr> -- Connect to a listening game instance.
 --listen         -- Listen for incoming connections.
 --position x,y   -- Set window position.
 --credits        -- Print contributor credits and exit.
 --info           -- Print metadata info and exit.

There's also an --info command that will print the game metadata, eg:

./examples/scrolly-tile/scrolly-tile --info
Rainbow Ascent v1.1.0
Powered by 32Blit SDL2 runtime - github.com/32blit/32blit-sdk

The Dark Souls of procedurally generated vertical jumping puzzles. Good luck.

 Category: game
 Author:   pimoroni
 URL:      https://github.com/32blit/32blit-sdk

Misc Fixes & Tweaks

  • Z invert bug fixed on Vec3::transform
  • More constexpr and const
  • Less uint8_t to avoid conversions
  • Metadata with quotes is less explodey
  • SDL video recording (yes, it exists!) now saves with an .mp4 extension
  • @ahnlak has cleaned up TileMap::offset to avoid a redundant duplication

As is the custom, find a complete list of changes here: v0.1.11...v0.1.12