SlideShare a Scribd company logo
1 of 68
Download to read offline
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Let’s Write Our Own CHIP-8 Interpreter!
CON3584
David Buck
Principal Member of Technical Staff
Java Platform Group
October 3rd, 2017
Confidential – Oracle Internal/Restricted/Highly Restricted 3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Confidential – Oracle Internal/Restricted/Highly Restricted 4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• JVM Sustaining Engineer
• OpenJDK 8 Update Project
Maintainer
• JavaOne Rock Star
• Co-author of Oracle WebLogic
Server 11g 構築・運用ガイド
• @DavidBuckJP
• https://blogs.oracle.com/buck/
Hi There!
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
CHIP-8 History
CHIP-8 Architecture
Emulating CHIP-8
Advanced Emulation Topics
1
2
3
Confidential – Oracle Internal/Restricted/Highly Restricted 6
4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Introducing CHIP-8
Confidential – Oracle Internal/Restricted/Highly Restricted 7
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Before CHIP-8
Confidential – Oracle Internal/Restricted/Highly Restricted 8
https://en.wikipedia.org/w/index.php?curid=4327124
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Intel 8080
Confidential – Oracle Internal/Restricted/Highly Restricted 9
By Konstantin Lanzet - CPU collectionCamera: Canon EOS 400D, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=7028099
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Not a Poor Nerd’s Hobby…
• 1975 kit price: 439 USD
• In 2017 currency: 1,997 USD
Confidential – Oracle Internal/Restricted/Highly Restricted 10
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
COSMAC ELF
Confidential – Oracle Internal/Restricted/Highly Restricted 11
By Swtpc6800 en:User:Swtpc6800 Michael Holley - Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3471056
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
COSMAC ELF
• DIY project documented in Popular Electronics in 1976-1977
• Could be built for under 100 USD (1976 prices)
• Kits and pre-assembled boards offered from many vendors
• Very popular both then and now
Confidential – Oracle Internal/Restricted/Highly Restricted 12
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Pixie
• RCA 1861 video generator IC
• 64×32 square pixels
• Needed 256 bytes of external RAM
Confidential – Oracle Internal/Restricted/Highly Restricted 13
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
RCA COSMAC 1802
Confidential – Oracle Internal/Restricted/Highly Restricted 14
By Konstantin Lanzet (with permission) - CPU collection Konstantin Lanzet, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=4774289
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
RCA COSMAC 1802
• Complementary Symmetry Monolithic Array Computer
• 1 chip revision of an earlier 2 chip design (1801)
• Very low cost compared to 8080
• Still in use in many applications today
Confidential – Oracle Internal/Restricted/Highly Restricted 15
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Radiation Hardened Versions
Confidential – Oracle Internal/Restricted/Highly Restricted 16
By NASA - http://solarsystem.nasa.gov/multimedia/display.cfm?IM_ID=2071 (image link)http://photojournal.jpl.nasa.gov/catalog/PIA18176 (image link)
Public Domain, https://commons.wikimedia.org/w/index.php?curid=408298
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
COSMAC VIP
• Developed by Joseph Weisbecker
• Version of the ELF targeting the video game market
• Came pre-assembled
• Hex-keyboard was standard
Confidential – Oracle Internal/Restricted/Highly Restricted 17
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Hex Keyboard
Confidential – Oracle Internal/Restricted/Highly Restricted 18
By John crane 59 - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=15795865
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Hex Keyboard
Confidential – Oracle Internal/Restricted/Highly Restricted 19
1 3
4 5 6
7 8 9
0A B
C
D
E
F
2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
COSMAC VIP
Confidential – Oracle Internal/Restricted/Highly Restricted 20
• CPU: 1802
• ROM: 512-byte
• RAM: 2k~4k on-board (up to 32k external)
• Cassette interface: 100 bps
• 40 years old this year!
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Similar to “CPU Trainers” of the day…
Confidential – Oracle Internal/Restricted/Highly Restricted 21
Public Domain, https://commons.wikimedia.org/w/index.php?curid=422438
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
RCA-Studio II
Confidential – Oracle Internal/Restricted/Highly Restricted 22
By Evan-Amos - Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=38826714
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CHIP-8
• A “language” for programming video games
• Developed by Joseph Weisbecker for the VIP
• Interpreter built into the VIP ROM
• Made writing games for the VIP much easier
Confidential – Oracle Internal/Restricted/Highly Restricted 23
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
“Language”?
• Looks like machine code
• It was really a very early virtual machine specification
Confidential – Oracle Internal/Restricted/Highly Restricted 24
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Why use a virtual machine?
• Abstract away much of the real hardware
– Linier display buffer -> X,Y mapped grid
– Sprite support
– Sound support (q-line on 1802)
– Key debouncing
• Very easy to program
• Very high code density
Confidential – Oracle Internal/Restricted/Highly Restricted 25
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Other Platforms Followed (Telmac 1800)
Confidential – Oracle Internal/Restricted/Highly Restricted 26
By jpl - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=40541200
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Fast Forward About 10 Years
HP 28c released
• HP’s first graphing calculator
• Light-years beyond anything else
– RPL (lambda expressions!)
– Symbolic math (CAS)
Confidential – Oracle Internal/Restricted/Highly Restricted 27
By Kurt Moerman (Kpmkpm) - Own work, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=4020998
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Legendary 48G
• Released in 1990
• HP’s most powerful calculator for almost a decade
Confidential – Oracle Internal/Restricted/Highly Restricted 28
By Feureau.com - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=9953201
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Meanwhile…
• TI-81
• Z80 based
• BASIC-like programming language
• Very easy to program
• Very easy to make games
Confidential – Oracle Internal/Restricted/Highly Restricted 29
By Calcvids - I took this photo of my TI-81, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=24252718
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
HP48G owners were jealous!
• RPL was horrible for gaming
– Too abstract / high-level
– Slow
– Steep learning curve
Confidential – Oracle Internal/Restricted/Highly Restricted 30
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CHIP-8 to the rescue!
• Andreas Gustafsson wrote a CHIP-8 interpreter for the HP48
• HP48 users got access to library of preexisting software from the 70s
• New CHIP-8 software started to be written
• Super CHIP (SCHIP) expanded to take advantage of HP48 hardware
Confidential – Oracle Internal/Restricted/Highly Restricted 31
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CHIP-8 Today
• A great way for future emulator authors to cut their teeth
• Probably the easiest platform to emulate that plays games
• Possibly the only platform with more emulators than native software
Confidential – Oracle Internal/Restricted/Highly Restricted 32
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CHIP-8 Architecture
Confidential – Oracle Internal/Restricted/Highly Restricted 33
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Memory Map
Confidential – Oracle Internal/Restricted/Highly Restricted 34
CHIP-8 Interpreter (ROM)
Font Data
Free Memory (RAM)
Display Memory (RAM)
0x200
0x1FF
0xFFF
0xF00
0xEFF
0x000
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
An Embarrassment of Registers
• 15 8-bit general registers (V0-VE)
• 1 8-bit “Flag” register (VF)
– Only used for carry (ALU) and sprite hit detection
• 1 16-bit address register
– Only 12-bit LSBs normally used
• 1 16-bit PC
Confidential – Oracle Internal/Restricted/Highly Restricted 35
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Sound
• Write-only sound timer that decrements 60 ticks a second
• Buzzer / beeping sound plays until timer reaches zero
• No music here!
Confidential – Oracle Internal/Restricted/Highly Restricted 36
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Display
• 64x32 monochrome pixels
• Sprites
– 8 pixels wide
– 1~15 pixels tall
– Drawn to video memory by XOR:ing
– Collision flag (FV) set (or cleared)
Confidential – Oracle Internal/Restricted/Highly Restricted 37
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Timer
• Like sound timer, but no output.
• Decremented 60 ticks a second
• Stops at zero
• Can be both read or written to (unlike RO sound timer)
Confidential – Oracle Internal/Restricted/Highly Restricted 38
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Opcodes
• AAA: address
• KK: 8-bit constant (byte)
• K: 4-bit constant (nibble)
• X, Y: 4-bit register identifier
• I, PC: 16bit register
Confidential – Oracle Internal/Restricted/Highly Restricted 39
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Call instruction
• 0AAA – jump to 1802 code at AAA (not used in modern CHIP-8)
Confidential – Oracle Internal/Restricted/Highly Restricted 40
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Display
• 00E0 CLS
• FX29 set I register to font for hex digit stored in X
• DXYK draw sprite K pixels high at X, Y coordinates
Confidential – Oracle Internal/Restricted/Highly Restricted 41
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Flow Control Instructions
• 00EE return from sub ★
• 1AAA jump to AAA
• 2AAA call sub at AAA ★
• 3XKK if VX == KK skip next instruction
• 4XKK if VX != KK skip next instruction
• 5XY0 if VX == VY skip next instruction
★ push and pop return address use implementation-defined stack
Confidential – Oracle Internal/Restricted/Highly Restricted 42
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Loads / Stores / Moves
• 6XKK Vx = NN
• 8XY0 VX = VY
• AAAA I = AAA
Confidential – Oracle Internal/Restricted/Highly Restricted 43
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
ALU (Math) Instructions
• 7XKK Vx += KK
• 8XY1 Vx=Vx|Vy
• 8XY2 Vx=Vx&Vy
• 8XY3 Vx=Vx^Vy
• 8XY4 Vx += Vy
• 8XY5 Vx -= Vy
• 8XY6 Vx=Vy=Vy>>1
• 8XY7 Vx=Vy-Vx
• 8XYE Vx=Vy=Vy<<1
Confidential – Oracle Internal/Restricted/Highly Restricted 44
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Input Instructions
• EX9E if (key()==Vx) skip next instruction
• EXA1 if (key()!=Vx) skip next instruction
• FX0A Vx = next key press (blocking wait)
Confidential – Oracle Internal/Restricted/Highly Restricted 45
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Timers / Sound Instructions
• FX07 Vx = delay_timer
• FX15 delay_timer = Vx
• FX18 sound_timer = Vx
Confidential – Oracle Internal/Restricted/Highly Restricted 46
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Other Instructions
• CXKK Vx = random_number & KK
• FX33 stores 3 digits of BCD for value of Vx into I, I+1, I+2
• FX55 writes all V registers between V0 and Vx to I
• FX65 loads all V registers between V0 and Vx from I
Confidential – Oracle Internal/Restricted/Highly Restricted 47
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Emulating CHIP-8
Confidential – Oracle Internal/Restricted/Highly Restricted 48
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Overall Design
Confidential – Oracle Internal/Restricted/Highly Restricted 49
Chip8
(Interpreter) DisplayKeyPad
Memory
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Overall Design
• Allows Display and KeyPad to be swapped out with different
implementations
– AWT
– Swing
– JavaFX
– LWJGL
• Memory is isolated to be closer aligned to more advanced emulators
Confidential – Oracle Internal/Restricted/Highly Restricted 50
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Memory
• One single 4K byte array
• Handles font data (must be initialized)
• Handles reading in of program (“rom”) during startup
Confidential – Oracle Internal/Restricted/Highly Restricted 51
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Display
• ASCII ART inspired
• Appends characters to a StringBuilder
– White Pixel ‘#’
– Black Pixel ‘ ‘
• Note that screen buffer memory is independent from main memory
• Screen buffer is shared between Display and Chip8 (the interpreter)
• Screen refresh timing / method can have a huge performance impact
Confidential – Oracle Internal/Restricted/Highly Restricted 52
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
KeyPad
• Depends on enabling raw input from terminal
• Semantics of key press detection depend on automatic key repeat
– By extension also depends on a very low repeat delay
• Shutdown hook is registered to restore terminal to useable state
Confidential – Oracle Internal/Restricted/Highly Restricted 53
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Interpreter Loop
• Is a naive implementation
• Uses a simple series of nested switch statements
• Register values are stored in next larger primitive type
• Each iteration of the main loop updates timers as needed
• Each iteration of the main loop refreshes display as needed
Confidential – Oracle Internal/Restricted/Highly Restricted 54
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Debugging
• You often want some way to debug what is running on the VM
– Trace
– Breakpoints
– Memory dumps
Confidential – Oracle Internal/Restricted/Highly Restricted 55
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Other General Emulation Tips
• Start with small test cases, not full games
• Write your own tests if you cannot find any
• Have some way to throttle execution speed
• Compare your emulator’s behavior to other emulators
Confidential – Oracle Internal/Restricted/Highly Restricted 56
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Advanced Emulation Topics
Confidential – Oracle Internal/Restricted/Highly Restricted 57
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Your code should model the hardware
• Figure out how instructions are encoded / decoded (e.g. z80 decode)
• If there are multiple pieces of similar hardware, instantiating objects is
probably best
• Multiple threads for interpreter loop / IO refresh (including display) may be
the easiest design
Confidential – Oracle Internal/Restricted/Highly Restricted 58
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
My CHIP-8 Design
Confidential – Oracle Internal/Restricted/Highly Restricted 59
Chip8
(Interpreter) DisplayKeyPad
Memory
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Typical Emulator Design
Confidential – Oracle Internal/Restricted/Highly Restricted 60
Memory
(and/or IO bus) DisplayKeyPad
CPU
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Dynamic Recompilation
• Use ASM to generate bytecode on the fly!
• Way easier than you might imagine
• Run your interpreter through ASMifier
(temporarily refactoring each opcode implementation into its own method may help
make things clearer)
• Write a new version of interpreter loop where implementation code is
replaced by the corresponding ASMifier output
• The interpreter loop will now just linearly scan the “rom”, and generate
corresponding bytecode.
Confidential – Oracle Internal/Restricted/Highly Restricted 61
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Conclusions
• Emulation / Interpreters are fun to write in Java
• They are not as hard as many people imagine
• You can improve your general programming skillset by writing one
• Start out small. You can’t get much simpler than CHIP-8
Confidential – Oracle Internal/Restricted/Highly Restricted 62
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
THANK YOU!
Confidential – Oracle Internal/Restricted/Highly Restricted 63
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• Octo - Chip-8 Assembly Language & On-line IDE
https://johnearnest.github.io/Octo/
• Cowgod's Chip-8 Technical Reference
http://devernay.free.fr/hacks/chip8/C8TECH10.HTM
• Chip-8 Software for HP48 Archive
http://www.hpcalc.org/hp48/games/chip/
• Cosmac ELF
(A great fan site with a lots of ELF content)
http://www.cosmacelf.com/
• Matthew Mikolay's Retro Computing Site
(Has scans of VIPER magazine among a ton of other great
information)
http://retro.mattmik.com/
Confidential – Oracle Internal/Restricted/Highly Restricted 64
References
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Stay connected
• Join us: DevOps Corner (Developer Lounge – Moscone West)
• Learn more: openjdk.java.net | wercker.com/java
• Follow: @OpenJDK, @wercker #JavaOne #DevOps
65
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Confidential – Oracle Internal/Restricted/Highly Restricted 66
Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584]
Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584]

