aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-09-15 00:18:14 +0900
committerAstatin <astatin@redacted>2024-09-15 00:18:14 +0900
commitfd5098e546ed2144c5f32fbe12b03ad784463cf9 (patch)
treef250c58b2d3831adcac3a7c95143eb61676d2c93
parent7101d14f3bcc0af29b8d51b1f5d58689fee1a571 (diff)
Update documentation
-rw-r--r--README.md33
-rw-r--r--src/main.rs2
2 files changed, 26 insertions, 9 deletions
diff --git a/README.md b/README.md
index abce9c2..6ac39c5 100644
--- a/README.md
+++ b/README.md
@@ -27,25 +27,42 @@ If there is the message `No gamepad found` in the first messages, it means your
## CPU Usage
-By default the emulator will spin lock instead of using thread::sleep (Bc I'm bad at programming and for some reason I can't manage to get an accurate time using thread::sleep)
+## Speed
-If you're on battery or the 100% CPU usage bothers you, you can use the --thread-sleep option, though it might cause some lags and inaccurate timing.
+You can adjust the speed with the `-s` argument
+This command makes it run at 2x speed
```bash
-emulator <gameboy_rom> --thread-sleep
+emulator <gameboy_rom> -s 2
```
-## Speed
+## Keyboard
-You can adjust the speed with the `-s` argument
+By default will be from a gamepad. Keyboard can be used by using the `-k` argument.
-This command makes it run at 2x speed
+The keyboard keys are:
+```
+Left, Right, Up, Down => Directional arrow
+Letter A and B => A and B button
+Enter => Start
+Backspace => Select
+```
+
+This command will force the use of the keyboard:
```bash
-emulator <gameboy_rom> -s 2
+emulator <gameboy_rom> -k
```
+## Timing issues
+
+Timing used to be inaccurate using sleep syscalls. The problem should now be fixed but if the timing is inconsistant on your system you can try to use the `--loop-lock-timing` and see if it is better. Note that using this will set your CPU usage to 100%.
+
+## Serial communication
+
+Serial communication is currently work in progress and doesn't work with basic ROMs but the `--fifo-input` and `--fifo-output` can already be tested by passing files created with mkfifo. If the goal is to allow communication between two gameboy, one gameboy's input should be the other's output.
+
# Contributing
This emulator is not the fastest one, the most accurate one or the most well made. I'm not even sure in which environment it works (I never tested it on windows). I just made it because it's fun and it's a good way to learn how the gameboy works in detail.
-For this reason, I'm not entirely sure what I would do if someone were to open a PR. If you find a bug or want to change something, I would be more confortable if you talked about it with me on stream or [on discord](https://discord.com/invite/XVTCuYJh) before.
+For this reason, I'm not entirely sure what I would do if someone were to open a PR without any previous discussion. If you find a bug or want to change something, I would be more confortable if you talked about it with me on stream or [on discord](https://discord.com/invite/XVTCuYJh) before.
diff --git a/src/main.rs b/src/main.rs
index b057486..ee31f31 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -20,7 +20,7 @@ struct Cli {
/// The gameboy rom file
rom: String,
- /// Setting this saves battery by using thread::sleep instead of spin_sleeping. It can result in lag and inconsistent timing.
+ /// Setting uses more battery and set the CPU to 100% but could sometimes solve inconsistent timing.
#[arg(long)]
loop_lock_timing: bool,