]> git.sesse.net Git - pistorm/blob - platforms/amiga/pistorm-dev/pistorm-dev-enums.h
a406b1854661e80429cf329c1a8b0db1ba8907aa
[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_FILESIZE         = 0x0100, // [R] Get the file size for file on the Pi side using the path
26                                       //     at PI_STR1, if it exists.
27     PI_CMD_TRANSFERFILE     = 0x0104, // [W] Transfer over a file from the Pi to Amiga RAM.
28     PI_CMD_MEMCPY           = 0x0108, // [W] Copy written longword of bytes from one area of memory (PTR1)
29                                       //     to another (PTR2).
30     PI_CMD_GET_FB           = 0x010C, // [R] Get the current framebuffer address.
31     PI_CMD_COPYRECT         = 0x0110, // [W] Generic memory copyrect with source and destination pitch.
32     PI_CMD_COPYRECT_EX      = 0x0112, // [W] Extended memory copyrect with additional source/destination X/Y coordinates.
33     PI_CMD_MEMSET           = 0x0114, // [W] Accelerated memset functionality to quickly clear a region of memory to a specific value.
34     PI_CMD_SHOWFPS          = 0x0118, // [W] Enable/disable RTG FPS display.
35     PI_CMD_PALETTEDEBUG     = 0x011A, // [W] Enable/disable RTG palette debug.
36
37     PI_CMD_QBASIC           = 0x0FFC, // QBasic
38     PI_CMD_NIBBLES          = 0x0FFE, // Nibbles
39
40     PI_DBG_MSG              = 0x1000, // [W] Trigger debug message output to avoid slow serial kprintf.
41     PI_DBG_VAL1             = 0x1010, // [RW]
42     PI_DBG_VAL2             = 0x1014, // [RW]
43     PI_DBG_VAL3             = 0x1018, // [RW]
44     PI_DBG_VAL4             = 0x101C, // [RW]
45     PI_DBG_VAL5             = 0x1020, // [RW]
46     PI_DBG_VAL6             = 0x1024, // [RW]
47     PI_DBG_VAL7             = 0x1028, // [RW]
48     PI_DBG_VAL8             = 0x102C, // [RW]
49     PI_DBG_STR1             = 0x1030, // [W] Pointers to debug strings (typically in Amiga RAM)
50     PI_DBG_STR2             = 0x1034, // [W]
51     PI_DBG_STR3             = 0x1038, // [W]
52     PI_DBG_STR4             = 0x103C, // [W]
53
54     PI_CMD_SHUTDOWN         = 0x1FFC, // [W] Initiate requesting the Pi to shut down
55     PI_CMD_CONFIRMSHUTDOWN  = 0x1FFE, // [W] Confirm shutting down the Pi
56
57     PI_BYTE1                = 0x2000, // [RW] // Bytes, words and longwords used as extended arguments.
58     PI_BYTE2                = 0x2001, // [RW] // for PiStorm interaction device commands.
59     PI_BYTE3                = 0x2002, // [RW]
60     PI_BYTE4                = 0x2003, // [RW]
61     PI_BYTE5                = 0x2004, // [RW]
62     PI_BYTE6                = 0x2005, // [RW]
63     PI_BYTE7                = 0x2006, // [RW]
64     PI_BYTE8                = 0x2007, // [RW]
65     PI_WORD1                = 0x2008, // [RW]
66     PI_WORD2                = 0x200A, // [RW]
67     PI_WORD3                = 0x200C, // [RW]
68     PI_WORD4                = 0x200E, // [RW]
69     PI_LONGWORD1            = 0x2010, // [RW]
70     PI_LONGWORD2            = 0x2014, // [RW]
71     PI_LONGWORD3            = 0x2018, // [RW]
72     PI_LONGWORD4            = 0x201C, // [RW]
73     PI_STR1                 = 0x2020, // [W] Pointers to strings (typically in Amiga RAM)
74     PI_STR2                 = 0x2024, // [W]
75     PI_STR3                 = 0x2028, // [W]
76     PI_STR4                 = 0x202C, // [W]
77     PI_PTR1                 = 0x2030, // [W] Pointers to allocated memory in Amiga RAM.
78     PI_PTR2                 = 0x2034, // [W] For instance for loading large files to Amiga RAM or
79     PI_PTR3                 = 0x2038, // [W] transferring over files from the Pi side of things.
80     PI_PTR4                 = 0x203C, // [W]
81     PI_WORD5                = 0x2040, // [RW]
82     PI_WORD6                = 0x2042, // [RW]
83     PI_WORD7                = 0x2044, // [RW]
84     PI_WORD8                = 0x2046, // [RW]
85     PI_WORD9                = 0x2048, // [RW]
86     PI_WORD10               = 0x204A, // [RW]
87     PI_WORD11               = 0x204C, // [RW]
88     PI_WORD12               = 0x204E, // [RW]
89
90     PI_CMDRESULT            = 0x2100, // [R] Check the result of any command that provides a "return value".
91 };
92
93 enum pistorm_piscsi_commands {
94     PISCSI_CTRL_NONE,
95     PISCSI_CTRL_MAP,        // For hard drives
96     PISCSI_CTRL_UNMAP,      //
97     PISCSI_CTRL_EJECT,      // For optical media, not yet implemented
98     PISCSI_CTRL_INSERT,     //
99     PISCSI_CTRL_ENABLE,     // Enable PiSCSI
100     PISCSI_CTRL_DISABLE,    // Disable PiSCSI
101     PISCSI_CTRL_NUM,
102 };
103
104 enum pistorm_config_commands {
105     PICFG_LOAD,             // Load a config file from string at PI_STR1
106     PICFG_RELOAD,           // Reload current config file, in case hard drives or ROM has been changed
107     PICFG_DEFAULT,          // Load default.cfg if it exists
108     PICFG_NUM,
109 };
110
111 enum pistorm_command_results {
112     PI_RES_OK,
113     PI_RES_FAILED,
114     PI_RES_NOCHANGE,
115     PI_RES_FILENOTFOUND,
116     PI_RES_INVALIDVALUE,
117     PI_RES_INVALIDCMD,
118     PI_RES_NUM,
119 };