More Related Content

What's hot

Supreme court of india
Supreme court of indiaSupreme court of india
Supreme court of indianarinder1988
 
Linux Kernel Startup Code In Embedded Linux
Linux    Kernel    Startup  Code In  Embedded  LinuxLinux    Kernel    Startup  Code In  Embedded  Linux
Linux Kernel Startup Code In Embedded LinuxEmanuele Bonanni
 
The Benefits and Harms of National Security Technologies
The Benefits and Harms of National Security TechnologiesThe Benefits and Harms of National Security Technologies
The Benefits and Harms of National Security TechnologiesKatina Michael
 
Fundamental Rights and Duties of Indian
Fundamental Rights and Duties of IndianFundamental Rights and Duties of Indian
Fundamental Rights and Duties of IndianAishwaryaAbe
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Macpaul Lin
 
Original Power Supply IC MIP0224SY MIP0224 TO-220 New Panasonic
Original Power Supply IC MIP0224SY MIP0224 TO-220 New PanasonicOriginal Power Supply IC MIP0224SY MIP0224 TO-220 New Panasonic
Original Power Supply IC MIP0224SY MIP0224 TO-220 New PanasonicAUTHELECTRONIC
 
STRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDY
STRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDYSTRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDY
STRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDYIAEME Publication
 
