Diff for /np2/bios/bios18.c between versions 1.39 and 1.43

version 1.39, 2004/07/22 11:31:32 version 1.43, 2005/05/20 13:59:46
Line 9 Line 9
   
   
 typedef struct {  typedef struct {
         BYTE    GBON_PTN;          UINT8   GBON_PTN;
         BYTE    GBBCC;          UINT8   GBBCC;
         BYTE    GBDOTU;          UINT8   GBDOTU;
         BYTE    GBDSP;          UINT8   GBDSP;
         BYTE    GBCPC[4];          UINT8   GBCPC[4];
         BYTE    GBSX1[2];          UINT8   GBSX1[2];
         BYTE    GBSY1[2];          UINT8   GBSY1[2];
         BYTE    GBLNG1[2];          UINT8   GBLNG1[2];
         BYTE    GBWDPA[2];          UINT8   GBWDPA[2];
         BYTE    GBRBUF[2][3];          UINT8   GBRBUF[2][3];
         BYTE    GBSX2[2];          UINT8   GBSX2[2];
         BYTE    GBSY2[2];          UINT8   GBSY2[2];
         BYTE    GBMDOT[2];          UINT8   GBMDOT[2];
         BYTE    GBCIR[2];          UINT8   GBCIR[2];
         BYTE    GBLNG2[2];          UINT8   GBLNG2[2];
         BYTE    GBMDOTI[8];          UINT8   GBMDOTI[8];
         BYTE    GBDTYP;          UINT8   GBDTYP;
         BYTE    GBFILL;          UINT8   GBFILL;
 } UCWTBL;  } UCWTBL;
   
 typedef struct {  typedef struct {
Line 143  void bios0x18_0c(void) { Line 143  void bios0x18_0c(void) {
   
 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;          UINT8   *p;
         UINT    raster;          UINT    raster;
         UINT    t;          UINT    t;
   
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;
Line 207  void bios0x18_10(REG8 curdel) { Line 207  void bios0x18_10(REG8 curdel) {
 REG16 bios0x18_14(REG16 seg, REG16 off, REG16 code) {  REG16 bios0x18_14(REG16 seg, REG16 off, REG16 code) {
   
         UINT16  size;          UINT16  size;
 const BYTE      *p;  const UINT8     *p;
         BYTE    buf[32];          UINT8   buf[32];
         UINT    i;          UINT    i;
   
         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 BYTE *p; Line 224  const BYTE *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 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);
                         }                          }
                         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);
 }  }
   
 static void bios0x18_1a(REG16 seg, REG16 off, REG16 code) {  static void bios0x18_1a(REG16 seg, REG16 off, REG16 code) {
   
         BYTE    *p;          UINT8   *p;
         BYTE    buf[32];          UINT8   buf[32];
         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 530  void bios0x18_42(REG8 mode) { Line 530  void bios0x18_42(REG8 mode) {
                 gdcs.disp = (mode >> 4) & 1;                  gdcs.disp = (mode >> 4) & 1;
         }          }
         if (!(mode & 0x20)) {          if (!(mode & 0x20)) {
                 gdc.mode1 &= ~0x04;                  gdc.mode2 &= ~0x04;
         }          }
         else {          else {
                 gdc.mode2 |= 0x04;                  gdc.mode2 |= 0x04;
         }          }
           gdcs.mode2 = gdc.mode2;
         gdcs.grphdisp |= GDCSCRN_ALLDRAW2;          gdcs.grphdisp |= GDCSCRN_ALLDRAW2;
         screenupdate |= 2;          screenupdate |= 2;
 }  }
   
 static void setbiosgdc(UINT32 csrw, const GDCVECT *vect, UINT8 ope) {  static void setbiosgdc(UINT32 csrw, const GDCVECT *vect, UINT8 ope) {
   
         gdc.s.para[GDC_CSRW + 0] = (BYTE)csrw;          gdc.s.para[GDC_CSRW + 0] = (UINT8)csrw;
         gdc.s.para[GDC_CSRW + 1] = (BYTE)(csrw >> 8);          gdc.s.para[GDC_CSRW + 1] = (UINT8)(csrw >> 8);
         gdc.s.para[GDC_CSRW + 2] = (BYTE)(csrw >> 16);          gdc.s.para[GDC_CSRW + 2] = (UINT8)(csrw >> 16);
   
         gdc.s.para[GDC_VECTW] = vect->ope;          gdc.s.para[GDC_VECTW] = vect->ope;
         gdc_vectreset(&gdc.s);          gdc_vectreset(&gdc.s);
Line 571  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 673  static void bios0x18_49(void) { Line 674  static void bios0x18_49(void) {
   
         UCWTBL          ucw;          UCWTBL          ucw;
         UINT            i;          UINT            i;
         BYTE            pat[8];          UINT8           pat[8];
         UINT16          tmp;          UINT16          tmp;
         GDCVECT         vect;          GDCVECT         vect;
         UINT16          GBSX1;          UINT16          GBSX1;
Line 683  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 767  void bios0x18(void) { Line 768  void bios0x18(void) {
   
 #if 0  #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 965  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 975  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.39  
changed lines
  Added in v.1.43


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