Diff for /np2/i286c/memory.c between versions 1.27 and 1.29

version 1.27, 2005/03/10 09:54:55 version 1.29, 2005/03/16 03:53:45
Line 76  static void MEMCALL memnc_wr16(UINT32 ad Line 76  static void MEMCALL memnc_wr16(UINT32 ad
 }  }
   
   
   
   
   
 // ---- write byte  
   
 static void MEMCALL egc_wt(UINT32 address, REG8 value) {                // VRAM  
   
         CPU_REMCLOCK -= MEMWAIT_GRCG;  
         memegc_wr8(address, value);  
 }  
   
   
 // ---- read byte  
   
 static REG8 MEMCALL egc_rd(UINT32 address) {                                    // VRAM  
   
         CPU_REMCLOCK -= MEMWAIT_GRCG;  
         return(memegc_rd8(address));  
 }  
   
   
 // ---- write word  
   
 static void MEMCALL egcw_wt(UINT32 address, REG16 value) {  
   
         CPU_REMCLOCK -= MEMWAIT_GRCG;  
         memegc_wr16(address, value);  
 }  
   
   
 // ---- read word  
   
 static REG16 MEMCALL egcw_rd(UINT32 address) {  
   
         CPU_REMCLOCK -= MEMWAIT_GRCG;  
         return(memegc_rd16(address));  
 }  
   
   
 // ---- table  // ---- table
   
 typedef void (MEMCALL * MEM8WRITE)(UINT32 address, REG8 value);  typedef void (MEMCALL * MEM8WRITE)(UINT32 address, REG8 value);
