mirror of
https://github.com/holub/mame
synced 2025-05-24 14:56:21 +03:00
corrected a flaw with tms9928a vram address, no whatsnew
This commit is contained in:
parent
e7b9fb3df7
commit
32d7b9fbc3
@ -135,7 +135,7 @@ static void (*const ModeHandlers[])(running_device *screen, bitmap_t *bitmap, co
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* TMS9928A internal settings */
|
/* TMS9928A internal settings */
|
||||||
UINT8 ReadAhead,Regs[8],StatusReg,FirstByte,latch,INT;
|
UINT8 ReadAhead,Regs[8],StatusReg,latch,INT;
|
||||||
INT32 Addr;
|
INT32 Addr;
|
||||||
int colour,pattern,nametbl,spriteattribute,spritepattern;
|
int colour,pattern,nametbl,spriteattribute,spritepattern;
|
||||||
int colourmask,patternmask;
|
int colourmask,patternmask;
|
||||||
@ -173,7 +173,6 @@ void TMS9928A_reset () {
|
|||||||
tms.spritepattern = tms.spriteattribute = 0;
|
tms.spritepattern = tms.spriteattribute = 0;
|
||||||
tms.colourmask = tms.patternmask = 0;
|
tms.colourmask = tms.patternmask = 0;
|
||||||
tms.Addr = tms.ReadAhead = tms.INT = 0;
|
tms.Addr = tms.ReadAhead = tms.INT = 0;
|
||||||
tms.FirstByte = 0;
|
|
||||||
tms.latch = 0;
|
tms.latch = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +221,6 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
|
|||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[7]);
|
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[7]);
|
||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.StatusReg);
|
state_save_register_item(machine, "tms9928a", NULL, 0, tms.StatusReg);
|
||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.ReadAhead);
|
state_save_register_item(machine, "tms9928a", NULL, 0, tms.ReadAhead);
|
||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.FirstByte);
|
|
||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.latch);
|
state_save_register_item(machine, "tms9928a", NULL, 0, tms.latch);
|
||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Addr);
|
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Addr);
|
||||||
state_save_register_item(machine, "tms9928a", NULL, 0, tms.INT);
|
state_save_register_item(machine, "tms9928a", NULL, 0, tms.INT);
|
||||||
@ -282,25 +280,25 @@ READ8_HANDLER (TMS9928A_register_r) {
|
|||||||
WRITE8_HANDLER (TMS9928A_register_w) {
|
WRITE8_HANDLER (TMS9928A_register_w) {
|
||||||
int reg;
|
int reg;
|
||||||
|
|
||||||
if (tms.latch) {
|
if (tms.latch) {
|
||||||
if (data & 0x80) {
|
if (data & 0x80) {
|
||||||
/* register write */
|
/* register write */
|
||||||
reg = data & 7;
|
reg = data & 7;
|
||||||
/*if (tms.FirstByte != tms.Regs[reg])*/ /* Removed to fix ColecoVision MESS Driver*/
|
change_register (space->machine, reg, tms.Addr & 0xff);
|
||||||
change_register (space->machine, reg, tms.FirstByte);
|
} else {
|
||||||
} else {
|
/* set high part of read/write address */
|
||||||
/* set read/write address */
|
tms.Addr = ((UINT16)data << 8 | (tms.Addr & 0xff)) & (tms.vramsize - 1);
|
||||||
tms.Addr = ((UINT16)data << 8 | tms.FirstByte) & (tms.vramsize - 1);
|
if ( !(data & 0x40) ) {
|
||||||
if ( !(data & 0x40) ) {
|
|
||||||
/* read ahead */
|
/* read ahead */
|
||||||
TMS9928A_vram_r (space,0);
|
TMS9928A_vram_r (space,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tms.latch = 0;
|
tms.latch = 0;
|
||||||
} else {
|
} else {
|
||||||
tms.FirstByte = data;
|
/* set low part of read/write address */
|
||||||
|
tms.Addr = ((tms.Addr & 0xff00) | data) & (tms.vramsize - 1);
|
||||||
tms.latch = 1;
|
tms.latch = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void change_register (running_machine *machine, int reg, UINT8 val) {
|
static void change_register (running_machine *machine, int reg, UINT8 val) {
|
||||||
|
Loading…
Reference in New Issue
Block a user