├── .gitignore ├── jni ├── Application.mk └── Android.mk ├── link.T ├── fonts ├── dbgfont.ttf └── license.txt ├── roms ├── chip8archive │ ├── RPS.ch8 │ ├── 1dcell.ch8 │ ├── DVN8.ch8 │ ├── bulb.ch8 │ ├── dodge.ch8 │ ├── down8.ch8 │ ├── eaty.ch8 │ ├── fuse.ch8 │ ├── knight.ch8 │ ├── outlaw.ch8 │ ├── petdog.ch8 │ ├── piper.ch8 │ ├── rockto.ch8 │ ├── snake.ch8 │ ├── snek.ch8 │ ├── squad.ch8 │ ├── sub8.ch8 │ ├── tank.ch8 │ ├── applejak.ch8 │ ├── binding.ch8 │ ├── br8kout.ch8 │ ├── carbon8.ch8 │ ├── chipwar.ch8 │ ├── danm8ku.ch8 │ ├── gradsim.ch8 │ ├── masquer8.ch8 │ ├── mondrian.ch8 │ ├── octogon.ch8 │ ├── octopeg.ch8 │ ├── octovore.ch8 │ ├── spacejam.ch8 │ ├── BadKaiJuJu.ch8 │ ├── chipcross.ch8 │ ├── chipquarium.ch8 │ ├── ghostEscape.ch8 │ ├── glitchGhost.ch8 │ ├── horseyJump.ch8 │ ├── mastermind.ch8 │ ├── octorancher.ch8 │ ├── sens8tion.ch8 │ ├── spaceracer.ch8 │ ├── supersquare.ch8 │ ├── sweetcopter.ch8 │ ├── turnover77.ch8 │ ├── xochip │ │ ├── sk8.ch8 │ │ ├── jub8-1.ch8 │ │ ├── jub8-2.ch8 │ │ ├── jub8-3.ch8 │ │ ├── jub8-4.ch8 │ │ ├── jub8-5.ch8 │ │ ├── jub8-6.ch8 │ │ ├── octoma.ch8 │ │ ├── flutterby.ch8 │ │ ├── octopaint.ch8 │ │ ├── skyward.ch8 │ │ ├── garlicscape.ch8 │ │ ├── redOctober.ch8 │ │ ├── OctoPartyMix.ch8 │ │ ├── chickenScratch.ch8 │ │ ├── keshaWasBird.ch8 │ │ ├── superneatboy.ch8 │ │ ├── trucksimul8or.ch8 │ │ ├── keshaWasNiiinja.ch8 │ │ ├── superOctoTrackXO.ch8 │ │ └── anEveningToDieFor.ch8 │ ├── blackrainbow.ch8 │ ├── caveexplorer.ch8 │ ├── flightrunner.ch8 │ ├── nokiatemplate.ch8 │ ├── slipperyslope.ch8 │ ├── tombstontipp.ch8 │ ├── 8ceattourny_d1.ch8 │ ├── 8ceattourny_d2.ch8 │ ├── 8ceattourny_d3.ch8 │ ├── horseWorldOnline.ch8 │ ├── mini-lights-out.ch8 │ ├── octoachip8story.ch8 │ ├── pumpkindressup.ch8 │ ├── spockpaperscissors.ch8 │ └── ultimatetictactoe.ch8 ├── optests │ ├── BC_test.ch8 │ ├── c8_test.ch8 │ ├── test_opcode.ch8 │ └── chip8-test-suite │ │ ├── 7-beep.ch8 │ │ ├── 3-corax+.ch8 │ │ ├── 4-flags.ch8 │ │ ├── 5-quirks.ch8 │ │ ├── 6-keypad.ch8 │ │ ├── 2-ibm-logo.ch8 │ │ ├── 8-scrolling.ch8 │ │ ├── 1-chip8-logo.ch8 │ │ └── 8-scrolling.ch8.dmp └── revival │ ├── games │ ├── Cave.ch8 │ ├── Tank.ch8 │ ├── Tron.ch8 │ ├── Figures.ch8 │ ├── Filter.ch8 │ ├── Landing.ch8 │ ├── Paddles.ch8 │ ├── Puzzle.ch8 │ ├── Shooting Stars [Philip Baltzer, 1978].txt │ ├── Soccer.ch8 │ ├── Airplane.ch8 │ ├── Pong (alt).ch8 │ ├── Timebomb.ch8 │ ├── X-Mirror.ch8 │ ├── Space Flight.ch8 │ ├── Pong (1 player).ch8 │ ├── Rocket Launcher.ch8 │ ├── Vers [JMN, 1991].ch8 │ ├── Blitz [David Winter].ch8 │ ├── Guess [David Winter].ch8 │ ├── Tapeworm [JDR, 1999].ch8 │ ├── UFO [Lutz V, 1992].ch8 │ ├── Wall [David Winter].ch8 │ ├── 15 Puzzle [Roger Ivie].ch8 │ ├── Biorhythm [Jef Winsor].ch8 │ ├── Deflection [John Fort].ch8 │ ├── Merlin [David Winter].ch8 │ ├── Missile [David Winter].ch8 │ ├── Rush Hour [Hap, 2006].ch8 │ ├── Squash [David Winter].ch8 │ ├── Animal Race [Brian Astle].ch8 │ ├── Brick (Brix hack, 1990).ch8 │ ├── Connect 4 [David Winter].ch8 │ ├── Hi-Lo [Jef Winsor, 1978].ch8 │ ├── Reversi [Philip Baltzer].ch8 │ ├── Slide [Joyce Weisbecker].ch8 │ ├── Guess [David Winter] (alt).ch8 │ ├── Hidden [David Winter, 1996].ch8 │ ├── Nim [Carmelo Cortez, 1978].ch8 │ ├── Pong [Paul Vervalin, 1990].ch8 │ ├── Rush Hour [Hap, 2006] (alt).ch8 │ ├── Sum Fun [Joyce Weisbecker].ch8 │ ├── Syzygy [Roy Trevino, 1990].ch8 │ ├── Tic-Tac-Toe [David Winter].ch8 │ ├── 15 Puzzle [Roger Ivie] (alt).ch8 │ ├── Bowling [Gooitzen van der Wal].ch8 │ ├── Craps [Camerlo Cortez, 1978].ch8 │ ├── Space Invaders [David Winter].ch8 │ ├── Tetris [Fran Dachille, 1991].ch8 │ ├── Wipe Off [Joseph Weisbecker].ch8 │ ├── ZeroPong [zeroZshadow, 2007].ch8 │ ├── Breakout [Carmelo Cortez, 1979].ch8 │ ├── Brix [Andreas Gustafsson, 1990].ch8 │ ├── Lunar Lander (Udo Pernisz, 1979).ch8 │ ├── Rocket Launch [Jonas Lindstedt].ch8 │ ├── Rocket [Joseph Weisbecker, 1978].ch8 │ ├── Submarine [Carmelo Cortez, 1978].ch8 │ ├── Addition Problems [Paul C. Moews].ch8 │ ├── Astro Dodge [Revival Studios, 2008].ch8 │ ├── Sequence Shoot [Joyce Weisbecker].ch8 │ ├── Space Invaders [David Winter] (alt).ch8 │ ├── Vertical Brix [Paul Robson, 1996].ch8 │ ├── Worm V4 [RB-Revival Studios, 2007].ch8 │ ├── Blinky [Hans Christian Egeberg, 1991].ch8 │ ├── Blinky [Hans Christian Egeberg] (alt).ch8 │ ├── Coin Flipping [Carmelo Cortez, 1978].ch8 │ ├── Most Dangerous Game [Peter Maruhnic].ch8 │ ├── Shooting Stars [Philip Baltzer, 1978].ch8 │ ├── Spooky Spot [Joseph Weisbecker, 1978].ch8 │ ├── Kaleidoscope [Joseph Weisbecker, 1978].ch8 │ ├── Pong 2 (Pong hack) [David Winter, 1997].ch8 │ ├── Programmable Spacefighters [Jef Winsor].ch8 │ ├── Russian Roulette [Carmelo Cortez, 1978].ch8 │ ├── Breakout (Brix hack) [David Winter, 1997].ch8 │ ├── Mastermind FourRow (Robert Lindley, 1978).ch8 │ ├── Space Intercept [Joseph Weisbecker, 1978].ch8 │ ├── Brick (Brix hack, 1990).txt │ ├── Space Invaders [David Winter].txt │ ├── Space Invaders [David Winter] (alt).txt │ ├── Guess [David Winter].txt │ ├── Guess [David Winter] (alt).txt │ ├── Russian Roulette [Carmelo Cortez, 1978].txt │ ├── 15 Puzzle [Roger Ivie].txt │ ├── Submarine [Carmelo Cortez, 1978].txt │ ├── Coin Flipping [Carmelo Cortez, 1978].txt │ ├── Blitz [David Winter].txt │ ├── Nim [Carmelo Cortez, 1978].txt │ ├── Tank.txt │ ├── Craps [Camerlo Cortez, 1978].txt │ ├── Breakout [Carmelo Cortez, 1979].txt │ ├── Pong [Paul Vervalin, 1990].txt │ ├── Breakout (Brix hack) [David Winter, 1997].txt │ ├── Space Intercept [Joseph Weisbecker, 1978].txt │ ├── Spooky Spot [Joseph Weisbecker, 1978].txt │ ├── Merlin [David Winter].txt │ ├── Hi-Lo [Jef Winsor, 1978].txt │ ├── Kaleidoscope [Joseph Weisbecker, 1978].txt │ ├── Connect 4 [David Winter].txt │ ├── Sum Fun [Joyce Weisbecker].txt │ ├── Slide [Joyce Weisbecker].txt │ ├── Hidden [David Winter, 1996].txt │ ├── Sequence Shoot [Joyce Weisbecker].txt │ ├── Rush Hour [Hap, 2006].txt │ ├── UFO [Lutz V, 1992].txt │ ├── Animal Race [Brian Astle].txt │ ├── Tetris [Fran Dachille, 1991].txt │ ├── Worm V4 [RB-Revival Studios, 2007].txt │ ├── Mastermind FourRow (Robert Lindley, 1978).txt │ ├── Astro Dodge [Revival Studios, 2008].txt │ ├── Reversi [Philip Baltzer].txt │ ├── Bowling [Gooitzen van der Wal].txt │ ├── Biorhythm [Jef Winsor].txt │ ├── Deflection [John Fort].txt │ ├── Most Dangerous Game [Peter Maruhnic].txt │ ├── Syzygy [Roy Trevino, 1990].txt │ ├── Lunar Lander [Udo Pernisz, 1979].txt │ └── Programmable Spacefighters [Jef Winsor].txt │ ├── programs │ ├── Fishie [Hap, 2005].txt │ ├── IBM Logo.ch8 │ ├── Chip8 Picture.ch8 │ ├── Fishie [Hap, 2005].ch8 │ ├── Keypad Test [Hap, 2006].ch8 │ ├── Life [GV Samways, 1980].ch8 │ ├── Framed MK1 [GV Samways, 1980].ch8 │ ├── Framed MK2 [GV Samways, 1980].ch8 │ ├── Chip8 emulator Logo [Garstyciuks].ch8 │ ├── Clock Program [Bill Fisher, 1981].ch8 │ ├── SQRT Test [Sergey Naydenov, 2010].ch8 │ ├── Division Test [Sergey Naydenov, 2010].ch8 │ ├── Minimal game [Revival Studios, 2007].ch8 │ ├── Jumping X and O [Harry Kleinberg, 1977].ch8 │ ├── Jumping X and O [Harry Kleinberg, 1977].txt │ ├── Delay Timer Test [Matthew Mikolay, 2010].ch8 │ ├── Random Number Test [Matthew Mikolay, 2010].ch8 │ ├── BMP Viewer - Hello (C8 example) [Hap, 2005].ch8 │ ├── Framed MK1 [GV Samways, 1980].txt │ ├── Framed MK2 [GV Samways, 1980].txt │ ├── BMP Viewer - Hello (C8 example) [Hap, 2005].txt │ ├── Keypad Test [Hap, 2006].txt │ ├── Delay Timer Test [Matthew Mikolay, 2010].txt │ ├── Clock Program [Bill Fisher, 1981].txt │ ├── Life [GV Samways, 1980].txt │ └── Random Number Test [Matthew Mikolay, 2010].txt │ ├── demos │ ├── Maze [David Winter, 199x].ch8 │ ├── Zero Demo [zeroZshadow, 2007].txt │ ├── Stars [Sergey Naydenov, 2010].ch8 │ ├── Zero Demo [zeroZshadow, 2007].ch8 │ ├── Maze (alt) [David Winter, 199x].ch8 │ ├── Particle Demo [zeroZshadow, 2008].ch8 │ ├── Sierpinski [Sergey Naydenov, 2010].ch8 │ ├── Sirpinski [Sergey Naydenov, 2010].ch8 │ ├── Trip8 Demo (2008) [Revival Studios].ch8 │ ├── Particle Demo [zeroZshadow, 2008].txt │ ├── Maze [David Winter, 199x].txt │ ├── Maze (alt) [David Winter, 199x].txt │ └── Trip8 Demo (2008) [Revival Studios].txt │ └── README ├── screenshots ├── Brix_CH8.gif ├── DVN8_CH8.gif ├── Invaders_CH8.gif ├── Rainbow_CH8.gif ├── SuperNeatBoy_CH8.gif └── Chicken_Scratch_CH8.gif ├── .gitmodules ├── Makefile.common ├── jaxe_libretro.info ├── CMakeLists.txt ├── LICENSE ├── include └── chip8.h ├── .gitlab-ci.yml ├── README.md ├── src ├── libretro.c └── main.c └── Makefile.libretro /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .vscode 3 | -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_PLATFORM := android-16 3 | -------------------------------------------------------------------------------- /link.T: -------------------------------------------------------------------------------- 1 | { 2 | global: retro_*; 3 | local: *; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /fonts/dbgfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/fonts/dbgfont.ttf -------------------------------------------------------------------------------- /roms/chip8archive/RPS.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/RPS.ch8 -------------------------------------------------------------------------------- /roms/optests/BC_test.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/BC_test.ch8 -------------------------------------------------------------------------------- /roms/optests/c8_test.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/c8_test.ch8 -------------------------------------------------------------------------------- /screenshots/Brix_CH8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/screenshots/Brix_CH8.gif -------------------------------------------------------------------------------- /screenshots/DVN8_CH8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/screenshots/DVN8_CH8.gif -------------------------------------------------------------------------------- /roms/chip8archive/1dcell.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/1dcell.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/DVN8.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/DVN8.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/bulb.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/bulb.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/dodge.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/dodge.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/down8.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/down8.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/eaty.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/eaty.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/fuse.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/fuse.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/knight.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/knight.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/outlaw.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/outlaw.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/petdog.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/petdog.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/piper.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/piper.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/rockto.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/rockto.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/snake.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/snake.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/snek.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/snek.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/squad.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/squad.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/sub8.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/sub8.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/tank.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/tank.ch8 -------------------------------------------------------------------------------- /roms/optests/test_opcode.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/test_opcode.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Cave.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Cave.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Tank.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Tank.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Tron.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Tron.ch8 -------------------------------------------------------------------------------- /screenshots/Invaders_CH8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/screenshots/Invaders_CH8.gif -------------------------------------------------------------------------------- /screenshots/Rainbow_CH8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/screenshots/Rainbow_CH8.gif -------------------------------------------------------------------------------- /roms/chip8archive/applejak.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/applejak.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/binding.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/binding.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/br8kout.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/br8kout.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/carbon8.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/carbon8.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/chipwar.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/chipwar.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/danm8ku.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/danm8ku.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/gradsim.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/gradsim.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/masquer8.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/masquer8.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/mondrian.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/mondrian.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/octogon.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/octogon.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/octopeg.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/octopeg.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/octovore.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/octovore.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/spacejam.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/spacejam.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Figures.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Figures.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Filter.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Filter.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Landing.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Landing.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Paddles.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Paddles.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Puzzle.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Puzzle.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Shooting Stars [Philip Baltzer, 1978].txt: -------------------------------------------------------------------------------- 1 | Shooting Stars, by: Philip Baltzer 2 | 3 | -------------------------------------------------------------------------------- /roms/revival/games/Soccer.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Soccer.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/BadKaiJuJu.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/BadKaiJuJu.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/chipcross.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/chipcross.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/chipquarium.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/chipquarium.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/ghostEscape.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/ghostEscape.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/glitchGhost.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/glitchGhost.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/horseyJump.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/horseyJump.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/mastermind.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/mastermind.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/octorancher.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/octorancher.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/sens8tion.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/sens8tion.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/spaceracer.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/spaceracer.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/supersquare.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/supersquare.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/sweetcopter.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/sweetcopter.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/turnover77.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/turnover77.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/sk8.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/sk8.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Airplane.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Airplane.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Pong (alt).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Pong (alt).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Timebomb.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Timebomb.ch8 -------------------------------------------------------------------------------- /roms/revival/games/X-Mirror.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/X-Mirror.ch8 -------------------------------------------------------------------------------- /screenshots/SuperNeatBoy_CH8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/screenshots/SuperNeatBoy_CH8.gif -------------------------------------------------------------------------------- /roms/chip8archive/blackrainbow.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/blackrainbow.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/caveexplorer.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/caveexplorer.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/flightrunner.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/flightrunner.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/nokiatemplate.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/nokiatemplate.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/slipperyslope.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/slipperyslope.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/tombstontipp.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/tombstontipp.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/jub8-1.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/jub8-1.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/jub8-2.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/jub8-2.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/jub8-3.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/jub8-3.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/jub8-4.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/jub8-4.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/jub8-5.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/jub8-5.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/jub8-6.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/jub8-6.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/octoma.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/octoma.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Space Flight.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Space Flight.ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Fishie [Hap, 2005].txt: -------------------------------------------------------------------------------- 1 | Fishie, used as internal rom for fish n chips 2 | by hap, 10-07-05 3 | -------------------------------------------------------------------------------- /roms/revival/programs/IBM Logo.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/IBM Logo.ch8 -------------------------------------------------------------------------------- /screenshots/Chicken_Scratch_CH8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/screenshots/Chicken_Scratch_CH8.gif -------------------------------------------------------------------------------- /roms/chip8archive/8ceattourny_d1.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/8ceattourny_d1.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/8ceattourny_d2.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/8ceattourny_d2.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/8ceattourny_d3.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/8ceattourny_d3.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/horseWorldOnline.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/horseWorldOnline.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/mini-lights-out.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/mini-lights-out.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/octoachip8story.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/octoachip8story.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/pumpkindressup.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/pumpkindressup.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/flutterby.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/flutterby.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/octopaint.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/octopaint.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/skyward.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/skyward.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Pong (1 player).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Pong (1 player).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Rocket Launcher.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Rocket Launcher.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/spockpaperscissors.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/spockpaperscissors.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/ultimatetictactoe.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/ultimatetictactoe.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/garlicscape.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/garlicscape.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/redOctober.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/redOctober.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/7-beep.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/7-beep.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Vers [JMN, 1991].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Vers [JMN, 1991].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Chip8 Picture.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Chip8 Picture.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/OctoPartyMix.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/OctoPartyMix.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/chickenScratch.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/chickenScratch.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/keshaWasBird.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/keshaWasBird.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/superneatboy.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/superneatboy.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/trucksimul8or.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/trucksimul8or.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/3-corax+.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/3-corax+.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/4-flags.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/4-flags.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/5-quirks.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/5-quirks.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/6-keypad.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/6-keypad.ch8 -------------------------------------------------------------------------------- /roms/revival/games/Blitz [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Blitz [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Guess [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Guess [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Tapeworm [JDR, 1999].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Tapeworm [JDR, 1999].ch8 -------------------------------------------------------------------------------- /roms/revival/games/UFO [Lutz V, 1992].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/UFO [Lutz V, 1992].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Wall [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Wall [David Winter].ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/keshaWasNiiinja.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/keshaWasNiiinja.ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/superOctoTrackXO.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/superOctoTrackXO.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/2-ibm-logo.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/2-ibm-logo.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/8-scrolling.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/8-scrolling.ch8 -------------------------------------------------------------------------------- /roms/revival/games/15 Puzzle [Roger Ivie].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/15 Puzzle [Roger Ivie].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Biorhythm [Jef Winsor].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Biorhythm [Jef Winsor].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Deflection [John Fort].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Deflection [John Fort].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Merlin [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Merlin [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Missile [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Missile [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Rush Hour [Hap, 2006].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Rush Hour [Hap, 2006].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Squash [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Squash [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Fishie [Hap, 2005].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Fishie [Hap, 2005].ch8 -------------------------------------------------------------------------------- /roms/chip8archive/xochip/anEveningToDieFor.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/chip8archive/xochip/anEveningToDieFor.ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/1-chip8-logo.ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/1-chip8-logo.ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Maze [David Winter, 199x].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Maze [David Winter, 199x].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Animal Race [Brian Astle].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Animal Race [Brian Astle].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Brick (Brix hack, 1990).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Brick (Brix hack, 1990).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Connect 4 [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Connect 4 [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Hi-Lo [Jef Winsor, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Hi-Lo [Jef Winsor, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Reversi [Philip Baltzer].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Reversi [Philip Baltzer].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Slide [Joyce Weisbecker].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Slide [Joyce Weisbecker].ch8 -------------------------------------------------------------------------------- /roms/optests/chip8-test-suite/8-scrolling.ch8.dmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/optests/chip8-test-suite/8-scrolling.ch8.dmp -------------------------------------------------------------------------------- /roms/revival/demos/Zero Demo [zeroZshadow, 2007].txt: -------------------------------------------------------------------------------- 1 | This is my first program for the CHIP-8, a simple demo with 4 bouncing sprites. 2 | 3 | Enjoy! -------------------------------------------------------------------------------- /roms/revival/games/Guess [David Winter] (alt).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Guess [David Winter] (alt).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Hidden [David Winter, 1996].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Hidden [David Winter, 1996].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Nim [Carmelo Cortez, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Nim [Carmelo Cortez, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Pong [Paul Vervalin, 1990].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Pong [Paul Vervalin, 1990].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Rush Hour [Hap, 2006] (alt).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Rush Hour [Hap, 2006] (alt).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Sum Fun [Joyce Weisbecker].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Sum Fun [Joyce Weisbecker].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Syzygy [Roy Trevino, 1990].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Syzygy [Roy Trevino, 1990].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Tic-Tac-Toe [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Tic-Tac-Toe [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Keypad Test [Hap, 2006].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Keypad Test [Hap, 2006].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Life [GV Samways, 1980].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Life [GV Samways, 1980].ch8 -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/deps/libretro-common"] 2 | path = src/deps/libretro-common 3 | url = https://github.com/libretro/libretro-common.git 4 | -------------------------------------------------------------------------------- /roms/revival/demos/Stars [Sergey Naydenov, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Stars [Sergey Naydenov, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Zero Demo [zeroZshadow, 2007].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Zero Demo [zeroZshadow, 2007].ch8 -------------------------------------------------------------------------------- /roms/revival/games/15 Puzzle [Roger Ivie] (alt).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/15 Puzzle [Roger Ivie] (alt).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Bowling [Gooitzen van der Wal].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Bowling [Gooitzen van der Wal].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Craps [Camerlo Cortez, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Craps [Camerlo Cortez, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Space Invaders [David Winter].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Space Invaders [David Winter].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Tetris [Fran Dachille, 1991].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Tetris [Fran Dachille, 1991].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Wipe Off [Joseph Weisbecker].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Wipe Off [Joseph Weisbecker].ch8 -------------------------------------------------------------------------------- /roms/revival/games/ZeroPong [zeroZshadow, 2007].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/ZeroPong [zeroZshadow, 2007].ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Maze (alt) [David Winter, 199x].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Maze (alt) [David Winter, 199x].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Breakout [Carmelo Cortez, 1979].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Breakout [Carmelo Cortez, 1979].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Brix [Andreas Gustafsson, 1990].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Brix [Andreas Gustafsson, 1990].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Lunar Lander (Udo Pernisz, 1979).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Lunar Lander (Udo Pernisz, 1979).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Rocket Launch [Jonas Lindstedt].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Rocket Launch [Jonas Lindstedt].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Rocket [Joseph Weisbecker, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Rocket [Joseph Weisbecker, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Submarine [Carmelo Cortez, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Submarine [Carmelo Cortez, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Framed MK1 [GV Samways, 1980].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Framed MK1 [GV Samways, 1980].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Framed MK2 [GV Samways, 1980].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Framed MK2 [GV Samways, 1980].ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Particle Demo [zeroZshadow, 2008].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Particle Demo [zeroZshadow, 2008].ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Sierpinski [Sergey Naydenov, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Sierpinski [Sergey Naydenov, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Sirpinski [Sergey Naydenov, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Sirpinski [Sergey Naydenov, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/demos/Trip8 Demo (2008) [Revival Studios].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/demos/Trip8 Demo (2008) [Revival Studios].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Addition Problems [Paul C. Moews].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Addition Problems [Paul C. Moews].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Astro Dodge [Revival Studios, 2008].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Astro Dodge [Revival Studios, 2008].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Sequence Shoot [Joyce Weisbecker].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Sequence Shoot [Joyce Weisbecker].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Space Invaders [David Winter] (alt).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Space Invaders [David Winter] (alt).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Vertical Brix [Paul Robson, 1996].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Vertical Brix [Paul Robson, 1996].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Worm V4 [RB-Revival Studios, 2007].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Worm V4 [RB-Revival Studios, 2007].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Blinky [Hans Christian Egeberg, 1991].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Blinky [Hans Christian Egeberg, 1991].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Blinky [Hans Christian Egeberg] (alt).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Blinky [Hans Christian Egeberg] (alt).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Coin Flipping [Carmelo Cortez, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Coin Flipping [Carmelo Cortez, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Most Dangerous Game [Peter Maruhnic].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Most Dangerous Game [Peter Maruhnic].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Shooting Stars [Philip Baltzer, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Shooting Stars [Philip Baltzer, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Spooky Spot [Joseph Weisbecker, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Spooky Spot [Joseph Weisbecker, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Chip8 emulator Logo [Garstyciuks].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Chip8 emulator Logo [Garstyciuks].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Clock Program [Bill Fisher, 1981].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Clock Program [Bill Fisher, 1981].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/SQRT Test [Sergey Naydenov, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/SQRT Test [Sergey Naydenov, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Kaleidoscope [Joseph Weisbecker, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Kaleidoscope [Joseph Weisbecker, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Pong 2 (Pong hack) [David Winter, 1997].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Pong 2 (Pong hack) [David Winter, 1997].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Programmable Spacefighters [Jef Winsor].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Programmable Spacefighters [Jef Winsor].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Russian Roulette [Carmelo Cortez, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Russian Roulette [Carmelo Cortez, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Division Test [Sergey Naydenov, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Division Test [Sergey Naydenov, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Minimal game [Revival Studios, 2007].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Minimal game [Revival Studios, 2007].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Breakout (Brix hack) [David Winter, 1997].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Breakout (Brix hack) [David Winter, 1997].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Mastermind FourRow (Robert Lindley, 1978).ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Mastermind FourRow (Robert Lindley, 1978).ch8 -------------------------------------------------------------------------------- /roms/revival/games/Space Intercept [Joseph Weisbecker, 1978].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/games/Space Intercept [Joseph Weisbecker, 1978].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Jumping X and O [Harry Kleinberg, 1977].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Jumping X and O [Harry Kleinberg, 1977].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Jumping X and O [Harry Kleinberg, 1977].txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Jumping X and O [Harry Kleinberg, 1977].txt -------------------------------------------------------------------------------- /roms/revival/programs/Delay Timer Test [Matthew Mikolay, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Delay Timer Test [Matthew Mikolay, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/Random Number Test [Matthew Mikolay, 2010].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/Random Number Test [Matthew Mikolay, 2010].ch8 -------------------------------------------------------------------------------- /roms/revival/programs/BMP Viewer - Hello (C8 example) [Hap, 2005].ch8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtjd/jaxe/HEAD/roms/revival/programs/BMP Viewer - Hello (C8 example) [Hap, 2005].ch8 -------------------------------------------------------------------------------- /roms/revival/games/Brick (Brix hack, 1990).txt: -------------------------------------------------------------------------------- 1 | BRICK: a modified version of BRIX, a CHIP-8 game. 2 | Original BRIX by Andreas Gustafsson. 3 | This one is a solid wall; no air between bricks! -------------------------------------------------------------------------------- /roms/revival/demos/Particle Demo [zeroZshadow, 2008].txt: -------------------------------------------------------------------------------- 1 | This is my particledemo for the Chip-8, SuperChip and MegaChip8. 2 | Works on real hardware as well as emulators 3 | 4 | Enjoy! 5 | 6 | zeroZshadow -------------------------------------------------------------------------------- /roms/revival/programs/Framed MK1 [GV Samways, 1980].txt: -------------------------------------------------------------------------------- 1 | Framed MK1, By: G.V. Samways, 1980 2 | 3 | This program displays a random movement of dots. You will notice a repetition in the pattern 4 | after a time. 5 | -------------------------------------------------------------------------------- /roms/revival/programs/Framed MK2 [GV Samways, 1980].txt: -------------------------------------------------------------------------------- 1 | Framed MK2, By: G.V. Samways, 1980 2 | 3 | This program displays a random movement of lines. You will notice a repetition in the pattern 4 | after a time. 5 | -------------------------------------------------------------------------------- /roms/revival/games/Space Invaders [David Winter].txt: -------------------------------------------------------------------------------- 1 | Space Invaders, by: David Winter 2 | 3 | The well known game. Destroy the invaders with your ship. Shoot 4 | with 5, move with 4 and 6. Press 5 to begin a game. 5 | 6 | -------------------------------------------------------------------------------- /roms/revival/games/Space Invaders [David Winter] (alt).txt: -------------------------------------------------------------------------------- 1 | Space Invaders, by: David Winter 2 | 3 | The well known game. Destroy the invaders with your ship. Shoot 4 | with 5, move with 4 and 6. Press 5 to begin a game. 5 | 6 | -------------------------------------------------------------------------------- /roms/revival/games/Guess [David Winter].txt: -------------------------------------------------------------------------------- 1 | Think to a number between 1 and 63. CHIP8 shows you several boards and you have to tell if you see your number in them. Press 5 if so, or another key if not. CHIP8 gives you the number... 2 | -------------------------------------------------------------------------------- /roms/revival/games/Guess [David Winter] (alt).txt: -------------------------------------------------------------------------------- 1 | Think to a number between 1 and 63. CHIP8 shows you several boards and you have to tell if you see your number in them. Press 5 if so, or another key if not. CHIP8 gives you the number... 2 | -------------------------------------------------------------------------------- /roms/revival/programs/BMP Viewer - Hello (C8 example) [Hap, 2005].txt: -------------------------------------------------------------------------------- 1 | BMP Viewer, 02-06-05, by hap 2 | works with monochrome BMPs only, of course. put the BMP data (headerless) at 3 | offset $30. change offset $0 (200) $00ff to $1202 for Chip-8. -------------------------------------------------------------------------------- /roms/revival/games/Russian Roulette [Carmelo Cortez, 1978].txt: -------------------------------------------------------------------------------- 1 | Russian Roulette , by: Carmelo Cortez 2 | 3 | This game is called Russian RouLette. Press any key to Spin and pull the Trigger. 4 | A "Click" or "Bang" will show, get ten "clicks" in a row and you win. -------------------------------------------------------------------------------- /roms/revival/games/15 Puzzle [Roger Ivie].txt: -------------------------------------------------------------------------------- 1 | Same than PUZZLE2. Wait for randomization... Instead of moving the item by pressing his associated key, move it UP DOWN LEFT RIGHT with respectively 2 8 4 6. Up and Down are inverted as the game uses the original CHIP8 keyboard. -------------------------------------------------------------------------------- /roms/revival/games/Submarine [Carmelo Cortez, 1978].txt: -------------------------------------------------------------------------------- 1 | Submarine, by: Carmelo Cortez 2 | 3 | The Sub Game is my favorlte. Press "5" key to fire depth charges at the subs below. 4 | You score 15 points for a small sub and 5 points for the larger. You get 25 depth charges to start. -------------------------------------------------------------------------------- /roms/revival/games/Coin Flipping [Carmelo Cortez, 1978].txt: -------------------------------------------------------------------------------- 1 | Coin Flipping, by: Carmelo Cortez 2 | 3 | The game is a Coin FlLpping program. Flip run up and the 4 | computer starts to flip a coin, and at the same tine shosing heads 5 | and tails on the screen, stopping at the value set in VC. 6 | -------------------------------------------------------------------------------- /roms/revival/games/Blitz [David Winter].txt: -------------------------------------------------------------------------------- 1 | Blitz, by: David Winter 2 | 3 | This game is a BOMBER clone. You are in a plane, and you must destroy the towers of a town. Your plane is flying left to right, and goes down. Use 5 to drop a bomb. The game ends when you crash yourself on a tower... 4 | 5 | -------------------------------------------------------------------------------- /roms/revival/games/Nim [Carmelo Cortez, 1978].txt: -------------------------------------------------------------------------------- 1 | Nim, by: Carmelo Cortez 2 | 3 | The Nim Game is a little less graphic than most games. The player may go first by pressing. "F" key, any other let the computer go first. 4 | You subtract 1, 2 or 3 fron the score. The one who ends up with the last number loses! -------------------------------------------------------------------------------- /roms/revival/games/Tank.txt: -------------------------------------------------------------------------------- 1 | You are in a tank which has 25 bombs. Your goal is to hit 25 times a mobile target. The game ends when all your bombs are shot. If your tank hits the target, you lose 5 bombs. Use 2 4 6 and 8 to move. This game uses the original CHIP8 keyboard, so directions 2 and 8 are swapped. 2 | -------------------------------------------------------------------------------- /roms/revival/games/Craps [Camerlo Cortez, 1978].txt: -------------------------------------------------------------------------------- 1 | Craps, by: Camerlo Cortez 2 | 3 | To use the Craps program, press any key to roll dice. 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. 5 | -------------------------------------------------------------------------------- /roms/revival/programs/Keypad Test [Hap, 2006].txt: -------------------------------------------------------------------------------- 1 | Keypad Test, by hap, 15-02-06 2 | 3 | press a chip8 key and the pressed char will light up 4 | if you want to do something funny, soft-reset the chip8/emulator over and over, 5 | and the sprite layout will become messed up ;p 6 | 7 | chip8 keypad: 8 | 1 2 3 c 9 | 4 5 6 d 10 | 7 8 9 e 11 | a 0 b f 12 | 13 | -------------------------------------------------------------------------------- /roms/revival/games/Breakout [Carmelo Cortez, 1979].txt: -------------------------------------------------------------------------------- 1 | Breakout, by: Carmelo Cortez 2 | 3 | The game, Breakout, is a variation of the Wipe-Off game. 4 | You have six walls and 20 balls to start. To win you must get through all walls to the top of the screen. At the end of the game the program will show the number of times you hit the walls and will show "FREE!" if you get through. -------------------------------------------------------------------------------- /roms/revival/games/Pong [Paul Vervalin, 1990].txt: -------------------------------------------------------------------------------- 1 | OK. here is PONG version 1.1. The ball is a little faster in this 2 | version making play a little more realistic. I know PONG 1.0 was 3 | just posted yesterday, but I think this version is significantly 4 | better, so here it is. 5 | 6 | Use keys 7 and 4 move left player and / and * move right player. 7 | 8 | Enjoy!! 9 | 10 | -------------------------------------------------------------------------------- /Makefile.common: -------------------------------------------------------------------------------- 1 | LIBRETRO_COMM_DIR = $(SOURCE_DIR)/deps/libretro-common 2 | 3 | SOURCES_C := \ 4 | $(SOURCE_DIR)/libretro.c \ 5 | $(SOURCE_DIR)/chip8.c 6 | 7 | SOURCES_CXX := 8 | 9 | INCLUDES := -I$(LIBRETRO_COMM_DIR)/include -I$(SOURCE_DIR)/../include 10 | 11 | ifneq (,$(findstring msvc200,$(platform))) 12 | INCLUDES += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc 13 | endif 14 | -------------------------------------------------------------------------------- /jaxe_libretro.info: -------------------------------------------------------------------------------- 1 | display_name = "CHIP-8/SuperChip8/XO-CHIP" 2 | authors = "Kurtis Dinelle" 3 | supported_extensions = "ch8|sc8|xo8|hc8" 4 | corename = "JAXE" 5 | manufacturer = "RCA" 6 | categories = "Emulator" 7 | systemname = "SuperChip8" 8 | database = "SuperChip8" 9 | license = "MIT" 10 | permissions = "" 11 | display_version = "GIT" 12 | supports_no_game = "false" 13 | firmware_count = 0 14 | -------------------------------------------------------------------------------- /roms/revival/games/Breakout (Brix hack) [David Winter, 1997].txt: -------------------------------------------------------------------------------- 1 | Breakout (Brix hack), by: David Winter 2 | 3 | This game is an "arkanoid" precursor. You have 5 lives, and your goal is the destruction of all the brixs. Use 4 and 6 to move your paddle. The game ends when all the brixs are destroyed. 4 | 5 | This game is the same than BRIX, but has graphics looking like the game on the Atari 2600 console. 6 | 7 | -------------------------------------------------------------------------------- /roms/revival/games/Space Intercept [Joseph Weisbecker, 1978].txt: -------------------------------------------------------------------------------- 1 | Space Intercept, by Joseph Weisbecker 2 | 3 | At startup, Press 1 to select the large UFO whichh counts 5 points when hit or 2 to select the small UFO which counts 15 points when hit. 4 | Launch your rocket by pressing key 4,5 or 6. You get 15 rockets as shown in the lower right corner of the screen. Your score is shown in the lower left corner of the screen. 5 | -------------------------------------------------------------------------------- /roms/revival/programs/Delay Timer Test [Matthew Mikolay, 2010].txt: -------------------------------------------------------------------------------- 1 | Hey guys! 2 | 3 | Here's another little program I wrote to test out a feature in my game. This 4 | program allows the user to change the value of the V3 register using the 2 and 8 5 | keys. When the 5 key is pressed, the delay timer starts counting down from the 6 | value the user placed into the V3 register, and the screen is updated as the 7 | value changes. 8 | 9 | -Matt -------------------------------------------------------------------------------- /roms/revival/games/Spooky Spot [Joseph Weisbecker, 1978].txt: -------------------------------------------------------------------------------- 1 | Spooky Spot, by: Joseph Weisbecker 2 | 3 | Now you can let the computer make your big decisions or predict the future just like governmentt or industry leaders do. 4 | You will see the words YES and NO at the right of the screen. Ask the computer any question that can be answered with YES or NO. Press KEY 0 and the spooky spot will show you the computer's answer. This program replaces your old fashioned mechanical OUIJA board. 5 | -------------------------------------------------------------------------------- /roms/revival/games/Merlin [David Winter].txt: -------------------------------------------------------------------------------- 1 | Merlin, by: David Winter 2 | 3 | This is the SIMON game. The goal is to remember in which order the squares are lighted. The game begins by lighting 4 random squares, and then asks you to light the squares in the correct order. 4 | You win a level when you give the exact order, and each increasing level shows a additionnal square. The game ends when you light an incorrect square. Keys are 4 and 5 for the two upper squares, then 1 and 2 for the two other ones. 5 | -------------------------------------------------------------------------------- /roms/revival/games/Hi-Lo [Jef Winsor, 1978].txt: -------------------------------------------------------------------------------- 1 | Hi-Lo, by: Jef Winsor 2 | 3 | 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. 4 | -------------------------------------------------------------------------------- /roms/revival/programs/Clock Program [Bill Fisher, 1981].txt: -------------------------------------------------------------------------------- 1 | This neat little clock program is the perfect program to run when someone asks: 2 | "That's nice, but what can your computer DO?" 3 | The program features "reverse" video numerals on the screen, which is a nice change from the 4 | usual white numbers on a black background. 5 | 6 | Instructions: 7 | - Type six digits on the hex keypad for the desired clock starting time, using 23 hour format (ex.173055) 8 | - Hit any hex key to start clock running at the above time setting. 9 | -------------------------------------------------------------------------------- /roms/revival/games/Kaleidoscope [Joseph Weisbecker, 1978].txt: -------------------------------------------------------------------------------- 1 | VIP Kaleidoscope, by: Joseph Weisbecker 2 | 3 | Four spots appear in a group at the center of the screen. Press keys 2, 4, 6, or 8 to create a pattern. Keep your pattern smaller than 138 key depressions. 4 | 5 | Push key 0 to terminate pattern entry. Pushing key 0 causes your pattern to be continuously repeated forming a fascinating, changing kaleidoscope display on the screen. A "44444442220" key sequence provides a very nice effect Experiment to 6 | find other nice patterns. 7 | 8 | -------------------------------------------------------------------------------- /roms/revival/games/Connect 4 [David Winter].txt: -------------------------------------------------------------------------------- 1 | Connect 4, by: David Winter 2 | 3 | This game is for two players. The goal is to align 4 coins in the 4 | game area. Each player's coins are colored. When you drop a coin, 5 | it is paced on the latest dropped coin in the same column, or at 6 | the bottom if the column is empty. Once the column is full, you 7 | cannot place any more coins in it. To select a column, use 4 and 6. 8 | 9 | To drop a coin, use 5. There is no winner detection yet. This will 10 | be soon avalaible (Hey! I don't spend my life on CHIP8 !). 11 | -------------------------------------------------------------------------------- /roms/revival/programs/Life [GV Samways, 1980].txt: -------------------------------------------------------------------------------- 1 | Life, by: G.V. Samways 2 | 3 | This is a display of cell growth, in accordance with the following rules: 4 | 1. A cell is born if 3 cells are adjecent to an empty space. 5 | 2. A cell lives if 2 or 3 cells are adjacent, and dies otherwise. 6 | 3. All events take place simultaneously. 7 | 8 | To start the game, you make a pattern by entering the cell coordinates, first 9 | the "Y"from 0-7 downwards, then the "X" from 0-F across. 10 | F initialises the program, and the number of scans is entered plus one, so that 1 gives 0 scans 11 | to F giving 14, and 0 giving 255. The sit back and watch the colony live, or die. 12 | -------------------------------------------------------------------------------- /roms/revival/demos/Maze [David Winter, 199x].txt: -------------------------------------------------------------------------------- 1 | Maze, by David Winter 2 | 3 | Drawing a random maze like this one consists in drawing random diagonal 4 | lines. There are two possibilities: right-to-left line, and left-to-right 5 | line. Each line is composed of a 4*4 bitmap. As the lines must form non- 6 | circular angles, the two bitmaps won't be '/' and '\'. The first one 7 | (right line) will be a little bit modified. See at the end of this source. 8 | 9 | The maze is composed of 16 lines (as the bitmaps are 4 pixels high), each 10 | line consists of 32 bitmaps. 11 | Bitmaps are drawn in random mode. We choose a random value (0 or 1). 12 | If it is 1, we draw a left line bitmap. If it is 0, we draw a right one. 13 | -------------------------------------------------------------------------------- /roms/revival/demos/Maze (alt) [David Winter, 199x].txt: -------------------------------------------------------------------------------- 1 | Maze, by David Winter 2 | 3 | Drawing a random maze like this one consists in drawing random diagonal 4 | lines. There are two possibilities: right-to-left line, and left-to-right 5 | line. Each line is composed of a 4*4 bitmap. As the lines must form non- 6 | circular angles, the two bitmaps won't be '/' and '\'. The first one 7 | (right line) will be a little bit modified. See at the end of this source. 8 | 9 | The maze is composed of 16 lines (as the bitmaps are 4 pixels high), each 10 | line consists of 32 bitmaps. 11 | Bitmaps are drawn in random mode. We choose a random value (0 or 1). 12 | If it is 1, we draw a left line bitmap. If it is 0, we draw a right one. 13 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | project(JAXE 4 | VERSION 1.0 5 | DESCRIPTION "Just Another Chip-8 Emulator." 6 | LANGUAGES C) 7 | 8 | add_executable("jaxe" 9 | src/main.c 10 | src/chip8.c) 11 | 12 | target_include_directories("jaxe" PUBLIC include) 13 | target_compile_options("jaxe" PRIVATE -Wall -Wextra -Wpedantic) 14 | 15 | if (WIN32) 16 | target_link_libraries("jaxe" -lmingw32 -lSDL2main -lSDL2 SDL2_ttf m) 17 | else (UNIX) 18 | target_link_libraries("jaxe" -lSDL2 SDL2_ttf m) 19 | endif (WIN32) 20 | 21 | add_executable("test" 22 | tests/test_opcodes.c 23 | src/chip8.c) 24 | 25 | target_include_directories("test" PUBLIC include) 26 | target_compile_options("test" PRIVATE -Wall -Wextra -Wpedantic) 27 | target_link_libraries("test" -lm) -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | CORE_DIR := $(LOCAL_PATH)/.. 4 | SOURCE_DIR := $(CORE_DIR)/src 5 | INCFLAGS := -I$(SOURCE_DIR)/deps/libretro-common/include -I$(SOURCE_DIR)/../include 6 | INCLUDES := 7 | SOURCES_C := 8 | SOURCES_CXX := 9 | 10 | include $(CORE_DIR)/Makefile.common 11 | 12 | COREFLAGS := -DANDROID -D__LIBRETRO__ -DHAVE_STRINGS_H -DRIGHTSHIFT_IS_SAR $(INCFLAGS) 13 | GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" 14 | ifneq ($(GIT_VERSION)," unknown") 15 | COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" 16 | endif 17 | 18 | include $(CLEAR_VARS) 19 | LOCAL_MODULE := retro 20 | LOCAL_SRC_FILES := $(SOURCES_C) 21 | LOCAL_CFLAGS := $(COREFLAGS) 22 | LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T 23 | include $(BUILD_SHARED_LIBRARY) 24 | -------------------------------------------------------------------------------- /roms/revival/programs/Random Number Test [Matthew Mikolay, 2010].txt: -------------------------------------------------------------------------------- 1 | Hey guys! 2 | 3 | I don't know if any of you will be interested in this, but I wrote this small 4 | program while coding my game to test out the random number generator. I wanted 5 | to see if there is a chance that zero will show up as the random number, and it 6 | turns out it can. 7 | 8 | Anyway, when you run the program, it brings a random number up on the screen. 9 | When you press any of the keys, it brings another random number up on the 10 | screen. This goes on until you quit the program. 11 | 12 | Address 0x202 holds the C0FF instruction, which commands the CHIP-8 interpreter 13 | to set V0 to a random number with the mask 0xFF. This yields 256 different 14 | possible numbers (0-255). If C0FF is changed to something like C00A, then the 15 | mask will change. This would yield 11 different possible numbers (0-10). 16 | 17 | -Matt -------------------------------------------------------------------------------- /roms/revival/games/Sum Fun [Joyce Weisbecker].txt: -------------------------------------------------------------------------------- 1 | 11. VIP Sum Fun 2 | 3 | The object of this game is to add up the three digits 4 | which appear in the middle of the screen and then hit 5 | the key representing the total as fast as you can. 6 | 7 | How to Play VIP Sum FUn 8 | 9 | 1. Load the CHIP-8 interpreter at 0000-01FF and 10 | the game starting at 0200. 11 | 12 | 2. Turn RUN switch on. 13 | 14 | 3. You get twenty sets of three digits per game and 15 | between zero and ten points per set. The faster you 16 | enter the correct total, the more points you win. 17 | 18 | 4. If you wait more that 3 seconds, you get zero points. 19 | The correct sum is shown above the three digits after 20 | you enter it, and there is a pause before the next 21 | set appears. 22 | 23 | 5. The score is shown in the upper right-hand corner of 24 | the screen. The maximum number of points you can score 25 | is 200. Between 120 and 159 points is above average. 26 | A score of 160 or higher is outstanding. 27 | 28 | -------------------------------------------------------------------------------- /roms/revival/games/Slide [Joyce Weisbecker].txt: -------------------------------------------------------------------------------- 1 | 5. VIP SLIDE 2 | 3 | Slide is a two-person game. Each player tries to slide a "puck" over the high-scoring 4 | "spots" without hitting the back wall. 5 | 6 | How To Play VIP Slide 7 | 8 | 1. Load the CHIP-8 interpretor at 0000-01FF 9 | and the game starting at 0200. 10 | 11 | 2. Turn RUN switch on. 12 | 13 | 3. The puck moves up and down randomly. Press "0" key to stop the puck. The puck 14 | will move towards the spots after you release the key. The longer you hold the 15 | key down, the further the puck travels (maximum time approximately 2.5 seconds). 16 | 17 | 4. You get 2 points for hitting the first spot, 4 points for either of the next two 18 | spots and 8 points for either of the last two. The highest score possible is 216 19 | (two spots can be hit on one slide). 20 | 21 | 5. If you hit the back wall, though, you get zero points for that slide, even though 22 | you've hit a spot. 23 | 24 | 6. Each player gets 3 pucks per turn and 6 turns in a game. 25 | -------------------------------------------------------------------------------- /roms/revival/games/Hidden [David Winter, 1996].txt: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | HIDDEN! 3 | Copyright (1996) by David WINTER 4 | ---------------------------------------- 5 | 6 | 7 | HIDDEN is a "memory" game. It is very simple to play. 8 | 9 | The rules are as follow: your goal is to find all the identical cards 10 | in a minimum time. 11 | 12 | You are playing in a 4*4 card grid. You can see only two cards at the 13 | same time. Once this time passed, these two cards will remain shown 14 | if they are identical, otherwise they will be hidden again. 15 | 16 | When the game is finished, two scores are shown: 17 | SC is your score, corresponding to the number of tries 18 | HI is the best score (smallest number of tries made to finish) 19 | 20 | The keys are: 21 | 22 | [2] : More DOWN 23 | [4] : Move LEFT 24 | [5] : Show card 25 | [6] : Move RIGHT 26 | [8] : Move UP 27 | 28 | Enjoy !!! 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2021 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /roms/revival/games/Sequence Shoot [Joyce Weisbecker].txt: -------------------------------------------------------------------------------- 1 | 12. VIP Sequence Shoot 2 | 3 | You score points by having the sharp-shooter hit the targets in the proper sequence. 4 | 5 | How to Play VIP Sequence Shoot 6 | 7 | 1. Load the CHIP-8 interpreter at 0000-01FF and 8 | the game starting at 0200. 9 | 10 | 2. Turn RUN switch on. 11 | 12 | 3. Pressing the Key C causes the little man to shoot the top target, Key D shoots the 13 | one below it, Key E the next lower and Key F the bottom target. 14 | 15 | 4. One of the four targets flashes and the computer waits for you to shoot it. When 16 | you press teh correct key, you get one point. Then two flash, on after the other. 17 | Shoot the one that flashed first, then shoot the other. This gives you two more 18 | points. Three targets (when hit in the same order as they flashed) add three 19 | points to your score. 20 | 21 | 5. Each time you shoot such a series of targets in proper sequence, your score 22 | increases by the number of targets you hit. An the next series you see is longer 23 | by one target. The maximum length of sequence is 22 targets, that is a score of 254. 24 | 25 | 6. Improper sequencing of shots in any series ends the game. -------------------------------------------------------------------------------- /roms/revival/games/Rush Hour [Hap, 2006].txt: -------------------------------------------------------------------------------- 1 | Rush Hour (v1.1) for CHIP-8 by hap 08-02-08, http://hap.samor.nl/ 2 | Originally released on 17-12-06. Version 1.1 improves a few things. 3 | Based on a boardgame by Nobuyuki Yoshigahara "Nob" and ThinkFun, 4 | http://www.thinkfun.com/ 5 | 6 | This game contains 170 puzzles. Most were taken from the original cardsets, 7 | some were made by me, and some were generated with Michel's PyTraffic, 8 | http://alpha.uhasselt.be/Research/Algebra/Members/pytraffic . Refer to 9 | the source code for detailed information on this. 10 | 11 | HOW TO PLAY 12 | =========== 13 | 14 | The goal of the game is to slide the arrow block(s) out of the 6*6 grid. 15 | Completing 10 boards will be awarded with the inclusion of the next boardset(s) 16 | as seen from the connections on the boardset select screen, a password will be 17 | given so you don't have to complete the game in a single session. 18 | 19 | HEX key PC key* Use 20 | --------------------------- 21 | 5 W up 22 | 8 S down 23 | 7 A left 24 | 9 D right 25 | A Z ok/hold to slide 26 | 1 1 option(in-game)/back 27 | 28 | * = for interpreters that have the 4*4 keypad at 1234/QWER/ASDF/ZXCV. 29 | -------------------------------------------------------------------------------- /roms/revival/games/UFO [Lutz V, 1992].txt: -------------------------------------------------------------------------------- 1 | Here's how to play UFO: 2 | 3 | You have a stationary missle launcher at the bottom of the screen. You 4 | can shoot in three directions; left diagonal, straight up, and right 5 | diagonal.. using the keys 4, 5, and 6 respectively.. You try to hit 6 | one of two objects flying by.. at apparently varying speeds.. Your 7 | score is displayed on your left, the number of missles you have left 8 | is displayed on your right. (You get 15).. 9 | 10 | This game ("UFO") is not new. I have a copy of it from 1977 (!). It 11 | was one of the original CHIP-8 games on the audio cassette that was 12 | included when I bought my first computer, the Finnish-made Telmac 13 | 1800. 14 | 15 | It was also the first real program to run under CHIP-48 (it was used 16 | as a test case during the development of the CHIP-48 interpreter). The 17 | reason I have not posted it to the net myself is that I have no idea 18 | about its copyright status. I don't even know where it originated 19 | (RCA, perhaps?). 20 | 21 | The cassette that was bundled with the Telmac 1800 contains more than 22 | a dozen CHIP-8 programs. If someone could convince me that these 23 | programs are indeed freely redistributable, the other programs could 24 | also be posted. Otherwise, perhaps this one shouldn't have been. 25 | -------------------------------------------------------------------------------- /roms/revival/games/Animal Race [Brian Astle].txt: -------------------------------------------------------------------------------- 1 | 9. VIP Animal Race 2 | 3 | Animal Race is a fun game for one person, with an element of luck - sure to 4 | put a smile on your face. Five different animals race against one another 5 | and you have the chance to test your expertise at picking the winner. 6 | 7 | 8 | How To Play Animal Race 9 | 10 | 1. Load the CHIP-8 interpretor at 0000-01FF 11 | and the game starting at 0200. 12 | 13 | 2. Turn RUN switch on. 14 | 15 | 3. Wait until the animals are lined up and read to start, then select an animal 16 | by pressing a letter A through E. A mark will appear to the left of the 17 | animal to remind you of the one you have selected. 18 | 19 | 4. Decide how much you want to bet (up to a limit of $9), then press that key. 20 | 21 | 5. After the race is over, press zero (or any key) to start the next race. 22 | Your winnings or losses will be computed and the new total displayed at 23 | the begining of the next race. 24 | 25 | Hints for expert players 26 | All animals move at approximately the same speed, but they start from different 27 | positions. The odds for each animal are related to the starting position but 28 | include a random element. Some races favor the player and you should bet up to 29 | the limit on these. Some races are unfavorable and you should bet carefully 30 | on these. 31 | 32 | You can win the game by accumulating $256 or more. 33 | -------------------------------------------------------------------------------- /roms/revival/games/Tetris [Fran Dachille, 1991].txt: -------------------------------------------------------------------------------- 1 | TETRIS 2 | by Fran Dachille 3 | 4 | This is my first release of the famous Tetris game on the HP48S. I was 5 | inspired by the lack enjoyable games for our favorite handheld. [Not since the 6 | Goodies Disks have been available! -jkh-] This game, though it lacks some of 7 | the whistles and bangs of fancy versions, performs on par with quality arcade 8 | versions (nota bene -> SPEED). At my college, every person who picks up my 9 | calculator is immediately hooked for hours. 10 | 11 | This version is written for the CHIP48 game interpreter (c) 12 | copyright 1990 Andreas Gustafsson. 13 | 14 | The 4 key is left rotate, 5 - left move, 6 - right move, 1 15 | - drop, ENTER - restart, DROP - end. After every 5 lines, the speed 16 | increases slightly and peaks at 45 lines. 17 | 18 | There is room for improvement in this version. Notably, background 19 | pictures, a pause key (for now, hold ON), two rotate keys, various 20 | starting skill levels, a B version which starts with randomn blocks, 21 | finishing graphics, and high scores, just to name a few. 22 | 23 | In order for improvements, I need to know if there is reasonable 24 | demand. If this game is worth playing for hours upon hours, please let 25 | me know. If you wish to support the improvements, want future versions, 26 | and want to see other games ported to the HP48S, send $5.00 to: 27 | 28 | FRAN DACHILLE 29 | WEBB INSTITUTE 30 | GLEN COVE, NY 11542 31 | 32 | -------------------------------------------------------------------------------- /roms/revival/README: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------------------- 2 | ///////////////// 3 | ////////////////// 4 | //// //// 5 | //// /////////// 6 | //// /////////// 7 | //// //// 8 | //// /////////// 9 | //// ////////// 10 | 11 | www.chip8.com 12 | ----------------------------------------------------------------------------- 13 | Title : Chip-8 Program Pack 14 | Author : Revival Studios 15 | Genre : Compilation 16 | System : Chip-8/SuperChip/MegaChip8 17 | Last updated : 16/04/2011 18 | Product ID : RS-C8000 19 | ----------------------------------------------------------------------------- 20 | 21 | This is a collection of all CHIP-8 / SuperChip / MegaChip8 programs i found scattered around the web. I've researched and added information about the original author and year of release for most roms. 22 | The roms are divided in the following categories: 23 | 24 | - CHIP-8 Games 25 | - CHIP-8 Demo's 26 | - CHIP-8 Test programs 27 | - CHIP-8 Hires (hardware compatible 64x64 hires mode) 28 | - CHIP-8X/Hybrid games 29 | - SuperChip Games 30 | - SuperChip Demo's 31 | - SuperChip Test programs 32 | - MegaChip Games 33 | - MegaChip Demo's 34 | 35 | I've also converted various listings from paper to binary form and added them to this package. 36 | 37 | Running the roms: 38 | ----------------- 39 | These roms will run in most CHIP-8 emulators and/or the original machines (CHIP8). 40 | 41 | Distribution: 42 | ------------- 43 | This package can be freely distributed in its original form. 44 | If you have any additions for this pack, let me know. 45 | 46 | Watch out for more releases soon! 47 | 48 | 49 | Revival Studios 50 | 51 | -------------------------------------------------------------------------------- /fonts/license.txt: -------------------------------------------------------------------------------- 1 | Thanks for downloading one of codeman38's retro video game fonts, as seen on Memepool, BoingBoing, and all around the blogosphere. 2 | 3 | So, you're wondering what the license is for these fonts? Pretty simple; it's based upon that used for Bitstream's Vera font set . 4 | 5 | Basically, here are the key points summarized, in as little legalese as possible; I hate reading license agreements as much as you probably do: 6 | 7 | With one specific exception, you have full permission to bundle these fonts in your own free or commercial projects-- and by projects, I'm referring to not just software but also electronic documents and print publications. 8 | 9 | So what's the exception? Simple: you can't re-sell these fonts in a commercial font collection. I've seen too many font CDs for sale in stores that are just a repackaging of thousands of freeware fonts found on the internet, and in my mind, that's quite a bit like highway robbery. Note that this *only* applies to products that are font collections in and of themselves; you may freely bundle these fonts with an operating system, application program, or the like. 10 | 11 | Feel free to modify these fonts and even to release the modified versions, as long as you change the original font names (to ensure consistency among people with the font installed) and as long as you give credit somewhere in the font file to codeman38 or zone38.net. I may even incorporate these changes into a later version of my fonts if you wish to send me the modifed fonts via e-mail. 12 | 13 | Also, feel free to mirror these fonts on your own site, as long as you make it reasonably clear that these fonts are not your own work. I'm not asking for much; linking to zone38.net or even just mentioning the nickname codeman38 should be enough. 14 | 15 | Well, that pretty much sums it up... so without further ado, install and enjoy these fonts from the golden age of video games. 16 | 17 | [ codeman38 | cody@zone38.net | http://www.zone38.net/ ] -------------------------------------------------------------------------------- /roms/revival/games/Worm V4 [RB-Revival Studios, 2007].txt: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------------------- 2 | ///////////////// 3 | ////////////////// 4 | //// //// 5 | //// /////////// 6 | //// /////////// 7 | //// //// 8 | //// /////////// 9 | //// ////////// 10 | 11 | www.revival-studios.com 12 | ----------------------------------------------------------------------------- 13 | Title : SuperWorm V4 14 | Author : RB (Original game) 15 | Updates and fixes by: Martijn Wenting / Revival Studios 16 | Genre : Game 17 | System : Chip-8 / SuperChip8 18 | Date : 10/08/2007 19 | Product ID : RS-C8001 20 | ----------------------------------------------------------------------------- 21 | 22 | All the contents of this package are (c)Copyright 2007 Revival Studios. 23 | Original game: SuperWorm is (c)Copyright 1992 RB 24 | 25 | The contents of the package may only be spread in its original form, and may not be 26 | published or distributed otherwise without the written permission of the authors. 27 | 28 | Description: 29 | ------------ 30 | SuperWorm V4 is an update of the SuperChip8 game: Worm3 by RB. 31 | The original game was only for SuperChip, so i've created a Chip-8 port. 32 | It also includes several speed fixes and a new control system. 33 | 34 | Running the game: 35 | ----------------- 36 | Use the Megachip emulator or any other Chip-8/SuperChip compatible emulator to run the game. 37 | 38 | Credits: 39 | -------- 40 | Chip-8 version, Updates and fixes by: Martijn Wenting 41 | Original game by: RB 42 | 43 | Distribution: 44 | ------------- 45 | This package can be freely distributed in its original form. 46 | If you would like to include this game in your rom package, please let me know. 47 | 48 | Watch out for more releases soon! 49 | 50 | 51 | Martijn Wenting / Revival Studios 52 | 53 | -------------------------------------------------------------------------------- /roms/revival/games/Mastermind FourRow (Robert Lindley, 1978).txt: -------------------------------------------------------------------------------- 1 | MASTERMIND 2 | by 3 | Robert Lindley 4 | 5 | I have progranmed two versLons of the game Mastermind. This game is distributed by Invicta Plastics, Suite 940, 200 - 5th Ave., New York, NY 10010, and is available most pLaces where toys and games are sold. 6 | For complete details of the game, please refer to their instructions. The information given here refers to this particular VIP iurplementation. 7 | The two versions are essentially the same except that the first has a four number code and the second has a five nr:mber hidden code selected at random.. In the four number version, the digits one through six are used and in the five number version the diglts zero through seven are used. 8 | While the game is running, the other hex keys, except key F, have no effect. Key F is used when you change your mind and want to change your input. This key erases the current partial entry. 9 | The game starts by displaying a series of dashes arranged in rows. As the game progresses, the player attempts to deduce the hidden code by replacing the dashes with digits entered via the hex keyboard. Each tlme a hex key is used, the selected digit replaces a dash in one vertical column. This vertical column is one guess of the ten allowed to deduce 10 | the hidden number. When the bottom dash in any column is replaced by a digit, that try is imidiately scored. This score appears below the current column. If any digit in the column exactly matches the hidden number digit in the same row, a broken bar will appear. then four or five (one for each row in the game) appear, the hidden number has been deduced 11 | and it will be revealed at the right end of the screen. If any digit in the column matches a hidden digit, but in an incorrect erorr, a white bar will appear. Note that the scoring is across all rows. For example, if there are two fives in a column and one of then is in the correct row and there is only one five in the hidden numbers, one broken bar will appear. 12 | When all allowed ten tries have been used, the hidden number will be revealed. 13 | 14 | -------------------------------------------------------------------------------- /roms/revival/games/Astro Dodge [Revival Studios, 2008].txt: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------------------- 2 | ///////////////// 3 | ////////////////// 4 | //// //// 5 | //// /////////// 6 | //// /////////// 7 | //// //// 8 | //// /////////// 9 | //// ////////// 10 | 11 | www.revival-studios.com 12 | ----------------------------------------------------------------------------- 13 | Title : Astro Dodge 14 | Author : Martijn Wenting / Revival Studios 15 | Genre : Game 16 | System : Chip8 / SuperChip8 17 | Date : 18/12/2008 18 | Product ID : RS-C8003 19 | ----------------------------------------------------------------------------- 20 | 21 | All the contents of this package are (c)Copyright 2008 Revival Studios. 22 | 23 | The contents of the package may only be spread in its original form, and may not be 24 | published or distributed otherwise without the written permission of the authors. 25 | 26 | Description: 27 | ------------ 28 | Astro Dodge is an arcade game for the Chip8 and SuperChip8 systems. 29 | Both versions of the game are included in this package. 30 | 31 | Your goal is to make your way through the asteroids field and dodge the asteroids, scoring points for each asteroid you are able to dodge. 32 | Button 2,4,6,8 will move your ship, button 5 will start the game. 33 | 34 | Running the game(s): 35 | -------------------- 36 | The CHIP8 version of the game has been programmed to be compatible with original hardware like the Cosmac VIP and Telmac 1800. 37 | Use the Megachip emulator or any other Chip8/SuperChip compatible emulator to run the game(s). 38 | 39 | Credits: 40 | -------- 41 | Programming and Graphics by: Martijn Wenting 42 | 43 | Distribution: 44 | ------------- 45 | This package can be freely distributed in its original form. 46 | If you would like to include this game in your rom package, please let me know. 47 | 48 | Watch out for more releases soon! 49 | 50 | 51 | Martijn Wenting / Revival Studios 52 | 53 | -------------------------------------------------------------------------------- /roms/revival/games/Reversi [Philip Baltzer].txt: -------------------------------------------------------------------------------- 1 | 6. VIP REVERSI 2 | Reversi is a game over 100 years old, which has become popular recently under the 3 | name Othello. The game is played on a 8x8 square, using two kinds of markers. 4 | In VIP Reversi one player has the open markers and the other player the solid 5 | markers. The score for either player at any time is the total number of his markers 6 | on the square. 7 | 8 | How to play VIP Reversi 9 | 10 | 1. Load the CHIP-8 interpretor at 0000-01FF 11 | and the game starting at 0200. 12 | 13 | 2. Turn RUN switch on. 14 | 15 | 3. The 8x8 square will be formed and the starting marker configuration shown, having 16 | two of each kind of marker in the center four locations of the square. The starting 17 | score for each player is shown as 02 above a line of his markers. 18 | 19 | 4. Your VIP indicates the player's turn by blinking that player's score and also blinking 20 | a cursor dot in the 8x8 square. A player moves the blinking cursor dot in the 8x8 21 | square by pressing the direction keys 1-4 and 6-9 as shown. (VIPG1-6.JPG) 22 | 23 | 5. When the cursor-dot is properly located, the player presses key 5 to place his marker 24 | on the square. You will find that your VIP will not allow you to make a non-valid 25 | play. The only placements allowed are onces for which at least one of the other 26 | player's markers is surrounded between an existing marker of your own and your new 27 | marker being placed. All these markers must be in consecutive positions on the 28 | square and can be in any horizontal, vertical or diagonal direction. Once a new 29 | marker has been placed, your VIP will change all such surrounded markers of the 30 | other player to your kind and change the scores. 31 | 32 | 6. Sometimes it may not be possible for a player to make a valid move. If this happens 33 | he must forfeit his move by pressing the "F" key! The game ends when neither player 34 | can play or when the 8x8 square is completely filled with markers. The goal is to 35 | end the game with the highest score. Do not be discouraged if during the game you 36 | seem to be losing because this is a game with dramatic reversals! Develop a winning 37 | strategem and become a champion!! 38 | -------------------------------------------------------------------------------- /roms/revival/demos/Trip8 Demo (2008) [Revival Studios].txt: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------------------- 2 | ///////////////// 3 | ////////////////// 4 | //// //// 5 | //// /////////// 6 | //// /////////// 7 | //// //// 8 | //// /////////// 9 | //// ////////// 10 | 11 | www.revival-studios.com 12 | ----------------------------------------------------------------------------- 13 | Title : Trip8 / SuperTrip8 demo 14 | Author : Martijn Wenting / Revival Studios 15 | Genre : Demo 16 | System : Chip-8 / SuperChip8 17 | Date : 14/10/2008 18 | Product ID : RS-C8004 19 | ----------------------------------------------------------------------------- 20 | 21 | All the contents of this package are (c)Copyright 2008 Revival Studios. 22 | 23 | The contents of the package may only be spread in its original form, and may not be 24 | published or distributed otherwise without the written permission of the authors. 25 | 26 | Description: 27 | ------------ 28 | The Trip8/SuperTrip8 demo are demo's for the Chip-8 and SuperChip8 systems. The demo consists of an intro, 3D vectorballs, and 4 randomized dot-effects. 29 | 30 | Writing a demo for the original Chip-8 interpreter was a real pain, since your framerate basically drops in half for every sprite you need to draw. So even clearing and redrawing a few dots will cause the framerate to drop to near zero :) Originally the demo was going to be bigger and there were much more graphical effects programmed/prototyped, but a lot of these effects turned out to be too much for the original unoptimized Chip-8 interpreters to handle. 31 | 32 | Running the Demo: 33 | ----------------- 34 | Use the Megachip emulator or any other Chip-8/SuperChip compatible emulator to run the slideshow. 35 | 36 | Credits: 37 | -------- 38 | Programming/Graphics/Design by: Martijn Wenting 39 | 40 | Distribution: 41 | ------------- 42 | This package can be freely distributed in its original form. 43 | If you would like to include this slideshow in your rom package, please let me know. 44 | 45 | Watch out for more releases soon! 46 | 47 | 48 | Martijn Wenting / Revival Studios 49 | 50 | -------------------------------------------------------------------------------- /roms/revival/games/Bowling [Gooitzen van der Wal].txt: -------------------------------------------------------------------------------- 1 | 7. VIP Bowling 2 | 3 | Bowling is a great game for recreation and competion requiring skill and a little 4 | bit of luck. This program simulates bowling closely with regular scoring and the 5 | option of using three different spins on the ball. 6 | 7 | How to play VIP Bowling 8 | 9 | 1. Load the CHIP-8 interpretor at 0000-01FF 10 | and the game starting at 0200. 11 | 12 | 2. Turn RUN switch on. 13 | 14 | 3. Up to 6 persons can compete. Make the choice by pressing Key 1,2,3,4,5 or 6. 15 | The players will be referred to as A,B,C,D,E and F. 16 | 17 | 4. It is possible to play up to 10 frames in one game. Make your choice of the 18 | number of frames by pressing Key 1,2,3,4,5,6,7,8,9 or 0 (for 10 frames). 19 | 20 | 5. It is possible to choose 3 ball speeds (Key 1,2 or 3). The speed option only 21 | affects the ball after it is released. 22 | 23 | 6. At the start of a player's turn, the video will display whose turn it is and 24 | whether he is working on a spare, strike, 2 strikes or nothing. 25 | Release the ball by pressing on of the following keys: Key 1,2,3,5,7,8 or 9. 26 | -Key 5 will cause a straight ball. 27 | -Key 1,2 and 3 will cause the ball to spin up. 28 | -Key 1 before the first pin 29 | -Key 2 after the first pin 30 | -Key 3 after the second pin 31 | -Key 7,8 and 9 will cause the ball to spin up. 32 | -Key 7 before the first pin 33 | -Key 8 after the first pin 34 | -Key 9 after the second pin 35 | 36 | 7. After the player's turn ends, the video will display whose turn it was, the 37 | frame, and the score. The next players follows the instructions at 6 above. 38 | 39 | 8. After all players have had their turn in a frame, the video will display the 40 | total of each player and whether he is working on a spare, 1 strike, 2 strikes 41 | or nothing. It will display the frame number and the total number of frames 42 | to go (unless the last frame was played). 43 | After pressing Any key, player A can start in the next frame. Continue with 44 | instruction 6 above. 45 | 46 | 9. If all frames in the game have been finished, press any key again. The player's 47 | who are still working on a spare will recieve 1 more ball, and those working 48 | on 1 or 2 strikes will receive 2 balls. 49 | 50 | 10. After all players have finished the game, the final score will be displayed. 51 | 52 | 53 | -------------------------------------------------------------------------------- /roms/revival/games/Biorhythm [Jef Winsor].txt: -------------------------------------------------------------------------------- 1 | 13. VIP Biorhythm 2 | 3 | The theory of Biorhythm states that there are thre predominant cycles that can influence 4 | human behavior. These include a 23-day physical cycle, a 28-day emotional cycle and a 5 | 33-day intellectual cycle. All three cycles start at birth and continue throughout life. 6 | 7 | Each cycle consists of a positive and a negative period. Physical, Emotional and 8 | Intellectual aspects are enhanced during positive periods. Poor performance is 9 | indicated by the negative period of a cycle. 10 | 11 | A critical day occurs on the crossover from the positive to the negative period or 12 | vice versa. A critical day indicates instability in a particular aspect. 13 | 14 | 15 | How to Use VIP Biorhythm 16 | 17 | 1. Load the CHIP-8 interpreter at 0000-01FF and 18 | the game starting at 0200. 19 | 20 | 2. Turn RUN switch on. 21 | 22 | 3. Enter birthdate using 2-digit month, 2-digit day, and 4-digit year. 23 | 24 | 4. Enter start date using 2-digit month, 2-digit day, and 4-digit year. The start date 25 | indicates the first day of the 32-day Biorhythm chart the program will generate. 26 | 27 | 5. After a period of calculation proportional to the span of time involved, the three 28 | cycle curves will be shown for a 32-day period. Each horizontal bit position 29 | represents one day in the cycle. The start day, on the left, and every seventh 30 | day are indicated by week markers. The first day of a positive or negative period 31 | is a critical day. 32 | 33 | 6. To advance the start date, hold key F down until the desired date is reached. 34 | To decrement the start date, hold key B down. These functions allow changing the 35 | start date slightly without reentering all the dates and waiting for the calculations 36 | to be preformed. 37 | 38 | 7. Press Key 0 to clear the screen and enter a new set of dates. 39 | 40 | 41 | 42 | See VIPG1-13.jpg 43 | 44 | 45 | INTERPRETATION 46 | 47 | 48 | Physical Emotional Intellectual 49 | 50 | Positive Period Strong, Good moods, Good Judgement 51 | (Up) Vigorous Cooperative Sharp Mentally 52 | 53 | Negative Period Tire easily, Low Enthusiasm, Low attentiveness 54 | (Down) Less Stamina Feelings Subdued and concentration 55 | 56 | Critical Days Susceptible to injury emotionally unstable, Poor memory, 57 | (Crossover) or Illness, Upset easily Prone to mistakes 58 | Low endurance 59 | -------------------------------------------------------------------------------- /roms/revival/games/Deflection [John Fort].txt: -------------------------------------------------------------------------------- 1 | 8. VIP DEFLECTION 2 | 3 | In the VIP Deflection game you position mirrors anywhere on the display screen. 4 | The object of the game is to deflect a ball of the mirrors a maximum number of 5 | times before hitting the target. 6 | 7 | The number of deflections times the target number gives you deflection points. 8 | These are added to your previous point total. If you fail to hit the target you 9 | get no points. The winner of the game is the player who accumulates 257 or 10 | more deflected points. 11 | 12 | How to Play VIP Deflection 13 | 14 | 1. Load the CHIP-8 interpretor at 0000-01FF 15 | and the game starting at 0200. 16 | 17 | 2. Turn RUN switch on. 18 | 19 | 3. After the scores appear a letter, the target with a number and a ball. The 20 | letter signifies the player who will program the mirrors. This sequence will 21 | be repeated until there is a winner. 22 | 23 | 4. To program the mirrors, select the proper mirror type by using Table 1 (VIP1-8.jpg) 24 | as a guide. Key 1 will place a horizontal mirror on the board. Key 2 selects a 25 | vertical mirror, Key 3 a slant-left mirror, Key 4 a slant-right mirror. 26 | 27 | 5. After a mirror has been selected, you may position the mirror by using keys 1 28 | through 4 and 6 through 9 (see Table 2 for movement of a mirror). Once a 29 | mirror has been selected and positioned, it may be fixed into position by pressing 30 | Key 5. 31 | 32 | Table 2 - Mirror Positioning and Ball Direction 33 | Key Selection | Positioning and Direction 34 | ------------------+--------------------------- 35 | 1 | up and to the left 36 | 2 | up 37 | 3 | up and to the right 38 | 4 | left 39 | 5 | right 40 | 7 | down and to the left 41 | 8 | down 42 | 9 | down and to the right 43 | 44 | 6. You may position up to 10 mirrors on the game board. After you have the maximum 45 | amount on the board you must press Key 0 to progress to the fire mode. If you 46 | wish to progress to the fire mode with less than 10 mirrors programmed, you may 47 | do so by pressing Key 0. You fire the ball in the direction you want by using 48 | Keys 1 through 4 and Keys 6 through 9 (see Table 2). 49 | 50 | 7. After the ball has reached the target or leaves the game board, the player's 51 | score is computed and displayed and a new ball and target appear. 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /roms/revival/games/Most Dangerous Game [Peter Maruhnic].txt: -------------------------------------------------------------------------------- 1 | 10. VIP Most Dangerous Game 2 | 3 | VIP Most Dangerous Game pits a hunter against a hunted in a maze. The hunter must 4 | shoot the hunted before either time runs out or the hunted escapes the maze. 5 | However, neither the hunted nor the hunter can see a wall in the maze until he runs 6 | into it. There is always at least one path through the maze. 7 | 8 | How To Play VIP Most Dangerous Game 9 | 10 | 1. Load the CHIP-8 interpretor at 0000-01FF 11 | and the game starting at 0200. 12 | 13 | 2. Turn RUN switch on. 14 | 15 | 3. Hunted's turn: 16 | When the arrow appears in the lower left, it is the hunted's turn. Keys 2-4-6-8 17 | control direction (up-left-right-down, respectively). The hunted continues to 18 | move until a) he makes 5 moves, b) he hits a wall or c) key 0 is pressed. 19 | 20 | 4. Hunter's turn 21 | When the arrow appears in the lower right, it is the hunter's turn. The hunter's 22 | turn consists of two modes, the move and the shoot. Keys 2-4-6-8 and 0 control both 23 | modes. Like the hunted, the hunter continues to move until a) he makes 3 moves, 24 | b) he hits a wall or c) key 0 is pressed. If he hits the wall, case b), he cannot 25 | fire a bullet. The hunter may fire one of his bullets using the direction keys 26 | 2-4-6-8. The bullet will travel four squares in the corresponding direction, unless 27 | a wall is encountered. If the hunter prefers not to use a bullet, he must press key 0. 28 | 29 | 5. Repeat steps 3 and 4 until: 30 | a) The number of turns (upper left on the display) expire. The hunted wins. 31 | b) The hunter lands on or shoots the hunted. The hunter wins. 32 | c) The hunted lands on hunter, thereby giving up. The hunter wins. 33 | d) The hunted reaches the lower right corner of the maze with at least 1 move 34 | remaining in his turn. The hunted wins, by escaping the maze. 35 | 36 | 6. Variations of VIP Most Dangerous Game may be played by changing certain bytes in 37 | the program. 38 | 39 | Location Default Meaning 40 | 0215 0F Number of turns in the game. 41 | 0217 06 Number of bullets hunter has at start. 42 | 0219 03 Number of moves per turn for the hunter. 43 | 0221 01 Number of squares per move (hunted and hunter). 44 | 022B 05 Number of moves per turn for the hunted. 45 | 024B 01 If zero, walls are invisible. 46 | 0355 04 Number of squares a bullet will go. 47 | 04E3 70 Probability (out of 100Hex) of a wall appearing. 48 | 04EB FE If FF, a wall may appear at previously tested boundaries. 49 | -------------------------------------------------------------------------------- /roms/revival/games/Syzygy [Roy Trevino, 1990].txt: -------------------------------------------------------------------------------- 1 | SYZYGY v0.1 2 | 3 | One of the first games I remember playing on a computer was 4 | called "syzygy" on a now ancient TRS-80 Model 1. It has since 5 | appeared on other computers under various names. Why it was 6 | called syzygy, I have no idea (consult Websters). However, since 7 | the HP48SX has approximately the same memory, graphics and cpu 8 | power as my TRS-80 did (something like 16kB, 128x64, and a 1.2Mhz Z80), 9 | I thought it would be amusing to play it again. Now, approximately 10 | to my recollection, and with many apologies to the original author, 11 | here is a CHIP48 version of SYZYGY. Enough drivel. 12 | 13 | The object of the game is to seek out "targets". You do this with 14 | your syzygy. Initially small, the syzygy will grow by some amount 15 | each time a target is hit. Eventually, your syzygy will 16 | be so long as to make tougher and tougher to get any points (and easier 17 | and easier to get killed). Confused? Just try it. 18 | 19 | Anyways, the syzygy is not allowed to run into anything except targets. 20 | It cannot run into the screen border (if present), or itself (this 21 | includes backing into itself). Fast and immediate death will result. 22 | Don't worry if you die quickly a few times. The keys take a few 23 | minutes to get used to. 24 | 25 | To start: + start/restart game with border 26 | - start/restart borderless game 27 | 28 | To play: 9 up 29 | 6 down 30 | 1 left 31 | 2 right 32 | 33 | [Hint for frustrated beginners: hold left hand on 1 & 2, and right hand on 34 | 6 & 9 keys. Alternate between left hand, right hand, left hand... -jkh-] 35 | 36 | 37 | Fine print (borrowed from Andreas Gustafsson, author of CHIP-48): 38 | 39 | SYZYGY is (c) copyright 1990 by Roy Trevino (RTT) 40 | 41 | Noncommercial distribution allowed, provided that this 42 | copyright message is preserved, and any modified versions 43 | are clearly marked as such. 44 | 45 | SYZYGY, via CHIP-48, makes use of undocumented low-level features 46 | of the HP48SX calculator, and may or may not cause loss of data, 47 | excessive battery drainage, and/or damage to the calcultor 48 | hardware. The Author takes no responsibility whatsoever for 49 | any damage caused by the use of this program. 50 | 51 | THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR 52 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 53 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 54 | PURPOSE. 55 | 56 | Roy 57 | 58 | -------------------------------------------------------------- 59 | Roy Trevino Intel Corp. 60 | E-mail: rtrevino@sedona.intel.com Tel: (602) 554 2816 61 | UUCP: decwrl!apple!oliveb!orc!inews!rtrevino@sedona.intel.com 62 |  -------------------------------------------------------------------------------- /roms/revival/games/Lunar Lander [Udo Pernisz, 1979].txt: -------------------------------------------------------------------------------- 1 | 15. Lunar Lander 2 | 3 | You are descending to the floor of a 250-foot crater. The right side of the TV display 4 | shows amount of fuel, feet from bottom and fall rate per cycle. Lenght of fall rate 5 | cycle changes from about 1/4 second to one second. The fall rate increases by one 6 | foot per second/per cycle. The computer will update the display only at the end of 7 | each cycle. 8 | 9 | The left side of the display shows the Lunar Lander descending from 250 feet. The 10 | Lander will first appear at one of sixteen locations. It will then slowly drop down 11 | the crater. The crater walls have rock formations protruding from them which must 12 | be avoided. If either rocket motor should touch any part of the crater, the Lander 13 | will explode in a cloud of smoke and disintegrate. (Remember, these are atomic 14 | thrusters and react like miniature atomic bombs upon impact). 15 | 16 | When you reach 32 feet, the display will change, and you will see the crater floor. 17 | You must now ladn between the rock formations on the floo and maintain a minimum fall 18 | rate. As you drop your fall rate to zero, you soon discover that the Lander becomes 19 | more and more unstable just as any hovering object would. And now with perfect skill 20 | you guide the ship in for a perfect touch down, or? 21 | 22 | How to Play VIP Lunar Lander 23 | 24 | 1. Load the CHIP-8 interpreter at 0000-01FF and teh game starting at 0200. 25 | 26 | 2. Key 2 controls the thrust of the Lunar Lander. One tone beep equals one pound 27 | of fuel and one foot of thrust. 28 | 29 | 3. Key 4 controlls the horizontal stabilizing engine, and moves the Lander one 30 | foot to the left per one pound of fuel. 31 | 32 | 4. Key 6 controls the stabilization to the right. 33 | 34 | 5. Stabilization controls only react after: (a) a complete fall cycle, or (b) after 35 | the Key 2 thrust control is pressed. You must be aware of this at all times or 36 | you will crash even though either key 4 or 6 is pressed. 37 | 38 | 6. At the end of each cycle, the Lunar Lander will move randomly at the rate of one 39 | foot either right or left. Therefore, as the fall rate approaches zero, the Lander 40 | becomes more uncontrollable, and your horizontal stabilizers react more quickly. 41 | (Just like the real thing). 42 | 43 | 7. If you land too fast, the Lander will bounce and flip over. 44 | 45 | 8. If you run out of fuel, the Lander will crash. 46 | 47 | 9. You will not be allowed to go above 250 feet. If you try to do so, you will just 48 | waste precious fuel. 49 | 50 | 10. Once you reach 32 feet and move into the landing display, you will not be allowed 51 | to rise above 26 feet. Trying to do so will waste more precious fuel. 52 | 53 | 11. Game options 54 | 55 | You may select one of three options at the begining of the game. 56 | 57 | Option 1: You start at 250 feet. You are given 150 pounds of fuel. You must land 58 | at 5 feet per second or less. The initial descent display is easy to 59 | maneuver through. 60 | 61 | Option 2: You start at 250 feet. You have 200 pounds of fuel. You must land at 3 feet 62 | per second or less. The initial descent display is hard to maneuver through. 63 | 64 | Option 3: You start at 32 feet. You have 100 pounds of fuel. You must land at 3 feet 65 | per second or less. This display allows you to practice landing. 66 | 67 | You should consider Option 2 as the complete game when trying for Astronaut Ratings. 68 | 69 | 12. Astronaut Ratings 70 | 71 | The computer will award you with ratings depending on how good a lander you are. 72 | 73 | You will obtain the rating of Astronaut by landing without regard to fall rate or 74 | fuel. You must not exceed fall rate, or zero fuel. 75 | 76 | You will obtain the rating of Astronaut Pilot, by ladning with regard to fuel. 80 77 | pounds or more if you land between the two rock formations on the floor, and 50 78 | pounds or more if you land between the crater wall and a rock formation. 79 | 80 | You will obtain the rating of Astronaut Captain by landing the ship with regard to 81 | fuel as per above and if the fall rate is two feet per second or less. (Not an 82 | easy task, as you will soon discover). 83 | 84 | 13. About Graphics 85 | 86 | This game has some interesting graphic displays when you run out of fuel, crash, 87 | land too fast, when you land successfully. I will leave them to your discovery, 88 | as they are fun to watch. 89 | 90 | 14. Landing Sites 91 | 92 | The final landing display will appear somewhat like the illustration below 93 | (VIPG1-15.jpg). You may land in any of the three locations pointed to. To land 94 | between the crater walls and rock formations, you will have to first bring the 95 | Lander to a zero fall rate while hovering in the center landing area. Then bring 96 | the ship up and just over the rock formation, and let it drop down to the landing 97 | site. At the last moment, a few taps on the thruster button will slow the lander 98 | to the required fall rate. It will take you many tries to land here, but don't 99 | give up, it can be done!! 100 | 101 | NOTE: VIP Lunar Lander requires at least 3K of RAM. RAM memories are available to 102 | increase your VIP from 2K to 3K at your local computer store or by contacting: 103 | RCA VIP Marketing 104 | New Holland Avenue 105 | Lancaster, PA 17604 106 | -------------------------------------------------------------------------------- /roms/revival/games/Programmable Spacefighters [Jef Winsor].txt: -------------------------------------------------------------------------------- 1 | 14. VIP Programmable Spacefighters 2 | 3 | Programmable Spacefighters is a combat game involving 2 to 8 spaceships competing 4 | for the domination of a contained field in space. The field of play is a 5 | two-dimensional representation of an oblong spheroid. 6 | 7 | The movement and fire of each spacefighter is controlled by programming a series of 8 | commands into each fighter's instruction storage table. Once all the spacefighters 9 | are programmed, they carry out their commands by sequentially executing a single step 10 | at a time. The play of the game ins divided into rounds. Each spacefighter may 11 | execute between 1 and 15 commands per round. 12 | 13 | The fighters all have the same appearance and capabilities. Players distinguish 14 | between fighters by examining the defense strength and position of their fighters 15 | at the begining of every round. 16 | 17 | Each fighter may face in any of 8 directions. All firing and forward movement 18 | occurs in the direction the fighter is currently facing. As a spacefighter crosses 19 | outside the two-dimensional field of play, it wraps around and re-enters on the 20 | opposite side of the field. Laser bursts terminate when they travel outside the 21 | field or hit a target. 22 | 23 | Each round consists of a selected number of steps. Each step is executed in 2 parts. 24 | During the first part, every spacefighter wishing to fire may execute a fire operation. 25 | The defense strength of any fighter which is hit by a laser burst is reduced by 1 26 | and a small flash appears. 27 | 28 | After all fighters have had an opportunity to execute fire instructions, the movement 29 | part of the step begins. Any fighter which has had its defense strength reduced to 0 30 | is destroyed and a longer flash appears. The defense strength is changed to a special 31 | code so that the fighter will no longer be programmable or take part in the execution 32 | phase. The destroyed fighter will still be open to examination during the Defense/ 33 | Position Check phase. Fighers having a defense strength greater than 0 may execute 34 | a movement command if there is one. Breaking each step into 2 such parts removes any 35 | strategic advantage to moving first. 36 | 37 | The nature of the game, in that there are variable parameters and no fixed victory 38 | conditions, allows the players a lot of freedom. Two to eight players can command 39 | single fighters. Four or less players can each command multiple fighters. Two 40 | fleets could complete to destroy their opponents' flagship first. Handicaps can 41 | be implemented through an imbalance of fighters in different fleets. An odd number 42 | of players can play in a free for all or team game. In a non-combat approach, a full 43 | complement of space fighters could be programmed to preform in kaleidoscope or other 44 | type formations. 45 | 46 | 47 | How to Play VIP Programmable Spacefighters 48 | 49 | 1. Load the CHIP-8 interpreter at 0000-01FF and 50 | the game starting at 0200. 51 | 52 | 2. Turn RUN switch on. 53 | 54 | 3. Initalization of Game. 55 | Various parameters are entered at the start of the game to determine the number 56 | of spacefighters and other aspects of play. 57 | 58 | S: Enter number of spacefighters. 1 to 8 spacefighters may be used. The program 59 | will adjust invalid enteries to the nearest valid number. 60 | 61 | D: Enter defense strength. A spacefighter may be hit from 1 to F times by laser 62 | before being destroyed. 63 | 64 | E: Enter number of command entries. A spacefighter may be programmed with 1 to F 65 | commands during the programming phase of each round. 66 | 67 | C: Enter clock duration/no clock. A timer clock 1 to F phorseks in duration may 68 | be selected. Each phorsek equals 4 seconds. The clock is not enabled if a 0 69 | is entered. The clock time is the time allowed for each fighter to be set up. 70 | 71 | F: Enter fire power available. A spacefighter may be allowed to fire 1 to F 72 | laser bursts per round. 73 | 74 | A: Enter accumulation/no accumulation. A spacefighter may be allowed to accumulate 75 | all unused laser bursts by entering 1 to F. Accumulation is not allowed if a 76 | 0 is entered. 77 | 78 | 4. Presentation of Field and Spacefighters. 79 | The two-dimensional representation of the palying fields consists of 10 vertical 80 | by 15 horizontal positons indicated by grid markings around the perimeter. The 81 | spacefighters will be in their initial positions. 82 | 83 | 5. Defense/Position Check. 84 | Enter number of spacefighter to be examined. 85 | S: Current spacefighter being examined. 86 | D: Defense strength of current spacefighter. 87 | Enter 0 to end defense/position check phase. 88 | 89 | 6. Program Spacefighters. 90 | Surviving spacefighters are programmed in ascending order. Enter 0 to begin 91 | programming first spacefighter. Defense strength and position are shown during 92 | programming. 93 | E: indicates number of enteries left after current command. 94 | C: indicates time remaining to program current fighter if clock was entered. 95 | 96 | COMMAND FUNCTION 97 | 1 Rotate 45 ccw, Move fwd 98 | 2 Move fwd 99 | 3 Rotate 45 cw, Move fwd 100 | 4 Rotate 45 ccw 101 | 5 Fire 102 | 6 Rotate 45 cw 103 | B Erase all commands and reprogram current spacefighter 104 | E End programming of current spacefighter 105 | 7-A,C,D,F Rest, No operation 106 | 0 Rest, Begin programming next spacefighter 107 | 108 | Enter 0 to begin programming each successive spacefighter. 109 | 110 | 7. Execute Commands. 111 | Enter 0 after all spacefighters are programmed to start execution of commands. 112 | 113 | 8. The recommended starting point when tryint the game out is with 1 or 2 spacefighters, 114 | any defense, F (15) entries per round, no clock, F (15) fire power and any accumulation 115 | S: 1 or 2 116 | D: 1 117 | E: F 118 | C: 0 119 | F: F 120 | A: 0 121 | 122 | Use the above to try out the movement and fire execution of the fighters. Try 123 | performing loops, figure 8's, tight turns, maximum fire coverage techniques, etc. 124 | Start out simple when first playing the game against an opponent. 125 | Eight spacefighters can get very complicated. 126 | 127 | 9. Changing different parameters creates very different effects on the play of the game. 128 | The main effect of a large number of fighters is a more complicated game. A large 129 | number of enteries per round results in a more lively game involving farsighted 130 | planning. Fewer enteries involves more thinking and reacting to immediate developments 131 | but is not without strategy when there are multiple fighters opposing each other. 132 | The clock provides pressure which can be greatly increased by the moves-to-time ratio. 133 | More fire power increases the importance of movement and positioning. Accumulation 134 | of fire power can have long range effects if there is low fire power and a large 135 | number of moves per round. 136 | -------------------------------------------------------------------------------- /include/chip8.h: -------------------------------------------------------------------------------- 1 | #ifndef CHIP8_H 2 | #define CHIP8_H 3 | 4 | #ifndef __LIBRETRO__ 5 | #ifdef WIN32 6 | #include 7 | #else 8 | #include 9 | #endif 10 | #endif 11 | #if defined(_MSC_VER) && _MSC_VER < 1800 12 | #ifdef __LIBRETRO__ 13 | #include "libretro.h" 14 | #else 15 | #define bool int 16 | #define true 1 17 | #define false 0 18 | #endif 19 | #else 20 | #include 21 | #endif 22 | #include 23 | 24 | #define ONE_SEC 1000000 25 | 26 | #define DISPLAY_WIDTH 128 27 | #define DISPLAY_HEIGHT 64 28 | 29 | #define NUM_KEYS 16 30 | #define NUM_REGISTERS 16 31 | #define NUM_USER_FLAGS 16 32 | #define NUM_QUIRKS 10 33 | #define NUM_BITPLANES 3 34 | #define NUM_FONT_BYTES 80 35 | #define NUM_BIG_FONT_BYTES 160 36 | 37 | #define MAX_RAM 65536 38 | #define MAX_FILEPATH_LEN 256 39 | #define STACK_SIZE 16 40 | #define AUDIO_BUF_SIZE 16 41 | 42 | #define FONT_START_ADDR 0x0 43 | #define BIG_FONT_START_ADDR (FONT_START_ADDR + NUM_FONT_BYTES) 44 | #define SP_START_ADDR (BIG_FONT_START_ADDR + NUM_BIG_FONT_BYTES) 45 | #define AUDIO_BUF_ADDR (SP_START_ADDR + STACK_SIZE) 46 | 47 | #define PC_START_ADDR_DEFAULT 0x200 48 | #define CPU_FREQ_DEFAULT 1000 49 | #define REFRESH_FREQ_DEFAULT 60 50 | #define TIMER_FREQ_DEFAULT 60 51 | #define PITCH_DEFAULT 64 52 | 53 | // The states each key of the keypad can be in. 54 | typedef enum 55 | { 56 | KEY_UP, 57 | KEY_DOWN, 58 | KEY_RELEASED 59 | } CHIP8K; 60 | 61 | // The selected bitplane draw/display operations are performed upon. 62 | typedef enum 63 | { 64 | BPNONE, 65 | BP1, 66 | BP2, 67 | BPBOTH 68 | } CHIP8BP; 69 | 70 | typedef struct CHIP8 71 | { 72 | // Represents random-access memory. 73 | uint8_t RAM[MAX_RAM]; 74 | 75 | // Represents general-purpose 8-bit registers. 76 | uint8_t V[NUM_REGISTERS]; 77 | 78 | // Program counter, stack pointer, and index 16-bit registers. 79 | uint16_t PC, SP, I; 80 | 81 | // Delay timer and sound timer 8-bit registers. 82 | uint8_t DT, ST; 83 | 84 | // 8-bit register which controls audio pitch (XO-CHIP Only). 85 | uint8_t pitch; 86 | 87 | // A monochrome display. A pixel can be either only on or off, no color. 88 | bool display[DISPLAY_HEIGHT][DISPLAY_WIDTH]; 89 | 90 | // A second display for XO-CHIP support. 91 | bool display2[DISPLAY_HEIGHT][DISPLAY_WIDTH]; 92 | 93 | // Represents the bitmask of both displays. 94 | CHIP8BP bitplane; 95 | 96 | // Represents if a key is down, up, or released. 97 | CHIP8K keypad[NUM_KEYS]; 98 | 99 | // Where the emulator begins reading instructions. 100 | uint16_t pc_start_addr; 101 | 102 | // These are used for handling CPU and timer speed. 103 | unsigned long cpu_freq; 104 | unsigned long timer_freq; 105 | unsigned long refresh_freq; 106 | long timer_max_cum; 107 | long cpu_max_cum; 108 | long cpu_cum; 109 | long sound_cum; 110 | long delay_cum; 111 | long refresh_max_cum; 112 | long refresh_cum; 113 | long total_cycle_time; 114 | 115 | #ifndef __LIBRETRO__ 116 | #ifdef WIN32 117 | LARGE_INTEGER win_cycle_time; 118 | LARGE_INTEGER cur_cycle_start; 119 | LARGE_INTEGER prev_cycle_start; 120 | LARGE_INTEGER real_cpu_freq; 121 | #else 122 | struct timeval cur_cycle_start; 123 | struct timeval prev_cycle_start; 124 | #endif 125 | #endif 126 | 127 | // The path and filename of currently loaded ROM. 128 | char ROM_path[MAX_FILEPATH_LEN]; 129 | 130 | // The path and filename of associated user flags file (ROM_path.uf). 131 | char UF_path[MAX_FILEPATH_LEN + 3]; 132 | 133 | // The path and filename of associated dump file (ROM_path.dmp). 134 | char DMP_path[MAX_FILEPATH_LEN + 4]; 135 | 136 | // Flags for the various quirky behavior of S-CHIP 137 | /* Quirks: 138 | -0: RAM Initialization 139 | -1: 8xy6/8xyE 140 | -2: Fx55/Fx65 141 | -3: Bnnn 142 | -4: Big Sprite LORES 143 | -5: 00FE/00FF 144 | -6: Sprite Wrapping 145 | -7: Collision Enumeration 146 | -8: Collision with Bottom of Screen 147 | -9: Disable undefined VF after logical OR, AND, XOR (VF is set to 0 with this disabled) 148 | */ 149 | bool quirks[NUM_QUIRKS]; 150 | 151 | // Used to signal to main to update the display. 152 | bool display_updated; 153 | 154 | // Used to signal to main to produce sound. 155 | bool beep; 156 | 157 | // Used to signal to main to exit the program. 158 | bool exit; 159 | 160 | // Used to toggle between HI-RES and standard LO-RES modes. 161 | bool hires; 162 | } CHIP8; 163 | 164 | // Set some things to useful default values. 165 | void chip8_init(CHIP8 *chip8, unsigned long cpu_freq, unsigned long timer_freq, 166 | unsigned long refresh_freq, uint16_t pc_start_addr, 167 | bool quirks[]); 168 | 169 | // Reset the machine. 170 | void chip8_reset(CHIP8 *chip8); 171 | 172 | // Soft reset the machine (keep ROM and fonts loaded). 173 | void chip8_soft_reset(CHIP8 *chip8); 174 | 175 | // Sets the CPU frequency of the machine. 176 | void chip8_set_cpu_freq(CHIP8 *chip8, unsigned long cpu_freq); 177 | 178 | // Sets the timer frequency of the machine. 179 | void chip8_set_timer_freq(CHIP8 *chip8, unsigned long timer_freq); 180 | 181 | // Sets the refresh frequency of the machine. 182 | void chip8_set_refresh_freq(CHIP8 *chip8, unsigned long refresh_freq); 183 | 184 | // Load hexadecimal font into memory. 185 | void chip8_load_font(CHIP8 *chip8); 186 | 187 | // Loads a given ROM into memory. 188 | bool chip8_load_rom(CHIP8 *chip8, char *filename); 189 | 190 | // Loads a given ROM into memory from a buffer. 191 | void chip8_load_rom_buffer(CHIP8 *chip8, const void *raw, size_t sz); 192 | 193 | /* Performs a full cycle of the emulator including executing an instruction and 194 | handling timers. Returns true if instruction was executed 195 | or false if the CPU was sleeping. */ 196 | bool chip8_cycle(CHIP8 *chip8); 197 | 198 | // Fetches, decodes, and executes the next instruction. 199 | void chip8_execute(CHIP8 *chip8); 200 | 201 | // Decrements delay and sound timers at specified frequency. 202 | void chip8_handle_timers(CHIP8 *chip8); 203 | 204 | // Updates the total cycle time since last call. 205 | void chip8_update_elapsed_time(CHIP8 *chip8); 206 | 207 | // Clears the keypad by setting all keys to up. 208 | void chip8_reset_keypad(CHIP8 *chip8); 209 | 210 | // Resets any key that was released to KEY_UP. 211 | void chip8_reset_released_keys(CHIP8 *chip8); 212 | 213 | // Clears the display by setting all pixels to off. 214 | void chip8_reset_display(CHIP8 *chip8, CHIP8BP bitplane); 215 | 216 | // Clears the RAM. 217 | void chip8_reset_RAM(CHIP8 *chip8); 218 | 219 | // Clears all registers. 220 | void chip8_reset_registers(CHIP8 *chip8); 221 | 222 | // Reset audio buffer to default sound. 223 | void chip8_reset_audio(CHIP8 *chip8); 224 | 225 | // Loads an instruction into memory. 226 | void chip8_load_instr(CHIP8 *chip8, uint16_t instr); 227 | 228 | // Performs a draw operation. 229 | void chip8_draw(CHIP8 *chip8, uint8_t x, uint8_t y, uint8_t n, CHIP8BP bitplane); 230 | 231 | // Scrolls the display in specified direction by num_pixels. 232 | void chip8_scroll(CHIP8 *chip8, int xdir, int ydir, int num_pixels, CHIP8BP bitplane); 233 | 234 | // Waits for a key to be released then stores that key in Vx. 235 | void chip8_wait_key(CHIP8 *chip8, uint8_t x); 236 | 237 | // Dump memory to disk. 238 | bool chip8_dump(CHIP8 *chip8); 239 | 240 | // Read dump file into memory. 241 | bool chip8_load_dump(CHIP8 *chip8, char *filename); 242 | 243 | // Saves/loads user flags to/from disk. 244 | bool chip8_handle_user_flags(CHIP8 *chip8, int num_flags, bool save); 245 | 246 | // Skips the next instrtuction. 247 | void chip8_skip_instr(CHIP8 *chip8); 248 | 249 | /* Returns a sound frequency based on the current pitch using the formula: 250 | 4000 * 2^((pitch - 64) / 48) */ 251 | double chip8_get_sound_freq(CHIP8 *chip8); 252 | 253 | #endif 254 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # DESCRIPTION: GitLab CI/CD for libRetro (NOT FOR GitLab-proper) 2 | 3 | ############################################################################## 4 | ################################# BOILERPLATE ################################ 5 | ############################################################################## 6 | 7 | # Core definitions 8 | .core-defs: 9 | variables: 10 | JNI_PATH: . 11 | CORENAME: jaxe 12 | MAKEFILE: Makefile.libretro 13 | GIT_SUBMODULE_STRATEGY: recursive 14 | 15 | # Inclusion templates, required for the build to work 16 | include: 17 | ################################## DESKTOPS ################################ 18 | # Windows 64-bit 19 | - project: 'libretro-infrastructure/ci-templates' 20 | file: '/windows-x64-mingw.yml' 21 | 22 | # Windows 32-bit 23 | - project: 'libretro-infrastructure/ci-templates' 24 | file: '/windows-i686-mingw.yml' 25 | 26 | # Windows msvc10 64-bit 27 | - project: 'libretro-infrastructure/ci-templates' 28 | file: '/windows-x64-msvc10-msys2.yml' 29 | 30 | # Windows msvc10 32-bit 31 | - project: 'libretro-infrastructure/ci-templates' 32 | file: '/windows-i686-msvc10-msys2.yml' 33 | 34 | # Windows msvc05 32-bit 35 | - project: 'libretro-infrastructure/ci-templates' 36 | file: '/windows-i686-msvc05-msys2.yml' 37 | 38 | # DJGPP 39 | - project: 'libretro-infrastructure/ci-templates' 40 | file: '/djgpp-static.yml' 41 | 42 | # Linux 64-bit 43 | - project: 'libretro-infrastructure/ci-templates' 44 | file: '/linux-x64.yml' 45 | 46 | # Linux 32-bit 47 | - project: 'libretro-infrastructure/ci-templates' 48 | file: '/linux-i686.yml' 49 | 50 | # MacOS 64-bit 51 | - project: 'libretro-infrastructure/ci-templates' 52 | file: '/osx-x64.yml' 53 | 54 | # MacOS ARM 64-bit 55 | - project: 'libretro-infrastructure/ci-templates' 56 | file: '/osx-arm64.yml' 57 | 58 | # MacOS PPC 59 | - project: 'libretro-infrastructure/ci-templates' 60 | file: '/osx-ppc.yml' 61 | 62 | ################################## CELLULAR ################################ 63 | # Android 64 | - project: 'libretro-infrastructure/ci-templates' 65 | file: '/android-jni.yml' 66 | 67 | # iOS 68 | - project: 'libretro-infrastructure/ci-templates' 69 | file: '/ios-arm64.yml' 70 | 71 | # iOS (armv7) 72 | - project: 'libretro-infrastructure/ci-templates' 73 | file: '/ios9.yml' 74 | 75 | ################################## CONSOLES ################################ 76 | # PlayStation Portable 77 | - project: 'libretro-infrastructure/ci-templates' 78 | file: '/psp-static.yml' 79 | 80 | # PlayStation Vita 81 | - project: 'libretro-infrastructure/ci-templates' 82 | file: '/vita-static.yml' 83 | 84 | # PlayStation2 85 | - project: 'libretro-infrastructure/ci-templates' 86 | file: '/ps2-static.yml' 87 | 88 | # Nintendo 3DS 89 | - project: 'libretro-infrastructure/ci-templates' 90 | file: '/ctr-static.yml' 91 | 92 | # Nintendo GameCube 93 | - project: 'libretro-infrastructure/ci-templates' 94 | file: '/ngc-static.yml' 95 | 96 | # Nintendo Wii 97 | - project: 'libretro-infrastructure/ci-templates' 98 | file: '/wii-static.yml' 99 | 100 | # Nintendo WiiU 101 | - project: 'libretro-infrastructure/ci-templates' 102 | file: '/wiiu-static.yml' 103 | 104 | # Nintendo Switch 105 | - project: 'libretro-infrastructure/ci-templates' 106 | file: '/libnx-static.yml' 107 | 108 | # OpenDingux 109 | - project: 'libretro-infrastructure/ci-templates' 110 | file: '/dingux-mips32.yml' 111 | 112 | # OpenDingux (ARM) 113 | - project: 'libretro-infrastructure/ci-templates' 114 | file: '/dingux-arm32.yml' 115 | 116 | # tvOS (AppleTV) 117 | - project: 'libretro-infrastructure/ci-templates' 118 | file: '/tvos-arm64.yml' 119 | 120 | #################################### MISC ################################## 121 | # Emscripten 122 | - project: 'libretro-infrastructure/ci-templates' 123 | file: '/emscripten-static.yml' 124 | 125 | # Stages for building 126 | stages: 127 | - build-prepare 128 | - build-shared 129 | - build-static 130 | 131 | ############################################################################## 132 | #################################### STAGES ################################## 133 | ############################################################################## 134 | # 135 | ################################### DESKTOPS ################################# 136 | # Windows 64-bit 137 | libretro-build-windows-x64: 138 | extends: 139 | - .libretro-windows-x64-mingw-make-default 140 | - .core-defs 141 | 142 | # Windows 32-bit 143 | libretro-build-windows-i686: 144 | extends: 145 | - .libretro-windows-i686-mingw-make-default 146 | - .core-defs 147 | 148 | # Windows msvc10 64-bit 149 | libretro-build-windows-msvc10-x64: 150 | extends: 151 | - .libretro-windows-x64-msvc10-msys2-make-default 152 | - .core-defs 153 | 154 | # Windows msvc10 32-bit 155 | libretro-build-windows-msvc10-i686: 156 | extends: 157 | - .libretro-windows-i686-msvc10-msys2-make-default 158 | - .core-defs 159 | 160 | # Windows msvc05 32-bit 161 | libretro-build-windows-msvc05-i686: 162 | extends: 163 | - .libretro-windows-i686-msvc05-msys2-make-default 164 | - .core-defs 165 | 166 | # DJGPP 167 | libretro-build-djgpp-i586: 168 | extends: 169 | - .libretro-djgpp-static-retroarch-master 170 | - .core-defs 171 | 172 | # Linux 64-bit 173 | libretro-build-linux-x64: 174 | extends: 175 | - .libretro-linux-x64-make-default 176 | - .core-defs 177 | 178 | # Linux 32-bit 179 | libretro-build-linux-i686: 180 | extends: 181 | - .libretro-linux-i686-make-default 182 | - .core-defs 183 | 184 | # MacOS 64-bit 185 | libretro-build-osx-x64: 186 | extends: 187 | - .libretro-osx-x64-make-default 188 | - .core-defs 189 | 190 | # MacOS ARM 64-bit 191 | libretro-build-osx-arm64: 192 | extends: 193 | - .libretro-osx-arm64-make-default 194 | - .core-defs 195 | 196 | # MacOS PPC 197 | libretro-build-osx-ppc: 198 | extends: 199 | - .libretro-osx-ppc-make-default 200 | - .core-defs 201 | 202 | ################################### CELLULAR ################################# 203 | # Android ARMv7a 204 | android-armeabi-v7a: 205 | extends: 206 | - .libretro-android-jni-armeabi-v7a 207 | - .core-defs 208 | 209 | # Android ARMv8a 210 | android-arm64-v8a: 211 | extends: 212 | - .libretro-android-jni-arm64-v8a 213 | - .core-defs 214 | 215 | # Android 64-bit x86 216 | android-x86_64: 217 | extends: 218 | - .libretro-android-jni-x86_64 219 | - .core-defs 220 | 221 | # Android 32-bit x86 222 | android-x86: 223 | extends: 224 | - .libretro-android-jni-x86 225 | - .core-defs 226 | 227 | # iOS 228 | libretro-build-ios-arm64: 229 | extends: 230 | - .libretro-ios-arm64-make-default 231 | - .core-defs 232 | 233 | # iOS (armv7) [iOS 9 and up] 234 | libretro-build-ios9: 235 | extends: 236 | - .libretro-ios9-make-default 237 | - .core-defs 238 | 239 | # tvOS 240 | libretro-build-tvos-arm64: 241 | extends: 242 | - .libretro-tvos-arm64-make-default 243 | - .core-defs 244 | 245 | ################################### CONSOLES ################################# 246 | # PlayStation Portable 247 | libretro-build-psp: 248 | extends: 249 | - .libretro-psp-static-retroarch-master 250 | - .core-defs 251 | 252 | # PlayStation Vita 253 | libretro-build-vita: 254 | extends: 255 | - .libretro-vita-static-retroarch-master 256 | - .core-defs 257 | 258 | # PlayStation2 259 | libretro-build-ps2: 260 | extends: 261 | - .libretro-ps2-static-retroarch-master 262 | - .core-defs 263 | 264 | # Nintendo 3DS 265 | libretro-build-ctr: 266 | extends: 267 | - .libretro-ctr-static-retroarch-master 268 | - .core-defs 269 | 270 | # Nintendo GameCube 271 | libretro-build-ngc: 272 | extends: 273 | - .libretro-ngc-static-retroarch-master 274 | - .core-defs 275 | 276 | # Nintendo Wii 277 | libretro-build-wii: 278 | extends: 279 | - .libretro-wii-static-retroarch-master 280 | - .core-defs 281 | 282 | # Nintendo WiiU 283 | libretro-build-wiiu: 284 | extends: 285 | - .libretro-wiiu-static-retroarch-master 286 | - .core-defs 287 | 288 | # Nintendo Switch 289 | libretro-build-libnx-aarch64: 290 | extends: 291 | - .libretro-libnx-static-retroarch-master 292 | - .core-defs 293 | 294 | # OpenDingux 295 | libretro-build-dingux-mips32: 296 | extends: 297 | - .libretro-dingux-mips32-make-default 298 | - .core-defs 299 | 300 | # OpenDingux Beta 301 | libretro-build-dingux-odbeta-mips32: 302 | extends: 303 | - .libretro-dingux-odbeta-mips32-make-default 304 | - .core-defs 305 | 306 | # OpenDingux Beta 307 | libretro-build-rs90-odbeta-mips32: 308 | extends: 309 | - .libretro-rs90-odbeta-mips32-make-default 310 | - .core-defs 311 | 312 | # Miyoo 313 | libretro-build-miyoo-arm32: 314 | extends: 315 | - .libretro-miyoo-arm32-make-default 316 | - .core-defs 317 | 318 | # RetroFW 319 | libretro-build-retrofw-mips32: 320 | extends: 321 | - .libretro-retrofw-mips32-make-default 322 | - .core-defs 323 | 324 | #################################### MISC ################################## 325 | # Emscripten 326 | libretro-build-emscripten: 327 | extends: 328 | - .libretro-emscripten-static-retroarch-master 329 | - .core-defs 330 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JAXE (Just Another XO-CHIP/CHIP-8 Emulator) 2 | |Brix|Space Invaders (In Debug Mode)| 3 | |----|------------------------------| 4 | ||| 5 | 6 | |Black Rainbow|DVN8| 7 | |-------------|----| 8 | ||| 9 | 10 | |Super Neat Boy|Chicken Scratch| 11 | |--------------|---------------| 12 | ||| 13 | 14 | CHIP-8 was a virtual machine/programming language developed by Joseph Weisbecker for the COSMAC VIP in the 1970s. It was designed with 35 opcodes and resembles assembly language, but was made for the easier development of video games on the VIP. 15 | 16 | Today, it is a popular target to be emulated because of its simplicity and charm. 17 | 18 | ## Features 19 | * Fully implemented instruction set (including S-CHIP and XO-CHIP) 20 | * HI-RES (128x64) mode to support S-CHIP programs 21 | * Dual display buffers to support XO-CHIP programs 22 | * Accurate delay and sound timers 23 | * Extended sound (though can sometimes be a bit noisy) 24 | * Integrated graphical debugger allowing user to step forward and back through program execution 25 | * Adjustable CPU/timer/refresh frequencies, display scale, colors, and program start address 26 | * Toggle S-CHIP "quirks" for compatibility with a wide variety of ROMs 27 | * Save and load memory dumps 28 | * Unit tests for those writing a C emulator 29 | * Emulator decoupled from any particular graphics/media library allowing for easy embedding into other C programs 30 | * Libretro port 31 | 32 | ## Technical Info 33 | The original CHIP-8 virtual machine was designed with the following specs: 34 | * 35 opcodes 35 | * 4kb RAM 36 | * 16 8-bit general purpose registers 37 | * 16-bit program counter, stack pointer, and index registers 38 | * 8-bit delay and sound timer registers 39 | * 64x32 monochrome display 40 | * 16-key keypad (0-F) 41 | * Program memory starting at address 0x200 42 | 43 | Due to the way CHIP-8 was designed, the "flicker" that happens when sprites are drawn is normal. Games developed for it also rarely made any attempt to cap their frame rate due to the slow hardware of the time hence the need to artificially slow the CPU down on modern emulators. 44 | 45 | In the early 90s, Andreas Gustafsson created a port for the HP48 calculator which was eventually superseded by S-CHIP 1.0/1.1 created by Erik Bryntse. The S-CHIP added several features as well as accidentally (or intentionally?) modifying the behavior of several original opcodes: 46 | 47 | * 9 new opcodes 48 | * 128x64 HI-RES display 49 | * Persistent storage 50 | * Modified Bnnn, Fx55, Fx65, Dxyn, 8xy6, and 8xyE instructions 51 | 52 | With time, it seems the S-CHIP became more popular and many programs were written to work with its various quirks. Thus, JAXE defaults to original S-CHIP design however many of its quirks can be toggled for improved compatibility using the flags in the Options section below. 53 | 54 | However, recently John Earnest designed the XO-CHIP extension allowing CHIP-8 programs to take advantage of modern hardware to an extent. This extension adds several more instructions and features including: 55 | 56 | * 7 new opcodes 57 | * 16-bit addressing for a total of ~64kb RAM 58 | * Second display buffer allowing for 4 colors instead of the typical 2 59 | * Improved sound support 60 | * Modified Fx75 and Fx85 instructions to allow for 16 user flags instead of typical 8 61 | 62 | JAXE currently supports all of these extensions. 63 | 64 | It should also be noted that JAXE stores its fonts in memory starting at address **0x0000** followed immediately by large fonts and finally immediately by the stack. Therefore the stack pointer initially points to address **0x00F0**. 65 | 66 | ## TODO 67 | * Continue to improve sound 68 | * Continue to improve Windows support 69 | * Improve build procedures 70 | * Add more color themes 71 | 72 | ## Requirements 73 | * SDL2 74 | * SDL2_ttf (for debug mode) 75 | * CMake (for automatic build) 76 | 77 | ## Build Procedures 78 | ### Linux/Windows (MinGW) 79 | `mkdir build && cd build` 80 | `cmake -B . -DCMAKE_BUILD_TYPE=Release ..` 81 | `make` 82 | 83 | ### Windows (non-MinGW) 84 | Unknown at this time. Currently the code uses the POSIX getopt() function to handle command-line arguments. To build without MinGW, remove `#define ALLOW_GETOPTS` from the top of *main.c* which will unfortunately remove command-line arguments until I handle them in a portable way. 85 | 86 | ## Run 87 | ### Linux 88 | `./jaxe [options] ` 89 | `./test` (for unit tests) 90 | 91 | ### Windows 92 | If built with MinGW, command line options are available: 93 | `jaxe.exe [options] ` 94 | 95 | Otherwise: 96 | `jaxe.exe ` 97 | `test.exe` (for unit tests) 98 | 99 | ## Options 100 | `-l` Enable legacy mode (for running original CHIP-8 ROMs) 101 | `-x` Enable XO-CHIP mode 102 | `-d` Enable debug mode 103 | `-m` Load dump file instead of ROM 104 | `-p` Set program start address (in hex) 105 | `-c` Set CPU frequency (in Hz, value of 0 means uncapped) 106 | `-t` Set timer frequency (in Hz, value of 0 means uncapped) 107 | `-r` Set screen refresh frequency (in Hz, value of 0 means uncapped) 108 | `-s` Set display scale factor 109 | `-b` Set background color (in hex) 110 | `-f` Set plane1 color (in hex) 111 | `-k` Set plane2 color (in hex) 112 | `-n` Set overlap color (in hex) 113 | 114 | Also includes flags for disabling specific S-CHIP "quirks" (which are all enabled by default): 115 | 116 | `-0` Disable uninitialized RAM 117 | `-1` Disable 8xy6/8xyE bug 118 | `-2` Disable Fx55/Fx65 bug 119 | `-3` Disable Bnnn bug 120 | `-4` Disable ban on big sprites being drawn in LO-RES mode 121 | `-5` Disable display state remaining the same when 00FE/00FF execute (display is cleared with this disabled) 122 | `-6` Disable sprite clipping 123 | `-7` Disable collision enumeration 124 | `-8` Disable collision check with bottom of screen 125 | `-9` Disable undefined VF after logical OR, AND, XOR (VF is set to 0 with this disabled) 126 | 127 | 128 | ## Controls 129 | ### Keyboard (This maps to the key layouts below) 130 | `1` `2` `3` `4` 131 | `Q` `W` `E` `R` 132 | `A` `S` `D` `F` 133 | `Z` `X` `C` `V` 134 | 135 | ### COSMAC VIP Keypad 136 | `1` `2` `3` `C` 137 | `4` `5` `6` `D` 138 | `7` `8` `9` `E` 139 | `A` `0` `B` `F` 140 | 141 | ### HP48 Keypad 142 | `7` `8` `9` `/` 143 | `4` `5` `6` `*` 144 | `1` `2` `3` `-` 145 | `0` `.` `_` `+` 146 | 147 | ### Other Controls 148 | |Key|Action| 149 | |---|------| 150 | |`SPACE`|Pause/Unpause| 151 | |`UP`|Step Forward (DBG Mode Only)| 152 | |`DOWN`|Step Back (DBG Mode Only)| 153 | |`RIGHT`|Increase CPU Speed| 154 | |`LEFT`|Decrease CPU Speed| 155 | |`ENTER`|Save/Create Dump File| 156 | |`BACKSPACE`|Cycle Color Themes| 157 | |`ESC`|Reset Emulator| 158 | 159 | ## Troubleshooting 160 | * This emulator defaults to S-CHIP mode, which has become more popular since the 90s. Unfortunately, S-CHIP changed the behavior of several instructions and introduced some other quirks, making some programs developed for the original COSMAC VIP not backwards-compatible. If a ROM is not working correctly (especially one written before 1990), try enabling legacy mode with the `-l` flag. 161 | * If running an XO-CHIP ROM, enable XO-CHIP mode with the `-x` flag. 162 | * This emulator defaults to 0x200 as the start address, however some programs assume other defaults (namely, those written for the ETI-660 which default to 0x600). Try to find out what default address the program assumes and set that with the `-p` option. 163 | * If a program is running very slowly, try increasing the CPU speed or even uncapping it (by setting the `-c` option to 0). Some ROMs are developed around an uncapped execution frequency and will run much more smoothly. 164 | * There are many CHIP-8 variants and this emulator does not support all of them. If a ROM still does not work correctly after trying the suggestions above, it may have been written for an unsupported variant and thus will simply not work. 165 | 166 | ## Libretro port 167 | 168 | Libretro port is intended to run under Retroarch on a wide variety of platforms. Compilation: 169 | 170 | * Default platform: 171 | 172 | ```shell 173 | make -f Makefile.libretro 174 | ``` 175 | 176 | * Most platforms 177 | 178 | ```shell 179 | make -f Makefile.libretro platform=PLATFORM 180 | ``` 181 | 182 | * Android 183 | 184 | ``` 185 | cd jni/ 186 | ndk-build 187 | ``` 188 | 189 | Running from command line: 190 | 191 | ```shell 192 | 193 | retroarch -L jaxe_libretro.so roms/chip8archive/br8kout.ch8 194 | ``` 195 | 196 | I hope to add it to buildbot and official distribution shortly 197 | 198 | Default key mapping: 199 | 200 | * `0` to `B` 201 | * `1` to `START` 202 | * `2` to `Y` 203 | * `3` to `SELECT` 204 | * `4` to `L` (shoulder) 205 | * `5` to `D-Pad Up` 206 | * `6` to `A` 207 | * `7` to `D-Pad Left` 208 | * `8` to `D-Pad Down` 209 | * `9` to `D-Pad Right` 210 | * `A` to `R` (shoulder) 211 | * `B` to `L2` (trigger) 212 | * `C` to `X` 213 | * `D` to `R2` (trigger) 214 | * `E` to `L3` (thumb) 215 | * `F` to `R3` (thumb) 216 | 217 | This is preliminary and subject to change. 218 | 219 | Differences and notes compared to standalone version: 220 | 221 | * Debug mode is missing 222 | * Userflags are saved as SRAM rather than .uf file 223 | * We use options instead of command line 224 | * CPU frequency can be set only to predefined values. This is a limitation of options interface 225 | * Colors can be chosen only from predefined themes. This is a limitation of options interface 226 | * Setting all quirks to false needs to set all of them manually (there is no equivalent to -x option) 227 | * To cycle through themes or to change CPU frequencies you need to go to options menu 228 | * Loading and storing dumps is done through serialization 229 | * Display scale, pause and exit are handled by frontend 230 | * Audio is resampled in the core and always outputs at 44100 231 | 232 | TODOs: 233 | 234 | * Add more color themes (same as standalone) 235 | * Investigate if better key mapping is possible 236 | * Allow frontend to peek into "VRAM" 237 | * Uncapped CPU frequency 238 | * Option for PC start address 239 | * Option for timer frequency 240 | * Option for refresh frequency 241 | * Choose resampled audio frequency based on available outputs or make it configurable 242 | * Maybe have retroachievements support? 243 | 244 | 245 | ## Contributing 246 | Anyone is welcome to contribute! I will try to review pull requests as quickly as possible. 247 | 248 | ## License 249 | JAXE is licensed under the MIT license so you are free to do almost whatever you please with this code (see LICENSE file). 250 | 251 | ## ROMs 252 | * [CHIP-8 Archive](https://johnearnest.github.io/chip8Archive/) 253 | * [Revival Studio's Chip-8 Program Pack](https://github.com/kripod/chip8-roms) 254 | 255 | ## References 256 | * [Cowgod's Chip-8 Technical Reference v1.0](http://devernay.free.fr/hacks/chip8/C8TECH10.HTM) 257 | * [Matthew Mikolay's Instruction Set](https://github.com/mattmikolay/chip-8/wiki/CHIP%E2%80%908-Instruction-Set) 258 | * [HP48-Superchip Investigations](https://github.com/Chromatophore/HP48-Superchip) 259 | * [CHIP-8 extensions and compatibility](https://chip-8.github.io/extensions/) 260 | * [XO-CHIP Specification](https://johnearnest.github.io/Octo/docs/XO-ChipSpecification.html) 261 | * [CHIP-8 Test Suite](https://github.com/Timendus/chip8-test-suite) 262 | 263 | ## Acknowledgments 264 | * [Kongtext Font by codeman38](https://www.1001fonts.com/kongtext-font.html) 265 | -------------------------------------------------------------------------------- /src/libretro.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "libretro.h" 7 | #include "chip8.h" 8 | 9 | #define VALID_EXTENSIONS "ch8|sc8|xo8|hc8" 10 | 11 | #ifdef USE_RGB565 12 | typedef unsigned short pixel_t; 13 | #if defined(ABGR1555) 14 | #define vRGB(r,g,b) ((((b) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((r) & 0xf8) >> 3)) 15 | #else 16 | #define vRGB(r,g,b) ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) 17 | #endif 18 | #else 19 | typedef unsigned int pixel_t; 20 | #define vRGB(r,g,b) (((r) << 16) | ((g) << 8) | (b)) 21 | #endif 22 | 23 | static pixel_t frame[DISPLAY_WIDTH * DISPLAY_HEIGHT]; 24 | 25 | static retro_environment_t environ_cb; 26 | static retro_log_printf_t log_cb; 27 | static retro_video_refresh_t video_cb; 28 | static retro_input_poll_t input_poll_cb; 29 | static retro_input_state_t input_state_cb; 30 | static retro_audio_sample_t audio_cb; 31 | static retro_audio_sample_batch_t audio_batch_cb; 32 | 33 | static CHIP8 chip8; 34 | static unsigned long cpu_debt = 0; 35 | #define AUDIO_RESAMPLE_RATE 44100 36 | static unsigned int audio_counter_chip8 = 0; 37 | static unsigned int audio_counter_resample = 0; 38 | static unsigned int audio_freq_chip8 = 0; 39 | static int snd_buf_pntr = 0; 40 | static uint8_t sram[NUM_USER_FLAGS]; 41 | 42 | struct theme { 43 | pixel_t bg, p1, p2, overlap; 44 | const char *name; 45 | }; 46 | 47 | bool chip8_handle_user_flags(CHIP8 *chip8p, int num_flags, bool save) 48 | { 49 | if (num_flags <= NUM_USER_FLAGS) 50 | { 51 | if (save) 52 | { 53 | memcpy(sram, chip8p->V, num_flags); 54 | } 55 | else 56 | { 57 | memcpy(chip8p->V, sram, num_flags); 58 | } 59 | 60 | return true; 61 | } 62 | else 63 | { 64 | return true; // Only return false on file open error. 65 | } 66 | } 67 | 68 | 69 | #define BG_COLOR_DEFAULT vRGB(0,0,0) 70 | #define P1_COLOR_DEFAULT vRGB(0xFF,0xFF,0xFF) 71 | #define P2_COLOR_DEFAULT vRGB(0xAA,0xAA,0xAA) 72 | #define OVERLAP_COLOR_DEFAULT vRGB(0x55,0x55,0x55) 73 | 74 | // Color/Display 75 | // TODO: Add more themes! 76 | static const struct theme color_themes[] = { 77 | {BG_COLOR_DEFAULT, P1_COLOR_DEFAULT, P2_COLOR_DEFAULT, OVERLAP_COLOR_DEFAULT, "Default"}, 78 | {vRGB(0,0,0), vRGB(0xFF,0xFF,0xFF), vRGB(0,0,0), vRGB(0,0,0), "Black and white"}, 79 | {vRGB(0xFF,0xFF,0xFF), vRGB(0,0,0), vRGB(0,0,0), vRGB(0,0,0), "Inverted black and white"}, 80 | {vRGB(0,0,0), vRGB(0xFF,0,0), vRGB(0,0,0), vRGB(0,0,0), "Blood"}, 81 | {vRGB(0,0,0), vRGB(0,0xFF,0), vRGB(0,0,0), vRGB(0,0,0), "Hacker"}, 82 | {vRGB(0,0,0), vRGB(0,0,0xFF), vRGB(0,0,0), vRGB(0,0,0), "Space" }, 83 | {vRGB(0xF0,0x90,0x7C), vRGB(0x96,0x29,0x12), vRGB(0xF4,0x69,0), vRGB(0xFA, 0xA4,0), "Crazy Orange"}, 84 | {vRGB(0x10,0,0x19), vRGB(0xFF,0xE1,0xFF), vRGB(0xE7,0,0xEA), vRGB(0xE7,0,0xEA), "Cyberpunk"} 85 | }; 86 | static pixel_t bg_color = BG_COLOR_DEFAULT; 87 | static pixel_t p1_color = P1_COLOR_DEFAULT; 88 | static pixel_t p2_color = P2_COLOR_DEFAULT; 89 | static pixel_t overlap_color = OVERLAP_COLOR_DEFAULT; 90 | 91 | static void fallback_log(enum retro_log_level level, 92 | const char *fmt, ...) { 93 | va_list args; 94 | 95 | (void) level; 96 | 97 | va_start(args, fmt); 98 | vfprintf(stderr, fmt, args); 99 | va_end(args); 100 | } 101 | 102 | #define FIRST_QUIRK_VARIABLE 0 103 | static struct retro_variable variables[] = 104 | { 105 | { 106 | "jaxe_quirk_0_ram_init", 107 | "Ram init quirk; enabled|disabled", 108 | }, 109 | { 110 | "jaxe_quirk_1_8xy6_8xye", 111 | "8xy6/8xyE quirk; enabled|disabled", 112 | }, 113 | { 114 | "jaxe_quirk_2_fx55_fx65", 115 | "Fx55/Fx65 quirk; enabled|disabled", 116 | }, 117 | { 118 | "jaxe_quirk_3_bnnn", 119 | "Bnnn quirk; enabled|disabled", 120 | }, 121 | { 122 | "jaxe_quirk_4_big_sprite_lores", 123 | "Big Sprite LORES quirk; enabled|disabled", 124 | }, 125 | { 126 | "jaxe_quirk_5_00fe_00ff", 127 | "00FE/00FF quirk; enabled|disabled", 128 | }, 129 | { 130 | "jaxe_quirk_6_sprite_wrapping", 131 | "Sprite Wrapping; enabled|disabled", 132 | }, 133 | { 134 | "jaxe_quirk_7_collision_enumeration", 135 | "Collision Enumeration; enabled|disabled", 136 | }, 137 | { 138 | "jaxe_quirk_8_collision_bottom_of_screen", 139 | "Collision with Bottom of Screen; enabled|disabled", 140 | }, 141 | { 142 | "jaxe_quirk_9_disable_undefined_VF_after_logical_OR_AND_XOR", 143 | "Disable undefined VF after logical OR, AND, XOR; enabled|disabled", 144 | }, 145 | { 146 | "jaxe_cpu_requency", 147 | "CPU frequency; 1000|1500|2000|3000|5000|10000|25000|50000|100000|800|750|600|500|400|300", 148 | }, 149 | { 150 | "jaxe_theme", 151 | "Theme; Default|Black and white|Inverted black and white|Blood|Hacker|Space|Crazy Orange|Cyberpunk" 152 | }, 153 | { NULL, NULL }, 154 | }; 155 | 156 | // TODO: find a better mapping 157 | static unsigned hexorder[] = { 158 | RETRO_DEVICE_ID_JOYPAD_B, 159 | RETRO_DEVICE_ID_JOYPAD_START, 160 | RETRO_DEVICE_ID_JOYPAD_Y, 161 | RETRO_DEVICE_ID_JOYPAD_SELECT, 162 | RETRO_DEVICE_ID_JOYPAD_L, 163 | RETRO_DEVICE_ID_JOYPAD_UP, 164 | RETRO_DEVICE_ID_JOYPAD_A, 165 | RETRO_DEVICE_ID_JOYPAD_LEFT, 166 | RETRO_DEVICE_ID_JOYPAD_DOWN, 167 | RETRO_DEVICE_ID_JOYPAD_RIGHT, 168 | RETRO_DEVICE_ID_JOYPAD_R, 169 | RETRO_DEVICE_ID_JOYPAD_L2, 170 | RETRO_DEVICE_ID_JOYPAD_X, 171 | RETRO_DEVICE_ID_JOYPAD_R2, 172 | RETRO_DEVICE_ID_JOYPAD_L3, 173 | RETRO_DEVICE_ID_JOYPAD_R3 174 | }; 175 | 176 | static struct retro_input_descriptor input_desc[] = { 177 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "7" }, 178 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "2" }, 179 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "8" }, 180 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "9" }, 181 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "0" }, 182 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT,"3" }, 183 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "C" }, 184 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "5" }, 185 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "6" }, 186 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "1" }, 187 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "4" }, 188 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "A" }, 189 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L2, "B" }, 190 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R2, "D" }, 191 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "E" }, 192 | { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R3, "F" }, 193 | 194 | { 0 }, 195 | }; 196 | 197 | void retro_set_environment(retro_environment_t fn) 198 | { 199 | static const struct retro_system_content_info_override content_overrides[] = { 200 | { 201 | VALID_EXTENSIONS, /* extensions */ 202 | false, /* need_fullpath */ 203 | true /* persistent_data */ 204 | }, 205 | { NULL, false, false } 206 | }; 207 | environ_cb = fn; 208 | 209 | fn(RETRO_ENVIRONMENT_SET_VARIABLES, variables); 210 | 211 | struct retro_log_callback log; 212 | 213 | if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log)) 214 | log_cb = log.log; 215 | else 216 | log_cb = fallback_log; 217 | 218 | /* Request a persistent content data buffer */ 219 | environ_cb(RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE, 220 | (void*)content_overrides); 221 | 222 | environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, input_desc); 223 | } 224 | 225 | static void load_theme(void) 226 | { 227 | struct retro_variable var; 228 | int theme_number = 0; 229 | var.key = "jaxe_theme"; 230 | var.value = NULL; 231 | 232 | if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { 233 | for (int i = 0; i < sizeof (color_themes) / sizeof(color_themes[0]); i++) { 234 | if (strcmp(var.value, color_themes[i].name) == 0) 235 | theme_number = i; 236 | } 237 | } 238 | 239 | bg_color = color_themes[theme_number].bg; 240 | p1_color = color_themes[theme_number].p1; 241 | p2_color = color_themes[theme_number].p2; 242 | overlap_color = color_themes[theme_number].overlap; 243 | } 244 | 245 | static unsigned long get_cpu_freq_var(unsigned long def) 246 | { 247 | struct retro_variable var; 248 | var.key = "jaxe_cpu_requency"; 249 | var.value = NULL; 250 | if (!environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || !var.value) 251 | return def; 252 | unsigned long cpu_freq = strtoul(var.value, 0, 0); 253 | if (cpu_freq == 0) 254 | return def; 255 | return cpu_freq; 256 | } 257 | 258 | static void chip8_init_with_vars(void) 259 | { 260 | bool quirks[NUM_QUIRKS] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; 261 | unsigned long cpu_freq = CPU_FREQ_DEFAULT; 262 | unsigned long timer_freq = TIMER_FREQ_DEFAULT; 263 | unsigned long refresh_freq = REFRESH_FREQ_DEFAULT; 264 | uint16_t pc_start_addr = PC_START_ADDR_DEFAULT; 265 | 266 | load_theme(); 267 | 268 | for (int i = 0; i < NUM_QUIRKS; i++) { 269 | struct retro_variable var; 270 | var.key = variables[i + FIRST_QUIRK_VARIABLE].key; 271 | var.value = NULL; 272 | 273 | quirks[i] = (!environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || !var.value) || strcmp(var.value, "disabled") != 0; 274 | } 275 | 276 | cpu_freq = get_cpu_freq_var(CPU_FREQ_DEFAULT); 277 | 278 | chip8_init(&chip8, cpu_freq, timer_freq, refresh_freq, pc_start_addr, 279 | quirks); 280 | } 281 | 282 | // Makes the physical screen match the emulator display. 283 | void draw_display(void) 284 | { 285 | for (int y = 0; y < DISPLAY_HEIGHT; y++) 286 | { 287 | for (int x = 0; x < DISPLAY_WIDTH; x++) 288 | { 289 | pixel_t color; 290 | 291 | if (!chip8.display[y][x] && !chip8.display2[y][x]) 292 | { 293 | color = bg_color; 294 | } 295 | else if (chip8.display[y][x] && !chip8.display2[y][x]) 296 | { 297 | color = p1_color; 298 | } 299 | else if (!chip8.display[y][x] && chip8.display2[y][x]) 300 | { 301 | color = p2_color; 302 | } 303 | else 304 | { 305 | color = overlap_color; 306 | } 307 | 308 | frame[x + y * DISPLAY_WIDTH] = color; 309 | } 310 | } 311 | } 312 | 313 | void retro_set_video_refresh(retro_video_refresh_t fn) { video_cb = fn; } 314 | void retro_set_audio_sample(retro_audio_sample_t fn) { audio_cb = fn; } 315 | void retro_set_audio_sample_batch(retro_audio_sample_batch_t fn) { audio_batch_cb = fn; } 316 | void retro_set_input_poll(retro_input_poll_t fn) { input_poll_cb = fn; } 317 | void retro_set_input_state(retro_input_state_t fn) { input_state_cb = fn; } 318 | 319 | void retro_init(void) 320 | { 321 | } 322 | 323 | static void *rom_buf = NULL; 324 | static const void *rom_data = NULL; 325 | static size_t rom_size = 0; 326 | 327 | static void load_rom(void) { 328 | cpu_debt = 0; 329 | audio_counter_chip8 = 0; 330 | audio_counter_resample = 0; 331 | audio_freq_chip8 = 0; 332 | snd_buf_pntr = 0; 333 | 334 | chip8_init_with_vars(); 335 | chip8_load_font(&chip8); 336 | 337 | chip8_load_rom_buffer(&chip8, rom_data, rom_size); 338 | } 339 | 340 | bool retro_load_game(const struct retro_game_info *info) 341 | { 342 | const struct retro_game_info_ext *info_ext = NULL; 343 | 344 | /* We need persistent ROM buffer for resets. */ 345 | rom_buf = NULL; 346 | rom_data = NULL; 347 | rom_size = 0; 348 | 349 | if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &info_ext) && 350 | info_ext && info_ext->persistent_data) { 351 | rom_data = (const uint8_t*)info_ext->data; 352 | rom_size = info_ext->size; 353 | } 354 | 355 | /* If frontend does not support persistent 356 | * content data, must create a copy */ 357 | if (!rom_data) { 358 | if (!info) 359 | return false; 360 | 361 | rom_size = info->size; 362 | rom_buf = malloc(rom_size); 363 | 364 | if (!rom_buf) { 365 | log_cb(RETRO_LOG_INFO, "Failed to allocate ROM buffer.\n"); 366 | return false; 367 | } 368 | 369 | memcpy(rom_buf, info->data, rom_size); 370 | rom_data = (const uint8_t*)rom_buf; 371 | } 372 | 373 | load_rom(); 374 | 375 | return true; 376 | } 377 | 378 | void retro_unload_game(void) 379 | { 380 | if (rom_buf) 381 | free(rom_buf); 382 | 383 | rom_buf = NULL; 384 | rom_data = NULL; 385 | rom_size = 0; 386 | } 387 | 388 | int16_t get_audio_sample(void) 389 | { 390 | // Get the byte of the emulator's buffer that the next sample is in. 391 | int16_t x = chip8.RAM[AUDIO_BUF_ADDR + (snd_buf_pntr / 8)]; 392 | 393 | // Get the actual sample bit. 394 | x <<= (snd_buf_pntr % 8); 395 | x &= 0x80; 396 | 397 | // Finally set the buffer to max volume if sample is 1. 398 | x *= 0xFF; 399 | 400 | /* Keep track of where we are in the emulator's sound buffer and 401 | wrap back around if necessary. */ 402 | snd_buf_pntr++; 403 | if (snd_buf_pntr >= (AUDIO_BUF_SIZE * 8)) 404 | { 405 | snd_buf_pntr = 0; 406 | } 407 | 408 | return x; 409 | } 410 | 411 | static void audio_sample(int16_t sample) { 412 | int16_t buf[200]; // Should be enough to call batch_cb only once 413 | // in most cases 414 | int16_t *bufptr = buf; 415 | while (audio_counter_resample >= ONE_SEC / AUDIO_RESAMPLE_RATE) { 416 | *bufptr++ = sample; 417 | *bufptr++ = sample; 418 | if (bufptr >= buf + sizeof(buf) / sizeof(buf[0])) { 419 | audio_batch_cb(buf, (bufptr - buf) / 2); 420 | bufptr = buf; 421 | } 422 | audio_counter_resample -= ONE_SEC / AUDIO_RESAMPLE_RATE; 423 | } 424 | 425 | if (bufptr != buf) { 426 | audio_batch_cb(buf, (bufptr - buf) / 2); 427 | } 428 | } 429 | 430 | void retro_run(void) 431 | { 432 | if (chip8.exit) { 433 | environ_cb(RETRO_ENVIRONMENT_SHUTDOWN, NULL); 434 | return; 435 | } 436 | 437 | bool updated = false; 438 | if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) { 439 | load_theme(); 440 | unsigned long cpu_freq = get_cpu_freq_var(chip8.cpu_freq); 441 | if (cpu_freq != chip8.cpu_freq) 442 | chip8_set_cpu_freq(&chip8, cpu_freq); 443 | } 444 | 445 | input_poll_cb(); 446 | 447 | for (int i = 0; i < 16; i++) 448 | if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, hexorder[i])) 449 | chip8.keypad[i] = KEY_DOWN; 450 | else 451 | chip8.keypad[i] = chip8.keypad[i] == KEY_DOWN ? KEY_RELEASED : KEY_UP; 452 | 453 | uint64_t cycle_step = ONE_SEC / chip8.cpu_freq; 454 | 455 | for (unsigned i = 0; i < (chip8.cpu_freq + cpu_debt) / chip8.refresh_freq && !chip8.exit; i++) { 456 | chip8.total_cycle_time = cycle_step; 457 | chip8_execute(&chip8); 458 | if (chip8.timer_freq != chip8.refresh_freq) 459 | chip8_handle_timers(&chip8); 460 | 461 | if (!chip8.beep) { 462 | audio_freq_chip8 = 0; 463 | audio_counter_chip8 = 0; 464 | snd_buf_pntr = 0; 465 | audio_counter_resample += cycle_step; 466 | audio_sample(0); 467 | } else { 468 | uint64_t cycle_audio_step; 469 | if (!audio_freq_chip8) { 470 | audio_freq_chip8 = chip8_get_sound_freq(&chip8); 471 | snd_buf_pntr = 0; 472 | } 473 | cycle_audio_step = ONE_SEC / audio_freq_chip8; 474 | audio_counter_chip8 += cycle_step; 475 | while (audio_counter_chip8 > cycle_audio_step) { 476 | audio_counter_chip8 -= cycle_audio_step; 477 | int16_t sample = get_audio_sample(); 478 | audio_counter_resample += cycle_audio_step; 479 | audio_sample(sample); 480 | } 481 | } 482 | } 483 | 484 | if (chip8.timer_freq == chip8.refresh_freq) { 485 | if (chip8.DT > 0) 486 | chip8.DT--; 487 | 488 | if (chip8.ST > 0) 489 | { 490 | chip8.ST--; 491 | chip8.beep = chip8.ST > 0 ? true : false; 492 | } 493 | } 494 | 495 | cpu_debt = (chip8.cpu_freq + cpu_debt) % chip8.refresh_freq; 496 | 497 | // Output video 498 | draw_display(); 499 | video_cb(frame, DISPLAY_WIDTH, DISPLAY_HEIGHT, sizeof(pixel_t) * DISPLAY_WIDTH); 500 | } 501 | 502 | unsigned retro_get_region(void) 503 | { 504 | return RETRO_REGION_NTSC; 505 | } 506 | 507 | void retro_get_system_info(struct retro_system_info *info) 508 | { 509 | memset(info, 0, sizeof(*info)); 510 | info->library_name = "JAXE"; 511 | #ifndef GIT_VERSION 512 | #define GIT_VERSION "" 513 | #endif 514 | info->library_version = "1.0" GIT_VERSION; 515 | info->valid_extensions = VALID_EXTENSIONS; 516 | info->need_fullpath = false; 517 | } 518 | 519 | void retro_get_system_av_info(struct retro_system_av_info *info) 520 | { 521 | #ifdef USE_RGB565 522 | int pixelformat = RETRO_PIXEL_FORMAT_RGB565; 523 | #else 524 | int pixelformat = RETRO_PIXEL_FORMAT_XRGB8888; 525 | #endif 526 | 527 | memset(info, 0, sizeof(*info)); 528 | info->geometry.base_width = DISPLAY_WIDTH; 529 | info->geometry.base_height = DISPLAY_HEIGHT; 530 | info->geometry.max_width = DISPLAY_WIDTH; 531 | info->geometry.max_height = DISPLAY_HEIGHT; 532 | info->geometry.aspect_ratio = ((float)DISPLAY_WIDTH) / ((float)DISPLAY_HEIGHT); 533 | 534 | info->timing.fps = chip8.refresh_freq; 535 | info->timing.sample_rate = AUDIO_RESAMPLE_RATE; 536 | 537 | environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &pixelformat); 538 | } 539 | 540 | 541 | void retro_deinit(void) { } 542 | 543 | void retro_reset(void) 544 | { 545 | load_rom(); 546 | } 547 | 548 | struct serialized_state 549 | { 550 | CHIP8 chip8; 551 | unsigned long cpu_debt; 552 | unsigned int audio_counter_chip8; 553 | unsigned int audio_counter_resample; 554 | unsigned int audio_freq_chip8; 555 | int snd_buf_pntr; 556 | uint8_t sram[NUM_USER_FLAGS]; 557 | }; 558 | 559 | size_t retro_serialize_size(void) 560 | { 561 | return sizeof (struct serialized_state); 562 | } 563 | 564 | bool retro_serialize(void *data, size_t size) 565 | { 566 | if (size < sizeof (struct serialized_state)) 567 | return false; 568 | 569 | struct serialized_state *st = (struct serialized_state *) data; 570 | memcpy(&st->chip8, &chip8, sizeof(st->chip8)); 571 | st->cpu_debt = cpu_debt; 572 | st->audio_counter_chip8 = audio_counter_chip8; 573 | st->audio_counter_resample = audio_counter_resample; 574 | st->audio_freq_chip8 = audio_freq_chip8; 575 | st->snd_buf_pntr = snd_buf_pntr; 576 | memcpy(st->sram, sram, sizeof(st->sram)); 577 | return true; 578 | } 579 | 580 | bool retro_unserialize(const void *data, size_t size) 581 | { 582 | if (size < sizeof (struct serialized_state)) 583 | return false; 584 | 585 | const struct serialized_state *st = (struct serialized_state *) data; 586 | memcpy(&chip8, &st->chip8, sizeof(chip8)); 587 | cpu_debt = st->cpu_debt; 588 | audio_counter_chip8 = st->audio_counter_chip8; 589 | audio_counter_resample = st->audio_counter_resample; 590 | audio_freq_chip8 = st->audio_freq_chip8; 591 | snd_buf_pntr = st->snd_buf_pntr; 592 | memcpy(sram, st->sram, sizeof(st->sram)); 593 | return true; 594 | } 595 | 596 | size_t retro_get_memory_size(unsigned id) 597 | { 598 | switch(id) 599 | { 600 | case RETRO_MEMORY_SYSTEM_RAM: // System Memory 601 | return MAX_RAM; 602 | 603 | case RETRO_MEMORY_SAVE_RAM: // SRAM 604 | return sizeof(sram); 605 | 606 | // TODO: VRAM 607 | } 608 | return 0; 609 | } 610 | 611 | void *retro_get_memory_data(unsigned id) 612 | { 613 | switch(id) 614 | { 615 | case RETRO_MEMORY_SYSTEM_RAM: // System Memory 616 | return chip8.RAM; 617 | 618 | case RETRO_MEMORY_SAVE_RAM: // SRAM 619 | return sram; 620 | 621 | // TODO: VRAM 622 | } 623 | return 0; 624 | } 625 | 626 | /* Stubs */ 627 | unsigned int retro_api_version(void) { return RETRO_API_VERSION; } 628 | void retro_cheat_reset(void) { } 629 | void retro_cheat_set(unsigned idx, bool enabled, const char *code) { 630 | (void) idx; 631 | (void) enabled; 632 | (void) code; 633 | } 634 | bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info) { 635 | (void) game_type; 636 | (void) info; 637 | (void) num_info; 638 | return false; 639 | } 640 | void retro_set_controller_port_device(unsigned port, unsigned device) { 641 | (void) port; 642 | (void) device; 643 | } 644 | -------------------------------------------------------------------------------- /Makefile.libretro: -------------------------------------------------------------------------------- 1 | STATIC_LINKING=0 2 | AR := ar 3 | 4 | ifeq ($(platform),) 5 | platform = unix 6 | ifeq ($(shell uname -a),) 7 | platform = win 8 | else ifneq ($(findstring MINGW,$(shell uname -a)),) 9 | platform = win 10 | else ifneq ($(findstring Darwin,$(shell uname -a)),) 11 | platform = osx 12 | else ifneq ($(findstring win,$(shell uname -a)),) 13 | platform = win 14 | endif 15 | endif 16 | 17 | # system platform 18 | system_platform = unix 19 | ifeq ($(shell uname -a),) 20 | EXE_EXT = .exe 21 | system_platform = win 22 | else ifneq ($(findstring Darwin,$(shell uname -a)),) 23 | system_platform = osx 24 | arch = intel 25 | ifeq ($(shell uname -p),powerpc) 26 | arch = ppc 27 | endif 28 | else ifneq ($(findstring MINGW,$(shell uname -a)),) 29 | system_platform = win 30 | endif 31 | 32 | 33 | CORE_DIR += . 34 | TARGET_NAME := jaxe 35 | SOURCE_DIR := src 36 | GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" 37 | ifneq ($(GIT_VERSION)," unknown") 38 | CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" 39 | endif 40 | CFLAGS += -std=c99 41 | 42 | ifeq ($(STATIC_LINKING),1) 43 | EXT := a 44 | endif 45 | 46 | ifneq (,$(filter $(platform), unix unix-armv7-hardfloat-neon)) 47 | EXT ?= so 48 | TARGET := $(TARGET_NAME)_libretro.$(EXT) 49 | fpic := -fPIC 50 | SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T -Wl,--no-undefined 51 | LIBS = -lm 52 | else ifeq ($(platform), linux-portable) 53 | TARGET := $(TARGET_NAME)_libretro.$(EXT) 54 | fpic := -fPIC -nostdlib 55 | SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T 56 | LIBS = -lm 57 | # tvOS 58 | else ifeq ($(platform), tvos-arm64) 59 | TARGET := $(TARGET_NAME)_libretro_tvos.dylib 60 | fpic := -fPIC 61 | SHARED := -dynamiclib 62 | CFLAGS += -DIOS 63 | ifeq ($(IOSSDK),) 64 | IOSSDK := $(shell xcodebuild -version -sdk appletvos Path) 65 | endif 66 | CFLAGS += -arch arm64 -isysroot $(IOSSDK) 67 | CXXFLAGS += -arch arm64 -isysroot $(IOSSDK) 68 | LDFLAGS += -arch arm64 -isysroot $(IOSSDK) 69 | else ifneq (,$(findstring osx,$(platform))) 70 | TARGET := $(TARGET_NAME)_libretro.dylib 71 | fpic := -fPIC 72 | SHARED := -dynamiclib 73 | 74 | ifeq ($(CROSS_COMPILE),1) 75 | TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT) 76 | CFLAGS += $(TARGET_RULE) 77 | CPPFLAGS += $(TARGET_RULE) 78 | CXXFLAGS += $(TARGET_RULE) 79 | LDFLAGS += $(TARGET_RULE) 80 | endif 81 | else ifneq (,$(findstring ios,$(platform))) 82 | TARGET := $(TARGET_NAME)_libretro_ios.dylib 83 | fpic := -fPIC 84 | SHARED := -dynamiclib 85 | 86 | ifeq ($(IOSSDK),) 87 | IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path) 88 | endif 89 | 90 | DEFINES := -DIOS 91 | ifeq ($(platform),ios-arm64) 92 | CFLAGS += -arch arm64 -isysroot $(IOSSDK) 93 | CXXFLAGS += -arch arm64 -isysroot $(IOSSDK) 94 | LDFLAGS += -arch arm64 -isysroot $(IOSSDK) 95 | else 96 | CC = cc -arch armv7 -isysroot $(IOSSDK) 97 | LD = cc -arch armv7 -isysroot $(IOSSDK) 98 | endif 99 | 100 | ifeq ($(platform),ios9) 101 | CC += -miphoneos-version-min=8.0 102 | CXXFLAGS += -miphoneos-version-min=8.0 103 | else 104 | CC += -miphoneos-version-min=5.0 105 | CXXFLAGS += -miphoneos-version-min=5.0 106 | endif 107 | 108 | # PS3 109 | else ifeq ($(platform), ps3) 110 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 111 | CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe 112 | AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe 113 | PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__ppc__ 114 | HAVE_RZLIB := 1 115 | STATIC_LINKING=1 116 | 117 | # PS3 (SNC) 118 | else ifeq ($(platform), sncps3) 119 | TARGET := $(TARGET_NAME)_libretro_ps3.a 120 | CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe 121 | AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe 122 | GCC_DEFINES := 123 | PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__ppc__ 124 | HAVE_RZLIB := 1 125 | STATIC_LINKING=1 126 | 127 | # Lightweight PS3 Homebrew SDK 128 | else ifeq ($(platform), psl1ght) 129 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 130 | CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) 131 | AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) 132 | GCC_DEFINES := 133 | PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__ppc__ 134 | HAVE_RZLIB := 1 135 | STATIC_LINKING=1 136 | 137 | # Xbox 360 (libxenon) 138 | else ifeq ($(platform), xenon) 139 | TARGET := $(TARGET_NAME)_libretro.a 140 | CC = xenon-gcc$(EXE_EXT) 141 | AR = xenon-ar$(EXE_EXT) 142 | CFLAGS += -D__LIBXENON__ -m32 -D__ppc__ 143 | PLATFORM_DEFINES := -D__LIBXENON__ -D__ppc_ 144 | STATIC_LINKING=1 145 | 146 | # Nintendo Game Cube 147 | else ifeq ($(platform), ngc) 148 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 149 | CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) 150 | AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) 151 | PLATFORM_DEFINES += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float 152 | HAVE_RZLIB := 1 153 | STATIC_LINKING=1 154 | 155 | # QNX / BLackberry 156 | else ifneq (,$(findstring qnx,$(platform))) 157 | TARGET := $(TARGET_NAME)_libretro_qnx.so 158 | fpic := -fPIC 159 | SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T -Wl,--no-undefined 160 | CC = qcc -Vgcc_ntoarmv7le 161 | CXX = QCC -Vgcc_ntoarmv7le 162 | # Nintendo Wii 163 | else ifeq ($(platform), wii) 164 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 165 | CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) 166 | AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) 167 | PLATFORM_DEFINES += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float 168 | HAVE_RZLIB := 1 169 | STATIC_LINKING=1 170 | 171 | # Nintendo Switch (libnx) 172 | else ifeq ($(platform), libnx) 173 | include $(DEVKITPRO)/libnx/switch_rules 174 | EXT=a 175 | TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT) 176 | DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL 177 | CFLAGS := $(DEFINES) -g -O3 \ 178 | -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs 179 | CFLAGS += $(INCDIRS) 180 | CFLAGS += -D__SWITCH__ -DHAVE_LIBNX -march=armv8-a -mtune=cortex-a57 -mtp=soft 181 | CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -std=gnu++11 182 | CFLAGS += -std=gnu11 183 | STATIC_LINKING = 1 184 | 185 | # Nintendo WiiU 186 | else ifeq ($(platform), wiiu) 187 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 188 | CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) 189 | AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) 190 | PLATFORM_DEFINES += -DGEKKO -DWIIU -DHW_RVL -mwup -mcpu=750 -meabi -mhard-float 191 | HAVE_RZLIB := 1 192 | STATIC_LINKING=1 193 | 194 | # Nintendo Switch (libtransistor) 195 | else ifeq ($(platform), switch) 196 | EXT=a 197 | TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT) 198 | include $(LIBTRANSISTOR_HOME)/libtransistor.mk 199 | HAVE_RZLIB := 1 200 | STATIC_LINKING=1 201 | 202 | # Classic Platforms #################### 203 | # Platform affix = classic__<µARCH> 204 | # Help at https://modmyclassic.com/comp 205 | 206 | # (armv7 a7, hard point, neon based) ### 207 | # NESC, SNESC, C64 mini 208 | else ifeq ($(platform), classic_armv7_a7) 209 | TARGET := $(TARGET_NAME)_libretro.so 210 | fpic := -fPIC 211 | SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T -Wl,--no-undefined 212 | CFLAGS += -Ofast \ 213 | -fdata-sections -ffunction-sections -Wl,--gc-sections \ 214 | -fno-stack-protector -fno-ident -fomit-frame-pointer \ 215 | -falign-functions=1 -falign-jumps=1 -falign-loops=1 \ 216 | -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \ 217 | -fmerge-all-constants -fno-math-errno \ 218 | -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard 219 | HAVE_NEON = 1 220 | ARCH = arm 221 | ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1) 222 | CFLAGS += -march=armv7-a 223 | else 224 | CFLAGS += -march=armv7ve 225 | # If gcc is 5.0 or later 226 | ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1) 227 | LDFLAGS += -static-libgcc -static-libstdc++ 228 | endif 229 | endif 230 | ####################################### 231 | 232 | # CTR/3DS 233 | else ifeq ($(platform), ctr) 234 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 235 | CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT) 236 | AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT) 237 | CFLAGS += -DARM11 -D_3DS 238 | CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard 239 | CFLAGS += -Wall -mword-relocations 240 | CFLAGS += -fomit-frame-pointer -ffast-math 241 | HAVE_RZLIB := 1 242 | DISABLE_ERROR_LOGGING := 1 243 | ARM = 1 244 | STATIC_LINKING=1 245 | 246 | # RETROFW 247 | else ifeq ($(platform), retrofw) 248 | EXT ?= so 249 | TARGET := $(TARGET_NAME)_libretro.$(EXT) 250 | CC = /opt/retrofw-toolchain/usr/bin/mipsel-linux-gcc 251 | AR = /opt/retrofw-toolchain/usr/bin/mipsel-linux-ar 252 | fpic := -fPIC 253 | SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T -Wl,--no-undefined 254 | CFLAGS += -ffast-math -march=mips32 -mtune=mips32 -mhard-float 255 | LIBS = -lm 256 | 257 | # Emscripten 258 | else ifeq ($(platform), emscripten) 259 | TARGET := $(TARGET_NAME)_libretro_$(platform).bc 260 | fpic := -fPIC 261 | SHARED := -shared -r 262 | STATIC_LINKING=1 263 | 264 | # PS2 265 | else ifeq ($(platform), ps2) 266 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 267 | CC = mips64r5900el-ps2-elf-gcc 268 | AR = mips64r5900el-ps2-elf-ar 269 | CFLAGS += -G0 -DPS2 -DUSE_RGB565 -DABGR1555 270 | CXXFLAGS += -G0 -DPS2 -DUSE_RGB565 -DABGR1555 271 | STATIC_LINKING=1 272 | 273 | # PSP 274 | else ifeq ($(platform), psp1) 275 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 276 | CC = psp-gcc 277 | AR = psp-ar 278 | CFLAGS += -G0 -DPSP -DUSE_RGB565 279 | CXXFLAGS += -G0 -DPSP -DUSE_RGB565 280 | STATIC_LINKING=1 281 | 282 | # Playstation Vita 283 | else ifeq ($(platform), vita) 284 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 285 | CC = arm-vita-eabi-gcc 286 | AR = arm-vita-eabi-ar 287 | CXXFLAGS += -Wl,-q -Wall -O3 288 | STATIC_LINKING=1 289 | # RS90 290 | else ifeq ($(platform), rs90) 291 | TARGET := $(TARGET_NAME)_libretro.so 292 | CC = /opt/rs90-toolchain/usr/bin/mipsel-linux-gcc 293 | CXX = /opt/rs90-toolchain/usr/bin/mipsel-linux-g++ 294 | AR = /opt/rs90-toolchain/usr/bin/mipsel-linux-ar 295 | fpic := -fPIC 296 | SHARED := -shared -Wl,-version-script=$(CORE_DIR)/link.T 297 | PLATFORM_DEFINES := -DCC_RESAMPLER -DCC_RESAMPLER_NO_HIGHPASS 298 | CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32 299 | CXXFLAGS += $(CFLAGS) 300 | 301 | # GCW0 302 | else ifeq ($(platform), gcw0) 303 | TARGET := $(TARGET_NAME)_libretro.so 304 | CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc 305 | AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar 306 | fpic := -fPIC 307 | SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined 308 | 309 | DISABLE_ERROR_LOGGING := 1 310 | CFLAGS += -march=mips32 -mtune=mips32r2 -mhard-float 311 | LIBS = -lm 312 | 313 | # Windows MSVC 2017 all architectures 314 | else ifneq (,$(findstring windows_msvc2017,$(platform))) 315 | 316 | PlatformSuffix = $(subst windows_msvc2017_,,$(platform)) 317 | ifneq (,$(findstring desktop,$(PlatformSuffix))) 318 | WinPartition = desktop 319 | MSVC2017CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP 320 | LDFLAGS += -MANIFEST -LTCG:incremental -NXCOMPAT -DYNAMICBASE -DEBUG -OPT:REF -INCREMENTAL:NO -SUBSYSTEM:WINDOWS -MANIFESTUAC:"level='asInvoker' uiAccess='false'" -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 321 | LIBS += kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib 322 | else ifneq (,$(findstring uwp,$(PlatformSuffix))) 323 | WinPartition = uwp 324 | MSVC2017CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_APP -DWINDLL -D_UNICODE -DUNICODE -DWRL_NO_DEFAULT_LIB 325 | LDFLAGS += -APPCONTAINER -NXCOMPAT -DYNAMICBASE -MANIFEST:NO -LTCG -OPT:REF -SUBSYSTEM:CONSOLE -MANIFESTUAC:NO -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 -DEBUG:FULL -WINMD:NO 326 | LIBS += WindowsApp.lib 327 | endif 328 | 329 | CFLAGS += $(MSVC2017CompileFlags) 330 | CXXFLAGS += $(MSVC2017CompileFlags) 331 | 332 | TargetArchMoniker = $(subst $(WinPartition)_,,$(PlatformSuffix)) 333 | 334 | CC = cl.exe 335 | CXX = cl.exe 336 | 337 | reg_query = $(call filter_out2,$(subst $2,,$(shell reg query "$2" -v "$1" 2>nul))) 338 | fix_path = $(subst $(SPACE),\ ,$(subst \,/,$1)) 339 | 340 | ProgramFiles86w := $(shell cmd //c "echo %PROGRAMFILES(x86)%") 341 | ProgramFiles86 := $(shell cygpath "$(ProgramFiles86w)") 342 | 343 | WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0) 344 | WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0) 345 | WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0) 346 | WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0) 347 | WindowsSdkDir := $(WindowsSdkDir) 348 | 349 | WindowsSDKVersion ?= $(firstword $(foreach folder,$(subst $(subst \,/,$(WindowsSdkDir)Include/),,$(wildcard $(call fix_path,$(WindowsSdkDir)Include\*))),$(if $(wildcard $(call fix_path,$(WindowsSdkDir)Include/$(folder)/um/Windows.h)),$(folder),)))$(BACKSLASH) 350 | WindowsSDKVersion := $(WindowsSDKVersion) 351 | 352 | VsInstallBuildTools = $(ProgramFiles86)/Microsoft Visual Studio/2017/BuildTools 353 | VsInstallEnterprise = $(ProgramFiles86)/Microsoft Visual Studio/2017/Enterprise 354 | VsInstallProfessional = $(ProgramFiles86)/Microsoft Visual Studio/2017/Professional 355 | VsInstallCommunity = $(ProgramFiles86)/Microsoft Visual Studio/2017/Community 356 | 357 | VsInstallRoot ?= $(shell if [ -d "$(VsInstallBuildTools)" ]; then echo "$(VsInstallBuildTools)"; fi) 358 | ifeq ($(VsInstallRoot), ) 359 | VsInstallRoot = $(shell if [ -d "$(VsInstallEnterprise)" ]; then echo "$(VsInstallEnterprise)"; fi) 360 | endif 361 | ifeq ($(VsInstallRoot), ) 362 | VsInstallRoot = $(shell if [ -d "$(VsInstallProfessional)" ]; then echo "$(VsInstallProfessional)"; fi) 363 | endif 364 | ifeq ($(VsInstallRoot), ) 365 | VsInstallRoot = $(shell if [ -d "$(VsInstallCommunity)" ]; then echo "$(VsInstallCommunity)"; fi) 366 | endif 367 | VsInstallRoot := $(VsInstallRoot) 368 | 369 | VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') 370 | VcCompilerToolsDir := $(VsInstallRoot)/VC/Tools/MSVC/$(VcCompilerToolsVer) 371 | 372 | WindowsSDKSharedIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\shared") 373 | WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt") 374 | WindowsSDKUMIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\um") 375 | WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)") 376 | WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\$(TargetArchMoniker)") 377 | 378 | # For some reason the HostX86 compiler doesn't like compiling for x64 379 | # ("no such file" opening a shared library), and vice-versa. 380 | # Work around it for now by using the strictly x86 compiler for x86, and x64 for x64. 381 | # NOTE: What about ARM? 382 | ifneq (,$(findstring x64,$(TargetArchMoniker))) 383 | VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX64 384 | else 385 | VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX86 386 | endif 387 | 388 | PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/$(TargetArchMoniker)"):$(PATH) 389 | PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") 390 | INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/include") 391 | LIB := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/lib/$(TargetArchMoniker)") 392 | 393 | export INCLUDE := $(INCLUDE);$(WindowsSDKSharedIncludeDir);$(WindowsSDKUCRTIncludeDir);$(WindowsSDKUMIncludeDir) 394 | export LIB := $(LIB);$(WindowsSDKUCRTLibDir);$(WindowsSDKUMLibDir) 395 | TARGET := $(TARGET_NAME)_libretro.dll 396 | PSS_STYLE :=2 397 | LDFLAGS += -DLL 398 | # Windows MSVC 2010 x64 399 | else ifeq ($(platform), windows_msvc2010_x64) 400 | CC = cl.exe -TP 401 | CXX = cl.exe 402 | 403 | CFLAGS += -wd4711 -wd4514 -wd4820 -DUSE_RGB565=1 404 | CXXFLAGS += -wd4711 -wd4514 -wd4820 -DUSE_RGB565=1 405 | 406 | PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin/amd64"):$(PATH) 407 | PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE") 408 | LIB := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/lib/amd64") 409 | INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include") 410 | 411 | WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') 412 | WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') 413 | 414 | WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include") 415 | WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl") 416 | WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\x64") 417 | 418 | INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)" 419 | export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKGlIncludeDir) 420 | export LIB := $(LIB);$(WindowsSDKLibDir) 421 | 422 | TARGET := $(TARGET_NAME)_libretro.dll 423 | LDFLAGS += -DLL 424 | 425 | # Windows MSVC 2010 x86 426 | else ifeq ($(platform), windows_msvc2010_x86) 427 | CC = cl.exe -TP 428 | CXX = cl.exe 429 | 430 | CFLAGS += -wd4711 -wd4514 -wd4820 -DUSE_RGB565=1 431 | CXXFLAGS += -wd4711 -wd4514 -wd4820 -DUSE_RGB565=1 432 | 433 | PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin"):$(PATH) 434 | PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE") 435 | LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/lib") 436 | INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include") 437 | 438 | WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') 439 | WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') 440 | 441 | WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include") 442 | WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl") 443 | WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib") 444 | 445 | INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)" 446 | export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKGlIncludeDir) 447 | export LIB := $(LIB);$(WindowsSDKLibDir) 448 | TARGET := $(TARGET_NAME)_libretro.dll 449 | LDFLAGS += -DLL 450 | 451 | # Windows MSVC 2005 x86 452 | else ifeq ($(platform), windows_msvc2005_x86) 453 | CC = cl.exe -TP 454 | CXX = cl.exe 455 | 456 | CFLAGS += -wd4711 -wd4514 -wd4820 -DUSE_RGB565=1 457 | CXXFLAGS += -wd4711 -wd4514 -wd4820 -DUSE_RGB565=1 458 | 459 | PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH) 460 | PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE") 461 | INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/include") 462 | LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/lib") 463 | BIN := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin") 464 | 465 | WindowsSdkDir := $(INETSDK) 466 | 467 | export INCLUDE := $(INCLUDE);$(INETSDK)/Include;src/libretro/libretro-common/include/compat/msvc 468 | export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib 469 | TARGET := $(TARGET_NAME)_libretro.dll 470 | PSS_STYLE :=2 471 | LDFLAGS += -DLL 472 | CFLAGS += -D_CRT_SECURE_NO_DEPRECATE 473 | LIBS = 474 | 475 | # Windows MSVC 2003 Xbox 1 476 | else ifeq ($(platform), xbox1_msvc2003) 477 | TARGET := $(TARGET_NAME)_libretro_xdk1.lib 478 | MSVCBINDIRPREFIX = $(XDK)/xbox/bin/vc71 479 | CC = "$(MSVCBINDIRPREFIX)/CL.exe" 480 | CXX = "$(MSVCBINDIRPREFIX)/CL.exe" 481 | LD = "$(MSVCBINDIRPREFIX)/lib.exe" 482 | 483 | export INCLUDE := $(XDK)/xbox/include 484 | export LIB := $(XDK)/xbox/lib 485 | PSS_STYLE :=2 486 | CFLAGS += -D_XBOX -D_XBOX1 487 | CXXFLAGS += -D_XBOX -D_XBOX1 488 | STATIC_LINKING=1 489 | 490 | # Windows MSVC 2010 Xbox 360 491 | else ifeq ($(platform), xbox360_msvc2010) 492 | TARGET := $(TARGET_NAME)_libretro_xdk360.lib 493 | MSVCBINDIRPREFIX = $(XEDK)/bin/win32 494 | CC = "$(MSVCBINDIRPREFIX)/cl.exe" 495 | CXX = "$(MSVCBINDIRPREFIX)/cl.exe" 496 | LD = "$(MSVCBINDIRPREFIX)/lib.exe" 497 | 498 | export INCLUDE := $(XEDK)/include/xbox 499 | export LIB := $(XEDK)/lib/xbox 500 | PSS_STYLE :=2 501 | CFLAGS += -D_XBOX -D_XBOX360 502 | CXXFLAGS += -D_XBOX -D_XBOX360 503 | STATIC_LINKING=1 504 | 505 | # MIYOO 506 | else ifeq ($(platform), miyoo) 507 | TARGET := $(TARGET_NAME)_libretro.so 508 | fpic := -fPIC 509 | SHARED := -shared -Wl,-version-script=link.T 510 | CC = /opt/miyoo/usr/bin/arm-linux-gcc 511 | AR = /opt/miyoo/usr/bin/arm-linux-ar 512 | CFLAGS += -fomit-frame-pointer -ffast-math -march=armv5te -mtune=arm926ej-s 513 | 514 | # DOS 515 | else ifeq ($(platform), dos) 516 | TARGET := $(TARGET_NAME)_libretro_$(platform).a 517 | CC = i586-pc-msdosdjgpp-gcc 518 | AR = i586-pc-msdosdjgpp-ar 519 | CXX = i586-pc-msdosdjgpp-g++ 520 | PLATFORM_DEFINES += -march=i386 521 | STATIC_LINKING=1 522 | 523 | # Current Windows builds via mingw/gcc 524 | else 525 | TARGET := $(TARGET_NAME)_libretro.dll 526 | CC ?= gcc 527 | SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=$(CORE_DIR)/link.T -Wl,--no-undefined 528 | CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__ -Wno-missing-field-initializers 529 | endif 530 | 531 | ifneq ($(platform), sncps3) 532 | ifeq (,$(findstring msvc,$(platform))) 533 | CFLAGS += -Wall -Wno-sign-compare -Wunused \ 534 | -Wpointer-arith -Wbad-function-cast -Wcast-align -Waggregate-return \ 535 | -Wshadow -Wstrict-prototypes \ 536 | -Wformat-security -Wwrite-strings \ 537 | -Wdisabled-optimization 538 | endif 539 | endif 540 | 541 | ifeq ($(DEBUG), 1) 542 | CFLAGS += -O0 -Wall -Wno-unused -g 543 | else 544 | CFLAGS += -O2 -DNDEBUG 545 | endif 546 | 547 | ifeq (,$(findstring msvc,$(platform))) 548 | CFLAGS += -fomit-frame-pointer -fstrict-aliasing 549 | endif 550 | 551 | ifeq ($(DEBUG), 1) 552 | CXXFLAGS += -O0 -g 553 | else 554 | CXXFLAGS += -O3 555 | endif 556 | 557 | include Makefile.common 558 | 559 | OBJECTS := $(SOURCES_C:.c=.o) $(SOURCES_CXX:.cpp=.o) 560 | 561 | CFLAGS += -Wall -D__LIBRETRO__ $(INCLUDES) $(fpic) 562 | CXXFLAGS += -Wall -D__LIBRETRO__ $(INCLUDES) $(fpic) 563 | 564 | OBJOUT = -o 565 | LINKOUT = -o 566 | 567 | ifneq (,$(findstring msvc,$(platform))) 568 | OBJOUT = -Fo 569 | LINKOUT = -out: 570 | ifeq ($(STATIC_LINKING),1) 571 | LD ?= lib.exe 572 | STATIC_LINKING=0 573 | else 574 | LD = link.exe 575 | endif 576 | else 577 | LD = $(CC) 578 | endif 579 | 580 | all: $(TARGET) 581 | 582 | $(TARGET): $(OBJECTS) 583 | ifeq ($(STATIC_LINKING),1) 584 | $(AR) rcs $@ $(OBJECTS) 585 | else 586 | $(LD) $(fpic) $(SHARED) $(LDFLAGS) $(LINKOUT)$@ $(OBJECTS) $(LIBS) 587 | endif 588 | 589 | %.o: %.c 590 | $(CC) $(CFLAGS) $(fpic) -c $(OBJOUT)$@ $< 591 | 592 | clean: 593 | rm -f $(OBJECTS) $(TARGET) 594 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | #define ALLOW_GETOPTS 2 | #ifdef ALLOW_GETOPTS 3 | #include 4 | #endif 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "chip8.h" 13 | 14 | #define BAD_KEY 0x42 15 | 16 | #define DBG_STACK_MAX 1000 17 | #define DBG_PANEL_WIDTH 200 18 | #define DBG_PANEL_HEIGHT 320 19 | #define DBG_FONT_FILE "../fonts/dbgfont.ttf" 20 | #define DBG_FONT_SIZE 12 21 | 22 | #define DISPLAY_SCALE_DEFAULT 5 23 | #define DISPLAY_SCALE_MAX 20 24 | #define BG_COLOR_DEFAULT 0x000000 25 | #define P1_COLOR_DEFAULT 0xFFFFFF 26 | #define P2_COLOR_DEFAULT 0xAAAAAA 27 | #define OVERLAP_COLOR_DEFAULT 0x555555 28 | #define NUM_COLOR_THEMES (int)(sizeof(color_themes) / sizeof(color_themes[0])) 29 | 30 | // Sound 31 | int snd_buf_pntr = 0; 32 | 33 | // Emulator 34 | CHIP8 chip8; 35 | char ROM_path[MAX_FILEPATH_LEN]; 36 | uint16_t pc_start_addr = PC_START_ADDR_DEFAULT; 37 | unsigned long cpu_freq = CPU_FREQ_DEFAULT; 38 | unsigned long timer_freq = TIMER_FREQ_DEFAULT; 39 | unsigned long refresh_freq = REFRESH_FREQ_DEFAULT; 40 | bool play_sound = false; 41 | bool quirks[NUM_QUIRKS] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; 42 | bool load_dmp = false; 43 | 44 | // Color/Display 45 | // TODO: Add more themes! 46 | long color_themes[] = { 47 | BG_COLOR_DEFAULT, P1_COLOR_DEFAULT, P2_COLOR_DEFAULT, OVERLAP_COLOR_DEFAULT, 48 | 0x000000, 0xFFFFFF, 0x000000, 0x000000, // Black and white 49 | 0xFFFFFF, 0x000000, 0x000000, 0x000000, // Inverted black and white 50 | 0x000000, 0xFF0000, 0x000000, 0x000000, // Blood 51 | 0x000000, 0x00FF00, 0x000000, 0x000000, // Hacker 52 | 0x000000, 0x0000FF, 0x000000, 0x000000, // Space 53 | 0xF0907C, 0x962912, 0xF46900, 0xFAA400, // Crazy Orange 54 | 0x100019, 0xFFE1FF, 0xE700EA, 0xE700EA // Cyberpunk 55 | 56 | }; 57 | int color_theme_pntr = 0; 58 | SDL_Window *window = NULL; 59 | SDL_Surface *surface = NULL; 60 | int display_scale = DISPLAY_SCALE_DEFAULT; 61 | long bg_color = BG_COLOR_DEFAULT; 62 | long p1_color = P1_COLOR_DEFAULT; 63 | long p2_color = P2_COLOR_DEFAULT; 64 | long overlap_color = OVERLAP_COLOR_DEFAULT; 65 | TTF_Font *dbg_font = NULL; 66 | 67 | // Debugger 68 | /* This stack holds instances of the chip8 emulator after every execution. 69 | It is used to be able to step back the emulator. */ 70 | CHIP8 dbg_stack[DBG_STACK_MAX]; 71 | int dbg_stack_pntr = 0; 72 | bool debug_mode = false; 73 | bool paused = false; 74 | bool dbg_step = false; 75 | bool dbg_step_back = false; 76 | 77 | // Push the emulator state onto the debug stack. 78 | void dbg_stack_push() 79 | { 80 | dbg_stack_pntr++; 81 | 82 | if (dbg_stack_pntr >= DBG_STACK_MAX) 83 | { 84 | dbg_stack_pntr = 0; 85 | } 86 | 87 | dbg_stack[dbg_stack_pntr] = chip8; 88 | } 89 | 90 | // Pop the previous emulator state from debug stack. 91 | void dbg_stack_pop() 92 | { 93 | dbg_stack_pntr--; 94 | 95 | if (dbg_stack_pntr < 0) 96 | { 97 | dbg_stack_pntr = DBG_STACK_MAX - 1; 98 | } 99 | 100 | chip8 = dbg_stack[dbg_stack_pntr]; 101 | dbg_step = true; 102 | dbg_step_back = true; 103 | } 104 | 105 | // Cycles between color themes. 106 | void cycle_color_theme() 107 | { 108 | color_theme_pntr += 4; 109 | if (color_theme_pntr >= NUM_COLOR_THEMES) 110 | { 111 | color_theme_pntr = 0; 112 | } 113 | 114 | bg_color = color_themes[color_theme_pntr]; 115 | p1_color = color_themes[color_theme_pntr + 1]; 116 | p2_color = color_themes[color_theme_pntr + 2]; 117 | overlap_color = color_themes[color_theme_pntr + 3]; 118 | } 119 | 120 | // Frees all resources and exits. 121 | void clean_exit(int status) 122 | { 123 | if (debug_mode && dbg_font) 124 | { 125 | TTF_CloseFont(dbg_font); 126 | dbg_font = NULL; 127 | } 128 | 129 | if (surface) 130 | { 131 | SDL_FreeSurface(surface); 132 | surface = NULL; 133 | } 134 | 135 | if (window) 136 | { 137 | SDL_DestroyWindow(window); 138 | window = NULL; 139 | } 140 | 141 | SDL_CloseAudio(); 142 | SDL_Quit(); 143 | 144 | exit(status); 145 | } 146 | 147 | // Gets the name of the loaded ROM 148 | void get_ROM_name(char *rom_name) 149 | { 150 | #ifdef WIN32 151 | char delim[] = "\\"; 152 | #else 153 | char delim[] = "/"; 154 | #endif 155 | 156 | // Find the string after the last occurrence of / or \ (depending on OS) 157 | char tmp_path[MAX_FILEPATH_LEN]; 158 | sprintf(tmp_path, "%s", ROM_path); 159 | 160 | char *token = strtok(tmp_path, delim); 161 | while (token != NULL) 162 | { 163 | sprintf(rom_name, "%s", token); 164 | token = strtok(NULL, delim); 165 | } 166 | 167 | // Find the string before the first occurrence of . and that's the name! 168 | strtok(rom_name, "."); 169 | } 170 | 171 | // Creates a square sound wave based off the MSB of the emulator's sound buffer. 172 | void squarewave_callback(void *snddata, Uint8 *buffer, int bytes) 173 | { 174 | (void)snddata; 175 | 176 | for (int i = 0; i < bytes; i++) 177 | { 178 | // Get the byte of the emulator's buffer that the next sample is in. 179 | buffer[i] = chip8.RAM[AUDIO_BUF_ADDR + (snd_buf_pntr / 8)]; 180 | 181 | // Get the actual sample bit. 182 | buffer[i] <<= (snd_buf_pntr % 8); 183 | buffer[i] &= 0x80; 184 | 185 | // Finally set the buffer to max volume if sample is 1. 186 | buffer[i] *= 0xFF; 187 | 188 | /* Keep track of where we are in the emulator's sound buffer and 189 | wrap back around if necessary. */ 190 | snd_buf_pntr++; 191 | if (snd_buf_pntr >= (AUDIO_BUF_SIZE * 8)) 192 | { 193 | snd_buf_pntr = 0; 194 | } 195 | } 196 | } 197 | 198 | // Start playing a sound. 199 | void start_sound() 200 | { 201 | snd_buf_pntr = 0; 202 | 203 | SDL_AudioSpec want; 204 | 205 | // Returns 4000 * 2^((pitch - 64) / 48) 206 | want.freq = chip8_get_sound_freq(&chip8); 207 | 208 | // We only need 1 bit so might as well select smallest format 209 | want.format = AUDIO_U8; 210 | 211 | // No need for stereo so use mono 212 | want.channels = 1; 213 | 214 | // Not exactly sure why a lower number works better but 2 is lowest possible 215 | want.samples = 2; 216 | 217 | want.callback = squarewave_callback; 218 | 219 | SDL_AudioSpec have; 220 | if (SDL_OpenAudio(&want, &have) != 0) 221 | { 222 | fprintf(stderr, "Could not open audio: %s.\n", SDL_GetError()); 223 | } 224 | 225 | if (want.format != have.format) 226 | { 227 | fprintf(stderr, "Could not get desired audio spec.\n"); 228 | } 229 | 230 | SDL_PauseAudio(0); 231 | } 232 | 233 | // Stop playing sound. 234 | void stop_sound() 235 | { 236 | SDL_PauseAudio(1); 237 | SDL_CloseAudio(); 238 | } 239 | 240 | // Initializes SDL. 241 | bool init_SDL() 242 | { 243 | /* Initialize SDL */ 244 | if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) 245 | { 246 | fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError()); 247 | return false; 248 | } 249 | 250 | return true; 251 | } 252 | 253 | // Checks and processes command-line arguments. 254 | bool handle_args(int argc, char **argv) 255 | { 256 | if (argc < 2) 257 | { 258 | fprintf(stderr, "Usage: ./jaxe [options] \n"); 259 | return false; 260 | } 261 | else if (argc >= 2) 262 | { 263 | if (strlen(argv[argc - 1]) >= MAX_FILEPATH_LEN) 264 | { 265 | fprintf(stderr, "ROM path must be less than %d characters.\n", 266 | MAX_FILEPATH_LEN); 267 | clean_exit(1); 268 | } 269 | 270 | sprintf(ROM_path, "%s", argv[argc - 1]); 271 | 272 | #ifdef ALLOW_GETOPTS 273 | int opt; 274 | while ((opt = getopt(argc, argv, "012345678xldms:p:c:t:r:f:b:n:k:")) != -1) 275 | { 276 | switch (opt) 277 | { 278 | // Toggle specific S-CHIP "quirks" 279 | case '0': 280 | case '1': 281 | case '2': 282 | case '3': 283 | case '4': 284 | case '5': 285 | case '6': 286 | case '7': 287 | case '8': 288 | case '9': 289 | quirks[opt - '0'] = false; 290 | break; 291 | 292 | // Toggle legacy mode 293 | case 'l': 294 | for (size_t i = 0; i < NUM_QUIRKS; i++) 295 | { 296 | quirks[i] = false; 297 | } 298 | 299 | // Both CHIP-8 and SCHIP apparently clip sprites (but not XO-CHIP) 300 | quirks[6] = true; 301 | 302 | break; 303 | 304 | // Toggle XO-CHIP mode 305 | case 'x': 306 | /* XO-CHIP is similar to legacy mode except the last quirk 307 | (VF Reset) should not be enabled and sprite wrapping should 308 | be enabled. */ 309 | for (size_t i = 0; i < NUM_QUIRKS - 1; i++) 310 | { 311 | quirks[i] = false; 312 | } 313 | break; 314 | 315 | // Toggle debug mode 316 | case 'd': 317 | debug_mode = true; 318 | paused = true; 319 | break; 320 | 321 | // Specify to emulator to load dump file as opposed to ROM 322 | case 'm': 323 | load_dmp = true; 324 | break; 325 | 326 | // Set display scale 327 | case 's': 328 | display_scale = atoi(optarg); 329 | if (display_scale > DISPLAY_SCALE_MAX) 330 | { 331 | display_scale = DISPLAY_SCALE_MAX; 332 | } 333 | 334 | break; 335 | 336 | // Set the address emulator begins executing at 337 | case 'p': 338 | pc_start_addr = strtol(optarg, NULL, 16); 339 | break; 340 | 341 | // Set CPU frequency 342 | case 'c': 343 | cpu_freq = atoi(optarg); 344 | break; 345 | 346 | // Set timer frequency 347 | case 't': 348 | timer_freq = atoi(optarg); 349 | break; 350 | 351 | // Set screen refresh frequency 352 | case 'r': 353 | refresh_freq = atoi(optarg); 354 | break; 355 | 356 | // Set background color 357 | case 'b': 358 | color_themes[0] = strtol(optarg, NULL, 16); 359 | bg_color = color_themes[0]; 360 | break; 361 | 362 | // Set plane 1 color 363 | case 'f': 364 | color_themes[1] = strtol(optarg, NULL, 16); 365 | p1_color = color_themes[1]; 366 | break; 367 | 368 | // Set plane 2 color 369 | case 'k': 370 | color_themes[2] = strtol(optarg, NULL, 16); 371 | p2_color = color_themes[2]; 372 | break; 373 | 374 | // Set overlap color 375 | case 'n': 376 | color_themes[3] = strtol(optarg, NULL, 16); 377 | overlap_color = color_themes[3]; 378 | break; 379 | } 380 | } 381 | #endif 382 | } 383 | 384 | return true; 385 | } 386 | 387 | // Set up the emulator to begin running. 388 | bool init_emulator() 389 | { 390 | /* If a dump file is given, skip initialization since dump contains 391 | all necessary data. */ 392 | if (!load_dmp) 393 | { 394 | chip8_init(&chip8, cpu_freq, timer_freq, refresh_freq, pc_start_addr, 395 | quirks); 396 | chip8_load_font(&chip8); 397 | 398 | /* Load ROM into memory. */ 399 | if (!chip8_load_rom(&chip8, ROM_path)) 400 | { 401 | return false; 402 | } 403 | } 404 | else if (!chip8_load_dump(&chip8, ROM_path)) 405 | { 406 | return false; 407 | } 408 | 409 | // Initialize the dbg stack with instances of the initial emulator state. 410 | for (int i = 0; i < DBG_STACK_MAX; i++) 411 | { 412 | dbg_stack[i] = chip8; 413 | } 414 | 415 | return true; 416 | } 417 | 418 | // Create the SDL window. 419 | SDL_Window *create_window() 420 | { 421 | int window_width = DISPLAY_WIDTH * display_scale; 422 | int window_height = DISPLAY_HEIGHT * display_scale; 423 | 424 | if (debug_mode) 425 | { 426 | // Change window size depending on if debug_mode is active or not. 427 | window_width += DBG_PANEL_WIDTH; 428 | if ((display_scale * DISPLAY_HEIGHT) < DBG_PANEL_HEIGHT) 429 | { 430 | window_height = DBG_PANEL_HEIGHT; 431 | } 432 | 433 | // Initialize fonts since debug mode relies on them. 434 | if (TTF_Init() == -1) 435 | { 436 | fprintf(stderr, "Could not initialize SDL_ttf: %s\n", 437 | SDL_GetError()); 438 | return NULL; 439 | } 440 | 441 | dbg_font = TTF_OpenFont(DBG_FONT_FILE, DBG_FONT_SIZE); 442 | if (!dbg_font) 443 | { 444 | fprintf(stderr, "Could not load font: %s\n", SDL_GetError()); 445 | } 446 | } 447 | 448 | char rom_name[MAX_FILEPATH_LEN]; 449 | char title[MAX_FILEPATH_LEN + 10]; 450 | get_ROM_name(rom_name); 451 | sprintf(title, "JAXE - %s", rom_name); 452 | 453 | SDL_Window *new_window = SDL_CreateWindow(title, 454 | SDL_WINDOWPOS_CENTERED, 455 | SDL_WINDOWPOS_CENTERED, 456 | window_width, 457 | window_height, 458 | SDL_WINDOW_SHOWN); 459 | if (!new_window) 460 | { 461 | fprintf(stderr, "Could not create SDL window: %s\n", SDL_GetError()); 462 | return NULL; 463 | } 464 | 465 | return new_window; 466 | } 467 | 468 | // Sets a pixel of the SDL surface to a certain color. 469 | void set_pixel(int x, int y, long color) 470 | { 471 | Uint32 *pixels = (Uint32 *)surface->pixels; 472 | pixels[(y * surface->w) + x] = color; 473 | } 474 | 475 | // Makes the physical screen match the emulator display. 476 | void draw_display() 477 | { 478 | for (int y = 0; y < DISPLAY_HEIGHT; y++) 479 | { 480 | for (int x = 0; x < DISPLAY_WIDTH; x++) 481 | { 482 | for (int i = 0; i < display_scale; i++) 483 | { 484 | for (int j = 0; j < display_scale; j++) 485 | { 486 | int sdl_x = (x * display_scale) + j; 487 | int sdl_y = (y * display_scale) + i; 488 | long color; 489 | 490 | if (!chip8.display[y][x] && !chip8.display2[y][x]) 491 | { 492 | color = bg_color; 493 | } 494 | else if (chip8.display[y][x] && !chip8.display2[y][x]) 495 | { 496 | color = p1_color; 497 | } 498 | else if (!chip8.display[y][x] && chip8.display2[y][x]) 499 | { 500 | color = p2_color; 501 | } 502 | else if (chip8.display[y][x] && chip8.display2[y][x]) 503 | { 504 | color = overlap_color; 505 | } 506 | 507 | set_pixel(sdl_x, sdl_y, color); 508 | } 509 | } 510 | } 511 | } 512 | 513 | SDL_UpdateWindowSurface(window); 514 | } 515 | 516 | /* Display the debug panel. 517 | This function is nasty and slow as hell, I am not proud of it. */ 518 | void draw_debug() 519 | { 520 | // Create a gray rectangle surface as the side panel for debug. 521 | SDL_Surface *dbg_panel = SDL_CreateRGBSurface(0, 522 | DBG_PANEL_WIDTH, 523 | DBG_PANEL_HEIGHT, 524 | 32, 0, 0, 0, 0); 525 | SDL_FillRect(dbg_panel, NULL, SDL_MapRGB(dbg_panel->format, 200, 200, 200)); 526 | 527 | SDL_Rect dest_rect; 528 | dest_rect.x = (DISPLAY_WIDTH * display_scale) + 1; 529 | dest_rect.y = 0; 530 | dest_rect.w = DBG_PANEL_WIDTH - 1; 531 | dest_rect.h = DBG_PANEL_HEIGHT; 532 | 533 | // Now create text with useful information. 534 | SDL_Surface *txt = NULL; 535 | SDL_Color font_color; 536 | font_color.a = 0; 537 | SDL_Rect font_dest_rect; 538 | font_dest_rect.w = 0; 539 | font_dest_rect.h = 0; 540 | char dbg_str[32]; 541 | 542 | // [DEBUG] 543 | font_color.r = 0; 544 | font_color.g = 0; 545 | font_color.b = 0; 546 | font_dest_rect.x = 57; 547 | font_dest_rect.y = 5; 548 | txt = TTF_RenderText_Solid(dbg_font, "[DEBUG]", font_color); 549 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 550 | SDL_FreeSurface(txt); 551 | 552 | // OPCODE 553 | font_color.r = 255; 554 | font_color.g = 0; 555 | font_color.b = 0; 556 | font_dest_rect.x = 41; 557 | font_dest_rect.y = 30; 558 | sprintf(dbg_str, "Next: %02X%02X", chip8.RAM[chip8.PC], 559 | chip8.RAM[chip8.PC + 1]); 560 | txt = TTF_RenderText_Solid(dbg_font, dbg_str, font_color); 561 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 562 | SDL_FreeSurface(txt); 563 | 564 | // Address Holders 565 | font_color.r = 0; 566 | font_color.g = 100; 567 | font_color.b = 0; 568 | 569 | // PC 570 | font_dest_rect.x = 57; 571 | font_dest_rect.y = 56; 572 | sprintf(dbg_str, "PC: %03X", chip8.PC); 573 | txt = TTF_RenderText_Solid(dbg_font, dbg_str, font_color); 574 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 575 | SDL_FreeSurface(txt); 576 | 577 | // SP, I 578 | font_dest_rect.x = 13; 579 | font_dest_rect.y = 76; 580 | sprintf(dbg_str, "SP: %03X I: %03X", chip8.SP, chip8.I); 581 | txt = TTF_RenderText_Solid(dbg_font, dbg_str, font_color); 582 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 583 | SDL_FreeSurface(txt); 584 | 585 | // Timers 586 | font_color.r = 128; 587 | font_color.g = 0; 588 | font_color.b = 128; 589 | font_dest_rect.x = 17; 590 | font_dest_rect.y = 97; 591 | sprintf(dbg_str, "DT: %02X ST: %02X", chip8.DT, chip8.ST); 592 | txt = TTF_RenderText_Solid(dbg_font, dbg_str, font_color); 593 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 594 | SDL_FreeSurface(txt); 595 | 596 | // Registers 597 | font_color.r = 0; 598 | font_color.g = 0; 599 | font_color.b = 255; 600 | font_dest_rect.x = 18; 601 | font_dest_rect.y = 120; 602 | 603 | for (int i = 0; i < (NUM_REGISTERS / 2); i++) 604 | { 605 | sprintf(dbg_str, "V%X: %02X V%X: %02X", i, chip8.V[i], i + 8, 606 | chip8.V[i + 8]); 607 | txt = TTF_RenderText_Solid(dbg_font, dbg_str, font_color); 608 | 609 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 610 | SDL_FreeSurface(txt); 611 | 612 | font_dest_rect.y += 15; 613 | } 614 | 615 | // Instructions 616 | font_color.r = 0; 617 | font_color.g = 0; 618 | font_color.b = 0; 619 | font_dest_rect.x = 4; 620 | 621 | // UP 622 | font_dest_rect.y = 120 + (15 * 8) + 20; 623 | txt = TTF_RenderText_Solid(dbg_font, "UP/DWN: Fwd/Bk", font_color); 624 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 625 | SDL_FreeSurface(txt); 626 | 627 | // SPACE 628 | font_dest_rect.y = 120 + (15 * 8) + 36; 629 | txt = TTF_RenderText_Solid(dbg_font, "SPACE: Strt/Stop", font_color); 630 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 631 | SDL_FreeSurface(txt); 632 | 633 | // ENTER 634 | font_dest_rect.y = 120 + (15 * 8) + 52; 635 | txt = TTF_RenderText_Solid(dbg_font, "ENTER: Dump Mem", font_color); 636 | SDL_BlitSurface(txt, NULL, dbg_panel, &font_dest_rect); 637 | SDL_FreeSurface(txt); 638 | 639 | // Finally blit debug panel onto window. 640 | SDL_BlitSurface(dbg_panel, NULL, surface, &dest_rect); 641 | SDL_FreeSurface(dbg_panel); 642 | SDL_UpdateWindowSurface(window); 643 | } 644 | 645 | // Converts an SDL key code to the respective key on the emulator keypad. 646 | unsigned char SDLK_to_hex(SDL_Keycode key) 647 | { 648 | switch (key) 649 | { 650 | case SDLK_1: 651 | return 0x01; 652 | break; 653 | case SDLK_2: 654 | return 0x02; 655 | break; 656 | case SDLK_3: 657 | return 0x03; 658 | break; 659 | case SDLK_4: 660 | return 0x0C; 661 | break; 662 | case SDLK_q: 663 | return 0x04; 664 | break; 665 | case SDLK_w: 666 | return 0x05; 667 | break; 668 | case SDLK_e: 669 | return 0x06; 670 | break; 671 | case SDLK_r: 672 | return 0x0D; 673 | break; 674 | case SDLK_a: 675 | return 0x07; 676 | break; 677 | case SDLK_s: 678 | return 0x08; 679 | break; 680 | case SDLK_d: 681 | return 0x09; 682 | break; 683 | case SDLK_f: 684 | return 0x0E; 685 | break; 686 | case SDLK_z: 687 | return 0x0A; 688 | break; 689 | case SDLK_x: 690 | return 0x00; 691 | break; 692 | case SDLK_c: 693 | return 0x0B; 694 | break; 695 | case SDLK_v: 696 | return 0x0F; 697 | break; 698 | default: 699 | return BAD_KEY; 700 | break; 701 | } 702 | } 703 | 704 | // Handles sound. 705 | void handle_sound() 706 | { 707 | if (!play_sound && chip8.beep) 708 | { 709 | play_sound = true; 710 | start_sound(); 711 | } 712 | else if (play_sound && !chip8.beep) 713 | { 714 | play_sound = false; 715 | stop_sound(); 716 | } 717 | } 718 | 719 | // Handles drawing the display. 720 | void handle_display() 721 | { 722 | if (chip8.display_updated) 723 | { 724 | draw_display(); 725 | } 726 | 727 | if (debug_mode) 728 | { 729 | draw_debug(); 730 | } 731 | } 732 | 733 | // Checks for key presses/releases and a quit event. 734 | bool handle_input(SDL_Event *e) 735 | { 736 | while (SDL_PollEvent(e)) 737 | { 738 | SDL_Keycode keyc; 739 | unsigned char hexkey; 740 | 741 | switch (e->type) 742 | { 743 | case SDL_QUIT: 744 | return false; 745 | break; 746 | 747 | case SDL_KEYUP: 748 | hexkey = SDLK_to_hex(e->key.keysym.sym); 749 | keyc = e->key.keysym.sym; 750 | 751 | // Send key press to emulator 752 | if (hexkey != BAD_KEY) 753 | { 754 | chip8.keypad[hexkey] = KEY_RELEASED; 755 | return true; 756 | } 757 | 758 | switch (keyc) 759 | { 760 | // Start or stop emulator 761 | case SDLK_SPACE: 762 | paused = !paused; 763 | break; 764 | 765 | // Step forward in program 766 | case SDLK_UP: 767 | dbg_step = true && debug_mode; 768 | break; 769 | 770 | // Step backwards in program 771 | case SDLK_DOWN: 772 | if (debug_mode) 773 | { 774 | dbg_stack_pop(); 775 | } 776 | 777 | break; 778 | 779 | // Increase CPU frequency 780 | case SDLK_RIGHT: 781 | chip8_set_cpu_freq(&chip8, chip8.cpu_freq + 100); 782 | break; 783 | 784 | // Decrease CPU frequency 785 | case SDLK_LEFT: 786 | chip8_set_cpu_freq(&chip8, chip8.cpu_freq - 100); 787 | break; 788 | 789 | // Dump memory to disk 790 | case SDLK_RETURN: 791 | chip8_dump(&chip8); 792 | break; 793 | 794 | // Change color theme 795 | case SDLK_BACKSPACE: 796 | cycle_color_theme(); 797 | break; 798 | 799 | // Reset emulator 800 | case SDLK_ESCAPE: 801 | chip8_soft_reset(&chip8); 802 | break; 803 | } 804 | 805 | break; 806 | 807 | case SDL_KEYDOWN: 808 | hexkey = SDLK_to_hex(e->key.keysym.sym); 809 | if (hexkey != BAD_KEY) 810 | { 811 | chip8.keypad[hexkey] = KEY_DOWN; 812 | } 813 | 814 | break; 815 | } 816 | } 817 | 818 | return true; 819 | } 820 | 821 | int main(int argc, char **argv) 822 | { 823 | if (!handle_args(argc, argv)) 824 | { 825 | clean_exit(1); 826 | } 827 | 828 | if (!init_emulator(&chip8)) 829 | { 830 | clean_exit(1); 831 | } 832 | 833 | if (!init_SDL()) 834 | { 835 | clean_exit(1); 836 | } 837 | 838 | window = create_window(); 839 | if (!window) 840 | { 841 | clean_exit(1); 842 | } 843 | 844 | surface = SDL_GetWindowSurface(window); 845 | if (!surface) 846 | { 847 | fprintf(stderr, "Could not create SDL surface: %s\n", SDL_GetError()); 848 | clean_exit(1); 849 | } 850 | 851 | SDL_Event e; 852 | while (!chip8.exit && handle_input(&e)) 853 | { 854 | if ((!paused || dbg_step) && !dbg_step_back) 855 | { 856 | /* Push the state of the emulator into debug stack if the CPU 857 | actually executed an instruction and wasn't sleeping. */ 858 | if (chip8_cycle(&chip8)) 859 | { 860 | dbg_stack_push(); 861 | } 862 | } 863 | 864 | handle_sound(); 865 | handle_display(); 866 | 867 | dbg_step = false; 868 | dbg_step_back = false; 869 | } 870 | 871 | clean_exit(0); 872 | 873 | return 0; 874 | } 875 | --------------------------------------------------------------------------------