diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-01-05 19:20:36 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-01-05 19:20:36 -0600 |
commit | 982a7d60cb1e34ba04ce1e8b03403b87f07cce3c (patch) | |
tree | 6050a34915d48597b94472b6b40ca61f3b796de6 | |
parent | 4c6da6a08a055584a962fe2cc2ed08016bf5d516 (diff) |
sprite constants
hg-commit-id: ce3c7d3ae15e
-rw-r--r-- | constants.asm | 73 | ||||
-rw-r--r-- | extras/sprite_helper.py | 74 |
2 files changed, 142 insertions, 5 deletions
diff --git a/constants.asm b/constants.asm index 266749b5..3eb6b5d5 100644 --- a/constants.asm +++ b/constants.asm @@ -1189,3 +1189,76 @@ TRAINER EQU $40 ; status ailments (masks) FRZ EQU %00100000 SLP EQU %00000111 + +SPRITE_HIRO EQU $01 +SPRITE_RIVAL EQU $02 +SPRITE_OAK EQU $03 +SPRITE_BLONDE_BOY EQU $04 +SPRITE_MACHOKE_SLOWBRO EQU $05 +SPRITE_BLONDE_PONYTAIL_GIRL EQU $06 +SPRITE_BLACK_HAIR_BOY_1 EQU $07 +SPRITE_LITTLE_GIRL EQU $08 +SPRITE_BIRD EQU $09 +SPRITE_FAT_BALD_GUY EQU $0a +SPRITE_MONK EQU $0b +SPRITE_BLACK_HAIR_BOY_2 EQU $0c +SPRITE_GIRL EQU $0d +SPRITE_HIKER EQU $0e +SPRITE_FOULARD_WOMAN EQU $0f +SPRITE_GENTLEMAN EQU $10 +SPRITE_SISTER EQU $11 +SPRITE_BIKER EQU $12 +SPRITE_SAILOR EQU $13 +SPRITE_COOK EQU $14 +SPRITE_SUNGLASSES_GUY EQU $15 +SPRITE_MR_FUJI EQU $16 +SPRITE_GIOVANNI EQU $17 +SPRITE_ROCKET_GRUNT EQU $18 +SPRITE_MEDIUM EQU $19 +SPRITE_WAITER EQU $1a +SPRITE_ERIKA EQU $1b +SPRITE_MOM_GEISHA EQU $1c +SPRITE_BRUNETTE_GIRL EQU $1d +SPRITE_LANCE EQU $1e +SPRITE_OAK_SCIENTIST_AIDE EQU $1f +SPRITE_OAK_AIDE EQU $20 +SPRITE_PUNK EQU $21 +SPRITE_SWIMMER EQU $22 +SPRITE_WHITE_PLAYER EQU $23 +SPRITE_GYM_HELPER EQU $24 +SPRITE_OLD_PERSON EQU $25 +SPRITE_MART_GUY EQU $26 +SPRITE_FISHER EQU $27 +SPRITE_OLD_MEDIUM_WOMAN EQU $28 +SPRITE_NURSE EQU $29 +SPRITE_CABLE_CLUB_WOMAN EQU $2a +SPRITE_MR_MASTERBALL EQU $2b +SPRITE_LAPRAS_GIVER EQU $2c +SPRITE_BALDING_FAT_GUY EQU $2d +SPRITE_BLACK_HAT_WHITE_BEARD_MAN EQU $2e +SPRITE_FAT_MAN EQU $2f +SPRITE_DOJO_GUY EQU $30 +SPRITE_GUARD_COP EQU $31 +SPRITE_COP_GUARD EQU $32 +SPRITE_MOM EQU $33 +SPRITE_BALDING_GUY EQU $34 +SPRITE_YOUNG_GIRL EQU $35 +SPRITE_GAMEBOY_KID EQU $36 +SPRITE_GAMEBOY_KID_COPY EQU $37 +SPRITE_CLEFAIRYLIKE EQU $38 +SPRITE_AGATHA EQU $39 +SPRITE_BRUNO EQU $3a +SPRITE_LORELEI EQU $3b +SPRITE_SEEL EQU $3c +SPRITE_BALL EQU $3d +SPRITE_OMANYTE EQU $3e +SPRITE_BOULDER EQU $3f +SPRITE_PAPER_SHEET EQU $40 +SPRITE_BOOK_MAP_DEX EQU $41 +SPRITE_CLIPBOARD EQU $42 +SPRITE_SNORLAX EQU $43 +SPRITE_OLD_AMBER EQU $44 +SPRITE_OLD_AMBER EQU $45 +SPRITE_LYING_OLD_MAN_UNUSED_1 EQU $46 +SPRITE_LYING_OLD_MAN_UNUSED_2 EQU $47 +SPRITE_LYING_OLD_MAN EQU $48 diff --git a/extras/sprite_helper.py b/extras/sprite_helper.py index c539e78b..f5ba1b13 100644 --- a/extras/sprite_helper.py +++ b/extras/sprite_helper.py @@ -10,7 +10,7 @@ constants = { 0x02: ["Rival", ""], 0x03: ["Oak", ""], 0x04: ["blonde boy", ""], -0x05: ["machoke/slowbro OW", "slowbro"], +0x05: ["machoke/slowbro OW", "machoke slowbro"], 0x06: ["blonde(horse-tail-hair) girl", "blonde ponytail girl"], 0x07: ["black-hair boy 1", "black hair boy 1"], 0x08: ["little kid (F)", "little girl"], @@ -23,7 +23,7 @@ constants = { 0x0F: ["foulard woman", "foulard woman"], 0x10: ["rich(black-hat) man", "gentleman"], 0x11: ["sister", ""], -0x12: ["motorbiker", ""], +0x12: ["motorbiker", "biker"], 0x13: ["sailor", ""], 0x14: ["cook", ""], 0x15: ["sun-glasses guy (bike seller)", "sunglasses guy"], @@ -33,7 +33,7 @@ constants = { 0x19: ["medium", ""], 0x1A: ["waiter", ""], 0x1B: ["erika", ""], -0x1C: ["mother (geisha)", "mother"], +0x1C: ["mother (geisha)", "mom geisha"], 0x1D: ["brunette girl", ""], 0x1E: ["lance", ""], 0x1F: ["oak's aide/scientist", "oak scientist aide"], @@ -56,7 +56,11 @@ constants = { 0x30: ["dojo guy", ""], 0x31: ["guard (cop?)", "guard cop"], 0x32: ["cop (guard)", "cop guard"], +0x33: ["mom", ""], 0x34: ["semi-bald man", "balding guy"], +0x35: ["young girl", ""], +0x36: ["gameboy kid", ""], +0x37: ["gameboy kid copy", ""], 0x38: ["clefairy-like", "clefairylike"], 0x39: ["Agatha", ""], 0x3A: ["Bruno", ""], @@ -64,12 +68,21 @@ constants = { 0x3C: ["seel", ""], 0x3D: ["ball", ""], 0x3E: ["omanyte", ""], +0x3F: ["boulder", ""], +0x40: ["paper sheet", ""], 0x41: ["book/map/dex", ""], +0x42: ["clipboard", ""], +0x43: ["snorlax", ""], +0x44: ["old amber", ""], +0x45: ["old amber", ""], +0x46: ["lying old man unused 1", ""], +0x47: ["lying old man unused 2", ""], 0x48: ["lying old man", ""], } icons = {} unique_icons = set() +todo_sprites = {} def load_icons(): for map_id in map_headers: @@ -109,7 +122,58 @@ def print_appearances(): print output -if __name__ == "__main__": +def insert_todo_sprites(): load_icons() - print_appearances() + counter = 1 + for icon in unique_icons: + if icon not in constants: + todo_sprites[icon] = counter + constants[icon] = None + counter += 1 + +def sprite_name_cleaner(badname): + output = "SPRITE_" + badname + output = output.replace(" ", "_") + output = output.replace("/", "_") + output = output.replace(".", "") + + output = output.upper() + + while output[-1] == "_": + output = output[:-1] + return output + +def sprite_namer(): + "makes up better constant names for each sprite" + insert_todo_sprites() + sprites = {} + + for sprite_id in constants: + suggestions = constants[sprite_id] + if suggestions == None: + sprites[sprite_id] = "SPRITE_TODO_" + str(todo_sprites[sprite_id]) + continue #next please + + original = suggestions[0] + if suggestions[1] != "": original = suggestions[1] + + result = sprite_name_cleaner(original) + sprites[sprite_id] = result + + for key in sprites: + line_length = len(sprites[key]) + len(" EQU $") + 2 + + if line_length < 40: + extra = (40 - line_length) * " " + else: extra = "" + + value = hex(key)[2:] + if len(value) == 1: value = "0" + value + + print sprites[key] + extra + " EQU $" + value + +if __name__ == "__main__": + #load_icons() + #print_appearances() + sprite_namer() |