Skip to content

Commit

Permalink
Read quirks setting from cfg file
Browse files Browse the repository at this point in the history
  • Loading branch information
leonmavr committed Aug 19, 2024
1 parent b04682c commit 1036c10
Show file tree
Hide file tree
Showing 80 changed files with 96 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ found at `roms/README.md`.

- [x] CPU and renderer.
- [x] UI including controls and debugger view including pause, exit, and stepping key.
- [x] .cfg file each ROM; lists the controls and sets the emulation frequency.
Found at `roms/*.cfg`.
- [x] .cfg file for each ROM with editable presets (such as emulation frequency) and key descriptions for each rom. Found at `roms/*.cfg`.
- [x] Configurable keys.
- [x] CI.
- [ ] Sound; probably never going to implement this.
Expand Down
2 changes: 2 additions & 0 deletions include/cfg_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CfgParser {
const std::vector<std::pair<std::string, std::string>>& key_descrs() const {
return key_descrs_;
}
bool quirks() const { return quirks_; }

private:
void ParseConfigFile(const std::string& filename);
Expand All @@ -39,6 +40,7 @@ class CfgParser {
return ret;
}();
std::vector<std::pair<std::string, std::string>> key_descrs_;
bool quirks_;
bool cfg_file_found_;
};

Expand Down
1 change: 1 addition & 0 deletions roms/15_Puzzle.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@
0xf: shuffle 16th tile

