Lofi graphics bitstream

#projects


so, software engineering challenge:


300 / 6 = 50 6-bit.symbols per second.

300 / 5 = 60 5-bit symbols per second.


2400 / 8 = 300 bytes per second

300 / 60 = 5 bytes per frame

300 / 50 = 6 bytes per frame

300 / 30 = 10 bytes per frame

300 / 25 = 12 bytes per frame

300 / 24 = 12.5 bytes per frame

300 / 15 = 20 bytes per frame

300 / 12 = 25 bytes per frame


but some is lost on error correction codes so effective rates are 72.29% of those.




idea 1: stack based language where stack serves as buffer, and each symbol its a command in the stack., with “push this symbol onto the stack” being the usual meaning, with a few commands reserved for doing side effects to the effect of “pop from stack”.


can we start with something like postscript and wittle it down?


so, each of the 64 symbols can represent a command with either a known number of parameters, or the number of expected parameters as the first argument.


Suppose I have a virtual machine that has a canvas that is 512x512 pixels, 4 bits per pixel. Much of this is used as scratch, typically divided into four areas. (or, perhaps, 256x1024


pattern buffer

map buffer, draw state buffer

scratch buffer

screen buffer



stealing from pico 8


draw state:

name changed by

Pen color, color()

background color, bgcolor()

camera position, camera()

print cursor position, cursor() or print()

clipping region, clip()

palette, pal(), palt()

fill pattern, fillp()

adding:

screen pointer

screen cursor

map pointer

map cursor/print cursor

pattern pointer

pattern cursor

command stack pointer

palette stack/cursor


pico state keeps this in an addressable memory region for easy save/restore. (zero page?)




  1. request buffer width, height, depth cls()
  2. request view width, height, depth [camera([x,] [y])]
  3. cursor(x, y)
  4. [clip([x,] [y,] [w,] [h])](https://pico-8.fandom.com/wiki/Clip)
  5. push pattern pattern.
  6. fillp([pat])
  7. color(col)
  8. draw pattern i with xor at coordinates x,y [print(str, [x,] [y,] [col])](https://pico-8.fandom.com/wiki/Print)
  9. draw pattern over at coordinate, pattern chars [print(str, [x,] [y,] [col])](https://pico-8.fandom.com/wiki/Print) [spr(n, x, y, [w,] [h,] [flip_x,] [flip_y])](https://pico-8.fandom.com/wiki/Spr) [sspr(sx, sy, sw, sh, dx, dy, [dw,] [dh,] [flip_x,] [flip_y])](https://pico-8.fandom.com/wiki/Sspr)
  10. fillRect (pattern i) [rect(x0, y0, x1, y1, [col])](https://pico-8.fandom.com/wiki/Rect)
  11. copyRect, drawmap
  12. [circ(x, y, r, [col])](https://pico-8.fandom.com/wiki/Circ)
  13. [circfill(x, y, r, [col])](https://pico-8.fandom.com/wiki/Circfill)
  14. set palette, [pal([c0,] [c1,] [p])](https://pico-8.fandom.com/wiki/Pal)
  15. draw line
  16. clear screen
  17. pset pixel set [pset(x, y, [c])](https://pico-8.fandom.com/wiki/Pset)
  18. mset map set
  19. move cursor
  20. line( [x0,] [y0,] [x1,] [y1,] [color] )
  21. tline( x0, y0, x1, y1, mx, my, [mdx,] [mdy] ) textured line from map
  22. [fset(n, [f,] [v])](https://pico-8.fandom.com/wiki/Fset)
  23. [sset(x, y, [c])](https://pico-8.fandom.com/wiki/Sset)
  24. push
  25. pop
  26. npush
  27. npop
  28. stroke path
  29. fillpath
  30. showframe
  31. skip frame
  32. define pure function of time, random, scroll.
  33. undefine function
  34. fill line
  35. inc/dec palette index
  36. push palette
  37. pop palette
  38. .





The NES[49] uses a custom-made Picture Processing Unit (PPU) developed by Ricoh . All variations of the PPU feature 2  kB of video RAM, 256 bytes of on-die “object attribute memory” (OAM) to store the positions, colors, and tile indices of up to 64 [sprites](https://en.wikipedia.org/wiki/Sprite_(computer_graphics)) on the screen, and 28 bytes of on-die palette RAM to allow selection of background and sprite colors. The console’s 2 kB of onboard RAM may be used for tile maps and attributes on the NES board and 8 kB of tile pattern ROM or RAM may be included on a cartridge.


GitHub - dpt/MotionMasks: Investigating using RLE-compressed masks for animation





steps for adding images to cycling image stack progressively.



addImage

make new paletteSet

make new imageIndexes

make new colorLUT

for each x,y in new image


  1. look up index for x,y in old imageIndexes
  2. look index up in oldPalette for oldColor
  3. add color to end of oldColor to make newColor
  4. add newColor to newPaletteSet
  5. add newColor to colorLUT- returns index from instances of newColor Value
  6. get index from colorLUT
  7. record newIndex in newImageIndexes
  8. convert paletteSet to sortablePalette
  9. return new sortablePalette,newImageIndexes,


motion vector algorithm between two pairs of images

  1. for each 8x8 pixel block
    1. for each offset against previous image
      1. try offsets of neighbouring blocks first
      2. build shared palette between this 8x8 block and 8x8 block in previous frame (palette of “cycles”)
      3. count unique indexes in shared palette
    2. optimise all offsets to minimise unique colors, difference from neighbouring offsets, distance from starting point.
    3. store offsets
    4. store xor of difference, if there is a difference.
    5. also store the palette for the new block, against the shared indexes? yes. because those are what we’re generating with xoring the diff.
    6. .







Retro Game Fantasy Computer Framework - GameCreators Forum

Idea for cell-shaded FMV on the NES - nesdev.com