Skip to content

Commit 384e644

Browse files
Maciek BaronBaekalfen
authored andcommitted
Add initial Pokemon Red wrapper code
1 parent 4a40250 commit 384e644

File tree

3 files changed

+403
-0
lines changed

3 files changed

+403
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .wrapper import GameWrapperPokemonRed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from .constants import ASCII_DELTA
2+
3+
def get_character_index(character):
4+
if character == ' ':
5+
return 0x7F
6+
if character == '?':
7+
return 0xE6
8+
if character == '!':
9+
return 0xE7
10+
if character == 'é':
11+
return 0xBA
12+
13+
index = ord(character)
14+
if index > 47 and index < 58:
15+
# number
16+
return index + 197
17+
return index + ASCII_DELTA

0 commit comments

Comments
 (0)