]> git.sesse.net Git - pistorm/blob - platforms/amiga/pistorm-dev/pistorm-dev-enums.h
ece375d31ed3a538f53bb13100274ffdde418371
[pistorm] / platforms / amiga / pistorm-dev / pistorm-dev-enums.h
1 // SPDX-License-Identifier: MIT
2
3 // Currently "2011" / 0x07DB - Defined as "Reserved for Hackers Only" in old Commodore documentation
4 #define PISTORM_AC_MANUF_ID 0x0, 0x7, 0xD, 0xB
5
6 // [R], [W] and [RW] indicate read, write or both access modes for register
7 // Any failure or result code from a write command should be put in PI_CMDRESULT
8 enum pistorm_dev_cmds {
9     PI_CMD_RESET        = 0x00, // [W] Reset the host system.
10     PI_CMD_SWITCHCONFIG = 0x02, // [W] Switch config file to string at PI_STR1, if it exists.
11                                 //     This will reset the Amiga if the config loads successfully.
12     PI_CMD_PISCSI_CTRL  = 0x04, // [RW] Write: Control a PiSCSI device. The command written here uses
13                                 //      values From various data registers around $2000.
14                                 //      Read: Returns whether PiSCSI is enabled or not.
15     PI_CMD_RTGSTATUS    = 0x06, // [RW] Read: Check RTG status Write: Set RTG status (enabled/disabled)
16     PI_CMD_NETSTATUS    = 0x08, // [RW] Read: Check ETH status Write: Set ETH status (enabled/disabled)
17     PI_CMD_KICKROM      = 0x0A, // [W] Map a different Kickstart ROM to the standard address using
18                                 //     the string at PI_STR1, if the file exists. Requires some config
19                                 //     file names to be set in order to find it.
20     PI_CMD_EXTROM       = 0x0E, // [W] Same as above, but the extended ROM.
21
22     PI_CMD_HWREV        = 0x10, // [R] Check the PiStorm hardware version/revision
23     PI_CMD_SWREV        = 0x12, // [R] Check the PiStorm software version/revision
24
25     PI_CMD_QBASIC       = 0x0FFC, // QBasic
26     PI_CMD_NIBBLES      = 0x0FFE, // Nibbles
27
28     PI_DBG_MSG          = 0x1000, // [W] Trigger debug message output to avoid slow serial kprintf.
29     PI_DBG_VAL1         = 0x1010, // [RW]
30     PI_DBG_VAL2         = 0x1014, // [RW]
31     PI_DBG_VAL3         = 0x1018, // [RW]
32     PI_DBG_VAL4         = 0x101C, // [RW]
33     PI_DBG_VAL5         = 0x1020, // [RW]
34     PI_DBG_VAL6         = 0x1024, // [RW]
35     PI_DBG_VAL7         = 0x1028, // [RW]
36     PI_DBG_VAL8         = 0x102C, // [RW]
37     PI_DBG_STR1         = 0x1030, // [W] Pointers to debug strings (typically in "Amiga RAM")
38     PI_DBG_STR2         = 0x1034, // [W]
39     PI_DBG_STR3         = 0x1038, // [W]
40     PI_DBG_STR4         = 0x103C, // [W]
41
42     PI_BYTE1            = 0x2000, // [RW] // Bytes, words and longwords used as extended arguments.
43     PI_BYTE2            = 0x2001, // [RW] // for PiStorm interaction device commands.
44     PI_BYTE3            = 0x2002, // [RW]
45     PI_BYTE4            = 0x2003, // [RW]
46     PI_BYTE5            = 0x2004, // [RW]
47     PI_BYTE6            = 0x2005, // [RW]
48     PI_BYTE7            = 0x2006, // [RW]
49     PI_BYTE8            = 0x2007, // [RW]
50     PI_WORD1            = 0x2008, // [RW]
51     PI_WORD2            = 0x200A, // [RW]
52     PI_WORD3            = 0x200C, // [RW]
53     PI_WORD4            = 0x200E, // [RW]
54     PI_LONGWORD1        = 0x2010, // [RW]
55     PI_LONGWORD2        = 0x2014, // [RW]
56     PI_LONGWORD3        = 0x2018, // [RW]
57     PI_LONGWORD4        = 0x201C, // [RW]
58     PI_STR1             = 0x2020, // [W] Pointers to strings (typically in "Amiga RAM")
59     PI_STR2             = 0x2024, // [W]
60     PI_STR3             = 0x2028, // [W]
61     PI_STR4             = 0x202C, // [W]
62
63     PI_CMDRESULT        = 0x2100, // [R] Check the result of any command that provides a "return value".
64 };
65
66 enum pistorm_piscsi_commands {
67     PISCSI_CTRL_NONE,
68     PISCSI_CTRL_MAP,        // For hard drives
69     PISCSI_CTRL_UNMAP,      //
70     PISCSI_CTRL_EJECT,      // For optical media, not yet implemented
71     PISCSI_CTRL_INSERT,     //
72     PISCSI_CTRL_ENABLE,     // Enable PiSCSI
73     PISCSI_CTRL_DISABLE,    // Disable PiSCSI
74     PISCSI_CTRL_NUM,
75 };
76
77 enum pistorm_config_commands {
78     PICFG_LOAD,             // Load a config file from string at PI_STR1
79     PICFG_RELOAD,           // Reload current config file, in case hard drives or ROM has been changed
80     PICFG_DEFAULT,          // Load default.cfg if it exists
81     PICFG_NUM,
82 };
83
84 enum pistorm_command_results {
85     PI_RES_OK,
86     PI_RES_FAILED,
87     PI_RES_NOCHANGE,
88     PI_RES_FILENOTFOUND,
89     PI_RES_INVALIDVALUE,
90     PI_RES_INVALIDCMD,
91     PI_RES_NUM,
92 };