Line 127  typedef struct { Line 88  typedef struct {
         MEM8WRITE       wr8[0x20];          MEM8WRITE       wr8[0x20];
         MEM16READ       rd16[0x20];          MEM16READ       rd16[0x20];
         MEM16WRITE      wr16[0x20];          MEM16WRITE      wr16[0x20];
 } MEMFN;  } MEMFN0;
   
 typedef struct {  typedef struct {
         MEM8READ        brd8;           // E8000-F7FFF byte read          MEM8READ        brd8;           // E8000-F7FFF byte read
Line 145  typedef struct { Line 106  typedef struct {
         MEM16WRITE      wr16;          MEM16WRITE      wr16;
 } VACCTBL;  } VACCTBL;
   
 static MEMFN memfn = {  static MEMFN0 memfn0 = {
            {memmain_rd8,        memmain_rd8,    memmain_rd8,    memmain_rd8,    // 00             {memmain_rd8,        memmain_rd8,    memmain_rd8,    memmain_rd8,    // 00
                 memmain_rd8,    memmain_rd8,    memmain_rd8,    memmain_rd8,    // 20                  memmain_rd8,    memmain_rd8,    memmain_rd8,    memmain_rd8,    // 20
                 memmain_rd8,    memmain_rd8,    memmain_rd8,    memmain_rd8,    // 40                  memmain_rd8,    memmain_rd8,    memmain_rd8,    memmain_rd8,    // 40
Line 199  static const VACCTBL vacctbl[0x10] = { Line 160  static const VACCTBL vacctbl[0x10] = {
                 {memvram1_rd8,  memvram1_wr8,   memvram1_rd16,  memvram1_wr16},                  {memvram1_rd8,  memvram1_wr8,   memvram1_rd16,  memvram1_wr16},
                 {memtcr0_rd8,   memtdw0_wr8,    memtcr0_rd16,   memtdw0_wr16},  // 80                  {memtcr0_rd8,   memtdw0_wr8,    memtcr0_rd16,   memtdw0_wr16},  // 80
                 {memtcr1_rd8,   memtdw1_wr8,    memtcr1_rd16,   memtdw1_wr16},                  {memtcr1_rd8,   memtdw1_wr8,    memtcr1_rd16,   memtdw1_wr16},
                 {egc_rd,                egc_wt,                 egcw_rd,                egcw_wt},                  {memegc_rd8,    memegc_wr8,             memegc_rd16,    memegc_wr16},
                 {egc_rd,                egc_wt,                 egcw_rd,                egcw_wt},                  {memegc_rd8,    memegc_wr8,             memegc_rd16,    memegc_wr16},
                 {memvram0_rd8,  memrmw0_wr8,    memvram0_rd16,  memrmw0_wr16},  // c0                  {memvram0_rd8,  memrmw0_wr8,    memvram0_rd16,  memrmw0_wr16},  // c0
                 {memvram1_rd8,  memrmw1_wr8,    memvram1_rd16,  memrmw1_wr16},                  {memvram1_rd8,  memrmw1_wr8,    memvram1_rd16,  memrmw1_wr16},
                 {egc_rd,                egc_wt,                 egcw_rd,                egcw_wt},                  {memegc_rd8,    memegc_wr8,             memegc_rd16,    memegc_wr16},
                 {egc_rd,                egc_wt,                 egcw_rd,                egcw_wt}};                  {memegc_rd8,    memegc_wr8,             memegc_rd16,    memegc_wr16}};
   
   
 void MEMCALL i286_memorymap(UINT type) {  void MEMCALL i286_memorymap(UINT type) {
Line 213  const MMAPTBL *mm; Line 174  const MMAPTBL *mm;
   
         mm = mmaptbl + (type & 1);          mm = mmaptbl + (type & 1);
   
         memfn.rd8[0xe8000 >> 15] = mm->brd8;          memfn0.rd8[0xe8000 >> 15] = mm->brd8;
         memfn.rd8[0xf0000 >> 15] = mm->brd8;          memfn0.rd8[0xf0000 >> 15] = mm->brd8;
         memfn.rd8[0xf8000 >> 15] = mm->ird8;          memfn0.rd8[0xf8000 >> 15] = mm->ird8;
         memfn.wr8[0xe8000 >> 15] = mm->bwr8;          memfn0.wr8[0xe8000 >> 15] = mm->bwr8;
         memfn.wr8[0xf0000 >> 15] = mm->bwr8;          memfn0.wr8[0xf0000 >> 15] = mm->bwr8;
         memfn.wr8[0xf8000 >> 15] = mm->bwr8;          memfn0.wr8[0xf8000 >> 15] = mm->bwr8;
   
         memfn.rd16[0xe8000 >> 15] = mm->brd16;          memfn0.rd16[0xe8000 >> 15] = mm->brd16;
         memfn.rd16[0xf0000 >> 15] = mm->brd16;          memfn0.rd16[0xf0000 >> 15] = mm->brd16;
         memfn.rd16[0xf8000 >> 15] = mm->ird16;          memfn0.rd16[0xf8000 >> 15] = mm->ird16;
         memfn.wr16[0xe8000 >> 15] = mm->bwr16;          memfn0.wr16[0xe8000 >> 15] = mm->bwr16;
         memfn.wr16[0xf0000 >> 15] = mm->bwr16;          memfn0.wr16[0xf0000 >> 15] = mm->bwr16;
         memfn.wr16[0xf8000 >> 15] = mm->bwr16;          memfn0.wr16[0xf8000 >> 15] = mm->bwr16;
 }  }
   
 void MEMCALL i286_vram_dispatch(UINT func) {  void MEMCALL i286_vram_dispatch(UINT func) {
Line 234  const VACCTBL *vacc; Line 195  const VACCTBL *vacc;
   
         vacc = vacctbl + (func & 0x0f);          vacc = vacctbl + (func & 0x0f);
   
         memfn.rd8[0xa8000 >> 15] = vacc->rd8;          memfn0.rd8[0xa8000 >> 15] = vacc->rd8;
         memfn.rd8[0xb0000 >> 15] = vacc->rd8;          memfn0.rd8[0xb0000 >> 15] = vacc->rd8;
         memfn.rd8[0xb8000 >> 15] = vacc->rd8;          memfn0.rd8[0xb8000 >> 15] = vacc->rd8;
         memfn.rd8[0xe0000 >> 15] = vacc->rd8;          memfn0.rd8[0xe0000 >> 15] = vacc->rd8;
   
         memfn.wr8[0xa8000 >> 15] = vacc->wr8;          memfn0.wr8[0xa8000 >> 15] = vacc->wr8;
         memfn.wr8[0xb0000 >> 15] = vacc->wr8;          memfn0.wr8[0xb0000 >> 15] = vacc->wr8;
         memfn.wr8[0xb8000 >> 15] = vacc->wr8;          memfn0.wr8[0xb8000 >> 15] = vacc->wr8;
         memfn.wr8[0xe0000 >> 15] = vacc->wr8;          memfn0.wr8[0xe0000 >> 15] = vacc->wr8;
   
         memfn.rd16[0xa8000 >> 15] = vacc->rd16;          memfn0.rd16[0xa8000 >> 15] = vacc->rd16;
         memfn.rd16[0xb0000 >> 15] = vacc->rd16;          memfn0.rd16[0xb0000 >> 15] = vacc->rd16;
         memfn.rd16[0xb8000 >> 15] = vacc->rd16;          memfn0.rd16[0xb8000 >> 15] = vacc->rd16;
         memfn.rd16[0xe0000 >> 15] = vacc->rd16;          memfn0.rd16[0xe0000 >> 15] = vacc->rd16;
   
         memfn.wr16[0xa8000 >> 15] = vacc->wr16;          memfn0.wr16[0xa8000 >> 15] = vacc->wr16;
         memfn.wr16[0xb0000 >> 15] = vacc->wr16;          memfn0.wr16[0xb0000 >> 15] = vacc->wr16;
         memfn.wr16[0xb8000 >> 15] = vacc->wr16;          memfn0.wr16[0xb8000 >> 15] = vacc->wr16;
         memfn.wr16[0xe0000 >> 15] = vacc->wr16;          memfn0.wr16[0xe0000 >> 15] = vacc->wr16;
   
         if (!(func & (1 << VOPBIT_ANALOG))) {                                   // digital          if (!(func & (1 << VOPBIT_ANALOG))) {                                   // digital
                 memfn.rd8[0xe0000 >> 15] = memnc_rd8;                  memfn0.rd8[0xe0000 >> 15] = memnc_rd8;
                 memfn.wr8[0xe0000 >> 15] = memnc_wr8;                  memfn0.wr8[0xe0000 >> 15] = memnc_wr8;
                 memfn.rd16[0xe0000 >> 15] = memnc_rd16;                  memfn0.rd16[0xe0000 >> 15] = memnc_rd16;
                 memfn.wr16[0xe0000 >> 15] = memnc_wr16;                  memfn0.wr16[0xe0000 >> 15] = memnc_wr16;
         }          }
 }  }
   
Line 279  REG8 MEMCALL i286_memoryread(UINT32 addr Line 240  REG8 MEMCALL i286_memoryread(UINT32 addr
         }          }
 #endif  #endif
         else {          else {
                 return(memfn.rd8[(address >> 15) & 0x1f](address));                  return(memfn0.rd8[(address >> 15) & 0x1f](address));
         }          }
 }  }
   
Line 313  REG16 MEMCALL i286_memoryread_w(UINT32 a Line 274  REG16 MEMCALL i286_memoryread_w(UINT32 a
         }          }
 #endif  #endif
         else if ((address & 0x7fff) != 0x7fff) {          else if ((address & 0x7fff) != 0x7fff) {
                 return(memfn.rd16[(address >> 15) & 0x1f](address));                  return(memfn0.rd16[(address >> 15) & 0x1f](address));
         }          }
         else {          else {
                 ret = memfn.rd8[(address >> 15) & 0x1f](address);                  ret = memfn0.rd8[(address >> 15) & 0x1f](address);
                 address++;                  address++;
                 ret += memfn.rd8[(address >> 15) & 0x1f](address) << 8;                  ret += memfn0.rd8[(address >> 15) & 0x1f](address) << 8;
                 return(ret);                  return(ret);
         }          }
 }  }
