Ejemplo n.º 1
0
def setup():
        m = mem.byte_mem(0x0000, 0x10000)
        dn = os.path.dirname(__file__)
        m.load_binfile(0x0000, 1, os.path.join(dn, "EPROM_ROB_357.bin"))

	for a in range(0x7ee):
		m.wr(0xa000 + a, m.rd(0x0012 + a))

        pj = job.Job(m, "RC702_bootrom_rob_357")
        cx = z80.z80()
        return pj, cx
Ejemplo n.º 2
0
def setup():
        m = mem.byte_mem(0x0000, 0x7800)
        dn = os.path.dirname(__file__)
        m.load_binfile(0x0000, 1, os.path.join(dn, "EPROM_ROA_375.bin"))

	for a in range(0x797):
		m.wr(0x7000 + a, m.rd(0x0069 + a))

        pj = job.Job(m, "RC702_bootrom_roa_375")
        cx = z80.z80()
        return pj, cx
Ejemplo n.º 3
0
def example():
    cx = z80.z80()
    m = mem.Stackup(files=(FILENAME, ), nextto=__file__)
    cx.m.map(m, 0, 0x12)
    cx.m.map(m, lo=0xa000, hi=0xa59a, offset=0x12)

    data.Txt(cx.m, 0xa533, label=False)
    data.Txt(cx.m, 0xa546, label=False)
    data.Txt(cx.m, 0xa571, label=False)
    data.Txt(cx.m, 0xa574, label=False)
    data.Txt(cx.m, 0xa588, 0xa58c, label=False)
    data.Txt(cx.m, 0xa58c, 0xa590, label=False)
    data.Txt(cx.m, 0xa593, 0xa593 + 0x7, label=False)

    cx.disass(0x0000)

    # Interrupt vector table
    for a in range(12):
        cx.codeptr(0xa000 + a * 2)

    return NAME, (cx.m, )
Ejemplo n.º 4
0
def setup():
    pj = job.Job(mem_setup(), "RC702_bootrom_roa_375")
    cx = z80.z80()
    return pj, cx
