MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

lxd
MAME Fan
Reged: 02/27/14
Posts: 25
Send PM


How to call DECLARE_WRITE8_MEMBER(duart_txa); at output.c
#324707 - 04/15/14 09:43 AM


CPU i8031 system.
I can call "output.c"'s fuctions
output_set_lamp_value(...)
output_set_digit_value(...) etc in my game driver.

But how output_xxxx(...) callback in my game driver like:

DECLARE_WRITE8_MEMBER(duart_txa);

WRITE8_MEMBER(bigmario_state::duart_txa)
{
//printf("bigmario_state::duart_txa=%2X\n",data);
m_serial_data_in = data;

m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
m_maincpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE);
};



lxd
MAME Fan
Reged: 02/27/14
Posts: 25
Send PM


Re: How to call DECLARE_WRITE8_MEMBER(duart_txa); at output.c new [Re: lxd]
#324715 - 04/15/14 11:26 AM


running_machine &machine

How can I from machine get my game driver object?

class bigmario_state : public driver_device



lxd
MAME Fan
Reged: 02/27/14
Posts: 25
Send PM


Re: How to call DECLARE_WRITE8_MEMBER(duart_txa); at output.c new [Re: lxd]
#324724 - 04/15/14 02:43 PM


I found a way. That is
void bigmario_state::machine_start()



etabeta
Reged: 08/25/04
Posts: 2036
Send PM


Re: How to call DECLARE_WRITE8_MEMBER(duart_txa); at output.c new [Re: lxd]
#324729 - 04/15/14 04:39 PM


> I found a way. That is
> void bigmario_state::machine_start()

nope. every class can invoke machine by using machine() , machine_start() is used for completely different things
from the machine you retrieve the driver state, and then you call state->duart_txa(space, offset, data)


also, when you have a new driver working, you are welcome to submit it for official inclusion (with proper credit, of course)



lxd
MAME Fan
Reged: 02/27/14
Posts: 25
Send PM


Re: How to call DECLARE_WRITE8_MEMBER(duart_txa); at output.c new [Re: etabeta]
#324749 - 04/15/14 09:28 PM


use "delegate" in
void bigmario_state::machine_start()
then out.c can callback
WRITE8_MEMBER(bigmario_state::duart_txa)

I have done it now. IT's work fine.

The first parameter is
machine.firstcpu->space()
for
ATTR_UNUSED address_space &space

Thank you tell me it.



Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 110 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3402