src/mame/machine/stvcd.c
| r12403 | r12404 | |
| 321 | 321 | CDROM_LOG(("cd_free_block: %x\n", (UINT32)(FPTR)blktofree)) |
| 322 | 322 | |
| 323 | 323 | if(blktofree == NULL) |
| 324 | { |
| 324 | 325 | return; |
| 326 | } |
| 325 | 327 | |
| 326 | 328 | for (i = 0; i < 200; i++) |
| 327 | 329 | { |
| r12403 | r12404 | |
| 685 | 687 | // CR1 & 4 = don't confirm mode 2 subheader |
| 686 | 688 | // CR1 & 8 = retry reading mode 2 sectors |
| 687 | 689 | // CR1 & 10 = force single-speed |
| 690 | // CR1 & 80 = no change flag (done by Assault Suit Leynos 2) |
| 688 | 691 | CDROM_LOG(("%s:CD: Initialize CD system\n", machine.describe_context())) |
| 689 | | hirqreg &= 0xffe5; |
| 692 | if((cr1 & 0x80) == 0x00) |
| 693 | { |
| 694 | cd_stat = CD_STAT_PAUSE; |
| 695 | cd_curfad = 150; |
| 696 | fadstoplay = 0; |
| 697 | in_buffer = 0; |
| 698 | buffull = 0; |
| 699 | hirqreg &= 0xffe5; |
| 700 | } |
| 690 | 701 | hirqreg |= (CMOK|ESEL); |
| 691 | | cd_stat = CD_STAT_PAUSE; |
| 692 | | cd_curfad = 150; |
| 693 | | fadstoplay = 0; |
| 694 | | in_buffer = 0; |
| 695 | | buffull = 0; |
| 696 | 702 | cr_standard_return(cd_stat); |
| 697 | 703 | break; |
| 698 | 704 | |
| r12403 | r12404 | |
| 1049 | 1055 | break; |
| 1050 | 1056 | |
| 1051 | 1057 | case 0x4800: // Reset Selector |
| 1058 | { |
| 1059 | int i,j; |
| 1060 | |
| 1052 | 1061 | CDROM_LOG(("%s:CD: Reset Selector\n", machine.describe_context())) |
| 1053 | 1062 | |
| 1054 | 1063 | if((cr1 & 0xff) == 0x00) |
| 1055 | 1064 | { |
| 1056 | 1065 | UINT8 bufnum = cr3>>8; |
| 1057 | | int i; |
| 1058 | 1066 | |
| 1059 | 1067 | if(bufnum < MAX_FILTERS) |
| 1060 | 1068 | { |
| r12403 | r12404 | |
| 1078 | 1086 | return; |
| 1079 | 1087 | } |
| 1080 | 1088 | |
| 1081 | | // ... |
| 1089 | /* reset false filter output conditions */ |
| 1090 | if(cr1 & 0x80) |
| 1091 | { |
| 1092 | for(i=0;i<MAX_FILTERS;i++) |
| 1093 | filters[i].condfalse = 0xff; |
| 1094 | } |
| 1095 | |
| 1096 | /* reset true filter output conditions */ |
| 1097 | if(cr1 & 0x40) |
| 1098 | { |
| 1099 | for(i=0;i<MAX_FILTERS;i++) |
| 1100 | filters[i].condtrue = i; |
| 1101 | } |
| 1102 | |
| 1103 | /* reset filter conditions*/ |
| 1104 | if(cr1 & 0x10) |
| 1105 | { |
| 1106 | for(i=0;i<MAX_FILTERS;i++) |
| 1107 | { |
| 1108 | filters[i].fad = 0; |
| 1109 | filters[i].range = 0xffffffff; |
| 1110 | filters[i].mode = 0; |
| 1111 | filters[i].chan = 0; |
| 1112 | filters[i].smmask = 0; |
| 1113 | filters[i].cimask = 0; |
| 1114 | filters[i].fid = 0; |
| 1115 | filters[i].smval = 0; |
| 1116 | filters[i].cival = 0; |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | /* reset partition buffer data */ |
| 1121 | if(cr1 & 0x4) |
| 1122 | { |
| 1123 | for(i=0;i<MAX_FILTERS;i++) |
| 1124 | { |
| 1125 | for (j = 0; j < MAX_BLOCKS; j++) |
| 1126 | { |
| 1127 | cd_free_block(partitions[i].blocks[j]); |
| 1128 | partitions[i].blocks[j] = (blockT *)NULL; |
| 1129 | partitions[i].bnum[j] = 0xff; |
| 1130 | } |
| 1131 | |
| 1132 | partitions[i].size = -1; |
| 1133 | partitions[i].numblks = 0; |
| 1134 | } |
| 1135 | |
| 1136 | buffull = sectorstore = 0; |
| 1137 | } |
| 1138 | |
| 1082 | 1139 | hirqreg |= (CMOK|ESEL); |
| 1083 | 1140 | cr_standard_return(cd_stat); |
| 1141 | } |
| 1084 | 1142 | break; |
| 1085 | 1143 | |
| 1086 | 1144 | case 0x5000: // get Buffer Size |