Previous 199869 Revisions Next

r21109 Saturday 16th February, 2013 at 02:08:55 UTC by Angelo Salese
Attempt to add Copy Sector Data command, but my logic fails for some reason ...
[src/emu/machine]stvcd.c

trunk/src/emu/machine/stvcd.c
r21108r21109
798798            else
799799            {
800800               cr4 = partitions[bufnum].numblks;
801               //printf("Partition %08x %04x\n",bufnum,cr4);
801802            }
802803
803804            hirqreg |= (CMOK|DRDY);
r21108r21109
10721073         break;
10731074
10741075      case 0x65:
1075         popmessage("Copy Sector data, contact MAMEdev");
1076         popmessage("Move Sector data, contact MAMEdev");
10761077         hirqreg |= (CMOK);
10771078         break;
10781079
1079      case 0x66:    // move sector data
1080      case 0x66:    // copy sector data
10801081         /* TODO: Sword & Sorcery / Riglord Saga 2 */
10811082         {
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
10861108         }
10871109
1088         hirqreg |= (CMOK|ECPY|DRDY);
1110         hirqreg |= (CMOK|ECPY);
10891111         cr_standard_return(cd_stat);
10901112         break;
10911113

Previous 199869 Revisions Next


© 1997-2024 The MAME Team