Skip to content

Lileco: ColecoVision emulator for Lilka#45

Open
alder wants to merge 7 commits intomainfrom
lileco
Open

Lileco: ColecoVision emulator for Lilka#45
alder wants to merge 7 commits intomainfrom
lileco

Conversation

@alder
Copy link
Contributor

@alder alder commented Nov 19, 2025

image

ColecoVision – is a second-generation home video-game console developed by Coleco and launched in North America in August 1982. [Wikipedia]

Lileco – is a basic port of ColecoVision emulator from espMCUME project by Jean-Marc Harvengt.

Works fine:

  1. ROM loading (files should have extension .col)
  2. Rendering.
  3. Gameplay.
  4. Basic controller support.
  5. Sound output.
  6. Inufuto’s free ColecoVision homebrew pack is added to the SD card.

Known limitations/issues:

  1. Only 4 keys from keypad is supported – 1, 2, # and *.
  2. Some games may not work properly (black screen is displayed after the splash screen)

Important:

  1. For the emulator to work correctly, ColecoVision BIOS is required. File should have name coleco.rom and should be placed in sdcard/coleco folder. You can dump BIOS from real system or find it somewhere in Internet (e.g. by searching "Compilation of BIOSes for various emulation platforms").
  2. Press Select + A to check the Lileco help.
screenshot_19700101_000050

Tested games:

Pacman, Frogger, Donkey Kong, Burger Time, Boulder Dash
screenshot_19700101_000418 screenshot_19700101_000330
screenshot_19700101_000312 screenshot_19700101_000247
screenshot_19700101_000136

@alder alder requested a review from frostmorn November 19, 2025 23:31
memset(channelPhases, 0, sizeof(channelPhases));

running = true;
BaseType_t res = xTaskCreatePinnedToCore(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also would be good to place task handle somewhere as a class field, so u can stop tasks u not need anymore from destructor, something similar in modplayer u've can cause a bug

memset(RAM,NORAM,RAMSIZE);
memset(VRAM,NORAM,VRAMSIZE);

if(Verbose) emu_printf("OK\nLoading ROMs:\nOpening COLECO.ROM...");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be always ok even if bios not present or have not expected name

void ColecoCore::presentFrame() {
if (!app || !app->canvas) return;

app->canvas->draw16bitRGBBitmap(frameOffsetX, frameOffsetY, frameBuffer.data(), SCREEN_WIDTH, SCREEN_HEIGHT);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be slow, maybe consider using canvas->getFramebuffer() and direct memcpy into it, in nes it gave + 10 FPS

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, fps meter would be good to add for further performance meassurements. actually this pixel rendering part is most heaviest by time


void emu_printf(char* text) {
if (!text) return;
lilka::serial.log("%s", text);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually no need, sdk supports default printf() perror() etc, so I guess we can remove a half of it :)


void emu_DrawLine(unsigned char* VBuf, int width, int, int line) {
auto* core = ColecoCore::getActive();
if (core) core->drawLine(VBuf, width, line);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call -> call -> call -> call ->call -> draw a pixel. slow :)
less calls in a chain better

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving a pixel can be one instruction on assembly, but with calls u've a lots of stuff like local stack init, path params through register/stack, it's way longer become

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theoretically compiler have to optimize it yup, in fact it works more for c only code and much less with c++, cause at least u've to pass this, right? :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, would be good to make it in a way
do cpu emulation ticks launching all that emu logic -> process input -> prepare frame(all at once) -> efficiently copy all result(I guess this is just same 16 bit bitmap so) to our canvas framebuffer -> signal through queueDraw to appmanager

@alder alder added the wip label Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants