2018-01-02 22:26:11 +00:00
|
|
|
#ifndef _APPLE2_MEM_H_
|
|
|
|
#define _APPLE2_MEM_H_
|
|
|
|
|
2018-01-02 22:30:21 +00:00
|
|
|
#include "apple2.h"
|
2018-01-02 22:26:11 +00:00
|
|
|
#include "vm_segment.h"
|
|
|
|
|
2018-01-11 19:19:17 +00:00
|
|
|
/*
|
|
|
|
* The MOS 6502 expects 64k of addressable space, but the Apple II
|
|
|
|
* technically has 68k of memory in each bank. (Along with having both a
|
|
|
|
* main and an auxiliary memory bank, with identical address schemes.)
|
|
|
|
* This is handled through bank-switching; the additional memory (which
|
|
|
|
* is accessible through $D000 - $DFFF) is actually stored in the
|
|
|
|
* 64k-68k block at the end.
|
|
|
|
*/
|
|
|
|
#define APPLE2_MEMORY_SIZE 0x11000
|
|
|
|
|
2018-01-09 21:56:21 +00:00
|
|
|
/*
|
|
|
|
* Given a slot number (1-7), this will return the memory page address
|
|
|
|
* for the site of the ROM that is associated for the peripheral that
|
|
|
|
* would be connected there.
|
|
|
|
*/
|
|
|
|
#define APPLE2_PERIPHERAL_SLOT(n) \
|
|
|
|
(0xC000 + (n << 8))
|
|
|
|
|
|
|
|
/*
|
2018-01-15 23:10:27 +00:00
|
|
|
* This is the total size of the ROM we hold devoted to peripherals. It
|
|
|
|
* is meant to be mapped directly to the entire $C000..$CFFF space; it's
|
|
|
|
* zero-padded for the $C0 page, and is also zero-padded in $C8..$CF;
|
|
|
|
* the latter being reserved for expansion peripheral ROM usage, and the
|
|
|
|
* former for the I/O soft switches that the Apple II has.
|
2018-01-09 21:56:21 +00:00
|
|
|
*/
|
2018-01-15 23:10:27 +00:00
|
|
|
#define APPLE2_PERIPHERAL_SIZE 0x1000
|
2018-01-09 21:56:21 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Peripheral ROM can only occupy a single page in memory.
|
|
|
|
*/
|
|
|
|
#define APPLE2_PERIPHERAL_PAGE 0x100
|
|
|
|
|
|
|
|
/*
|
|
|
|
* System ROM requires a full 16k; part of it is copied into several
|
|
|
|
* pages beginning at $C800, and much more go into $D000 - $FFFF.
|
|
|
|
*/
|
|
|
|
#define APPLE2_SYSROM_SIZE 0x4000
|
2018-01-03 21:07:19 +00:00
|
|
|
|
|
|
|
/*
|
2018-01-15 23:10:27 +00:00
|
|
|
* The size of our block of ROM is 20k; 16k for internal ROM, 4k to
|
|
|
|
* contain all of the peripheral ROM above.
|
2018-01-03 21:07:19 +00:00
|
|
|
*/
|
2018-01-15 23:10:27 +00:00
|
|
|
#define APPLE2_ROM_SIZE 0x5000
|
2018-01-03 21:07:19 +00:00
|
|
|
|
2018-01-11 02:36:44 +00:00
|
|
|
/*
|
|
|
|
* At the highest point (with the IIe extended 80 column text card), you
|
|
|
|
* could have a whole other 64k of data in auxiliary memory. (Of which
|
|
|
|
* only 1k was needed for 80 columns!)
|
|
|
|
*/
|
|
|
|
#define APPLE2_AUX_SIZE 0x10000
|
|
|
|
|
2018-01-03 21:07:19 +00:00
|
|
|
/*
|
|
|
|
* This is the base address (or offset) for all bank-switched memory
|
|
|
|
*/
|
|
|
|
#define APPLE2_BANK_OFFSET 0xD000
|
|
|
|
|
2018-01-13 06:38:29 +00:00
|
|
|
extern SEGMENT_READER(apple2_mem_zp_read);
|
|
|
|
extern SEGMENT_WRITER(apple2_mem_zp_write);
|
2018-01-03 21:07:19 +00:00
|
|
|
extern int apple2_mem_init_sys_rom(apple2 *);
|
2018-01-12 01:52:13 +00:00
|
|
|
extern void apple2_mem_map(apple2 *, vm_segment *);
|
2018-01-02 22:26:11 +00:00
|
|
|
|
|
|
|
#endif
|