public void handler() {
            int A;
            UBytePtr rom;

            /* additionally to the usual protection, all the program ROMs have data lines */
            /* D0 and D1 swapped. */
            rom = memory_region(REGION_CPU1);
            for (A = 0; A < 0xc000; A++) {
                rom.write(A, ((rom.read(A) & 0xfc) | ((rom.read(A) & 1) << 1) | ((rom.read(A) & 2) >> 1)));
            }

            /* the tile gfx ROMs are mangled as well: */
            rom = memory_region(REGION_GFX1);

            /* the first ROM has data lines D0 and D6 swapped. */
            for (A = 0x0000; A < 0x4000; A++) {
                rom.write(A, ((rom.read(A) & 0xbe) | ((rom.read(A) & 0x01) << 6) | ((rom.read(A) & 0x40) >> 6)));
            }

            /* the second ROM has data lines D1 and D5 swapped. */
            for (A = 0x4000; A < 0x8000; A++) {
                rom.write(A, ((rom.read(A) & 0xdd) | ((rom.read(A) & 0x02) << 4) | ((rom.read(A) & 0x20) >> 4)));
            }

            /* the third ROM has data lines D0 and D6 swapped. */
            for (A = 0x8000; A < 0xc000; A++) {
                rom.write(A, ((rom.read(A) & 0xbe) | ((rom.read(A) & 0x01) << 6) | ((rom.read(A) & 0x40) >> 6)));
            }

            /* also, all three ROMs have address lines A4 and A5 swapped. */
            for (A = 0; A < 0xc000; A++) {
                int A1;
                char temp;

                A1 = (A & 0xffcf) | ((A & 0x0010) << 1) | ((A & 0x0020) >> 1);
                if (A < A1) {
                    temp = rom.read(A);
                    rom.write(A, rom.read(A1));
                    rom.write(A1, temp);
                }
            }

            myheroj_decode();
        }