2018-01-10 09:13:04 +00:00
|
|
|
#ifndef __VMRAM__H
|
|
|
|
#define __VMRAM__H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/* Preallocated RAM class. */
|
|
|
|
|
|
|
|
class VMRam {
|
|
|
|
public:
|
|
|
|
VMRam();
|
|
|
|
~VMRam();
|
|
|
|
|
|
|
|
void init();
|
|
|
|
|
|
|
|
uint8_t readByte(uint32_t addr);
|
|
|
|
void writeByte(uint32_t addr, uint8_t value);
|
|
|
|
|
2018-01-10 13:05:49 +00:00
|
|
|
bool Serialize(int8_t fd);
|
|
|
|
bool Deserialize(int8_t fd);
|
|
|
|
|
2018-02-07 15:20:26 +00:00
|
|
|
bool Test();
|
|
|
|
|
2018-01-10 09:13:04 +00:00
|
|
|
private:
|
2020-07-03 01:59:35 +00:00
|
|
|
// We need 591 pages of 256 bytes for the //e.
|
2018-02-07 15:20:26 +00:00
|
|
|
//
|
2020-07-03 01:59:35 +00:00
|
|
|
// This previously used a split memory model where some of this was
|
|
|
|
// in internal ram and some was external - and while that's not true
|
|
|
|
// right now, it may be true again in the future.
|
2018-02-07 15:20:26 +00:00
|
|
|
//
|
2020-07-03 01:59:35 +00:00
|
|
|
// If we go that way: zero-page should be in internal RAM (it's
|
|
|
|
// changed very often). Some other pages that are read or written
|
|
|
|
// often should probably go in here too. The order of the pages (in
|
|
|
|
// apple/applemmu.cpp) defines what order the pages are referenced
|
|
|
|
// in the VMRam object; the lowest should wind up in internal RAM.
|
2018-02-07 15:20:26 +00:00
|
|
|
|
|
|
|
// Pages 0-3 are ZP; we want those in RAM.
|
|
|
|
// Pages 4-7 are 0x200 - 0x3FF. We want those in RAM too (text pages).
|
|
|
|
|
2020-07-06 20:46:14 +00:00
|
|
|
// Has to be static if we're using the EXTMEM sectioning, so it's now in vmram.cpp :/
|
|
|
|
//EXTMEM uint8_t preallocatedRam[591*256];
|
|
|
|
|
|
|
|
|
2018-01-10 09:13:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|