Diff for /np2/bios/bios18.c between versions 1.30 and 1.34

version 1.30, 2004/03/04 15:20:13 version 1.34, 2004/04/06 18:41:00
Line 8 Line 8
 #include        "font.h"  #include        "font.h"
   
   
 static  int             sti_waiting = 0;  
   
 typedef struct {  typedef struct {
         BYTE    GBON_PTN;          BYTE    GBON_PTN;
         BYTE    GBBCC;          BYTE    GBBCC;
Line 41  typedef struct { Line 39  typedef struct {
 static const UINT8 modenum[4] = {3, 1, 0, 2};  static const UINT8 modenum[4] = {3, 1, 0, 2};
   
 static const CRTDATA crtdata[7] = {  static const CRTDATA crtdata[7] = {
                                                 {0x07,  0x00, 0x07, 0x08},              // 200-20                                                  {0x09,  0x1f, 0x08, 0x08},              // 200-20
                                                 {0x09,  0x1f, 0x08, 0x08},              // 200-25                                                  {0x07,  0x00, 0x07, 0x08},              // 200-25
                                                 {0x0f,  0x00, 0x0f, 0x10},              // 400-20                                                  {0x13,  0x1e, 0x11, 0x10},              // 400-20
                                                 {0x13,  0x1e, 0x11, 0x10},              // 400-25                                                  {0x0f,  0x00, 0x0f, 0x10},              // 400-25
                                                 {0x17,  0x1c, 0x13, 0x10},              // 480-20                                                  {0x17,  0x1c, 0x13, 0x10},              // 480-20
                                                 {0x12,  0x1f, 0x11, 0x10},              // 480-25                                                  {0x12,  0x1f, 0x11, 0x10},              // 480-25
                                                 {0x0f,  0x00, 0x0f, 0x10}};             // 480-30                                                  {0x0f,  0x00, 0x0f, 0x10}};             // 480-30
Line 114  const CRTDATA *crt; Line 112  const CRTDATA *crt;
                 gdc.mode1 |= 0x08;                  gdc.mode1 |= 0x08;
                 crt += 2;                  crt += 2;
         }          }
         if (mode & 0x01) {          if (!(mode & 0x01)) {
                 crt += 1;                                               // 20行                  crt += 1;                                               // 25行
         }          }
         if (mode & 0x02) {          if (mode & 0x02) {
                 gdc.mode1 |= 0x04;                              // 40桁                  gdc.mode1 |= 0x04;                              // 40桁
Line 135  const CRTDATA *crt; Line 133  const CRTDATA *crt;
         bios0x18_10(0);          bios0x18_10(0);
 }  }
   
   void bios0x18_0c(void) {
   
           if (!(gdcs.textdisp & GDCSCRN_ENABLE)) {
                   gdcs.textdisp |= GDCSCRN_ENABLE;
                   screenupdate |= 2;
           }
   }
   
 static void bios0x18_0f(UINT seg, UINT off, REG8 num, REG8 cnt) {  static void bios0x18_0f(UINT seg, UINT off, REG8 num, REG8 cnt) {
   
         BYTE    *p;          BYTE    *p;
Line 167  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 = i286_memword_read(seg, off);                  t = MEML_READ16(seg, off);
                 t >>= 1;                  t >>= 1;
                 STOREINTELWORD(p, t);                  STOREINTELWORD(p, t);
                 t = i286_memword_read(seg, off + 2);                  t = MEML_READ16(seg, off + 2);
                 t *= raster;                  t *= raster;
                 STOREINTELWORD(p + 2, t);                  STOREINTELWORD(p + 2, t);
                 off += 4;                  off += 4;
Line 208  const BYTE *p; Line 214  const BYTE *p;
         switch(code >> 8) {          switch(code >> 8) {
                 case 0x00:                      // 8x8                  case 0x00:                      // 8x8
                         size = 0x0101;                          size = 0x0101;
                         i286_memword_write(seg, off, 0x0101);                          MEML_WRITE16(seg, off, 0x0101);
                         p = fontrom + 0x82000 + ((code & 0xff) << 4);                          p = fontrom + 0x82000 + ((code & 0xff) << 4);
                         i286_memstr_write(seg, off + 2, p, 8);                          MEML_WRITESTR(seg, off + 2, p, 8);
                         break;                          break;
   
                 case 0x28:                      // 8x16 KANJI                  case 0x28:                      // 8x16 KANJI
Line 218  const BYTE *p; Line 224  const BYTE *p;
                 case 0x2a:                  case 0x2a:
                 case 0x2b:                  case 0x2b:
                         size = 0x0102;                          size = 0x0102;
                         i286_memword_write(seg, off, 0x0102);                          MEML_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;
                         i286_memstr_write(seg, off + 2, p, 16);                          MEML_WRITESTR(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);
                         i286_memstr_write(seg, off + 2, p, 16);                          MEML_WRITESTR(seg, off + 2, p, 16);
                         break;                          break;
   
                 default:                  default:
Line 240  const BYTE *p; Line 246  const BYTE *p;
                                 buf[i*2+0] = *p;                                  buf[i*2+0] = *p;
                                 buf[i*2+1] = *(p+0x800);                                  buf[i*2+1] = *(p+0x800);
                         }                          }
                         i286_memstr_write(seg, off + 2, buf, 32);                          MEML_WRITESTR(seg, off + 2, buf, 32);
                         break;                          break;
         }          }
         i286_memword_write(seg, off, size);          MEML_WRITE16(seg, off, size);
         return(size);          return(size);
 }  }
   
Line 254  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) {
                 i286_memstr_read(seg, off + 2, buf, 32);                  MEML_READSTR(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 561  static void bios0x18_47(void) { Line 567  static void bios0x18_47(void) {
         SINT16          dy;          SINT16          dy;
   
         gdc_forceready(GDCWORK_SLAVE);          gdc_forceready(GDCWORK_SLAVE);
         i286_memstr_read(CPU_DS, CPU_BX, &ucw, sizeof(ucw));          MEML_READSTR(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 672  static void bios0x18_49(void) { Line 678  static void bios0x18_49(void) {
   
         gdc_forceready(GDCWORK_SLAVE);          gdc_forceready(GDCWORK_SLAVE);
   
         i286_memstr_read(CPU_DS, CPU_BX, &ucw, sizeof(ucw));          MEML_READSTR(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 756  void bios0x18(void) { Line 762  void bios0x18(void) {
   
 #if 0  #if 0
         TRACEOUT(("int18 AX=%.4x %.4x:%.4x", CPU_AX,          TRACEOUT(("int18 AX=%.4x %.4x:%.4x", CPU_AX,
                                                         i286_memword_read(CPU_SS, CPU_SP+2),                                                          MEML_READ16(CPU_SS, CPU_SP+2),
                                                         i286_memword_read(CPU_SS, CPU_SP)));                                                          MEML_READ16(CPU_SS, CPU_SP)));
 #endif  #endif
   
         sti_waiting ^= 1;  
         if (sti_waiting) {                                      // 割込み許可の遊び  
                 CPU_STI;  
                 if (PICEXISTINTR) {  
                         CPU_IP--;  
                         nevent_forceexit();  
                         return;  
                 }  
         }  
         sti_waiting = 0;  
   
         switch(CPU_AH) {          switch(CPU_AH) {
                 case 0x00:                                              // キー・データの読みだし                  case 0x00:                                              // キー・データの読みだし
                         if (mem[MEMB_KB_COUNT]) {                          if (mem[MEMB_KB_COUNT]) {
Line 825  void bios0x18(void) { Line 820  void bios0x18(void) {
                         break;                          break;
   
                 case 0x0c:                                              // テキスト画面の表示開始                  case 0x0c:                                              // テキスト画面の表示開始
                         if (!(gdcs.textdisp & GDCSCRN_ENABLE)) {                          bios0x18_0c();
                                 gdcs.textdisp |= GDCSCRN_ENABLE;  
                                 screenupdate |= 2;  
                         }  
                         break;                          break;
   
                 case 0x0d:                                              // テキスト画面の表示終了                  case 0x0d:                                              // テキスト画面の表示終了
Line 940  void bios0x18(void) { Line 932  void bios0x18(void) {
                                 if (tmp.r8 == 0x05) {                                  if (tmp.r8 == 0x05) {
                                         CPU_AL = 0;                                          CPU_AL = 0;
                                         CPU_BH = 0;                                          CPU_BH = 0;
                                         TRACEOUT(("success"));  
                                 }                                  }
                                 else {                                  else {
                                         CPU_AL = 1;                                          CPU_AL = 1;
                                         CPU_BH = 1;                                          CPU_BH = 1;
                                         TRACEOUT(("failure"));  
                                 }                                  }
                         }                          }
                         break;                          break;
Line 970  void bios0x18(void) { Line 960  void bios0x18(void) {
                         break;                          break;
   
                 case 0x43:                                              // パレットの設定                  case 0x43:                                              // パレットの設定
                         i286_memstr_read(CPU_DS, CPU_BX + offsetof(UCWTBL, GBCPC),                          MEML_READSTR(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));
Line 980  void bios0x18(void) { Line 970  void bios0x18(void) {
   
                 case 0x44:                                              // ボーダカラーの設定                  case 0x44:                                              // ボーダカラーの設定
 //                      if (!(mem[MEMB_PRXCRT] & 0x40)) {  //                      if (!(mem[MEMB_PRXCRT] & 0x40)) {
 //                              color = i286_membyte_read(CPU_DS, CPU_BX + 1);  //                              color = MEML_READ8(CPU_DS, CPU_BX + 1);
 //                      }  //                      }
                         break;                          break;
   

Removed from v.1.30  
changed lines
  Added in v.1.34


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