diff options
Diffstat (limited to 'src/busses.h')
| -rw-r--r-- | src/busses.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/busses.h b/src/busses.h new file mode 100644 index 0000000..9c08f25 --- /dev/null +++ b/src/busses.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | #ifndef INCLUDED_BUSSES_H | ||
| 2 | #define INCLUDED_BUSSES_H | ||
| 3 | |||
| 4 | #include <raylib.h> | ||
| 5 | #include <inttypes.h> | ||
| 6 | #include "connections.h" | ||
| 7 | |||
| 8 | #define IS_BUS_FREE(bus) ((bus)->reserved_connection == CONNECTION_NONE) | ||
| 9 | #define FREE_BUS(bus) ((bus)->reserved_connection = CONNECTION_NONE) | ||
| 10 | |||
| 11 | typedef struct bus { | ||
| 12 | int reserved_connection; | ||
| 13 | int connection_targets; | ||
| 14 | bool linked; | ||
| 15 | CONNECTION cache_connections[CPU_COUNT]; | ||
| 16 | CONNECTION memory_connection; | ||
| 17 | float y; | ||
| 18 | float scale; | ||
| 19 | Color color; | ||
| 20 | char *label; | ||
| 21 | Vector2 label_size; | ||
| 22 | } *BUS; | ||
| 23 | |||
| 24 | extern int *cache_locking_busses; | ||
| 25 | extern int *bus_cycles; | ||
| 26 | extern BUS data_bus; | ||
| 27 | extern BUS addr_bus; | ||
| 28 | extern BUS shared_bus; | ||
| 29 | |||
| 30 | void init_bus (BUS, CONNECTION caches[CPU_COUNT], CONNECTION memory, float y, float scale, Color, char *label); | ||
| 31 | void draw_bus (BUS); | ||
| 32 | void bus_link_connection (BUS, CONNECTION); | ||
| 33 | void bus_unlink_connection (BUS); | ||
| 34 | void bus_link_connections (BUS, CONNECTION cons[CPU_COUNT]); | ||
| 35 | |||
| 36 | #endif | ||
