From 0eee5a262467177b059bbec63fb2358fb2cc4310 Mon Sep 17 00:00:00 2001 From: n loewen Date: Tue, 29 Aug 2023 08:55:03 -0400 Subject: [PATCH] Move issues and notes back into this branch --- issues/issues.md | 46 ++++++++++++++++++++++++++++++++++++++++ issues/todo.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 issues/issues.md create mode 100644 issues/todo.md diff --git a/issues/issues.md b/issues/issues.md new file mode 100644 index 0000000..4a9e2dc --- /dev/null +++ b/issues/issues.md @@ -0,0 +1,46 @@ +# Cardiograph issues + +## Open + +### #1 - Improve CLI interface + +I'm thinking of an interface like this... + + $ ./cpu.js -mc code.bin + $ ./cpu.js code.asm + $ ./cpu.js --debug code.asm + +Full list of flags I want: + + -d --debug + -s --singlestep + -p --prettydisplay + -mc --machinecode + +### #2 - Startup: Execute `JMP $FF` + +See [2023-08-24](../notes/2023-08-24--dev-notes.md#cpu-start-up) + +... say that there's a 1-byte ROM at $FF. + +- `00-19` - display (5x5) +- `1A ` - pointer to display memory +- `1B ` - keypad: value of latest key pressed +- `1C ` - reserved for future use (bank switching flag) +- `1D ` - initial IP +- `1D-FE` - free +- `FF ` - ROM (unwriteable) - pointer to initial IP + +- store `$1D` at `$FF` +- make CPU execute `JMP $FF` on startup +- make ROM unwriteable + +More step-by-step: + + - Change memory from a Uint8Array to a regular array, + and make every entry { number | { type: 'ROM', value: number }} + - Store ROM as an object in machine.config.js + - Load ROM data into memory at CPU startup (`startCPU(RAM, ROM)`) + + +## Closed \ No newline at end of file diff --git a/issues/todo.md b/issues/todo.md new file mode 100644 index 0000000..e29a352 --- /dev/null +++ b/issues/todo.md @@ -0,0 +1,55 @@ +# To do — Summary + +This is a quick todo list. + +For extended commentary, see [issues](issues.md). + +## Open + +### Todo + +- Finish WIP on run-cli arg parsing +- Pass CYCLE_COUNT as a cli arg + +- (cpu) !! Fix overflow flag +- Add a flag for bank-switching to the ~zero-page +- Remove run-scripts and add the ability to run `./cpu.js` and `./assembler.js` directly -- cf. [#1](issues.md#1---improve-cli-interface) +- [fix] (cpu) Make single-stepping work with simulated keypad + +### Features + +- (cpu) allow arrow keys, too +- [fix] (cpu) Execute `JMP $FF` on startup / Implement ROM — see [#2](issues.md#2---startup-execute-jmp-ff) +- (assembler) Validate labels +- (assembler) Extract debugging to its own module +- (cpu) Consider adding a VIP-style keypad-based machine code monitor +- (cpu) Add a mode that prints the display as text, but still animates +- (cpu) Allow running pre-compiled machine code +- (cpu) DRY out addition and subtraction +- [Extended system (secret bonus operations)](../notes/2023-08-07--dev-notes.md) +- (research) Review CHIP-8 + - read about the spec / ISA + - read these, and add them to the bibliography: + - Steve Losh: https://stevelosh.com/blog/2016/12/chip8-input/ + - https://tonisagrista.com/blog/2021/chip8-spec/ + +### Documentation + +- Improve docs for flags register + +### Testing + +- Display (hex) numbers +- Greater than +- Minimal LOGO-ish interpreter for turtle graphics + + +## Closed + +- 2023-08-26 - [fix] (logging) - 'undefined operand' situation is caused by assembling to an initial IP of $1C, which is an odd number +- (assembler) Pass asm line thru to cpu to print when debugging + + +## Abandoned + +- (assembler) Return pure machine code when printing to stdout (and not in debug mode) \ No newline at end of file