public void handler(osd_bitmap bitmap, int full_refresh) {
            int priority;

            for (priority = 0; priority < 16; priority++) {
                sprite_priority[0][priority] = 0;
                /* Clear priorities used list */
                sprite_priority[1][priority] = 0;
                /* Clear priorities used list */
            }

            tilemap_update(ALL_TILEMAPS);

            palette_init_used_colors();
            mark_sprite_colors(0);
            /* Also mark priorities used */
            mark_sprite_colors(1);
            /* Also mark priorities used */

            if (palette_recalc() != null) {
                tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);
            }

            tilemap_render(ALL_TILEMAPS);

            fillbitmap(bitmap, palette_transparent_pen, Machine.drv.visible_area);

            for (priority = 0; priority < 16; priority++) {
                tilemap_draw(bitmap, bg_tilemap[1], priority);
                tilemap_draw(bitmap, fg_tilemap[1], priority);
                tilemap_draw(bitmap, top_tilemap[1], priority);
                if (sprite_priority[1][priority] != 0) {
                    draw_sprites(bitmap, 1, priority);
                }
            }
            for (priority = 0; priority < 16; priority++) {
                tilemap_draw(bitmap, bg_tilemap[0], priority);
                tilemap_draw(bitmap, fg_tilemap[0], priority);
                tilemap_draw(bitmap, top_tilemap[0], priority);
                if (sprite_priority[0][priority] != 0) {
                    draw_sprites(bitmap, 0, priority);
                }
            }
        }