Example #1
0
#!/usr/bin/env python3
#
# Parse the ROM, and output asm files with the map headers and map data.

import os
import argparse
from textwrap import dedent
from lib.map_parser import *
from lib.utils import BANK

map_descriptors = [
    MapDescriptor(
        name = 'overworld',
        address = BANK(0x09),
        length = 0x200,
        data_base_address = (lambda room_index: BANK(0x09) if room_index <= 0x7F else BANK(0x1A)),
        rooms = [
            RoomsDescriptor(
                name = 'overworld_a',
                address = BANK(0x09) + 512,
                length = 9357,
                klass = OverworldRoom
            ),
            RoomsDescriptor(
                name = 'overworld_b',
                address = BANK(0x1A),
                length = 7797,
                klass = OverworldRoom
            )
        ]),
    MapDescriptor(
#!/usr/bin/env python3
#
# Parse the ROM, and output asm files with the entities pointer tables and data.

import os
import argparse
from textwrap import dedent
from lib.entities_parser import *
from lib.utils import BANK

entities_descriptors = [
    EntitiesTableDescriptor(name='overworld',
                            address=BANK(0x16) + 0x000,
                            length=0x200,
                            entities=EntitiesDescriptor(address=BANK(0x16) +
                                                        0x1186,
                                                        length=0x4DE)),
    EntitiesTableDescriptor(name='indoors_a',
                            address=BANK(0x16) + 0x200,
                            length=0x200,
                            entities=EntitiesDescriptor(address=BANK(0x16) +
                                                        0x0640,
                                                        length=0x664)),
    EntitiesTableDescriptor(name='indoors_b',
                            address=BANK(0x16) + 0x400,
                            length=0x200,
                            entities=EntitiesDescriptor(address=BANK(0x16) +
                                                        0x0CA4,
                                                        length=0x4E2)),
    EntitiesTableDescriptor(name='color_dungeon',
                            address=BANK(0x16) + 0x600,
background_descriptors = [
    # BackgroundTableDescriptor(
    #     name = 'tilemaps',
    #     address = BANK(0x20) + 0x052B,
    #     length = 0x4C,
    #     data = [
    #         BackgroundDescriptor(
    #             address = BANK(0x08) + 0x0DD4,
    #             length = 0x2B4C
    #         )
    #     ]
    # ),
    BackgroundTableDescriptor(
        name='attrmaps',
        address=BANK(0x24) + 0x1C4B,
        length=0x4C,
        data=[
            # US, JP
            BackgroundDescriptor(address=BANK(0x24) + 0x1C97, length=0x174A),
            BackgroundDescriptor(address=BANK(0x24) + 0x3BA7, length=0x12A),
            # FR, GE
            # BackgroundDescriptor(
            #     address = BANK(0x24) + 0x1C97,
            #     length = 0x1736
            # ),
            # BackgroundDescriptor(
            #     address = BANK(0x24) + 0x3B93,
            #     length = 0x12A
            # ),
        ])
#!/usr/bin/env python3
#
# Parse the ROM, and output asm files with the entities pointer tables and data.

import os
import argparse
from textwrap import dedent
from lib.entities_parser import *
from lib.utils import BANK

entities_descriptors = [
    EntitiesTableDescriptor(
        name = 'overworld',
        address = BANK(0x16) + 0x000,
        length = 0x200,
        entities = EntitiesDescriptor(
            address = BANK(0x16) + 0x1186,
            length = 0x4DE
        )
    ),
    EntitiesTableDescriptor(
        name = 'indoors_a',
        address = BANK(0x16) + 0x200,
        length = 0x200,
        entities = EntitiesDescriptor(
            address = BANK(0x16) + 0x0640,
            length = 0x664
        )
    ),
    EntitiesTableDescriptor(
        name = 'indoors_b',
Example #5
0
#!/usr/bin/env python3
#
# Parse the ROM, and output asm files with the background tilemaps tables and data.

import os
import argparse
import re
from textwrap import dedent
from itertools import groupby
from lib.background_parser import *
from lib.utils import BANK, global_to_local

background_descriptors = [
    BackgroundTableDescriptor(
        name = 'background_tile_commands',
        address = BANK(0x20) + 0x052B,
        length = 0x4C,
        data = BackgroundDescriptor(
            address = BANK(0x08) + 0x0DD4
        )
    ),

    # TODO: The attributes are split into multiple areas where they are stored.
    #  so we need to split the output into multiple files and make sure not to decode any code.
    #  But we only need a single pointer list.
    #BackgroundTableDescriptor(
    #    name = 'background_attributes',
    #    address = BANK(0x24) + 0x1C4B,
    #    length = 0x4C,
    #    data = BackgroundDescriptor(
    #        address = BANK(0x24) + 0x1C97,