-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
2,150 additions
and
2,150 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<h1 align="center">Sonic Battle Hacking</h1> | ||
<p align="center">This is a repository for hacking Sonic Battle, | ||
a game for the GameBoy Advanced released in 2004.</p> | ||
|
||
##Documentation | ||
All docs on Sonic Battle reverse engineering are in [**`DOCUMENTATION.md`**](DOCUMENTATION.md). | ||
|
||
##Hack Suite | ||
This hack suite is written in Java (because GUIs and portability). | ||
It has tools to edit Palettes, Dialogue, Sprites, and more. Do note | ||
that it is a WIP, and not all the features are implemented yet. | ||
|
||
##Contributing | ||
If you find any new research on SB, make an issue and we can discuss | ||
expanding upon it or including it into the Hack Suite. Stand-alone | ||
tools can also be placed in this repo, just submit a PR and make | ||
<h1 align="center">Sonic Battle Hacking</h1> | ||
<p align="center">This is a repository for hacking Sonic Battle, | ||
a game for the GameBoy Advanced released in 2004.</p> | ||
|
||
##Documentation | ||
All docs on Sonic Battle reverse engineering are in [**`DOCUMENTATION.md`**](DOCUMENTATION.md). | ||
|
||
##Hack Suite | ||
This hack suite is written in Java (because GUIs and portability). | ||
It has tools to edit Palettes, Dialogue, Sprites, and more. Do note | ||
that it is a WIP, and not all the features are implemented yet. | ||
|
||
##Contributing | ||
If you find any new research on SB, make an issue and we can discuss | ||
expanding upon it or including it into the Hack Suite. Stand-alone | ||
tools can also be placed in this repo, just submit a PR and make | ||
sure your code is documented and pretty. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
; Dark Sonic Patch ; | ||
|
||
$47AFB8 ; Sonic's Palette ; | ||
E0 7F | ||
FF 7F | ||
D6 DA | ||
CE 39 | ||
84 10 | ||
60 FE | ||
C6 18 | ||
C0 18 | ||
00 00 | ||
C6 18 | ||
C0 18 | ||
00 00 | ||
39 7F | ||
73 7E | ||
8C 7D | ||
; Dark Sonic Patch ; | ||
|
||
$47AFB8 ; Sonic's Palette ; | ||
E0 7F | ||
FF 7F | ||
D6 DA | ||
CE 39 | ||
84 10 | ||
60 FE | ||
C6 18 | ||
C0 18 | ||
00 00 | ||
C6 18 | ||
C0 18 | ||
00 00 | ||
39 7F | ||
73 7E | ||
8C 7D | ||
60 82 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
package xyz.jadonfowler.sbhs; | ||
|
||
import java.awt.Color; | ||
|
||
public class GBAColor { | ||
public static Color fromGBA(String hex) { | ||
assert hex.length() == 4 : "Woah! This string isn't 4 characters wide!"; | ||
int h = Integer.parseInt(hex, 16), r = 0, g = 0, b = 0; | ||
while (h - (4 * 256) >= 0) { | ||
b += 8; | ||
h -= (4 * 256); | ||
} | ||
while (h - 32 >= 0) { | ||
g += 8; | ||
h -= 32; | ||
} | ||
r = h * 8; | ||
int t = 255; | ||
r = r > t ? t : r; | ||
g = g > t ? t : g; | ||
b = b > t ? t : b; | ||
Color c = new Color(r, g, b); | ||
return c; | ||
} | ||
|
||
public static String toGBA(int r, int g, int b) { | ||
r = (int) r / 8; | ||
g = ((int) g / 8) * 32; | ||
b = ((int) b / 8) * 256 * 4; | ||
int i = r + g + b; | ||
return (i < Math.pow(16, 3) ? "0" : "") + (i < 256 ? "0" : "") + (i < 16 ? "0" : "") | ||
+ Integer.toHexString(r + g + b); | ||
} | ||
|
||
public static String toGBA(Color c) { | ||
return toGBA(c.getRed(), c.getGreen(), c.getBlue()); | ||
} | ||
|
||
public static int[] toInts(String s) { | ||
assert s.length() == 4 : "Woah! This string isn't 4 characters wide!"; | ||
char[] c = s.toCharArray(); | ||
int[] i = new int[2]; | ||
i[0] = Integer.parseInt(c[0] + "" + c[1], 16); | ||
i[1] = Integer.parseInt(c[2] + "" + c[3], 16); | ||
return i; | ||
} | ||
|
||
package xyz.jadonfowler.sbhs; | ||
|
||
import java.awt.Color; | ||
|
||
public class GBAColor { | ||
public static Color fromGBA(String hex) { | ||
assert hex.length() == 4 : "Woah! This string isn't 4 characters wide!"; | ||
int h = Integer.parseInt(hex, 16), r = 0, g = 0, b = 0; | ||
while (h - (4 * 256) >= 0) { | ||
b += 8; | ||
h -= (4 * 256); | ||
} | ||
while (h - 32 >= 0) { | ||
g += 8; | ||
h -= 32; | ||
} | ||
r = h * 8; | ||
int t = 255; | ||
r = r > t ? t : r; | ||
g = g > t ? t : g; | ||
b = b > t ? t : b; | ||
Color c = new Color(r, g, b); | ||
return c; | ||
} | ||
|
||
public static String toGBA(int r, int g, int b) { | ||
r = (int) r / 8; | ||
g = ((int) g / 8) * 32; | ||
b = ((int) b / 8) * 256 * 4; | ||
int i = r + g + b; | ||
return (i < Math.pow(16, 3) ? "0" : "") + (i < 256 ? "0" : "") + (i < 16 ? "0" : "") | ||
+ Integer.toHexString(r + g + b); | ||
} | ||
|
||
public static String toGBA(Color c) { | ||
return toGBA(c.getRed(), c.getGreen(), c.getBlue()); | ||
} | ||
|
||
public static int[] toInts(String s) { | ||
assert s.length() == 4 : "Woah! This string isn't 4 characters wide!"; | ||
char[] c = s.toCharArray(); | ||
int[] i = new int[2]; | ||
i[0] = Integer.parseInt(c[0] + "" + c[1], 16); | ||
i[1] = Integer.parseInt(c[2] + "" + c[3], 16); | ||
return i; | ||
} | ||
|
||
} |
Oops, something went wrong.