Legendry engineer : Sir mokshagundam visvesvaraya
Legendry engineer : Sir mokshagundam visvesvarayaLegendry engineer : Sir mokshagundam visvesvaraya
Legendry engineer : Sir mokshagundam visvesvarayaMadhusudan Sharma
 
Seismic Retrofitting Techniques
Seismic Retrofitting TechniquesSeismic Retrofitting Techniques
Seismic Retrofitting TechniquesAritra Banerjee
 
Basic principles of design for rcc building
Basic principles of design for rcc buildingBasic principles of design for rcc building
Basic principles of design for rcc buildinghlksd
 
Introduction to open_sbi
Introduction to open_sbiIntroduction to open_sbi
Introduction to open_sbiNylon
 
Security for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangoutSecurity for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangoutmentoresd
 
Núcleo do Linux (Kernel Linux)
Núcleo do Linux (Kernel Linux)Núcleo do Linux (Kernel Linux)
Núcleo do Linux (Kernel Linux)Luiz Arthur
 
Resources of Construction Industry
Resources of Construction IndustryResources of Construction Industry
Resources of Construction IndustryHimanshu Vaid
 
Making of the indian constitution by madhavi mahajan
Making of the indian constitution by madhavi mahajanMaking of the indian constitution by madhavi mahajan
Making of the indian constitution by madhavi mahajanMadhavi Mahajan
 

