MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

Naibo
Reged: 10/17/07
Posts: 148
Send PM


About two devices sharing the same memory mapped space, in an interleaved manner
#386672 - 06/09/20 02:24 AM


Recently during the stay-home days, I did some study on Jaleco's music & rhythm game "VJ" series. It shares the basic hardware with Jaleco's another series Rock'n Tread, which is simpler and has been well emulated in tetrisp2.cpp.
While, VJ machines use two pieces of audio IC YMZ280b, instead of only one in Rock'n series.

These two 8-bit-port devices are mapped into the same memory space: map(0xa60000, 0xa60003). One IC uses only even byte addresses, while another uses odds.

The current code for the single audio IC in Rockn is like this:
map(0xa60000, 0xa60003).w("ymz", FUNC(ymz280b_device::write)).umask16(0x00ff); // Sound

Could some friends instruct me how to properly add the 2nd IC?



Naibo
Reged: 10/17/07
Posts: 148
Send PM


Re: About two devices sharing the same memory mapped space, in an interleaved manner new [Re: Naibo]
#386673 - 06/09/20 02:31 AM


I also tried to write a handler like this:
WRITE16_MEMBER(stepstag_state::dual_ymz280b_w)
{
if (ACCESSING_BITS_0_7)
ymz->write(data & 0xff, offset);

if (ACCESSING_BITS_8_15)
ymz1->write(data >> 8, offset);
}

However, when compiling (under gcc , it gives error messages:
error: ‘ymz’ was not declared in this scope
ymz->write(data & 0xff, offset);
^~~

The ymz has been added in the machine configuration function, then what is proper way to ref a device?



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4462
Loc: Melbourne, Australia
Send PM


Re: About two devices sharing the same memory mapped space, in an interleaved manner new [Re: Naibo]
#386674 - 06/09/20 07:12 AM


map(0xa60000, 0xa60003).w(whatever the other IC is).umask16(0xff00);

Just select the other lanes in the umask for the other IC.



Naibo
Reged: 10/17/07
Posts: 148
Send PM


Re: About two devices sharing the same memory mapped space, in an interleaved manner new [Re: Vas Crabb]
#386697 - 06/12/20 05:46 AM


Thanks Vas. Just added it.


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

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