1 // SPDX-License-Identifier: MIT
3 // Currently "2011" / 0x07DB - Defined as "Reserved for Hackers Only" in old Commodore documentation
4 #define PISTORM_AC_MANUF_ID 0x0, 0x7, 0xD, 0xB
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.
22 PI_CMD_HWREV = 0x10, // [R] Check the PiStorm hardware version/revision
23 PI_CMD_SWREV = 0x12, // [R] Check the PiStorm software version/revision
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)
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 PI_CMD_MEMCPY_Q = 0x0120, // [W] CopyMemQuick debug thing
38 PI_CMD_QBASIC = 0x0FFC, // QBasic
39 PI_CMD_NIBBLES = 0x0FFE, // Nibbles
41 PI_DBG_MSG = 0x1000, // [W] Trigger debug message output to avoid slow serial kprintf.
42 PI_DBG_VAL1 = 0x1010, // [RW]
43 PI_DBG_VAL2 = 0x1014, // [RW]
44 PI_DBG_VAL3 = 0x1018, // [RW]
45 PI_DBG_VAL4 = 0x101C, // [RW]
46 PI_DBG_VAL5 = 0x1020, // [RW]
47 PI_DBG_VAL6 = 0x1024, // [RW]
48 PI_DBG_VAL7 = 0x1028, // [RW]
49 PI_DBG_VAL8 = 0x102C, // [RW]
50 PI_DBG_STR1 = 0x1030, // [W] Pointers to debug strings (typically in Amiga RAM)
51 PI_DBG_STR2 = 0x1034, // [W]
52 PI_DBG_STR3 = 0x1038, // [W]
53 PI_DBG_STR4 = 0x103C, // [W]
55 PI_CMD_SHUTDOWN = 0x1FFC, // [W] Initiate requesting the Pi to shut down
56 PI_CMD_CONFIRMSHUTDOWN = 0x1FFE, // [W] Confirm shutting down the Pi
58 PI_BYTE1 = 0x2000, // [RW] // Bytes, words and longwords used as extended arguments.
59 PI_BYTE2 = 0x2001, // [RW] // for PiStorm interaction device commands.
60 PI_BYTE3 = 0x2002, // [RW]
61 PI_BYTE4 = 0x2003, // [RW]
62 PI_BYTE5 = 0x2004, // [RW]
63 PI_BYTE6 = 0x2005, // [RW]
64 PI_BYTE7 = 0x2006, // [RW]
65 PI_BYTE8 = 0x2007, // [RW]
66 PI_WORD1 = 0x2008, // [RW]
67 PI_WORD2 = 0x200A, // [RW]
68 PI_WORD3 = 0x200C, // [RW]
69 PI_WORD4 = 0x200E, // [RW]
70 PI_LONGWORD1 = 0x2010, // [RW]
71 PI_LONGWORD2 = 0x2014, // [RW]
72 PI_LONGWORD3 = 0x2018, // [RW]
73 PI_LONGWORD4 = 0x201C, // [RW]
74 PI_STR1 = 0x2020, // [W] Pointers to strings (typically in Amiga RAM)
75 PI_STR2 = 0x2024, // [W]
76 PI_STR3 = 0x2028, // [W]
77 PI_STR4 = 0x202C, // [W]
78 PI_PTR1 = 0x2030, // [W] Pointers to allocated memory in Amiga RAM.
79 PI_PTR2 = 0x2034, // [W] For instance for loading large files to Amiga RAM or
80 PI_PTR3 = 0x2038, // [W] transferring over files from the Pi side of things.
81 PI_PTR4 = 0x203C, // [W]
82 PI_WORD5 = 0x2040, // [RW]
83 PI_WORD6 = 0x2042, // [RW]
84 PI_WORD7 = 0x2044, // [RW]
85 PI_WORD8 = 0x2046, // [RW]
86 PI_WORD9 = 0x2048, // [RW]
87 PI_WORD10 = 0x204A, // [RW]
88 PI_WORD11 = 0x204C, // [RW]
89 PI_WORD12 = 0x204E, // [RW]
91 PI_CMDRESULT = 0x2100, // [R] Check the result of any command that provides a "return value".
94 enum pistorm_piscsi_commands {
96 PISCSI_CTRL_MAP, // For hard drives
98 PISCSI_CTRL_EJECT, // For optical media, not yet implemented
99 PISCSI_CTRL_INSERT, //
100 PISCSI_CTRL_ENABLE, // Enable PiSCSI
101 PISCSI_CTRL_DISABLE, // Disable PiSCSI
105 enum pistorm_config_commands {
106 PICFG_LOAD, // Load a config file from string at PI_STR1
107 PICFG_RELOAD, // Reload current config file, in case hard drives or ROM has been changed
108 PICFG_DEFAULT, // Load default.cfg if it exists
112 enum pistorm_command_results {