Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: Add GFX: device and some basic ioctls. #112

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

thejpster
Copy link
Member

@thejpster thejpster commented Dec 26, 2024

Supports drawing a single pixel, and clearing the whole screen.

TODO:

  • Move the ioctl definition into the neotron_api crate (or copy them into the neotron_sdk crate and just live with them being defined twice).
    • I'm unsure if I want to bump the API crate just because I've added an ioctl. If I have to do that I might as well add bespoke functions for each operation and not abstract them behind the ioctl API.
  • Add a utility which uses the API, rather than built-in commands.
    • Might want to have a flag for 'baking in' application code as a library rather than loading it into the TPA for execution, as you can't execute code from the TPA on Windows/macOS/Linux due to the NX bit.
  • Add line drawing ioctl
  • Add palette changing ioctl
  • Add region ioctl
  • Support writing to GFX:
  • Support reading from GFX:
  • Write a bitmap display utility

@thejpster
Copy link
Member Author

I put the ioctls in the SDK crate. See Neotron-Compute/Neotron-SDK#17.

@thejpster thejpster force-pushed the add-graphics-device branch 2 times, most recently from f701f70 to d8b5c72 Compare December 27, 2024 23:09
@thejpster
Copy link
Member Author

I cheated on the bitmap display utility, because I bake the raw bitmap into the binary and just send a pointer to it to the GFX: set_framebuffer ioctl. But, I don't have enough RAM to load the .bmp file and host a framebuffer, and the tinybmp crate doesn't support reading from a filesystem - the data has to be in RAM as a slice.

I might need to write a new bitmap parser that doesn't have that issue.

@thejpster
Copy link
Member Author

Or, I need a mechanism to obtain a byte-slice for a thing that's in ROMFS.

Requires new neotron-sdk.

Running an application now also caches and restores the current video mode (incase the app leaves it in a mess), which is done through the VGACONSOLE object so you can't write text to a framebuffer and ruin it.
Only supports a single colour.
Now it fits on one screen.
@thejpster
Copy link
Member Author

Rebased on develop. Updated the mode command to be less verbose now the Neotron Pico BIOS has a lot more video modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant