41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include "memory.h"
|
|
|
|
// Screen dimensions
|
|
#define SCREEN_WIDTH 128
|
|
#define SCREEN_HEIGHT 64
|
|
|
|
// VRAM Size & Address
|
|
#define VRAM_SIZE (SCREEN_WIDTH * SCREEN_HEIGHT / 8) // 1024 for 128*64 monochrome
|
|
#define VRAM_ADDRESS (RAM_START + RAM_SIZE) // (64 * 1024) // Arbitrary address relative to start of RAM
|
|
//#define VRAM_ADDRESS (64 * 1024) // Arbitrary address relative to start of RAM
|
|
|
|
#define LCD_SELECT_REGISTER 0xB4000000
|
|
#define LCD_DATA_REGISTER 0xB4010000
|
|
|
|
// Size of characters in ASCII texture
|
|
#define ASCII_CHAR_WIDTH 7
|
|
#define ASCII_CHAR_HEIGHT 9
|
|
|
|
// Size of characters on screen
|
|
#define CHAR_WIDTH 6
|
|
#define CHAR_HEIGHT 8
|
|
|
|
// https://bible.planet-casio.com/simlo/chm/v20/fx_legacy_Cursor.HTM
|
|
typedef struct {
|
|
int col; // starts at 1
|
|
int row; // starts at 1
|
|
} cursor_t;
|
|
|
|
struct display_t {
|
|
// Pointer to virtual memory in RAM
|
|
uint8_t vram[VRAM_SIZE];
|
|
|
|
// LCD screen emulation
|
|
uint8_t lcd[VRAM_SIZE];
|
|
uint8_t lcd_registers; // Use for both selector & data registers
|
|
|
|
// Current cursor position
|
|
cursor_t cursor;
|
|
}; |