1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-26 14:29:31 +00:00

add ram::page_size; sizes are unsigned

This commit is contained in:
Stephen Crane 2021-02-17 14:49:40 +00:00
parent 42566200c1
commit 5f8bb62648
10 changed files with 13 additions and 11 deletions

View File

@ -6,7 +6,7 @@
#define KBD_DATA 34 #define KBD_DATA 34
#define KBD_IRQ 35 #define KBD_IRQ 35
#define RAM_SIZE 0 #define RAM_SIZE 0u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

View File

@ -15,7 +15,7 @@
#define KBD_DATA 34 #define KBD_DATA 34
#define KBD_IRQ 35 #define KBD_IRQ 35
#define RAM_SIZE 65536 #define RAM_SIZE 0x10000u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

View File

@ -11,7 +11,7 @@
#define KBD_DATA 34 #define KBD_DATA 34
#define KBD_IRQ 35 #define KBD_IRQ 35
#define RAM_SIZE 65536 #define RAM_SIZE 0x10000u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

View File

@ -15,13 +15,13 @@
#define KBD_DATA D3 #define KBD_DATA D3
#define KBD_IRQ D4 #define KBD_IRQ D4
#define RAM_SIZE 32768 #define RAM_SIZE 0x8000u
// SPI-RAM // SPI-RAM
#define USE_SPIRAM #define USE_SPIRAM
#define SPIRAM_DEV SPI #define SPIRAM_DEV SPI
#define SPIRAM_CS D0 #define SPIRAM_CS D0
#define SPIRAM_SIZE 32768 #define SPIRAM_SIZE 0x8000u
// "tape" storage... // "tape" storage...
#undef USE_SD #undef USE_SD

View File

@ -15,7 +15,7 @@
#define KBD_DATA D3 #define KBD_DATA D3
#define KBD_IRQ D4 #define KBD_IRQ D4
#define RAM_SIZE 32768 #define RAM_SIZE 0x8000u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

View File

@ -15,7 +15,7 @@
#define KBD_DATA D3 #define KBD_DATA D3
#define KBD_IRQ D4 #define KBD_IRQ D4
#define RAM_SIZE 32768 #define RAM_SIZE 0x8000u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

View File

@ -15,7 +15,7 @@
#define KBD_DATA D3 #define KBD_DATA D3
#define KBD_IRQ D4 #define KBD_IRQ D4
#define RAM_SIZE 32768 #define RAM_SIZE 0x8000u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

View File

@ -13,7 +13,7 @@
#define KBD_DATA PE_4 #define KBD_DATA PE_4
#define KBD_IRQ PE_5 #define KBD_IRQ PE_5
#define RAM_SIZE 0x3000 #define RAM_SIZE 0x3000u
// SPI-RAM // SPI-RAM
#define USE_SPIRAM #define USE_SPIRAM

View File

@ -13,7 +13,7 @@
#define KBD_DATA PE_4 #define KBD_DATA PE_4
#define KBD_IRQ PE_5 #define KBD_IRQ PE_5
#define RAM_SIZE 0x3000 #define RAM_SIZE 0x3000u
// SPI-RAM // SPI-RAM
#undef USE_SPIRAM #undef USE_SPIRAM

4
ram.h
View File

@ -3,6 +3,8 @@
class ram: public Memory::Device { class ram: public Memory::Device {
public: public:
static const unsigned page_size = 1024;
virtual void operator= (uint8_t c) { _mem[_acc] = c; } virtual void operator= (uint8_t c) { _mem[_acc] = c; }
virtual operator uint8_t () { return _mem[_acc]; } virtual operator uint8_t () { return _mem[_acc]; }
@ -14,6 +16,6 @@ public:
ram (): Memory::Device(sizeof(_mem)) {} ram (): Memory::Device(sizeof(_mem)) {}
private: private:
uint8_t _mem[1024]; uint8_t _mem[page_size];
}; };
#endif #endif