OXYGENHUB
# 9120e87480a6 enhanced-x16-emulator / src / debug_ui / io_reg_info.h
2.1 KiB · Objective-C · last changed chore(): initial commit 26 days ago source blame history raw
9120e874 Andy McCall 1
// Commander X16 Emulator — names and purposes for the I/O page registers.
2
//
3
// The Activity log and the VIA tab both show raw addresses, and a raw address
4
// is not something anyone should have to look up in a manual mid-debug. This
5
// maps $9F00-$9FFF to a short column-width name and a tooltip-length
6
// description of what the register is for.
7
//
8
// Sourced from the emulator's own decode -- video.c, via.c, memory.c and
9
// ymglue.h -- rather than from the reference manual, so what is described is
10
// what this emulator actually does. Where the two differ, the code wins,
11
// because the code is what the user is looking at.
12
#ifndef DEBUG_UI_IO_REG_INFO_H
13
#define DEBUG_UI_IO_REG_INFO_H
14
15
#include <stdint.h>
16
17
#ifdef __cplusplus
18
extern "C" {
19
#endif
20
21
// Short identifier for an I/O address, e.g. "DATA0", "T1C_L", "SPI_CTRL".
22
// Never NULL -- unmapped addresses report "-".
23
//
24
// A trailing '*' means the register is banked and its identity depends on
25
// machine state the log cannot recover after the fact: the four VERA registers
26
// at $9F29-$9F2C are selected by DCSEL, so a historical access cannot be
27
// attributed to one meaning with certainty.
28
const char *io_reg_name(uint16_t addr);
29
30
// One or two sentences on what the register does, for a tooltip. Never NULL.
31
const char *io_reg_purpose(uint16_t addr);
32
33
// What a VIA port pin is physically wired to on the X16, for `which` 0 (VIA1)
34
// or 1 (VIA2), port 'A' or 'B', bit 0-7. Never NULL.
35
const char *io_via_pin_name(int which, char port, int bit);
36
37
// Name of a 65C22 IFR/IER bit, 0-7.
38
const char *io_via_irq_bit_name(int bit);
39
40
// Name of an SMC register offset, and what it does. Both never NULL.
41
const char *io_smc_reg_name(uint8_t reg);
42
const char *io_smc_reg_purpose(uint8_t reg);
43
44
// Name of an RTC register offset. Never NULL.
45
const char *io_rtc_reg_name(uint8_t reg);
46
47
// What a DOS command sent to the command channel does, e.g. "S:NAME" ->
48
// "delete a file". Returns "" when the command is not recognised, so callers
49
// can print it unconditionally. Never NULL.
50
const char *io_dos_command_meaning(const char *cmd);
51
52
#ifdef __cplusplus
53
}
54
#endif
55
56
#endif