CRTC on CGA-like graphics chips is now on the entire 3D0 to 3D7 port range, fixes scrolling in some old games.

This commit is contained in:
OBattler
2021-05-22 03:16:02 +02:00
parent 6ac6ef381d
commit e695cb0e3b
3 changed files with 18 additions and 0 deletions

View File

@@ -228,6 +228,9 @@ vid_out_1512(uint16_t addr, uint8_t val, void *priv)
amsvid_t *vid = (amsvid_t *)priv;
uint8_t old;
if ((addr >= 0x3d0) && (addr <= 0x3d7))
addr = (addr & 0xff9) | 0x004;
switch (addr) {
case 0x03d4:
vid->crtcreg = val & 31;
@@ -277,6 +280,9 @@ vid_in_1512(uint16_t addr, void *priv)
amsvid_t *vid = (amsvid_t *)priv;
uint8_t ret = 0xff;
if ((addr >= 0x3d0) && (addr <= 0x3d7))
addr = (addr & 0xff9) | 0x004;
switch (addr) {
case 0x03d4:
ret = vid->crtcreg;

View File

@@ -520,6 +520,9 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
t1kvid_t *vid = dev->vid;
uint8_t old;
if ((addr >= 0x3d0) && (addr <= 0x3d7))
addr = (addr & 0xff9) | 0x004;
switch (addr) {
case 0x03d4:
vid->crtcreg = val & 0x1f;
@@ -589,6 +592,9 @@ vid_in(uint16_t addr, void *priv)
t1kvid_t *vid = dev->vid;
uint8_t ret = 0xff;
if ((addr >= 0x3d0) && (addr <= 0x3d7))
addr = (addr & 0xff9) | 0x004;
switch (addr) {
case 0x03d4:
ret = vid->crtcreg;

View File

@@ -58,6 +58,9 @@ cga_out(uint16_t addr, uint8_t val, void *p)
cga_t *cga = (cga_t *) p;
uint8_t old;
if ((addr >= 0x3d0) && (addr <= 0x3d7))
addr = (addr & 0xff9) | 0x004;
switch (addr) {
case 0x3D4:
cga->crtcreg = val & 31;
@@ -100,6 +103,9 @@ cga_in(uint16_t addr, void *p)
uint8_t ret = 0xff;
if ((addr >= 0x3d0) && (addr <= 0x3d7))
addr = (addr & 0xff9) | 0x004;
switch (addr) {
case 0x3D4:
ret = cga->crtcreg;