25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: pc_bios.c,v 1.97 2005/06/02 17:11:34 debug Exp $ |
* $Id: pc_bios.c,v 1.98 2005/06/26 11:36:28 debug Exp $ |
29 |
* |
* |
30 |
* Generic PC BIOS emulation. |
* Generic PC BIOS emulation. |
31 |
* |
* |
1629 |
output_char(cpu, x,y, ch, 0x19); |
output_char(cpu, x,y, ch, 0x19); |
1630 |
} |
} |
1631 |
|
|
1632 |
sprintf(t, "GXemul"); |
snprintf(t, sizeof(t), "GXemul"); |
1633 |
#ifdef VERSION |
#ifdef VERSION |
1634 |
sprintf(t + strlen(t), " "VERSION); |
snprintf(t + strlen(t), sizeof(t)-strlen(t), " "VERSION); |
1635 |
#endif |
#endif |
1636 |
set_cursor_pos(cpu, 2, 1); |
set_cursor_pos(cpu, 2, 1); |
1637 |
pc_bios_printstr(cpu, t, 0x1f); |
pc_bios_printstr(cpu, t, 0x1f); |
1638 |
|
|
1639 |
sprintf(t, "%i cpu%s (%s), %i MB memory", |
snprintf(t, sizeof(t), "%i cpu%s (%s), %i MB memory", |
1640 |
cpu->machine->ncpus, cpu->machine->ncpus > 1? "s" : "", |
cpu->machine->ncpus, cpu->machine->ncpus > 1? "s" : "", |
1641 |
cpu->cd.x86.model.name, cpu->machine->physical_ram_in_mb); |
cpu->cd.x86.model.name, cpu->machine->physical_ram_in_mb); |
1642 |
if (cpu->machine->md.pc.columns <= 40) |
if (cpu->machine->md.pc.columns <= 40) |
1656 |
if (diskimage_exist(cpu->machine, i, DISKIMAGE_FLOPPY)) { |
if (diskimage_exist(cpu->machine, i, DISKIMAGE_FLOPPY)) { |
1657 |
struct pc_bios_disk *p; |
struct pc_bios_disk *p; |
1658 |
p = add_disk(cpu->machine, i, i, DISKIMAGE_FLOPPY); |
p = add_disk(cpu->machine, i, i, DISKIMAGE_FLOPPY); |
1659 |
sprintf(t, "%c%c", i<2? ('A'+i):' ', i<2? ':':' '); |
snprintf(t, sizeof(t), "%c%c", i<2? ('A'+i):' ', |
1660 |
|
i<2? ':':' '); |
1661 |
pc_bios_printstr(cpu, t, 0xf); |
pc_bios_printstr(cpu, t, 0xf); |
1662 |
if (i < 2) |
if (i < 2) |
1663 |
nfloppies ++; |
nfloppies ++; |
1664 |
sprintf(t, " (bios disk %02x) FLOPPY", i); |
snprintf(t, sizeof(t), " (bios disk %02x) FLOPPY", i); |
1665 |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
1666 |
sprintf(t, ", %i KB", (int)(p->size / 1024)); |
snprintf(t, sizeof(t), ", %i KB", (int)(p->size/1024)); |
1667 |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
1668 |
if (cpu->machine->md.pc.columns <= 40) |
if (cpu->machine->md.pc.columns <= 40) |
1669 |
pc_bios_printstr(cpu, "\n ", 0x07); |
pc_bios_printstr(cpu, "\n ", 0x07); |
1670 |
sprintf(t, " (CHS=%i,%i,%i)", p->cylinders, p->heads, |
snprintf(t, sizeof(t), " (CHS=%i,%i,%i)", p->cylinders, |
1671 |
p->sectorspertrack); |
p->heads, p->sectorspertrack); |
1672 |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
1673 |
if (boot_id == i && boot_type == DISKIMAGE_FLOPPY) { |
if (boot_id == i && boot_type == DISKIMAGE_FLOPPY) { |
1674 |
bios_boot_id = i; |
bios_boot_id = i; |
1684 |
if (diskimage_exist(cpu->machine, i, DISKIMAGE_IDE)) { |
if (diskimage_exist(cpu->machine, i, DISKIMAGE_IDE)) { |
1685 |
struct pc_bios_disk *p; |
struct pc_bios_disk *p; |
1686 |
p = add_disk(cpu->machine, disknr, i, DISKIMAGE_IDE); |
p = add_disk(cpu->machine, disknr, i, DISKIMAGE_IDE); |
1687 |
sprintf(t, "%s", disknr==0x80? "C:" : " "); |
snprintf(t, sizeof(t), "%s", disknr==0x80? "C:" : " "); |
1688 |
pc_bios_printstr(cpu, t, 0xf); |
pc_bios_printstr(cpu, t, 0xf); |
1689 |
nhds ++; |
nhds ++; |
1690 |
sprintf(t, " (bios disk %02x) IDE %s, id %i", |
snprintf(t, sizeof(t), |
1691 |
|
" (bios disk %02x) IDE %s, id %i", |
1692 |
disknr, diskimage_is_a_cdrom(cpu->machine, i, |
disknr, diskimage_is_a_cdrom(cpu->machine, i, |
1693 |
DISKIMAGE_IDE)? "cdrom" : ( |
DISKIMAGE_IDE)? "cdrom" : ( |
1694 |
diskimage_is_a_tape(cpu->machine, i, |
diskimage_is_a_tape(cpu->machine, i, |
1700 |
else |
else |
1701 |
pc_bios_printstr(cpu, ", ", |
pc_bios_printstr(cpu, ", ", |
1702 |
cpu->machine->md.pc.curcolor); |
cpu->machine->md.pc.curcolor); |
1703 |
sprintf(t, "%lli MB", (long long) (p->size >> 20)); |
snprintf(t, sizeof(t), "%lli MB", (long long) |
1704 |
|
(p->size >> 20)); |
1705 |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
1706 |
if (boot_id == i && boot_type == DISKIMAGE_IDE) { |
if (boot_id == i && boot_type == DISKIMAGE_IDE) { |
1707 |
bios_boot_id = disknr; |
bios_boot_id = disknr; |
1717 |
if (diskimage_exist(cpu->machine, i, DISKIMAGE_SCSI)) { |
if (diskimage_exist(cpu->machine, i, DISKIMAGE_SCSI)) { |
1718 |
struct pc_bios_disk *p; |
struct pc_bios_disk *p; |
1719 |
p = add_disk(cpu->machine, disknr, i, DISKIMAGE_SCSI); |
p = add_disk(cpu->machine, disknr, i, DISKIMAGE_SCSI); |
1720 |
sprintf(t, "%s", disknr==0x80? "C:" : " "); |
snprintf(t, sizeof(t), "%s", disknr==0x80? "C:" : " "); |
1721 |
pc_bios_printstr(cpu, t, 0xf); |
pc_bios_printstr(cpu, t, 0xf); |
1722 |
nhds ++; |
nhds ++; |
1723 |
sprintf(t, " (bios disk %02x) SCSI disk, id %i", |
snprintf(t, sizeof(t), |
1724 |
disknr, i); |
" (bios disk %02x) SCSI disk, id %i", disknr, i); |
1725 |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
1726 |
if (cpu->machine->md.pc.columns <= 40) |
if (cpu->machine->md.pc.columns <= 40) |
1727 |
pc_bios_printstr(cpu, "\n ", 0x07); |
pc_bios_printstr(cpu, "\n ", 0x07); |
1728 |
else |
else |
1729 |
pc_bios_printstr(cpu, ", ", |
pc_bios_printstr(cpu, ", ", |
1730 |
cpu->machine->md.pc.curcolor); |
cpu->machine->md.pc.curcolor); |
1731 |
sprintf(t, "%lli MB", (long long) (p->size >> 20)); |
snprintf(t, sizeof(t), "%lli MB", (long long) |
1732 |
|
(p->size >> 20)); |
1733 |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
pc_bios_printstr(cpu, t, cpu->machine->md.pc.curcolor); |
1734 |
if (boot_id == i && boot_type == DISKIMAGE_SCSI) { |
if (boot_id == i && boot_type == DISKIMAGE_SCSI) { |
1735 |
bios_boot_id = disknr; |
bios_boot_id = disknr; |