m20: fix vram

This commit is contained in:
cracyc 2023-02-12 11:32:08 -06:00
parent 4938e3bc33
commit 3439f20117
2 changed files with 10 additions and 12 deletions

View File

@ -77,7 +77,6 @@ public:
m_floppy0(*this, "fd1797:0:5dd"),
m_floppy1(*this, "fd1797:1:5dd"),
m_apb(*this, "apb"),
m_p_videoram(*this, "videoram"),
m_palette(*this, "palette")
{
}
@ -96,7 +95,6 @@ private:
required_device<floppy_image_device> m_floppy1;
optional_device<m20_8086_device> m_apb;
required_shared_ptr<uint16_t> m_p_videoram;
required_device<palette_device> m_palette;
virtual void machine_start() override;
@ -134,11 +132,12 @@ MC6845_UPDATE_ROW( m20_state::update_row )
{
uint32_t *p = &bitmap.pix(y);
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
uint16_t *vram = (uint16_t *)m_ram->pointer();
uint16_t offset = ((ma | (ra << 1)) << 4);
for ( int i = 0; i < x_count; i++ )
{
uint16_t offset = ((ma | (ra << 1)) << 4) + i;
uint16_t data = m_p_videoram[ offset ];
uint16_t data = vram[ offset + i ];
for ( int j = 15; j >= 0; j-- )
{
@ -327,14 +326,12 @@ B/W, 128K cards, 3 cards => 512K of memory:
void m20_state::m20_program_mem(address_map &map)
{
map.unmap_value_high();
map(0x30000, 0x33fff).ram().share("videoram");
map(0x40000, 0x41fff).rom().region("maincpu", 0x00000);
}
void m20_state::m20_data_mem(address_map &map)
{
map.unmap_value_high();
map(0x30000, 0x33fff).ram().share("videoram");
map(0x40000, 0x41fff).rom().region("maincpu", 0x00000);
}
@ -377,10 +374,10 @@ void m20_state::install_memory()
pspace.install_ram(0x28000, 0x2bfff, 0, memptr + 0x1c000);
dspace.install_ram(0x28000, 0x2bfff, 0, memptr + 0x1c000);
/* <2>c000 empty*/
/* <3>0000 (video buffer)
/* <3>0000 (video buffer) */
pspace.install_ram(0x30000, 0x33fff, 0, memptr + 0x0000);
dspace.install_ram(0x30000, 0x33fff, 0, memptr + 0x0000);
*/
/* <5>0000 */
dspace.install_ram(0x50000, 0x53fff, 0, memptr + 0x8000);

View File

@ -18,10 +18,11 @@ m20_8086_device::m20_8086_device(const machine_config &mconfig, const char *tag,
void m20_8086_device::device_start()
{
uint8_t* ram = m_ram->pointer();
m_8086->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 0x4001, &ram[0x4000]);
membank("highram")->set_base(ram);
membank("vram")->set_base(memshare(":videoram")->ptr());
membank("vram2")->set_base(memshare(":videoram")->ptr());
m_8086->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 0x4001, ram + 0x4000);
membank("highram")->set_base(ram + 0x4000);
membank("vram")->set_base(ram);
membank("vram2")->set_base(ram);
}
void m20_8086_device::device_reset()