What's hot (20)

Supreme court of india
Supreme court of indiaSupreme court of india
Supreme court of india
 
linux
linuxlinux
linux
 
Linux Kernel Startup Code In Embedded Linux
Linux    Kernel    Startup  Code In  Embedded  LinuxLinux    Kernel    Startup  Code In  Embedded  Linux
Linux Kernel Startup Code In Embedded Linux
 
The Benefits and Harms of National Security Technologies
The Benefits and Harms of National Security TechnologiesThe Benefits and Harms of National Security Technologies
The Benefits and Harms of National Security Technologies
 
Salient features of constitution of India
 Salient features of constitution of India Salient features of constitution of India
Salient features of constitution of India
 
Fundamental Rights and Duties of Indian
Fundamental Rights and Duties of IndianFundamental Rights and Duties of Indian
Fundamental Rights and Duties of Indian
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
Bsd presentation
Bsd presentationBsd presentation
Bsd presentation
 
Original Power Supply IC MIP0224SY MIP0224 TO-220 New Panasonic
Original Power Supply IC MIP0224SY MIP0224 TO-220 New PanasonicOriginal Power Supply IC MIP0224SY MIP0224 TO-220 New Panasonic
Original Power Supply IC MIP0224SY MIP0224 TO-220 New Panasonic
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
STRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDY
STRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDYSTRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDY
STRENGTH OF REINFORCED CONCRETE CORBELS – A PARAMETRIC STUDY
 
Legendry engineer : Sir mokshagundam visvesvaraya
Legendry engineer : Sir mokshagundam visvesvarayaLegendry engineer : Sir mokshagundam visvesvaraya
Legendry engineer : Sir mokshagundam visvesvaraya
 
Seismic Retrofitting Techniques
Seismic Retrofitting TechniquesSeismic Retrofitting Techniques
Seismic Retrofitting Techniques
 
Basic principles of design for rcc building
Basic principles of design for rcc buildingBasic principles of design for rcc building
Basic principles of design for rcc building
 
Introduction to open_sbi
Introduction to open_sbiIntroduction to open_sbi
Introduction to open_sbi
 
Security for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangoutSecurity for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangout
 
Núcleo do Linux (Kernel Linux)
Núcleo do Linux (Kernel Linux)Núcleo do Linux (Kernel Linux)
Núcleo do Linux (Kernel Linux)
 
Resources of Construction Industry
Resources of Construction IndustryResources of Construction Industry
Resources of Construction Industry
 
