critterandguitari / Organelle_OS

Other
57 stars 24 forks source link

SDL hardware target #45

Closed konsumer closed 1 year ago

konsumer commented 1 year ago

This adds a new make sdlpi target that will compile an SDL hardware description that shows SDL OLED and can be navigated with keys or joystick.

The main purpose is targeting hardware like this cool gameboy thing or a pi with a LCD screen (that already has drivers) using regular OS stuff. It's also great for dev, on a desktop computer.

I am using SDL_RenderSetLogicalSize to ensure that it always renders 128x64, but the window-size can be set to anything, so I scale up to 800x600 on desktop (to make it easier to read.) ORGANELLE_HW_WIDTH and ORGANELLE_HW_HEIGHT defines are used to make it easy to compile for different resolutions. This can be really important on some handhelds that won't render if the window is larger than the physical screen.

This is me navigating menu with keys on my Intel mac laptop:

449cc725750e937051f26a64464abdb5c6dca52b

There are a couple unrelated things I can remove, but they might be useful, too:

See #43

owenosborn commented 1 year ago

This looks cool, will be fun to have it running with SDL

konsumer commented 1 year ago

I think a better target-name might be sdl instead of sdlpi because it's not pi-specific. We could add some pi-specific stuff to another target though, maybe, like hardware-accelerated rotary-encoders & i2c OLED. I am thinking maybe I can setup a mix&match UI thing, so you can combine them (like SDL screen + plain pi GPIO rotaries or pi i2c OLED + pi i2c rotaries.) The hardware I want to test against next is a pi with a pisound, which has limited GPIO left, but it does have standard i2c pins free.

I can also add some documentation about the different hardware targets, and setup github to auto-build them for releases.

I started work on this in this branch