Code Monkey home page Code Monkey logo

Comments (7)

inexorabletash avatar inexorabletash commented on May 20, 2024

Code at $85FC MAIN is used to detect double-clicks. It is called by DeskTop after an icon click (window or desktop), and it stashes the coords and starts a counter, then enters an input loop. If the counter hits zero, the cursor moves beyond a pixel threshold, or a non move/click event occurs it exits. If the event is a click it signals a double click.

The counter is initialized with machine-specific values (IIe = $12C, IIc = $1F4, IIgs = $1FA). These could be inflated although the counter decrement logic only handles values in the range $0 ... $1FF. (There's enough room to replace the counter initialization with larger but fixed values, e.g. $3FF, and generalize the counter decrement logic.)

If the counter is set to infinity (e.g. NOP out the checks) then basic click actions don't work until the mouse moves beyond the pixel threshold, so that's not an acceptable fix for arbitrary acceleration (e.g. an emulator running flat out) - there really does need to be a time limit.

from a2d.

inexorabletash avatar inexorabletash commented on May 20, 2024

Interestingly, there is a second, possibly unused implementation of the double-click detection code.

  • The main one is at desktop_main.s $85FC and uses delta x/y of 8/7 and machine_type*2 as delta t.
  • The second is at desktop_main.s $B554 and uses delta x/y of 5/4 and the machine_type*2 as delta t.

Related, there is insertion point blinking. There are again two implementations:

  • One at main $A56C for the Rename/New Folder prompt; it uses a fixed value of $14 as delta t.
  • One is in ovl4.s circa $5C60 and uses machine_type as the delta t.

Under Virtual ][ at normal speed, both have a cycle of about 1s, which is... weird.

The machine_type field uses: IIgs=$FD, IIc=$FA, IIe=$96; presumably this correlates with the speed of the mouse firmware which affects the input loop.

from a2d.

inexorabletash avatar inexorabletash commented on May 20, 2024

The speed setting could also be used to slow down the open/close window animation on fast machines.

from a2d.

inexorabletash avatar inexorabletash commented on May 20, 2024

Crazy idea for emulators: since emulators slow down when sound is produced, toggle the speaker when initiating a double-click detection loop, and infrequently during the loop. There may be a sweet spot where it isn't audible, but slows the emulator enough.

from a2d.

inexorabletash avatar inexorabletash commented on May 20, 2024

The SPKR trick works in Virtual ][, although it induces a bit of UI jank on any click in a window

from a2d.

inexorabletash avatar inexorabletash commented on May 20, 2024

Correction to previous:

  • There are two IP blinking implementations (one in desktop_main.s, one in ovl4.s, but both use hardcoded $14 value.
  • The routine in ovl4.s circa $5C60 is (yet another) a double-click detection routine, in the file picker dialog.

from a2d.

inexorabletash avatar inexorabletash commented on May 20, 2024

image

The settings should be appropriate for roughly 1MHz, 4MHz, and 32MHz systems (i.e. baseline IIe, accelerated IIc+/IIgs/Laser, and emulators/FastChip).

We can iterate and add more steps if needed.

from a2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.