Тёмный

Sprite library for the SSD1306 OLED in Hopper 

Hopper Development Environment
Подписаться 495
Просмотров 209
50% 1

Simple sprite engine for 4x4 pixel sprites on an SSD1306 OLED without using a screen buffer:
- minimal memory usage for the game scene
- quick updating of the screen (only draw the sprite that has changed/moved)
Prototyped on a Raspberry Pi Pico style microcontroller. Also runs on the 6502.
The code:
gist.github.com/sillycowvalle...
Hopper Releases on GitHub:
github.com/sillycowvalley/Hop...

Опубликовано:

 

10 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@Rich-can-do
@Rich-can-do 2 месяца назад
Very interesting. I am writing 6502 asm and I am translating some code. I am a neat freak and like things is the right places. I like my vars. EQUs at the started. I like my data at the end. I am using the as65 assembler and cl65 linker. I really like the idea and see what you can do with one of these displays. I am using Ben Eaters design. This gives me 16k or RAM *HUGE RAM* compared to 128 bytes. I am on a Linux machine. I want nothing to do with Billy's software. I have lots of breadboards and atmega328ps to play with, maybe its possible to set it up in my mintlinux?
@instatemp
@instatemp 2 месяца назад
I am working on a game using esp32 and oled display module, are you interested
@biggertigger
@biggertigger 2 месяца назад
Sounds interesting. In C, I assume? I'd love to port it to Hopper as a demo on the RP2040 when you are ready with it. Here's an invite to the Hopper Discord server if you want to discuss: discord.gg/xbskyHGG
@instatemp
@instatemp Месяц назад
@biggertigger getting an error saying the link is invalid
@biggertigger
@biggertigger Месяц назад
@@instatemp They expire after a while. Here's a fresh one: discord.gg/D5qf4fHr
@Rich-can-do
@Rich-can-do 2 месяца назад
It looks like the screen is in graphics mode?
@biggertigger
@biggertigger 2 месяца назад
The SSD1306 OLED is essentially a matrix of monochrome pixels (it only has 'graphics mode'). My sprite engine works in 4x4 pixel cells because it is designed to minimize memory use on the CPU side : to have a memory map of the entire matrix of pixels would take 1K. The 65uino only has 128 bytes total. I keep track of my sprites rather than the entire display to make this possible. When running on my 6502 SBC we have 32K of RAM available so this is a non-issue (and the Hopper library keeps a 1K buffer for this screen and supports graphics and text APIs similar to the AdaFruit APIs for MCUs, but on the 6502).