Making of the indian constitution by madhavi mahajan
Making of the indian constitution by madhavi mahajanMaking of the indian constitution by madhavi mahajan
Making of the indian constitution by madhavi mahajan
 

Similar to Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584]

OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]
OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]
OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]David Buck
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...David Buck
 
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsGraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsOracle Developers
 
EMC World 2016 - code.05 Automating your Physical Data Center with RackHD
EMC World 2016 - code.05 Automating your Physical Data Center with RackHDEMC World 2016 - code.05 Automating your Physical Data Center with RackHD
EMC World 2016 - code.05 Automating your Physical Data Center with RackHD{code}
 
DevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataDevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataMarketingArrowECS_CZ
 
“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the CoreC4Media
 
Automating Your Data Center with RackHD - EMC World 2016
Automating Your Data Center with RackHD - EMC World 2016Automating Your Data Center with RackHD - EMC World 2016
Automating Your Data Center with RackHD - EMC World 2016Kendrick Coleman
 
0 foundation update__final - Mendy Furmanek
0 foundation update__final - Mendy Furmanek0 foundation update__final - Mendy Furmanek
0 foundation update__final - Mendy FurmanekYutaka Kawai
 
Considerations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudConsiderations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudAll Things Open
 
OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]
OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]
OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]David Buck
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessDavid Delabassee
 
Considerations for Operating An OpenStack Cloud
Considerations for Operating An OpenStack CloudConsiderations for Operating An OpenStack Cloud
Considerations for Operating An OpenStack CloudMark Voelker
 
Oracle meetup kubernetes_171118
Oracle meetup kubernetes_171118Oracle meetup kubernetes_171118
Oracle meetup kubernetes_171118Oracle Korea
 
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMOSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMmfrancis
 
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...jaxLondonConference
 
Seminole County Teach In 2017: Crooms Acadamy of Information Technology
Seminole County Teach In 2017: Crooms Acadamy of Information TechnologySeminole County Teach In 2017: Crooms Acadamy of Information Technology
Seminole County Teach In 2017: Crooms Acadamy of Information TechnologyEd Burns
 
Game Development Best Practices
Game Development Best PracticesGame Development Best Practices
Game Development Best PracticesPerforce
 
Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Curity
 
OpenPOWER foundation update new executive director and bright open future_i...
OpenPOWER  foundation update  new executive director and bright open future_i...OpenPOWER  foundation update  new executive director and bright open future_i...
OpenPOWER foundation update new executive director and bright open future_i...Ganesan Narayanasamy
 

Similar to Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584] (20)

OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]
OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]
OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
 
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsGraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
 
EMC World 2016 - code.05 Automating your Physical Data Center with RackHD
EMC World 2016 - code.05 Automating your Physical Data Center with RackHDEMC World 2016 - code.05 Automating your Physical Data Center with RackHD
EMC World 2016 - code.05 Automating your Physical Data Center with RackHD
 
DevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataDevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on Exadata
 
“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core
 
Automating Your Data Center with RackHD - EMC World 2016
Automating Your Data Center with RackHD - EMC World 2016Automating Your Data Center with RackHD - EMC World 2016
Automating Your Data Center with RackHD - EMC World 2016
 
0 foundation update__final - Mendy Furmanek
0 foundation update__final - Mendy Furmanek0 foundation update__final - Mendy Furmanek
0 foundation update__final - Mendy Furmanek
 
Considerations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudConsiderations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack Cloud
 
OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]
OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]
OpenJDK 参加入門 [JJUG CCC 2017 Fall E2]
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Considerations for Operating An OpenStack Cloud
Considerations for Operating An OpenStack CloudConsiderations for Operating An OpenStack Cloud
Considerations for Operating An OpenStack Cloud
 
Oracle meetup kubernetes_171118
Oracle meetup kubernetes_171118Oracle meetup kubernetes_171118
Oracle meetup kubernetes_171118
 
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMOSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
 
Seminole County Teach In 2017: Crooms Acadamy of Information Technology
Seminole County Teach In 2017: Crooms Acadamy of Information TechnologySeminole County Teach In 2017: Crooms Acadamy of Information Technology
Seminole County Teach In 2017: Crooms Acadamy of Information Technology
 
Game Development Best Practices
Game Development Best PracticesGame Development Best Practices
Game Development Best Practices
 
Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1
 
OpenPOWER foundation update new executive director and bright open future_i...
OpenPOWER  foundation update  new executive director and bright open future_i...OpenPOWER  foundation update  new executive director and bright open future_i...
OpenPOWER foundation update new executive director and bright open future_i...
 

More from David Buck

JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]David Buck
 
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...David Buck
 
Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]David Buck
 
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...David Buck
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]David Buck
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...David Buck
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]David Buck
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage CollectorDavid Buck
 
Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019David Buck
 
Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018David Buck
 
JDK 10 へようこそ
JDK 10 へようこそJDK 10 へようこそ
JDK 10 へようこそDavid Buck
 
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]David Buck
 
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]David Buck
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]David Buck
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]David Buck
 
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]David Buck
 
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]David Buck
 

