trunk/src/emu/machine/stvcd.c
| r21108 | r21109 | |
| 798 | 798 | else |
| 799 | 799 | { |
| 800 | 800 | cr4 = partitions[bufnum].numblks; |
| 801 | //printf("Partition %08x %04x\n",bufnum,cr4); |
| 801 | 802 | } |
| 802 | 803 | |
| 803 | 804 | hirqreg |= (CMOK|DRDY); |
| r21108 | r21109 | |
| 1072 | 1073 | break; |
| 1073 | 1074 | |
| 1074 | 1075 | case 0x65: |
| 1075 | | popmessage("Copy Sector data, contact MAMEdev"); |
| 1076 | popmessage("Move Sector data, contact MAMEdev"); |
| 1076 | 1077 | hirqreg |= (CMOK); |
| 1077 | 1078 | break; |
| 1078 | 1079 | |
| 1079 | | case 0x66: // move sector data |
| 1080 | case 0x66: // copy sector data |
| 1080 | 1081 | /* TODO: Sword & Sorcery / Riglord Saga 2 */ |
| 1081 | 1082 | { |
| 1082 | | //UINT8 src_filter = (cr3>>8)&0xff; |
| 1083 | | //UINT8 dst_filter = cr4; |
| 1084 | | cd_stat |= CD_STAT_TRANS; |
| 1085 | | //debugger_break(machine()); |
| 1083 | UINT32 src_filter = (cr3>>8)&0xff; |
| 1084 | UINT32 dst_filter = cr1&0xff; |
| 1085 | UINT32 sectnum = cr4 & 0xff; |
| 1086 | |
| 1087 | //cd_stat |= CD_STAT_TRANS; |
| 1088 | //transpart = &partitions[dst_filter]; |
| 1089 | |
| 1090 | for (int i = 0; i < sectnum; i++) |
| 1091 | { |
| 1092 | // allocate the dst blocks |
| 1093 | partitions[dst_filter].blocks[i] = cd_alloc_block(&partitions[dst_filter].bnum[i]); |
| 1094 | partitions[dst_filter].size += partitions[dst_filter].blocks[i]->size; |
| 1095 | partitions[dst_filter].numblks++; |
| 1096 | |
| 1097 | //copy data |
| 1098 | for(int j = 0; j < sectlenin; j++) |
| 1099 | partitions[dst_filter].blocks[i]->data[j] = partitions[src_filter].blocks[i]->data[j]; |
| 1100 | |
| 1101 | //deallocate the src blocks |
| 1102 | //partitions[src_filter].size -= partitions[src_filter].blocks[i]->size; |
| 1103 | //cd_free_block(partitions[src_filter].blocks[i]); |
| 1104 | //partitions[src_filter].blocks[i] = (blockT *)NULL; |
| 1105 | //partitions[src_filter].bnum[i] = 0xff; |
| 1106 | } |
| 1107 | |
| 1086 | 1108 | } |
| 1087 | 1109 | |
| 1088 | | hirqreg |= (CMOK|ECPY|DRDY); |
| 1110 | hirqreg |= (CMOK|ECPY); |
| 1089 | 1111 | cr_standard_return(cd_stat); |
| 1090 | 1112 | break; |
| 1091 | 1113 | |