| ... | ... |
@@ -145,14 +145,14 @@ file_delete(void) |
| 145 | 145 |
void |
| 146 | 146 |
file_deo(Device *d, Uint8 port) |
| 147 | 147 |
{
|
| 148 |
- Uint16 a, b, res; |
|
| 148 |
+ Uint16 addr, len, res; |
|
| 149 | 149 |
switch(port) {
|
| 150 | 150 |
case 0x5: |
| 151 |
- DEVPEEK16(a, 0x4); |
|
| 152 |
- DEVPEEK16(b, 0xa); |
|
| 153 |
- if(b > 0x10000 - a) |
|
| 154 |
- b = 0x10000 - a; |
|
| 155 |
- res = file_stat(&d->u->ram[a], b); |
|
| 151 |
+ DEVPEEK16(addr, 0x4); |
|
| 152 |
+ DEVPEEK16(len, 0xa); |
|
| 153 |
+ if(len > 0x10000 - addr) |
|
| 154 |
+ len = 0x10000 - addr; |
|
| 155 |
+ res = file_stat(&d->u->ram[addr], len); |
|
| 156 | 156 |
DEVPOKE16(0x2, res); |
| 157 | 157 |
break; |
| 158 | 158 |
case 0x6: |
| ... | ... |
@@ -160,24 +160,24 @@ file_deo(Device *d, Uint8 port) |
| 160 | 160 |
DEVPOKE16(0x2, res); |
| 161 | 161 |
break; |
| 162 | 162 |
case 0x9: |
| 163 |
- DEVPEEK16(a, 0x8); |
|
| 164 |
- res = file_init(&d->u->ram[a]); |
|
| 163 |
+ DEVPEEK16(addr, 0x8); |
|
| 164 |
+ res = file_init(&d->u->ram[addr]); |
|
| 165 | 165 |
DEVPOKE16(0x2, res); |
| 166 | 166 |
break; |
| 167 | 167 |
case 0xd: |
| 168 |
- DEVPEEK16(a, 0xc); |
|
| 169 |
- DEVPEEK16(b, 0xa); |
|
| 170 |
- if(b > 0x10000 - a) |
|
| 171 |
- b = 0x10000 - a; |
|
| 172 |
- res = file_read(&d->u->ram[a], b); |
|
| 168 |
+ DEVPEEK16(addr, 0xc); |
|
| 169 |
+ DEVPEEK16(len, 0xa); |
|
| 170 |
+ if(len > 0x10000 - addr) |
|
| 171 |
+ len = 0x10000 - addr; |
|
| 172 |
+ res = file_read(&d->u->ram[addr], len); |
|
| 173 | 173 |
DEVPOKE16(0x2, res); |
| 174 | 174 |
break; |
| 175 | 175 |
case 0xf: |
| 176 |
- DEVPEEK16(a, 0xe); |
|
| 177 |
- DEVPEEK16(b, 0xa); |
|
| 178 |
- if(b > 0x10000 - a) |
|
| 179 |
- b = 0x10000 - a; |
|
| 180 |
- res = file_write(&d->u->ram[a], b, d->dat[0x7]); |
|
| 176 |
+ DEVPEEK16(addr, 0xe); |
|
| 177 |
+ DEVPEEK16(len, 0xa); |
|
| 178 |
+ if(len > 0x10000 - addr) |
|
| 179 |
+ len = 0x10000 - addr; |
|
| 180 |
+ res = file_write(&d->u->ram[addr], len, d->dat[0x7]); |
|
| 181 | 181 |
DEVPOKE16(0x2, res); |
| 182 | 182 |
break; |
| 183 | 183 |
} |