Пример #1
0
def format_state(pos, value, fixp, state_map):
    try:
        path = state_map.lookup_address(pos)
        path_str = format_path(path)
    except KeyError:
        path = None
        path_str = '(UNKNOWN)'
    desc = ('  [%05X]' % pos) + ' ' + path_str
    if fixp:
        desc += ' = %f' % fixp_as_float(value)
    else:
        # For uniforms, show float value
        if (pos >= 0x05000 and pos < 0x06000) or (
                pos >= 0x07000 and pos < 0x08000) or (pos >= 0x30000
                                                      and pos < 0x32000):
            num = pos & 0xFFF
            spec = 'u%i.%s' % (num // 16, COMPS[(num // 4) % 4])
            desc += ' := %f (%s)' % (int_as_float(value), spec)
        elif path is not None:
            register = path[-1][0]
            desc += ' := '
            if isinstance(register.type, Domain):
                desc += format_addr(value)
            else:
                desc += register.describe(value)
    return desc
Пример #2
0
 def format_state(self, pos, value, fixp):
     try:
         path = self.state_map.lookup_address(pos)
         path_str = format_path(path)
     except KeyError:
         path = None
         path_str = '0x%05X' % pos
     desc = '  ' + path_str 
     if fixp:
         desc += ' = %f' % fixp_as_float(value)
     else:
         # For uniforms, show float value
         if (pos >= 0x05000 and pos < 0x06000) or (pos >= 0x07000 and pos < 0x08000):
             num = pos & 0xFFF
             desc += ' := %f (%s)' % (int_as_float(value), offset_to_uniform(num))
         elif path is not None:
             register = path[-1][0]
             desc += ' := ' + register.describe(value)
     return desc
Пример #3
0
 def format_state(self, pos, value, fixp):
     try:
         path = self.state_map.lookup_address(pos)
         path_str = format_path(path)
     except KeyError:
         path = None
         path_str = '0x%05X' % pos
     desc = '  ' + path_str 
     if fixp:
         desc += ' = %f' % fixp_as_float(value)
     else:
         # For uniforms, show float value
         if (pos >= 0x05000 and pos < 0x06000) or (pos >= 0x07000 and pos < 0x08000):
             num = pos & 0xFFF
             desc += ' := %f (%s)' % (int_as_float(value), offset_to_uniform(num))
         elif path is not None:
             register = path[-1][0]
             desc += ' := ' + register.describe(value)
     return desc
Пример #4
0
def format_state(pos, value, fixp, state_map, describe):
    try:
        path = state_map.lookup_address(pos)
        path_str = format_path(path)
    except KeyError:
        path = None
        path_str = '(UNKNOWN)'
    desc = ('  [%05X]' % pos) + ' ' + path_str 
    if fixp:
        desc += ' = %f' % fixp_as_float(value)
    else:
        # For uniforms, show float value
        if (pos >= 0x05000 and pos < 0x06000) or (pos >= 0x07000 and pos < 0x08000) or (pos >= 0x30000 and pos < 0x32000):
            num = pos & 0xFFF
            spec = 'u%i.%s' % (num//16, COMPS[(num//4)%4])
            desc += ' := %f (%s)' % (int_as_float(value), spec)
        elif path is not None:
            register = path[-1][0]
            desc += ' := ' + describe(register, value)
    return desc
Пример #5
0
def format_state(pos, value, fixp, state_map):
    try:
        path = state_map.lookup_address(pos)
        path_str = format_path(path) #+ ('(0x%05X)' % pos)
    except KeyError:
        path = None
        path_str = '0x%05X' % pos
    desc = '  ' + path_str 
    if fixp:
        desc += ' = %f' % fixp_as_float(value)
    else:
        # For uniforms, show float value
        if (pos >= 0x05000 and pos < 0x06000) or (pos >= 0x07000 and pos < 0x08000):
            num = pos & 0xFFF
            spec = 'u%i.%s' % (num//16, COMPS[(num//4)%4])
            desc += ' := %f (%s)' % (int_as_float(value), spec)
        elif path is not None:
            register = path[-1][0]
            desc += ' := '
            desc += register.describe(value)
    return desc
Пример #6
0
def hex_and_float_fixp(x):
    return '%08x (%f)' % (x, fixp_as_float(x))
Пример #7
0
def hex_and_float_fixp(x):
    return '%08x (%f)' % (x, fixp_as_float(x))