←back to thread

221 points benbridle | 1 comments | | HN request time: 0s | source

Hey everyone, this is my latest project.

Bedrock is a lightweight program runtime: programs assemble down to a few kilobytes of bytecode that can run on any computer, console, or handheld. The runtime is tiny, it can be implemented from scratch in a few hours, and the I/O devices for accessing the keyboard, screen, networking, etc. can be added on as needed.

I designed Bedrock to make it easier to maintain programs as a solo developer. It's deeply inspired by Uxn and PICO-8, but it makes significant departures from Uxn to provide more capabilities to programs and to be easier to implement.

Let me know if you try it out or have any questions.

Show context
kosmavision ◴[] No.44566466[source]
For people curious about the differences between this and Uxn (as I was): https://benbridle.com/articles/bedrock-differences-from-uxn....
replies(1): >>44568935 #
tromp ◴[] No.44568935[source]
> each pixel having both a foreground and a background colour

how does that work?

replies(2): >>44569074 #>>44576757 #
pjc50 ◴[] No.44569074[source]
I thought this might be like the ZX spectrum, but that covers each 8x8 block with a foreground and background colour; "sprites" are then bitmaps over that. This does say two colours per pixel, which is confusing.
replies(1): >>44570170 #
Luc ◴[] No.44570170[source]
Here's the docs for the screen device: https://benbridle.com/projects/bedrock/user-manual/screen-de...

You set up a palette of 16 colours, then write 0-15 to the coordinates where you want to set a pixel, but you can also choose between an overlapping foreground and background layer (colour 0 on the foreground layer is transparent).

I guess it's no more weird than some hardware designs from the 80's...

replies(1): >>44571321 #
1. Lerc ◴[] No.44571321[source]
I made a fantasy console with 3x3 pixel cells defined in 16 bits to do any two of 16 colours in the cell

    4 bits : color A
    4 bits : color B
    8 bits : select A or B for the first 8 pixels of the cell
The last Pixel is always color A. You can independently change all pixels in the cell because changing the last pixel on its own can be done by swapping A and B and inverting the second byte.

In hindsight I don't think there was much advantage to the last bit being the odd one out. The code for setting individual pixels in a cell was pretty custom anyway. If I were to do it again, I'd place the color A pixel in the center.

And I do find myself working on a memory constrained device again, so perhaps I'll be giving it a go.