More from David Buck (20)

JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
 
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
 
Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]
 
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
 
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage Collector
 
Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019
 
Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018
 
JDK 10 へようこそ
JDK 10 へようこそJDK 10 へようこそ
JDK 10 へようこそ
 
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
 
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
 
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
 
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
 
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
 

Recently uploaded

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584]

  • 1.
  • 2.
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Let’s Write Our Own CHIP-8 Interpreter! CON3584 David Buck Principal Member of Technical Staff Java Platform Group October 3rd, 2017 Confidential – Oracle Internal/Restricted/Highly Restricted 3
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Confidential – Oracle Internal/Restricted/Highly Restricted 4
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • JVM Sustaining Engineer • OpenJDK 8 Update Project Maintainer • JavaOne Rock Star • Co-author of Oracle WebLogic Server 11g 構築・運用ガイド • @DavidBuckJP • https://blogs.oracle.com/buck/ Hi There!
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda CHIP-8 History CHIP-8 Architecture Emulating CHIP-8 Advanced Emulation Topics 1 2 3 Confidential – Oracle Internal/Restricted/Highly Restricted 6 4
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Introducing CHIP-8 Confidential – Oracle Internal/Restricted/Highly Restricted 7
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Before CHIP-8 Confidential – Oracle Internal/Restricted/Highly Restricted 8 https://en.wikipedia.org/w/index.php?curid=4327124
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Intel 8080 Confidential – Oracle Internal/Restricted/Highly Restricted 9 By Konstantin Lanzet - CPU collectionCamera: Canon EOS 400D, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=7028099
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Not a Poor Nerd’s Hobby… • 1975 kit price: 439 USD • In 2017 currency: 1,997 USD Confidential – Oracle Internal/Restricted/Highly Restricted 10
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | COSMAC ELF Confidential – Oracle Internal/Restricted/Highly Restricted 11 By Swtpc6800 en:User:Swtpc6800 Michael Holley - Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3471056
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | COSMAC ELF • DIY project documented in Popular Electronics in 1976-1977 • Could be built for under 100 USD (1976 prices) • Kits and pre-assembled boards offered from many vendors • Very popular both then and now Confidential – Oracle Internal/Restricted/Highly Restricted 12
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Pixie • RCA 1861 video generator IC • 64×32 square pixels • Needed 256 bytes of external RAM Confidential – Oracle Internal/Restricted/Highly Restricted 13
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | RCA COSMAC 1802 Confidential – Oracle Internal/Restricted/Highly Restricted 14 By Konstantin Lanzet (with permission) - CPU collection Konstantin Lanzet, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=4774289
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | RCA COSMAC 1802 • Complementary Symmetry Monolithic Array Computer • 1 chip revision of an earlier 2 chip design (1801) • Very low cost compared to 8080 • Still in use in many applications today Confidential – Oracle Internal/Restricted/Highly Restricted 15
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Radiation Hardened Versions Confidential – Oracle Internal/Restricted/Highly Restricted 16 By NASA - http://solarsystem.nasa.gov/multimedia/display.cfm?IM_ID=2071 (image link)http://photojournal.jpl.nasa.gov/catalog/PIA18176 (image link) Public Domain, https://commons.wikimedia.org/w/index.php?curid=408298
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | COSMAC VIP • Developed by Joseph Weisbecker • Version of the ELF targeting the video game market • Came pre-assembled • Hex-keyboard was standard Confidential – Oracle Internal/Restricted/Highly Restricted 17
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Hex Keyboard Confidential – Oracle Internal/Restricted/Highly Restricted 18 By John crane 59 - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=15795865
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Hex Keyboard Confidential – Oracle Internal/Restricted/Highly Restricted 19 1 3 4 5 6 7 8 9 0A B C D E F 2
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | COSMAC VIP Confidential – Oracle Internal/Restricted/Highly Restricted 20 • CPU: 1802 • ROM: 512-byte • RAM: 2k~4k on-board (up to 32k external) • Cassette interface: 100 bps • 40 years old this year!
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Similar to “CPU Trainers” of the day… Confidential – Oracle Internal/Restricted/Highly Restricted 21 Public Domain, https://commons.wikimedia.org/w/index.php?curid=422438
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | RCA-Studio II Confidential – Oracle Internal/Restricted/Highly Restricted 22 By Evan-Amos - Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=38826714
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CHIP-8 • A “language” for programming video games • Developed by Joseph Weisbecker for the VIP • Interpreter built into the VIP ROM • Made writing games for the VIP much easier Confidential – Oracle Internal/Restricted/Highly Restricted 23
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | “Language”? • Looks like machine code • It was really a very early virtual machine specification Confidential – Oracle Internal/Restricted/Highly Restricted 24
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Why use a virtual machine? • Abstract away much of the real hardware – Linier display buffer -> X,Y mapped grid – Sprite support – Sound support (q-line on 1802) – Key debouncing • Very easy to program • Very high code density Confidential – Oracle Internal/Restricted/Highly Restricted 25
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Other Platforms Followed (Telmac 1800) Confidential – Oracle Internal/Restricted/Highly Restricted 26 By jpl - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=40541200
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Fast Forward About 10 Years HP 28c released • HP’s first graphing calculator • Light-years beyond anything else – RPL (lambda expressions!) – Symbolic math (CAS) Confidential – Oracle Internal/Restricted/Highly Restricted 27 By Kurt Moerman (Kpmkpm) - Own work, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=4020998
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Legendary 48G • Released in 1990 • HP’s most powerful calculator for almost a decade Confidential – Oracle Internal/Restricted/Highly Restricted 28 By Feureau.com - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=9953201
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Meanwhile… • TI-81 • Z80 based • BASIC-like programming language • Very easy to program • Very easy to make games Confidential – Oracle Internal/Restricted/Highly Restricted 29 By Calcvids - I took this photo of my TI-81, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=24252718
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | HP48G owners were jealous! • RPL was horrible for gaming – Too abstract / high-level – Slow – Steep learning curve Confidential – Oracle Internal/Restricted/Highly Restricted 30
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CHIP-8 to the rescue! • Andreas Gustafsson wrote a CHIP-8 interpreter for the HP48 • HP48 users got access to library of preexisting software from the 70s • New CHIP-8 software started to be written • Super CHIP (SCHIP) expanded to take advantage of HP48 hardware Confidential – Oracle Internal/Restricted/Highly Restricted 31
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CHIP-8 Today • A great way for future emulator authors to cut their teeth • Probably the easiest platform to emulate that plays games • Possibly the only platform with more emulators than native software Confidential – Oracle Internal/Restricted/Highly Restricted 32
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CHIP-8 Architecture Confidential – Oracle Internal/Restricted/Highly Restricted 33
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Memory Map Confidential – Oracle Internal/Restricted/Highly Restricted 34 CHIP-8 Interpreter (ROM) Font Data Free Memory (RAM) Display Memory (RAM) 0x200 0x1FF 0xFFF 0xF00 0xEFF 0x000
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | An Embarrassment of Registers • 15 8-bit general registers (V0-VE) • 1 8-bit “Flag” register (VF) – Only used for carry (ALU) and sprite hit detection • 1 16-bit address register – Only 12-bit LSBs normally used • 1 16-bit PC Confidential – Oracle Internal/Restricted/Highly Restricted 35
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Sound • Write-only sound timer that decrements 60 ticks a second • Buzzer / beeping sound plays until timer reaches zero • No music here! Confidential – Oracle Internal/Restricted/Highly Restricted 36
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Display • 64x32 monochrome pixels • Sprites – 8 pixels wide – 1~15 pixels tall – Drawn to video memory by XOR:ing – Collision flag (FV) set (or cleared) Confidential – Oracle Internal/Restricted/Highly Restricted 37
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Timer • Like sound timer, but no output. • Decremented 60 ticks a second • Stops at zero • Can be both read or written to (unlike RO sound timer) Confidential – Oracle Internal/Restricted/Highly Restricted 38
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Opcodes • AAA: address • KK: 8-bit constant (byte) • K: 4-bit constant (nibble) • X, Y: 4-bit register identifier • I, PC: 16bit register Confidential – Oracle Internal/Restricted/Highly Restricted 39
  • 40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Call instruction • 0AAA – jump to 1802 code at AAA (not used in modern CHIP-8) Confidential – Oracle Internal/Restricted/Highly Restricted 40
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Display • 00E0 CLS • FX29 set I register to font for hex digit stored in X • DXYK draw sprite K pixels high at X, Y coordinates Confidential – Oracle Internal/Restricted/Highly Restricted 41
  • 42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Flow Control Instructions • 00EE return from sub ★ • 1AAA jump to AAA • 2AAA call sub at AAA ★ • 3XKK if VX == KK skip next instruction • 4XKK if VX != KK skip next instruction • 5XY0 if VX == VY skip next instruction ★ push and pop return address use implementation-defined stack Confidential – Oracle Internal/Restricted/Highly Restricted 42
  • 43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Loads / Stores / Moves • 6XKK Vx = NN • 8XY0 VX = VY • AAAA I = AAA Confidential – Oracle Internal/Restricted/Highly Restricted 43
  • 44. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | ALU (Math) Instructions • 7XKK Vx += KK • 8XY1 Vx=Vx|Vy • 8XY2 Vx=Vx&Vy • 8XY3 Vx=Vx^Vy • 8XY4 Vx += Vy • 8XY5 Vx -= Vy • 8XY6 Vx=Vy=Vy>>1 • 8XY7 Vx=Vy-Vx • 8XYE Vx=Vy=Vy<<1 Confidential – Oracle Internal/Restricted/Highly Restricted 44
  • 45. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Input Instructions • EX9E if (key()==Vx) skip next instruction • EXA1 if (key()!=Vx) skip next instruction • FX0A Vx = next key press (blocking wait) Confidential – Oracle Internal/Restricted/Highly Restricted 45
  • 46. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Timers / Sound Instructions • FX07 Vx = delay_timer • FX15 delay_timer = Vx • FX18 sound_timer = Vx Confidential – Oracle Internal/Restricted/Highly Restricted 46
  • 47. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Other Instructions • CXKK Vx = random_number & KK • FX33 stores 3 digits of BCD for value of Vx into I, I+1, I+2 • FX55 writes all V registers between V0 and Vx to I • FX65 loads all V registers between V0 and Vx from I Confidential – Oracle Internal/Restricted/Highly Restricted 47
  • 48. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Emulating CHIP-8 Confidential – Oracle Internal/Restricted/Highly Restricted 48
  • 49. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Overall Design Confidential – Oracle Internal/Restricted/Highly Restricted 49 Chip8 (Interpreter) DisplayKeyPad Memory
  • 50. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Overall Design • Allows Display and KeyPad to be swapped out with different implementations – AWT – Swing – JavaFX – LWJGL • Memory is isolated to be closer aligned to more advanced emulators Confidential – Oracle Internal/Restricted/Highly Restricted 50
  • 51. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Memory • One single 4K byte array • Handles font data (must be initialized) • Handles reading in of program (“rom”) during startup Confidential – Oracle Internal/Restricted/Highly Restricted 51
  • 52. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Display • ASCII ART inspired • Appends characters to a StringBuilder – White Pixel ‘#’ – Black Pixel ‘ ‘ • Note that screen buffer memory is independent from main memory • Screen buffer is shared between Display and Chip8 (the interpreter) • Screen refresh timing / method can have a huge performance impact Confidential – Oracle Internal/Restricted/Highly Restricted 52
  • 53. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | KeyPad • Depends on enabling raw input from terminal • Semantics of key press detection depend on automatic key repeat – By extension also depends on a very low repeat delay • Shutdown hook is registered to restore terminal to useable state Confidential – Oracle Internal/Restricted/Highly Restricted 53
  • 54. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Interpreter Loop • Is a naive implementation • Uses a simple series of nested switch statements • Register values are stored in next larger primitive type • Each iteration of the main loop updates timers as needed • Each iteration of the main loop refreshes display as needed Confidential – Oracle Internal/Restricted/Highly Restricted 54
  • 55. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Debugging • You often want some way to debug what is running on the VM – Trace – Breakpoints – Memory dumps Confidential – Oracle Internal/Restricted/Highly Restricted 55
  • 56. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Other General Emulation Tips • Start with small test cases, not full games • Write your own tests if you cannot find any • Have some way to throttle execution speed • Compare your emulator’s behavior to other emulators Confidential – Oracle Internal/Restricted/Highly Restricted 56
  • 57. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Advanced Emulation Topics Confidential – Oracle Internal/Restricted/Highly Restricted 57
  • 58. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Your code should model the hardware • Figure out how instructions are encoded / decoded (e.g. z80 decode) • If there are multiple pieces of similar hardware, instantiating objects is probably best • Multiple threads for interpreter loop / IO refresh (including display) may be the easiest design Confidential – Oracle Internal/Restricted/Highly Restricted 58
  • 59. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | My CHIP-8 Design Confidential – Oracle Internal/Restricted/Highly Restricted 59 Chip8 (Interpreter) DisplayKeyPad Memory
  • 60. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Typical Emulator Design Confidential – Oracle Internal/Restricted/Highly Restricted 60 Memory (and/or IO bus) DisplayKeyPad CPU
  • 61. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Dynamic Recompilation • Use ASM to generate bytecode on the fly! • Way easier than you might imagine • Run your interpreter through ASMifier (temporarily refactoring each opcode implementation into its own method may help make things clearer) • Write a new version of interpreter loop where implementation code is replaced by the corresponding ASMifier output • The interpreter loop will now just linearly scan the “rom”, and generate corresponding bytecode. Confidential – Oracle Internal/Restricted/Highly Restricted 61
  • 62. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Conclusions • Emulation / Interpreters are fun to write in Java • They are not as hard as many people imagine • You can improve your general programming skillset by writing one • Start out small. You can’t get much simpler than CHIP-8 Confidential – Oracle Internal/Restricted/Highly Restricted 62
  • 63. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | THANK YOU! Confidential – Oracle Internal/Restricted/Highly Restricted 63
  • 64. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • Octo - Chip-8 Assembly Language & On-line IDE https://johnearnest.github.io/Octo/ • Cowgod's Chip-8 Technical Reference http://devernay.free.fr/hacks/chip8/C8TECH10.HTM • Chip-8 Software for HP48 Archive http://www.hpcalc.org/hp48/games/chip/ • Cosmac ELF (A great fan site with a lots of ELF content) http://www.cosmacelf.com/ • Matthew Mikolay's Retro Computing Site (Has scans of VIPER magazine among a ton of other great information) http://retro.mattmik.com/ Confidential – Oracle Internal/Restricted/Highly Restricted 64 References
  • 65. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Stay connected • Join us: DevOps Corner (Developer Lounge – Moscone West) • Learn more: openjdk.java.net | wercker.com/java • Follow: @OpenJDK, @wercker #JavaOne #DevOps 65
  • 66. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Confidential – Oracle Internal/Restricted/Highly Restricted 66