500
on
1 change: 1 addition & 0 deletions roms/15_Puzzle_alt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
0xb: shuffle 15th tile
0xf: shuffle 16th tile
500
on
1 change: 1 addition & 0 deletions roms/Addition_Problems.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
1 change: 1 addition & 0 deletions roms/Airplane.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Author: Unknown
# Controls:
0x8: Shoot
on
1 change: 1 addition & 0 deletions roms/Animal_Race.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
0x6: Bet $8
0x9: Bet $9
1500
on
1 change: 1 addition & 0 deletions roms/Astro_Dodge.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@
0x6: Right
0x8: Down
1500
on
1 change: 1 addition & 0 deletions roms/Biorhythm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@
0xf: advance start date
0xb: decrement start date
2000
on
1 change: 1 addition & 0 deletions roms/Blinky.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Author: Unknown
2000
on
1 change: 1 addition & 0 deletions roms/Blinky_alt.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Author: Unknown
2000
on
1 change: 1 addition & 0 deletions roms/Blitz.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
# Status: Not working
# Controls:
0x5: drop bomb
on
1 change: 1 addition & 0 deletions roms/Bowling.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@
#
#
# Author: Gooitzen van der Wal
on
1 change: 1 addition & 0 deletions roms/Breakout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
# Controls:
0x4: Left
0x6: Right
on
1 change: 1 addition & 0 deletions roms/Breakout_Brix_hack.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
# Author: David Winter, 1997
0x4: Left
0x6: Right
on
3 changes: 2 additions & 1 deletion roms/Brick.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# Original BRIX by Andreas Gustafsson.
0x4: left
0x6: right
300
350
on
1 change: 1 addition & 0 deletions roms/Brix.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0x4: left
# frequency
350
on
1 change: 1 addition & 0 deletions roms/Cave.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0x4: Left
0x6: Right
150
on
1 change: 1 addition & 0 deletions roms/Coin_Flipping.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
# and tails on the screen, stopping at the value set in VC.
# Author: Carmelo Cortez, 1978
1500
on
1 change: 1 addition & 0 deletions roms/Connect_4.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
0x4: Select left column
0x6: Select right column
0x5: Drop coin
on
1 change: 1 addition & 0 deletions roms/Craps.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# 7 or 11 wins, 12, 2 or 3 loses on first roll. The second roll must match the first to win, but if you roll a seven you lose. This program could be expanded to include on-the-screen scoring of bets.
# Author: Camerlo Cortez, 1978
# Status: Not working
on
1 change: 1 addition & 0 deletions roms/Deflection.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@
0x7: down and to the left
0x8: down
0x9: down and to the right
on
1 change: 1 addition & 0 deletions roms/Figures.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0x6: move right
0x1: drop
600
on
1 change: 1 addition & 0 deletions roms/Filter.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0x4: Left
0x6: Right
250
on
1 change: 1 addition & 0 deletions roms/Guess.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
0x5: See the number you thought
0x0: Or other keys; don't see it
1500
on
1 change: 1 addition & 0 deletions roms/Guess_alt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0x5: See the number you thought
0x0: Or other keys; don't see it
1500
on
1 change: 1 addition & 0 deletions roms/Hi-Lo.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#
# You have 10 chances to guess the value of a random number between 00 and 99 selected by the program. The number at the right of the screen shows the number of the guess you are using. Enter a two digit number and the computer tells you if you are high or low. Press any key to erase this number and then, try again. If you have failed after ten guesses, press any key and the number will be shown. If you are good you will never need more than seven guesses.
# Author: Jef Winsor, 1978
on
1 change: 1 addition & 0 deletions roms/Hidden.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
#
# Enjoy !!!
# Author: David Winter, 1996
on
1 change: 1 addition & 0 deletions roms/Kaleidoscope.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
0x6: create a pattern
0x8: create a pattern
1000
on
1 change: 1 addition & 0 deletions roms/Landing.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Author: Unknown
0x8: Shoot
on
1 change: 1 addition & 0 deletions roms/Lunar_Lander.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@
0x2: thrust
0x4: left
0x6: right
on
1 change: 1 addition & 0 deletions roms/Mastermind_FourRow_Robert_Lindley,_1978.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
# used, the hidden number will be revealed.
# Controls:
0xf: change your mind and input
on
1 change: 1 addition & 0 deletions roms/Merlin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
0x5: Toggle upper right
0x1: Toggle lower left
0x2: Toggle lower right
on
1 change: 1 addition & 0 deletions roms/Missile.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Author: Unknown
# Controls:
0x8: Shoot
on
1 change: 1 addition & 0 deletions roms/Most_Dangerous_Game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
# 04E3 70 Probability (out of 100Hex) of a wall appearing.
# 04EB FE If FF, a wall may appear at previously tested boundaries.
# Author: Peter Maruhnic
on
1 change: 1 addition & 0 deletions roms/Nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# Author: Carmelo Cortez, 1978
# Controls:
0xf: action
on
1 change: 1 addition & 0 deletions roms/Paddles.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
0x7: left (bottom player)
0x9: right (bottom player)
500
on
1 change: 1 addition & 0 deletions roms/Pong.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
0x4: Left player down
0xc: Right player up
0xd: Right player down
on
1 change: 1 addition & 0 deletions roms/Pong_1_player.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0x1: up
0x4: down
400
on
1 change: 1 addition & 0 deletions roms/Pong_2_Pong_hack.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0x4: Left player down
0xc: Right player up
0xd: Right player down
on
1 change: 1 addition & 0 deletions roms/Pong_alt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0x4: Left player down
0xc: Right player up
0xd: Right player down
on
1 change: 1 addition & 0 deletions roms/Programmable_Spacefighters.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,4 @@
# of fire power can have long range effects if there is low fire power and a large
# number of moves per round.
# Author: Jef Winsor
on
1 change: 1 addition & 0 deletions roms/Puzzle.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
2 changes: 2 additions & 0 deletions roms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Here's an example config:
0x5: Shoot
# Frequency (optional)
1000
# Quirks ("on" or "off")
on
```

### Credits
Expand Down
1 change: 1 addition & 0 deletions roms/Reversi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@
0x6: right (P1/P2)
0x8: down (P1/P2)
1000
on
1 change: 1 addition & 0 deletions roms/Rocket.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Author: Unknown
# Controls:
0xf: Launch
on
1 change: 1 addition & 0 deletions roms/Rocket_Launch.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
0x4: left
0x6: right
2000
on
1 change: 1 addition & 0 deletions roms/Rocket_Launcher.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
1 change: 1 addition & 0 deletions roms/Rush_Hour.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
0xa: OK/hold to slide
0x1: Options/back
1000
on
1 change: 1 addition & 0 deletions roms/Rush_Hour_alt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
0xa: OK/hold to slide
0x1: Options/back
1000
on
1 change: 1 addition & 0 deletions roms/Russian_Roulette.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
# Controls:
0x0: (or any other key) spin
1000
on
1 change: 1 addition & 0 deletions roms/Sequence_Shoot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
0xe: Shoot 3rd target
0xf: Shoot 4th target (bottom)
1000
on
1 change: 1 addition & 0 deletions roms/Shooting_Stars.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
0x6: right
0x8: down
1000
on
1 change: 1 addition & 0 deletions roms/Slide.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
# Controls:
0x0: stop and hold the puck
1000
on
1 change: 1 addition & 0 deletions roms/Soccer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0x4: Down (P1)
0xc: Up (P2)
0xd: Down (P2)
on
1 change: 1 addition & 0 deletions roms/Space_Flight.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
0xf: start game
0xe: launch
500
on
1 change: 1 addition & 0 deletions roms/Space_Intercept.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
0x5: Launch
0x6: Launch
1000
on
1 change: 1 addition & 0 deletions roms/Space_Invaders.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
0x6: Right

400
on
1 change: 1 addition & 0 deletions roms/Space_Invaders_alt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
0x6: Right

400
on
1 change: 1 addition & 0 deletions roms/Spooky_Spot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
# Author: Joseph Weisbecker, 1978
0x0: Show answer
1000
on
1 change: 1 addition & 0 deletions roms/Squash.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0x1: up
0x4: down
250
on
1 change: 1 addition & 0 deletions roms/Submarine.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@

0x5: shoot
500
on
1 change: 1 addition & 0 deletions roms/Sum_Fun.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
0x8: Enter 8
0x9: Enter 9
500
on
1 change: 1 addition & 0 deletions roms/Syzygy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@
0x1: left
0x2: down
250
on
1 change: 1 addition & 0 deletions roms/Tank.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
# Controls:
0x5: shoot
500
on
1 change: 1 addition & 0 deletions roms/Tapeworm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
0x8: down
0xf: start
1000
on
1 change: 1 addition & 0 deletions roms/Tetris.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
0x7: drop
2000

on
1 change: 1 addition & 0 deletions roms/Tic-Tac-Toe.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
0x8: tile 8
0x9: tile 9
500
on
1 change: 1 addition & 0 deletions roms/Timebomb.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
1 change: 1 addition & 0 deletions roms/Tron.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
1 change: 1 addition & 0 deletions roms/UFO.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
0x4: Shoot top left
0x5: Shoot straight
0x6: Shoot top right
on
1 change: 1 addition & 0 deletions roms/Vers.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
1 change: 1 addition & 0 deletions roms/Vertical_Brix.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0x1: Up
0x4: Down
1000
on
1 change: 1 addition & 0 deletions roms/Wall.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Controls:
0x4: Left
0x6: Right
on
1 change: 1 addition & 0 deletions roms/Wipe_Off.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0x4: left
0x6: right
500
on
1 change: 1 addition & 0 deletions roms/Worm_V4.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@
0x8: Down
0x4: Left
350
on
1 change: 1 addition & 0 deletions roms/X-Mirror.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Author: Unknown
on
1 change: 1 addition & 0 deletions roms/ZeroPong.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Controls:
0x2: up
0x8: down
on
Loading

0 comments on commit 1036c10

Please sign in to comment.