USBJoystick - licensing and acknowledgements
============================================

This is the single place that records where USBJoystick's code came from
and under what terms it is distributed. Source files carry only a short
pointer back here (c.usbjoystick) or, for vendored third-party files,
their original upstream notice (which their licence requires us to keep).


Summary
-------
  USBJoystick's own code      Apache License 2.0     (file LICENSE, at the
                                                      root of the project)
  Vendored NetBSD HID parser  BSD 2-clause           (text below)
  FreeBSD Xbox 360 descriptor BSD 2-clause           (text below)
  Colin Granville's USB code  BSD 2-clause           (text below)

Copyright 2018-2026 Richard Walker, licensed under the Apache License,
Version 2.0 (the "License"); you may not use this software except in
compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.

The full licence text is in the file LICENSE and is not repeated here.


Third-party code
----------------
Everything not listed below is original to this project and covered by
the Apache License 2.0.

  File(s)                What it is                       Copyright holder(s)
  ---------------------  -------------------------------  --------------------------
  c.data  c.descr        NetBSD libusbhid HID report      Lennart Augustsson
  c.parse  h.usbhid      parser (lib/libusbhid), with     (1999, 2001)
                         small RISC OS portability edits
                         marked "RW"

  h.usb (parts)          report_desc declaration (NetBSD  The NetBSD Foundation
                         libusbhid/usbvar.h) and the HID  (1998), from software by
                         usage definitions (sys/dev/hid/  Lennart Augustsson
                         hid.h)

  c.usb  h.usb (parts)   USB descriptor-walking code and  Colin Granville (2015)
                         types, from USBDescriptors 0.09
                         (BSD 2-clause)

  h.usbrdesc             Replacement HID report           Nick Hibma (2000)
                         descriptor for the Xbox 360      Ed Schouten (2005)
                         controller, from FreeBSD's
                         usb_rdesc.h

These are BSD-licensed. The licence requires that:

  - source redistributions retain the copyright notice, the conditions
    and the disclaimer - so each vendored file keeps its original header,
    and these headers must not be removed or edited;
  - binary redistributions (the module, in RAM or ROM builds) reproduce
    the same in the accompanying documentation - which is what the text
    below is for. Anything that ships the USBJoystick module must ship
    this file, or equivalent, alongside it.

The licence text is the same in all the files above apart from the
copyright line (and, for the NetBSD Foundation's, the name in the
disclaimer):

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  SUCH DAMAGE.

Pristine copies of the upstream NetBSD and FreeBSD files are kept in the
refs directory of the source tree, for comparison when syncing with upstream;
they are not part of the built module.


Prior art and acknowledgements
------------------------------
USBJoystick builds on the following. Code taken directly (including Colin
Granville's USBDescriptors) is listed under "Third-party code" above; the
rest is credited here as the origin of the approach and ideas.

  X-MAME's USB joystick driver (src/unix/joy_usb.c), written by Krister
  Walfridsson and improved by Dieter Baron. The early builds of
  USBJoystick took their data structures and the logic of walking a HID
  report descriptor and classifying axes, buttons and hat from here; the
  driver has since been developed independently and no X-MAME source is
  carried in this project. The HID parser it relies on is the NetBSD code
  listed above.

  James Peacock's EtherUSB (now part of the ROOL source tree), studied for
  how a client module drives USBDriver and uses BufferManager. No code
  was taken from it.

  Steve Fryatt's "A Look at Debugging"
  (https://www.stevefryatt.org.uk/risc-os/wimp-prog/a-look-at-debugging),
  a tutorial that the Reporter interface in c.debugrep was developed from.
