Previous Thread
Next Thread
Print Thread
Joined: Feb 2014
Posts: 674
Likes: 9
G
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 674
Likes: 9
So the imagewriter has a jumper and the SID pin reads either a 1 or a 0, but the status doesn't get displayed in the debugger:


[Linked Image from i.imgur.com]

Code

	PORT_START("WIDTH")
	PORT_CONFNAME(0x1, 0x01, "Printer Width")
	PORT_CONFSETTING(0x0, "15 Inches")
	PORT_CONFSETTING(0x1, "8 Inches")

...
	uint8_t maincpu_in_sid_func() 
	{
		return ioport("WIDTH")->read(); 
	}

...
	i8085a_cpu_device &cpu(I8085A(config, m_maincpu, 9.8304_MHz_XTAL / 2));  // aka 4.9152_MHz_XTAL

	m_maincpu->in_sid_func().set(FUNC(apple_imagewriter_printer_device::maincpu_in_sid_func));


The RIM instruction does read the SID pin properly, it just doesn't display correctly in the debugger panel.


I don't quite understand how this code works, but if I do this, it will display in the debugger register panel.


Code
void i8085a_cpu_device::state_export(const device_state_entry &entry)
{
	switch (entry.index())
	{
		case I8085_SID:
//			m_ietemp = ((m_im & IM_SID) != 0) && m_in_sid_func() != 0;
			m_ietemp = (m_in_sid_func ? m_in_sid_func() : 0);
			break;

		case I8085_INTE:
			m_ietemp = ((m_im & IM_IE) != 0);
			break;

		default:
			fatalerror("CPU_EXPORT_STATE(i808x) called for unexpected value\n");
	}
}



Joined: Mar 2001
Posts: 16,808
Likes: 32
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,808
Likes: 32
I think the correct fix is just to call get_rim_value() and mask out the bits that aren't IM_SID, based on what the other code's doing.

Something like m_ietemp = ((get_rim_value() & IM_SID) == IM_SID);


Link Copied to Clipboard
Who's Online Now
1 members (Olivier Galibert), 30 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,974
Posts117,896
Members5,001
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com