Ejemplo n.º 5
0
def example():
    m = []
    for fn, csum in FILES:
        i = mem.Stackup(files=(fn,), nextto=__file__,)
        assert sum(i.bytearray(i.lo, i.hi)) & 0xffff == csum
        m.append(i)

    charrom(m[3], m[4])

    cpu = z80.z80()
    cpu.m.map(m[0], 0x0000)
    cpu.m.map(m[1], 0x4000)
    cpu.m.map(m[2], 0xa000)

    cpu.flow_check.append(fc)

    for a, b in SYMBOLS.items():
        cpu.m.set_label(a, b)

    for a, b in IO_SYMBOLS.items():
        cpu.as_io.set_label(a, b)

    for a in range(0x3d, 0x60, 2):
        x = cpu.codeptr(a)
        cpu.m.set_line_comment(x.dst, "From tbl@0x003d")

    for a in range(0x0700, 0x0728, 2):
        x = cpu.codeptr(a)
        cpu.m.set_line_comment(x.dst, "From tbl@0x0700")

    for a in range(0x0800, 0x0810, 2):
        x = cpu.codeptr(a)
        cpu.m.set_line_comment(x.dst, "From tbl@0x0800")

    for a in range(0x0900, 0x0908, 2):
        x = cpu.codeptr(a)
        cpu.m.set_line_comment(x.dst, "From tbl@0x0900")

    for a in range(0xe00, 0xfa0, 2):
        x = cpu.codeptr(a)
        cpu.m.set_line_comment(x.dst, "From tbl@0x0e00")

    for a in range(0x0810, 0x0900, 2):
        x = cpu.dataptr(a)
        y = data.Txt(cpu.m, x.dst, term=(0x81,), label=False)
        x.lcmt = y.txt

    for a in range(0x0a45, 0x0be3, 2):
        x = cpu.dataptr(a)
        y = data.Txt(cpu.m, x.dst, term=(0x80,), label=False)
        x.lcmt = y.txt

    for a in range(0x3bb1, 0x3bd1, 2):
        x = cpu.dataptr(a)
        cpu.m.set_label(x.dst, "KBD_%x" % a)
        for i in range(29):
            try:
                y = data.Pstruct(cpu.m, x.dst + i * 5, "B" * 5, fmt=", ".join(["0x%02x"] * 5))
                y.compact = True
            except:
                pass

    hack(cpu, 0x264b)

    a = 0xa51a
    b = 0xa539
    while cpu.m[a] != 0xff:
        x = data.Pstruct(cpu.m, a, "BBB", fmt=", ".join(["0x%02x"] * 3))
        a = x.hi
        y = data.Txt(cpu.m, b, b + 0x1e, label=False)
        b = y.hi
    data.Const(cpu.m, a, a + 1)

    x = data.Pstruct(cpu.m, 0x54a7, "B" * 12, fmt=", ".join(["0x%02x"] * 12))
    x = data.Pstruct(cpu.m, 0xaddd, "B" * 12, fmt=", ".join(["0x%02x"] * 12))
    x = data.Pstruct(cpu.m, 0xa392, "B" * 12, fmt=", ".join(["0x%02x"] * 12))
    x = data.Pstruct(cpu.m, 0xa39e, "B" * 12, fmt=", ".join(["0x%02x"] * 12))
    x = data.Pstruct(cpu.m, 0xacb0, "B" * 10, fmt=", ".join(["0x%02x"] * 10))

    cpu.m.set_label(0xa2c4, "TestNames")
    for a in range(0xa2c4, 0xa384, 0x10):
        x = data.Txt(cpu.m, a, a + 0x10, label=False)

    for a in range(0xade9, 0xae21, 7):
        x = data.Txt(cpu.m, a, a + 0x7, label=True)

    menu_desc(cpu, 0x7103)
    menu_desc(cpu, 0x742b)
    menu_desc(cpu, 0x7689)

    for a, l in (
            (0xa384, 0x7),
            (0xa38b, 0x7),
            (0xae21, 0xa),
            (0xae2c, 0xc),
            (0xae38, 0x7),
            (0xae40, 0x9),
            (0xae4a, 0xa),
            (0xae54, 0xb),
            (0xae5f, 0xf),
            (0xae6f, 0x7),
            (0xae76, 0xb),
            (0xae81, 0x7),
    ):
        x = data.Txt(cpu.m, a, a + l)

    cpu.vectors(
        (
            "RESET",
            "RST08",
            "RST10",
            "RST18",
            "RST28",
            "IRQ",
            "NMI",
        )
    )

    # switch_tbl(cpu.m, 0x0dc0, cpu)
    switch_tbl(cpu.m, 0x32f8, cpu)
    switch_tbl(cpu.m, 0x334a, cpu)
    switch_tbl(cpu.m, 0x33c1, cpu)
    switch_tbl(cpu.m, 0x5328, cpu)
    switch_tbl(cpu.m, 0x5383, cpu)
    switch_tbl(cpu.m, 0x53b9, cpu)
    switch_tbl(cpu.m, 0x53a2, cpu)
    switch_tbl(cpu.m, 0x53af, cpu)

    for a in range(0x789b, 0x78bb, 2):
        y = cpu.dataptr(a)
        data.Txt(cpu.m, y.dst, term=(0x80,))

    for a in (
            0x7926,
            0x7cf7,
            0x7d03,
    ):
        data.Txt(cpu.m, a, term=(0x80,))

    if False:
        # See 0x43cc
        for a in range(0x3d, 0x58, 2):
            y = cpu.codeptr(a)
            cpu.m.set_line_comment(y.dst, "MANUAL from tbl@0x3c")

    if False:
        # See 0x493e
        for a in range(0x800, 0x900, 2):
            y = cpu.codeptr(a)
            cpu.m.set_line_comment(y.dst, "MANUAL from tbl@0x800")

    data.Pstruct(cpu.m, 0x89, "2B", fmt=", ".join(["0x%02x"] * 2))
    for a in range(0x524, 0x56c, 4):
        data.Pstruct(cpu.m, a, "4B", fmt=", ".join(["0x%02x"] * 4))

    for a, b in (
            (0x008b, "via IY"),
            (0x04f6, "via IY"),
            (0x0506, "via IY"),
            (0x0518, "via IY"),
            (0x0fc7, "via xfa0"),
            (0x0fe5, "via xfa0"),
            (0x1006, "via xfa0"),
            (0x1397, None),
            (0x5c03, "via 0xc296"),
            (0x5df9, "via 0xc296"),
            (0x5e25, "via 0xc296"),
            (0x5ecb, "via 0xc296"),
            (0x5f7f, "via 0xc296"),
            (0x5fbc, "via 0xc296"),
            (0xac5a, None),
            (0xb800, None),
            (0xb874, "via 0xc1da ptr"),
            (0xb8db, "via 0xc1d8 ptr"),
            (0xb8e2, "via 0xc1d8 ptr"),
            (0xb8e9, "via 0xc1d8 ptr"),
            (0xb8f0, "via 0xc1d8 ptr"),
            (0xb8f7, "via 0xc1d8 ptr"),
            (0xb844, None),
            (0x3916, "via 0xcf58 ptr"),
            (0x3936, "via 0xcf58 ptr"),
            (0x3948, "via 0xcf58 ptr"),
            (0x39d8, "via 0xcf58 ptr"),
    ):
        cpu.disass(a)
        if not b:
            b = "MANUAL"
        cpu.m.set_line_comment(a, b)

    y = data.Data(cpu.m, 0x4707, 0x4707 + 0x15e)

    if False:
        discover.Discover(cpu)

    return NAME, (cpu.m,)