Skip to content

Commit c29dde0

Browse files
committed
fixes agian
1 parent 1e86645 commit c29dde0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2163
-1249
lines changed

extras/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ Run the tests with:
3939
nosetests-2.7
4040
```
4141

42+
There might be a great deal of spammy output. Drop some of the spam with:
43+
44+
```
45+
nosetests-2.7 tests.integration.tests --nocapture --nologcapture
46+
```
47+
4248
# see also
4349

4450
* [Pokémon Crystal source code](https://github.com/kanzure/pokecrystal)

extras/pkmnasm/asmlex.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3+
from __future__ import print_function
34
import ply.lex as lex
45
import sys, os
56

@@ -466,7 +467,7 @@ def msg(self, str):
466467
''' Prints an error msg.
467468
'''
468469
#print '%s:%i %s' % (FILENAME, self.lex.lineno, str)
469-
print '%s:%s %s' % (FILENAME, "?", str)
470+
print('%s:%s %s' % (FILENAME, "?", str))
470471

471472

472473
def error(self, str):
@@ -490,5 +491,5 @@ def warning(self, str):
490491
tmp.input(open(sys.argv[1]).read())
491492
tok = tmp.token()
492493
while tok:
493-
print tok
494+
print(tok)
494495
tok = tmp.token()

extras/pokemontools/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
import configuration as config
2-
import crystal
3-
import preprocessor
4-
51
__version__ = "1.6.0"

extras/pokemontools/audio.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# coding: utf-8
22

3+
from __future__ import absolute_import
34
import os
45

56
from math import ceil
67

7-
from song_names import song_names
8-
from sfx_names import sfx_names
9-
from cry_names import cry_names
8+
from .song_names import song_names
9+
from .sfx_names import sfx_names
10+
from .cry_names import cry_names
1011

11-
from gbz80disasm import get_global_address, get_local_address
12-
from labels import line_has_label
13-
from crystal import music_classes as sound_classes
14-
from crystal import (
12+
from .gbz80disasm import get_global_address, get_local_address
13+
from .labels import line_has_label
14+
from .crystal import music_classes as sound_classes
15+
from .crystal import (
1516
Command,
1617
SingleByteParam,
1718
MultiByteParam,
@@ -22,7 +23,7 @@
2223
rom = load_rom()
2324
rom = bytearray(rom)
2425

25-
import configuration
26+
from . import configuration
2627
conf = configuration.Config()
2728

2829

@@ -299,7 +300,7 @@ def parse(self):
299300
self.address / 0x4000 != self.start_address / 0x4000
300301
) and not done:
301302
done = True
302-
raise Exception, self.label + ': reached the end of the bank without finishing!'
303+
raise Exception(self.label + ': reached the end of the bank without finishing!')
303304

304305
self.output += [(self.address, '; %x\n' % self.address, self.address)]
305306

extras/pokemontools/battle_animations.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# coding: utf-8
22

3+
from __future__ import print_function
4+
from __future__ import absolute_import
35
import os
46
from new import classobj
57

6-
import configuration
8+
from . import configuration
79
conf = configuration.Config()
810

9-
from crystal import (
11+
from .crystal import (
1012
SingleByteParam,
1113
PointerLabelParam,
1214
DecimalParam,
@@ -15,11 +17,11 @@
1517
load_rom
1618
)
1719

18-
from gbz80disasm import get_local_address, get_global_address
19-
from audio import sort_asms
20+
from .gbz80disasm import get_local_address, get_global_address
21+
from .audio import sort_asms
2022

2123

22-
from wram import read_constants
24+
from .wram import read_constants
2325

2426
rom = bytearray(load_rom())
2527

@@ -42,7 +44,7 @@ def to_asm(self):
4244
objs = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
4345
bgs = { k: v for k, v in anims.items() if 'ANIM_BG' in v }
4446
anims = { k: v.replace('ANIM_','') for k, v in anims.items() }
45-
from move_constants import moves
47+
from .move_constants import moves
4648
anims.update(moves)
4749

4850
class AnimObjParam(SingleByteParam):
@@ -320,5 +322,5 @@ def asm_list_to_text(asms):
320322

321323
if __name__ == '__main__':
322324
asms = dump_battle_anims()
323-
print asm_list_to_text(asms)
325+
print(asm_list_to_text(asms))
324326

extras/pokemontools/comparator.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
"""
33
Find shared functions between red/crystal.
44
"""
5+
from __future__ import print_function
6+
from __future__ import absolute_import
57

6-
from crystal import (
8+
from .crystal import (
79
get_label_from_line,
810
get_address_from_line_comment,
911
AsmSection,
1012
direct_load_rom,
1113
direct_load_asm,
1214
)
1315

14-
from romstr import (
16+
from .romstr import (
1517
RomStr,
1618
AsmList,
1719
)
@@ -53,7 +55,7 @@ def __new__(cls, x=None, *args, **kwargs):
5355
instance = int.__new__(cls, int(x, base=16), *args, **kwargs)
5456
else:
5557
msg = "Address.__new__ doesn't know how to parse this string"
56-
raise Exception, msg
58+
raise Exception(msg)
5759
else:
5860
instance = int.__new__(cls, x, *args, **kwargs)
5961

@@ -157,7 +159,7 @@ def find_in_crystal(self):
157159
found_blobs.append(self)
158160

159161
if self.debug:
160-
print self.label + ": found " + str(len(self.locations)) + " matches."
162+
print(self.label + ": found " + str(len(self.locations)) + " matches.")
161163

162164
def find_by_first_bytes(self):
163165
"""
@@ -181,7 +183,7 @@ def find_by_first_bytes(self):
181183
found_blobs.append(self)
182184

183185
if self.debug:
184-
print self.label + ": found " + str(len(self.locations)) + " matches."
186+
print(self.label + ": found " + str(len(self.locations)) + " matches.")
185187

186188
pokecrystal_rom_path = "../baserom.gbc"
187189
pokecrystal_src_path = "../main.asm"
@@ -214,14 +216,14 @@ def scan_red_asm(bank_stop=3, debug=True):
214216

215217
for line in redsrc:
216218
if debug and show_lines:
217-
print "processing a line from red: " + line
219+
print("processing a line from red: " + line)
218220

219221
if line[0:7] == "SECTION":
220222
thing = AsmSection(line)
221223
current_bank = thing.bank_id
222224

223225
if debug:
224-
print "scan_red_asm: switching to bank " + str(current_bank)
226+
print("scan_red_asm: switching to bank " + str(current_bank))
225227

226228
elif line[0:6] != "INCBIN":
227229
if ":" in line and not ";XXX:" in line and not " ; XXX:" in line:
@@ -240,7 +242,7 @@ def scan_red_asm(bank_stop=3, debug=True):
240242
line_number=line_number)
241243

242244
if debug:
243-
print "Created a new blob: " + str(blob) + " from line: " + str(latest_line)
245+
print("Created a new blob: " + str(blob) + " from line: " + str(latest_line))
244246

245247
latest_label = current_label
246248
latest_start_address = current_start_address
@@ -250,18 +252,18 @@ def scan_red_asm(bank_stop=3, debug=True):
250252

251253
if current_bank == bank_stop:
252254
if debug:
253-
print "scan_red_asm: stopping because current_bank >= " + \
254-
str(bank_stop) + " (bank_stop)"
255+
print("scan_red_asm: stopping because current_bank >= " + \
256+
str(bank_stop) + " (bank_stop)")
255257

256258
break
257259

258260
scan_red_asm(bank_stop=3)
259261

260-
print "================================"
262+
print("================================")
261263

262264
for blob in found_blobs:
263-
print blob
265+
print(blob)
264266

265-
print "Found " + str(len(found_blobs)) + " possibly copied functions."
267+
print("Found " + str(len(found_blobs)) + " possibly copied functions.")
266268

267-
print [hex(x) for x in found_blobs[10].locations]
269+
print([hex(x) for x in found_blobs[10].locations])

extras/pokemontools/cry_names.py

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,72 @@
11
# coding: utf-8
22

3-
cry_names = ['%.2X' % x for x in xrange(0x44)]
4-
3+
cry_names = [
4+
'Nidoran_M',
5+
'Nidoran_F',
6+
'Slowpoke',
7+
'Kangaskhan',
8+
'Charmander',
9+
'Grimer',
10+
'Voltorb',
11+
'Muk',
12+
'Oddish',
13+
'Raichu',
14+
'Nidoqueen',
15+
'Diglett',
16+
'Seel',
17+
'Drowzee',
18+
'Pidgey',
19+
'Bulbasaur',
20+
'Spearow',
21+
'Rhydon',
22+
'Golem',
23+
'Blastoise',
24+
'Pidgeotto',
25+
'Weedle',
26+
'Caterpie',
27+
'Ekans',
28+
'Fearow',
29+
'Clefairy',
30+
'Venonat',
31+
'Lapras',
32+
'Metapod',
33+
'Squirtle',
34+
'Paras',
35+
'Growlithe',
36+
'Krabby',
37+
'Psyduck',
38+
'Rattata',
39+
'Vileplume',
40+
'Vulpix',
41+
'Weepinbell',
42+
'Marill',
43+
'Spinarak',
44+
'Togepi',
45+
'Girafarig',
46+
'Raikou',
47+
'Mareep',
48+
'Togetic',
49+
'Hoothoot',
50+
'Sentret',
51+
'Slowking',
52+
'Cyndaquil',
53+
'Chikorita',
54+
'Totodile',
55+
'Gligar',
56+
'Cleffa',
57+
'Slugma',
58+
'Ledyba',
59+
'Entei',
60+
'Wooper',
61+
'Mantine',
62+
'Typhlosion',
63+
'Natu',
64+
'Teddiursa',
65+
'Sunflora',
66+
'Ampharos',
67+
'Magcargo',
68+
'Pichu',
69+
'Aipom',
70+
'Dunsparce',
71+
'Donphan',
72+
]

0 commit comments

Comments
 (0)