예제 #1
0
    def initialize(self, rom, symfile):
        """
		Setup the disassembler.
		"""
        path = os.path.join(self.config.path, rom)
        self.rom = load_rom(path)

        path = os.path.join(self.config.path, symfile)
        if os.path.exists(path):
            self.sym, self.rsym, self.wram, self.sram = load_symbols(path)

        path = os.path.join(self.config.path, 'gbhw.asm')

        if os.path.exists(path):
            self.gbhw = read_constants(path)
        else:
            path = os.path.join(self.config.path,
                                "constants/hardware_constants.asm")
            if os.path.exists(path):
                self.gbhw = read_constants(path)

        path = os.path.join(self.config.path, 'vram.asm')
        if os.path.exists(path):
            self.vram = read_constants(path)

        path = os.path.join(self.config.path, 'hram.asm')
        if os.path.exists(path):
            self.hram = read_constants(path)
	def initialize(self, rom, symfile):
		"""
		Setup the disassembler.
		"""
		path = os.path.join(self.config.path, rom)
		self.rom = load_rom(path)
		
		path = os.path.join(self.config.path, symfile)
		if os.path.exists(path):
			self.sym, self.rsym, self.wram, self.sram = load_symbols(path)

		path = os.path.join(self.config.path, 'gbhw.asm')
		
		if os.path.exists(path):
			self.gbhw = read_constants(path)
		else:
			path = os.path.join(self.config.path, "constants/hardware_constants.asm")
			if os.path.exists(path):
				self.gbhw = read_constants(path)
		
		path = os.path.join(self.config.path, 'vram.asm')
		if os.path.exists(path):
			self.vram = read_constants(path)
			
		path = os.path.join(self.config.path, 'hram.asm')
		if os.path.exists(path):
			self.hram = read_constants(path)
예제 #3
0
	def initialize(self, rom, symfile):
		"""
		Setup the disassembler.
		"""
		path = os.path.join(self.config.path, rom)
		self.rom = load_rom(path)

		# load ram symbols
		path = os.path.join(self.config.path, symfile)
		if os.path.exists(path):
			self.sym, self.rsym, self.wram, self.sram, self.vram, self.hram = load_symbols(path)

		# load hardware constants
		path = os.path.join(self.config.path, 'src/constants/hardware_constants.asm')
		if os.path.exists(path):
			self.gbhw = read_constants(path)
	PointerLabelParam,
	DecimalParam,
	BigEndianParam,
	Command,
	load_rom
)

from gbz80disasm import get_local_address, get_global_address
from audio import sort_asms


from wram import read_constants

rom = bytearray(load_rom())

sfx_constants = read_constants(os.path.join(conf.path, 'constants/sfx_constants.asm'))
class SoundEffectParam(SingleByteParam):
	def to_asm(self):
		if self.byte in sfx_constants.keys():
			sfx_constant = sfx_constants[self.byte]
			return sfx_constant
		return SingleByteParam.to_asm(self)

anim_gfx_constants = read_constants(os.path.join(conf.path, 'constants/gfx_constants.asm'))
class AnimGFXParam(SingleByteParam):
	def to_asm(self):
		if self.byte in anim_gfx_constants.keys():
			return anim_gfx_constants[self.byte]
		return SingleByteParam.to_asm(self)

anims = read_constants(os.path.join(conf.path, 'constants/animation_constants.asm'))
from new import classobj

import configuration
conf = configuration.Config()

from crystal import (SingleByteParam, PointerLabelParam, DecimalParam,
                     BigEndianParam, Command, load_rom)

from gbz80disasm import get_local_address, get_global_address
from audio import sort_asms

from wram import read_constants

rom = bytearray(load_rom())

sfx_constants = read_constants(
    os.path.join(conf.path, 'constants/sfx_constants.asm'))


class SoundEffectParam(SingleByteParam):
    def to_asm(self):
        if self.byte in sfx_constants.keys():
            sfx_constant = sfx_constants[self.byte]
            return sfx_constant
        return SingleByteParam.to_asm(self)


anim_gfx_constants = read_constants(
    os.path.join(conf.path, 'constants/gfx_constants.asm'))


class AnimGFXParam(SingleByteParam):