Some timing tests on windows machine. Double buffering was pretty
successful only 1KBps speed drop when actually dumping real cart data.
This commit is contained in:
parent
a7eaf970b2
commit
876b526e8c
|
|
@ -653,7 +653,6 @@ void update_buffers()
|
|||
|
||||
}
|
||||
|
||||
//usbPoll();
|
||||
//this will get entered on first and all successive calls
|
||||
if ( operation == DUMPING ) {
|
||||
//buffer_payload will pass cur_buff to usb driver on next IN transfer
|
||||
|
|
|
|||
|
|
@ -422,12 +422,12 @@ uint8_t nes_cpu_page_rd_poll( uint8_t *data, uint8_t addrH, uint8_t first, uint8
|
|||
ADDR_OUT = first; //doing this prior to entry and right after latching
|
||||
//gives longest delay between address out and latching data
|
||||
for( i=0; i<=len; i++ ) {
|
||||
//couple more NOP's waiting for data
|
||||
//testing shows that having this if statement doesn't affect overall dumping speed
|
||||
if ( poll == FALSE ) {
|
||||
NOP(); //couple more NOP's waiting for data
|
||||
NOP(); //one prob good enough considering the if/else
|
||||
NOP();
|
||||
} else {
|
||||
usbPoll();
|
||||
usbPoll(); //Call usbdrv.h usb polling while waiting for data
|
||||
}
|
||||
//latch data
|
||||
data[i] = DATA_IN;
|
||||
|
|
|
|||
|
|
@ -19,5 +19,6 @@ uint8_t nes_ppu_rd( uint8_t addrH, uint8_t addrL );
|
|||
void nes_ppu_wr( uint8_t addrH, uint8_t addrL, uint8_t data );
|
||||
uint8_t ciram_a10_mirroring( void );
|
||||
uint8_t nes_cpu_page_rd_poll( uint8_t *data, uint8_t addrH, uint8_t first, uint8_t last, uint8_t poll );
|
||||
uint8_t nes_ppu_page_rd_poll( uint8_t *data, uint8_t addrH, uint8_t first, uint8_t last, uint8_t poll );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -97,19 +97,24 @@ int dump_cart( USBtransfer* transfer, rom_image *rom, cartridge *cart )
|
|||
// get_buff_operation( transfer );
|
||||
// get_buff_elements( transfer, buff0 );
|
||||
// get_buff_elements( transfer, buff1 );
|
||||
clock_t tstart, tstop;
|
||||
tstart = clock();
|
||||
|
||||
//now just need to call series of payload IN transfers to retrieve data
|
||||
//for( i=0; i<(256*KByte/buff_size); i++) {
|
||||
//for( i=0; i<(512*KByte/buff_size); i++) {
|
||||
for( i=0; i<(32*KByte/buff_size); i++) {
|
||||
//for( i=0; i<(8*KByte/buff_size); i++) {
|
||||
//payload transfer in and append to file
|
||||
if ( i % 256 == 0 ) debug("payload in #%d", i);
|
||||
// if ( i % 256 == 0 ) debug("payload in #%d", i);
|
||||
check(! payload_in( transfer, data, buff_size ), "Error with payload IN");
|
||||
if (i==0) printf("first byte: %x\n", data[0]);
|
||||
check(! append_to_file( rom, data, buff_size ), "Error with file append");
|
||||
}
|
||||
debug("payload done");
|
||||
|
||||
tstop = clock();
|
||||
float timediff = ( (float)(tstop-tstart) / CLOCKS_PER_SEC);
|
||||
printf("total time: %fsec, speed: %fKBps", timediff, (512/timediff));
|
||||
//TODO flush file from time to time..?
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -400,6 +400,7 @@
|
|||
// 256Byte OUT (write) transfers with long transfers ENABLED: 18.56sec/512KByte = 27.6 KBps
|
||||
// 254Byte OUT (write) transfers with long transfers DISABLED: 17.9 sec/512KByte = 28.6 KBps (assuming 2 bytes stuffed in setup packet)
|
||||
// 128Byte IN (read) with long xfr DISABLED, w/o usbFuncRd: 30.5 sec/512KByte = 16.8 KBps
|
||||
//with read data dumping operations and file writing: 128Byte IN 32.25sec/512KByte = 15.8 KBps only 1KBps lost due to dumping operation
|
||||
// 128Byte IN (read) with long xfr DISABLED, w/usbFuncRd: 34.9 sec/512KByte = 14.7 KBps
|
||||
// 1033*254Byte IN (read) long xfr DISABLED, w/o usbFuncRd: 28.35sec/512KByte = 18.1 KBps
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue