Previous 15994 Revisions Next

r3384 Saturday 4th October, 2008 at 19:19:50 UTC by Wilbert Pol
[IBM5150] Fixed memory dips.
[src/mess/machine]pc.c

src/mess/machine/pc.c
r3383r3384
603603 *                         1 = clear and disable shift register and clear IRQ1 flip flop
604604 *
605605 * PORT C
606 * 0 - PC0 -         - Dipswitch 0/4
607 * 1 - PC1 -         - Dipswitch 1/5
608 * 2 - PC2 -         - Dipswitch 2/6
609 * 3 - PC3 -         - Dipswitch 3/7
606 * 0 - PC0 -         - Dipswitch 0/4 SW1
607 * 1 - PC1 -         - Dipswitch 1/5 SW1
608 * 2 - PC2 -         - Dipswitch 2/6 SW1
609 * 3 - PC3 -         - Dipswitch 3/7 SW1
610610 * 4 - PC4 - SPK     - Speaker/cassette data
611611 * 5 - PC5 - I/OCHCK - Expansion I/O check result
612612 * 6 - PC6 - T/C2OUT - Output of 8253 timer 2
613613 * 7 - PC7 - PCK     - Parity check result
614614 *
615 * IBM5150 SW1:
616 * 0   - OFF - One or more floppy drives
617 *       ON  - Diskless operation
618 * 1   - OFF - 8087 present
619 *       ON  - No 8087 present
620 * 2+3 - Used to determine on board memory configuration
621 *       OFF OFF - 64KB
622 *       ON  OFF - 48KB
623 *       OFF ON  - 32KB
624 *       ON  ON  - 16KB
625 * 4+5 - Used to select display
626 *       OFF OFF - Monochrome
627 *       ON  OFF - CGA, 80 column
628 *       OFF ON  - CGA, 40 column
629 *       ON  ON  - EGA/VGA display
630 * 6+7 - Used to select number of disk drives
631 *       OFF OFF - four disk drives
632 *       ON  OFF - three disk drives
633 *       OFF ON  - two disk drives
634 *       ON  ON  - one disk drive
635 *
615636 **********************************************************/
616637
617638static struct {
r3383r3384
645666       *      01 - color 40x25
646667       * 6-7  The number of floppy disk drives
647668       */
648      data = input_port_read(device->machine, "DSW0");
669      data = input_port_read(device->machine, "DSW0") & 0xF3;
670      switch ( mess_ram_size )
671      {
672      case 16 * 1024:
673         data |= 0x00;
674         break;
675      case 32 * 1024:   /* Need to verify if this is correct */
676         data |= 0x04;
677         break;
678      case 48 * 1024:   /* Need to verify if this is correct */
679         data |= 0x08;
680         break;
681      default:
682         data |= 0x0C;
683         break;
684      }
649685   }
650686   else
651687   {
r3383r3384
676712   /* KB port C: equipment flags */
677713   if (pc_ppi.portc_switch_high)
678714   {
679      /* read hi nibble of S2 */
680      data = (data & 0xf0) | ((input_port_read(device->machine, "DSW0") >> 4) & 0x0f);
715      /* read hi nibble of SW2 */
716      data = data & 0xf0;
717
718      switch ( mess_ram_size )
719      {
720      case 64 * 1024:      data |= 0x00; break;
721      case 128 * 1024:   data |= 0x02; break;
722      case 192 * 1024:   data |= 0x04; break;
723      case 256 * 1024:   data |= 0x06; break;
724      case 320 * 1024:   data |= 0x08; break;
725      case 384 * 1024:   data |= 0x0A; break;
726      case 448 * 1024:   data |= 0x0C; break;
727      case 512 * 1024:   data |= 0x0E; break;
728      case 576 * 1024:   data |= 0x01; break;
729      case 640 * 1024:   data |= 0x03; break;
730      case 704 * 1024:   data |= 0x05; break;
731      case 768 * 1024:   data |= 0x07; break;
732      case 832 * 1024:   data |= 0x09; break;
733      case 896 * 1024:   data |= 0x0B; break;
734      case 960 * 1024:   data |= 0x0D; break;
735      }
736      if ( mess_ram_size > 960 * 1024 )
737         data |= 0x0D;
738     
681739      PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
682740   }
683741   else
r3383r3384
13191377INTERRUPT_GEN( pc_frame_interrupt )
13201378{
13211379   pc_keyboard();
1322
1323   /* Extermely crappy hack to have let the ibm5150 support 640kb. For testing purposes only. */
1324//   if ( mess_ram[0x413] == 0x00 && mess_ram[0x414] == 0x01 )
1325//   {
1326//      mess_ram[0x413] = 640 & 0xff;
1327//      mess_ram[0x414] = 640 >> 8;
1328//   }
1329
13301380}
13311381
13321382INTERRUPT_GEN( pc_vga_frame_interrupt )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team