src/mess/drivers/pc8801.c
| r10245 | r10246 | |
| 169 | 169 | static UINT8 timer_irq_mask,timer_irq_latch; |
| 170 | 170 | static UINT8 sound_irq_mask,sound_irq_latch; |
| 171 | 171 | #endif |
| 172 | | static UINT8 has_dictionary,dic_ctrl,dic_bank; |
| 172 | static UINT8 has_dictionary,has_cdrom,dic_ctrl,dic_bank; |
| 173 | static UINT8 cdrom_reg[0x10]; |
| 173 | 174 | |
| 174 | 175 | /* |
| 175 | 176 | CRTC command params: |
| r10245 | r10246 | |
| 701 | 702 | return dic_rom[offset]; |
| 702 | 703 | } |
| 703 | 704 | |
| 705 | static READ8_HANDLER( pc8801_cdbios_rom_r ) |
| 706 | { |
| 707 | UINT8 *cdrom_bios = space->machine->region("cdrom")->base(); |
| 708 | |
| 709 | return cdrom_bios[offset]; |
| 710 | } |
| 711 | |
| 704 | 712 | static READ8_HANDLER( pc8801_mem_r ) |
| 705 | 713 | { |
| 706 | 714 | if(offset >= 0x0000 && offset <= 0x7fff) |
| r10245 | r10246 | |
| 711 | 719 | if(gfx_ctrl & 2) |
| 712 | 720 | return pc8801_wram_r(space,offset); |
| 713 | 721 | |
| 722 | if(has_cdrom && cdrom_reg[9] & 0x10) |
| 723 | return pc8801_cdbios_rom_r(space,(offset & 0x7fff) | ((gfx_ctrl & 4) ? 0x8000 : 0x0000)); |
| 724 | |
| 714 | 725 | if(gfx_ctrl & 4) |
| 715 | 726 | return pc8801_nbasic_rom_r(space,offset); |
| 716 | 727 | |
| r10245 | r10246 | |
| 1195 | 1206 | /* bits 2 to 5 are cmt related */ |
| 1196 | 1207 | |
| 1197 | 1208 | 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? |
| 1201 | 1210 | } |
| 1202 | 1211 | |
| 1203 | 1212 | static UINT32 knj_addr[2]; |
| r10245 | r10246 | |
| 1246 | 1255 | dic_ctrl = (data ^ 1) & 1; |
| 1247 | 1256 | } |
| 1248 | 1257 | |
| 1258 | static 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 | |
| 1268 | static 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 | |
| 1249 | 1280 | static ADDRESS_MAP_START( pc8801_io, ADDRESS_SPACE_IO, 8 ) |
| 1250 | 1281 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1251 | 1282 | ADDRESS_MAP_UNMAP_HIGH |
| r10245 | r10246 | |
| 1271 | 1302 | AM_RANGE(0x30, 0x30) AM_READ_PORT("DSW1") AM_WRITE(pc8801_txt_cmt_ctrl_w) |
| 1272 | 1303 | AM_RANGE(0x31, 0x31) AM_READ_PORT("DSW2") AM_WRITE(pc8801_gfx_ctrl_w) |
| 1273 | 1304 | AM_RANGE(0x32, 0x32) AM_READWRITE(pc8801_misc_ctrl_r, pc8801_misc_ctrl_w) |
| 1305 | //0x33, 0x33 sets something kanji related |
| 1274 | 1306 | AM_RANGE(0x34, 0x34) AM_WRITE(pc8801_alu_ctrl1_w) |
| 1275 | 1307 | AM_RANGE(0x35, 0x35) AM_WRITE(pc8801_alu_ctrl2_w) |
| 1276 | 1308 | AM_RANGE(0x40, 0x40) AM_READWRITE(pc8801_ctrl_r, pc8801_ctrl_w) |
| r10245 | r10246 | |
| 1290 | 1322 | AM_RANGE(0x70, 0x70) AM_READWRITE(pc8801_window_bank_r, pc8801_window_bank_w) |
| 1291 | 1323 | AM_RANGE(0x71, 0x71) AM_READWRITE(pc8801_ext_rom_bank_r, pc8801_ext_rom_bank_w) |
| 1292 | 1324 | 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) |
| 1294 | 1326 | // AM_RANGE(0xa0, 0xa3) AM_NOP /* music & network */ |
| 1295 | 1327 | // AM_RANGE(0xa8, 0xad) AM_NOP /* second sound board */ |
| 1296 | 1328 | // AM_RANGE(0xb4, 0xb5) AM_NOP /* Video art board */ |
| r10245 | r10246 | |
| 1924 | 1956 | } |
| 1925 | 1957 | |
| 1926 | 1958 | has_dictionary = 0; |
| 1959 | has_cdrom = 0; |
| 1960 | |
| 1927 | 1961 | } |
| 1928 | 1962 | |
| 1929 | 1963 | static MACHINE_RESET( pc8801_dic ) |
| r10245 | r10246 | |
| 1937 | 1971 | static MACHINE_RESET( pc8801_cdrom ) |
| 1938 | 1972 | { |
| 1939 | 1973 | 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 | } |
| 1941 | 1982 | } |
| 1942 | 1983 | |
| 1943 | 1984 | static PALETTE_INIT( pc8801 ) |