Coder Social home page Coder Social logo

chipper8's People

Contributors

fokoid avatar

Watchers

 avatar

chipper8's Issues

Allow closing windows

  • make UI windows closable
  • Mechanism to reopen windows - maybe via context menu in empty space of parent window

counter for duplicate items in REPL history

if the same instruction is sent consecutively, don't spam rows in the REPL history. instead add a new column with a number (maybe max 99) to indicate the number of times sent consecutively

Hotkeys

  • hotkey detection regardless of focus
  • Hotkeys for meta commands (may require modal popups for args)
  • Window with list of available hotkeys

debug metacommands

  • .step to run current instruction and increment program counter
  • .run to resume normal execution from current instruction

rework 'assembly' grammar

e.g. simplify sets

set <register> <value>
index set <value>
timer sound <value>
timer set <value>

could become

set <register|index|sound|timer> <value>

this will also allow making the (currently hand coded) parsing logic easier

implement instructions in terms of each other

for example the font instruction sets the index to the memory location of the appropriate font glyph. currently it directly sets the index but it could instead invoke the index set command.

one potential advantage would be the ability to split commands into those that directly mutate state and those that don't. this would make any future refactors of the VM internal state easier.

error state(s) for VM

need to read the specs on this. but for example what happens if we try to execute an invalid instruction? should we crash entirely? does VF get set to something?

register type

this should wrap the usize register index, enforce bounds checking, provide pretty formatting like VX

review/rework index display

index should probably go in its own window since it's structurally different to the program counter. we should display:

  • index address value
  • byte value at address
  • draw a glyph starting at that address (how many rows? maybe user configurable)

memory visualization nice to haves

  • coloured highlighting of various regions in memory display
    • current instruction (i.e. PC and PC + 1)
    • index
    • font region
    • reserved region
    • loaded rom
  • key to highlight colors
  • tooltips with region description
  • maybe also tooltip with cell value, which could be implemented for the display as well

Reset metacommand

Meta command to 'reboot' VM, resetting it to initial state on boot

error display

extend bottom bar with repl text entry across entire window. use the additional space to display error messages

cleanup types

at the moment there's a lot of casts between integer types (especially various unsigned ints to/from sizes/pointers)

Improved window management

  • make parent window resizable
  • Auto arrange child windows button
  • Make child windows resizable when appropriate (with minima/maxima if applicable) superseded by #56

upstream: egui table with header in bottom to top layout

The REPL history table was breaking when I added headers to tables. But the other tables were fine. The difference? The REPL history table sits within a bottom to top layout.

Need to figure out exactly what's going wrong and file an upstream bug report if appropriate. My guess is that when the header is allocated in bottom to top layout it consumes the whole space since we start at the bottom and the top is hard coded as the top of the current view.

window registry

currently there's a hard coded list of windows. figure out a way to register available windows and just have them all displayed. (in python I'd do this with a decorator on the method responsible for drawing each window, but not sure what I'll do in rust. probably has to be a macro.)

VM state undo & redo

  • stack of previous states
  • undo/redo metacommands
  • figure out how to manage redo

Basic VM visualizer UI

Rough prototype of VM visualizer GUI:

  • register values
  • stack state
  • 64 x 32 display
  • program counter & next instruction
  • index counter and memory value
  • delay timer
  • sound timer with visual cue to show active bell
  • 64x64 memory visualization including highlight of program counter and index

make VM state editable via GUI

  • most fields could be directly modified as text edit fields, e.g. registers, timers, special registers
  • for stack would need special UI for pop & push to avoid breakage)
  • would be cool to allow direct draw on display
  • and even cooler to allow it on the memory

toggleable table columns

  • could do by right clicking on header rows
  • but what about if all columns gone
  • so maybe right click context menu on window title bar is better

Helper formatting structs for numeric values

At the moment the number of hex digits shown in various displays is hard coded and non semantic. Let's extract formatting structs so it's configured in one place and has semantic meaning. All of the below wrap a single u16 (maybe u8 in a few cases) and implement the Display trait.

  • Decimal - regular decimal format, no digit limit
  • Word - 4 digit hex format
  • Byte - 2 digit hex format
  • Address - 3 digit (12 bit) address format
  • Instruction - textual instruction parsed from opcode (if possible)

Keypad window

Add a window with clickable keypad buttons for sending button presses direct to the VM. We should also figure out a way to send GUI keypresses 0-9 A-F direct to the VM (e.g. when the display window is focused) but the keypad window would be a simpler first step. Additionally, when keypresses are being captured and sent to the VM we could indicate this by highlighting the relevant key in the keypad window.

ROM load, play and stop meta command

Load rom into memory at <address> and set program counter to <address>:

.load IBM.rom <address>

Start execution loop

.play

Pause execution loop and back to repl

.pause

Given the retro nature of CHIP-8 let's go hard on the tape metaphors

  • .load
  • .play
  • .pause

Parsing for IBM logo instructions

Implement REPL parsing of the commands required by the IBM logo ROM

  • 00E0 (clear screen)
  • 1NNN (jump)
  • 6XNN (set register VX)
  • 7XNN (add value to register VX)
  • ANNN (set index register I)
  • DXYN (display/draw)

Add metacommands & status bar

Add fixed bottom bar with:

  • metacommand buttons
    • load rom
    • play/pause
    • step
    • reset
  • (maybe) instruction buttons
    • clear screen
    • jump
    • set register
    • add register
    • set index
    • sound timer
    • draw
    • font
  • REPL command entry text box (so this can be removed from the REPL window and that window made into a dedicated history window; this makes #33 obsolete since we no longer have any reason to do a bottom to top layout with a table)
  • error readout
  • program counter display with next instruction (this is as well as PC display in main GUI)

Basic REPL UI

Command field, submit on , and command history. Barebones command parsing needed but only for placeholder unknown command.

set monospace globally

try to figure out a way to set monospace globally instead of using the MonoLabel widget

remove row highlighting

the row highlighting doesn't place nice with current pattern for building tables. we don't really need it anyway so let's drop it.

  • for the sound timer we already have a bell icon to show activity
  • for the stack add an arrow column which can point to the next stack entry
  • only semi related but add a (STACK_SIZE + 1)-th row to the stack so the pointer can point past the end

Execution for IBM logo instructions

Implement the instructions required by IBM logo ROM in the VM

  • 00E0 (clear screen)
  • 1NNN (jump)
  • 6XNN (set register VX)
  • 7XNN (add value to register VX)
  • ANNN (set index register I)
  • DXYN (display/draw)

unify stack & program counter display

program counter row format should be exactly the same as stack: name, address value, pointed value (hex word), parsed instruction. should use the same code to format both. maybe some kind of row struct that takes a name and address and handles the rest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.