302 WISH

302 : WISH

Design render

How it works

Dragonochi is a dragon-themed tamagotchi rendered live to a VGA monitor: a virtual hatchling you feed, water, put to sleep and play with until it evolves into an adult dragon.

Two mechanics drive it. The first judges you as an owner, and the rule is moderation — the dragon wants variety, not more. Four different actions in a row and it cheers up, and gains a heart if it was already content. Six actions with one of the four missing and it protests, then starts losing hearts. No dragon wants to eat the same thing forever.

The second is the play button: a treasure chest gamble. Open chests to grow a pot of coins, cash out before you hit a bomb, and spend what you keep on evolutions. Pick wrong and you lose the pot, or a heart with it.

Run out of hearts and it is game over; pay for the final evolution and you win.

Home screen

Block Diagram

One clock, two rates

There is no framebuffer and no RAM. Every pixel is recomputed from the game state as the beam passes over it at the 25.175 MHz pixel clock.

The game side only needs to change once per frame, so every game register is gated on frame_tick. Sampling the buttons at that rate is the debounce. "One press equals one action" works with an edge detector and every animation length is written in frames instead of clock cycles.

The blocks.

buttons.v synchronises ui_in through two flops and turns each rising edge into a single one-frame pulse, so holding a button down still counts once.

home.v is the mode machine. You start at TITLE, any button takes you to EGG where the egg hatches so you eventually get into HOME. From there PLAY opens the chest room, an empty heart bar goes to GAME OVER, and the last evolution goes to YOU WIN; both end screens return you to TITLE. home.v also decides which button wins: inside HOME the buttons are only read while no effect animation is playing, and the checks are a priority chain, so three buttons in the same frame still produce one action. The animation is its own lockout, which is why spamming does nothing.

balance.v keeps a short history of your last actions and applies the variety rule described above. It only requests changes, dragon_state.v applies them.

dragon_state.v is the only module that writes hearts (0-5), satisfaction (0-4), coins (0-999) or level (1-7). Keeping all four in one file means simultaneous requests are handled accordingly.

chest_game.v deals three chests, shuffled by dual_lfsr.v (two 16-bit LFSRs, the second clocked only when bit 0 of the first is set, so the result does not track the frame counter). A chest holds coins, a doubler, a bomb, or a cursed prize that pays out and costs a heart. Rewards run 40, 60, 100, 160, and from round 4 on there is nothing left but doublers and bombs.

anim.v owns everything time-dependent about the picture: the idle bob, day and night, the feed and drink timers, and the evolve sequence. Satisfaction sets the bob speed.

Two details in there were worth the extra state. A feed or drink request waits in a pending register until the bob is back on the ground, then freezes it for the duration, so the feed or drink animation does not get disrupted.

Evolving

Step 1→2 2→3 3→4 4→5 5→6 6→7 win
Coins 90 220 180 250 340 400 999

The dragon hatches at level 1 and there are three different evolutions, not seven: levels 1–2, 3–6 and 7 each draw a different dragon. The two steps that actually transform the dragon are priced more — you are paying for the new evolution, not just the number. The two transformations also refill the hearts, so it doubles as a rescue.

Reaching level 7 is not the end. Winning costs one more evolution, and it is priced at 999.

VGA

The screen is on its side. The VGA raster is the usual 640 × 480 landscape, but the game is drawn in portrait: px = pix_y and py = 639 - pix_x, so every drawable thinks in a 480 wide by 640 tall screen and the monitor is physically rotated 90°.

