static void Pixel(osd_bitmap bitmap, int x, int y, int spr_number, int color) {
        int xr, yr, spr_y1, spr_y2;
        int SprOnScreen;

        if (x < Machine.drv.visible_area.min_x
                || x > Machine.drv.visible_area.max_x
                || y < Machine.drv.visible_area.min_y
                || y > Machine.drv.visible_area.max_y) {
            return;
        }

        if (SpritesCollisionTable[256 * y + x] == 255) {
            SpritesCollisionTable[256 * y + x] = (char) spr_number;
            plot_pixel.handler(bitmap, x, y, color);
        } else {
            SprOnScreen = SpritesCollisionTable[256 * y + x];
            system1_sprites_collisionram.write(SprOnScreen + 32 * spr_number, 0xff);
            if (system1_pixel_mode == system1_SPRITE_PIXEL_MODE1) {
                spr_y1 = GetSpriteBottomY.handler(spr_number);
                spr_y2 = GetSpriteBottomY.handler(SprOnScreen);
                if (spr_y1 >= spr_y2) {
                    plot_pixel.handler(bitmap, x, y, color);
                    SpritesCollisionTable[256 * y + x] = (char) spr_number;
                }
            } else {
                plot_pixel.handler(bitmap, x, y, color);
                SpritesCollisionTable[256 * y + x] = (char) spr_number;
            }
        }

        xr = ((x - background_scrollx) & 0xff) / 8;
        yr = ((y - background_scrolly) & 0xff) / 8;

        /* TODO: bits 5 and 6 of backgroundram are also used (e.g. Pitfall2, Mr. Viking) */
        /* what's the difference? Bit 7 is used in Choplifter/WBML for extra char bank */
        /* selection, but it is also set in Pitfall2 */
        if (system1_background_memory == system1_BACKGROUND_MEMORY_SINGLE) {
            if ((system1_backgroundram.read(2 * (32 * yr + xr) + 1) & 0x10) != 0) {
                system1_background_collisionram.write(0x20 + spr_number, 0xff);
            }
        } else {
            /* TODO: I should handle the paged background memory here. */
            /* maybe collision detection is not used by the paged games */
            /* (wbml and tokisens), though tokisens doesn't play very well */
            /* (you can't seem to fit in gaps where you should fit) */
        }

        /* TODO: collision should probably be checked with the foreground as well */
        /* (TeddyBoy Blues, head of the tiger in girl bonus round) */
    }