Line 337  void MEMCALL i286_memorywrite(UINT32 add Line 298  void MEMCALL i286_memorywrite(UINT32 add
         }          }
 #endif  #endif
         else {          else {
                 memfn.wr8[(address >> 15) & 0x1f](address, value);                  memfn0.wr8[(address >> 15) & 0x1f](address, value);
         }          }
 }  }
   
Line 362  void MEMCALL i286_memorywrite_w(UINT32 a Line 323  void MEMCALL i286_memorywrite_w(UINT32 a
         }          }
 #endif  #endif
         else if ((address & 0x7fff) != 0x7fff) {          else if ((address & 0x7fff) != 0x7fff) {
                 memfn.wr16[(address >> 15) & 0x1f](address, value);                  memfn0.wr16[(address >> 15) & 0x1f](address, value);
         }          }
         else {          else {
                 memfn.wr8[(address >> 15) & 0x1f](address, (UINT8)value);                  memfn0.wr8[(address >> 15) & 0x1f](address, (UINT8)value);
                 address++;                  address++;
                 memfn.wr8[(address >> 15) & 0x1f](address, (UINT8)(value >> 8));                  memfn0.wr8[(address >> 15) & 0x1f](address, (UINT8)(value >> 8));
         }          }
 }  }
   

Removed from v.1.27  
changed lines
  Added in v.1.29


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