~ubuntu-branches/ubuntu/dapper/vice/dapper

« back to all changes in this revision

Viewing changes to src/monitor/mon_registerz80.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2004-08-26 13:35:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040826133551-gcje8j31q5cqgdq2
Tags: 1.14-3
Apply patch from Spiro Trikaliotis <vice@trikaliotis.net> to fix a
problem that some users were experiencing with a floating point
exception on startup related to the fullscreen option being enabled
during compile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * mon_registerz80.c - The VICE built-in monitor Z80 register functions.
3
3
 *
4
4
 * Written by
5
 
 *  Andreas Boose <boose@linux.rz.fh-hannover.de>
 
5
 *  Andreas Boose <viceteam@t-online.de>
6
6
 *
7
7
 * This file is part of VICE, the Versatile Commodore Emulator.
8
8
 * See README for copyright notice.
29
29
#include <stdio.h>
30
30
#include <string.h>
31
31
 
 
32
#include "lib.h"
32
33
#include "log.h"
33
34
#include "mon_register.h"
34
35
#include "mon_util.h"
35
36
#include "montypes.h"
36
37
#include "uimon.h"
37
 
#include "utils.h"
38
38
#include "z80regs.h"
39
39
 
 
40
 
40
41
static unsigned int mon_register_get_val(int mem, int reg_id)
41
42
{
42
43
    z80_regs_t *reg_ptr;
43
44
 
44
 
    if (mem == e_disk8_space) {
45
 
        if (!check_drive_emu_level_ok(8))
46
 
            return 0;
47
 
    }
48
 
    if (mem == e_disk9_space) {
49
 
        if (!check_drive_emu_level_ok(9))
50
 
            return 0;
51
 
    }
 
45
    if (monitor_diskspace_dnr(mem) >= 0)
 
46
        if (!check_drive_emu_level_ok(monitor_diskspace_dnr(mem) + 8))
 
47
            return 0;
52
48
 
53
49
    reg_ptr = mon_interfaces[mem]->z80_cpu_regs;
54
50
 
91
87
{
92
88
    z80_regs_t *reg_ptr;
93
89
 
94
 
    if (mem == e_disk8_space) {
95
 
        if (!check_drive_emu_level_ok(8))
96
 
            return;
97
 
    }
98
 
    if (mem == e_disk9_space) {
99
 
        if (!check_drive_emu_level_ok(9))
100
 
            return;
101
 
    }
 
90
    if (monitor_diskspace_dnr(mem) >= 0)
 
91
        if (!check_drive_emu_level_ok(monitor_diskspace_dnr(mem) + 8))
 
92
            return;
102
93
 
103
94
    reg_ptr = mon_interfaces[mem]->z80_cpu_regs;
104
95
 
156
147
{
157
148
    z80_regs_t *regs;
158
149
 
159
 
    if (mem == e_disk8_space) {
160
 
        if (!check_drive_emu_level_ok(8))
161
 
            return;
162
 
    } else if (mem == e_disk9_space) {
163
 
        if (!check_drive_emu_level_ok(9))
 
150
 
 
151
    if (monitor_diskspace_dnr(mem) >= 0) {
 
152
        if (!check_drive_emu_level_ok(monitor_diskspace_dnr(mem) + 8))
164
153
            return;
165
154
    } else if (mem != e_comp_space) {
166
155
        log_error(LOG_ERR, "Unknown memory space!");
170
159
 
171
160
    mon_out("  ADDR AF   BC   DE   HL   IX   IY   SP   I  R  AF'  BC'  DE'  HL'\n");
172
161
    mon_out(".;%04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %04x %04x %04x %04x\n",
173
 
              mon_register_get_val(mem, e_PC),
 
162
              addr_location(mon_register_get_val(mem, e_PC)),
174
163
              mon_register_get_val(mem, e_AF),
175
164
              mon_register_get_val(mem, e_BC),
176
165
              mon_register_get_val(mem, e_DE),
190
179
{
191
180
    mon_reg_list_t *mon_reg_list;
192
181
 
193
 
    mon_reg_list = (mon_reg_list_t *)xmalloc(sizeof(mon_reg_list_t) * 14);
 
182
    mon_reg_list = (mon_reg_list_t *)lib_malloc(sizeof(mon_reg_list_t) * 14);
194
183
 
195
184
    mon_reg_list[0].name = "PC";
196
185
    mon_reg_list[0].val = (unsigned int)mon_register_get_val(mem, e_PC);