Created
May 23, 2014 09:35
-
-
Save kevinburke/eaeb1d8149a6eef0dcc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
rct "github.com/kevinburke/rct-rides" | |
) | |
func main() { | |
f, err := os.Open(os.Getenv("HOME") + "/code/OpenRCT2/openrct2.exe") | |
if err != nil { | |
panic(err) | |
} | |
defer f.Close() | |
var WIDTH = 0x12 | |
b := make([]byte, 100*WIDTH) | |
addr := 0x0057E3AC | |
f.ReadAt(b, int64(addr)) // direction change stored in 2nd bit. | |
for i := 0; i < len(rct.RIDENAMES); i++ { | |
//fmt.Printf("%2x ", i) | |
//fmt.Printf("%40s ", rct.RIDENAMES[i]) | |
var val bool | |
if b[i*WIDTH] == 20 { | |
val = true | |
} else { | |
val = false | |
} | |
fmt.Printf("\t%t,\t", bool(val)) | |
fmt.Printf("// %x %s\n", i, rct.RIDENAMES[i]) | |
//fmt.Printf("%t\n", b[i*WIDTH]&0x80 > 0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment