Previous 199869 Revisions Next

r26266 Monday 18th November, 2013 at 18:02:25 UTC by Jürgen Buchmüller
Fix m_rdram_flag and m_wrtram_flag assignments. Move mouse latch read phases to m_mouse.
[/branches/alto2/src/emu/cpu/alto2]a2mouse.c a2ram.c alto2.c alto2.h

branches/alto2/src/emu/cpu/alto2/a2ram.c
r26265r26266
234234 */
235235void alto2_cpu_device::f1_wrtram_1()
236236{
237   m_wrtram_flag = 1;
237   m_wrtram_flag = true;
238238   LOG((LOG_RAM,2,"   WRTRAM\n"));
239239}
240240
r26265r26266
243243 */
244244void alto2_cpu_device::f1_rdram_1()
245245{
246   m_rdram_flag = 1;
246   m_rdram_flag = true;
247247   LOG((LOG_RAM,2,"   RDRAM\n"));
248248}
249249
branches/alto2/src/emu/cpu/alto2/a2mouse.c
r26265r26266
9595 * Advance the mouse x and y coordinates to the dx and dy
9696 * coordinates by either toggling MX2 or MX1 first for a
9797 * y movement, or MY2 or MY1 for x movement.
98 * There are four read phases counted by m_mouse.phase
9899 *
99 * @result lookup value from madr_a32
100 * @return lookup value from madr_a32
100101 */
101102UINT16 alto2_cpu_device::mouse_read()
102103{
103   static int arg;
104104   UINT16 data;
105105
106106   m_mouse.latch = (m_mouse.latch << 1) & MLATCH;
107107   data = m_madr_a32[m_mouse.latch];
108108
109   switch (arg & 3) {
109   switch (m_mouse.phase) {
110110   case 0:
111111      m_mouse.latch |= MOVEX(m_mouse.dx - m_mouse.x);
112112      m_mouse.latch |= MOVEY(m_mouse.dy - m_mouse.y);
r26265r26266
137137      if (m_mouse.y > m_mouse.dy)
138138         m_mouse.y--;
139139   }
140   arg++;
140   m_mouse.phase = (m_mouse.phase + 1) % 4;
141141   return data;
142142}
143143
r26265r26266
151151INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_x )
152152{
153153   // set new destination (absolute) mouse x coordinate
154   m_mouse.dx += newval - oldval;
154   m_mouse.dx = newval;
155155#if   MOUSE_DIRTY_HACK
156156   /* XXX: dirty, dirty, hack */
157157#if   ALTO2_HAMMING_CHECK
r26265r26266
172172INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_y )
173173{
174174   // set new destination (absolute) mouse y coordinate
175   m_mouse.dy += newval - oldval;
175   m_mouse.dy = newval;
176176#if   MOUSE_DIRTY_HACK
177177   /* XXX: dirty, dirty, hack */
178178#if   ALTO2_HAMMING_CHECK
branches/alto2/src/emu/cpu/alto2/alto2.c
r26265r26266
21952195   UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr) % ALTO2_UCODE_RAM_PAGES;
21962196   UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
21972197
2198   m_rdram_flag = 0;
2198   m_rdram_flag = false;
21992199   if (GET_CRAM_RAMROM(m_cram_addr)) {
22002200      /* read ROM 0 at current mpc */
22012201      addr = m_mpc & 01777;
r26265r26266
22382238   UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr) % ALTO2_UCODE_RAM_PAGES;
22392239   UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
22402240
2241   m_wrtram_flag = 0;
2241   m_wrtram_flag = false;
22422242
22432243   /* write RAM 0,1,2 */
22442244   addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr;
r26265r26266
27312731      // The PROM output lines are
27322732      // B0: unused   B1: TSELECT  B2: ALUCI'   B3: ALUM'
27332733      // B4: ALUS0'   B5: ALUS1'   B6: ALUS2'   B7: ALUS3'
2734      // B3-B7 are inverted on loading the PROM
2734      // B1 and B3-B7 are inverted on loading the PROM
27352735      UINT8 a10 = m_alu_a10[(m_emu.skip << 4) | aluf];
27362736      UINT32 alu = alu_74181(m_bus, m_t, a10);
27372737      m_aluc0 = (alu >> 16) & 1;
branches/alto2/src/emu/cpu/alto2/alto2.h
r26265r26266
13871387
13881388   //! mouse context
13891389   struct {
1390      int x;
1391      int y;
1392      int dx;
1393      int dy;
1394      UINT8 latch;
1390      int x;                              //!< current X coordinate
1391      int y;                              //!< current Y coordinate
1392      int dx;                              //!< destination X coordinate (real mouse X)
1393      int dy;                              //!< destination Y coordinate (real mouse Y)
1394      UINT8 latch;                        //!< current latch value
1395      UINT8 phase;                        //!< current read latch phase
13951396   }   m_mouse;
13961397
13971398   UINT16 mouse_read();                     //!< return the mouse motion flags

Previous 199869 Revisions Next


© 1997-2024 The MAME Team