public static void retofinv_draw_foreground(osd_bitmap bitmap) {
        int x, y, offs;
        int sx, sy, tile, palette, flipx, flipy;

        for (x = 0; x < 32; x++) {
            for (y = 30; y <= 31; y++) {
                offs = y * 32 + x;

                sx = ((62 - y) + 3) << 3;
                sy = (31 - x) << 3;

                flipx = flipy = 0;

                if (flipscreen != 0) {
                    sx = 280 - sx;
                    sy = 248 - sy;
                    flipx = flipy = 1;
                }

                tile = retofinv_fg_videoram.read(offs) + (retofinv_fg_char_bank.read(0) * 256);
                palette = retofinv_fg_colorram.read(offs);

                drawgfx(bitmap, Machine.gfx[0],
                        tile,
                        palette,
                        flipx, flipy,
                        sx, sy,
                        Machine.drv.visible_area, TRANSPARENCY_NONE, 0);
            }
        }

        for (x = 29; x >= 2; x--) {
            for (y = 31; y >= 0; y--) {
                offs = x * 32 + y;
                sy = ((31 - x) << 3);
                sx = ((33 - y)) << 3;

                flipx = flipy = 0;

                if (flipscreen != 0) {
                    sx = 280 - sx;
                    sy = 248 - sy;
                    flipx = flipy = 1;
                }

                tile = retofinv_fg_videoram.read(offs) + (retofinv_fg_char_bank.read(0) * 256);
                palette = retofinv_fg_colorram.read(offs);

                drawgfx(bitmap, Machine.gfx[0],
                        tile,
                        palette,
                        flipx, flipy,
                        sx, sy,
                        Machine.drv.visible_area, TRANSPARENCY_PEN, 0);
            }
        }

        for (x = 0; x < 32; x++) {
            for (y = 1; y >= 0; y--) {
                offs = y * 32 + x;
                sx = (1 - y) << 3;
                sy = (31 - x) << 3;

                flipx = flipy = 0;

                if (flipscreen != 0) {
                    sx = 280 - sx;
                    sy = 248 - sy;
                    flipx = flipy = 1;
                }

                tile = retofinv_fg_videoram.read(offs) + (retofinv_fg_char_bank.read(0) * 256);
                palette = retofinv_fg_colorram.read(offs);

                drawgfx(bitmap, Machine.gfx[0],
                        tile,
                        palette,
                        flipx, flipy,
                        sx, sy,
                        Machine.drv.visible_area, TRANSPARENCY_NONE, 0);
            }
        }
    }