Slide 1

Slide 1 text

The day I reverse engineered a Gameboy Advance game With @ythecombinator AND @macabeus

Slide 2

Slide 2 text

WTF?! THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 3

Slide 3 text

"""

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

soooo…

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

This is macabeus

Slide 8

Slide 8 text

This is MATHEUS

Slide 9

Slide 9 text

This is US PLAYING KLONOA

Slide 10

Slide 10 text

AND THIS IS US BORED

Slide 11

Slide 11 text

soooo…

Slide 12

Slide 12 text

WANTED MORE LEVELS TO PLAY WITH

Slide 13

Slide 13 text

WANTED DIFFERENT LEVELS

Slide 14

Slide 14 text

soooo…

Slide 15

Slide 15 text

soooo…

Slide 16

Slide 16 text

soooo…

Slide 17

Slide 17 text

soooo…AND THIS IS KLONNOA

Slide 18

Slide 18 text

soooo…AND THIS IS KLONNOA

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

http://bit.ly/gba-the-conf-project

Slide 23

Slide 23 text

Stretching the bridge THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 24

Slide 24 text

https://www.nogba.com

Slide 25

Slide 25 text

https://www.hex-rays.com/products/ida

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

This is the tile ID. In this example, all tiles with the ID 9B are exactly the bridge part, which is the left corner. 9A is the ID of the continuous part of the bridge.

Slide 29

Slide 29 text

This tells us where the tile is stored in the memory. In this example, it is at 0600F1AD.

Slide 30

Slide 30 text

https://www.coranac.com/tonc/text/hardware.htm

Slide 31

Slide 31 text

https://www.coranac.com/tonc/text/hardware.htm The address found is expected 0600F1AD given that everything between 0600 and 0601 is part of the section known as VRAM.

Slide 32

Slide 32 text

Our bridge starts here!

Slide 33

Slide 33 text

Our bridge starts here!

Slide 34

Slide 34 text

And now we grow it bigger!

Slide 35

Slide 35 text

And now we grow it bigger!

Slide 36

Slide 36 text

And now we grow it bigger! WTF??!

Slide 37

Slide 37 text

Understanding the DMA THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

VRAM pulls the tilemap
 containing exactly what the player has to see from somewhere else that has the entire thing.

Slide 41

Slide 41 text

https://www.coranac.com/tonc/text/regbg.htm

Slide 42

Slide 42 text

https://www.coranac.com/tonc/text/regbg.htm Direct Memory Access

Slide 43

Slide 43 text

https://www.coranac.com/tonc/text/regbg.htm It is a feature of computer systems that allows certain hardware subsystems to access main system memory (random- access memory), independent of the CPU

Slide 44

Slide 44 text

https://www.coranac.com/tonc/text/regbg.htm tldr; a faster copy and paste

Slide 45

Slide 45 text

DMA3: 03000900 0600E000 80000400 DMA3: 03001100 0600E800 80000400 DMA3: 03004DB0 0600F000 80000200 DMA3: 03004800 07000000 84000048

Slide 46

Slide 46 text

DMA3: 03000900 0600E000 80000400 DMA3: 03001100 0600E800 80000400 DMA3: 03004DB0 0600F000 80000200 DMA3: 03004800 07000000 84000048 The closest to the bytes of our bridge (0600F1AD).

Slide 47

Slide 47 text

DMA3: 03000900 0600E000 80000400 DMA3: 03001100 0600E800 80000400 DMA3: 03004DB0 0600F000 80000200 DMA3: 03004800 07000000 84000048 This address is the VRAM data source. It’s located in a region called Fast WRAM.

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

Our bridge starts here!

Slide 50

Slide 50 text

Stretching it…

Slide 51

Slide 51 text

Stretching it… …It works! And…

Slide 52

Slide 52 text

Stretching it… …It works! And… WTF??!

Slide 53

Slide 53 text

Stretching it… …It works! And… WTF??!

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

Our extra tiles disappear when out of the player vision range.

Slide 57

Slide 57 text

LET’S TALK ABOUT PHYSICS THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 58

Slide 58 text

Object Attribute Memory

Slide 59

Slide 59 text

OAM

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

This is the address in which Klonoa is stored on the memory

Slide 62

Slide 62 text

DMA3: 03000900 0600E000 80000400 DMA3: 03001100 0600E800 80000400 DMA3: 03004DB0 0600F000 80000200 DMA3: 03004800 07000000 8400003E

Slide 63

Slide 63 text

DMA3: 03000900 0600E000 80000400 DMA3: 03001100 0600E800 80000400 DMA3: 03004DB0 0600F000 80000200 DMA3: 03004800 07000000 8400003E We can see exactly the byte that writes on Klonoa’s OAM (03004800).

Slide 64

Slide 64 text

DMA3: 03000900 0600E000 80000400 DMA3: 03001100 0600E800 80000400 DMA3: 03004DB0 0600F000 80000200 DMA3: 03004800 07000000 8400003E We can see exactly the byte that writes on Klonoa’s OAM (03004800).

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

1 2

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

Here is where Y fixes Klonoa’s position

Slide 83

Slide 83 text

Here is where Y fixes Klonoa’s position Here is where which decides if should fix or not Klonoa’s position

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

https://www.coranac.com/tonc/text/hardware.htm

Slide 86

Slide 86 text

https://www.coranac.com/tonc/text/hardware.htm

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

Let’s find the tilemap on rom THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 91

Slide 91 text

Cartridge > > > > The data flow

Slide 92

Slide 92 text

Cartridge Slow WRAM > > > > The data flow

Slide 93

Slide 93 text

Cartridge Fast WRAM Slow WRAM > > > > The data flow

Slide 94

Slide 94 text

Cartridge Fast WRAM Slow WRAM VRAM > > > > The data flow

Slide 95

Slide 95 text

Cartridge Fast WRAM Display Slow WRAM VRAM > > > > The data flow

Slide 96

Slide 96 text

Cartridge Fast WRAM Display VRAM Slow WRAM > > > > Our research flow

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

swi 11h what?

Slide 99

Slide 99 text

Swi

Slide 100

Slide 100 text

SoftWare Interrupt

Slide 101

Slide 101 text

SoftWare Interrupt = Bios calls

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

BIOS is a firmware that is intended to initialise the physical components of the system

Slide 104

Slide 104 text

BIOS is a firmware that is intended to initialise the physical components of the system In GBA, its BIOS exposes many functions often used in games, including data compression and decompression

Slide 105

Slide 105 text

BIOS is a firmware that is intended to initialise the physical components of the system In GBA, its BIOS exposes many functions often used in games, including data compression and decompression Each function has an associated numeric code, which must be used as a parameter in the SWI statement

Slide 106

Slide 106 text

Input: How division works on ARM Assembly swi 0x06 Output:

Slide 107

Slide 107 text

Input: How division works on ARM Assembly swi 0x06 R0
 numerator R1
 denominator Output:

Slide 108

Slide 108 text

Input: How division works on ARM Assembly swi 0x06 R0
 numerator R1
 denominator R0
 numerator / denominator R1
 numerator % denominator R3
 abs(numerator / denominator) Output:

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

Huffman + lz77 = deflate

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E

Slide 117

Slide 117 text

6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E

Slide 118

Slide 118 text

6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E 6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E

Slide 119

Slide 119 text

6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E 6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E

Slide 120

Slide 120 text

6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E 6E 6E 6E B0 B1 BD 77 AB B3 AB B3 7C 6E 6E 6E 6E 6E 6E 6E 6E 7C 6E 6E 6E 6E 7C 6E 6E =

Slide 121

Slide 121 text

Let’s paint the tilemap THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 122

Slide 122 text

0x1A 0x1B 0x1C 0x1D 0x1E 0x1F

Slide 123

Slide 123 text

0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F

Slide 124

Slide 124 text

0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F

Slide 125

Slide 125 text

0x1A 0x1B 0x1C 0x1D 0x1E 0x1F

Slide 126

Slide 126 text

H · W = 25023
 H,W ∈ ℕ

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

x x x x a x x x x x x x x b x x x x I’m on tile a

Slide 129

Slide 129 text

x x x x a x x x x x x x x b x x x x I’m on tile a

Slide 130

Slide 130 text

x x x x a x x x x x x x x b x x x x I’m on tile a x x x x a x x x x x x x x b x x x x From the tile a to b there are 9 bytes (= 9 tiles), so the length of the tilemap is exactly 9

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

Breakpoint here

Slide 133

Slide 133 text

…is located here This byte…

Slide 134

Slide 134 text

No content

Slide 135

Slide 135 text

As I change this byte…

Slide 136

Slide 136 text

…it reflects right here

Slide 137

Slide 137 text

No content

Slide 138

Slide 138 text

Changing these bytes…

Slide 139

Slide 139 text

…we drop Klonoa one level below

Slide 140

Slide 140 text

No content

Slide 141

Slide 141 text

Changing these bytes… …we found the B tile!

Slide 142

Slide 142 text

020085DB The length of the level is 420! - 02008437 = 1A4 (420)

Slide 143

Slide 143 text

https://github.com/oliver-moran/jimp

Slide 144

Slide 144 text

const Jimp = require('jimp') const { drop } = require('ramda') const fs = require('fs') const data = drop(3, fs.readFileSync('dump/level-2/tilemap'))

Slide 145

Slide 145 text

const getPixelColor = hexTile "# { if (hexTile === 0) { return 0x00000000 } return 0xFFFFFFFF }

Slide 146

Slide 146 text

new Jimp(300, 600, (err, image) "# { let x = 0 let y = 0 for (let i = 0; i < data.length; i += 1) { const value = data[i] x += 1 if (x === 300) { y += 1 x = 0 } let color = getPixelColor(value) image.setPixelColor(color, x, y) } image.write('image.png') })

Slide 147

Slide 147 text

No content

Slide 148

Slide 148 text

No content

Slide 149

Slide 149 text

No content

Slide 150

Slide 150 text

No content

Slide 151

Slide 151 text

No content

Slide 152

Slide 152 text

No content

Slide 153

Slide 153 text

let’s see the project THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 154

Slide 154 text

Coding THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 155

Slide 155 text

soooo…

Slide 156

Slide 156 text

soooo…

Slide 157

Slide 157 text

Stack

Slide 158

Slide 158 text

React.js ✈

Slide 159

Slide 159 text

Webpack ✈

Slide 160

Slide 160 text

Ramda.js ✈

Slide 161

Slide 161 text

FormerKit ✈

Slide 162

Slide 162 text

GH Pages ✈

Slide 163

Slide 163 text

architecture

Slide 164

Slide 164 text

✂ Brush Scissors

Slide 165

Slide 165 text

klo-gba.js/scissors/src/visions/

Slide 166

Slide 166 text

export default { rom: { tilemap: [0x1B27FC, 0x1B36F3], oam: [0xE2B90, 0xE2F59], portals: [0xD48C8, 0xD48EF], }, tilemap: { totalStages: 3, height: 60, width: 420, scheme: [ { name: 'grass', ids: [0x7D, 0x80, 0x81, 0x82, 0x8E, 0x8F, 0x90], },

Slide 167

Slide 167 text

export default { rom: { tilemap: [0x1B27FC, 0x1B36F3], oam: [0xE2B90, 0xE2F59], portals: [0xD48C8, 0xD48EF], }, tilemap: { totalStages: 3, height: 60, width: 420, scheme: [ { name: 'grass', ids: [0x7D, 0x80, 0x81, 0x82, 0x8E, 0x8F, 0x90], },

Slide 168

Slide 168 text

export default { rom: { tilemap: [0x1B27FC, 0x1B36F3], oam: [0xE2B90, 0xE2F59], portals: [0xD48C8, 0xD48EF], }, tilemap: { totalStages: 3, height: 60, width: 420, scheme: [ { name: 'grass', ids: [0x7D, 0x80, 0x81, 0x82, 0x8E, 0x8F, 0x90], },

Slide 169

Slide 169 text

{ name: 'rock', ids: [0x54, 0x53, 0x55, 0x56, 0x57, 0x58, 0x59, }, { name: 'darkRock', ids: [0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, }, { name: 'wood', ids: [0x52, 0x94, 0x98, 0x99, 0x9A, 0x9B, 0x9D, }, { name: 'bridgeRope', ids: [0x04, 0x05, 0x0B, 0x0C, 0x11, 0x13, 0x14,

Slide 170

Slide 170 text

{ name: 'spike', ids: [0x3D], }, ], },

Slide 171

Slide 171 text

Provider Pattern

Slide 172

Slide 172 text

No content

Slide 173

Slide 173 text

✘ Nah$$.Not necessary at all.

Slide 174

Slide 174 text

ROMProvider VisionProvider

Slide 175

Slide 175 text

import React from 'react' const ROMContext = React.createContext() export default ROMContext import React from 'react' const VisionContext = React.createContext() export default VisionContext klo-gba.js/brush/src/context/ROMContext.js klo-gba.js/brush/src/context/VisionContext.js

Slide 176

Slide 176 text

import React from 'react' const ROMContext = React.createContext() export default ROMContext import React from 'react' const VisionContext = React.createContext() export default VisionContext klo-gba.js/brush/src/context/ROMContext.js klo-gba.js/brush/src/context/VisionContext.js

Slide 177

Slide 177 text

const ROMProvider = (props) "# { const [romBuffer, setROMBuffer] = useROMBuffer() return ( {props.children} ) }

Slide 178

Slide 178 text

const SelectVision = () "# { const { romBufferMemory } = useContext(ROMContext) const { updateVision, vision: { state: visionState }, visionIndex, visionWorld, } = useContext(VisionContext) const setNewVision = (newVision) "# { const [newVisionWorld, newVisionIndex] = newVision.split('-') updateVision(romBufferMemory, newVisionWorld, newVisionIndex) }

Slide 179

Slide 179 text

const SelectVision = () "# { const { romBufferMemory } = useContext(ROMContext) const { updateVision, vision: { state: visionState }, visionIndex, visionWorld, } = useContext(VisionContext) const setNewVision = (newVision) "# { const [newVisionWorld, newVisionIndex] = newVision.split('-') updateVision(romBufferMemory, newVisionWorld, newVisionIndex) }

Slide 180

Slide 180 text

Custom hooks

Slide 181

Slide 181 text

import { useContext, useEffect } from 'react' import VisionContext from '../context/VisionContext' const useWhenVisionChanges = (callback) "# { const { visionIndex, visionWorld } = useContext(VisionContext) useEffect(callback, [visionIndex, visionWorld]) } export default useWhenVisionChanges

Slide 182

Slide 182 text

const LoadedRom = () "# { const { vision } = useContext(VisionContext) const [highlightCoordinates, setHighlightCoordinates] = useState([-1, -1]) const [optShowGrid, setOptShowGrid] = useState(false) const [optShowOAM, setOptShowOAM] = useState(true) const [optShowPortals, setOptShowPortals] = useState(true) const [toolState, setToolState] = useTool() const [resolution, setResolution] = useState(1) useWhenVisionChanges(() "# { setHighlightCoordinates([-1, -1]) }) $( $$.

Slide 183

Slide 183 text

const LoadedRom = () "# { const { vision } = useContext(VisionContext) const [highlightCoordinates, setHighlightCoordinates] = useState([-1, -1]) const [optShowGrid, setOptShowGrid] = useState(false) const [optShowOAM, setOptShowOAM] = useState(true) const [optShowPortals, setOptShowPortals] = useState(true) const [toolState, setToolState] = useTool() const [resolution, setResolution] = useState(1) useWhenVisionChanges(() "# { setHighlightCoordinates([-1, -1]) }) $( $$.

Slide 184

Slide 184 text

import { useState } from 'react' const useTool = () "# { const [{ currentTool, toolsValue }, setToolsStates] = useState({ currentTool: 'magnifyingGlass', toolsValue: { brush: null, magnifyingGlass: null, }, })

Slide 185

Slide 185 text

const updateToolState = (tool, newToolState) "# { if (newToolState ))* undefined) { setToolsStates({ currentTool: tool, toolsValue: { $$.toolsValue, [tool]: newToolState, }, }) return } setToolsStates({ currentTool: tool, toolsValue, }) }

Slide 186

Slide 186 text

return [{ name: currentTool, value: toolsValue[currentTool], }, updateToolState] } export default useTool

Slide 187

Slide 187 text

Web assembly

Slide 188

Slide 188 text

Tilemap compressed Old C code to uncompress it Decompressed Tilemap > >

Slide 189

Slide 189 text

Tilemap compressed Old C code to uncompress it Decompressed Tilemap > > Can’t run C code on browser!

Slide 190

Slide 190 text

Tilemap compressed Old C code to uncompress it Decompressed Tilemap > >

Slide 191

Slide 191 text

Tilemap compressed Old C code to uncompress it Decompressed Tilemap > > >Emscripten >WebAssembly

Slide 192

Slide 192 text

huffman.c lzss.c > > Emscripten huffman.js lzss.js huffman.wasm lzss.wasm +

Slide 193

Slide 193 text

No content

Slide 194

Slide 194 text

klo-gba.js/scissors/webpack.config.js const rules = [ { loader: 'file-loader', test: /\.wasm$/, type: 'javascript/auto', }, … ]

Slide 195

Slide 195 text

const huffmanWasm = require('./wasm/huffman.wasm') const huffmanModule = require('./wasm/huffman.js')({ locateFile (path) { if (path.endsWith('.wasm')) { return `static/wasm/${huffmanWasm}` } return path }, })

Slide 196

Slide 196 text

class HuffmanDecodeError extends Error { constructor (e) { super(`Error when tried to use huffman decoder: ${e}`) this.name = 'HuffmanDecodeError' } } huffmanModule.onRuntimeInitialized = () "# {} const huffmanDecode = (buffer) "# { FS.writeFile('file', buffer)

Slide 197

Slide 197 text

class HuffmanDecodeError extends Error { constructor (e) { super(`Error when tried to use huffman decoder: ${e}`) this.name = 'HuffmanDecodeError' } } huffmanModule.onRuntimeInitialized = () "# {} const huffmanDecode = (buffer) "# { FS.writeFile('file', buffer)

Slide 198

Slide 198 text

const huffmanDecode = (buffer) "# { FS.writeFile('file', buffer) huffmanModule._HUF_Decode() try { return huffmanModule.FS.readFile('file', { encoding: 'binary' }) } catch (e) { throw new HuffmanDecodeError(e) } }

Slide 199

Slide 199 text

function docker_run_emscripten { local filename="$1" echo "Compiling $filename$$." docker run \ --rm -it \ -v $(pwd)/scissors/src/wasm:/src \ trzeci/emscripten \ emcc -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"FS\"] -s EXPORT_NAME=\"$filename\" -o ./$filename.js $filename.c } docker_run_emscripten huffman docker_run_emscripten lzss

Slide 200

Slide 200 text

function docker_run_emscripten { local filename="$1" echo "Compiling $filename$$." docker run \ --rm -it \ -v $(pwd)/scissors/src/wasm:/src \ trzeci/emscripten \ emcc -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"FS\"] -s EXPORT_NAME=\"$filename\" -o ./$filename.js $filename.c } docker_run_emscripten huffman docker_run_emscripten lzss

Slide 201

Slide 201 text

No content

Slide 202

Slide 202 text

const extractFullTilemap = (romBuffer, [addressStart, addressEnd]) "# romBuffer.slice(addressStart, addressEnd) |> huffmanDecode |> lzssDecode

Slide 203

Slide 203 text

Tilemap

Slide 204

Slide 204 text

No content

Slide 205

Slide 205 text

✔ Display tiles and OAM ✔ Allow the user to edit it

Slide 206

Slide 206 text

https://github.com/konvajs/konva

Slide 207

Slide 207 text

No content

Slide 208

Slide 208 text

1st load: ˜3 seconds! 2nd load: ˜13 seconds!

Slide 209

Slide 209 text

After some React.js performance work…

Slide 210

Slide 210 text

1st load

Slide 211

Slide 211 text

1st load ˜1.8 seconds!

Slide 212

Slide 212 text

1st load 2nd load

Slide 213

Slide 213 text

1st load 2nd load ˜3.6 seconds!

Slide 214

Slide 214 text

1st load 2nd load 1st load: ˜1.8 seconds! 2nd load: ˜3.6 seconds!

Slide 215

Slide 215 text

After switching from Canvas to WebGL…

Slide 216

Slide 216 text

1st load

Slide 217

Slide 217 text

1st load ˜1.6 seconds!

Slide 218

Slide 218 text

1st load ˜1.6 seconds! 2nd load

Slide 219

Slide 219 text

1st load ˜1.6 seconds! 2nd load ˜2.8 seconds!

Slide 220

Slide 220 text

After doing more optimizations on WebGL…

Slide 221

Slide 221 text

1st load

Slide 222

Slide 222 text

1st load ˜625 ms!

Slide 223

Slide 223 text

1st load 2nd load ˜625 ms!

Slide 224

Slide 224 text

1st load 2nd load ˜536 ms! ˜625 ms!

Slide 225

Slide 225 text

1st load: ˜3 seconds! 2nd load: ˜13 seconds! Perf recap: No one is gonna play with this

Slide 226

Slide 226 text

1st load: ˜3 1.8 seconds! 2nd load: ˜13 3.6 seconds! Perf recap: Removing wasted renders and other React optimisation stuff.

Slide 227

Slide 227 text

1st load: ˜3 1.8 1.6 seconds! 2nd load: ˜13 3.6 2.8 seconds! Perf recap: Canvas → WebGL

Slide 228

Slide 228 text

1st load: ˜3 1.8 1.6 0.625 seconds! 2nd load: ˜13 3.6 2.8 0.536 seconds! Perf recap: React → WebGL

Slide 229

Slide 229 text

Result THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 230

Slide 230 text

No content

Slide 231

Slide 231 text

No content

Slide 232

Slide 232 text

No content

Slide 233

Slide 233 text

No content

Slide 234

Slide 234 text

No content

Slide 235

Slide 235 text

No content

Slide 236

Slide 236 text

THE Future THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 237

Slide 237 text

No content

Slide 238

Slide 238 text

No content

Slide 239

Slide 239 text

No content

Slide 240

Slide 240 text

WE ARE... THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 241

Slide 241 text

MACABEUS macabeus ____ www.macalogs.com.br _ _ Software Engineer, full-stack @LOGGI Always creating crazy projects

Slide 242

Slide 242 text

MATHEUS ALBUQUERQUE YTHECOMBINATOR www.ythecombinator.space [email protected] Senior Software Engineer, Front-End @STRV addicted to emojis, memes and beer

Slide 243

Slide 243 text

Raul peres behance.net/Kniksis illustrator

Slide 244

Slide 244 text

This talk THE DAY I REVERSE ENGINEERED A GAMEBOY ADVANCE GAME

Slide 245

Slide 245 text

http://bit.ly/gba-reactsp-slides

Slide 246

Slide 246 text

http://bit.ly/gba-the-conf-project

Slide 247

Slide 247 text

http://bit.ly/medium-gba

Slide 248

Slide 248 text

No content

Slide 249

Slide 249 text

We got stickers!

Slide 250

Slide 250 text

OBRIGADO THANKS @ythecombinator AND @macabeus