Пример #1
0
void keyboard_pcjr_write(uint16_t port, uint8_t val, void *priv)
{
//        pclog("keyboard_pcjr : write %04X %02X %02X\n", port, val, keyboard_pcjr.pb);
/*        if (ram[8] == 0xc3) 
        {
                output = 3;
        }*/
        switch (port)
        {
                case 0x60:
                keyboard_pcjr.pa = val;
                break;
                
                case 0x61:
                keyboard_pcjr.pb = val;

                timer_process();
                timer_update_outstanding();

                speaker_update();
                speaker_gated = val & 1;
                speaker_enable = val & 2;
                if (speaker_enable) 
                        was_speaker_enable = 1;
                pit_set_gate(2, val & 1);
                sn76489_mute = speaker_mute = 1;
                switch (val & 0x60)
                {
                        case 0x00:
                        speaker_mute = 0;
                        break;
                        case 0x60:
                        sn76489_mute = 0;
                        break;
                }
                break;
                
                case 0xa0:
                nmi_mask = val & 0x80;
                pit_set_using_timer(1, !(val & 0x20));
                break;
        }
}
Пример #2
0
void keyboard_pcjr_write(uint16_t port, uint8_t val, void *priv)
{
        switch (port)
        {
                case 0x60:
                keyboard_pcjr.pa = val;
                break;
                
                case 0x61:
                keyboard_pcjr.pb = val;

                timer_process();
                timer_update_outstanding();

		speaker_update();
                speaker_gated = val & 1;
                speaker_enable = val & 2;
                if (speaker_enable) 
                        was_speaker_enable = 1;
                pit_set_gate(&pit, 2, val & 1);
                sn76489_mute = speaker_mute = 1;
                switch (val & 0x60)
                {
                        case 0x00:
                        speaker_mute = 0;
                        break;
                        case 0x60:
                        sn76489_mute = 0;
                        break;
                }
                break;
                
                case 0xa0:
                nmi_mask = val & 0x80;
                pit_set_using_timer(&pit, 1, !(val & 0x20));
                break;
        }
}