Merge pull request #8078 from tlindner/gime-ff22

coco3: fix video glitch in Skiing
This commit is contained in:
ajrhacker 2021-05-19 16:56:54 -04:00 committed by GitHub
commit a068ff3644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 1 deletions

View File

@ -50,12 +50,18 @@ public:
void coco3_mem(address_map &map);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void update_cart_base(uint8_t *cart_base) override;
// miscellaneous
virtual void update_keyboard_input(uint8_t value) override;
virtual void cart_w(bool line) override;
uint8_t m_pia1b_control_register;
private:
required_device<gime_device> m_gime;
required_ioport m_screen_config;

View File

@ -46,6 +46,34 @@
#include "emu.h"
#include "includes/coco3.h"
//-------------------------------------------------
// device_start
//-------------------------------------------------
void coco3_state::device_start()
{
// call parent device_start
coco_state::device_start();
// save state support
save_item(NAME(m_pia1b_control_register));
}
//-------------------------------------------------
// device_reset
//-------------------------------------------------
void coco3_state::device_reset()
{
/* call parent device_start */
coco_state::device_reset();
/* reset state */
m_pia1b_control_register = 0;
}
//-------------------------------------------------
// ff20_write
//-------------------------------------------------
@ -54,7 +82,11 @@ void coco3_state::ff20_write(offs_t offset, uint8_t data)
{
coco_state::ff20_write(offset, data);
if (offset == 0x02)
if (offset == 0x03)
m_pia1b_control_register = data;
/* only pass ff22 to gime if the data register is addressed */
if (offset == 0x02 && ((m_pia1b_control_register & 0x04) == 0x04))
m_gime->ff22_write(data);
}