Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - true-grue/Brus-16: A tiny game console for education
Nothing Special   »   [go: up one dir, main page]

Skip to content

true-grue/Brus-16

Repository files navigation

Brus-16

Brus-16 is an educational 16-bit game console with an original, minimalistic architecture. Unlike fantasy consoles, Brus-16 was designed for FPGA implementation.

See in action (use cursor keys).

Architecture

Brus-16 consists of:

  • 16-bit stack-based CPU: Harvard architecture (8K words for code, 8K for data), two hardware stacks (arguments and return addresses), fixed instruction size. Designed to simplify compiler development.
  • Graphics processor: Renders 64 filled rectangles per frame without a framebuffer. 640x480x16bpp, 60 fps.
  • Input controller: Supports 16 buttons.

Software Tools

There is a basic set of tool templates:

  • Compiler (brus16_dsl.py): translates from a Python-like DSL to Brus-16 assembly.
  • Assembler (brus16_asm.py): translates assembly into a binary image.
  • Emulator (brus16_cpu.c, brus16_sdl.c): software model of the console using the SDL3 library.

Educational Projects

Brus-16 can be 8682 used for various educational projects. Examples:

  • Develop a software emulator in another language (e.g., Rust, C#).
  • Create an interactive debugger with stack and memory visualization.
  • Write a full-featured assembler with macros and directives.
  • Extend the existing compiler (for-loops, structs).
  • Implement new compiler optimizations (e.g., value numbering).
  • Develop a compiler for another language (e.g., a subset of C or Forth).
  • Create a graphics editor for drawing game assets with rectangles.
  • Develop a tool to approximate a raster image with 64 rectangles.
  • Design a new architectural variant of Brus-16 on an FPGA.
  • And, of course, develop your own game!

A Verilog hardware implementation by Kirill Pavlov is available here.


Брус-16

Брус-16 — это учебная 16-битная игровая приставка с оригинальной, минималистичной архитектурой. В отличие от существующих fantasy consoles, Брус-16 проектировался с прицелом на аппаратную реализацию на ПЛИС.

Архитектура

В состав Брус-16 входят:

  • 16-битный стековый процессор: гарвардская архитектура (8К слов для кода, 8К слов для данных), два аппаратных стека (для аргументов и адресов возврата), фиксированная длина команд. Архитектура процессора спроектирована для удобства написания простых компиляторов.
  • Графический процессор: обрабатывает 64 закрашенных прямоугольника на кадр без использования видеобуфера. Характеристики графики: 640x480x16bpp, 60 fps.
  • Контроллер ввода: поддерживает 16 кнопок.

Программные инструменты

Имеется базовый набор инструментов-заготовок:

  • Компилятор (brus16_dsl.py): Транслирует код с Python-подобного DSL в язык ассемблера Брус-16.
  • Ассемблер (brus16_asm.py): Транслирует ассемблерный код в бинарную прошивку.
  • Эмулятор (brus16_cpu.c, brus16_sdl.c): Программная модель приставки с использованием библиотеки SDL3.

DSL для разработки игр

Краткое описание DSL находится здесь.

Учебные проекты

Брус-16 может быть основой учебных проектов различной сложности. Вот несколько примеров задач для студентов:

  • Разработать программный эмулятор на другом языке (например, Rust или C#).
  • Создать интерактивный отладчик с визуализацией стеков и памяти.
  • Написать полноценный ассемблер с поддержкой макросов и директив.
  • Доработать существующий компилятор (добавить цикл for, структуры).
  • Добавить новые оптимизации в компилятор (например, value numbering).
  • Разработать компилятор для другого языка (например, подмножества C или Forth).
  • Создать графический редактор для рисования игровых объектов прямоугольниками.
  • Разработать инструмент, аппроксимирующий растровое изображение 64 прямоугольниками.
  • Разработать новый архитектурный вариант Брус-16 на ПЛИС.
  • И, конечно же, разработать свою игру!

Аппаратная реализация приставки на Verilog от Кирилла Павлова находится здесь.

0