Subversion Repositories pentevo

Rev

Rev 798 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 798 Rev 800
Line 11... Line 11...
11
#include "sound.h"
11
#include "sound.h"
12
#include "gs.h"
12
#include "gs.h"
13
#include "sdcard.h"
13
#include "sdcard.h"
14
#include "zc.h"
14
#include "zc.h"
15
#include "tape.h"
15
#include "tape.h"
-
 
16
#include "upd765.h"
16
 
17
 
17
void out(unsigned port, unsigned char val)
18
void out(unsigned port, unsigned char val)
18
{
19
{
19
   port &= 0xFFFF;
20
   port &= 0xFFFF;
20
   u8 p1 = (port & 0xFF);
21
   u8 p1 = (port & 0xFF);
Line 354... Line 355...
354
      }
355
      }
355
      // don't return - out to port #FE works in trdos!
356
      // don't return - out to port #FE works in trdos!
356
   }
357
   }
357
   else // эх dos
358
   else // эх dos
358
   {
359
   {
-
 
360
       if((p1 == 0x3F) && (conf.sound.ay_scheme == AY_SCHEME_FULLER)) // fuller AY register select
-
 
361
       {
-
 
362
           ay[0].select(val);
-
 
363
           return;
-
 
364
       }
-
 
365
       if((p1 == 0x5F) && (conf.sound.ay_scheme == AY_SCHEME_FULLER)) // fuller AY data
-
 
366
       {
-
 
367
           ay[0].write(temp.sndblock ? 0 : cpu.t, val);
-
 
368
           return;
-
 
369
       }
-
 
370
 
359
         if(((port & 0xA3) == 0xA3) && (conf.ide_scheme == IDE_DIVIDE))
371
         if(((port & 0xA3) == 0xA3) && (conf.ide_scheme == IDE_DIVIDE))
360
         {
372
         {
361
             if((port & 0xFF) == 0xA3)
373
             if((port & 0xFF) == 0xA3)
362
             {
374
             {
363
                 comp.ide_hi_byte_w ^= 1;
375
                 comp.ide_hi_byte_w ^= 1;
Line 422... Line 434...
422
 
434
 
423
   // port #FE
435
   // port #FE
424
   bool pFE;
436
   bool pFE;
425
 
437
 
426
   // scorp  xx1xxx10 /dos=1 (sc16 green)
438
   // scorp  xx1xxx10 /dos=1 (sc16 green)
427
   if((conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP) && !(comp.flags & CF_DOSPORTS))
439
   if((conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP))
428
       pFE = ((port & 0x23) == (0xFE & 0x23));
440
       pFE = ((port & 0x23) == (0xFE & 0x23)) && !(comp.flags & CF_DOSPORTS);
429
   else if(conf.mem_model == MM_QUORUM) // 1xx11xx0
441
   else if(conf.mem_model == MM_QUORUM) // 1xx11xx0
430
       pFE = ((port & 0x99) == (0xFE & 0x99));
442
       pFE = ((port & 0x99) == (0xFE & 0x99));
431
   else // others xxxxxxx0
443
   else // others xxxxxxx0
432
       pFE = !(port & 1);
444
       pFE = !(port & 1);
433
 
445
 
Line 480... Line 492...
480
         return;
492
         return;
481
      }
493
      }
482
 
494
 
483
      if (!(port & 0x8000)) // zx128 port
495
      if (!(port & 0x8000)) // zx128 port
484
      {
496
      {
485
         // 0001xxxxxxxxxx0x (bcig4)
497
         // 0001xxxxxxxxxx0x (bcig4) // 1FFD
-
 
498
         // 0010xxxxxxxxxx0x (bcig4) // 2FFD
-
 
499
         // 0011xxxxxxxxxx0x (bcig4) // 3FFD
486
         if ((port & 0xF002) == (0x1FFD & 0xF002) && conf.mem_model == MM_PLUS3)
500
          if((port & (3 << 14)) == 0 && conf.mem_model == MM_PLUS3)
-
 
501
          {
-
 
502
              unsigned Idx = (port >> 12) & 3;
-
 
503
              switch(Idx)
-
 
504
              {
-
 
505
              case 1: // 1FFD
487
             goto set1FFD;
506
                  goto set1FFD;
-
 
507
              case 3: // 3FFD
-
 
508
                  Upd765.out(val);
-
 
509
                  return;
-
 
510
              }
-
 
511
          }
488
 
512
 
489
         if ((port & 0xC003) == (0x1FFD & 0xC003) && conf.mem_model == MM_KAY)
513
         if ((port & 0xC003) == (0x1FFD & 0xC003) && conf.mem_model == MM_KAY)
490
             goto set1FFD;
514
             goto set1FFD;
491
 
515
 
492
         // 00xxxxxxxx1xxx01 (sc16 green)
516
         // 00xxxxxxxx1xxx01 (sc16 green)
Line 563... Line 587...
563
          comp.p80FD = val;
587
          comp.p80FD = val;
564
          set_banks();
588
          set_banks();
565
          return;
589
          return;
566
      }
590
      }
567
 
591
 
568
      if ((port & 0xC0FF) == 0xC0FD)
592
      if ((port & 0xC0FF) == 0xC0FD && conf.sound.ay_scheme >= AY_SCHEME_SINGLE)
569
      { // A15=A14=1, FxFD - AY select register
593
      { // A15=A14=1, FxFD - AY select register
570
         if ((conf.sound.ay_scheme == AY_SCHEME_CHRV) && ((val & 0xF8) == 0xF8)) //Alone Coder
594
         if ((conf.sound.ay_scheme == AY_SCHEME_CHRV) && ((val & 0xF8) == 0xF8)) //Alone Coder
571
         {
595
         {
572
             if (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203))
596
             if (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203))
573
             {
597
             {
Line 579... Line 603...
579
         unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay;
603
         unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay;
580
         ay[n_ay].select(val);
604
         ay[n_ay].select(val);
581
         return;
605
         return;
582
      }
606
      }
583
 
607
 
584
      if ((port & 0xC000)==0x8000 && conf.sound.ay_scheme)
608
      if ((port & 0xC000)==0x8000 && conf.sound.ay_scheme >= AY_SCHEME_SINGLE)
585
      {  // BFFD - AY data register
609
      {  // BFFD - AY data register
586
         unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay;
610
         unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay;
587
         ay[n_ay].write(temp.sndblock? 0 : cpu.t, val);
611
         ay[n_ay].write(temp.sndblock? 0 : cpu.t, val);
588
         if (conf.input.mouse == 2 && ay[n_ay].get_activereg() == 14)
612
         if (conf.input.mouse == 2 && ay[n_ay].get_activereg() == 14)
589
             input.aymouse_wr(val);
613
             input.aymouse_wr(val);
Line 961... Line 985...
961
 
985
 
962
   // port #FE
986
   // port #FE
963
   bool pFE;
987
   bool pFE;
964
 
988
 
965
   // scorp  xx1xxx10 (sc16)
989
   // scorp  xx1xxx10 (sc16)
966
   if((conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP) && !(comp.flags & CF_DOSPORTS))
990
   if((conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP))
967
       pFE = ((port & 0x23) == (0xFE & 0x23));
991
       pFE = ((port & 0x23) == (0xFE & 0x23)) && !(comp.flags & CF_DOSPORTS);
968
   else if(conf.mem_model == MM_QUORUM) // 1xx11xx0
992
   else if(conf.mem_model == MM_QUORUM) // 1xx11xx0
969
       pFE = ((port & 0x99) == (0xFE & 0x99));
993
       pFE = ((port & 0x99) == (0xFE & 0x99));
970
   else // others xxxxxxx0
994
   else // others xxxxxxx0
971
       pFE = !(port & 1);
995
       pFE = !(port & 1);
972
 
996
 
Line 985... Line 1009...
985
      unsigned char irq = 0x40;
1009
      unsigned char irq = 0x40;
986
      if (conf.ide_scheme == IDE_ATM) irq = (hdd.read_intrq() & 0x40);
1010
      if (conf.ide_scheme == IDE_ATM) irq = (hdd.read_intrq() & 0x40);
987
      return irq + 0x3F;
1011
      return irq + 0x3F;
988
   }
1012
   }
989
 
1013
 
-
 
1014
   // 0001xxxxxxxxxx0x (bcig4) // 1FFD
-
 
1015
   // 0010xxxxxxxxxx0x (bcig4) // 2FFD
-
 
1016
   // 0011xxxxxxxxxx0x (bcig4) // 3FFD
-
 
1017
   if((port & ((3 << 14) | 2)) == 0 && conf.mem_model == MM_PLUS3)
-
 
1018
   {
-
 
1019
       unsigned Idx = (port >> 12) & 3;
-
 
1020
       switch(Idx)
-
 
1021
       {
-
 
1022
       case 2: // 2FFD
-
 
1023
           return Upd765.in(Idx);
-
 
1024
       case 3: // 3FFD
-
 
1025
           return Upd765.in(Idx);
-
 
1026
       }
-
 
1027
   }
-
 
1028
 
990
   if ((unsigned char)port == 0xFD && conf.sound.ay_scheme)
1029
   if ((unsigned char)port == 0xFD && conf.sound.ay_scheme >= AY_SCHEME_SINGLE)
991
   {
1030
   {
992
      if((conf.sound.ay_scheme == AY_SCHEME_CHRV) && (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203)) && (tfmstatuson0 == 0))
1031
      if((conf.sound.ay_scheme == AY_SCHEME_CHRV) && (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203)) && (tfmstatuson0 == 0))
993
          return 0x7f /*always ready*/; //Alone Coder 0.36.6
1032
          return 0x7f /*always ready*/; //Alone Coder 0.36.6
994
      if ((port & 0xC0FF) != 0xC0FD) return 0xFF;
1033
      if ((port & 0xC0FF) != 0xC0FD) return 0xFF;
995
      unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay;
1034
      unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay;