Diff for /np2/bios/bios18.c between versions 1.41 and 1.45

version 1.41, 2005/03/16 09:33:53 version 1.45, 2007/11/11 13:54:14
Line 107  const CRTDATA *crt; Line 107  const CRTDATA *crt;
         gdc.mode1 &= ~(0x2d);          gdc.mode1 &= ~(0x2d);
         mem[MEMB_CRT_STS_FLAG] = mode;          mem[MEMB_CRT_STS_FLAG] = mode;
         crt = crtdata;          crt = crtdata;
         if (!(np2cfg.dipsw[0] & 1)) {          if (!(pccore.dipsw[0] & 1)) {
                 mem[MEMB_CRT_STS_FLAG] |= 0x80;                  mem[MEMB_CRT_STS_FLAG] |= 0x80;
                 gdc.mode1 |= 0x08;                  gdc.mode1 |= 0x08;
                 crt += 2;                  crt += 2;
Line 137  void bios0x18_0c(void) { Line 137  void bios0x18_0c(void) {
   
         if (!(gdcs.textdisp & GDCSCRN_ENABLE)) {          if (!(gdcs.textdisp & GDCSCRN_ENABLE)) {
                 gdcs.textdisp |= GDCSCRN_ENABLE;                  gdcs.textdisp |= GDCSCRN_ENABLE;
                 screenupdate |= 2;                  pcstat.screenupdate |= 2;
         }          }
 }  }
   
Line 173  static void bios0x18_0f(UINT seg, UINT o Line 173  static void bios0x18_0f(UINT seg, UINT o
 #endif  #endif
   
         while((cnt--) && (p < (gdc.m.para + GDC_SCROLL + 0x10))) {          while((cnt--) && (p < (gdc.m.para + GDC_SCROLL + 0x10))) {
                 t = MEML_READ16(seg, off);                  t = MEMR_READ16(seg, off);
                 t >>= 1;                  t >>= 1;
                 STOREINTELWORD(p, t);                  STOREINTELWORD(p, t);
                 t = MEML_READ16(seg, off + 2);                  t = MEMR_READ16(seg, off + 2);
                 t *= raster;                  t *= raster;
                 STOREINTELWORD(p + 2, t);                  STOREINTELWORD(p + 2, t);
                 off += 4;                  off += 4;
                 p += 4;                  p += 4;
         }          }
         gdcs.textdisp |= GDCSCRN_ALLDRAW2;          gdcs.textdisp |= GDCSCRN_ALLDRAW2;
         screenupdate |= 2;          pcstat.screenupdate |= 2;
 }  }
   
 void bios0x18_10(REG8 curdel) {  void bios0x18_10(REG8 curdel) {
Line 214  const UINT8 *p; Line 214  const UINT8 *p;
         switch(code >> 8) {          switch(code >> 8) {
                 case 0x00:                      // 8x8                  case 0x00:                      // 8x8
                         size = 0x0101;                          size = 0x0101;
                         MEML_WRITE16(seg, off, 0x0101);                          MEMR_WRITE16(seg, off, 0x0101);
                         p = fontrom + 0x82000 + ((code & 0xff) << 4);                          p = fontrom + 0x82000 + ((code & 0xff) << 4);
                         MEML_WRITESTR(seg, off + 2, p, 8);                          MEMR_WRITES(seg, off + 2, p, 8);
                         break;                          break;
   
 //              case 0x28:  //              case 0x28:
Line 224  const UINT8 *p; Line 224  const UINT8 *p;
                 case 0x2a:                  case 0x2a:
                 case 0x2b:                  case 0x2b:
                         size = 0x0102;                          size = 0x0102;
                         MEML_WRITE16(seg, off, 0x0102);                          MEMR_WRITE16(seg, off, 0x0102);
                         p = fontrom;                          p = fontrom;
                         p += (code & 0x7f) << 12;                          p += (code & 0x7f) << 12;
                         p += (((code >> 8) - 0x20) & 0x7f) << 4;                          p += (((code >> 8) - 0x20) & 0x7f) << 4;
                         MEML_WRITESTR(seg, off + 2, p, 16);                          MEMR_WRITES(seg, off + 2, p, 16);
                         break;                          break;
   
                 case 0x80:                      // 8x16 ANK                  case 0x80:                      // 8x16 ANK
                         size = 0x0102;                          size = 0x0102;
                         p = fontrom + 0x80000 + ((code & 0xff) << 4);                          p = fontrom + 0x80000 + ((code & 0xff) << 4);
                         MEML_WRITESTR(seg, off + 2, p, 16);                          MEMR_WRITES(seg, off + 2, p, 16);
                         break;                          break;
   
                 default:                  default:
Line 246  const UINT8 *p; Line 246  const UINT8 *p;
                                 buf[i*2+0] = *p;                                  buf[i*2+0] = *p;
                                 buf[i*2+1] = *(p+0x800);                                  buf[i*2+1] = *(p+0x800);
                         }                          }
                         MEML_WRITESTR(seg, off + 2, buf, 32);                          MEMR_WRITES(seg, off + 2, buf, 32);
                         break;                          break;
         }          }
         MEML_WRITE16(seg, off, size);          MEMR_WRITE16(seg, off, size);
         return(size);          return(size);
 }  }
   
Line 260  static void bios0x18_1a(REG16 seg, REG16 Line 260  static void bios0x18_1a(REG16 seg, REG16
         UINT    i;          UINT    i;
   
         if (((code >> 8) & 0x7e) == 0x76) {          if (((code >> 8) & 0x7e) == 0x76) {
                 MEML_READSTR(seg, off + 2, buf, 32);                  MEMR_READS(seg, off + 2, buf, 32);
                 p = fontrom;                  p = fontrom;
                 p += (code & 0x7f) << 12;                  p += (code & 0x7f) << 12;
                 p += (((code >> 8) - 0x20) & 0x7f) << 4;                  p += (((code >> 8) - 0x20) & 0x7f) << 4;
Line 397  const CRTDATA *p; Line 397  const CRTDATA *p;
         gdcs.textdisp &= ~GDCSCRN_ENABLE;          gdcs.textdisp &= ~GDCSCRN_ENABLE;
         gdcs.textdisp |= GDCSCRN_EXT | GDCSCRN_ALLDRAW2;          gdcs.textdisp |= GDCSCRN_EXT | GDCSCRN_ALLDRAW2;
         gdcs.grphdisp |= GDCSCRN_EXT | GDCSCRN_ALLDRAW2;          gdcs.grphdisp |= GDCSCRN_EXT | GDCSCRN_ALLDRAW2;
         screenupdate |= 2;          pcstat.screenupdate |= 2;
   
         mem[0x597] &= ~3;          mem[0x597] &= ~3;
         mem[0x597] |= (scrn >> 4) & 3;          mem[0x597] |= (scrn >> 4) & 3;
Line 442  void bios0x18_40(void) { Line 442  void bios0x18_40(void) {
         gdc_forceready(GDCWORK_SLAVE);          gdc_forceready(GDCWORK_SLAVE);
         if (!(gdcs.grphdisp & GDCSCRN_ENABLE)) {          if (!(gdcs.grphdisp & GDCSCRN_ENABLE)) {
                 gdcs.grphdisp |= GDCSCRN_ENABLE;                  gdcs.grphdisp |= GDCSCRN_ENABLE;
                 screenupdate |= 2;                  pcstat.screenupdate |= 2;
         }          }
         mem[MEMB_PRXCRT] |= 0x80;          mem[MEMB_PRXCRT] |= 0x80;
 }  }
Line 452  void bios0x18_41(void) { Line 452  void bios0x18_41(void) {
         gdc_forceready(GDCWORK_SLAVE);          gdc_forceready(GDCWORK_SLAVE);
         if (gdcs.grphdisp & GDCSCRN_ENABLE) {          if (gdcs.grphdisp & GDCSCRN_ENABLE) {
                 gdcs.grphdisp &= ~(GDCSCRN_ENABLE);                  gdcs.grphdisp &= ~(GDCSCRN_ENABLE);
                 screenupdate |= 2;                  pcstat.screenupdate |= 2;
         }          }
         mem[MEMB_PRXCRT] &= 0x7f;          mem[MEMB_PRXCRT] &= 0x7f;
 }  }
Line 537  void bios0x18_42(REG8 mode) { Line 537  void bios0x18_42(REG8 mode) {
         }          }
         gdcs.mode2 = gdc.mode2;          gdcs.mode2 = gdc.mode2;
         gdcs.grphdisp |= GDCSCRN_ALLDRAW2;          gdcs.grphdisp |= GDCSCRN_ALLDRAW2;
         screenupdate |= 2;          pcstat.screenupdate |= 2;
 }  }
   
 static void setbiosgdc(UINT32 csrw, const GDCVECT *vect, UINT8 ope) {  static void setbiosgdc(UINT32 csrw, const GDCVECT *vect, UINT8 ope) {
Line 572  static void bios0x18_47(void) { Line 572  static void bios0x18_47(void) {
         SINT16          dy;          SINT16          dy;
   
         gdc_forceready(GDCWORK_SLAVE);          gdc_forceready(GDCWORK_SLAVE);
         MEML_READSTR(CPU_DS, CPU_BX, &ucw, sizeof(ucw));          MEMR_READS(CPU_DS, CPU_BX, &ucw, sizeof(ucw));
         GBSX1 = LOADINTELWORD(ucw.GBSX1);          GBSX1 = LOADINTELWORD(ucw.GBSX1);
         GBSY1 = LOADINTELWORD(ucw.GBSY1);          GBSY1 = LOADINTELWORD(ucw.GBSY1);
         GBSX2 = LOADINTELWORD(ucw.GBSX2);          GBSX2 = LOADINTELWORD(ucw.GBSX2);
Line 684  static void bios0x18_49(void) { Line 684  static void bios0x18_49(void) {
   
         gdc_forceready(GDCWORK_SLAVE);          gdc_forceready(GDCWORK_SLAVE);
   
         MEML_READSTR(CPU_DS, CPU_BX, &ucw, sizeof(ucw));          MEMR_READS(CPU_DS, CPU_BX, &ucw, sizeof(ucw));
         for (i=0; i<8; i++) {          for (i=0; i<8; i++) {
                 mem[MEMW_PRXGLS + i] = ucw.GBMDOTI[i];                  mem[MEMW_PRXGLS + i] = ucw.GBMDOTI[i];
                 pat[i] = GDCPATREVERSE(ucw.GBMDOTI[i]);                  pat[i] = GDCPATREVERSE(ucw.GBMDOTI[i]);
Line 766  void bios0x18(void) { Line 766  void bios0x18(void) {
         }               tmp;          }               tmp;
         int             i;          int             i;
   
 #if 1  #if 0
         TRACEOUT(("int18 AX=%.4x %.4x:%.4x", CPU_AX,          TRACEOUT(("int18 AX=%.4x %.4x:%.4x", CPU_AX,
                                                         MEML_READ16(CPU_SS, CPU_SP+2),                                                          MEMR_READ16(CPU_SS, CPU_SP+2),
                                                         MEML_READ16(CPU_SS, CPU_SP)));                                                          MEMR_READ16(CPU_SS, CPU_SP)));
 #endif  #endif
   
         switch(CPU_AH) {          switch(CPU_AH) {
Line 832  void bios0x18(void) { Line 832  void bios0x18(void) {
                 case 0x0d:                                              // テキスト画面の表示終了                  case 0x0d:                                              // テキスト画面の表示終了
                         if (gdcs.textdisp & GDCSCRN_ENABLE) {                          if (gdcs.textdisp & GDCSCRN_ENABLE) {
                                 gdcs.textdisp &= ~(GDCSCRN_ENABLE);                                  gdcs.textdisp &= ~(GDCSCRN_ENABLE);
                                 screenupdate |= 2;                                  pcstat.screenupdate |= 2;
                         }                          }
                         break;                          break;
   
Line 849  void bios0x18(void) { Line 849  void bios0x18(void) {
                         SETBIOSMEM16(MEMW_CRT_W_RASTER, tmp.w);                          SETBIOSMEM16(MEMW_CRT_W_RASTER, tmp.w);
                         STOREINTELWORD(gdc.m.para + GDC_SCROLL + 2, tmp.w);                          STOREINTELWORD(gdc.m.para + GDC_SCROLL + 2, tmp.w);
                         gdcs.textdisp |= GDCSCRN_ALLDRAW2;                          gdcs.textdisp |= GDCSCRN_ALLDRAW2;
 //                      screenupdate |= 2;  //                      pcstat.screenupdate |= 2;
                         break;                          break;
   
                 case 0x0f:                                              // 複数の表示領域の設定                  case 0x0f:                                              // 複数の表示領域の設定
Line 966  void bios0x18(void) { Line 966  void bios0x18(void) {
                         break;                          break;
   
                 case 0x43:                                              // パレットの設定                  case 0x43:                                              // パレットの設定
                         MEML_READSTR(CPU_DS, CPU_BX + offsetof(UCWTBL, GBCPC),                          MEMR_READS(CPU_DS, CPU_BX + offsetof(UCWTBL, GBCPC), tmp.col, 4);
                                                                                                                                 tmp.col, 4);  
                         for (i=0; i<4; i++) {                          for (i=0; i<4; i++) {
                                 gdc_setdegitalpal(6 - (i*2), (REG8)(tmp.col[i] >> 4));                                  gdc_setdegitalpal(6 - (i*2), (REG8)(tmp.col[i] >> 4));
                                 gdc_setdegitalpal(7 - (i*2), (REG8)(tmp.col[i] & 15));                                  gdc_setdegitalpal(7 - (i*2), (REG8)(tmp.col[i] & 15));
Line 976  void bios0x18(void) { Line 975  void bios0x18(void) {
   
                 case 0x44:                                              // ボーダカラーの設定                  case 0x44:                                              // ボーダカラーの設定
 //                      if (!(mem[MEMB_PRXCRT] & 0x40)) {  //                      if (!(mem[MEMB_PRXCRT] & 0x40)) {
 //                              color = MEML_READ8(CPU_DS, CPU_BX + 1);  //                              color = MEMR_READ8(CPU_DS, CPU_BX + 1);
 //                      }  //                      }
                         break;                          break;
   

Removed from v.1.41  
changed lines
  Added in v.1.45


RetroPC.NET-CVS <cvs@retropc.net>