init_banks(), reset_banks(), bank_port(), switch_bank(), clear_memory(),
memory_at(), read_addr(), read_memo(), write_memo(), write_to_memory(!),
dma_write(), dma_read() - total memory access
int init_banks(char *rom_path, char *bank_mapping_descr);
unsigned bank_port(unsigned char id);
void switch_bank(unsigned char id, unsigned i);
unsigned char memory_at(unsigned short index);
unsigned char * io_address;
unsigned char read_addr(unsigned short index);
unsigned char read_memo(unsigned short index);
void write_memo(unsigned short index, unsigned char data);
unsigned char write_to_memory(unsigend short index, unsigned char data);
unsigned dma_write(unsigned short offset, unsigned count, FILE *from);
unsigned dma_read(unsigned short offset, unsigned count, FILE *to);
These functions provide all memory access and also read data from external
- initializes the bank handling and reads the bank contents from the
directory *rom_path with the file *bank_mapping_descr
containing the bank mapping description. It returns the number of usable
bank entries in the description file.
- does a reset to the banks meaning going to the default
- can be used to test a port whether it is reserved for bank switching. If
this is the case it returns the positive bank port no else 0.
- switches the bank id into memory at the position defined by bank
port no i.
- sets these parts of the 64kB RAM to 0 which are writeable.
- returns the byte value at position index in the memory. Can not be
used by the decoding or execution unit of the CPU because it by-passes the
- holds the location of an external supplied byte by the hardware.
- returns the byte value correspoing to the address index. This may
be an IO-address in which case io_address is just to locate the
- returns the byte value correspoing to the address index from
- writes the byte value data into memory at address index
provided this address is writeable.
- writes the byte value data to address index provided this
address is writeable. It returns the previous value at the address. This
function can not be used by the execution unit because it by-passes the
CPU. It is demanded from compile(void) which is called from
- transfers into memory starting at address offset count many
bytes directly from file from by passing the CPU.
- transfers from memory address offset count many bytes
directly into file to by passing the CPU.