MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

peter ferrie
MAME Fan
Reged: 10/06/10
Posts: 46
Send PM


bad downcast<> or device<>
#301873 - 01/03/13 10:53 PM


I'm working on the Savage Quest driver right now.
After implementing support for the missing PAM registers and fixing a collection of things in the IDE controller code, it starts booting and eventually I see an IRQ2 acknowledge request.
However, the "pic8259->read_slave_ack_func(irq);" call is exiting with this message:

"Error: bad downcast<> or device<>. Tried to convert the device :pic8259_1 of type class device_t * to a class savquest_state *, which are incompatible."

The only other drivers that implement the 8259 are also skeletons, and I haven't managed to get any of them to trigger an acknowledge request to see if they fail similarly.
What have I not implemented yet that might fix this?



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


Re: bad downcast<> or device<> new [Re: peter ferrie]
#301877 - 01/04/13 12:11 AM


> I'm working on the Savage Quest driver right now.
> After implementing support for the missing PAM registers and fixing a collection of
> things in the IDE controller code, it starts booting and eventually I see an IRQ2
> acknowledge request.
> However, the "pic8259->read_slave_ack_func(irq);" call is exiting with this message:
>
> "Error: bad downcast<> or device<>. Tried to convert the device ic8259_1 of
> type class device_t * to a class savquest_state *, which are incompatible."
>
> The only other drivers that implement the 8259 are also skeletons, and I haven't
> managed to get any of them to trigger an acknowledge request to see if they fail
> similarly.
> What have I not implemented yet that might fix this?

without the actual source is hard to tell exactly where the problem is.
I'd start from checking that your savquest_state class contains a device_t pic8259 member, so that you can later call state->pic8259->read_slave_ack_func as above.



peter ferrie
MAME Fan
Reged: 10/06/10
Posts: 46
Send PM


Re: bad downcast<> or device<> new [Re: etabeta]
#301883 - 01/04/13 12:28 AM


> without the actual source is hard to tell exactly where the problem is.
> I'd start from checking that your savquest_state class contains a device_t pic8259
> member, so that you can later call state->pic8259->read_slave_ack_func as above.

I haven't changed that part of the original code - I just added some missing things - so if you have the original source, then you can see that it's there.



peter ferrie
MAME Fan
Reged: 10/06/10
Posts: 46
Send PM


Re: bad downcast<> or device<> new [Re: peter ferrie]
#301899 - 01/04/13 02:40 AM


I found the problem:

in pic8259_interface savquest_pic8259_1_config, the
DEVCB_MEMBER(savquest_state,get_slave_ack)
should be
DEVCB_DRIVER_MEMBER(savquest_state,get_slave_ack)
It looks like the interface changed and the driver was never updated.
funkball.c, midqslvr.c, queen.c, and xtom3d.c appear to be affected similarly.



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


Re: bad downcast<> or device<> new [Re: peter ferrie]
#301915 - 01/04/13 08:47 AM


you are fully right, I started from the wrong assumption that you had issues in new handlers added by yourself.
we'd appreciate if you send a patch to fix the issues you found (http://mamedev.org/devwiki/index.php/Submitting_Source_Code)



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: bad downcast<> or device<> new [Re: etabeta]
#301939 - 01/04/13 05:43 PM


> you are fully right, I started from the wrong assumption that you had issues in new
> handlers added by yourself.
> we'd appreciate if you send a patch to fix the issues you found (
> http://mamedev.org/devwiki/index.php/Submitting_Source_Code)

And for future reference, the MESS PC drivers are the gold standard reference for this kind of thing, because those *do* get updated frequently



peter ferrie
MAME Fan
Reged: 10/06/10
Posts: 46
Send PM


Re: bad downcast<> or device<> new [Re: R. Belmont]
#301960 - 01/04/13 11:38 PM


> > you are fully right, I started from the wrong assumption that you had issues in new
> > handlers added by yourself.
> > we'd appreciate if you send a patch to fix the issues you found (
> > http://mamedev.org/devwiki/index.php/Submitting_Source_Code)

I submitted the Savage Quest patch last night.
If the others are definitely wrong, then I can submit those, too. I haven't confirmed it yet.

> And for future reference, the MESS PC drivers are the gold standard reference for
> this kind of thing, because those *do* get updated frequently

but in this case, the bug was in the game driver code. It was simply being called by the core.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 211 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1176