fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1/*****************************************************************************
2 * pce *
3 *****************************************************************************/
4
5/*****************************************************************************
6 * File name: src/lib/monitor.h *
7 * Created: 2006-12-13 by Hampa Hug <hampa@hampa.ch> *
8 * Copyright: (C) 2006-2013 Hampa Hug <hampa@hampa.ch> *
9 *****************************************************************************/
10
11/*****************************************************************************
12 * This program is free software. You can redistribute it and / or modify it *
13 * under the terms of the GNU General Public License version 2 as published *
14 * by the Free Software Foundation. *
15 * *
16 * This program is distributed in the hope that it will be useful, but *
17 * WITHOUT ANY WARRANTY, without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
19 * Public License for more details. *
20 *****************************************************************************/
21
22
23#ifndef PCE_LIB_MONITOR_H
24#define PCE_LIB_MONITOR_H 1
25
26
27#include <lib/cmd.h>
28
29
30typedef struct {
31 const char *cmd;
32 const char *par;
33 const char *text;
34} mon_cmd_t;
35
36
37typedef struct {
38 void *cmdext;
39 int (*docmd) (void *ext, cmd_t *cmd);
40
41 void *msgext;
42 int (*setmsg) (void *ext, const char *msg, const char *val);
43
44 void *get_mem8_ext;
45 unsigned char (*get_mem8) (void *ext, unsigned long addr);
46
47 void *set_mem8_ext;
48 void (*set_mem8) (void *ext, unsigned long addr, unsigned char val);
49
50 void *set_mem8rw_ext;
51 void (*set_mem8rw) (void *ext, unsigned long addr, unsigned char val);
52
53 unsigned memory_mode;
54
55 unsigned short default_seg;
56
57 unsigned long last_addr;
58 unsigned short last_ofs;
59
60 unsigned cmd_cnt;
61 mon_cmd_t *cmd;
62
63 char rw;
64 char terminate;
65
66 const char *prompt;
67} monitor_t;
68
69
70void mon_init (monitor_t *mon);
71void mon_free (monitor_t *mon);
72
73monitor_t *mon_new (void);
74void mon_del (monitor_t *mon);
75
76void mon_set_cmd_fct (monitor_t *mon, void *fct, void *ext);
77void mon_set_msg_fct (monitor_t *mon, void *fct, void *ext);
78
79void mon_set_get_mem_fct (monitor_t *mon, void *ext, void *fct);
80void mon_set_set_mem_fct (monitor_t *mon, void *ext, void *fct);
81void mon_set_set_memrw_fct (monitor_t *mon, void *ext, void *fct);
82
83void mon_set_memory_mode (monitor_t *mon, unsigned mode);
84
85void mon_set_terminate (monitor_t *mon, int val);
86
87void mon_set_prompt (monitor_t *mon, const char *str);
88
89int mon_cmd_add (monitor_t *mon, const mon_cmd_t *cmd, unsigned cnt);
90int mon_cmd_add_bp (monitor_t *mon);
91
92int mon_run (monitor_t *mon);
93
94
95#endif