Each drawable is a small module that gets local coordinates and answers two things: is this pixel mine, and which colour code. renderer.v does the rest in four steps — place (subtract each drawable's origin, so moving something on screen is a one-line edit), show (which drawables this mode uses), stack (a priority cascade, first visible layer wins) and colour (code to 6-bit RGB, two bits per channel).

The stack differs per mode:

  • title and egg — flash, title, crack, egg, "press any button", ground, sky
  • home — hearts, level, coins, satisfaction bar, buttons, dragon, background
  • chest — hearts, menu, chest body, icon, lid, background

Where two things use the same table and can never both claim a pixel, there is one lookup with mixed inputs instead of two copies. The dragon and the title egg share a palette because their modes exclude each other; the chest body and lid share theirs because the stack always picks one; and a single digit_rom draws the round number, the pot, the coin counter and the level.

The dragon gets a second palette for night instead of a brightness trick, so the outline stays black while the belly still lifts, and the unpicked chests dim by dropping the low bit of each channel.

How to test

In simulation. Every module has its own cocotb test in test/, and make test_core runs them all in about three minutes. test.py is what the Tiny Tapeout CI runs on the full chip: sync timing, black blanking, one frame_tick per frame, and a button press taking the chip from the title to the egg.

The three state machines — home, dragon_state, anim — are checked against Python models of the same logic, including reset at every awkward moment, simultaneous requests in one frame, held and spammed buttons, and 3000 frames of random input. test_renderer puts game states directly on the renderer and reads the screen back: layer order, what each mode may and may not show, heart and bar colours, and the numbers on screen decoded through the font. test_hvsync pins the VGA timing to the clock.

The sprites themselves are checked by eye: the benches in test/visual/ write frames as PPM and ppm2gif.py turns them into a GIF.

On hardware. Plug the TinyVGA PMOD into the output PMOD, connect a monitor, put 8 buttons on ui_in, set the clock to 25.175 MHz and reset. You should get the title screen.

Button map

Then: press anything to hatch the egg. Try feed, drink and sleep, and notice that input is ignored until each animation finishes. Alternate all four actions and the satisfaction bar climbs and the dragon bobs faster; repeat one action six times instead and the bar drops and hearts start going. Open a few chests, cash out, and spend the coins on an evolution.

External hardware

  • TinyVGA PMOD on the output PMOD, and a VGA monitor. The monitor has to be rotated 90° — the game is drawn in portrait.
  • 8 push buttons on ui_in. They are synchronised and edge-detected on-chip, so no external debouncing is needed.

The eight bidirectional pins carry the game state out: the current mode, the chest-room state, whether an action was accepted, whether an evolution is affordable, and whether a stat is at its cap. The design has no audio itself — a microcontroller that already sits between the buttons and ui_in can read these and play matching sounds, so the sound design can change without a new tapeout.

ui_in Home Chest room
1 evolve select up
3 select down
4 feed
5 drink
6 sleep open chest / continue
7 play cash out and leave

Bits 0 and 2 are unused.

IO

#InputOutputBidirectional
0R1mode[0]
1up/evolveG1mode[1]
2B1mode[2]
3downvsyncchest_state[0]
4feedR0chest_state[1]
5drinkG0fx_on
6select/sleepB0evolve_now
7back/playhsyncoverflow

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_teuscher_eml_fabric (EML Fabric — analog exp/ln compute cells) tt_um_wokwi_465656663515438081 (Convert binary to hex on 7 segments) tt_um_nikita_face_detect (FPGA Face Detection) tt_um_obstacle_avoider (Obstacle Avoider State Machine) tt_um_poket_animal (Poket Animal) tt_um_drewbabel_uart (Configurable FIFO-buffered UART with APB CSR) tt_um_wokwi_469163916296039425 (TT Workshop Test) tt_um_jonahsaunders_slsvga (tt_um_jonahsaunders_slsvga) tt_um_fatigue_monitor (Fatigue Monitor (PPG Pulse-Interval Variability)) tt_um_vedam_dual_port_ram (Dual Port RAM) tt_um_wokwi_469739097665887233 (Tiny Tapeout Template Copy) tt_um_spdif_to_i2s_kilpelaj (S/PDIF to I2S receiver) tt_um_morse_converter (ASCII to Morse Code Converter) tt_um_wokwi_469806914724000769 (Spin, Text and VGA) tt_um_wokwi_469701770572338177 (TinyTapeout) tt_um_garnetkoebel_communotron (Communotron) tt_um_wokwi_469449970323169281 (full adder) tt_um_duzabf_2026_ow (A WIP Online Workshop 2026 project) tt_um_wokwi_469807513638180865 (Tiny Tapeout NAK) tt_um_ttsky26c_oguz (ttsky26c-202607-mehmetoguzderin by Oguz) tt_um_kashif_fp4_sparse_tpu (FP4 Sparse Mini-TPU) tt_um_moein_maleki_arm16 (arm16) tt_um_wokwi_469453454643027969 (ON Check System) tt_um_felixcheng_neural_core (Neural Compute Core (V0.15)) tt_um_wokwi_469788774011248641 (Spin Display - select-reset-reverse) tt_um_wokwi_469449443070765057 (Samuel's first chip) tt_um_wokwi_469449007236383745 (testinttrsv01) tt_um_vga_ca (VGA cellular Automaton) tt_um_dosci_500hz (Digital Oscillator 500 Hz) tt_um_wokwi_469747443569078273 (XOR test project - Tiny Tapeout workshop) tt_um_wokwi_469585758593419265 (spinner) tt_um_fp16_mac (FP32 Math Unit) tt_um_1DC_vga_dyoa (VGA Design Your Own ASIC) tt_um_haydenevans_top (Systolic Processing Element) tt_um_wokwi_469806252715961345 (TT_Proj_SA) tt_um_wokwi_469448996577604609 (Tiny Tapeout - Reto) tt_um_ehofmannbr_pmodvga_06 (VGA Color Tiles) tt_um_lfglabs_lsc1u (leanSilicon LSC-1 Micro arithmetic kernel) tt_um_wokwi_469804280240495617 (Zetterling SRAM) tt_um_wokwi_469806066852696065 (TileTestchase) tt_um_wokwi_469449118072978433 (binary_add_v1) tt_um_voltage_amplifier_neuron (Voltage Amplfier Neuron) tt_um_wokwi_469449686545956865 (Tiny Tapeout Template Copy_JinoShiono) tt_um_wokwi_469448887171240961 (Tiny Tapeout - Mini CORDIC) tt_um_wokwi_469809033878555649 (Tiny Tapeout Yummy Chip - bgianfo) tt_um_sirajmuhammad_bpsk_mod (BPSK Baseband Modulator) tt_um_K_coder_9 (TENs device frequency controller) tt_um_wokwi_469758119198926849 (LL_6BitShiftRegister_ToggleEnabledFeedback) tt_um_Asaadkhex_6x6u (6x6 UART Bussbar Switch) tt_um_wokwi_469809198944364545 (tt8-8bit-cpu Copy) tt_um_wokwi_469710279607305217 (Tiny Tapeout Submission KL - SiliDize) tt_um_wokwi_469629799092815873 (2:1 Mux with differential outputs) tt_um_poundbrad_reciprocal_counter (Two-Channel Reciprocal Counter) tt_um_joonatanalanampa_cordic (CORDIC-1) tt_um_x4ntha_nova (Data General Nova 1200 CPU) tt_um_quick_bus (quick_bus) tt_um_wokwi_470058539448408065 (Nigel's Tiny Tapeout Project) tt_um_wokwi_470058244557293569 (Tiny Tapeout Kabisan) tt_um_wokwi_470058241869790209 (Abdi's desgin) tt_um_wokwi_470060107756808193 (Sukhraj Deol's Chip) tt_um_wokwi_470058578588614657 (The Chip of Master George Stead) tt_um_wokwi_470069286344622081 (Tiny Tapeout ISHA) tt_um_ucl_display (Flashing... lights) tt_um_wokwi_470058746279043073 (Arihant's first Wokwi design) tt_um_wokwi_470060103260512257 (Tiny Tapeout Jabriel Copy) tt_um_wokwi_470069460157662209 (haadi's tiny tapeout) tt_um_wokwi_470058418706939905 (Kitty) tt_um_wokwi_470058490118136833 (Iris) tt_um_wokwi_470060098828179457 (Temz_ tiny tapeout) tt_um_wokwi_470058023187099649 (Osman WOKWI project 1) tt_um_wokwi_470057988621827073 (Viraj Tiny Template Full Adder TEST) tt_um_wokwi_470069802034377729 (Tiny Tapeout Template Copy) tt_um_wokwi_470070136685362177 (full adder) tt_um_wokwi_470070449402211329 (Anastasia Copy (2)) tt_um_wokwi_470059864883484673 (Keyaan’s first Wokwi design) tt_um_wokwi_470071200164912129 (full adder tiny tapeout Copy) tt_um_wokwi_470060671178857473 (SBUSixth First Chip Design Mentored by Tiny Tapeout) tt_um_wokwi_470099562753182721 (Isaac Tiny Tapeout) tt_um_wokwi_470120538476737537 (efwz8voices) tt_um_lelo_gr01_analogicus (LELO-GR01) tt_um_lelo_gr04_analogicus (LELO-GR04) tt_um_lelo_gr02_analogicus (LELO-GR02) tt_um_pump_out (60 Hz RMS Pump-Out Controller) tt_um_urish_simon (Simon Says memory game) tt_um_lelo_gr03_analogicus (LELO-GR03) tt_um_wokwi_470299374901578753 (Shrimp) tt_um_vga_clock (VGA clock) tt_um_frequency_counter (Frequency counter) tt_um_z2a_rgb_mixer (RGB Mixer demo) tt_um_mattvenn_r2r_dac_3v3 (Analog 8 bit 3.3v R2R DAC) tt_um_rebeccargb_universal_decoder (Universal Binary to Segment Decoder) tt_um_rebeccargb_hardware_utf8 (Hardware UTF Encoder/Decoder) tt_um_rebeccargb_intercal_alu (INTERCAL ALU) tt_um_rebeccargb_vga_pride (VGA Pride) tt_um_ogggggish_ota_ldo (SSF Capless LDO) tt_um_hariri4534_audioplayback (audioplayback) tt_um_wokwi_470637150792846337 (Joni - Tiny Tapeout Teardown2026 Workshop) tt_um_wokwi_470635013242210305 (Tom's first Wokwi design) tt_um_wokwi_470635780983408641 (Tiny Tapeout-AyeshaTeardown26) tt_um_wokwi_470639152626282497 (KeKoaM Tiny Tapeout) tt_um_wokwi_470637073520124929 (Tiny Tapeout workshop) tt_um_toby43479_iox (IO Expander with PWM) tt_um_wokwi_470635764113915905 (Divider Demo) tt_um_wokwi_470635580461052929 (Mann-teardown-project) tt_um_wokwi_470639672984256513 (KCs 001 TinyTapeout Design) tt_um_wokwi_470635507665754113 (Tiny Tapeout Template Copy) tt_um_wokwi_470637047364443137 (Pixel-Curio-Chip) tt_um_terihear_tinytearout (TinyTearout) tt_um_wokwi_470643025042834433 (TT 2026) tt_um_wokwi_470637360757626881 (Tiny Tapeout Template Copy) tt_um_wokwi_470635627278929921 (Tiny Tapeout Workshop) tt_um_wokwi_474471160110403585 (Cylon-Scanner) tt_um_wokwi_470646659230201857 (bloopbloop) tt_um_pthomas_sigma_delta (Continuous-Time Sigma-Delta ADC (1st order)) tt_um_sky_tpu_3x3 (Sky TPU 3x3) tt_um_tpcannon7_fir (tinyfir) tt_um_bruniliomuy_top (Fir_Filter) tt_um_semiqa_diff_opamp (Diff-In-Diff-Out-OpAmp) tt_um_TinyProcessor_naiyar_ (TinyProcessor) tt_um_CCDmos3D (ADC for CCDmos3D pixel) tt_um_snn_lif_neuron (snn_lif_neurons) tt_um_galaguna_NanoSys_fit (Nano-120_CPU@ler.uam.mx) tt_um_rowles_regime (Single-Bit Macro Regime Classifier) tt_um_rowles_fedmodel (The Fed Model (F1/F2)) tt_um_sky26c (tt_sky26c) tt_um_aka_regfile_ecc (regfile_ecc) tt_um_fwilson12_mac (int8 MAC) tt_um_davidbroughsmyth_ecg_sar12 (heart_monitor_adc_art) tt_um_foxworks_picorv32 (TCD Foxworks PicoRV32) tt_um_saltworks_ndf_c32 (Neural dataflow fabric — bit-serial MAC cells on a self-routing switch) tt_um_yjeum11 (DTMF (Touch-Tone) decoder) tt_um_vedic_mult (4-bit Vedic Multiplier) tt_um_atx_phased_interferometer (Acoustic Interferometer) tt_um_tilesos_dual_adc (Dual-Path Noise-Shaping ADC) tt_um_darga_cirom (Darga CiROM digital read + ternary MAC) tt_um_azara_cirom (Azara CiROM ternary read) tt_um_spi_reg_bank (8-bit Modified RISC-V) tt_um_aialaqili_updown_counter (4-bit Up/Down Counter) tt_um_noahzperez29_riscv_core (Noah RISC-V Core) tt_um_fp8_fpu (FP8 (E4M3) Floating-Point Unit) tt_um_costinemanuelv_gps_daily_trigger (GPS Daily Trigger) tt_um_ja_achtung_1x1 (JA Achtung Compact) tt_um_ja_achtung_1x2 (JA Achtung Full) tt_um_pwm_spice (spice-pwm-tapeout) tt_um_wecallemjazzyfact_bgr_ldo (BGR + LDO 3.3V/1.8V Integrated IP) tt_um_lelo_temp_wulffern (LELO-TEMP) tt_um_wokwi_472389622799861761 (3-Bit 101 Pattern Detector) tt_um_LnL_SoC (Lab and Lectures SoC) tt_um_dash_lucas_risc (risc_processor) tt_um_serdes_ephotonics (UCIe-style SERDES with analog TX driver & RX slicer) tt_um_joram200 (Kalman Filter Hardware Accelerator) tt_um_colbywonn_poly_synth (Poly Synth v1.0) tt_um_nobleg30_uart_vga_scroller (UART VGA Text Scroller) tt_um_multi_precision_mult (Multi-Precision Multiplier) tt_um_pratibha_munnangi_qkt_mac (QKT MAC Accelerator) tt_um_akankaan_bf16_fma (BF16 Fused Multiply-Add (FMA)) tt_um_rtfce (RTFCE - Reconfigurable Temporal Fault/Constraint Engine) tt_um_hdc_classifier (HDC Classifier) tt_um_preethi8a_adaptive_lfsr_prng (Self-Seeding Adaptive 16-bit Galois LFSR PRNG) tt_um_dilip951_cpu_systolic_array (Reconfigurable mixed-precision 2x2 systolic MAC array) tt_um_pqc_ntt_bfly (Crypto-Agile NTT Butterfly (ML-KEM / ML-DSA / FN-DSA)) tt_um_mlkem_coefficient_integrity (Fault-Aware Constant-Time FO Backend for ML-KEM) tt_um_vital_ap (VITAL-AP: Adaptive Pixel Register) tt_um_olaf8 (OLAF-8: Bounded-Memory Online Adaptive Fuzzy Inference) tt_um_Median_MAD (Streaming Median-MAD Estimator) tt_um_tnt_mosbius (tnt's variant of SKY130 mini-MOSbius) tt_um_undip_ann_q610 (UNDIP ANN Accelerator (SPI + bring-up self-test)) tt_um_cpu8 (CPU8) tt_um_vaishnavipatil5_configurable_cam (Configurable CAM with Masked Pattern Matching and Priority Resolution) tt_um_gina_env_monitor (Environmental Mapping Processor) tt_um_manasvibhat_bloom_filter (Bloom Filter Membership Tester) tt_um_amazing_sage_snn (LIF Neuron SNN) tt_um_nkanderson_lut_snn (LUT Spiking Network Classifier) tt_um_bigmanraffa_clm (Clementine: 4-lane int8 SIMT GPU) tt_um_adityarprasad_fft (Adaptive-Precision FFT) tt_um_oscillating_bones (Oscillating Bones) tt_um_silicon_edge_ns_sar_adc (NS SAR ADC) tt_um_sishi888_tinymind (TinyMind SoC) tt_um_afra_123_ecc_memory (Runtime-Reconfigurable ECC Memory) tt_um_kenchangh_mnist (MNIST Digit Recognition) tt_um_ece298a_8_bit_cpu_top (8-Bit CPU) tt_um_libormiller_SIMON_V2 (SIMON V2) tt_um_WaiMingLee888_nanov_1tile (NanoV RV32E one-tile RISC-V processor) tt_um_four_bit_nn_accel (4-bit Neural Network Accelerator) tt_um_rsa_simple (RSA Simple Encryptor) tt_um_synapticrw_lif_neuron (LIF Neuron (SynapticRW Teardown 2026)) tt_um_smunigan_ipv4_filter (IPv4 Header Filter) tt_um_jjy_spi_watchdog (SPI-Configurable Watchdog Timer) tt_um_osian_beam_controller (Programmable Metasurface Beam Controller) tt_um_namramazhar_popcnt_shiftreg (17-bit Wallace-tree POPCNT with shift-register input) tt_um_obookstay_puf (An arbiter PUF) tt_um_arminkardovic_montenegro_securekey (Montenegro SecureKey) tt_um_rcyaon_droop (All-Digital Supply Droop Detector) tt_um_ctw_spms (CTW-SPMS — Programmable Smart Power Management & Supervisor) tt_um_taiwoopesade_tempo_detector_sky26c (Hardware Audio Tempo Detector) tt_um_wokwi_470059878406973441 (Ehan's first TinyTapeout Project) tt_um_wokwi_470637170309995521 (My First Wokwi Thing!) tt_um_wokwi_470637401137246209 (Teardown Tiny Tapeout) tt_um_wokwi_469443433165025281 (Tiny Tapeout First Design Beth Plummer) tt_um_wokwi_472423526521678849 (4-bit to 5x7 Matrix Decoder for Tiny Tapeout) tt_um_wokwi_470057961258181633 (Tiny Tapeout Template Kavana) tt_um_wokwi_470057993933917185 (ivane- Tiny Tapeout (full adder)) tt_um_wokwi_470088776251343873 (training_project_kaylem) tt_um_neuropong (NeuroPong) tt_um_tamagotchi (TamaGotThis) tt_um_group02_seethebeat (SeeTheBeat) tt_um_kul_chromechain (Chrome Chain) tt_um_baked_weights (Baked-Weights Shakespeare GPT) tt_um_gilangfajrul_sar_adc (sar-adc) tt_um_Logy_FMAC (FMAC) tt_um_porkfreezer_rrio_opamp (RRIO Op-amp) tt_um_diff_engine (DSLX finite_difference) tt_um_dragonochi (WISH) tt_um_siliconsonics (ultrasonic sonar: range and bearing) tt_um_kul_conway (Interactive Conway's Game of Life) tt_um_algofoogle_ttsky26c_analog (Assorted analog in 1 tile) tt_um_mariavictoriaalm_qubit_sim ( tt-2qubit-sim) tt_um_andre_dpe (Dot product engine) tt_um_rmranjitkarNULL_pong_top (last_minute_Pong) tt_um_SAR_ADC (CTW LDO and Dynamic Comparator) tt_um_fabulous_sky_26c (Tiny FABulous FPGA) tt_um_tomvdsch_tiny32_soc (Tiny32 RV32IMA Zephyr-target SoC) tt_um_np523_pong (Pong) tt_um_usfq_adc_procmon (USFQ 8-bit Tracking ADC and Process Variation Monitor) tt_um_rangfuu_alu (Tiny ALU PD) tt_um_wokwi_473800139156677633 (Tiny Snake with PRISM 8) tt_um_mini_nn (Four-MAC Core Neural Network Inference Engine) tt_um_kianv_rv32_regfile (KianV uLinux RISC-V regfile edition) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_urish_rings (VGA Rings) tt_um_silicon_art_vga_screensaver (VGA Screensaver with Silicon Art ROM) tt_um_rom_vga_screensaver (VGA Screensaver with embedded bitmap ROM) tt_um_krisjdev_manchester_baby (Manchester Baby) tt_um_urish_sic1 (SIC-1 8-bit SUBLEQ Single Instruction Computer) tt_um_ThomasCowieEngineering_LMC (Little Man Computer CPU) tt_um_pranavUl_ascon_aead128 (Ascon bit-serial permutation engine) tt_um_orca (ORCA — Online Reconfigurable Circuit with Adaptation) tt_um_krisjdev_artwork (Silicon Artwork) tt_um_htfab_caterpillar (Simon's Caterpillar) tt_um_htfab_vga_tester (Video mode tester) Available Available Available Available Available Available Available Available Available Available