~swisschili/toolchain-6502

16ce8ed98014e1735c0383cdd314d29a120ddc65 — swissChili 4 months ago eb39d68
Fix markdown, add doc links
5 files changed, 52 insertions(+), 54 deletions(-)

M building.md
M debugger.md
M examples.md
M index.md
M usage.md
M building.md => building.md +0 -3
@@ 1,6 1,3 @@
@parent = page.html
@title = Building

# Building from source

You need the following libraries installed to build the emulator:

M debugger.md => debugger.md +8 -11
@@ 1,6 1,3 @@
@parent = page.html
@title = Debugger

# Debugger commands

These are the commands that the debugger CLI supports. Due to the asynchronous nature


@@ 9,37 6,37 @@ executing the program. For instance, try running the `disco.asm` <a href="/examp
example</a> and typing `set A #$0` into the debugger while it's running with a screen
attached, you will be able to modify the program in real time!

<br>

Or, run the emulator on an empty file, and run `set $200 #$FF` to write to the frame
buffer. You can even draw a picture by hand using just the debugger!

<br>

The GUI debugger actually just sends commands like these to the emulator using a
message queue, and you can do the same. Look in `/dev/mqueue` for the message queue
the emulator is using, and try sending a debug command as a null-terminated string
to the queue, you should be able to interact with the emulator from a different
process in real time.

#### `step`, `s`
## `step`, `s`

Step through one CPU instruction

#### `show [$addr]`, `print [$addr]`
## `show [$addr]`, `print [$addr]`

Show the value at `$addr` in memory, or, if no address given, show value of all registers.

#### `set $addr #$val`, `set reg #$val`
## `set $addr #$val`, `set reg #$val`

Set either `$addr` or register `reg` to `#$val`.

#### `run`
## `run`

Run the emulator.

#### `pause`
## `pause`

Stop running the emulator.

#### `quit`, `exit`
## `quit`, `exit`

Quit the debugger, emulator, and the screen (if running).

M examples.md => examples.md +4 -7
@@ 1,16 1,13 @@
@parent = page.html
@title = Examples

# Example Programs

Download the compiled programs and try them out in the emulator!

### Colors
## Colors

Draws every supported color on the screen.
<a href="colors.dat" download>Download</a>

```
```asm
	LDY #$0
loop:
	TYA


@@ 24,14 21,14 @@ loop:
	BRK
```

### Disco
## Disco

Epilepsy warning: lots of flashing colors. Due to how much faster this emulator is
than the one this program was written for, it's more of just flashing colors than
what it originally looked like.
<a href="disco.dat" download>Download</a>

```
```asm
; Taken from 6502asm.com

start:

M index.md => index.md +31 -21
@@ 1,42 1,52 @@
@parent = page.html
@title = Home
---
toc: false
title: 6502 Toolchain
---

# 6502 Toolchain

<center>
	<video controls="true">
		<source src="demo.webm" type="video/webm">
	</video>
</center>
![Screenshot](screenshot.png)

This project aims to create a fast, powerful, and easy to use toolchain for writing, debugging,
and running programs for the 6502 processor. It features a graphical and CLI debugger, disassembler,
and emulator.
This project aims to create a fast, powerful, and easy to use
toolchain for writing, debugging, and running programs for the 6502
processor. It features a graphical and CLI debugger, disassembler, and
emulator.

## Docs

- [Building from source](building.html)
- [Using the debugger](debugger.html)
- [Example programs](examples.html)
- [Using the emulator](usage.html)


## Features

### 8 bit color

That's 16 times more colors than <a href="http://6502asm.com/" target="_blank">the competition</a>!
That's 16 times more colors than <a href="http://6502asm.com/"
target="_blank">the competition</a>!

### Graphical debugger

Easily step through, run, and debug your programs using a fast graphical debugger. A traditional
CLI debugger is also available.
Easily step through, run, and debug your programs using a fast
graphical debugger. A traditional CLI debugger is also available.

### Fully multithreaded

The graphical debugger, cli debugger, and screen are all fully asynchronous. That means your
debugger stays fast, even when the emulator is running at full capacity.
It will soon be possible to even debug an already running instance of the emulator!
The graphical debugger, cli debugger, and screen are all fully
asynchronous. That means your debugger stays fast, even when the
emulator is running at full capacity.  It will soon be possible to
even debug an already running instance of the emulator!

### *Fast*

This emulator is incredibly fast. So fast that programs written for other emulators don't work
properly half the time because of how fast it is! At some point I will add an option to slow
the emulator down so it is comparable to other emulators.
This emulator is very fast. So fast that programs written for other
emulators don't work properly half the time because of how fast it is!
At some point I will add an option to slow the emulator down so it is
comparable to other emulators.


<br>

So what are you waiting for? Download the emulator now, or build it from source.
\ No newline at end of file
So what are you waiting for? Download the emulator now, or build it
from source.

M usage.md => usage.md +9 -12
@@ 1,46 1,43 @@
@parent = page.html
@title = Usage

# Basic Usage

The `6502` command takes some arguments that control how it functions. Each flag is documented
here. Note that only UNIX style flags are supported, not GNU style. This uses the standard
`getopt()` function, so flags work the same as any UNIX command.

#### `-g`
## `-g`

Opens a GUI debugger window.

#### `-s`
## `-s`

Opens a window that shows the emulators screen. Cannot be used in conjunction with `-g`.

#### `-H`
## `-H`

Keep the emulator running after the CPU halts (after an interrupt is triggered). Useful
for debugging short programs. Does nothing when used with `-D`.

#### `-d`
## `-d`

Disassemble the input file, printing the whole disassembly to `stdout`. You probably want
to use this with `-n`

#### `-r`
## `-r`

Run the input file. Can be used in conjunction with `-s` to run and display the output.

#### `-D`
## `-D`

Open CLI debugger. Can be used with `-s` to view screen while debugging. 

#### `-i input`
## `-i input`

Read `input` into the CPUs memory.

#### `-n number_of_instructions`
## `-n number_of_instructions`

Disassemble only `number_of_instructions` instructions.

#### `-h, -?`
## `-h, -?`

Print a help message.