Exemplo n.º 1
0
        public void findAndSetSegment02()
        {
            AssemblyReader ar = new AssemblyReader();
            List <AssemblyReader.JAL_CALL> func_calls;
            SegBank seg = new SegBank();
            uint    seg02_init;
            uint    RAMtoROM;

            switch (region)
            {
            default:
            case ROM_Region.NORTH_AMERICA:
                seg02_init = Globals.seg02_init_NA;
                RAMtoROM   = Globals.RAMtoROM_NA;
                break;

            case ROM_Region.EUROPE:
                seg02_init = Globals.seg02_init_EU;
                RAMtoROM   = Globals.RAMtoROM_EU;
                break;

            case ROM_Region.JAPAN:
                seg02_init = Globals.seg02_init_JP;
                RAMtoROM   = Globals.RAMtoROM_JP;
                break;

            case ROM_Region.JAPAN_SHINDOU:
                seg02_init = Globals.seg02_init_JS;
                RAMtoROM   = Globals.RAMtoROM_JS;
                break;

            case ROM_Region.CHINESE_IQUE:
                seg02_init = Globals.seg02_init_IQ;
                RAMtoROM   = Globals.RAMtoROM_IQ;
                break;
            }

            func_calls = ar.findJALsInFunction(seg02_init, RAMtoROM);
            for (int i = 0; i < func_calls.Count; i++)
            {
                if (func_calls[i].a0 == 0x2)
                {
                    Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                    if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                    {
                        seg.IsMIO0       = true;
                        seg02_isFakeMIO0 = testIfMIO0IsFake(
                            func_calls[i].a1,
                            readWord(func_calls[i].a1 + 0x8),
                            readWord(func_calls[i].a1 + 0xC)
                            );
                        seg.SegStart             = func_calls[i].a1;
                        seg02_uncompressedOffset = readWordUnsigned(func_calls[i].a1 + 0xC);
                    }
                }
            }

            setSegment(0x2, seg, null);
        }
Exemplo n.º 2
0
        public void findAndSetSegment02()
        {
            AssemblyReader ar = new AssemblyReader();
            List <AssemblyReader.JAL_CALL> func_calls;

            switch (region)
            {
            default:
            case RomRegion.NorthAmerica:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_NA, Globals.RAMtoROM_NA);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_NA && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02] = true;
                        }
                    }
                }
                break;

            case RomRegion.Europe:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_EU, Globals.RAMtoROM_EU);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_EU && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02] = true;
                        }
                    }
                }
                break;

            case RomRegion.Japan:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_JP, Globals.RAMtoROM_JP);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_JP && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02] = true;
                        }
                    }
                }
                break;

            case RomRegion.JapanShindou:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_JS, Globals.RAMtoROM_JS);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_JS && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02] = true;
                        }
                    }
                }
                break;
            }
        }
Exemplo n.º 3
0
        public void findAndSetSegment02()
        {
            AssemblyReader ar = new AssemblyReader();
            List <AssemblyReader.JAL_CALL> func_calls;

            switch (region)
            {
            default:
            case ROM_Region.NORTH_AMERICA:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_NA, Globals.RAMtoROM_NA);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_NA && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02]  = true;
                            seg02_isFakeMIO0 = testIfMIO0IsFake(
                                func_calls[i].a1,
                                readWord(func_calls[i].a1 + 0x8),
                                readWord(func_calls[i].a1 + 0xC)
                                );
                            segStart[0x02]           = func_calls[i].a1;
                            seg02_uncompressedOffset = readWordUnsigned(func_calls[i].a1 + 0xC);
                        }
                    }
                }
                break;

            case ROM_Region.EUROPE:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_EU, Globals.RAMtoROM_EU);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_EU && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02]  = true;
                            seg02_isFakeMIO0 = testIfMIO0IsFake(
                                func_calls[i].a1,
                                readWord(func_calls[i].a1 + 0x8),
                                readWord(func_calls[i].a1 + 0xC)
                                );
                            segStart[0x02]           = func_calls[i].a1;
                            seg02_uncompressedOffset = readWordUnsigned(func_calls[i].a1 + 0xC);
                        }
                    }
                }
                break;

            case ROM_Region.JAPAN:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_JP, Globals.RAMtoROM_JP);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_JP && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02]  = true;
                            seg02_isFakeMIO0 = testIfMIO0IsFake(
                                func_calls[i].a1,
                                readWord(func_calls[i].a1 + 0x8),
                                readWord(func_calls[i].a1 + 0xC)
                                );
                            segStart[0x02]           = func_calls[i].a1;
                            seg02_uncompressedOffset = readWordUnsigned(func_calls[i].a1 + 0xC);
                        }
                    }
                }
                break;

            case ROM_Region.JAPAN_SHINDOU:
                func_calls = ar.findJALsInFunction(Globals.seg02_init_JS, Globals.RAMtoROM_JS);
                for (int i = 0; i < func_calls.Count; i++)
                {
                    if (func_calls[i].JAL_ADDRESS == Globals.seg02_alloc_JS && func_calls[i].a0 == 0x2)
                    {
                        Globals.seg02_location = new[] { func_calls[i].a1, func_calls[i].a2 };
                        if (readWordUnsigned(func_calls[i].a1) == 0x4D494F30)
                        {
                            segIsMIO0[0x02]  = true;
                            seg02_isFakeMIO0 = testIfMIO0IsFake(
                                func_calls[i].a1,
                                readWord(func_calls[i].a1 + 0x8),
                                readWord(func_calls[i].a1 + 0xC)
                                );
                            segStart[0x02]           = func_calls[i].a1;
                            seg02_uncompressedOffset = readWordUnsigned(func_calls[i].a1 + 0xC);
                        }
                    }
                }
                break;
            }
        }