summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author MetalliC <0vetal0@gmail.com>2020-02-05 23:06:58 +0200
committer MetalliC <0vetal0@gmail.com>2020-02-05 23:06:58 +0200
commit095a13d02c65c22e31b8e0f905a7f497aea181ff (patch)
treef01b160b4400942c48e4d3b4f671ff77bd6d412c
parent182b58e5546b509df00e8d261c54660c70a73b2f (diff)
konamigs.cpp: document I/O, hook bookkeeping (nw)
-rw-r--r--src/mame/drivers/konamigs.cpp50
1 files changed, 41 insertions, 9 deletions
diff --git a/src/mame/drivers/konamigs.cpp b/src/mame/drivers/konamigs.cpp
index c4a9c7cc375..c54726212e0 100644
--- a/src/mame/drivers/konamigs.cpp
+++ b/src/mame/drivers/konamigs.cpp
@@ -28,7 +28,7 @@
TODO:
- currently implemented very basic set of Q2SD GPU features, required/used by dumped games, should be improved if more games will be found.
- - hook IRQs from GPU and SPU (not used by dumped games)
+ - hook IRQs from GPU and SPU (not used by dumped games), possible controlled by one write registers in 140010xx area.
Notes:
- hold Test + Service while booting to initialise RTC NVRAM
@@ -105,6 +105,7 @@ protected:
DECLARE_WRITE64_MEMBER(portc_medal_w);
DECLARE_READ64_MEMBER(porte_r);
DECLARE_WRITE64_MEMBER(porte_w);
+ DECLARE_WRITE64_MEMBER(porte_medal_w);
DECLARE_READ16_MEMBER(dipsw_r);
u8 m_portc_data = 0xff;
u8 m_porte_data = 0xff;
@@ -256,16 +257,30 @@ READ64_MEMBER(gsan_state::portc_r)
}
WRITE64_MEMBER(gsan_state::portc_w)
{
+/* DDR
+ ---- x--- /Coin counter
+ --x- ---- Start button lamp
+ -x-- ---- Right button lamp
+ x--- ---- Left button lamp
+*/
m_portc_data = data;
- // TODO
+
+ machine().bookkeeping().coin_counter_w(0, ~data & 8);
}
WRITE64_MEMBER(gsan_state::portc_medal_w)
{
+/* Medal
+ ---- ---x Medal in counter
+ ---- --x- 100Y in counter
+ ---- -x-- 10Y in counter
+ x--- ---- Hopper
+*/
m_portc_data = data;
m_hopper->motor_w(data & 0x80);
machine().bookkeeping().coin_counter_w(0, data & 4);
- machine().bookkeeping().coin_counter_w(1, data & 1);
+ machine().bookkeeping().coin_counter_w(1, data & 2);
+ machine().bookkeeping().coin_counter_w(2, data & 1);
}
READ64_MEMBER(gsan_state::porte_r)
{
@@ -273,14 +288,30 @@ READ64_MEMBER(gsan_state::porte_r)
}
WRITE64_MEMBER(gsan_state::porte_w)
{
- // lamps
-#if 0
- u8 mask = m_porte_data ^ data;
- if (mask)
- logerror("PORT_E mask %02X val %02X\n", mask, data & mask);
-#endif
+/* DDR
+ ---- -x-- Lamp R3
+ ---- x--- Lamp R2
+ ---x ---- Lamp R1
+ --x- ---- Lamp L3
+ -x-- ---- Lamp L2
+ x--- ---- Lamp L1
+*/
m_porte_data = data;
}
+WRITE64_MEMBER(gsan_state::porte_medal_w)
+{
+/* Medal
+ ---- ---x Medal in lock
+ ---- --x- 100Y in lock
+ ---- -x-- 10Y in lock
+ -x-- ---- Button lamp
+*/
+ m_porte_data = data;
+
+ machine().bookkeeping().coin_lockout_w(0, data & 4);
+ machine().bookkeeping().coin_lockout_w(1, data & 2);
+ machine().bookkeeping().coin_lockout_w(2, data & 1);
+}
// Q2SD GPU
@@ -770,6 +801,7 @@ void gsan_state::main_port_medal(address_map &map)
{
main_port(map);
map(SH3_PORT_C, SH3_PORT_C + 7).rw(FUNC(gsan_state::portc_r), FUNC(gsan_state::portc_medal_w));
+ map(SH3_PORT_E, SH3_PORT_E + 7).rw(FUNC(gsan_state::porte_r), FUNC(gsan_state::porte_medal_w));
}
void gsan_state::ymz280b_map_medal(address_map &map)
an class="cpf">"../00-helloworld/logo.h" extern bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset); uint16_t uint16_max(uint16_t _a, uint16_t _b) { return _a < _b ? _b : _a; } int _main_(int _argc, char** _argv) { uint32_t width = 1280; uint32_t height = 720; uint32_t debug = BGFX_DEBUG_TEXT; uint32_t reset = BGFX_RESET_VSYNC; (void)_argc; (void)_argv; bgfx_init(BGFX_RENDERER_TYPE_COUNT , BGFX_PCI_ID_NONE , 0 , NULL , NULL ); bgfx_reset(width, height, reset); // Enable debug text. bgfx_set_debug(debug); bgfx_set_view_clear(0 , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH , 0x303030ff , 1.0f , 0 ); while (!entry_process_events(&width, &height, &debug, &reset) ) { // Set view 0 default viewport. bgfx_set_view_rect(0, 0, 0, width, height); // This dummy draw call is here to make sure that view 0 is cleared // if no other draw calls are submitted to view 0. bgfx_touch(0); // Use debug font to print information about this example. bgfx_dbg_text_clear(0, false); bgfx_dbg_text_image(uint16_max(width/2/8, 20)-20 , uint16_max(height/2/16, 6)-6 , 40 , 12 , s_logo , 160 ); bgfx_dbg_text_printf(0, 1, 0x4f, "bgfx/examples/25-c99"); bgfx_dbg_text_printf(0, 2, 0x6f, "Description: Initialization and debug text with C99 API."); // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. bgfx_frame(); } // Shutdown bgfx. bgfx_shutdown(); return 0; }