mirror of
https://github.com/st3fan/ewm.git
synced 2024-12-29 07:29:46 +00:00
Fixes #71 - Handle writes to screen soft switches
This commit is contained in:
parent
733f2e6141
commit
a9027b884b
38
a2p.c
38
a2p.c
@ -125,9 +125,47 @@ uint8_t a2p_iom_read(struct cpu_t *cpu, struct mem_t *mem, uint16_t addr) {
|
||||
void a2p_iom_write(struct cpu_t *cpu, struct mem_t *mem, uint16_t addr, uint8_t b) {
|
||||
struct a2p_t *a2p = (struct a2p_t*) mem->obj;
|
||||
switch (addr) {
|
||||
|
||||
case EWM_A2P_SS_KBDSTRB:
|
||||
a2p->key &= 0x7f;
|
||||
break;
|
||||
|
||||
case EWM_A2P_SS_SCREEN_MODE_GRAPHICS:
|
||||
a2p->screen_mode = EWM_A2P_SCREEN_MODE_GRAPHICS;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
case EWM_A2P_SS_SCREEN_MODE_TEXT:
|
||||
a2p->screen_mode = EWM_A2P_SCREEN_MODE_TEXT;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
|
||||
case EWM_A2P_SS_GRAPHICS_MODE_LGR:
|
||||
a2p->screen_graphics_mode = EWM_A2P_SCREEN_GRAPHICS_MODE_LGR;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
case EWM_A2P_SS_GRAPHICS_MODE_HGR:
|
||||
a2p->screen_graphics_mode = EWM_A2P_SCREEN_GRAPHICS_MODE_HGR;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
|
||||
case EWM_A2P_SS_GRAPHICS_STYLE_FULL:
|
||||
a2p->screen_graphics_style = EWM_A2P_SCREEN_GRAPHICS_STYLE_FULL;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
case EWM_A2P_SS_GRAPHICS_STYLE_MIXED:
|
||||
a2p->screen_graphics_style = EWM_A2P_SCREEN_GRAPHICS_STYLE_MIXED;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
|
||||
case EWM_A2P_SS_SCREEN_PAGE1:
|
||||
a2p->screen_page = EWM_A2P_SCREEN_PAGE1;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
case EWM_A2P_SS_SCREEN_PAGE2:
|
||||
a2p->screen_page = EWM_A2P_SCREEN_PAGE2;
|
||||
a2p->screen_dirty = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("[A2P] Unexpected write at $%.4X\n", addr);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user