You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok, I just finished polishing some details over this last version of Geebly, its been a while since the last release!
3
+
4
+
I do plan on using this version as an absolute baseline for a functioning emulator, as I've implemented almost all the details I've refrained from working on since development started, and as such, I'm really happy with the state of the emulator right now, code and functionality wise.
5
+
6
+
Everything is looking clearer, the PPU has been rewritten from scratch (literally!), the SPU is now properly implemented, etc.
7
+
8
+
Below is a (non-exhaustive) list of important changes:
9
+
10
+
### Changes
11
+
#### CPU
12
+
- Bit operations (and other instructions that used `bus::ref`) now properly cause side effects on MMIO
13
+
14
+
#### PPU
15
+
The PPU has been rewritten from scratch. Now it runs on a much more accurate FIFO-based sub-scanline renderer, compared to the more naive scanline only renderer that was in place before.
16
+
17
+
- Sub-scanline renderer implemented
18
+
- Greatly improved timings
19
+
- Implemented sprite/background/window priorities (also for CGB mode)
20
+
- Fixed DMA-related issues (see DMA for more info)
21
+
22
+
#### SPU/APU
23
+
I've ditched the initial SPU implementation that relied on `SDL_QueueAudio`. The SPU now outputs samples at the Game Boy's real sample rate (2 MHz) and resamples them on-demand (`audio_update_cb`).
24
+
25
+
- Ditched `SDL_QueueAudio`, SPU is now callback based, this allowed the fixes below:
26
+
- Fixed "race conditions" between channels where one channel would empty the buffer for a new sound to play, while another channel might have been pushing samples to the buffer, resulting in the second channel's audio being cut prematurely
27
+
- The wave channel's pitch will no longer drift
28
+
- Correctly implemented SPU control registers
29
+
- Implemented stereo audio + stereo/mono setting
30
+
- Implemented a master volume setting
31
+
32
+
#### DMA/HDMA (CGB DMA)
33
+
- Fixed an issue where WRAM addresses wouldn't have been correctly translated (CGB mode)
34
+
- `ff55` will always be set to `ff`, this fixes HDMA-related wait loop hanging. Its a hotfix though, I plan on correctly implementing HDMA so it isn't the same as GDMA
35
+
36
+
#### Codebase
37
+
There have been a lot of improvements to the codebase overall, this looks insignificant to the outside world, but a cleaner, simpler and more concise codebase directly impacts the performance of a project as a whole
38
+
39
+
### To-do
40
+
I plan on completely rewriting the debugger from the ground up, its already possible to see some advancements on the debug.hpp file. There are many more things to work on, but for now this is the one I'm going to be focusing on! Check the sources for more "To-do"s.
A Gameboy/Color emulator written in C++, currently under development.
9
-
<palign="center">
10
-
<img src="https://user-images.githubusercontent.com/15825466/105384568-258a5200-5bf1-11eb-949c-8c274d88229e.gif" alt="Running Super Mario Bros. Deluxe (GBC)")
11
-
</p>
11
+
12
+

13
+
14
+
</div>
12
15
13
16
## Usage
14
17
### Linux
15
18
`geebly <settings> <file>`
16
19
17
-
### Windows (Powershell)
18
-
`./geebly <settings> <file>`
20
+
### Windows
21
+
`./geebly <settings> <file>` or `geebly <settings> <file>`
19
22
20
23
### Settings
21
24
There are different settings for every part of the emulation engine, Boot ROM/BIOS related settings are prefixed with a `B`, general emulation settings are prefixed with a `E`, etc. Common settings' shorthands usually are just one letter long though.
22
25
23
26
Here's all the settings currently present in the CLI:
24
27
|Setting|Shorthand|Description|Default|
25
28
|--|--|--|--|
29
+
|`--master-volume`|`-v`|Set the master volume (`float` or `int`) <ul><li>`0.0` = Silence</li><li>`1.0` = Max</li><li>`> 1.0` = Clipping</li></ul>|`1.0`
30
+
|`--mono`|`-m`|Disable stereo sound|No
26
31
|`--debug`|`-d`|Enable the Geebly Debugger|Disabled
27
32
|`--boot`|`-b`|Specify a boot ROM|`"dmg_boot.bin"`
28
33
|`--scale`|`-s`|Set the display scale|1
@@ -32,52 +37,9 @@ Here's all the settings currently present in the CLI:
32
37
|`--cgb-mode`|`-Ecgb`|Switches to CGB (Game Boy Color) mode|Disabled
Out of nowhere, there's now Game Boy Color emulation! This mostly comprises additional PPU registers and logic, and the CPU's double speed mode, that doesn't really affect the emulated CPU itself, but more the way devices do timing-based stuff based off the CPU clock.
Almost all IRQs are supported, with the exception of `SC` (no Serial support yet), plus `STAT` might be broken, but testing points to it being close to perfectly emulated.
50
-
51
-
### Mapper/cartridge type support
52
-
Most common mappers are fully implemented, that is:
53
-
-`ROM only`
54
-
-`MBC1`
55
-
-`MBC2`
56
-
-`MBC3`
57
-
-`MBC5`
58
-
59
-
All of them with full ROM/SRAM banking support!
60
-
61
-
RTC and Rumble functions are not supported.
62
-
63
-
### Graphics (PPU/GPU)
64
-
Color is supported! in CGB mode, there's two switchable VRAM banks, but the second one should contain a Background Tile Attribute Map that enables selecting CGB palettes in a per-tile basis, among other things like X/Y flipping tiles, etc.
65
-
66
-
All three layers are implemented, with full scrolling support for both background and window.
67
-
68
-
The OAM DMA controller is also implemented, it will log warnings when invalid transfers are attempted. The HDMA/GDMA CGB controllers are not yet supported, but short-term planned.
69
-
70
-
### Sound (SPU/APU)
71
-
Sound emulation is finally supported, but only on Windows, as I don't really have a separate Linux machine to test things on, I'm relying in WSL2 only, which doesn't really have good sound support, I could maybe mess around with `pulseaudio`, but it didn't seem like a straightforward process to me, so that's why I decided to not support sound emulation on Linux for now.
72
-
73
-
Its not an accurate emulation, nor all features are supported, only channels 1, 2 and 4 are supported, that's the two square channels and a noise channel.
74
-
75
-
Both square channels support volume envelope, trigger, sound length, but not sweep.
76
-
77
-
The noise channel's sound is completely off, the documented frequency calculation formula gave out really high frequencies that were inaudible, and so I had to workaround scaling them so something could be heard, this resulted in a high pitched sound being audible alongside the noise, which is undesirable, but at least we get to hear noise stabs or percussion-like sounds.
78
-
79
-
### Timers
80
-
`DIV` and `TIMA` (`TAC` and `TMA` aswell) are accurately emulated.
40
+
## Tests
41
+
-`cpu_instrs.gb` passes all tests
42
+
-`dmg-acid2.gb` passes both DMG and CGB tests
81
43
82
-
### Blargg's tests
83
-
`cpu_instrs.gb` passes all 11 tests!
44
+
##Building
45
+
So many things have changed in this last version that the build process is just not the same anymore, I'll fix that in upcoming commits
0 commit comments