# OmniCom

OmniCom is an emulator for the Nintendo Entertainment System (and hopefully more consoles in the future), which I built for my CS50 class at Harvard and have since expanded into a much more usable program. Below is a guide on how to use it.

## Usage

### Building/Opening

You can use it in 2 main ways:
1. Use the build scripts in the ```bin``` folder, and execute ```bin/main```.
2. Use ```make_exec_[platform].cpp``` to compile omnicom for your platform. From there, run that executable followed by the rom name in the directory you wish to save the executable in. From there, simply run the executable generated by omnicom.

### Controls

Once you've opened a rom using one of the two methods above, the default controls will be as follows:
| Button | Key |
| --- | --- |
| A | <kbd> Space </kbd> |
| B | <kbd> Left Shift </kbd> |
| Select | <kbd> Tab </kbd> |
| Start | <kbd> Return </kbd> |
| Up | <kbd> ↑ </kbd> |
| Down | <kbd> ↓ </kbd> |
| Left | <kbd> ← </kbd> |
| Right| <kbd> → </kbd> |

All of these default keybinds can be changed by pressing <kbd> Esc </kbd>, which will take you to the pause menu using ImGui. This menu is very incomplete, and right now only supports a few options.

### Saving and Loading States

From the pause menu, you can see a 'Save' and a 'Load' button. This allows you to save the current state of the emulator and load it later. This has its own glitches, however, and can sometimes load back incorrectly.


## Python Extension

You can also use this project with Python as an extension. It is available on PyPi as ```omnicom``` and you can install it with ```pip install omnicom```.

```omnicom``` doesnt actually create window contexts or use your audio devices. You have to do that yourself, hence, the extension is best used alongside libraries like ```pygame``` and ```pyaudio```, in order to actually be able to play the games in realtime.
