#ifndef INCLUDED_BUSSES_H #define INCLUDED_BUSSES_H #include #include #include "connections.h" #define IS_BUS_FREE(bus) ((bus)->reserved_connection == CONNECTION_NONE) #define FREE_BUS(bus) ((bus)->reserved_connection = CONNECTION_NONE) typedef struct bus { int reserved_connection; int connection_targets; bool linked; CONNECTION cache_connections[CPU_COUNT]; CONNECTION memory_connection; float y; float scale; Color color; char *label; Vector2 label_size; } *BUS; extern int *cache_locking_busses; extern int *bus_cycles; extern BUS data_bus; extern BUS addr_bus; extern BUS shared_bus; void init_bus (BUS, CONNECTION caches[CPU_COUNT], CONNECTION memory, float y, float scale, Color, char *label); void draw_bus (BUS); void bus_link_connection (BUS, CONNECTION); void bus_unlink_connection (BUS); void bus_link_connections (BUS, CONNECTION cons[CPU_COUNT]); #endif