public void handler(int offset, int data) {

            if (death_playing != 0) {
                death_playing = sample_playing(CHANNEL_EXPLOSION);
            }

            if (bosskill_playing != 0) {
                bosskill_playing = sample_playing(CHANNEL_EXPLOSION);
            }

            /* Bit 2 - Explosion trigger */
            if ((data & 0x04) != 0 && (last_a & 0x04) == 0) {
                /* I *know* that the effect select port will be written shortly
                 after this one, so this works */
                start_explosion = 1;
            }

            /* Bit 0/1/3 - Background noise */
            if ((data & 0x08) != (last_a & 0x08)) {
                if ((data & 0x08) != 0) {
                    int sample = SAMPLE_WAVE + (data & 3);
                    sample_start(CHANNEL_WAVE, sample, 1);
                } else {
                    sample_stop(CHANNEL_WAVE);
                }
            }

            /* Bit 4 - Boss Laser */
            if ((data & 0x10) != 0 && (last_a & 0x10) == 0) {
                if (bosskill_playing == 0) {
                    sample_start(CHANNEL_BOSSFIRE, SAMPLE_BOSSFIRE, 0);
                }
            }

            /* Bit 5 - Fire */
            if ((data & 0x20) != 0 && (last_a & 0x20) == 0) {
                if (bosskill_playing == 0) {
                    sample_start(CHANNEL_FIRE, SAMPLE_FIRE, 0);
                }
            }

            /* Bit 6 - Don't know. Probably something to do with the explosion sounds */
            /* Bit 7 - Don't know. Maybe a global sound enable bit? */
            last_a = data;
        }