Search
lxdream.org :: lxdream :: r1172:43eef98ff265
lxdream 0.9.1
released Jun 29
Download Now
changeset1172:43eef98ff265
parent1171:d644413208a3
child1173:49207ef698e1
authorNathan Keynes <nkeynes@lxdream.org>
dateWed May 11 08:45:31 2011 +1000 (8 years ago)
Fix returned maple packet length for VMU block reads and get-mem-info
Fix returned block-id in block reads to match the input block-id.
src/maple/maple.c
src/maple/vmu.c
1.1 --- a/src/maple/maple.c Tue May 10 20:31:14 2011 +1000
1.2 +++ b/src/maple/maple.c Wed May 11 08:45:31 2011 +1000
1.3 @@ -176,7 +176,7 @@
1.4 *((uint32_t *)return_buf) = -1;
1.5 } else {
1.6 int status, func;
1.7 - unsigned int pt, phase, block;
1.8 + unsigned int pt, phase, block, blkid;
1.9 out_length = 0;
1.10 switch( cmd ) {
1.11 case MAPLE_CMD_INFO:
1.12 @@ -241,6 +241,7 @@
1.13 status = MAPLE_ERR_CMD_UNKNOWN;
1.14 else status = dev->get_memory_info(dev,func, pt, return_buf+8, &out_length);
1.15 if( status == 0 ) {
1.16 + out_length++;
1.17 status = MAPLE_RESP_DATA;
1.18 PUTWORD(4,func);
1.19 }
1.20 @@ -250,6 +251,7 @@
1.21 pt = GETBYTE(16);
1.22 phase = GETBYTE(17);
1.23 block = (GETBYTE(18)<<8) | GETBYTE(19);
1.24 + blkid = GETWORD(16);
1.25 if( dev->read_block == NULL )
1.26 status = MAPLE_ERR_CMD_UNKNOWN;
1.27 else status = dev->read_block(dev, func, pt, block, phase,
1.28 @@ -257,8 +259,9 @@
1.29 &out_length );
1.30 if( status == 0 ) {
1.31 status = MAPLE_RESP_DATA;
1.32 + out_length += 2;
1.33 PUTWORD(4,func);
1.34 - PUTWORD(8,block);
1.35 + PUTWORD(8,blkid);
1.36 }
1.37 break;
1.38 case MAPLE_CMD_WRITE_BLOCK:
2.1 --- a/src/maple/vmu.c Tue May 10 20:31:14 2011 +1000
2.2 +++ b/src/maple/vmu.c Wed May 11 08:45:31 2011 +1000
2.3 @@ -209,7 +209,9 @@
2.4 break;
2.5 case MAPLE_FUNC_MEMORY:
2.6 if( vmu->vol != NULL ) {
2.7 - vmu_volume_read_block( vmu->vol, pt, block, outbuf );
2.8 + if( vmu_volume_read_block( vmu->vol, pt, block, outbuf ) ) {
2.9 + *buflen = VMU_BLOCK_SIZE/4;
2.10 + }
2.11 return 0;
2.12 }
2.13 // Else fallthrough for now
.