Skip to content
View emadb's full-sized avatar
⌨️
coding
⌨️
coding

Organizations

@CodicePlastico

Block or report emadb

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
emadb/README.md
00000000  65 6d 61 64 62 20 3a 3a  20 73 6f 66 74 77 61 72  |emadb :: softwar|
00000010  65 20 65 6e 67 69 6e 65  65 72 0a 00 c0 ff ee 00  |e engineer......|
00000020  72 75 73 74 c3 1f 80 80  85 80 0a de ad be ef 00  |rust............|
███████╗███╗   ███╗ █████╗ ██████╗ ██████╗ 
██╔════╝████╗ ████║██╔══██╗██╔══██╗██╔══██╗
█████╗  ██╔████╔██║███████║██║  ██║██████╔╝
██╔══╝  ██║╚██╔╝██║██╔══██║██║  ██║██╔══██╗
███████╗██║ ╚═╝ ██║██║  ██║██████╔╝██████╔╝
╚══════╝╚═╝     ╚═╝╚═╝  ╚═╝╚═════╝ ╚═════╝ 

; 01010010 01010101 01010011 01010100 — 4 bytes, big-endian, you figure it out

cryptic marquee

Website Bluesky Blog

👾 01000101 👾 01001101 🛸 01000001 👾 01000100 👾 01000010 👾


SPRITE_ROM[0x00] // invader.squid — 8×8, the only sprite that matters

   ██        db $18    0b00011000
  ████       db $3C    0b00111100
 ██████      db $7E    0b01111110     ; this is me, stored in 8 bytes
██ ██ ██     db $DB    0b11011011     ; defended earth since 1973
████████     db $FF    0b11111111
 █ ██ █      db $5A    0b01011010
█      █     db $81    0b10000001
 █    █      db $42    0b01000010

0x0000 RESET_VECTOR — cold boot

#![no_std]
#![allow(human::needs_coffee)]

/// A low-level engineer. Emulates dead CPUs for fun, ships weird web apps for a living.
pub struct Emadb;

impl Machine for Emadb {
    const ROLE:     &str = "software engineer · co-founder @ CodicePlastico";
    const BASE:     &str = "Brescia, IT — 45.5416°N, 10.2118°E";
    const WEAPON:   &str = "Rust 🦀";                 // zero-cost, fearless, no GC
    const TARGETS:  &[&str] = &["Game Boy", "i8080", "Chip-8"];
    const HERESY:   &str = "Rust → wasm32 → cursed little web apps";
    const SHIELDS:  &[&str] = &["DDD", "event sourcing", "TDD", "good design"];

    fn main(&self) -> ! {
        loop { self.emulate(); self.refactor(); self.ship(); }   // -> never returns
    }
}

.text:0000 — the main loop, disassembled

ADDR   BYTES       LABEL    MNEMONIC              ; comment
────   ─────────   ──────   ──────────────────   ─────────────────────────
0000   F3          reset:   DI                    ; mask interrupts, find focus
0001   31 FF FF             LXI  SP,$FFFF         ; stack = top of the coffee mug
0004   CD 40 00             CALL wake_up
0007   DB 01       .loop:   IN   curiosity        ; poll the only input that matters
0009   CD 80 00             CALL emulate_cpu      ; gameboy / i8080 / chip-8
000C   CD C0 00             CALL refactor         ; design is never *done*
000F   3E 01                MVI  A,1              ; A = 1up
0011   C3 07 00             JMP  .loop            ; 0xC3 — goto, considered essential
0014   76          halt:    HLT                   ; (unreachable; we never stop)

SYMBOL TABLE — linked at runtime

SYMBOL                  ADDR     .section   ROM
─────────────────────   ──────   ────────   ──────────────────────────────────
gameboy                 $0000    .text      Game Boy (DMG) emulator — CPU·PPU·timers
space_invade.rs         $2000    .text      i8080 + Space Invaders   ; ◄ %rip is here
chip-8                  $4000    .text      Chip-8 interpreter — the first boss
snakers                 $6000    .game      Snake, in Rust
gol-rs                  $7000    .game      Conway's Game of Life
reners                  $8000    .util      mass file renamer
lorx-display            $E000    .device    ESP32 + e-ink — real silicon 🛸
meryclaire              $F000    .elixir    static blog generator
ruby_loves_ddd          $F400    .ruby      DDD sample app
the_little_alchemist    $F800    .elixir    "The Little Schemer", functionally

REGISTER DUMP @ panic — current state of the machine

A   0x52   0101 0010    ; 'R' — accumulator pinned to Rust
B   0xBE   1011 1110    ; the BEAM, still warm
C   0xC0   1100 0000    ; Clean Code
D   0xDD   1101 1101    ; Domain-Driven Design
PC  0x1337              ; program counter -> /emulators
SP  0xFFFF              ; stack: maxed (side projects overflowing)
F   ----   S Z A P C    ; flags: [S]leep-deprived [Z]en [C]affeinated

thread 'main' panicked — expand backtrace
thread 'main' panicked at 'too many side projects', src/life.rs:42:1
stack backtrace:
   0:  emadb::just_one_more_emulator
   1:  core::result::Result::<Coffee>::unwrap
   2:  emadb::refactor::{{closure}}        // "it's almost good enough"
   3:  emadb::defend_earth
   4:  <Curiosity as Iterator>::next
   5:  emadb::main::loop                   // 0x1337
note: run with `RUST_BACKTRACE=full` for a more verbose ego
note: process did not exit. it never does.

Top Languages

// TRANSMISSION ENDS
01100111 01101111 01101111 01100100 00100000 01100011 01101111 01100100 01100101
EOF — checksum 0xDEADBEEF — <invaders still descending>
hits

Pinned Loading

  1. meryclaire meryclaire Public

    A static blog generator written in Elixir

    Elixir 1

  2. the_little_alchemist the_little_alchemist Public

    The exercises of The Little Schemer written in Elixir

    Elixir 4

  3. ruby_loves_ddd ruby_loves_ddd Public

    A sample application to get practice with ruby and Domain Driven Design

    Ruby 34 9

  4. bowling_kata bowling_kata Public

    The Bowling Game Kata implemented in Elixir using only pattern matching and recursion

    Elixir