st2204, st2205u: Fix writes to high bytes of banking registers (nw)

st2204: Fix port control writes (nw)

This fixes the memory banking problems in dyndesk and cartridge loading in gameking.
This commit is contained in:
AJR 2019-11-05 09:58:36 -05:00
parent 0a5fed2ece
commit 6c517ab98e
3 changed files with 10 additions and 12 deletions

View File

@ -293,7 +293,7 @@ u8 st2204_device::prrh_r()
void st2204_device::prrh_w(u8 data)
{
u16 &prr = downcast<mi_st2204 &>(*mintf).prr;
prr = (data & 0x0f) << 16 | (prr & 0x00ff);
prr = u16(data & 0x0f) << 8 | (prr & 0x00ff);
}
u8 st2204_device::drrl_r()
@ -315,7 +315,7 @@ u8 st2204_device::drrh_r()
void st2204_device::drrh_w(u8 data)
{
u16 &drr = downcast<mi_st2204 &>(*mintf).drr;
drr = (data & 0x07) << 16 | (drr & 0x00ff);
drr = u16(data & 0x07) << 8 | (drr & 0x00ff);
}
u8 st2204_device::dmsl_r()
@ -407,7 +407,7 @@ u8 st2204_device::dmrh_r()
void st2204_device::dmrh_w(u8 data)
{
u16 &dmr = downcast<mi_st2204 &>(*mintf).dmr;
dmr = (data & 0x07) << 16 | (dmr & 0x00ff);
dmr = (data & 0x07) << 8 | (dmr & 0x00ff);
}
u8 st2204_device::pmem_r(offs_t offset)
@ -434,7 +434,7 @@ void st2204_device::int_map(address_map &map)
{
map(0x0000, 0x0004).rw(FUNC(st2204_device::pdata_r), FUNC(st2204_device::pdata_w));
map(0x0005, 0x0005).rw(FUNC(st2204_device::psc_r), FUNC(st2204_device::psc_w));
map(0x0008, 0x000c).rw(FUNC(st2204_device::pdata_r), FUNC(st2204_device::pdata_w));
map(0x0008, 0x000c).rw(FUNC(st2204_device::pctrl_r), FUNC(st2204_device::pctrl_w));
map(0x000d, 0x000d).rw(FUNC(st2204_device::pfc_r), FUNC(st2204_device::pfc_w));
map(0x000e, 0x000e).rw(FUNC(st2204_device::pfd_r), FUNC(st2204_device::pfd_w));
map(0x000f, 0x000f).rw(FUNC(st2204_device::pmcr_r), FUNC(st2204_device::pmcr_w));

View File

@ -271,7 +271,7 @@ u8 st2205u_device::irrh_r()
void st2205u_device::irrh_w(u8 data)
{
u16 &irr = downcast<mi_st2205u &>(*mintf).irr;
irr = (data & 0x8f) << 16 | (irr & 0x00ff);
irr = (data & 0x8f) << 8 | (irr & 0x00ff);
}
u8 st2205u_device::prrl_r()
@ -293,7 +293,7 @@ u8 st2205u_device::prrh_r()
void st2205u_device::prrh_w(u8 data)
{
u16 &prr = downcast<mi_st2205u &>(*mintf).prr;
prr = (data & 0x8f) << 16 | (prr & 0x00ff);
prr = (data & 0x8f) << 8 | (prr & 0x00ff);
}
u8 st2205u_device::drrl_r()
@ -315,7 +315,7 @@ u8 st2205u_device::drrh_r()
void st2205u_device::drrh_w(u8 data)
{
u16 &drr = downcast<mi_st2205u &>(*mintf).drr;
drr = (data & 0x87) << 16 | (drr & 0x00ff);
drr = (data & 0x87) << 8 | (drr & 0x00ff);
}
u8 st2205u_device::brrl_r()
@ -337,7 +337,7 @@ u8 st2205u_device::brrh_r()
void st2205u_device::brrh_w(u8 data)
{
u16 &brr = downcast<mi_st2205u &>(*mintf).brr;
brr = (data & 0x9f) << 16 | (brr & 0x00ff);
brr = (data & 0x9f) << 8 | (brr & 0x00ff);
}
u8 st2205u_device::pmcr_r()

View File

@ -4,9 +4,6 @@
VTech Intelligence Advance E/R Lerncomputer
TODO: dyndesk writes to low memory go to external RAM instead? It also
eventually runs off into nonexistent memory.
***************************************************************************/
#include "emu.h"
@ -39,7 +36,8 @@ void inteladv_state::inteladv_map(address_map &map)
void inteladv_state::dyndesk_map(address_map &map)
{
map(0x000000, 0x1fffff).rom().region("maincpu", 0).nopw();
map(0x000000, 0x1fffff).rom().region("maincpu", 0).mirror(0x400000); // why mirrored?
map(0x800000, 0x807fff).ram();
}
static INPUT_PORTS_START( inteladv )