• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision17934610f23e4e0797701a486db67a644c1512f7 (tree)
Time2018-04-13 02:22:30
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM][FM7][JOYSTICK] Apply before change to Inteligent-Mouse.

Change Summary

Incremental Difference

--- a/source/src/vm/fm7/joystick.cpp
+++ b/source/src/vm/fm7/joystick.cpp
@@ -87,10 +87,8 @@ void JOYSTICK::event_frame()
8787 #if !defined(_FM8)
8888 mouse_state = p_emu->get_mouse_buffer();
8989 if(mouse_state != NULL) {
90- //dx += (mouse_state[0] / 2);
91- //dy += (mouse_state[1] / 2);
92- dx += (mouse_state[0] / 6);
93- dy += (mouse_state[1] / 6);
90+ dx += mouse_state[0];
91+ dy += mouse_state[1];
9492 if(dx < -127) {
9593 dx = -127;
9694 } else if(dx > 127) {
@@ -129,68 +127,8 @@ void JOYSTICK::event_frame()
129127 } else { // MOUSE
130128 }
131129 }
132-#if 0
133- uint32_t opnval = (uint32_t)port_b_val;
134- if(emulate_mouse[0]) {
135- if((opnval & 0xc0) == 0x00) {
136- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x03) << 4), 0xff);
137- return;
138- } else {
139- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x03) << 4) & mouse_button, 0xff);
140- return;
141- }
142- } else if(emulate_mouse[1]) {
143- if((opnval & 0xc0) == 0x40) {
144- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x0c) << 2), 0xff);
145- return;
146- } else {
147- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x0c) << 2) & mouse_button, 0xff);
148- return;
149- }
150- }
151- switch(opnval & 0xf0) {
152- case 0x20:
153- if(lpt_type != 1) {
154- val = joydata[0];
155- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, val, 0xff);
156- }
157- break;
158- case 0x50:
159- if(lpt_type != 2) {
160- val = joydata[1];
161- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, val, 0xff);
162- }
163- break;
164- }
165-#endif
166130 }
167131
168-#if 0
169-void JOYSTICK::event_vline(int v, int clock)
170-{
171-#if 0
172- //if((v % 5) != 0) return;
173- uint32_t opnval = (uint32_t)port_b_val;
174- if(emulate_mouse[0]) {
175- if((opnval & 0xc0) == 0x00) {
176- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x03) << 4), 0xff);
177- return;
178- } else {
179- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x03) << 4) & mouse_button, 0xff);
180- return;
181- }
182- } else if(emulate_mouse[1]) {
183- if((opnval & 0xc0) == 0x40) {
184- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x0c) << 2), 0xff);
185- return;
186- } else {
187- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x0c) << 2) & mouse_button, 0xff);
188- return;
189- }
190- }
191-#endif
192-}
193-#endif
194132
195133 uint32_t JOYSTICK::update_mouse(uint32_t mask)
196134 {
@@ -210,8 +148,6 @@ uint32_t JOYSTICK::update_mouse(uint32_t mask)
210148 mouse_data = (ly >> 4) & 0x0f;
211149 break;
212150 }
213- //mouse_button = 0x00;
214- //printf("%02x\n", (mouse_data | (mask & button) | 0xc0));
215151 return (mouse_data | (mask & button) | 0xc0);
216152 #else
217153 return 0x00;
@@ -228,28 +164,6 @@ void JOYSTICK::event_callback(int event_id, int err)
228164 mouse_timeout_event = -1;
229165 dx = dy = lx = ly = 0;
230166 mouse_data = ly & 0x0f;
231-#if 0
232- {
233- uint32_t opnval = (uint32_t)port_b_val;
234- if(emulate_mouse[0]) {
235- if((opnval & 0xc0) == 0x00) {
236- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x03) << 4), 0xff);
237- return;
238- } else {
239- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x03) << 4) & mouse_button, 0xff);
240- return;
241- }
242- } else if(emulate_mouse[1]) {
243- if((opnval & 0xc0) == 0x40) {
244- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x0c) << 2), 0xff);
245- return;
246- } else {
247- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x0c) << 2) & mouse_button, 0xff);
248- return;
249- }
250- }
251- }
252-#endif
253167 break;
254168 }
255169 #endif
@@ -264,36 +178,8 @@ void JOYSTICK::update_strobe(bool flag)
264178 ly = -dy;
265179 dx = 0;
266180 dy = 0;
267- //if(mouse_state != NULL) {
268- // uint8_t stat = mouse_state[2];
269- // mouse_button = 0x00;
270- // if((stat & 0x01) == 0) mouse_button |= 0x10; // left
271- // if((stat & 0x02) == 0) mouse_button |= 0x20; // right
272- //}
273181 register_event(this, EVENT_MOUSE_TIMEOUT, 2000.0, false, &mouse_timeout_event);
274182 }
275-#if 0
276- {
277- uint32_t opnval = (uint32_t)port_b_val;
278- if(emulate_mouse[0]) {
279- if((opnval & 0xc0) == 0x00) {
280- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x03) << 4), 0xff);
281- return;
282- } else {
283- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x03) << 4) & mouse_button, 0xff);
284- return;
285- }
286- } else if(emulate_mouse[1]) {
287- if((opnval & 0xc0) == 0x40) {
288- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, update_mouse((opnval & 0x0c) << 2), 0xff);
289- return;
290- } else {
291- if(opn != NULL) opn->write_signal(SIG_YM2203_PORT_A, ((opnval & 0x0c) << 2) & mouse_button, 0xff);
292- return;
293- }
294- }
295- }
296-#endif
297183 {
298184 mouse_phase++;
299185 if(mouse_phase >= 4) {
Show on old repository browser