Previous Thread
Next Thread
Print Thread
Page 77 of 77 1 2 75 76 77
Joined: Feb 2014
Posts: 675
Likes: 9
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 675
Likes: 9
Thought I'd try to make an imagewriter control panel layout:


[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 675
Likes: 9
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 675
Likes: 9
Now the buttons and leds are "hooked up".

Code
	output_finder<> m_power_led;
	output_finder<> m_paper_error_led;
	output_finder<> m_select_led;

add to the constructor:
Code
	m_power_led(*this, "power_led"),
	m_paper_error_led(*this, "paper_error_led"),
	m_select_led(*this, "select_led")

and don't forget to resolve() them. Forgot to do this...
Code
	m_power_led.resolve();  // will get segfault if you forget to resolve
	m_paper_error_led.resolve();
	m_select_led.resolve();

then just assign them a value in the code:
Code
	m_select_led = !m_ic17_flipflop_select_status;


There's something really satisfying about clicking on buttons and seeing it work. 8-)


[Linked Image from i.imgur.com]

Joined: Mar 2001
Posts: 16,814
Likes: 34
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,814
Likes: 34
Clickable artwork buttons are indeed surprisingly satisfying.

Joined: Feb 2014
Posts: 675
Likes: 9
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 675
Likes: 9
Just for fun, let's make the pressed button have more bling:

Code
	<element name="pushbutton_rect" defstate="0">
		<rect state="0">
			<color red="0.0" green="0.0" blue="0.0" />
		</rect>
		<rect state="0">
			<bounds x="0.02" y="0.02" width=".96" height="0.96" />
			<color red="0.92" green="0.91" blue="0.75" />
		</rect>
		<rect state="1">
			<color red="0.5" green="0.5" blue="0.5" />
		</rect>
		<rect state="1">
			<bounds x="0.02" y="0.02" width=".96" height="0.96" />
			<color red="0.0" green="0" blue="0" />
		</rect>
		<disk state="1">
			<bounds xc=".5" yc=".5" width=".90" height=".90" />
			<color red="1.0" green="1.0" blue="0" alpha = "0.50" />
		</disk>
		<disk state="1">
			<bounds xc=".5" yc=".5" width=".50" height=".50" />
			<color red="1.0" green="1.0" blue="0" alpha = "0.85" />
		</disk>
		<text string="Pressed" state="1">
			<color red="1.0" green="0.0" blue=".25" alpha = "1.0"/>
			<bounds xc=".5" yc=".5" width="1.0" height="1.0" />
		</text>
	</element>
[Linked Image from i.imgur.com]

Joined: Mar 2001
Posts: 16,814
Likes: 34
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,814
Likes: 34
That's a bit excessive smile

Joined: Feb 2014
Posts: 675
Likes: 9
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 675
Likes: 9
Ok, I'm not an expert on subclassing, but I made an imagewriter15 as a subclass of the regular imagewriter, but with 15 inch wide paper.

I tried to make it a PORT_CONFNAME/PORT_CONFSETTING configuration option, but ioports aren't available during device_add_mconfig time (as far as I know).


Only a few variables have to be changed:

Code
class apple_imagewriter15_printer_device : public apple_imagewriter_printer_device
{
public:
	apple_imagewriter15_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	apple_imagewriter_printer_device(mconfig, tag, owner, clock)
	{	
		PAPER_WIDTH_INCHES = 15.0;
		PAPER_WIDTH = PAPER_WIDTH_INCHES * dpi * xscale;  
		m_right_edge=((PAPER_WIDTH_INCHES + MARGIN_INCHES) * dpi * xscale - 1) ;
	};
};

DECLARE_DEVICE_TYPE(APPLE_IMAGEWRITER_PRINTER, apple_imagewriter_printer_device)
DECLARE_DEVICE_TYPE(APPLE_IMAGEWRITER15_PRINTER, apple_imagewriter15_printer_device)


The break in the middle is me switching the jumper from 8 inches to 15 inches and resetting while holding down FF.

[Linked Image from i.imgur.com]

Joined: Mar 2001
Posts: 16,814
Likes: 34
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,814
Likes: 34
Was there actually a wide-carriage ImageWriter? I don't remember how that worked in real life.

Joined: Feb 2014
Posts: 675
Likes: 9
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 675
Likes: 9
The imagewriter 15 was model A9M0305 and from what I can tell from Apple's imagewriter schematic, it's the same motherboard, just has a jumper that grounds the 8085's SID input.



It reads that input when it starts up, I just made a config option previously so I could set it to 1 or 0, but now I've got this in:

Code
//-------------------------------------------------
//    i8085 Main cpu in sid function
//-------------------------------------------------

uint8_t apple_imagewriter_printer_device::maincpu_in_sid_func()
{
	return (PAPER_WIDTH_INCHES == 15.0) ? 0 : 1;  // for imagewriter15, will be 0, regular imagewriter will be 1
//	return ioportsaferead("WIDTH");
}


Joined: Mar 2001
Posts: 16,814
Likes: 34
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,814
Likes: 34
Ahh, yeah. In that case the separate 8.5 and 15 inch devices is the right call. Fortunately Vas fixed it recently so devices can share ROMs.

Page 77 of 77 1 2 75 76 77

Link Copied to Clipboard
Who's Online Now
4 members (box, Pernod, rbramante, AJR), 23 guests, and 4 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,979
Posts117,944
Members5,003
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com