Previous 15994 Revisions Next

r10246 Monday 31st January, 2011 at 23:41:36 UTC by Angelo Salese
[PC-8801] Added CD-ROM BIOS hook-up for MC subtype
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r10245r10246
169169static UINT8 timer_irq_mask,timer_irq_latch;
170170static UINT8 sound_irq_mask,sound_irq_latch;
171171#endif
172static UINT8 has_dictionary,dic_ctrl,dic_bank;
172static UINT8 has_dictionary,has_cdrom,dic_ctrl,dic_bank;
173static UINT8 cdrom_reg[0x10];
173174
174175/*
175176CRTC command params:
r10245r10246
701702   return dic_rom[offset];
702703}
703704
705static READ8_HANDLER( pc8801_cdbios_rom_r )
706{
707   UINT8 *cdrom_bios = space->machine->region("cdrom")->base();
708
709   return cdrom_bios[offset];
710}
711
704712static READ8_HANDLER( pc8801_mem_r )
705713{
706714   if(offset >= 0x0000 && offset <= 0x7fff)
r10245r10246
711719      if(gfx_ctrl & 2)
712720         return pc8801_wram_r(space,offset);
713721
722      if(has_cdrom && cdrom_reg[9] & 0x10)
723         return pc8801_cdbios_rom_r(space,(offset & 0x7fff) | ((gfx_ctrl & 4) ? 0x8000 : 0x0000));
724
714725      if(gfx_ctrl & 4)
715726         return pc8801_nbasic_rom_r(space,offset);
716727
r10245r10246
11951206   /* bits 2 to 5 are cmt related */
11961207
11971208   txt_width = data & 1;
1198   txt_color = data & 2;
1199   if((data & 2) == 0)
1200   printf("TEXT COLOR is black\n");
1209   txt_color = data & 2; //TODO: Alpha enables this, but don't want black as the text?
12011210}
12021211
12031212static UINT32 knj_addr[2];
r10245r10246
12461255      dic_ctrl = (data ^ 1) & 1;
12471256}
12481257
1258static READ8_HANDLER( pc8801_cdrom_r )
1259{
1260   //printf("CD-ROM read [%02x]\n",offset);
1261
1262   //if(has_cdrom)
1263   //   return cdrom_reg[offset];
1264
1265   return 0xff;
1266}
1267
1268static WRITE8_HANDLER( pc8801_cdrom_w )
1269{
1270   /*
1271   [9] ---x ---- CD-ROM BIOS bank
1272       ---- ---x CD-ROM E-ROM bank (?)
1273   */
1274   //printf("CD-ROM write %02x -> [%02x]\n",data,offset);
1275
1276   if(has_cdrom)
1277      cdrom_reg[offset] = data;
1278}
1279
12491280static ADDRESS_MAP_START( pc8801_io, ADDRESS_SPACE_IO, 8 )
12501281   ADDRESS_MAP_GLOBAL_MASK(0xff)
12511282   ADDRESS_MAP_UNMAP_HIGH
r10245r10246
12711302   AM_RANGE(0x30, 0x30) AM_READ_PORT("DSW1") AM_WRITE(pc8801_txt_cmt_ctrl_w)
12721303   AM_RANGE(0x31, 0x31) AM_READ_PORT("DSW2") AM_WRITE(pc8801_gfx_ctrl_w)
12731304   AM_RANGE(0x32, 0x32) AM_READWRITE(pc8801_misc_ctrl_r, pc8801_misc_ctrl_w)
1305   //0x33, 0x33 sets something kanji related
12741306   AM_RANGE(0x34, 0x34) AM_WRITE(pc8801_alu_ctrl1_w)
12751307   AM_RANGE(0x35, 0x35) AM_WRITE(pc8801_alu_ctrl2_w)
12761308   AM_RANGE(0x40, 0x40) AM_READWRITE(pc8801_ctrl_r, pc8801_ctrl_w)
r10245r10246
12901322   AM_RANGE(0x70, 0x70) AM_READWRITE(pc8801_window_bank_r, pc8801_window_bank_w)
12911323   AM_RANGE(0x71, 0x71) AM_READWRITE(pc8801_ext_rom_bank_r, pc8801_ext_rom_bank_w)
12921324   AM_RANGE(0x78, 0x78) AM_WRITE(pc8801_window_bank_inc_w)
1293//  AM_RANGE(0x90, 0x9f) AM_NOP                                     /* CD-ROM */
1325   AM_RANGE(0x90, 0x9f) AM_READWRITE(pc8801_cdrom_r,pc8801_cdrom_w)
12941326//  AM_RANGE(0xa0, 0xa3) AM_NOP                                     /* music & network */
12951327//  AM_RANGE(0xa8, 0xad) AM_NOP                                     /* second sound board */
12961328//  AM_RANGE(0xb4, 0xb5) AM_NOP                                     /* Video art board */
r10245r10246
19241956   }
19251957
19261958   has_dictionary = 0;
1959   has_cdrom = 0;
1960
19271961}
19281962
19291963static MACHINE_RESET( pc8801_dic )
r10245r10246
19371971static MACHINE_RESET( pc8801_cdrom )
19381972{
19391973   MACHINE_RESET_CALL( pc8801_dic );
1940   has_dictionary = 1;
1974   has_cdrom = 1;
1975
1976   {
1977      int i;
1978
1979      for(i=0;i<0x10;i++)
1980         cdrom_reg[i] = 0;
1981   }
19411982}
19421983
19431984static PALETTE_INIT( pc8801 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team