In this session I will walk you through how to build your own retro handheld console that is powered by Java, runs on a Raspberry Pi, and is printed on a 3D printer. Some of the topics that we will cover along the journey include:
• Hacking Java on the Raspberry Pi
• Rigging input devices with Pi4J
• Insane performance tuning on the JVM
• Why your boss [or SO] needs to buy you a 3D printer!
And of course your retro gaming mettle will be put to the test, so make sure to dust off your old 8 and 16 bit consoles to prepare.
This presentation is about the most fun you can have while still legitimately calling this conference “work.” In fact, I will hopefully inspire you to do your own creative “work” leveraging Java and Raspberry Pi to hack the real world.
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
RetroPi Handheld Raspberry Pi Gaming Console
1. BYO Java RetroPi Console
Stephen Chin (@steveonjava)
Lead Java Community Manager
JavaOne Conference Co-Chair
2. Java Community Management is pretty hard…
314
Java User Groups 9M+Java
Developers
150+ 150+
Java Champions
50+ JUG groups
contributing
to JCP
2
Community
4. Emulating the NES is a real challenge!
826
ROMs to Test
Plus Homebrew!
92M
61 Million Units
Sold Worldwide
3,510
Transistors
Synchronization
Points
4
Nintendo
Entertainment
System
https://commons.wikimedia.org/wiki/File:RP2A07.jpg
13. And what are these for?
http://i.imgur.com/k0Puu.jpg
14. Portable Display Options
Graphics Bus Quality Speed Power Usage
Composite Low Fast High
HDMI High Fast High
SPI High Slow Low
Device Tree High Fast Low
14
15. Adafruit Kippah
• Connects to 40 pin LCD connector
• Connects display via Device Tree GPIO
• Powers Display off Raspberry Pi 5V VCC
• Optional touch support via USB
• Uses I2C, UART, and SPI pins… only 6 GPIO left over
15
31. Which Are the Real Performance Bottlenecks?
• Swing Video via X-Windows
• Synchronization between CPU, PPU, APU
– Return to per-line instead of per-pixel
• Bitwise Helper Functions
• Extracting PPU Operations
• Replace APU Double Math with Longs
• Array Access via Unsafe
• Replace loops with System.arraycopy
• PWM Audio
33
32. HalfNes Performance Bottlenecks
• Swing Video via X-Windows
• Synchronization between CPU, PPU, APU
– Return to per-line instead of per-pixel
• Bitwise Helper Functions
• Extracting PPU Operations
• Replace APU Double Math with Longs
• Array Access via Unsafe (Doesn't actually help)
• Replace loops with System.arraycopy
• PWM Audio
34
33. 3D Printing a Case
35http://vidal-design.deviantart.com/art/Mario-Versus-Bullet-Bill-3D-printed-402524749
68. 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.
72
Editor's Notes
You would think easy because 2D and slow CPU
No because
mappers
Separate buses for PPU and CPU, everything is memory mapped, need to emulate all accesses
bankswitching program code and graphics in the middle of the screen sometimes even inside a line makes static recompilation impossible
sloppy and clever coding
synchronization
Quirky hardware and analog effects (that flickering line in Super Mario Bros only happens when a register is written to during a single specific pixel)
Input and video lag and synchronization
The Raspberry Pi is a single board computer developed in UK by Raspberry Pi Foundation with the intention to stimulate the teaching of basic computer science in schools. It has a slightly slower ARM processor (ARMv6 700Mhz), but a better GPU than the BeagleBoard. Connectivity is via HDMI/Component, USBx2, Ethernet, and Audio out.
Specs:
700 Mhz ARM1176JZF-S core, Broadcom VideoCore IV, OpenGL EX 2.0
512mb RAM, 3.5Watts@5v, 8 x GPIO, UART, I2C bus, SPI bus
2 USB 2.0, SD / MMC / SDIO, 10/100 Ethernet
HDMI, DSI, Composite VideoCore IV, 3.5 mm Audio Jack
Cost $35 + Shipping
Swing video is slow at scaling output, not done in hardware on Linux, unnecessary buffer copies -> switch to JavaFX
Synchronization wastes time constantly context switching, 90% of games don't need it
Use of GetBit everywhere to make writing it easier but it wasn't being optimized out
Double and Long math are same speed on PC but not Pi