25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dec_prom.c,v 1.57 2005/02/22 12:05:19 debug Exp $ |
* $Id: dec_prom.c,v 1.58 2005/05/15 01:55:49 debug Exp $ |
29 |
* |
* |
30 |
* DECstation PROM emulation. |
* DECstation PROM emulation. |
31 |
*/ |
*/ |
133 |
case 0x38: /* read(handle, ptr, length) */ |
case 0x38: /* read(handle, ptr, length) */ |
134 |
cpu->cd.mips.gpr[MIPS_GPR_V0] = -1; |
cpu->cd.mips.gpr[MIPS_GPR_V0] = -1; |
135 |
if ((int32_t)cpu->cd.mips.gpr[MIPS_GPR_A2] > 0) { |
if ((int32_t)cpu->cd.mips.gpr[MIPS_GPR_A2] > 0) { |
136 |
int disk_id = diskimage_bootdev(cpu->machine); |
int disk_id = diskimage_bootdev(cpu->machine, NULL); |
137 |
int res; |
int res; |
138 |
unsigned char *tmp_buf; |
unsigned char *tmp_buf; |
139 |
|
|
145 |
break; |
break; |
146 |
} |
} |
147 |
|
|
148 |
res = diskimage_access(cpu->machine, disk_id, 0, |
res = diskimage_access(cpu->machine, disk_id, |
149 |
current_file_offset, tmp_buf, |
DISKIMAGE_SCSI, 0, current_file_offset, tmp_buf, |
150 |
cpu->cd.mips.gpr[MIPS_GPR_A2]); |
cpu->cd.mips.gpr[MIPS_GPR_A2]); |
151 |
|
|
152 |
/* If the transfer was successful, transfer the data |
/* If the transfer was successful, transfer the data |
469 |
cpu->cd.mips.gpr[MIPS_GPR_V0] = 0; |
cpu->cd.mips.gpr[MIPS_GPR_V0] = 0; |
470 |
|
|
471 |
if ((int32_t)cpu->cd.mips.gpr[MIPS_GPR_A2] > 0) { |
if ((int32_t)cpu->cd.mips.gpr[MIPS_GPR_A2] > 0) { |
472 |
int disk_id = diskimage_bootdev(cpu->machine); |
int disk_id = diskimage_bootdev(cpu->machine, NULL); |
473 |
int res; |
int res; |
474 |
unsigned char *tmp_buf; |
unsigned char *tmp_buf; |
475 |
|
|
481 |
break; |
break; |
482 |
} |
} |
483 |
|
|
484 |
res = diskimage_access(cpu->machine, disk_id, 0, |
res = diskimage_access(cpu->machine, disk_id, |
485 |
|
DISKIMAGE_SCSI, 0, |
486 |
cpu->cd.mips.gpr[MIPS_GPR_A0] * 512, tmp_buf, |
cpu->cd.mips.gpr[MIPS_GPR_A0] * 512, tmp_buf, |
487 |
cpu->cd.mips.gpr[MIPS_GPR_A2]); |
cpu->cd.mips.gpr[MIPS_GPR_A2]); |
488 |
|
|