├── .gitignore
├── README.md
├── breakouts
├── gerbview_n64_breakout.gvp
├── gerbview_nes_breakout.gvp
├── gerbview_snes_breakout.gvp
├── n64_breakout.GBL
├── n64_breakout.GBO
├── n64_breakout.GBS
├── n64_breakout.GML
├── n64_breakout.GTL
├── n64_breakout.GTO
├── n64_breakout.GTS
├── n64_breakout.TXT
├── n64_breakout.brd
├── n64_breakout.sch
├── nes_breakout.GBL
├── nes_breakout.GBO
├── nes_breakout.GBS
├── nes_breakout.GML
├── nes_breakout.GTL
├── nes_breakout.GTO
├── nes_breakout.GTS
├── nes_breakout.TXT
├── nes_breakout.brd
├── nes_breakout.sch
├── snes_breakout.GBL
├── snes_breakout.GBO
├── snes_breakout.GBS
├── snes_breakout.GML
├── snes_breakout.GTL
├── snes_breakout.GTO
├── snes_breakout.GTS
├── snes_breakout.TXT
├── snes_breakout.brd
└── snes_breakout.sch
├── firmware
├── 4nes4snes-1.4.2-bitkit
│ ├── Changelog.txt
│ ├── License.txt
│ ├── Makefile
│ ├── Makefile.atmega168
│ ├── Readme.txt
│ ├── checksize
│ ├── circuit
│ │ ├── sch-connectors.png
│ │ └── sch-core.png
│ ├── devdesc.c
│ ├── devdesc.h
│ ├── fournsnes.c
│ ├── fournsnes.h
│ ├── gamepad.h
│ ├── main.c
│ ├── usbconfig.h
│ └── usbdrv
│ │ ├── Changelog.txt
│ │ ├── CommercialLicense.txt
│ │ ├── License.txt
│ │ ├── Readme.txt
│ │ ├── USBID-License.txt
│ │ ├── iarcompat.h
│ │ ├── oddebug.c
│ │ ├── oddebug.h
│ │ ├── usbconfig-prototype.h
│ │ ├── usbdrv.c
│ │ ├── usbdrv.h
│ │ ├── usbdrvasm.S
│ │ ├── usbdrvasm.asm
│ │ ├── usbdrvasm12.S
│ │ ├── usbdrvasm15.S
│ │ ├── usbdrvasm16.S
│ │ └── usbdrvasm165.S
├── README.md
├── gc_n64_usb-2.9.1-bitkit
│ ├── .gitignore
│ ├── Changelog.txt
│ ├── License.txt
│ ├── Makefile
│ ├── Makefile.atmega168
│ ├── Makefile.atmega8
│ ├── Readme.txt
│ ├── calibration_fixer
│ │ ├── readme.txt
│ │ └── src
│ │ │ ├── Makefile
│ │ │ ├── changelog.txt
│ │ │ ├── gc_cal_fix.cpp
│ │ │ └── gc_calfix_ng.exe
│ ├── devdesc.c
│ ├── devdesc.h
│ ├── gamecube.c
│ ├── gamecube.h
│ ├── gamepad.h
│ ├── gc_kb.c
│ ├── gc_kb.h
│ ├── gcn64_protocol.c
│ ├── gcn64_protocol.h
│ ├── hid_keycodes.h
│ ├── leds.h
│ ├── main.c
│ ├── n64.c
│ ├── n64.h
│ ├── reportdesc.c
│ ├── reportdesc.h
│ ├── schematics
│ │ └── readme.txt
│ ├── usbconfig.h
│ └── usbdrv
│ │ ├── Changelog.txt
│ │ ├── CommercialLicense.txt
│ │ ├── License.txt
│ │ ├── Readme.txt
│ │ ├── USB-ID-FAQ.txt
│ │ ├── USB-IDs-for-free.txt
│ │ ├── asmcommon.inc
│ │ ├── oddebug.c
│ │ ├── oddebug.h
│ │ ├── usbdrv.c
│ │ ├── usbdrv.h
│ │ ├── usbdrvasm.S
│ │ ├── usbdrvasm.asm
│ │ ├── usbdrvasm12.inc
│ │ ├── usbdrvasm128.inc
│ │ ├── usbdrvasm15.inc
│ │ ├── usbdrvasm16.inc
│ │ ├── usbdrvasm165.inc
│ │ ├── usbdrvasm18-crc.inc
│ │ ├── usbdrvasm20.inc
│ │ └── usbportability.h
└── nes_snes_db9_usb-1.9-bitkit
│ ├── Changelog.txt
│ ├── License.txt
│ ├── Makefile
│ ├── Readme.txt
│ ├── checksize
│ ├── db9.c
│ ├── db9.h
│ ├── devdesc.c
│ ├── devdesc.h
│ ├── gamepad.h
│ ├── leds.h
│ ├── main.c
│ ├── nes.c
│ ├── nes.h
│ ├── segamtap.c
│ ├── segamtap.h
│ ├── snes.c
│ ├── snes.h
│ ├── snes_descriptor.c
│ ├── snes_descriptor.h
│ ├── snesmouse.c
│ ├── snesmouse.h
│ ├── tg16.c
│ ├── tg16.h
│ ├── usbconfig.h
│ └── usbdrv
│ ├── Changelog.txt
│ ├── CommercialLicense.txt
│ ├── License.txt
│ ├── Readme.txt
│ ├── USBID-License.txt
│ ├── iarcompat.h
│ ├── oddebug.c
│ ├── oddebug.h
│ ├── usbconfig-prototype.h
│ ├── usbdrv.c
│ ├── usbdrv.h
│ ├── usbdrvasm.S
│ ├── usbdrvasm.asm
│ ├── usbdrvasm12.S
│ ├── usbdrvasm15.S
│ ├── usbdrvasm16.S
│ └── usbdrvasm165.S
├── gerbers
├── README.md
├── gerbmerge.cfg
├── gerbmerge.def
├── gerbview.gvp
├── usb-gamepad.GBL
├── usb-gamepad.GBO
├── usb-gamepad.GBS
├── usb-gamepad.GML
├── usb-gamepad.GTL
├── usb-gamepad.GTO
├── usb-gamepad.GTS
└── usb-gamepad.TXT
├── usb-gamepad.brd
└── usb-gamepad.sch
/.gitignore:
--------------------------------------------------------------------------------
1 | lbr
2 | revs
3 | datasheets
4 | diagrams
5 | *panel*
6 | *.b#*
7 | *.bin
8 | *.dri
9 | *.elf
10 | *.gpi
11 | *.hex
12 | *.map
13 | *.o
14 | *.s
15 | *.s#*
16 | *.zip
17 | *.tar.gz
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Classic Gamepad USB Adapter
2 |
3 | This hardware and software allows you to connect your favorite classic gamepad to use as a joystick on your computer. The design is based on work from [raphnet.net](http://raphnet.net/electronique/electronique_en.php#1) and is completely open. The following configurations are supported:
4 |
5 | - Four NES and/or SNES gamepads
6 | - One N64 or Gamecube gamepad
7 | - One Genesis or Atari gamepad
8 |
9 | Connector footprints are also available for NES, SNES, and N64 under the [breakouts](./breakouts/) folder.
10 |
11 |
12 |
13 | # Availability
14 |
15 | Boards available at [OSH Park](https://www.oshpark.com/shared_projects/oCdHAtTx).
16 |
17 | Kits available at [Tindie](https://www.tindie.com/products/gzip/classic-gamepad-usb-adapter/).
18 |
19 |
20 |
21 | ## License
22 |
23 | All hardware and software is derivative of raphnet.net and is therefore GPL. The [breakout boards](./breakouts/) are original works and licensed under [Creative Commons Share Alike](http://creativecommons.org/licenses/by-sa/4.0/).
24 |
25 |
--------------------------------------------------------------------------------
/breakouts/gerbview_n64_breakout.gvp:
--------------------------------------------------------------------------------
1 | (gerbv-file-version! "2.0A")
2 | (define-layer! 10 (cons 'filename "n64_breakout.GBS")(cons 'visible #f)(cons 'color #(57054 57054 57054)))
3 | (define-layer! 9 (cons 'filename "n64_breakout.GBL")(cons 'visible #f)(cons 'color #(6871 6871 65535)))
4 | (define-layer! 7 (cons 'filename "n64_breakout.GBO")(cons 'visible #f)(cons 'color #(65535 65535 65535)))
5 | (define-layer! 6 (cons 'filename "n64_breakout.GTS")(cons 'visible #t)(cons 'color #(65535 0 19202)))
6 | (define-layer! 5 (cons 'filename "n64_breakout.GTL")(cons 'visible #t)(cons 'color #(46104 1586 9148)))
7 | (define-layer! 3 (cons 'filename "n64_breakout.GTO")(cons 'visible #t)(cons 'color #(65535 65535 65535)))
8 | (define-layer! 1 (cons 'filename "n64_breakout.TXT")(cons 'visible #t)(cons 'color #(0 0 0))(cons 'attribs (list (list 'autodetect 'Boolean 1) (list 'zero_supression 'Enum 0) (list 'units 'Enum 0) (list 'digits 'Integer 4))))
9 | (define-layer! 0 (cons 'filename "n64_breakout.GML")(cons 'visible #t)(cons 'color #(0 65535 65535)))
10 | (set-render-type! 0)
11 |
--------------------------------------------------------------------------------
/breakouts/gerbview_nes_breakout.gvp:
--------------------------------------------------------------------------------
1 | (gerbv-file-version! "2.0A")
2 | (define-layer! 10 (cons 'filename "nes_breakout.GBS")(cons 'visible #f)(cons 'color #(57054 57054 57054)))
3 | (define-layer! 9 (cons 'filename "nes_breakout.GBL")(cons 'visible #f)(cons 'color #(6871 6871 65535)))
4 | (define-layer! 7 (cons 'filename "nes_breakout.GBO")(cons 'visible #f)(cons 'color #(65535 65535 65535)))
5 | (define-layer! 6 (cons 'filename "nes_breakout.GTS")(cons 'visible #t)(cons 'color #(65535 0 19202)))
6 | (define-layer! 5 (cons 'filename "nes_breakout.GTL")(cons 'visible #t)(cons 'color #(46104 1586 9148)))
7 | (define-layer! 3 (cons 'filename "nes_breakout.GTO")(cons 'visible #t)(cons 'color #(65535 65535 65535)))
8 | (define-layer! 1 (cons 'filename "nes_breakout.TXT")(cons 'visible #t)(cons 'color #(0 0 0))(cons 'attribs (list (list 'autodetect 'Boolean 1) (list 'zero_supression 'Enum 0) (list 'units 'Enum 0) (list 'digits 'Integer 4))))
9 | (define-layer! 0 (cons 'filename "nes_breakout.GML")(cons 'visible #t)(cons 'color #(0 65535 65535)))
10 | (set-render-type! 0)
11 |
--------------------------------------------------------------------------------
/breakouts/gerbview_snes_breakout.gvp:
--------------------------------------------------------------------------------
1 | (gerbv-file-version! "2.0A")
2 | (define-layer! 10 (cons 'filename "snes_breakout.GBS")(cons 'visible #f)(cons 'color #(57054 57054 57054)))
3 | (define-layer! 9 (cons 'filename "snes_breakout.GBL")(cons 'visible #f)(cons 'color #(6871 6871 65535)))
4 | (define-layer! 7 (cons 'filename "snes_breakout.GBO")(cons 'visible #f)(cons 'color #(65535 65535 65535)))
5 | (define-layer! 6 (cons 'filename "snes_breakout.GTS")(cons 'visible #t)(cons 'color #(65535 0 19202)))
6 | (define-layer! 5 (cons 'filename "snes_breakout.GTL")(cons 'visible #t)(cons 'color #(46104 1586 9148)))
7 | (define-layer! 3 (cons 'filename "snes_breakout.GTO")(cons 'visible #t)(cons 'color #(65535 65535 65535)))
8 | (define-layer! 1 (cons 'filename "snes_breakout.TXT")(cons 'visible #t)(cons 'color #(0 0 0))(cons 'attribs (list (list 'autodetect 'Boolean 1) (list 'zero_supression 'Enum 0) (list 'units 'Enum 0) (list 'digits 'Integer 4))))
9 | (define-layer! 0 (cons 'filename "snes_breakout.GML")(cons 'visible #t)(cons 'color #(0 65535 65535)))
10 | (set-render-type! 0)
11 |
--------------------------------------------------------------------------------
/breakouts/n64_breakout.GBL:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1266*%
11 | %ADD11C,0.0600*%
12 | %ADD12C,0.0160*%
13 | D10*
14 | X003805Y004435D03*
15 | X005405Y004435D03*
16 | X007005Y004435D03*
17 | D11*
18 | X002930Y001210D02*
19 | X002930Y000610D01*
20 | X003930Y000610D02*
21 | X003930Y001210D01*
22 | X004930Y001210D02*
23 | X004930Y000610D01*
24 | X005930Y000610D02*
25 | X005930Y001210D01*
26 | X006930Y001210D02*
27 | X006930Y000610D01*
28 | X007930Y000610D02*
29 | X007930Y001210D01*
30 | D12*
31 | X004930Y000910D02*
32 | X004930Y003960D01*
33 | X004932Y004001D01*
34 | X004937Y004042D01*
35 | X004946Y004083D01*
36 | X004959Y004122D01*
37 | X004975Y004161D01*
38 | X004994Y004198D01*
39 | X005016Y004232D01*
40 | X005041Y004265D01*
41 | X005069Y004296D01*
42 | X005100Y004324D01*
43 | X005133Y004349D01*
44 | X005168Y004371D01*
45 | X005204Y004390D01*
46 | X005243Y004406D01*
47 | X005282Y004419D01*
48 | X005323Y004428D01*
49 | X005364Y004433D01*
50 | X005405Y004435D01*
51 | X003805Y004435D02*
52 | X003430Y004435D01*
53 | X003386Y004433D01*
54 | X003343Y004427D01*
55 | X003301Y004418D01*
56 | X003259Y004405D01*
57 | X003219Y004388D01*
58 | X003180Y004368D01*
59 | X003143Y004345D01*
60 | X003109Y004318D01*
61 | X003076Y004289D01*
62 | X003047Y004256D01*
63 | X003020Y004222D01*
64 | X002997Y004185D01*
65 | X002977Y004146D01*
66 | X002960Y004106D01*
67 | X002947Y004064D01*
68 | X002938Y004022D01*
69 | X002932Y003979D01*
70 | X002930Y003935D01*
71 | X002930Y000910D01*
72 | M02*
73 |
--------------------------------------------------------------------------------
/breakouts/n64_breakout.GBO:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.0080*%
11 | %ADD11C,0.0060*%
12 | D10*
13 | X002720Y001820D02*
14 | X002790Y001750D01*
15 | X002720Y001820D02*
16 | X002720Y001960D01*
17 | X002790Y002030D01*
18 | X002860Y002030D01*
19 | X002930Y001960D01*
20 | X002930Y001890D01*
21 | X002930Y001960D02*
22 | X003000Y002030D01*
23 | X003070Y002030D01*
24 | X003140Y001960D01*
25 | X003140Y001820D01*
26 | X003070Y001750D01*
27 | X002790Y002210D02*
28 | X002790Y002280D01*
29 | X002720Y002280D01*
30 | X002720Y002210D01*
31 | X002790Y002210D01*
32 | X002790Y002441D02*
33 | X002720Y002511D01*
34 | X002720Y002651D01*
35 | X002790Y002721D01*
36 | X002860Y002721D01*
37 | X002930Y002651D01*
38 | X002930Y002581D01*
39 | X002930Y002651D02*
40 | X003000Y002721D01*
41 | X003070Y002721D01*
42 | X003140Y002651D01*
43 | X003140Y002511D01*
44 | X003070Y002441D01*
45 | X003140Y002901D02*
46 | X002860Y002901D01*
47 | X002720Y003041D01*
48 | X002860Y003181D01*
49 | X003140Y003181D01*
50 | X004720Y003258D02*
51 | X004720Y003048D01*
52 | X004790Y002978D01*
53 | X004860Y003048D01*
54 | X004860Y003258D01*
55 | X004930Y003258D02*
56 | X004720Y003258D01*
57 | X004930Y003258D02*
58 | X005000Y003188D01*
59 | X005000Y003048D01*
60 | X005000Y002811D02*
61 | X005000Y002671D01*
62 | X005070Y002741D02*
63 | X004790Y002741D01*
64 | X004720Y002811D01*
65 | X004720Y002491D02*
66 | X004720Y002280D01*
67 | X004790Y002210D01*
68 | X004860Y002280D01*
69 | X004860Y002491D01*
70 | X004930Y002491D02*
71 | X004720Y002491D01*
72 | X004930Y002491D02*
73 | X005000Y002421D01*
74 | X005000Y002280D01*
75 | X005070Y002030D02*
76 | X004790Y002030D01*
77 | X004720Y001960D01*
78 | X004720Y001750D01*
79 | X005140Y001750D01*
80 | X005140Y001960D01*
81 | X005070Y002030D01*
82 | X007720Y001960D02*
83 | X007720Y001820D01*
84 | X007790Y001750D01*
85 | X008070Y001750D01*
86 | X008140Y001820D01*
87 | X008140Y001960D01*
88 | X008070Y002030D01*
89 | X007930Y002030D02*
90 | X007930Y001890D01*
91 | X007930Y002030D02*
92 | X007790Y002030D01*
93 | X007720Y001960D01*
94 | X007720Y002210D02*
95 | X008000Y002210D01*
96 | X008000Y002421D01*
97 | X007930Y002491D01*
98 | X007720Y002491D01*
99 | X007790Y002671D02*
100 | X007930Y002671D01*
101 | X008000Y002741D01*
102 | X008000Y002951D01*
103 | X008140Y002951D02*
104 | X007720Y002951D01*
105 | X007720Y002741D01*
106 | X007790Y002671D01*
107 | D11*
108 | X002680Y000410D02*
109 | X002430Y000660D01*
110 | X002430Y001160D01*
111 | X002680Y001410D01*
112 | X003180Y001410D01*
113 | X003430Y001160D01*
114 | X003430Y000660D01*
115 | X003180Y000410D01*
116 | X002680Y000410D01*
117 | X003430Y000660D02*
118 | X003680Y000410D01*
119 | X004180Y000410D01*
120 | X004430Y000660D01*
121 | X004680Y000410D01*
122 | X005180Y000410D01*
123 | X005430Y000660D01*
124 | X005680Y000410D01*
125 | X006180Y000410D01*
126 | X006430Y000660D01*
127 | X006680Y000410D01*
128 | X007180Y000410D01*
129 | X007430Y000660D01*
130 | X007680Y000410D01*
131 | X008180Y000410D01*
132 | X008430Y000660D01*
133 | X008430Y001160D01*
134 | X008180Y001410D01*
135 | X007680Y001410D01*
136 | X007430Y001160D01*
137 | X007180Y001410D01*
138 | X006680Y001410D01*
139 | X006430Y001160D01*
140 | X006430Y000660D01*
141 | X006430Y001160D02*
142 | X006180Y001410D01*
143 | X005680Y001410D01*
144 | X005430Y001160D01*
145 | X005180Y001410D01*
146 | X004680Y001410D01*
147 | X004430Y001160D01*
148 | X004180Y001410D01*
149 | X003680Y001410D01*
150 | X003430Y001160D01*
151 | X004430Y001160D02*
152 | X004430Y000660D01*
153 | X005430Y000660D02*
154 | X005430Y001160D01*
155 | X007430Y001160D02*
156 | X007430Y000660D01*
157 | M02*
158 |
--------------------------------------------------------------------------------
/breakouts/n64_breakout.GBS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.1346*%
12 | %ADD12C,0.0680*%
13 | D10*
14 | X001430Y001110D03*
15 | X009430Y001110D03*
16 | D11*
17 | X007005Y004435D03*
18 | X005405Y004435D03*
19 | X003805Y004435D03*
20 | D12*
21 | X003930Y001210D02*
22 | X003930Y000610D01*
23 | X004930Y000610D02*
24 | X004930Y001210D01*
25 | X005930Y001210D02*
26 | X005930Y000610D01*
27 | X006930Y000610D02*
28 | X006930Y001210D01*
29 | X007930Y001210D02*
30 | X007930Y000610D01*
31 | X002930Y000610D02*
32 | X002930Y001210D01*
33 | M02*
34 |
--------------------------------------------------------------------------------
/breakouts/n64_breakout.GML:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.0000*%
11 | D10*
12 | X000480Y000710D02*
13 | X000480Y008410D01*
14 | X000482Y008454D01*
15 | X000488Y008497D01*
16 | X000497Y008539D01*
17 | X000510Y008581D01*
18 | X000527Y008621D01*
19 | X000547Y008660D01*
20 | X000570Y008697D01*
21 | X000597Y008731D01*
22 | X000626Y008764D01*
23 | X000659Y008793D01*
24 | X000693Y008820D01*
25 | X000730Y008843D01*
26 | X000769Y008863D01*
27 | X000809Y008880D01*
28 | X000851Y008893D01*
29 | X000893Y008902D01*
30 | X000936Y008908D01*
31 | X000980Y008910D01*
32 | X009880Y008910D01*
33 | X009924Y008908D01*
34 | X009967Y008902D01*
35 | X010009Y008893D01*
36 | X010051Y008880D01*
37 | X010091Y008863D01*
38 | X010130Y008843D01*
39 | X010167Y008820D01*
40 | X010201Y008793D01*
41 | X010234Y008764D01*
42 | X010263Y008731D01*
43 | X010290Y008697D01*
44 | X010313Y008660D01*
45 | X010333Y008621D01*
46 | X010350Y008581D01*
47 | X010363Y008539D01*
48 | X010372Y008497D01*
49 | X010378Y008454D01*
50 | X010380Y008410D01*
51 | X010380Y000710D01*
52 | X010378Y000666D01*
53 | X010372Y000623D01*
54 | X010363Y000581D01*
55 | X010350Y000539D01*
56 | X010333Y000499D01*
57 | X010313Y000460D01*
58 | X010290Y000423D01*
59 | X010263Y000389D01*
60 | X010234Y000356D01*
61 | X010201Y000327D01*
62 | X010167Y000300D01*
63 | X010130Y000277D01*
64 | X010091Y000257D01*
65 | X010051Y000240D01*
66 | X010009Y000227D01*
67 | X009967Y000218D01*
68 | X009924Y000212D01*
69 | X009880Y000210D01*
70 | X000980Y000210D01*
71 | X000936Y000212D01*
72 | X000893Y000218D01*
73 | X000851Y000227D01*
74 | X000809Y000240D01*
75 | X000769Y000257D01*
76 | X000730Y000277D01*
77 | X000693Y000300D01*
78 | X000659Y000327D01*
79 | X000626Y000356D01*
80 | X000597Y000389D01*
81 | X000570Y000423D01*
82 | X000547Y000460D01*
83 | X000527Y000499D01*
84 | X000510Y000539D01*
85 | X000497Y000581D01*
86 | X000488Y000623D01*
87 | X000482Y000666D01*
88 | X000480Y000710D01*
89 | X000800Y001110D02*
90 | X000802Y001160D01*
91 | X000808Y001210D01*
92 | X000818Y001259D01*
93 | X000832Y001307D01*
94 | X000849Y001354D01*
95 | X000870Y001399D01*
96 | X000895Y001443D01*
97 | X000923Y001484D01*
98 | X000955Y001523D01*
99 | X000989Y001560D01*
100 | X001026Y001594D01*
101 | X001066Y001624D01*
102 | X001108Y001651D01*
103 | X001152Y001675D01*
104 | X001198Y001696D01*
105 | X001245Y001712D01*
106 | X001293Y001725D01*
107 | X001343Y001734D01*
108 | X001392Y001739D01*
109 | X001443Y001740D01*
110 | X001493Y001737D01*
111 | X001542Y001730D01*
112 | X001591Y001719D01*
113 | X001639Y001704D01*
114 | X001685Y001686D01*
115 | X001730Y001664D01*
116 | X001773Y001638D01*
117 | X001814Y001609D01*
118 | X001853Y001577D01*
119 | X001889Y001542D01*
120 | X001921Y001504D01*
121 | X001951Y001464D01*
122 | X001978Y001421D01*
123 | X002001Y001377D01*
124 | X002020Y001331D01*
125 | X002036Y001283D01*
126 | X002048Y001234D01*
127 | X002056Y001185D01*
128 | X002060Y001135D01*
129 | X002060Y001085D01*
130 | X002056Y001035D01*
131 | X002048Y000986D01*
132 | X002036Y000937D01*
133 | X002020Y000889D01*
134 | X002001Y000843D01*
135 | X001978Y000799D01*
136 | X001951Y000756D01*
137 | X001921Y000716D01*
138 | X001889Y000678D01*
139 | X001853Y000643D01*
140 | X001814Y000611D01*
141 | X001773Y000582D01*
142 | X001730Y000556D01*
143 | X001685Y000534D01*
144 | X001639Y000516D01*
145 | X001591Y000501D01*
146 | X001542Y000490D01*
147 | X001493Y000483D01*
148 | X001443Y000480D01*
149 | X001392Y000481D01*
150 | X001343Y000486D01*
151 | X001293Y000495D01*
152 | X001245Y000508D01*
153 | X001198Y000524D01*
154 | X001152Y000545D01*
155 | X001108Y000569D01*
156 | X001066Y000596D01*
157 | X001026Y000626D01*
158 | X000989Y000660D01*
159 | X000955Y000697D01*
160 | X000923Y000736D01*
161 | X000895Y000777D01*
162 | X000870Y000821D01*
163 | X000849Y000866D01*
164 | X000832Y000913D01*
165 | X000818Y000961D01*
166 | X000808Y001010D01*
167 | X000802Y001060D01*
168 | X000800Y001110D01*
169 | X008800Y001110D02*
170 | X008802Y001160D01*
171 | X008808Y001210D01*
172 | X008818Y001259D01*
173 | X008832Y001307D01*
174 | X008849Y001354D01*
175 | X008870Y001399D01*
176 | X008895Y001443D01*
177 | X008923Y001484D01*
178 | X008955Y001523D01*
179 | X008989Y001560D01*
180 | X009026Y001594D01*
181 | X009066Y001624D01*
182 | X009108Y001651D01*
183 | X009152Y001675D01*
184 | X009198Y001696D01*
185 | X009245Y001712D01*
186 | X009293Y001725D01*
187 | X009343Y001734D01*
188 | X009392Y001739D01*
189 | X009443Y001740D01*
190 | X009493Y001737D01*
191 | X009542Y001730D01*
192 | X009591Y001719D01*
193 | X009639Y001704D01*
194 | X009685Y001686D01*
195 | X009730Y001664D01*
196 | X009773Y001638D01*
197 | X009814Y001609D01*
198 | X009853Y001577D01*
199 | X009889Y001542D01*
200 | X009921Y001504D01*
201 | X009951Y001464D01*
202 | X009978Y001421D01*
203 | X010001Y001377D01*
204 | X010020Y001331D01*
205 | X010036Y001283D01*
206 | X010048Y001234D01*
207 | X010056Y001185D01*
208 | X010060Y001135D01*
209 | X010060Y001085D01*
210 | X010056Y001035D01*
211 | X010048Y000986D01*
212 | X010036Y000937D01*
213 | X010020Y000889D01*
214 | X010001Y000843D01*
215 | X009978Y000799D01*
216 | X009951Y000756D01*
217 | X009921Y000716D01*
218 | X009889Y000678D01*
219 | X009853Y000643D01*
220 | X009814Y000611D01*
221 | X009773Y000582D01*
222 | X009730Y000556D01*
223 | X009685Y000534D01*
224 | X009639Y000516D01*
225 | X009591Y000501D01*
226 | X009542Y000490D01*
227 | X009493Y000483D01*
228 | X009443Y000480D01*
229 | X009392Y000481D01*
230 | X009343Y000486D01*
231 | X009293Y000495D01*
232 | X009245Y000508D01*
233 | X009198Y000524D01*
234 | X009152Y000545D01*
235 | X009108Y000569D01*
236 | X009066Y000596D01*
237 | X009026Y000626D01*
238 | X008989Y000660D01*
239 | X008955Y000697D01*
240 | X008923Y000736D01*
241 | X008895Y000777D01*
242 | X008870Y000821D01*
243 | X008849Y000866D01*
244 | X008832Y000913D01*
245 | X008818Y000961D01*
246 | X008808Y001010D01*
247 | X008802Y001060D01*
248 | X008800Y001110D01*
249 | M02*
250 |
--------------------------------------------------------------------------------
/breakouts/n64_breakout.GTS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.1346*%
12 | %ADD12C,0.0680*%
13 | D10*
14 | X001430Y001110D03*
15 | X009430Y001110D03*
16 | D11*
17 | X007005Y004435D03*
18 | X005405Y004435D03*
19 | X003805Y004435D03*
20 | D12*
21 | X003930Y001210D02*
22 | X003930Y000610D01*
23 | X004930Y000610D02*
24 | X004930Y001210D01*
25 | X005930Y001210D02*
26 | X005930Y000610D01*
27 | X006930Y000610D02*
28 | X006930Y001210D01*
29 | X007930Y001210D02*
30 | X007930Y000610D01*
31 | X002930Y000610D02*
32 | X002930Y001210D01*
33 | M02*
34 |
--------------------------------------------------------------------------------
/breakouts/n64_breakout.TXT:
--------------------------------------------------------------------------------
1 | %
2 | M48
3 | M72
4 | T01C0.0400
5 | T02C0.0866
6 | T03C0.1260
7 | %
8 | T01
9 | X2930Y910
10 | X3930Y910
11 | X4930Y910
12 | X5930Y910
13 | X6930Y910
14 | X7930Y910
15 | T02
16 | X7005Y4435
17 | X5405Y4435
18 | X3805Y4435
19 | T03
20 | X1430Y1110
21 | X9430Y1110
22 | M30
23 |
--------------------------------------------------------------------------------
/breakouts/nes_breakout.GBL:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1000*%
11 | %ADD11C,0.0600*%
12 | %ADD12C,0.0160*%
13 | D10*
14 | X002630Y004410D03*
15 | X004230Y004410D03*
16 | X005830Y004410D03*
17 | X005830Y006010D03*
18 | X007430Y006010D03*
19 | X004230Y006010D03*
20 | X002630Y006010D03*
21 | D11*
22 | X002615Y001210D02*
23 | X002615Y000610D01*
24 | X003615Y000610D02*
25 | X003615Y001210D01*
26 | X004615Y001210D02*
27 | X004615Y000610D01*
28 | X005615Y000610D02*
29 | X005615Y001210D01*
30 | X006615Y001210D02*
31 | X006615Y000610D01*
32 | X007615Y000610D02*
33 | X007615Y001210D01*
34 | D12*
35 | X006830Y000960D02*
36 | X006680Y000960D01*
37 | X006615Y000910D01*
38 | X006830Y000960D02*
39 | X006830Y005010D01*
40 | X006828Y005070D01*
41 | X006823Y005131D01*
42 | X006814Y005190D01*
43 | X006801Y005249D01*
44 | X006785Y005308D01*
45 | X006765Y005365D01*
46 | X006742Y005420D01*
47 | X006715Y005475D01*
48 | X006686Y005527D01*
49 | X006653Y005578D01*
50 | X006617Y005627D01*
51 | X006579Y005673D01*
52 | X006537Y005717D01*
53 | X006493Y005759D01*
54 | X006447Y005797D01*
55 | X006398Y005833D01*
56 | X006347Y005866D01*
57 | X006295Y005895D01*
58 | X006240Y005922D01*
59 | X006185Y005945D01*
60 | X006128Y005965D01*
61 | X006069Y005981D01*
62 | X006010Y005994D01*
63 | X005951Y006003D01*
64 | X005890Y006008D01*
65 | X005830Y006010D01*
66 | X005030Y005510D02*
67 | X005030Y003460D01*
68 | X005032Y003430D01*
69 | X005037Y003400D01*
70 | X005046Y003371D01*
71 | X005059Y003344D01*
72 | X005074Y003318D01*
73 | X005093Y003294D01*
74 | X005114Y003273D01*
75 | X005138Y003254D01*
76 | X005164Y003239D01*
77 | X005191Y003226D01*
78 | X005220Y003217D01*
79 | X005250Y003212D01*
80 | X005280Y003210D01*
81 | X005325Y003208D01*
82 | X005371Y003202D01*
83 | X005415Y003193D01*
84 | X005459Y003180D01*
85 | X005501Y003164D01*
86 | X005542Y003144D01*
87 | X005581Y003120D01*
88 | X005618Y003094D01*
89 | X005653Y003065D01*
90 | X005685Y003033D01*
91 | X005714Y002998D01*
92 | X005740Y002961D01*
93 | X005764Y002922D01*
94 | X005784Y002881D01*
95 | X005800Y002839D01*
96 | X005813Y002795D01*
97 | X005822Y002751D01*
98 | X005828Y002705D01*
99 | X005830Y002660D01*
100 | X005830Y000910D01*
101 | X005615Y000910D01*
102 | X004615Y000910D02*
103 | X004615Y001816D01*
104 | X004613Y001855D01*
105 | X004607Y001893D01*
106 | X004598Y001930D01*
107 | X004585Y001967D01*
108 | X004568Y002002D01*
109 | X004549Y002035D01*
110 | X004526Y002066D01*
111 | X004500Y002095D01*
112 | X004471Y002121D01*
113 | X004440Y002144D01*
114 | X004407Y002163D01*
115 | X004372Y002180D01*
116 | X004335Y002193D01*
117 | X004298Y002202D01*
118 | X004260Y002208D01*
119 | X004221Y002210D01*
120 | X003930Y002210D01*
121 | X003886Y002212D01*
122 | X003843Y002218D01*
123 | X003801Y002227D01*
124 | X003759Y002240D01*
125 | X003719Y002257D01*
126 | X003680Y002277D01*
127 | X003643Y002300D01*
128 | X003609Y002327D01*
129 | X003576Y002356D01*
130 | X003547Y002389D01*
131 | X003520Y002423D01*
132 | X003497Y002460D01*
133 | X003477Y002499D01*
134 | X003460Y002539D01*
135 | X003447Y002581D01*
136 | X003438Y002623D01*
137 | X003432Y002666D01*
138 | X003430Y002710D01*
139 | X003430Y005510D01*
140 | X003428Y005554D01*
141 | X003422Y005597D01*
142 | X003413Y005639D01*
143 | X003400Y005681D01*
144 | X003383Y005721D01*
145 | X003363Y005760D01*
146 | X003340Y005797D01*
147 | X003313Y005831D01*
148 | X003284Y005864D01*
149 | X003251Y005893D01*
150 | X003217Y005920D01*
151 | X003180Y005943D01*
152 | X003141Y005963D01*
153 | X003101Y005980D01*
154 | X003059Y005993D01*
155 | X003017Y006002D01*
156 | X002974Y006008D01*
157 | X002930Y006010D01*
158 | X002630Y006010D01*
159 | X004230Y006010D02*
160 | X004530Y006010D01*
161 | X004574Y006008D01*
162 | X004617Y006002D01*
163 | X004659Y005993D01*
164 | X004701Y005980D01*
165 | X004741Y005963D01*
166 | X004780Y005943D01*
167 | X004817Y005920D01*
168 | X004851Y005893D01*
169 | X004884Y005864D01*
170 | X004913Y005831D01*
171 | X004940Y005797D01*
172 | X004963Y005760D01*
173 | X004983Y005721D01*
174 | X005000Y005681D01*
175 | X005013Y005639D01*
176 | X005022Y005597D01*
177 | X005028Y005554D01*
178 | X005030Y005510D01*
179 | M02*
180 |
--------------------------------------------------------------------------------
/breakouts/nes_breakout.GBO:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.0080*%
11 | %ADD11C,0.0060*%
12 | D10*
13 | X003420Y001820D02*
14 | X003490Y001750D01*
15 | X003420Y001820D02*
16 | X003420Y001960D01*
17 | X003490Y002030D01*
18 | X003630Y002030D01*
19 | X003700Y001960D01*
20 | X003700Y001890D01*
21 | X003630Y001750D01*
22 | X003840Y001750D01*
23 | X003840Y002030D01*
24 | X003840Y002210D02*
25 | X003560Y002210D01*
26 | X003420Y002351D01*
27 | X003560Y002491D01*
28 | X003840Y002491D01*
29 | X004420Y002491D02*
30 | X004420Y002280D01*
31 | X004490Y002210D01*
32 | X004560Y002280D01*
33 | X004560Y002491D01*
34 | X004630Y002491D02*
35 | X004420Y002491D01*
36 | X004630Y002491D02*
37 | X004700Y002421D01*
38 | X004700Y002280D01*
39 | X004770Y002030D02*
40 | X004490Y002030D01*
41 | X004420Y001960D01*
42 | X004420Y001750D01*
43 | X004840Y001750D01*
44 | X004840Y001960D01*
45 | X004770Y002030D01*
46 | X005420Y002030D02*
47 | X005420Y001750D01*
48 | X005840Y001750D01*
49 | X005490Y002210D02*
50 | X005560Y002280D01*
51 | X005560Y002491D01*
52 | X005630Y002491D02*
53 | X005420Y002491D01*
54 | X005420Y002280D01*
55 | X005490Y002210D01*
56 | X005700Y002280D02*
57 | X005700Y002421D01*
58 | X005630Y002491D01*
59 | X005700Y002671D02*
60 | X005700Y002811D01*
61 | X005770Y002741D02*
62 | X005490Y002741D01*
63 | X005420Y002811D01*
64 | X005490Y002978D02*
65 | X005420Y003048D01*
66 | X005420Y003258D01*
67 | X005420Y003438D02*
68 | X005840Y003438D01*
69 | X005700Y003508D02*
70 | X005700Y003648D01*
71 | X005630Y003718D01*
72 | X005420Y003718D01*
73 | X005630Y003438D02*
74 | X005700Y003508D01*
75 | X005700Y003258D02*
76 | X005700Y003048D01*
77 | X005630Y002978D01*
78 | X005490Y002978D01*
79 | X004770Y002741D02*
80 | X004490Y002741D01*
81 | X004420Y002811D01*
82 | X004490Y002978D02*
83 | X004560Y003048D01*
84 | X004560Y003258D01*
85 | X004630Y003258D02*
86 | X004420Y003258D01*
87 | X004420Y003048D01*
88 | X004490Y002978D01*
89 | X004700Y003048D02*
90 | X004700Y003188D01*
91 | X004630Y003258D01*
92 | X004700Y002811D02*
93 | X004700Y002671D01*
94 | X006420Y002728D02*
95 | X006560Y002517D01*
96 | X006700Y002728D01*
97 | X006840Y002517D02*
98 | X006420Y002517D01*
99 | X006420Y002351D02*
100 | X006420Y002210D01*
101 | X006420Y002280D02*
102 | X006840Y002280D01*
103 | X006840Y002210D01*
104 | X006770Y002030D02*
105 | X006840Y001960D01*
106 | X006840Y001820D01*
107 | X006770Y001750D01*
108 | X006490Y001750D01*
109 | X006420Y001820D01*
110 | X006420Y001960D01*
111 | X006490Y002030D01*
112 | X007420Y001960D02*
113 | X007420Y001820D01*
114 | X007490Y001750D01*
115 | X007770Y001750D01*
116 | X007840Y001820D01*
117 | X007840Y001960D01*
118 | X007770Y002030D01*
119 | X007630Y002030D02*
120 | X007630Y001890D01*
121 | X007630Y002030D02*
122 | X007490Y002030D01*
123 | X007420Y001960D01*
124 | X007420Y002210D02*
125 | X007700Y002210D01*
126 | X007700Y002421D01*
127 | X007630Y002491D01*
128 | X007420Y002491D01*
129 | X007490Y002671D02*
130 | X007420Y002741D01*
131 | X007420Y002951D01*
132 | X007840Y002951D01*
133 | X007700Y002951D02*
134 | X007700Y002741D01*
135 | X007630Y002671D01*
136 | X007490Y002671D01*
137 | D11*
138 | X002365Y000410D02*
139 | X002115Y000660D01*
140 | X002115Y001160D01*
141 | X002365Y001410D01*
142 | X002865Y001410D01*
143 | X003115Y001160D01*
144 | X003115Y000660D01*
145 | X002865Y000410D01*
146 | X002365Y000410D01*
147 | X003115Y000660D02*
148 | X003365Y000410D01*
149 | X003865Y000410D01*
150 | X004115Y000660D01*
151 | X004365Y000410D01*
152 | X004865Y000410D01*
153 | X005115Y000660D01*
154 | X005365Y000410D01*
155 | X005865Y000410D01*
156 | X006115Y000660D01*
157 | X006365Y000410D01*
158 | X006865Y000410D01*
159 | X007115Y000660D01*
160 | X007365Y000410D01*
161 | X007865Y000410D01*
162 | X008115Y000660D01*
163 | X008115Y001160D01*
164 | X007865Y001410D01*
165 | X007365Y001410D01*
166 | X007115Y001160D01*
167 | X006865Y001410D01*
168 | X006365Y001410D01*
169 | X006115Y001160D01*
170 | X006115Y000660D01*
171 | X006115Y001160D02*
172 | X005865Y001410D01*
173 | X005365Y001410D01*
174 | X005115Y001160D01*
175 | X004865Y001410D01*
176 | X004365Y001410D01*
177 | X004115Y001160D01*
178 | X003865Y001410D01*
179 | X003365Y001410D01*
180 | X003115Y001160D01*
181 | X004115Y001160D02*
182 | X004115Y000660D01*
183 | X005115Y000660D02*
184 | X005115Y001160D01*
185 | X007115Y001160D02*
186 | X007115Y000660D01*
187 | M02*
188 |
--------------------------------------------------------------------------------
/breakouts/nes_breakout.GBS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.1080*%
12 | %ADD12C,0.1182*%
13 | %ADD13C,0.0680*%
14 | D10*
15 | X001115Y001110D03*
16 | X009115Y001110D03*
17 | D11*
18 | X005830Y004410D03*
19 | X004230Y004410D03*
20 | X002630Y004410D03*
21 | X002630Y006010D03*
22 | X004230Y006010D03*
23 | X005830Y006010D03*
24 | X007430Y006010D03*
25 | D12*
26 | X008830Y007610D03*
27 | X001430Y002810D03*
28 | D13*
29 | X002615Y001210D02*
30 | X002615Y000610D01*
31 | X003615Y000610D02*
32 | X003615Y001210D01*
33 | X004615Y001210D02*
34 | X004615Y000610D01*
35 | X005615Y000610D02*
36 | X005615Y001210D01*
37 | X006615Y001210D02*
38 | X006615Y000610D01*
39 | X007615Y000610D02*
40 | X007615Y001210D01*
41 | M02*
42 |
--------------------------------------------------------------------------------
/breakouts/nes_breakout.GTS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.1080*%
12 | %ADD12C,0.1182*%
13 | %ADD13C,0.0680*%
14 | D10*
15 | X001115Y001110D03*
16 | X009115Y001110D03*
17 | D11*
18 | X005830Y004410D03*
19 | X004230Y004410D03*
20 | X002630Y004410D03*
21 | X002630Y006010D03*
22 | X004230Y006010D03*
23 | X005830Y006010D03*
24 | X007430Y006010D03*
25 | D12*
26 | X008830Y007610D03*
27 | X001430Y002810D03*
28 | D13*
29 | X002615Y001210D02*
30 | X002615Y000610D01*
31 | X003615Y000610D02*
32 | X003615Y001210D01*
33 | X004615Y001210D02*
34 | X004615Y000610D01*
35 | X005615Y000610D02*
36 | X005615Y001210D01*
37 | X006615Y001210D02*
38 | X006615Y000610D01*
39 | X007615Y000610D02*
40 | X007615Y001210D01*
41 | M02*
42 |
--------------------------------------------------------------------------------
/breakouts/nes_breakout.TXT:
--------------------------------------------------------------------------------
1 | %
2 | M48
3 | M72
4 | T01C0.0400
5 | T02C0.0570
6 | T03C0.1102
7 | T04C0.1260
8 | %
9 | T01
10 | X2615Y910
11 | X3615Y910
12 | X4615Y910
13 | X5615Y910
14 | X6615Y910
15 | X7615Y910
16 | T02
17 | X5830Y4410
18 | X4230Y4410
19 | X2630Y4410
20 | X2630Y6010
21 | X4230Y6010
22 | X5830Y6010
23 | X7430Y6010
24 | T03
25 | X8830Y7610
26 | X1430Y2810
27 | T04
28 | X1115Y1110
29 | X9115Y1110
30 | M30
31 |
--------------------------------------------------------------------------------
/breakouts/snes_breakout.GBL:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1000*%
11 | %ADD11C,0.0600*%
12 | %ADD12C,0.0160*%
13 | D10*
14 | X003180Y004310D03*
15 | X004780Y004310D03*
16 | X006380Y004310D03*
17 | X007980Y004310D03*
18 | X010564Y004310D03*
19 | X012164Y004310D03*
20 | X013764Y004310D03*
21 | D11*
22 | X011080Y001210D02*
23 | X011080Y000610D01*
24 | X010080Y000610D02*
25 | X010080Y001210D01*
26 | X009080Y001210D02*
27 | X009080Y000610D01*
28 | X008080Y000610D02*
29 | X008080Y001210D01*
30 | X007080Y001210D02*
31 | X007080Y000610D01*
32 | X006080Y000610D02*
33 | X006080Y001210D01*
34 | D12*
35 | X006830Y001910D02*
36 | X003680Y001910D01*
37 | X003636Y001912D01*
38 | X003593Y001918D01*
39 | X003551Y001927D01*
40 | X003509Y001940D01*
41 | X003469Y001957D01*
42 | X003430Y001977D01*
43 | X003393Y002000D01*
44 | X003359Y002027D01*
45 | X003326Y002056D01*
46 | X003297Y002089D01*
47 | X003270Y002123D01*
48 | X003247Y002160D01*
49 | X003227Y002199D01*
50 | X003210Y002239D01*
51 | X003197Y002281D01*
52 | X003188Y002323D01*
53 | X003182Y002366D01*
54 | X003180Y002410D01*
55 | X003180Y004310D01*
56 | X004780Y004310D02*
57 | X004780Y004910D01*
58 | X004782Y004954D01*
59 | X004788Y004997D01*
60 | X004797Y005039D01*
61 | X004810Y005081D01*
62 | X004827Y005121D01*
63 | X004847Y005160D01*
64 | X004870Y005197D01*
65 | X004897Y005231D01*
66 | X004926Y005264D01*
67 | X004959Y005293D01*
68 | X004993Y005320D01*
69 | X005030Y005343D01*
70 | X005069Y005363D01*
71 | X005109Y005380D01*
72 | X005151Y005393D01*
73 | X005193Y005402D01*
74 | X005236Y005408D01*
75 | X005280Y005410D01*
76 | X008980Y005410D01*
77 | X008830Y005010D02*
78 | X006380Y005010D01*
79 | X006380Y004310D01*
80 | X007980Y004310D02*
81 | X008080Y004310D01*
82 | X008080Y000910D01*
83 | X007080Y000910D02*
84 | X007080Y001660D01*
85 | X007078Y001690D01*
86 | X007073Y001720D01*
87 | X007064Y001749D01*
88 | X007051Y001776D01*
89 | X007036Y001802D01*
90 | X007017Y001826D01*
91 | X006996Y001847D01*
92 | X006972Y001866D01*
93 | X006946Y001881D01*
94 | X006919Y001894D01*
95 | X006890Y001903D01*
96 | X006860Y001908D01*
97 | X006830Y001910D01*
98 | X009080Y000910D02*
99 | X009080Y004760D01*
100 | X009480Y004910D02*
101 | X009478Y004954D01*
102 | X009472Y004997D01*
103 | X009463Y005039D01*
104 | X009450Y005081D01*
105 | X009433Y005121D01*
106 | X009413Y005160D01*
107 | X009390Y005197D01*
108 | X009363Y005231D01*
109 | X009334Y005264D01*
110 | X009301Y005293D01*
111 | X009267Y005320D01*
112 | X009230Y005343D01*
113 | X009191Y005363D01*
114 | X009151Y005380D01*
115 | X009109Y005393D01*
116 | X009067Y005402D01*
117 | X009024Y005408D01*
118 | X008980Y005410D01*
119 | X009480Y004910D02*
120 | X009480Y001910D01*
121 | X009580Y001910D01*
122 | X009624Y001908D01*
123 | X009667Y001902D01*
124 | X009709Y001893D01*
125 | X009751Y001880D01*
126 | X009791Y001863D01*
127 | X009830Y001843D01*
128 | X009867Y001820D01*
129 | X009901Y001793D01*
130 | X009934Y001764D01*
131 | X009963Y001731D01*
132 | X009990Y001697D01*
133 | X010013Y001660D01*
134 | X010033Y001621D01*
135 | X010050Y001581D01*
136 | X010063Y001539D01*
137 | X010072Y001497D01*
138 | X010078Y001454D01*
139 | X010080Y001410D01*
140 | X010080Y000910D01*
141 | X009080Y004760D02*
142 | X009078Y004790D01*
143 | X009073Y004820D01*
144 | X009064Y004849D01*
145 | X009051Y004876D01*
146 | X009036Y004902D01*
147 | X009017Y004926D01*
148 | X008996Y004947D01*
149 | X008972Y004966D01*
150 | X008946Y004981D01*
151 | X008919Y004994D01*
152 | X008890Y005003D01*
153 | X008860Y005008D01*
154 | X008830Y005010D01*
155 | M02*
156 |
--------------------------------------------------------------------------------
/breakouts/snes_breakout.GBO:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.0080*%
11 | %ADD11C,0.0060*%
12 | D10*
13 | X006870Y001820D02*
14 | X006940Y001750D01*
15 | X006870Y001820D02*
16 | X006870Y001960D01*
17 | X006940Y002030D01*
18 | X007080Y002030D01*
19 | X007150Y001960D01*
20 | X007150Y001890D01*
21 | X007080Y001750D01*
22 | X007290Y001750D01*
23 | X007290Y002030D01*
24 | X007290Y002210D02*
25 | X007010Y002210D01*
26 | X006870Y002351D01*
27 | X007010Y002491D01*
28 | X007290Y002491D01*
29 | X007870Y002491D02*
30 | X007870Y002280D01*
31 | X007940Y002210D01*
32 | X008010Y002280D01*
33 | X008010Y002491D01*
34 | X008080Y002491D02*
35 | X007870Y002491D01*
36 | X008080Y002491D02*
37 | X008150Y002421D01*
38 | X008150Y002280D01*
39 | X008220Y002030D02*
40 | X007940Y002030D01*
41 | X007870Y001960D01*
42 | X007870Y001750D01*
43 | X008290Y001750D01*
44 | X008290Y001960D01*
45 | X008220Y002030D01*
46 | X008870Y002030D02*
47 | X008870Y001750D01*
48 | X009290Y001750D01*
49 | X009870Y001820D02*
50 | X009870Y001960D01*
51 | X009940Y002030D01*
52 | X010220Y002030D02*
53 | X010290Y001960D01*
54 | X010290Y001820D01*
55 | X010220Y001750D01*
56 | X009940Y001750D01*
57 | X009870Y001820D01*
58 | X009870Y002210D02*
59 | X009870Y002351D01*
60 | X009870Y002280D02*
61 | X010290Y002280D01*
62 | X010290Y002210D01*
63 | X010870Y002210D02*
64 | X011150Y002210D01*
65 | X011150Y002421D01*
66 | X011080Y002491D01*
67 | X010870Y002491D01*
68 | X010940Y002671D02*
69 | X011080Y002671D01*
70 | X011150Y002741D01*
71 | X011150Y002951D01*
72 | X011290Y002951D02*
73 | X010870Y002951D01*
74 | X010870Y002741D01*
75 | X010940Y002671D01*
76 | X010290Y002517D02*
77 | X009870Y002517D01*
78 | X010010Y002517D02*
79 | X010150Y002728D01*
80 | X010010Y002517D02*
81 | X009870Y002728D01*
82 | X009220Y002741D02*
83 | X008940Y002741D01*
84 | X008870Y002811D01*
85 | X009150Y002811D02*
86 | X009150Y002671D01*
87 | X009080Y002491D02*
88 | X008870Y002491D01*
89 | X008870Y002280D01*
90 | X008940Y002210D01*
91 | X009010Y002280D01*
92 | X009010Y002491D01*
93 | X009080Y002491D02*
94 | X009150Y002421D01*
95 | X009150Y002280D01*
96 | X008220Y002741D02*
97 | X007940Y002741D01*
98 | X007870Y002811D01*
99 | X008150Y002811D02*
100 | X008150Y002671D01*
101 | X007940Y002978D02*
102 | X008010Y003048D01*
103 | X008010Y003258D01*
104 | X008080Y003258D02*
105 | X007870Y003258D01*
106 | X007870Y003048D01*
107 | X007940Y002978D01*
108 | X008150Y003048D02*
109 | X008150Y003188D01*
110 | X008080Y003258D01*
111 | X008870Y003258D02*
112 | X008870Y003048D01*
113 | X008940Y002978D01*
114 | X009080Y002978D01*
115 | X009150Y003048D01*
116 | X009150Y003258D01*
117 | X009080Y003438D02*
118 | X009150Y003508D01*
119 | X009150Y003648D01*
120 | X009080Y003718D01*
121 | X008870Y003718D01*
122 | X008870Y003438D02*
123 | X009290Y003438D01*
124 | X010870Y001960D02*
125 | X010940Y002030D01*
126 | X011080Y002030D01*
127 | X011080Y001890D01*
128 | X010940Y001750D02*
129 | X010870Y001820D01*
130 | X010870Y001960D01*
131 | X011220Y002030D02*
132 | X011290Y001960D01*
133 | X011290Y001820D01*
134 | X011220Y001750D01*
135 | X010940Y001750D01*
136 | D11*
137 | X005830Y000410D02*
138 | X005580Y000660D01*
139 | X005580Y001160D01*
140 | X005830Y001410D01*
141 | X006330Y001410D01*
142 | X006580Y001160D01*
143 | X006580Y000660D01*
144 | X006330Y000410D01*
145 | X005830Y000410D01*
146 | X006580Y000660D02*
147 | X006830Y000410D01*
148 | X007330Y000410D01*
149 | X007580Y000660D01*
150 | X007830Y000410D01*
151 | X008330Y000410D01*
152 | X008580Y000660D01*
153 | X008830Y000410D01*
154 | X009330Y000410D01*
155 | X009580Y000660D01*
156 | X009830Y000410D01*
157 | X010330Y000410D01*
158 | X010580Y000660D01*
159 | X010830Y000410D01*
160 | X011330Y000410D01*
161 | X011580Y000660D01*
162 | X011580Y001160D01*
163 | X011330Y001410D01*
164 | X010830Y001410D01*
165 | X010580Y001160D01*
166 | X010330Y001410D01*
167 | X009830Y001410D01*
168 | X009580Y001160D01*
169 | X009580Y000660D01*
170 | X010580Y000660D02*
171 | X010580Y001160D01*
172 | X009580Y001160D02*
173 | X009330Y001410D01*
174 | X008830Y001410D01*
175 | X008580Y001160D01*
176 | X008330Y001410D01*
177 | X007830Y001410D01*
178 | X007580Y001160D01*
179 | X007330Y001410D01*
180 | X006830Y001410D01*
181 | X006580Y001160D01*
182 | X007580Y001160D02*
183 | X007580Y000660D01*
184 | X008580Y000660D02*
185 | X008580Y001160D01*
186 | M02*
187 |
--------------------------------------------------------------------------------
/breakouts/snes_breakout.GBS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.1080*%
12 | %ADD12C,0.0680*%
13 | D10*
14 | X004580Y001110D03*
15 | X012580Y001110D03*
16 | D11*
17 | X012164Y004310D03*
18 | X013764Y004310D03*
19 | X010564Y004310D03*
20 | X007980Y004310D03*
21 | X006380Y004310D03*
22 | X004780Y004310D03*
23 | X003180Y004310D03*
24 | D12*
25 | X006080Y001210D02*
26 | X006080Y000610D01*
27 | X007080Y000610D02*
28 | X007080Y001210D01*
29 | X008080Y001210D02*
30 | X008080Y000610D01*
31 | X009080Y000610D02*
32 | X009080Y001210D01*
33 | X010080Y001210D02*
34 | X010080Y000610D01*
35 | X011080Y000610D02*
36 | X011080Y001210D01*
37 | M02*
38 |
--------------------------------------------------------------------------------
/breakouts/snes_breakout.GML:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.0000*%
11 | D10*
12 | X000680Y000210D02*
13 | X016480Y000210D01*
14 | X016524Y000212D01*
15 | X016567Y000218D01*
16 | X016609Y000227D01*
17 | X016651Y000240D01*
18 | X016691Y000257D01*
19 | X016730Y000277D01*
20 | X016767Y000300D01*
21 | X016801Y000327D01*
22 | X016834Y000356D01*
23 | X016863Y000389D01*
24 | X016890Y000423D01*
25 | X016913Y000460D01*
26 | X016933Y000499D01*
27 | X016950Y000539D01*
28 | X016963Y000581D01*
29 | X016972Y000623D01*
30 | X016978Y000666D01*
31 | X016980Y000710D01*
32 | X016980Y006260D01*
33 | X016978Y006304D01*
34 | X016972Y006347D01*
35 | X016963Y006389D01*
36 | X016950Y006431D01*
37 | X016933Y006471D01*
38 | X016913Y006510D01*
39 | X016890Y006547D01*
40 | X016863Y006581D01*
41 | X016834Y006614D01*
42 | X016801Y006643D01*
43 | X016767Y006670D01*
44 | X016730Y006693D01*
45 | X016691Y006713D01*
46 | X016651Y006730D01*
47 | X016609Y006743D01*
48 | X016567Y006752D01*
49 | X016524Y006758D01*
50 | X016480Y006760D01*
51 | X000680Y006760D01*
52 | X000636Y006758D01*
53 | X000593Y006752D01*
54 | X000551Y006743D01*
55 | X000509Y006730D01*
56 | X000469Y006713D01*
57 | X000430Y006693D01*
58 | X000393Y006670D01*
59 | X000359Y006643D01*
60 | X000326Y006614D01*
61 | X000297Y006581D01*
62 | X000270Y006547D01*
63 | X000247Y006510D01*
64 | X000227Y006471D01*
65 | X000210Y006431D01*
66 | X000197Y006389D01*
67 | X000188Y006347D01*
68 | X000182Y006304D01*
69 | X000180Y006260D01*
70 | X000180Y000710D01*
71 | X000182Y000666D01*
72 | X000188Y000623D01*
73 | X000197Y000581D01*
74 | X000210Y000539D01*
75 | X000227Y000499D01*
76 | X000247Y000460D01*
77 | X000270Y000423D01*
78 | X000297Y000389D01*
79 | X000326Y000356D01*
80 | X000359Y000327D01*
81 | X000393Y000300D01*
82 | X000430Y000277D01*
83 | X000469Y000257D01*
84 | X000509Y000240D01*
85 | X000551Y000227D01*
86 | X000593Y000218D01*
87 | X000636Y000212D01*
88 | X000680Y000210D01*
89 | X003950Y001110D02*
90 | X003952Y001160D01*
91 | X003958Y001210D01*
92 | X003968Y001259D01*
93 | X003982Y001307D01*
94 | X003999Y001354D01*
95 | X004020Y001399D01*
96 | X004045Y001443D01*
97 | X004073Y001484D01*
98 | X004105Y001523D01*
99 | X004139Y001560D01*
100 | X004176Y001594D01*
101 | X004216Y001624D01*
102 | X004258Y001651D01*
103 | X004302Y001675D01*
104 | X004348Y001696D01*
105 | X004395Y001712D01*
106 | X004443Y001725D01*
107 | X004493Y001734D01*
108 | X004542Y001739D01*
109 | X004593Y001740D01*
110 | X004643Y001737D01*
111 | X004692Y001730D01*
112 | X004741Y001719D01*
113 | X004789Y001704D01*
114 | X004835Y001686D01*
115 | X004880Y001664D01*
116 | X004923Y001638D01*
117 | X004964Y001609D01*
118 | X005003Y001577D01*
119 | X005039Y001542D01*
120 | X005071Y001504D01*
121 | X005101Y001464D01*
122 | X005128Y001421D01*
123 | X005151Y001377D01*
124 | X005170Y001331D01*
125 | X005186Y001283D01*
126 | X005198Y001234D01*
127 | X005206Y001185D01*
128 | X005210Y001135D01*
129 | X005210Y001085D01*
130 | X005206Y001035D01*
131 | X005198Y000986D01*
132 | X005186Y000937D01*
133 | X005170Y000889D01*
134 | X005151Y000843D01*
135 | X005128Y000799D01*
136 | X005101Y000756D01*
137 | X005071Y000716D01*
138 | X005039Y000678D01*
139 | X005003Y000643D01*
140 | X004964Y000611D01*
141 | X004923Y000582D01*
142 | X004880Y000556D01*
143 | X004835Y000534D01*
144 | X004789Y000516D01*
145 | X004741Y000501D01*
146 | X004692Y000490D01*
147 | X004643Y000483D01*
148 | X004593Y000480D01*
149 | X004542Y000481D01*
150 | X004493Y000486D01*
151 | X004443Y000495D01*
152 | X004395Y000508D01*
153 | X004348Y000524D01*
154 | X004302Y000545D01*
155 | X004258Y000569D01*
156 | X004216Y000596D01*
157 | X004176Y000626D01*
158 | X004139Y000660D01*
159 | X004105Y000697D01*
160 | X004073Y000736D01*
161 | X004045Y000777D01*
162 | X004020Y000821D01*
163 | X003999Y000866D01*
164 | X003982Y000913D01*
165 | X003968Y000961D01*
166 | X003958Y001010D01*
167 | X003952Y001060D01*
168 | X003950Y001110D01*
169 | X011950Y001110D02*
170 | X011952Y001160D01*
171 | X011958Y001210D01*
172 | X011968Y001259D01*
173 | X011982Y001307D01*
174 | X011999Y001354D01*
175 | X012020Y001399D01*
176 | X012045Y001443D01*
177 | X012073Y001484D01*
178 | X012105Y001523D01*
179 | X012139Y001560D01*
180 | X012176Y001594D01*
181 | X012216Y001624D01*
182 | X012258Y001651D01*
183 | X012302Y001675D01*
184 | X012348Y001696D01*
185 | X012395Y001712D01*
186 | X012443Y001725D01*
187 | X012493Y001734D01*
188 | X012542Y001739D01*
189 | X012593Y001740D01*
190 | X012643Y001737D01*
191 | X012692Y001730D01*
192 | X012741Y001719D01*
193 | X012789Y001704D01*
194 | X012835Y001686D01*
195 | X012880Y001664D01*
196 | X012923Y001638D01*
197 | X012964Y001609D01*
198 | X013003Y001577D01*
199 | X013039Y001542D01*
200 | X013071Y001504D01*
201 | X013101Y001464D01*
202 | X013128Y001421D01*
203 | X013151Y001377D01*
204 | X013170Y001331D01*
205 | X013186Y001283D01*
206 | X013198Y001234D01*
207 | X013206Y001185D01*
208 | X013210Y001135D01*
209 | X013210Y001085D01*
210 | X013206Y001035D01*
211 | X013198Y000986D01*
212 | X013186Y000937D01*
213 | X013170Y000889D01*
214 | X013151Y000843D01*
215 | X013128Y000799D01*
216 | X013101Y000756D01*
217 | X013071Y000716D01*
218 | X013039Y000678D01*
219 | X013003Y000643D01*
220 | X012964Y000611D01*
221 | X012923Y000582D01*
222 | X012880Y000556D01*
223 | X012835Y000534D01*
224 | X012789Y000516D01*
225 | X012741Y000501D01*
226 | X012692Y000490D01*
227 | X012643Y000483D01*
228 | X012593Y000480D01*
229 | X012542Y000481D01*
230 | X012493Y000486D01*
231 | X012443Y000495D01*
232 | X012395Y000508D01*
233 | X012348Y000524D01*
234 | X012302Y000545D01*
235 | X012258Y000569D01*
236 | X012216Y000596D01*
237 | X012176Y000626D01*
238 | X012139Y000660D01*
239 | X012105Y000697D01*
240 | X012073Y000736D01*
241 | X012045Y000777D01*
242 | X012020Y000821D01*
243 | X011999Y000866D01*
244 | X011982Y000913D01*
245 | X011968Y000961D01*
246 | X011958Y001010D01*
247 | X011952Y001060D01*
248 | X011950Y001110D01*
249 | M02*
250 |
--------------------------------------------------------------------------------
/breakouts/snes_breakout.GTS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.1080*%
12 | %ADD12C,0.0680*%
13 | D10*
14 | X004580Y001110D03*
15 | X012580Y001110D03*
16 | D11*
17 | X012164Y004310D03*
18 | X013764Y004310D03*
19 | X010564Y004310D03*
20 | X007980Y004310D03*
21 | X006380Y004310D03*
22 | X004780Y004310D03*
23 | X003180Y004310D03*
24 | D12*
25 | X006080Y001210D02*
26 | X006080Y000610D01*
27 | X007080Y000610D02*
28 | X007080Y001210D01*
29 | X008080Y001210D02*
30 | X008080Y000610D01*
31 | X009080Y000610D02*
32 | X009080Y001210D01*
33 | X010080Y001210D02*
34 | X010080Y000610D01*
35 | X011080Y000610D02*
36 | X011080Y001210D01*
37 | M02*
38 |
--------------------------------------------------------------------------------
/breakouts/snes_breakout.TXT:
--------------------------------------------------------------------------------
1 | %
2 | M48
3 | M72
4 | T01C0.0400
5 | T02C0.0570
6 | T03C0.1260
7 | %
8 | T01
9 | X6080Y910
10 | X7080Y910
11 | X8080Y910
12 | X9080Y910
13 | X10080Y910
14 | X11080Y910
15 | T02
16 | X10564Y4310
17 | X12164Y4310
18 | X13764Y4310
19 | X7980Y4310
20 | X6380Y4310
21 | X4780Y4310
22 | X3180Y4310
23 | T03
24 | X4580Y1110
25 | X12580Y1110
26 | M30
27 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/Changelog.txt:
--------------------------------------------------------------------------------
1 | --- v1.4.2 (July 14, 2013)
2 | - Corrected the USB Vendor ID
3 |
4 | --- v1.4.1 (April 26, 2013)
5 | - Reduced declared max current from 120mA to 100mA. This makes
6 | it possible to connect the adapter to my keyboard USB port but
7 | is still a conservative estimate for the worst combination
8 | of hypothetical non-standard power hungry controllers.
9 | - Some code cleanups
10 |
11 | --- v1.4 (April 20, 2013)
12 | - Support for Atmega168. Use Makefile.atmega168.
13 | - New USB VID/PID
14 | - Simplified main loop by remving setIdle/getIdle implementation. Optional for
15 | joysticks according to HID specification appendix G.
16 |
17 | --- v1.3 (April 2012)
18 | - Added support for SNES multitaps in 4 player mode.
19 |
20 | --- v1.2 (May 2, 2009)
21 | - License changed to GPLv2
22 | - Implemented "Live autodetection". This allows NES and SNES controllers to be
23 | changed at runtime. This feature can be disabled by closing JP1.
24 | - Added NES fourscore support. When a fourscore is detected in port 1, fourscore
25 | mode is entered and ports 1 and 2 are used to read up to 4 NES controllers.
26 |
27 | --- v1.1 (18 Apr 2007)
28 | - Changed report descriptor. There are now four separate report IDs, one
29 | per controller. This was necessary because even though all axis and buttons
30 | were perfectly functional in 'control panel -> game controllers', it was not
31 | the case in many games, including zsnes and snes9x!
32 | - Changed device id to 0x0A9D
33 |
34 | --- v1.0 (24 Mar 2007)
35 | Initial release.
36 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/Makefile:
--------------------------------------------------------------------------------
1 | CC=avr-gcc
2 | AS=$(CC)
3 | LD=$(CC)
4 | PROGNAME=4nes4snes-m8
5 | CPU=atmega8
6 |
7 | CFLAGS=-Wall -Os -Iusbdrv -I. -mmcu=$(CPU) -DF_CPU=12000000L #-DDEBUG_LEVEL=1
8 | LDFLAGS=-Wl,-Map=$(PROGNAME).map -mmcu=$(CPU)
9 | AVRDUDE=avrdude -p m8 -c usbasp
10 |
11 | OBJS=usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o fournsnes.o devdesc.o
12 |
13 | HEXFILE=$(PROGNAME).hex
14 | ELFFILE=$(PROGNAME).elf
15 |
16 | # symbolic targets:
17 | all: $(HEXFILE)
18 |
19 | .c.o:
20 | $(CC) $(CFLAGS) -c $< -o $@
21 |
22 | .S.o:
23 | $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@
24 | # "-x assembler-with-cpp" should not be necessary since this is the default
25 | # file type for the .S (with capital S) extension. However, upper case
26 | # characters are not always preserved on Windows. To ensure WinAVR
27 | # compatibility define the file type manually.
28 |
29 | .c.s:
30 | $(CC) $(CFLAGS) -S $< -o $@
31 |
32 |
33 | clean:
34 | rm -f $(HEXFILE) main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
35 |
36 | # file targets:
37 | $(ELFFILE): $(OBJS)
38 | $(LD) $(LDFLAGS) -o $(ELFFILE) $(OBJS)
39 |
40 | $(HEXFILE): $(ELFFILE)
41 | rm -f $(HEXFILE)
42 | avr-objcopy -j .text -j .data -O ihex $(ELFFILE) $(HEXFILE)
43 | ./checksize $(ELFFILE)
44 |
45 |
46 | flash: $(HEXFILE)
47 | $(AVRDUDE) -Uflash:w:$(HEXFILE) -B 1.0
48 |
49 | flashall: flash fuse
50 |
51 | # Fuse high byte:
52 | # 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
53 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
54 | # | | | | | +-------- BOOTSZ1
55 | # | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
56 | # | | | +-------------- CKOPT (full output swing)
57 | # | | +---------------- SPIEN (allow serial programming)
58 | # | +------------------ WDTON (WDT not always on)
59 | # +-------------------- RSTDISBL (reset pin is enabled)
60 | # Fuse low byte:
61 | # 0x9f = 1 0 0 1 1 1 1 1
62 | # ^ ^ \ / \--+--/
63 | # | | | +------- CKSEL 3..0 (external >8M crystal)
64 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
65 | # | +------------------ BODEN (BrownOut Detector enabled)
66 | # +-------------------- BODLEVEL (2.7V)
67 |
68 | LFUSE=0x9F
69 | HFUSE=0xC9
70 |
71 | fuse:
72 | $(AVRDUDE) -e -Uhfuse:w:$(HFUSE):m -Ulfuse:w:$(LFUSE):m -B 20.0 -v
73 |
74 | chip_erase:
75 | $(AVRDUDE) -e -B 1.0 -F
76 |
77 | reset:
78 | $(AVRDUDE) -B 1.0 -F
79 |
80 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/Makefile.atmega168:
--------------------------------------------------------------------------------
1 | CC=avr-gcc
2 | AS=$(CC)
3 | LD=$(CC)
4 | PROGNAME=4nes4snes-m168
5 | CPU=atmega168
6 |
7 | CFLAGS=-Wall -Os -Iusbdrv -I. -mmcu=$(CPU) -DF_CPU=12000000L #-DDEBUG_LEVEL=1
8 | LDFLAGS=-Wl,-Map=$(PROGNAME).map -mmcu=$(CPU)
9 | AVRDUDE=avrdude -p m168 -P usb -c avrispmkII
10 |
11 | OBJS=usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o fournsnes.o devdesc.o
12 |
13 | HEXFILE=$(PROGNAME).hex
14 | ELFFILE=$(PROGNAME).elf
15 |
16 | # symbolic targets:
17 | all: $(HEXFILE)
18 |
19 | .c.o:
20 | $(CC) $(CFLAGS) -c $< -o $@
21 |
22 | .S.o:
23 | $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@
24 | # "-x assembler-with-cpp" should not be necessary since this is the default
25 | # file type for the .S (with capital S) extension. However, upper case
26 | # characters are not always preserved on Windows. To ensure WinAVR
27 | # compatibility define the file type manually.
28 |
29 | .c.s:
30 | $(CC) $(CFLAGS) -S $< -o $@
31 |
32 |
33 | clean:
34 | rm -f $(HEXFILE) main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
35 |
36 | # file targets:
37 | $(ELFFILE): $(OBJS)
38 | $(LD) $(LDFLAGS) -o $(ELFFILE) $(OBJS)
39 |
40 | $(HEXFILE): $(ELFFILE)
41 | rm -f $(HEXFILE)
42 | avr-objcopy -j .text -j .data -O ihex $(ELFFILE) $(HEXFILE)
43 | ./checksize $(ELFFILE)
44 |
45 |
46 | flash: $(HEXFILE)
47 | $(AVRDUDE) -Uflash:w:$(HEXFILE) -B 1.0
48 |
49 | # Extended fuse byte (Datasheet Table 28-5)
50 | #
51 | # - - - - - BOOTSZ1 BOOTSZ0 BOOTRST
52 | # 0 0 0 0 0 0 0 1
53 | #
54 | EFUSE=0x01
55 |
56 | # Fuse high byte (Datasheet Table 28-6)
57 | #
58 | # RSTDISBL DWEN SPIEN WDTON EESAVE BODLEVEL2 BODLEVEL1 BODLEVEL0
59 | # 1 1 0 1 0 1 0 1
60 | #
61 | HFUSE=0xd5
62 |
63 | # Fuse low byte (Datasheet Table 28-7)
64 | #
65 | # CKDIV8 CKOUT SUT1 SUT0 CKSEL3 CKSEL2 CKSEL1 CKSEL0
66 | # 1 1 0 1 0 1 1 1
67 | #
68 | # Full swing crystal oscillator
69 | # 0.4 - 20 MHz : CKSEL3..1 011
70 | #
71 | # Crystal Oscillator, BOD enabled (Table 9-6)
72 | # CKSEL0 : 1
73 | # SUT1..0 : 01
74 | #
75 | LFUSE=0xD7
76 |
77 | fuse:
78 | $(AVRDUDE) -e -Uefuse:w:$(EFUSE):m -Uhfuse:w:$(HFUSE):m -Ulfuse:w:$(LFUSE):m -B 20.0 -v
79 |
80 | chip_erase:
81 | $(AVRDUDE) -e -B 1.0 -F
82 |
83 | reset:
84 | $(AVRDUDE) -B 1.0 -F
85 |
86 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/Readme.txt:
--------------------------------------------------------------------------------
1 | This is 4nes4snes Readme.txt file.
2 |
3 | Table of contents:
4 |
5 | 1) What is 4nes4snes?
6 | 2) USB Implementation
7 | 3) Compilation and installation
8 | 4) License
9 | 5) About the vendor id/product id pair:
10 | 6) Where do I get more information and updates?
11 |
12 |
13 | 1) What is 4nes4snes?
14 | --------------------
15 | 4nes4snes if a firmware for Atmel ATmega8 and Atmega168*
16 | which allows one to connect up to 4 NES and/or SNES
17 | controllers to a PC using a single circuit.
18 |
19 | The device connects to an USB port and appears to the
20 | PC as standard HID joystick with 4 report Id's. This means
21 | that it looks like 4 controllers in Windows's
22 | control_panel->game_controllers window.
23 |
24 | * Other devices from the same family are probably supported, but
25 | not tested.
26 |
27 |
28 | 2) USB Implementation
29 | ------------------
30 | 4nes4snes uses the software-only usb driver from Objective Development.
31 | See http://www.obdev.at/products/avrusb/index.html
32 |
33 | A good portion of 4nes4snes is based on Objective Development's
34 | HIDKeys example.
35 |
36 |
37 | 3) Compilation and installation
38 | ----------------------------
39 | First, you must compile it. To compile, you need a working avr-gcc and
40 | avr-libc. Under linux or cygwin, simply type make in the project directory.
41 | (assuming avr-gcc is in your path).
42 |
43 | Next, you must upload the generated file (main.hex) to the Atmega8 using
44 | whatever tools you like. Personally, I use uisp. The 'flash' and 'fuse'
45 | targets in the makefile is a good example about how to use it.
46 |
47 | The Atmega fuse bits must also be set properly. The idea behind this is to
48 | enable the external 12mhz crystal instead of the internal clock. Check the
49 | makefile for good fuse bytes values.
50 |
51 |
52 | 4) License
53 | -------
54 | 4nes4snes is released under the GPLv2 license. See License.txt
55 |
56 |
57 | 5) About the vendor id/product id pair:
58 | ------------------------------------
59 | Please do not re-use them for other projects. Instead,
60 | obtain your own.
61 |
62 |
63 | 6) Where can I get more information and updates?
64 | --------------------------------------------
65 | Visit the 4nes4snes webpage:
66 | http://www.raphnet.net/electronique/4nes4snes/index_en.php
67 | you may also contact me by email:
68 | Raphael Assenat
69 |
70 |
71 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/checksize:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Name: checksize
3 | # Project: AVR-USB
4 | # Author: Christian Starkjohann
5 | # Creation Date: 2004-12-29
6 | # Tabsize: 4
7 | # Copyright: (c) 2005 OBJECTIVE DEVELOPMENT Software GmbH.
8 | # Revision: $Id: checksize,v 1.1.1.1 2007-03-25 02:59:31 raph Exp $
9 |
10 | error=0
11 | codelimit=8192
12 | datalimit=960 # leave 64 bytes for stack
13 |
14 | if [ $# -gt 1 ]; then
15 | codelimit="$2"
16 | fi
17 | if [ $# -gt 2 ]; then
18 | datalimit="$3"
19 | fi
20 |
21 | set -- `avr-size -d "$1" | awk '/[0-9]/ {print $1 + $2, $2 + $3, $2}'`
22 | if [ $1 -gt $codelimit ]; then
23 | echo "*** code size $1 exceeds limit of $codelimit"
24 | error=1
25 | else
26 | echo "ROM: $1 bytes (data=$3)"
27 | fi
28 | if [ $2 -gt $datalimit ]; then
29 | echo "*** data size $2 exceeds limit of $datalimit"
30 | error=1
31 | else
32 | echo "RAM: $2 bytes"
33 | fi
34 |
35 | exit $error
36 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/circuit/sch-connectors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/4nes4snes-1.4.2-bitkit/circuit/sch-connectors.png
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/circuit/sch-core.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/4nes4snes-1.4.2-bitkit/circuit/sch-core.png
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/devdesc.c:
--------------------------------------------------------------------------------
1 | #include "devdesc.h"
2 | #include "usbconfig.h"
3 |
4 | #define USBDESCR_DEVICE 1
5 |
6 | const char usbDescrDevice[] PROGMEM = { /* USB device descriptor */
7 | 18, /* sizeof(usbDescrDevice): length of descriptor in bytes */
8 | USBDESCR_DEVICE, /* descriptor type */
9 | 0x01, 0x01, /* USB version supported */
10 | USB_CFG_DEVICE_CLASS,
11 | USB_CFG_DEVICE_SUBCLASS,
12 | 0, /* protocol */
13 | 8, /* max packet size */
14 | USB_CFG_VENDOR_ID, /* 2 bytes */
15 | USB_CFG_DEVICE_ID, /* 2 bytes */
16 | USB_CFG_DEVICE_VERSION, /* 2 bytes */
17 | #if USB_CFG_VENDOR_NAME_LEN
18 | 1, /* manufacturer string index */
19 | #else
20 | 0, /* manufacturer string index */
21 | #endif
22 |
23 | 2, /* product string index */
24 | 3, /* serial number string index */
25 | 1, /* number of configurations */
26 | };
27 |
28 | int getUsbDescrDevice_size(void) { return sizeof(usbDescrDevice); }
29 |
30 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/devdesc.h:
--------------------------------------------------------------------------------
1 | #ifndef _devdesc_h__
2 | #define _devdesc_h__
3 |
4 | #include
5 |
6 | extern const char usbDescrDevice[] PROGMEM;
7 | int getUsbDescrDevice_size(void);
8 |
9 | #endif // _devdesc_h__
10 |
11 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/fournsnes.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | void disableLiveAutodetect(void);
4 | Gamepad *fournsnesGetGamepad(void);
5 |
6 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/gamepad.h:
--------------------------------------------------------------------------------
1 | #ifndef _gamepad_h__
2 | #define _gamepad_h__
3 |
4 | typedef struct {
5 | // size of reports built by buildReport
6 | char num_reports;
7 |
8 | int reportDescriptorSize;
9 | void *reportDescriptor; // must be in flash
10 |
11 | int deviceDescriptorSize; // if 0, use default
12 | void *deviceDescriptor; // must be in flash
13 |
14 | void (*init)(void);
15 | void (*update)(void);
16 |
17 | char (*changed)(unsigned char id);
18 | /**
19 | * \param id Controller id (starting at 1 to match report IDs)
20 | * \return The number of bytes written to buf.
21 | * */
22 | char (*buildReport)(unsigned char *buf, char id);
23 | } Gamepad;
24 |
25 | #endif // _gamepad_h__
26 |
27 |
28 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/usbdrv/CommercialLicense.txt:
--------------------------------------------------------------------------------
1 | AVR-USB Driver Software License Agreement
2 | Version 2006-07-24
3 |
4 | THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN
5 | ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING
6 | THE AMOUNT ACCORDING TO SECTION 4 ("PAYMENT") TO OBJECTIVE DEVELOPMENT.
7 |
8 |
9 | 1 DEFINITIONS
10 |
11 | 1.1 "OBJECTIVE DEVELOPMENT" shall mean OBJECTIVE DEVELOPMENT Software GmbH,
12 | Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA.
13 |
14 | 1.2 "You" shall mean the Licensee.
15 |
16 | 1.3 "AVR-USB" shall mean the firmware-only USB device implementation for
17 | Atmel AVR microcontrollers distributed by OBJECTIVE DEVELOPMENT and
18 | consisting of the files usbdrv.c, usbdrv.h, usbdrvasm.S, oddebug.c,
19 | oddebug.h, usbdrvasm.asm, iarcompat.h and usbconfig-prototype.h.
20 |
21 |
22 | 2 LICENSE GRANTS
23 |
24 | 2.1 Source Code. OBJECTIVE DEVELOPMENT shall furnish you with the source
25 | code of AVR-USB.
26 |
27 | 2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the
28 | non-exclusive right to use and distribute AVR-USB with your hardware
29 | product(s), restricted by the limitations in section 3 below.
30 |
31 | 2.3 Modifications. OBJECTIVE DEVELOPMENT grants you the right to modify
32 | your copy of AVR-USB according to your needs.
33 |
34 | 2.4 USB IDs. OBJECTIVE DEVELOPMENT grants you the exclusive rights to use
35 | USB Product ID(s) sent to you in e-mail after receiving your payment in
36 | conjunction with USB Vendor ID 5824. OBJECTIVE DEVELOPMENT has acquired an
37 | exclusive license for this pair of USB identifiers from Wouter van Ooijen
38 | (www.voti.nl), who has licensed the VID from the USB Implementers Forum,
39 | Inc. (www.usb.org).
40 |
41 |
42 | 3 LICENSE RESTRICTIONS
43 |
44 | 3.1 Number of Units. Only one of the following three definitions is
45 | applicable. Which one is determined by the amount you pay to OBJECTIVE
46 | DEVELOPMENT, see section 4 ("Payment") below.
47 |
48 | Hobby License: You may use AVR-USB according to section 2 above in no more
49 | than 5 hardware units. These units must not be sold for profit.
50 |
51 | Entry Level License: You may use AVR-USB according to section 2 above in no
52 | more than 150 hardware units.
53 |
54 | Professional License: You may use AVR-USB according to section 2 above in
55 | any number of hardware units, except for large scale production ("unlimited
56 | fair use"). Quantities below 10,000 units are not considered large scale
57 | production. If your reach quantities which are obviously large scale
58 | production, you must pay a license fee of 0.10 EUR per unit for all units
59 | above 10,000.
60 |
61 | 3.2 Rental. You may not rent, lease, or lend AVR-USB or otherwise encumber
62 | any copy of AVR-USB, or any of the rights granted herein.
63 |
64 | 3.3 Transfer. You may not transfer your rights under this Agreement to
65 | another party without OBJECTIVE DEVELOPMENT's prior written consent. If
66 | such consent is obtained, you may permanently transfer this License to
67 | another party. The recipient of such transfer must agree to all terms and
68 | conditions of this Agreement.
69 |
70 | 3.4 Reservation of Rights. OBJECTIVE DEVELOPMENT retains all rights not
71 | expressly granted.
72 |
73 | 3.5 Non-Exclusive Rights. Your license rights under this Agreement are
74 | non-exclusive.
75 |
76 | 3.6 Third Party Rights. This Agreement cannot grant you rights controlled
77 | by third parties. In particular, you are not allowed to use the USB logo or
78 | other trademarks owned by the USB Implementers Forum, Inc. without their
79 | consent. Since such consent depends on USB certification, it should be
80 | noted that AVR-USB will not pass certification because it does not
81 | implement checksum verification and the microcontroller ports do not meet
82 | the electrical specifications.
83 |
84 |
85 | 4 PAYMENT
86 |
87 | The payment amount depends on the variation of this agreement (according to
88 | section 3.1) into which you want to enter. Concrete prices are listed on
89 | OBJECTIVE DEVELOPMENT's web site, usually at
90 | http://www.obdev.at/avrusb/license.html. You agree to pay the amount listed
91 | there to OBJECTIVE DEVELOPMENT or OBJECTIVE DEVELOPMENT's payment processor
92 | or reseller.
93 |
94 |
95 | 5 COPYRIGHT AND OWNERSHIP
96 |
97 | AVR-USB is protected by copyright laws and international copyright
98 | treaties, as well as other intellectual property laws and treaties. AVR-USB
99 | is licensed, not sold.
100 |
101 |
102 | 6 TERM AND TERMINATION
103 |
104 | 6.1 Term. This Agreement shall continue indefinitely. However, OBJECTIVE
105 | DEVELOPMENT may terminate this Agreement and revoke the granted license and
106 | USB-IDs if you fail to comply with any of its terms and conditions.
107 |
108 | 6.2 Survival of Terms. All provisions regarding secrecy, confidentiality
109 | and limitation of liability shall survive termination of this agreement.
110 |
111 |
112 | 7 DISCLAIMER OF WARRANTY AND LIABILITY
113 |
114 | LIMITED WARRANTY. AVR-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
115 | KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, OBJECTIVE
116 | DEVELOPMENT AND ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES, EITHER
117 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
118 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
119 | NON-INFRINGEMENT, WITH REGARD TO AVR-USB, AND THE PROVISION OF OR FAILURE
120 | TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL
121 | RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO
122 | STATE/JURISDICTION.
123 |
124 | LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
125 | IN NO EVENT SHALL OBJECTIVE DEVELOPMENT OR ITS SUPPLIERS BE LIABLE FOR ANY
126 | SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
127 | (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
128 | BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY
129 | LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE AVR-USB OR THE
130 | PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIVE
131 | DEVELOPMENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY
132 | CASE, OBJECTIVE DEVELOPMENT'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS
133 | AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR AVR-USB.
134 |
135 |
136 | 8 MISCELLANEOUS TERMS
137 |
138 | 8.1 Marketing. OBJECTIVE DEVELOPMENT has the right to mention for marketing
139 | purposes that you entered into this agreement.
140 |
141 | 8.2 Entire Agreement. This document represents the entire agreement between
142 | OBJECTIVE DEVELOPMENT and you. It may only be modified in writing signed by
143 | an authorized representative of both, OBJECTIVE DEVELOPMENT and you.
144 |
145 | 8.3 Severability. In case a provision of these terms and conditions should
146 | be or become partly or entirely invalid, ineffective, or not executable,
147 | the validity of all other provisions shall not be affected.
148 |
149 | 8.4 Applicable Law. This agreement is governed by the laws of the Republic
150 | of Austria.
151 |
152 | 8.5 Responsible Courts. The responsible courts in Vienna/Austria will have
153 | exclusive jurisdiction regarding all disputes in connection with this
154 | agreement.
155 |
156 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/usbdrv/USBID-License.txt:
--------------------------------------------------------------------------------
1 | Royalty-Free Non-Exclusive License USB Product-ID
2 | =================================================
3 |
4 | Version 2006-06-19
5 |
6 | OBJECTIVE DEVELOPMENT Software GmbH hereby grants you the non-exclusive
7 | right to use three USB.org vendor-ID (VID) / product-ID (PID) pairs with
8 | products based on Objective Development's firmware-only USB driver for
9 | Atmel AVR microcontrollers:
10 |
11 | * VID = 5824 (=0x16c0) / PID = 1500 (=0x5dc) for devices implementing no
12 | USB device class (vendor-class devices with USB class = 0xff). Devices
13 | using this pair will be referred to as "VENDOR CLASS" devices.
14 |
15 | * VID = 5824 (=0x16c0) / PID = 1503 (=0x5df) for HID class devices
16 | (excluding mice and keyboards). Devices using this pair will be referred
17 | to as "HID CLASS" devices.
18 |
19 | * VID = 5824 (=0x16c0) / PID = 1505 (=0x5e1) for CDC class modem devices
20 | Devices using this pair will be referred to as "CDC-ACM CLASS" devices.
21 |
22 | Since the granted right is non-exclusive, the same VID/PID pairs may be
23 | used by many companies and individuals for different products. To avoid
24 | conflicts, your device and host driver software MUST adhere to the rules
25 | outlined below.
26 |
27 | OBJECTIVE DEVELOPMENT Software GmbH has licensed these VID/PID pairs from
28 | Wouter van Ooijen (see www.voti.nl), who has licensed the VID from the USB
29 | Implementers Forum, Inc. (see www.usb.org). The VID is registered for the
30 | company name "Van Ooijen Technische Informatica".
31 |
32 |
33 | RULES AND RESTRICTIONS
34 | ======================
35 |
36 | (1) The USB device MUST provide a textual representation of the
37 | manufacturer and product identification. The manufacturer identification
38 | MUST be available at least in USB language 0x0409 (English/US).
39 |
40 | (2) The textual manufacturer identification MUST contain either an Internet
41 | domain name (e.g. "mycompany.com") registered and owned by you, or an
42 | e-mail address under your control (e.g. "myname@gmx.net"). You can embed
43 | the domain name or e-mail address in any string you like, e.g. "Objective
44 | Development http://www.obdev.at/avrusb/".
45 |
46 | (3) You are responsible for retaining ownership of the domain or e-mail
47 | address for as long as any of your products are in use.
48 |
49 | (4) You may choose any string for the textual product identification, as
50 | long as this string is unique within the scope of your textual manufacturer
51 | identification.
52 |
53 | (5) Matching of device-specific drivers MUST be based on the textual
54 | manufacturer and product identification in addition to the usual VID/PID
55 | matching. This means that operating system features which are based on
56 | VID/PID matching only (e.g. Windows kernel level drivers, automatic actions
57 | when the device is plugged in etc) MUST NOT be used. The driver matching
58 | MUST be a comparison of the entire strings, NOT a sub-string match. For
59 | CDC-ACM CLASS devices, a generic class driver should be used and the
60 | matching is based on the USB device class.
61 |
62 | (6) The extent to which VID/PID matching is allowed for non device-specific
63 | drivers or features depends on the operating system and particular VID/PID
64 | pair used:
65 |
66 | * Mac OS X, Linux, FreeBSD and other Unixes: No VID/PID matching is
67 | required and hence no VID/PID-only matching is allowed at all.
68 |
69 | * Windows: The operating system performs VID/PID matching for the kernel
70 | level driver. You are REQUIRED to use libusb-win32 (see
71 | http://libusb-win32.sourceforge.net/) as the kernel level driver for
72 | VENDOR CLASS devices. HID CLASS devices all use the generic HID class
73 | driver shipped with Windows, except mice and keyboards. You therefore
74 | MUST NOT use any of the shared VID/PID pairs for mice or keyboards.
75 | CDC-ACM CLASS devices require a ".inf" file which matches on the VID/PID
76 | pair. This ".inf" file MUST load the "usbser" driver to configure the
77 | device as modem (COM-port).
78 |
79 | (7) OBJECTIVE DEVELOPMENT Software GmbH disclaims all liability for any
80 | problems which are caused by the shared use of these VID/PID pairs. You
81 | have been warned that the sharing of VID/PID pairs may cause problems. If
82 | you want to avoid them, get your own VID/PID pair for exclusive use.
83 |
84 |
85 | HOW TO IMPLEMENT THESE RULES
86 | ============================
87 |
88 | The following rules are for VENDOR CLASS and HID CLASS devices. CDC-ACM
89 | CLASS devices use the operating system's class driver and don't need a
90 | custom driver.
91 |
92 | The host driver MUST iterate over all devices with the given VID/PID
93 | numbers in their device descriptors and query the string representation for
94 | the manufacturer name in USB language 0x0409 (English/US). It MUST compare
95 | the ENTIRE string with your textual manufacturer identification chosen in
96 | (2) above. A substring search for your domain or e-mail address is NOT
97 | acceptable. The driver MUST NOT touch the device (other than querying the
98 | descriptors) unless the strings match.
99 |
100 | For all USB devices with matching VID/PID and textual manufacturer
101 | identification, the host driver must query the textual product
102 | identification and string-compare it with the name of the product it can
103 | control. It may only initialize the device if the product matches exactly.
104 |
105 | Objective Development provides examples for these matching rules with the
106 | "PowerSwitch" project (using libusb) and with the "Automator" project
107 | (using Windows calls on Windows and libusb on Unix).
108 |
109 |
110 | Technical Notes:
111 | ================
112 |
113 | Sharing the same VID/PID pair among devices is possible as long as ALL
114 | drivers which match the VID/PID also perform matching on the textual
115 | identification strings. This is easy on all operating systems except
116 | Windows, since Windows establishes a static connection between the VID/PID
117 | pair and a kernel level driver. All devices with the same VID/PID pair must
118 | therefore use THE SAME kernel level driver.
119 |
120 | We therefore demand that you use libusb-win32 for VENDOR CLASS devices.
121 | This is a generic kernel level driver which allows all types of USB access
122 | for user space applications. This is only a partial solution of the
123 | problem, though, because different device drivers may come with different
124 | versions of libusb-win32 and they may not work with the libusb version of
125 | the respective other driver. You are therefore encouraged to test your
126 | driver against a broad range of libusb-win32 versions. Do not use new
127 | features in new versions, or check for their existence before you use them.
128 | When a new libusb-win32 becomes available, make sure that your driver is
129 | compatible with it.
130 |
131 | For HID CLASS devices it is necessary that all those devices bind to the
132 | same kernel driver: Microsoft's generic USB HID driver. This is true for
133 | all HID devices except those with a specialized driver. Currently, the only
134 | HIDs with specialized drivers are mice and keyboards. You therefore MUST
135 | NOT use a shared VID/PID with mouse and keyboard devices.
136 |
137 | Sharing the same VID/PID among different products is unusual and probably
138 | violates the USB specification. If you do it, you do it at your own risk.
139 |
140 | To avoid possible incompatibilities, we highly recommend that you get your
141 | own VID/PID pair if you intend to sell your product. Objective
142 | Development's commercial licenses for AVR-USB include a PID for
143 | unrestricted exclusive use.
144 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/usbdrv/iarcompat.h:
--------------------------------------------------------------------------------
1 | /* Name: iarcompat.h
2 | * Project: AVR USB driver
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2006-03-01
5 | * Tabsize: 4
6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: iarcompat.h,v 1.2 2009-05-02 12:41:41 cvs Exp $
9 | */
10 |
11 | /*
12 | General Description:
13 | This header is included when we compile with the IAR C-compiler and assembler.
14 | It defines macros for cross compatibility between gcc and IAR-cc.
15 |
16 | Thanks to Oleg Semyonov for his help with the IAR tools port!
17 | */
18 |
19 | #ifndef __iarcompat_h_INCLUDED__
20 | #define __iarcompat_h_INCLUDED__
21 |
22 | #if defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__
23 |
24 | /* Enable bit definitions */
25 | #ifndef ENABLE_BIT_DEFINITIONS
26 | # define ENABLE_BIT_DEFINITIONS 1
27 | #endif
28 |
29 | /* Include IAR headers */
30 | #include
31 | #ifndef __IAR_SYSTEMS_ASM__
32 | # include
33 | #endif
34 |
35 | #define __attribute__(arg)
36 | #define IAR_SECTION(section) @ section
37 |
38 | #ifndef USB_BUFFER_SECTION
39 | # define USB_BUFFER_SECTION "TINY_Z" /* if user has not selected a named section */
40 | #endif
41 |
42 | #ifdef __IAR_SYSTEMS_ASM__
43 | # define __ASSEMBLER__
44 | #endif
45 |
46 | #ifdef __HAS_ELPM__
47 | # define PROGMEM __farflash
48 | #else
49 | # define PROGMEM __flash
50 | #endif
51 |
52 | #define PRG_RDB(addr) (*(PROGMEM char *)(addr))
53 |
54 | /* The following definitions are not needed by the driver, but may be of some
55 | * help if you port a gcc based project to IAR.
56 | */
57 | #define cli() __disable_interrupt()
58 | #define sei() __enable_interrupt()
59 | #define wdt_reset() __watchdog_reset()
60 |
61 | /* Depending on the device you use, you may get problems with the way usbdrv.h
62 | * handles the differences between devices. Since IAR does not use #defines
63 | * for MCU registers, we can't check for the existence of a particular
64 | * register with an #ifdef. If the autodetection mechanism fails, include
65 | * definitions for the required USB_INTR_* macros in your usbconfig.h. See
66 | * usbconfig-prototype.h and usbdrv.h for details.
67 | */
68 |
69 | #endif /* defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__ */
70 | #endif /* __iarcompat_h_INCLUDED__ */
71 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/usbdrv/oddebug.c:
--------------------------------------------------------------------------------
1 | /* Name: oddebug.c
2 | * Project: AVR library
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2005-01-16
5 | * Tabsize: 4
6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: oddebug.c,v 1.2 2009-05-02 12:41:41 cvs Exp $
9 | */
10 |
11 | #include "oddebug.h"
12 |
13 | #if DEBUG_LEVEL > 0
14 |
15 | #warning "Never compile production devices with debugging enabled"
16 |
17 | static void uartPutc(char c)
18 | {
19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */
20 | ODDBG_UDR = c;
21 | }
22 |
23 | static uchar hexAscii(uchar h)
24 | {
25 | h &= 0xf;
26 | if(h >= 10)
27 | h += 'a' - (uchar)10 - '0';
28 | h += '0';
29 | return h;
30 | }
31 |
32 | static void printHex(uchar c)
33 | {
34 | uartPutc(hexAscii(c >> 4));
35 | uartPutc(hexAscii(c));
36 | }
37 |
38 | void odDebug(uchar prefix, uchar *data, uchar len)
39 | {
40 | printHex(prefix);
41 | uartPutc(':');
42 | while(len--){
43 | uartPutc(' ');
44 | printHex(*data++);
45 | }
46 | uartPutc('\r');
47 | uartPutc('\n');
48 | }
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/usbdrv/oddebug.h:
--------------------------------------------------------------------------------
1 | /* Name: oddebug.h
2 | * Project: AVR library
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2005-01-16
5 | * Tabsize: 4
6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: oddebug.h,v 1.2 2009-05-02 12:41:41 cvs Exp $
9 | */
10 |
11 | #ifndef __oddebug_h_included__
12 | #define __oddebug_h_included__
13 |
14 | /*
15 | General Description:
16 | This module implements a function for debug logs on the serial line of the
17 | AVR microcontroller. Debugging can be configured with the define
18 | 'DEBUG_LEVEL'. If this macro is not defined or defined to 0, all debugging
19 | calls are no-ops. If it is 1, DBG1 logs will appear, but not DBG2. If it is
20 | 2, DBG1 and DBG2 logs will be printed.
21 |
22 | A debug log consists of a label ('prefix') to indicate which debug log created
23 | the output and a memory block to dump in hex ('data' and 'len').
24 | */
25 |
26 |
27 | #ifndef F_CPU
28 | # define F_CPU 12000000 /* 12 MHz */
29 | #endif
30 |
31 | /* make sure we have the UART defines: */
32 | #include "iarcompat.h"
33 | #ifndef __IAR_SYSTEMS_ICC__
34 | # include
35 | #endif
36 |
37 | #ifndef uchar
38 | # define uchar unsigned char
39 | #endif
40 |
41 | #if DEBUG_LEVEL > 0 && !(defined TXEN || defined TXEN0) /* no UART in device */
42 | # warning "Debugging disabled because device has no UART"
43 | # undef DEBUG_LEVEL
44 | #endif
45 |
46 | #ifndef DEBUG_LEVEL
47 | # define DEBUG_LEVEL 0
48 | #endif
49 |
50 | /* ------------------------------------------------------------------------- */
51 |
52 | #if DEBUG_LEVEL > 0
53 | # define DBG1(prefix, data, len) odDebug(prefix, data, len)
54 | #else
55 | # define DBG1(prefix, data, len)
56 | #endif
57 |
58 | #if DEBUG_LEVEL > 1
59 | # define DBG2(prefix, data, len) odDebug(prefix, data, len)
60 | #else
61 | # define DBG2(prefix, data, len)
62 | #endif
63 |
64 | /* ------------------------------------------------------------------------- */
65 |
66 | #if DEBUG_LEVEL > 0
67 | extern void odDebug(uchar prefix, uchar *data, uchar len);
68 |
69 | /* Try to find our control registers; ATMEL likes to rename these */
70 |
71 | #if defined UBRR
72 | # define ODDBG_UBRR UBRR
73 | #elif defined UBRRL
74 | # define ODDBG_UBRR UBRRL
75 | #elif defined UBRR0
76 | # define ODDBG_UBRR UBRR0
77 | #elif defined UBRR0L
78 | # define ODDBG_UBRR UBRR0L
79 | #endif
80 |
81 | #if defined UCR
82 | # define ODDBG_UCR UCR
83 | #elif defined UCSRB
84 | # define ODDBG_UCR UCSRB
85 | #elif defined UCSR0B
86 | # define ODDBG_UCR UCSR0B
87 | #endif
88 |
89 | #if defined TXEN
90 | # define ODDBG_TXEN TXEN
91 | #else
92 | # define ODDBG_TXEN TXEN0
93 | #endif
94 |
95 | #if defined USR
96 | # define ODDBG_USR USR
97 | #elif defined UCSRA
98 | # define ODDBG_USR UCSRA
99 | #elif defined UCSR0A
100 | # define ODDBG_USR UCSR0A
101 | #endif
102 |
103 | #if defined UDRE
104 | # define ODDBG_UDRE UDRE
105 | #else
106 | # define ODDBG_UDRE UDRE0
107 | #endif
108 |
109 | #if defined UDR
110 | # define ODDBG_UDR UDR
111 | #elif defined UDR0
112 | # define ODDBG_UDR UDR0
113 | #endif
114 |
115 | static inline void odDebugInit(void)
116 | {
117 | ODDBG_UCR |= (1< /* for CPU I/O register definitions and vectors */
24 | #endif /* __IAR_SYSTEMS_ASM__ */
25 | #include "usbdrv.h" /* for common defs */
26 |
27 | /* register names */
28 | #define x1 r16
29 | #define x2 r17
30 | #define shift r18
31 | #define cnt r19
32 | #define x3 r20
33 | #define x4 r21
34 | #define bitcnt r22
35 | #define phase x4
36 | #define leap x4
37 |
38 | /* Some assembler dependent definitions and declarations: */
39 |
40 | #ifdef __IAR_SYSTEMS_ASM__
41 |
42 | # define nop2 rjmp $+2 /* jump to next instruction */
43 | # define XL r26
44 | # define XH r27
45 | # define YL r28
46 | # define YH r29
47 | # define ZL r30
48 | # define ZH r31
49 | # define lo8(x) LOW(x)
50 | # define hi8(x) (((x)>>8) & 0xff) /* not HIGH to allow XLINK to make a proper range check */
51 |
52 | extern usbRxBuf, usbDeviceAddr, usbNewDeviceAddr, usbInputBufOffset
53 | extern usbCurrentTok, usbRxLen, usbRxToken, usbTxLen
54 | extern usbTxBuf, usbMsgLen, usbTxLen1, usbTxBuf1, usbTxLen3, usbTxBuf3
55 | # if USB_COUNT_SOF
56 | extern usbSofCount
57 | # endif
58 | public usbCrc16
59 | public usbCrc16Append
60 |
61 | COMMON INTVEC
62 | # ifndef USB_INTR_VECTOR
63 | ORG INT0_vect
64 | # else /* USB_INTR_VECTOR */
65 | ORG USB_INTR_VECTOR
66 | # undef USB_INTR_VECTOR
67 | # endif /* USB_INTR_VECTOR */
68 | # define USB_INTR_VECTOR usbInterruptHandler
69 | rjmp USB_INTR_VECTOR
70 | RSEG CODE
71 |
72 | #else /* __IAR_SYSTEMS_ASM__ */
73 |
74 | # define nop2 rjmp .+0 /* jump to next instruction */
75 |
76 | # ifndef USB_INTR_VECTOR /* default to hardware interrupt INT0 */
77 | # define USB_INTR_VECTOR INT0_vect /* was SIG_INTERRUPT0 */
78 | # endif
79 | .text
80 | .global USB_INTR_VECTOR
81 | .type USB_INTR_VECTOR, @function
82 | .global usbCrc16
83 | .global usbCrc16Append
84 | #endif /* __IAR_SYSTEMS_ASM__ */
85 |
86 |
87 | #if USB_INTR_PENDING < 0x40 /* This is an I/O address, use in and out */
88 | # define USB_LOAD_PENDING(reg) in reg, USB_INTR_PENDING
89 | # define USB_STORE_PENDING(reg) out USB_INTR_PENDING, reg
90 | #else /* It's a memory address, use lds and sts */
91 | # define USB_LOAD_PENDING(reg) lds reg, USB_INTR_PENDING
92 | # define USB_STORE_PENDING(reg) sts USB_INTR_PENDING, reg
93 | #endif
94 |
95 |
96 | ;----------------------------------------------------------------------------
97 | ; Utility functions
98 | ;----------------------------------------------------------------------------
99 |
100 | #ifdef __IAR_SYSTEMS_ASM__
101 | /* Register assignments for usbCrc16 on IAR cc */
102 | /* Calling conventions on IAR:
103 | * First parameter passed in r16/r17, second in r18/r19 and so on.
104 | * Callee must preserve r4-r15, r24-r29 (r28/r29 is frame pointer)
105 | * Result is passed in r16/r17
106 | * In case of the "tiny" memory model, pointers are only 8 bit with no
107 | * padding. We therefore pass argument 1 as "16 bit unsigned".
108 | */
109 | RTMODEL "__rt_version", "3"
110 | /* The line above will generate an error if cc calling conventions change.
111 | * The value "3" above is valid for IAR 4.10B/W32
112 | */
113 | # define argLen r18 /* argument 2 */
114 | # define argPtrL r16 /* argument 1 */
115 | # define argPtrH r17 /* argument 1 */
116 |
117 | # define resCrcL r16 /* result */
118 | # define resCrcH r17 /* result */
119 |
120 | # define ptrL ZL
121 | # define ptrH ZH
122 | # define ptr Z
123 | # define byte r22
124 | # define bitCnt r19
125 | # define polyL r20
126 | # define polyH r21
127 | # define scratch r23
128 |
129 | #else /* __IAR_SYSTEMS_ASM__ */
130 | /* Register assignments for usbCrc16 on gcc */
131 | /* Calling conventions on gcc:
132 | * First parameter passed in r24/r25, second in r22/23 and so on.
133 | * Callee must preserve r1-r17, r28/r29
134 | * Result is passed in r24/r25
135 | */
136 | # define argLen r22 /* argument 2 */
137 | # define argPtrL r24 /* argument 1 */
138 | # define argPtrH r25 /* argument 1 */
139 |
140 | # define resCrcL r24 /* result */
141 | # define resCrcH r25 /* result */
142 |
143 | # define ptrL XL
144 | # define ptrH XH
145 | # define ptr x
146 | # define byte r18
147 | # define bitCnt r19
148 | # define polyL r20
149 | # define polyH r21
150 | # define scratch r23
151 |
152 | #endif
153 |
154 | ; extern unsigned usbCrc16(unsigned char *data, unsigned char len);
155 | ; data: r24/25
156 | ; len: r22
157 | ; temp variables:
158 | ; r18: data byte
159 | ; r19: bit counter
160 | ; r20/21: polynomial
161 | ; r23: scratch
162 | ; r24/25: crc-sum
163 | ; r26/27=X: ptr
164 | usbCrc16:
165 | mov ptrL, argPtrL
166 | mov ptrH, argPtrH
167 | ldi resCrcL, 0xff
168 | ldi resCrcH, 0xff
169 | ldi polyL, lo8(0xa001)
170 | ldi polyH, hi8(0xa001)
171 | crcByteLoop:
172 | subi argLen, 1
173 | brcs crcReady
174 | ld byte, ptr+
175 | ldi bitCnt, 8
176 | crcBitLoop:
177 | mov scratch, byte
178 | eor scratch, resCrcL
179 | lsr resCrcH
180 | ror resCrcL
181 | lsr byte
182 | sbrs scratch, 0
183 | rjmp crcNoXor
184 | eor resCrcL, polyL
185 | eor resCrcH, polyH
186 | crcNoXor:
187 | dec bitCnt
188 | brne crcBitLoop
189 | rjmp crcByteLoop
190 | crcReady:
191 | com resCrcL
192 | com resCrcH
193 | ret
194 |
195 | ; extern unsigned usbCrc16Append(unsigned char *data, unsigned char len);
196 | usbCrc16Append:
197 | rcall usbCrc16
198 | st ptr+, resCrcL
199 | st ptr+, resCrcH
200 | ret
201 |
202 |
203 | ;----------------------------------------------------------------------------
204 | ; Now include the clock rate specific code
205 | ;----------------------------------------------------------------------------
206 |
207 | #ifndef USB_CFG_CLOCK_KHZ
208 | # define USB_CFG_CLOCK_KHZ 12000
209 | #endif
210 |
211 | #if USB_CFG_CLOCK_KHZ == 12000
212 | # include "usbdrvasm12.S"
213 | #elif USB_CFG_CLOCK_KHZ == 15000
214 | # include "usbdrvasm15.S"
215 | #elif USB_CFG_CLOCK_KHZ == 16000
216 | # include "usbdrvasm16.S"
217 | #elif USB_CFG_CLOCK_KHZ == 16500
218 | # include "usbdrvasm165.S"
219 | #else
220 | # error "USB_CFG_CLOCK_KHZ is not one of the supported rates!"
221 | #endif
222 |
--------------------------------------------------------------------------------
/firmware/4nes4snes-1.4.2-bitkit/usbdrv/usbdrvasm.asm:
--------------------------------------------------------------------------------
1 | /* Name: usbdrvasm.asm
2 | * Project: AVR USB driver
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2006-03-01
5 | * Tabsize: 4
6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: usbdrvasm.asm,v 1.2 2009-05-02 12:41:41 cvs Exp $
9 | */
10 |
11 | /*
12 | General Description:
13 | The IAR compiler/assembler system prefers assembler files with file extension
14 | ".asm". We simply provide this file as an alias for usbdrvasm.S.
15 |
16 | Thanks to Oleg Semyonov for his help with the IAR tools port!
17 | */
18 |
19 | #include "usbdrvasm.S"
20 |
21 | end
22 |
--------------------------------------------------------------------------------
/firmware/README.md:
--------------------------------------------------------------------------------
1 | # Firmware for the Classic Gamepad USB Adapter
2 |
3 | The software here is provided by [raphnet.net](http://raphnet.net/electronique/electronique_en.php#1) and has been modified minimally to change the data pin(s), remove any code related to jumper settings, and change the VID/PID as requested by the original author. The following configurations are available here:
4 |
5 | - Four NES and/or SNES gamepads
6 | - One N64 or Gamecube gamepad
7 | - One Genesis or Atari gamepad
8 |
9 | ## License
10 |
11 | GPL
12 |
13 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 | *.hex
3 | *.bin
4 | *.elf
5 | *.map
6 | *.swp
7 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/Changelog.txt:
--------------------------------------------------------------------------------
1 | --- v2.9.1 (April 17, 2014)
2 | - Prevent 8bit overflow from occuring. Helps some cheap 3rd party
3 | controllers that have the "Left not working" problem.
4 | - Fix non-working timeout when waiting for the controller. The
5 | adapter now enumerate without controllers as it used to.
6 |
7 | --- v2.9 (November 24, 2013)
8 | - Add support for the Gamecube ASCII keyboard.
9 | - Rework for device/report descriptor switching. Used
10 | to switch from Joystick to Keyboard mode.
11 | - Improved N64 rumble pack detection.
12 | - Fix compilation with newer compilers.
13 | - Various code cleanups.
14 | - Updated V-USB.
15 |
16 | --- v2.3 (June 24, 2013)
17 | - Added support for Atmega168. Use Makefile.atmega168.
18 | (Should also work with Atmega88 and 328 [not tested])
19 | - Simplified main loop by removing setIdle/getIdle implementation,
20 | optional for joysticks according to HID specification appendix G.
21 | - Code cleanups.
22 |
23 | --- v2.2 (February 11, 2013)
24 | - Reduced USB interrupt-in poll interval.
25 | - Use a new USB Vendor ID
26 | - A new calibration fixer updated to support this new firmware is available.
27 | - The calibration fixer source code is now available.
28 | - Serial number now working again.
29 |
30 | --- v2.1 (November 12, 2011)
31 | - Fixed USB detection when no controllers are present. This was broken
32 | in 2.0. Controller swapping still worked fine though.
33 |
34 | - Changed the device name to allow easier version identification.
35 |
36 | --- v2.0 (November 3, 2011)
37 | - Force feedback support:
38 | - N64 rumble pack and Gamecube controller built-in vibration supported!
39 | - Implemented using standard HID PID (Physical Interface Device) which
40 | means: No special driver required. Tested on Linux (fftest) and win7
41 | directx.
42 | - Special thanks to Sean Green for providing an updated device
43 | descriptor and an example main.c from his own project for me
44 | to use and finally implement this feature. Without this, I don't
45 | think I would have ever taken the time to add this feature.
46 |
47 | - The L and R buttons analog feature on gamecube controllers can be
48 | disabled. Useful when they are causing problems and you don't mind
49 | using only the L and R digital switches. To disable the analog feature,
50 | fully press L and R when connecting the controller.
51 |
52 | - The calibration fixer windows executables are now provided with
53 | the source code. See calibration_fixer/readme.txt for details.
54 |
55 | - Code cleanups:
56 | - New asm transmission code capable of sending many bytes with perfect
57 | timing.
58 | - N64/Gamecube communication code is now shared between the N64 and
59 | GC drivers. It's the same wire protocol so it makes sense.
60 |
61 | --- v1.4 (June 2011)
62 | - Update gamecube reception code using the new N64 algorithm from 1.3.
63 | To my knowledge, this does not fix a known problem but being more robust
64 | should be good.
65 |
66 | - Synchronized controller polling with USB polling. This should prevent USB
67 | communications from interferring with the timing sensitive N64/Gamecube
68 | protocol. At least with my equipment, this seems to fix very rare spurious
69 | button presses (One in several minutes).
70 |
71 | - Confirmed the adapter works with the new white gamecube controllers with
72 | extra long cable (Japanese import).
73 |
74 | --- v1.3 (May 2011)
75 | - Found out why some HORI pads where having issues (random joystick jumps and
76 | spurious button presses). This is due to the HORI communication timing
77 | being very different from original Nintento pads. (1.5 times slower bit
78 | rate). Implemented a new reception algorithm that should be very tolerant
79 | to timing variations and jitter. Works well with all my controllers.
80 |
81 | - It is now possible hot-swap between N64 and Gamecube controllers.
82 | With earlier versions, this would have required a disconnect/reconnect
83 | of the USB cable to reset the firmware.
84 |
85 | - It is no longer necessary to connect a controller (gc or N64) in
86 | order for the adapter to be detected by the computer (USB).
87 |
88 | - Updated USB code to vusb-20100715 from
89 | http://www.obdev.at/products/vusb/index.html
90 |
91 | --- v1.2 (Nov ??, 2008)
92 | Nintendo Wavebird controllers are now supported.
93 | Compatibility improvements.
94 |
95 | --- v1.1 (Nov 11, 2007)
96 | C-Stick vertical orientation was wrong.
97 |
98 | --- v1.0 (Apr 21, 2007)
99 | Initial release:
100 | Nintendo 64 controller support
101 | Gamecube controller support
102 |
103 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/Makefile:
--------------------------------------------------------------------------------
1 | all:
2 | @echo "Please use Makefile.atmega8 or Makefile.atmega168."
3 | @echo
4 | @echo "Example: make -f Makefile.atmega168"
5 |
6 | clean:
7 | make -f Makefile.atmega168 clean
8 | make -f Makefile.atmega8 clean
9 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/Makefile.atmega168:
--------------------------------------------------------------------------------
1 | CC=avr-gcc
2 | AS=$(CC)
3 | LD=$(CC)
4 | PROGNAME=gc_n64_usb-m168
5 | CPU=atmega168
6 |
7 | CFLAGS=-Wall -Os -Iusbdrv -I. -mmcu=$(CPU) -DF_CPU=12000000L #-DDEBUG_LEVEL=1
8 | LDFLAGS=-Wl,-Map=$(PROGNAME).map -mmcu=$(CPU)
9 | AVRDUDE=avrdude -p m168 -P usb -c avrispmkII
10 |
11 | OBJS=usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o gcn64_protocol.o gamecube.o n64.o devdesc.o reportdesc.o gc_kb.o
12 |
13 | HEXFILE=$(PROGNAME).hex
14 | ELFFILE=$(PROGNAME).elf
15 |
16 | # symbolic targets:
17 | all: $(HEXFILE)
18 |
19 | .c.o:
20 | $(CC) $(CFLAGS) -c $< -o $@
21 |
22 | .S.o:
23 | $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@
24 | # "-x assembler-with-cpp" should not be necessary since this is the default
25 | # file type for the .S (with capital S) extension. However, upper case
26 | # characters are not always preserved on Windows. To ensure WinAVR
27 | # compatibility define the file type manually.
28 |
29 | .c.s:
30 | $(CC) $(CFLAGS) -S $< -o $@
31 |
32 |
33 | clean:
34 | rm -f $(HEXFILE) main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
35 |
36 | # file targets:
37 | $(ELFFILE): $(OBJS)
38 | $(LD) $(LDFLAGS) -o $(ELFFILE) $(OBJS)
39 |
40 | $(HEXFILE): $(ELFFILE)
41 | rm -f $(HEXFILE)
42 | avr-objcopy -j .text -j .data -O ihex $(ELFFILE) $(HEXFILE)
43 | avr-size $(ELFFILE)
44 |
45 |
46 | flash: $(HEXFILE)
47 | $(AVRDUDE) -Uflash:w:$(HEXFILE) -B 1.0
48 |
49 | # Extended fuse byte (Datasheet Table 28-5)
50 | #
51 | # - - - - - BOOTSZ1 BOOTSZ0 BOOTRST
52 | # 0 0 0 0 0 0 0 1
53 | #
54 | EFUSE=0x01
55 |
56 | # Fuse high byte (Datasheet Table 28-6)
57 | #
58 | # RSTDISBL DWEN SPIEN WDTON EESAVE BODLEVEL2 BODLEVEL1 BODLEVEL0
59 | # 1 1 0 1 0 1 0 1
60 | #
61 | HFUSE=0xd5
62 |
63 | # Fuse low byte (Datasheet Table 28-7)
64 | #
65 | # CKDIV8 CKOUT SUT1 SUT0 CKSEL3 CKSEL2 CKSEL1 CKSEL0
66 | # 1 1 0 1 0 1 1 1
67 | #
68 | # Full swing crystal oscillator
69 | # 0.4 - 20 MHz : CKSEL3..1 011
70 | #
71 | # Crystal Oscillator, BOD enabled (Table 9-6)
72 | # CKSEL0 : 1
73 | # SUT1..0 : 01
74 | #
75 | LFUSE=0xD7
76 |
77 | fuse:
78 | $(AVRDUDE) -e -Uefuse:w:$(EFUSE):m -Uhfuse:w:$(HFUSE):m -Ulfuse:w:$(LFUSE):m -B 20.0 -v
79 |
80 | chip_erase:
81 | $(AVRDUDE) -e -B 1.0 -F
82 |
83 | reset:
84 | $(AVRDUDE) -B 1.0 -F
85 |
86 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/Makefile.atmega8:
--------------------------------------------------------------------------------
1 | # Name: Makefile
2 | # Project: HIDKeys
3 | # Author: Christian Starkjohann
4 | # Creation Date: 2006-02-02
5 | # Tabsize: 4
6 | # Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 | # License: Proprietary, free under certain conditions. See Documentation.
8 | # This Revision: $Id: Makefile.atmega8,v 1.2 2013-11-09 15:20:06 cvs Exp $
9 |
10 | AVRDUDE=avrdude -p m8
11 | UISP = uisp -dprog=stk500 -dpart=atmega8 -dserial=/dev/avr
12 | COMPILE = avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8 -DF_CPU=12000000L #-DDEBUG_LEVEL=1
13 | OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o devdesc.o gamecube.o n64.o reportdesc.o gcn64_protocol.o gc_kb.o
14 |
15 | PROGNAME=gc_n64_usb
16 | HEXFILE=$(PROGNAME).hex
17 |
18 | # symbolic targets:
19 | all: $(HEXFILE)
20 |
21 | .c.o:
22 | $(COMPILE) -c $< -o $@
23 |
24 | .S.o:
25 | $(COMPILE) -x assembler-with-cpp -c $< -o $@
26 | # "-x assembler-with-cpp" should not be necessary since this is the default
27 | # file type for the .S (with capital S) extension. However, upper case
28 | # characters are not always preserved on Windows. To ensure WinAVR
29 | # compatibility define the file type manually.
30 |
31 | .c.s:
32 | $(COMPILE) -S $< -o $@
33 |
34 |
35 | clean:
36 | rm -f $(PROGNAME).hex $(PROGNAME).lst $(PROGNAME).obj $(PROGNAME).cof $(PROGNAME).list $(PROGNAME).map $(PROGNAME).eep.hex $(PROGNAME).bin *.o usbdrv/*.o $(PROGNAME).s usbdrv/oddebug.s usbdrv/usbdrv.s
37 |
38 | # file targets:
39 | gc_n64_usb.bin: $(OBJECTS) gamecube.o devdesc.o
40 | $(COMPILE) -o gc_n64_usb.bin $(OBJECTS) -Wl,-Map=gc_n64_usb.map
41 |
42 | gc_n64_usb.hex: $(PROGNAME).bin
43 | rm -f $(PROGNAME).hex $(PROGNAME).eep.hex
44 | avr-objcopy -j .text -j .data -O ihex gc_n64_usb.bin gc_n64_usb.hex
45 | avr-size $(PROGNAME).bin
46 | @echo -n "Report descriptor size:"
47 | @nm -S reportdesc.o | grep gcn64_usbHidReportDescriptor | cut -d ' ' -f 2
48 |
49 | flash_uisp: all
50 | #$(UISP) --erase --upload --verify if=gc_n64_usb.hex
51 | $(UISP) --erase --upload if=gc_n64_usb.hex
52 |
53 | flash: all
54 | $(AVRDUDE) -Uflash:w:$(HEXFILE) -B 1.0
55 |
56 | # Fuse high byte:
57 | # 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
58 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
59 | # | | | | | +-------- BOOTSZ1
60 | # | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
61 | # | | | +-------------- CKOPT (full output swing)
62 | # | | +---------------- SPIEN (allow serial programming)
63 | # | +------------------ WDTON (WDT not always on)
64 | # +-------------------- RSTDISBL (reset pin is enabled)
65 | # Fuse low byte:
66 | # 0x9f = 1 0 0 1 1 1 1 1
67 | # ^ ^ \ / \--+--/
68 | # | | | +------- CKSEL 3..0 (external >8M crystal)
69 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
70 | # | +------------------ BODEN (BrownOut Detector enabled)
71 | # +-------------------- BODLEVEL (2.7V)
72 | fuse:
73 | $(UISP) --wr_fuse_h=0xc9 --wr_fuse_l=0x9f
74 |
75 | fuse_usb:
76 | avrdude -p m8 -P usb -c avrispmkII -Uhfuse:w:0xc9:m -Ulfuse:w:0x9f:m -B 10.0
77 |
78 |
79 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/Readme.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/gc_n64_usb-2.9.1-bitkit/Readme.txt
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/calibration_fixer/readme.txt:
--------------------------------------------------------------------------------
1 | The L and R sliders don't have a central resting position. This
2 | will cause many games to think they are active, which causes
3 | problem when performing button assignments.
4 |
5 | The tool provided here patches the calibration data in a way
6 | that makes the idle position appear central to the computer.
7 | Execute it _after_ completing the normal windows calibration
8 | procdure.
9 |
10 | You need to run the patch again every time you recalibrate
11 | using the windows tool.
12 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/calibration_fixer/src/Makefile:
--------------------------------------------------------------------------------
1 | CC=gcc
2 | CPP=g++
3 | LD=$(CPP)
4 |
5 | DX_INCLUDE_PATH=/c/dx9sdk/Include
6 | DX_LIBS=/c/dx9sdk/Lib/x86/dinput8.lib /c/dx9sdk/Lib/x86/dxguid.lib
7 |
8 | CFLAGS=-Wall -I$(DX_INCLUDE_PATH)
9 | CPPFLAGS=$(CFLAGS)
10 | LDFLAGS=$(DX_LIBS) -static
11 |
12 | gc_calfix_ng: gc_cal_fix.o
13 | $(LD) $^ -o $@ $(LDFLAGS)
14 |
15 | clean:
16 | rm gc_calfix_ng.exe
17 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/calibration_fixer/src/changelog.txt:
--------------------------------------------------------------------------------
1 | - Versino 1.3 (2013-11-24)
2 | * Added support for GCN64-USB v2.9
3 | * Exit after displaying help (-h)
4 |
5 | - Version 1.2 (2013-06-24)
6 | * Added support for GCN64-USB v2.3
7 |
8 |
9 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/calibration_fixer/src/gc_cal_fix.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | #define DIRECTINPUT_VERSION 0x0800
9 |
10 | #include
11 | #include
12 |
13 | LPDIRECTINPUT8 g_pDI = NULL;
14 | LPDIRECTINPUTDEVICE8 g_pJoystick = NULL;
15 |
16 | static int g_num_fixed = 0;
17 | static int g_only_list = 0;
18 | static int g_show_unsigned = 0;
19 |
20 | int fixJoystickCalibration(void)
21 | {
22 | HRESULT hr;
23 | DIPROPCAL cpoints;
24 | DIDEVCAPS devcaps;
25 | int x;
26 | int axes[6] = { DIJOFS_X, DIJOFS_Y,
27 | DIJOFS_RX, DIJOFS_RY,
28 | DIJOFS_RZ, DIJOFS_SLIDER(0) };
29 |
30 | if( FAILED( hr = g_pJoystick->SetDataFormat( &c_dfDIJoystick ) ) )
31 | return -1;
32 |
33 | //g_pJoystick->Acquire();
34 |
35 | devcaps.dwSize = sizeof(devcaps);
36 | hr = g_pJoystick->GetCapabilities(&devcaps);
37 | if (FAILED(hr)) {
38 | //MessageBox(NULL, _com_error(GetLastError()).ErrorMessage(), L"asd", MB_ICONWARNING | MB_OK);
39 | printf("*** ERROR ****\n");
40 | }
41 | else {
42 | printf(" Axes: %lu, Buttons: %lu\n", devcaps.dwAxes, devcaps.dwButtons);
43 | }
44 |
45 | printf(" Min. Center Max.\n");
46 |
47 | cpoints.diph.dwSize = sizeof(cpoints);
48 | cpoints.diph.dwHeaderSize = sizeof(DIPROPHEADER);
49 | cpoints.diph.dwHow = DIPH_BYOFFSET;
50 |
51 | for (x=0; x<6; x++) {
52 | cpoints.diph.dwObj = axes[x];
53 |
54 | hr = g_pJoystick->GetProperty(DIPROP_CALIBRATION, &cpoints.diph);
55 | if (FAILED(hr)) {
56 | continue;
57 | }
58 |
59 | if (g_show_unsigned) {
60 | printf(" %d: %3ld %3ld %3ld", x,
61 | cpoints.lMin, cpoints.lCenter, cpoints.lMax);
62 | } else {
63 | printf(" %d: %3ld %3ld %3ld", x,
64 | cpoints.lMin - 127, cpoints.lCenter - 127, cpoints.lMax - 127);
65 | }
66 |
67 | if (!g_only_list) {
68 | if (x==4 || x==5) {
69 | cpoints.lCenter = cpoints.lMax;
70 | cpoints.lMax = 0xff;
71 |
72 | g_pJoystick->SetProperty(DIPROP_CALIBRATION, &cpoints.diph);
73 | printf(" (Modified)");
74 | }
75 | }
76 | printf("\n");
77 | }
78 |
79 | g_num_fixed++;
80 |
81 | return 0;
82 | }
83 |
84 |
85 | BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE*
86 | pdidInstance, VOID* pContext)
87 | {
88 | HRESULT hr;
89 | DIPROPDWORD vidpid;
90 | WORD vid, pid;
91 |
92 | // Obtain an interface to the enumerated joystick.
93 | hr = g_pDI->CreateDevice(pdidInstance->guidInstance,
94 | &g_pJoystick, NULL);
95 | if(FAILED(hr))
96 | return DIENUM_CONTINUE;
97 |
98 | /* Test */
99 | vidpid.diph.dwSize = sizeof(vidpid);
100 | vidpid.diph.dwHeaderSize = sizeof(DIPROPHEADER);
101 | vidpid.diph.dwHow = DIPH_DEVICE;
102 | vidpid.diph.dwObj = 0;
103 | hr = g_pJoystick->GetProperty(DIPROP_VIDPID, &vidpid.diph);
104 | if (FAILED(hr)) {
105 | return DIENUM_CONTINUE;
106 | }
107 |
108 | vid = vidpid.dwData & 0xffff;
109 | pid = vidpid.dwData >> 16;
110 |
111 |
112 |
113 | if (vid==0x1781 && pid==0x0a9a) {
114 | printf("Found Device ID : VID=%04x PID=%04x (ADAP-GCN64 v1.x)\n", vid, pid);
115 | fixJoystickCalibration(); // uses global
116 | }
117 | else if (vid==0x1740 && pid==0x057f) {
118 | printf("Found Device ID : VID=%04x PID=%04x (ADAP-GCN64 v2.1)\n", vid, pid);
119 | fixJoystickCalibration(); // uses global
120 | }
121 | else if (vid==0x289b && pid==0x0001) {
122 | printf("Found Device ID : VID=%04x PID=%04x (ADAP-GCN64 v2.2)\n", vid, pid);
123 | fixJoystickCalibration(); // uses global
124 | }
125 | else if (vid==0x289b && pid==0x0004) {
126 | printf("Found Device ID : VID=%04x PID=%04x (ADAP-GCN64 v2.3)\n", vid, pid);
127 | fixJoystickCalibration(); // uses global
128 | }
129 | else if (vid==0x289b && pid==0x000c) {
130 | printf("Found Device ID : VID=%04x PID=%04x (ADAP-GCN64 v2.9)\n", vid, pid);
131 | fixJoystickCalibration(); // uses global
132 | }
133 | else {
134 | printf("Ignoring Device ID : VID=%04x PID=%04x\n", vid, pid);
135 |
136 | }
137 |
138 | return DIENUM_CONTINUE;
139 | }
140 |
141 | int main(int argc, char * argv[])
142 | {
143 | HRESULT res;
144 | int opt;
145 | int run_calibration = 0;
146 |
147 | printf("raphnet.net Gamecube adapter L/R buttons calibration fixer v1.3\n");
148 | printf("Copyright (C) 2009-2013, Raphael Assenat\n\n");
149 |
150 | while(-1 != (opt = getopt(argc, argv, "hlcu"))) {
151 | switch (opt)
152 | {
153 | case 'h':
154 | printf("Usage: ./gc_calfix_ng \n\n");
155 | printf("By default, this tool adjusts the calibration data for all supported joysticks.\n");
156 | printf("The following options can be used to perform other tasks.\n\n");
157 | printf("Options:\n");
158 | printf(" -h Show help\n");
159 | printf(" -l Only list and display supported joystick calibration settings\n");
160 | printf(" -c Open the windows calibration dialog before exiting\n");
161 | printf(" -u Show unsigned calibration values.\n");
162 | return 0;
163 |
164 | case 'u':
165 | g_show_unsigned = 1;
166 | break;
167 |
168 | case 'l':
169 | g_only_list = 1;
170 | break;
171 |
172 | case 'c':
173 | run_calibration = 1;
174 | break;
175 |
176 | default:
177 | fprintf(stderr, "Unknown option passed. See -h\n");
178 | break;
179 | }
180 | }
181 |
182 |
183 | res = DirectInput8Create(GetModuleHandle( NULL ), DIRECTINPUT_VERSION, IID_IDirectInput8,
184 | (VOID **)&g_pDI, NULL);
185 |
186 | if (FAILED(res)) {
187 | printf("DirectInput8Create failed\n");
188 | return -1;
189 | }
190 |
191 | g_pDI->EnumDevices(DI8DEVCLASS_GAMECTRL, EnumJoysticksCallback,
192 | NULL, DIEDFL_ATTACHEDONLY);
193 |
194 | if (!g_num_fixed) {
195 | printf("No supported joysticks found.");
196 | }
197 | else {
198 | printf("Found %d supported joystick(s).\n", g_num_fixed);\
199 | if (run_calibration) {
200 | g_pJoystick->RunControlPanel(0,0);
201 | }
202 | }
203 |
204 | printf("\n -- Press ENTER to exit --\n");
205 |
206 | getchar();
207 |
208 | return 0;
209 | }
210 |
211 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/calibration_fixer/src/gc_calfix_ng.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/gc_n64_usb-2.9.1-bitkit/calibration_fixer/src/gc_calfix_ng.exe
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/devdesc.c:
--------------------------------------------------------------------------------
1 | #include "devdesc.h"
2 | #include "usbconfig.h"
3 |
4 | #define USBDESCR_DEVICE 1
5 |
6 | const char usbDescrDevice[] PROGMEM = { /* USB device descriptor */
7 | 18, /* sizeof(usbDescrDevice): length of descriptor in bytes */
8 | USBDESCR_DEVICE, /* descriptor type */
9 | 0x01, 0x01, /* USB version supported */
10 | USB_CFG_DEVICE_CLASS,
11 | USB_CFG_DEVICE_SUBCLASS,
12 | 0, /* protocol */
13 | 8, /* max packet size */
14 | USB_CFG_VENDOR_ID, /* 2 bytes */
15 | USB_CFG_DEVICE_ID, /* 2 bytes */
16 | USB_CFG_DEVICE_VERSION, /* 2 bytes */
17 | 1, /* manufacturer string index */
18 | 2, /* product string index */
19 | 3, /* serial number string index */
20 | 1, /* number of configurations */
21 | };
22 |
23 | int getUsbDescrDevice_size(void) { return sizeof(usbDescrDevice); }
24 |
25 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/devdesc.h:
--------------------------------------------------------------------------------
1 | #ifndef _devdesc_h__
2 | #define _devdesc_h__
3 |
4 | #include
5 |
6 | extern const char usbDescrDevice[] PROGMEM;
7 | int getUsbDescrDevice_size(void);
8 |
9 | #endif // _devdesc_h__
10 |
11 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/gamecube.c:
--------------------------------------------------------------------------------
1 | /* gc_n64_usb : Gamecube or N64 controller to USB firmware
2 | Copyright (C) 2007-2013 Raphael Assenat
3 |
4 | This program is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | This program is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with this program. If not, see .
16 | */
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include "gamepad.h"
22 | #include "leds.h"
23 | #include "gamecube.h"
24 | #include "reportdesc.h"
25 | #include "gcn64_protocol.h"
26 |
27 | /*********** prototypes *************/
28 | static void gamecubeInit(void);
29 | static char gamecubeUpdate(void);
30 | static char gamecubeChanged(int rid);
31 |
32 |
33 | /* What was most recently read from the controller */
34 | static unsigned char last_built_report[GCN64_REPORT_SIZE];
35 |
36 | /* What was most recently sent to the host */
37 | static unsigned char last_sent_report[GCN64_REPORT_SIZE];
38 |
39 | static int gc_rumbling = 0;
40 | static int gc_analog_lr_disable = 0;
41 |
42 | static void gamecubeInit(void)
43 | {
44 | if (0 == gamecubeUpdate()) {
45 | unsigned char btns2;
46 |
47 | btns2 = gcn64_protocol_getByte(8);
48 |
49 | //if (gcn64_workbuf[GC_BTN_L] && gcn64_workbuf[GC_BTN_R]) {
50 | if ((btns2 & 0x06) == 0x06) { // L + R
51 | gc_analog_lr_disable = 1;
52 | } else {
53 | gc_analog_lr_disable = 0;
54 | }
55 | }
56 | }
57 |
58 | static char gamecubeUpdate(void)
59 | {
60 | int i;
61 | unsigned char tmp=0;
62 | unsigned char tmpdata[8];
63 | unsigned char count;
64 | unsigned char x,y,cx,cy,rtrig,ltrig,btns1,btns2,rb1,rb2;
65 |
66 | /* Get ID command.
67 | *
68 | * If we don't do that, the wavebird does not work.
69 | */
70 | tmp = GC_GETID;
71 | count = gcn64_transaction(&tmp, 1);
72 | if (count != GC_GETID_REPLY_LENGTH) {
73 | return 1;
74 | }
75 |
76 | tmpdata[0] = GC_GETSTATUS1;
77 | tmpdata[1] = GC_GETSTATUS2;
78 | tmpdata[2] = GC_GETSTATUS3(gc_rumbling);
79 |
80 | count = gcn64_transaction(tmpdata, 3);
81 | if (count != GC_GETSTATUS_REPLY_LENGTH) {
82 | return 1; // failure
83 | }
84 |
85 | /*
86 | (Source: Nintendo Gamecube Controller Protocol
87 | updated 8th March 2004, by James.)
88 |
89 | Bit Function
90 | 0-2 Always 0
91 | 3 Start
92 | 4 Y
93 | 5 X
94 | 6 B
95 | 7 A
96 | 8 Always 1
97 | 9 L
98 | 10 R
99 | 11 Z
100 | 12-15 Up,Down,Right,Left
101 | 16-23 Joy X
102 | 24-31 Joy Y
103 | 32-39 C Joystick X
104 | 40-47 C Joystick Y
105 | 48-55 Left Btn Val
106 | 56-63 Right Btn Val
107 | */
108 |
109 | btns1 = gcn64_protocol_getByte(0);
110 | btns2 = gcn64_protocol_getByte(8);
111 | x = gcn64_protocol_getByte(16);
112 | y = gcn64_protocol_getByte(24);
113 | cx = gcn64_protocol_getByte(32);
114 | cy = gcn64_protocol_getByte(40);
115 | ltrig = gcn64_protocol_getByte(48);
116 | rtrig = gcn64_protocol_getByte(56);
117 |
118 | /* Prepare button bits */
119 | rb1 = rb2 = 0;
120 | for (i=0; i<5; i++) // St Y X B A
121 | rb1 |= (btns1 & (0x10 >> i)) ? (0x01<> i)) ? (0x20<> i)) ? (0x01<
119 | #define GC_KEY_SLASH_QUESTION 0x3E // /?
120 |
121 | // (The extra key before right-shift on japanese keyboards.
122 | // HID code International 1 [HID usage tables Footnote 15-20]).
123 | #define GC_KEY_INTERNATIONAL1 0x3F
124 | #define GC_KEY_F1 0x40
125 | #define GC_KEY_F2 0x41
126 | #define GC_KEY_F3 0x42
127 | #define GC_KEY_F4 0x43
128 | #define GC_KEY_F5 0x44
129 | #define GC_KEY_F6 0x45
130 | #define GC_KEY_F7 0x46
131 | #define GC_KEY_F8 0x47
132 | #define GC_KEY_F9 0x48
133 | #define GC_KEY_F10 0x49
134 | #define GC_KEY_F11 0x4A
135 | #define GC_KEY_F12 0x4B
136 | #define GC_KEY_ESC 0x4C
137 | #define GC_KEY_INSERT 0x4D
138 | #define GC_KEY_DELETE 0x4E
139 |
140 | // (Hankaku/zenkaku/kanji button). Also known as `~
141 | #define GC_KEY_HANKAKU 0x4F
142 | #define GC_KEY_BACKSPACE 0x50
143 | #define GC_KEY_TAB 0x51
144 |
145 | #define GC_KEY_CAPS_LOCK 0x53
146 | #define GC_KEY_LEFT_SHIFT 0x54
147 | #define GC_KEY_RIGHT_SHIFT 0x55
148 | #define GC_KEY_LEFT_CTRL 0x56
149 | #define GC_KEY_LEFT_ALT 0x57
150 | #define GC_KEY_MUHENKAN 0x58 // HID international 5
151 | #define GC_KEY_SPACE 0x59
152 | #define GC_KEY_HENKAN 0x5A // HID international 4
153 | #define GC_KEY_KANA 0x5B // HID international 2
154 | #define GC_KEY_LEFT 0x5C
155 | #define GC_KEY_DOWN 0x5D
156 | #define GC_KEY_UP 0x5E
157 | #define GC_KEY_RIGHT 0x5F
158 |
159 | #define GC_KEY_ENTER 0x61
160 |
161 | void gcn64protocol_hwinit(void);
162 | int gcn64_detectController(void);
163 | int gcn64_transaction(unsigned char *data_out, int data_out_len);
164 |
165 | unsigned char gcn64_protocol_getByte(int offset);
166 | void gcn64_protocol_getBytes(int offset, int n_bytes, unsigned char *dstbuf);
167 |
168 | #endif // _gcn64_protocol_h__
169 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/hid_keycodes.h:
--------------------------------------------------------------------------------
1 | #ifndef _hid_keycodes_h__
2 | #define _hid_keycodes_h__
3 |
4 | /* From Hut1_12.pdf : Universal Serial Bus HID Usage Tables,
5 | * section 10 Keyboard/Keypad Page (0x07) */
6 |
7 | #define HID_KB_NOEVENT 0x00
8 |
9 | #define HID_KB_A 0x04
10 | #define HID_KB_B 0x05
11 | #define HID_KB_C 0x06
12 | #define HID_KB_D 0x07
13 | #define HID_KB_E 0x08
14 | #define HID_KB_F 0x09
15 | #define HID_KB_G 0x0a
16 | #define HID_KB_H 0x0b
17 | #define HID_KB_I 0x0c
18 | #define HID_KB_J 0x0d
19 | #define HID_KB_K 0x0e
20 | #define HID_KB_L 0x0f
21 | #define HID_KB_M 0x10
22 | #define HID_KB_N 0x11
23 | #define HID_KB_O 0x12
24 | #define HID_KB_P 0x13
25 | #define HID_KB_Q 0x14
26 | #define HID_KB_R 0x15
27 | #define HID_KB_S 0x16
28 | #define HID_KB_T 0x17
29 | #define HID_KB_U 0x18
30 | #define HID_KB_V 0x19
31 | #define HID_KB_W 0x1a
32 | #define HID_KB_X 0x1b
33 | #define HID_KB_Y 0x1c
34 | #define HID_KB_Z 0x1d
35 |
36 | #define HID_KB_1 0x1e
37 | #define HID_KB_2 0x1f
38 | #define HID_KB_3 0x20
39 | #define HID_KB_4 0x21
40 | #define HID_KB_5 0x22
41 | #define HID_KB_6 0x23
42 | #define HID_KB_7 0x24
43 | #define HID_KB_8 0x25
44 | #define HID_KB_9 0x26
45 | #define HID_KB_0 0x27
46 |
47 | #define HID_KB_ESCAPE 0x29
48 | #define HID_KB_BACKSPACE 0x2a
49 | #define HID_KB_TAB 0x2b
50 |
51 | #define HID_KB_SPACE 0x2c
52 | #define HID_KB_DASH_UNDERSCORE 0x2d
53 | #define HID_KB_EQUAL_PLUS 0x2e
54 | #define HID_KB_OPEN_BRKT_BRACE 0x2f
55 |
56 | #define HID_KB_CLOSE_BRKT_BRACE 0x30
57 | #define HID_KB_NONUS_HASH_TILDE 0x32
58 | #define HID_KB_SEMI_COLON_COLON 0x33
59 | #define HID_KB_QUOTES 0x34
60 | #define HID_KB_GRAVE_ACCENT_AND_TILDE 0x35
61 | #define HID_KB_COMMA_SMALLER_THAN 0x36
62 | #define HID_KB_PERIOD_GREATER_THAN 0x37
63 | #define HID_KB_SLASH_QUESTION 0x38
64 | #define HID_KB_CAPS_LOCK 0x39
65 |
66 | #define HID_KB_F1 0x3a
67 | #define HID_KB_F2 0x3b
68 | #define HID_KB_F3 0x3c
69 | #define HID_KB_F4 0x3d
70 | #define HID_KB_F5 0x3e
71 | #define HID_KB_F6 0x3f
72 | #define HID_KB_F7 0x40
73 | #define HID_KB_F8 0x41
74 | #define HID_KB_F9 0x42
75 | #define HID_KB_F10 0x43
76 | #define HID_KB_F11 0x44
77 | #define HID_KB_F12 0x45
78 |
79 | #define HID_KB_SCROLL_LOCK 0x47
80 | #define HID_KB_INSERT 0x49
81 | #define HID_KB_HOME 0x4a
82 | #define HID_KB_PGUP 0x4b
83 | #define HID_KB_DELETE_FORWARD 0x4c
84 | #define HID_KB_END 0x4d
85 | #define HID_KB_PGDN 0x4e
86 |
87 | #define HID_KB_RIGHT_ARROW 0x4f
88 | #define HID_KB_LEFT_ARROW 0x50
89 | #define HID_KB_DOWN_ARROW 0x51
90 | #define HID_KB_UP_ARROW 0x52
91 |
92 | #define HID_KB_ENTER 0x58
93 |
94 | #define HID_KB_INTERNATIONAL1 0x87
95 | #define HID_KB_INTERNATIONAL2 0x88
96 | #define HID_KB_INTERNATIONAL3 0x89
97 | #define HID_KB_INTERNATIONAL4 0x8a
98 | #define HID_KB_INTERNATIONAL5 0x8b
99 |
100 | #define HID_KB_LEFT_CONTROL 0xe0
101 | #define HID_KB_LEFT_SHIFT 0xe1
102 | #define HID_KB_LEFT_ALT 0xe2
103 | #define HID_KB_LEFT_GUI 0xe3
104 | #define HID_KB_RIGHT_CONTROL 0xe4
105 | #define HID_KB_RIGHT_SHIFT 0xe5
106 | #define HID_KB_RIGHT_ALT 0xe6
107 | #define HID_KB_RIGHT_GUI 0xe7
108 |
109 | #endif // _hid_keycodes_h__
110 |
111 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/leds.h:
--------------------------------------------------------------------------------
1 | #ifndef _leds_h__
2 | #define _leds_h__
3 |
4 | #ifndef PORTD
5 | #include
6 | #endif
7 |
8 |
9 | #define LED_OFF()
10 | #define LED_ON();
11 | #define LED_TOGGLE();
12 |
13 | //#define LED_OFF() do { PORTD |= 0x20; } while(0)
14 | //#define LED_ON() do { PORTD &= ~0x20; } while(0)
15 | //#define LED_TOGGLE() do { PORTD ^= 0x20; } while(0)
16 |
17 | #endif
18 |
19 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/n64.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *n64GetGamepad(void);
4 |
5 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/reportdesc.h:
--------------------------------------------------------------------------------
1 | #ifndef _reportdesc_h__
2 | #define _reportdesc_h__
3 |
4 | #include
5 |
6 | #define GCN64_REPORT_SIZE 9
7 |
8 | extern const char gcn64_usbHidReportDescriptor[] PROGMEM;
9 | int getUsbHidReportDescriptor_size(void);
10 |
11 | #endif // _reportdesc_h__
12 |
13 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/schematics/readme.txt:
--------------------------------------------------------------------------------
1 | For the latest schematics, please visit:
2 | http://www.raphnet.net/electronique/gc_n64_usb/index_en.php
3 |
4 |
5 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/usbdrv/CommercialLicense.txt:
--------------------------------------------------------------------------------
1 | V-USB Driver Software License Agreement
2 | Version 2012-07-09
3 |
4 | THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN
5 | ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING
6 | THE AMOUNT ACCORDING TO SECTION 4 ("PAYMENT") TO OBJECTIVE DEVELOPMENT.
7 |
8 |
9 | 1 DEFINITIONS
10 |
11 | 1.1 "OBJECTIVE DEVELOPMENT" shall mean OBJECTIVE DEVELOPMENT Software GmbH,
12 | Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA.
13 |
14 | 1.2 "You" shall mean the Licensee.
15 |
16 | 1.3 "V-USB" shall mean all files included in the package distributed under
17 | the name "vusb" by OBJECTIVE DEVELOPMENT (http://www.obdev.at/vusb/)
18 | unless otherwise noted. This includes the firmware-only USB device
19 | implementation for Atmel AVR microcontrollers, some simple device examples
20 | and host side software examples and libraries.
21 |
22 |
23 | 2 LICENSE GRANTS
24 |
25 | 2.1 Source Code. OBJECTIVE DEVELOPMENT shall furnish you with the source
26 | code of V-USB.
27 |
28 | 2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the
29 | non-exclusive right to use, copy and distribute V-USB with your hardware
30 | product(s), restricted by the limitations in section 3 below.
31 |
32 | 2.3 Modifications. OBJECTIVE DEVELOPMENT grants you the right to modify
33 | the source code and your copy of V-USB according to your needs.
34 |
35 | 2.4 USB IDs. OBJECTIVE DEVELOPMENT furnishes you with one or two USB
36 | Product ID(s), sent to you in e-mail. These Product IDs are reserved
37 | exclusively for you. OBJECTIVE DEVELOPMENT has obtained USB Product ID
38 | ranges under the Vendor ID 5824 from Wouter van Ooijen (Van Ooijen
39 | Technische Informatica, www.voti.nl) and under the Vendor ID 8352 from
40 | Jason Kotzin (now flirc.tv, Inc.). Both owners of the Vendor IDs have
41 | obtained these IDs from the USB Implementers Forum, Inc. (www.usb.org).
42 | OBJECTIVE DEVELOPMENT disclaims all liability which might arise from the
43 | assignment of USB IDs.
44 |
45 | 2.5 USB Certification. Although not part of this agreement, we want to make
46 | it clear that you cannot become USB certified when you use V-USB or a USB
47 | Product ID assigned by OBJECTIVE DEVELOPMENT. AVR microcontrollers don't
48 | meet the electrical specifications required by the USB specification and
49 | the USB Implementers Forum certifies only members who bought a Vendor ID of
50 | their own.
51 |
52 |
53 | 3 LICENSE RESTRICTIONS
54 |
55 | 3.1 Number of Units. Only one of the following three definitions is
56 | applicable. Which one is determined by the amount you pay to OBJECTIVE
57 | DEVELOPMENT, see section 4 ("Payment") below.
58 |
59 | Hobby License: You may use V-USB according to section 2 above in no more
60 | than 5 hardware units. These units must not be sold for profit.
61 |
62 | Entry Level License: You may use V-USB according to section 2 above in no
63 | more than 150 hardware units.
64 |
65 | Professional License: You may use V-USB according to section 2 above in
66 | any number of hardware units, except for large scale production ("unlimited
67 | fair use"). Quantities below 10,000 units are not considered large scale
68 | production. If your reach quantities which are obviously large scale
69 | production, you must pay a license fee of 0.10 EUR per unit for all units
70 | above 10,000.
71 |
72 | 3.2 Rental. You may not rent, lease, or lend V-USB or otherwise encumber
73 | any copy of V-USB, or any of the rights granted herein.
74 |
75 | 3.3 Transfer. You may not transfer your rights under this Agreement to
76 | another party without OBJECTIVE DEVELOPMENT's prior written consent. If
77 | such consent is obtained, you may permanently transfer this License to
78 | another party. The recipient of such transfer must agree to all terms and
79 | conditions of this Agreement.
80 |
81 | 3.4 Reservation of Rights. OBJECTIVE DEVELOPMENT retains all rights not
82 | expressly granted.
83 |
84 | 3.5 Non-Exclusive Rights. Your license rights under this Agreement are
85 | non-exclusive.
86 |
87 | 3.6 Third Party Rights. This Agreement cannot grant you rights controlled
88 | by third parties. In particular, you are not allowed to use the USB logo or
89 | other trademarks owned by the USB Implementers Forum, Inc. without their
90 | consent. Since such consent depends on USB certification, it should be
91 | noted that V-USB will not pass certification because it does not
92 | implement checksum verification and the microcontroller ports do not meet
93 | the electrical specifications.
94 |
95 |
96 | 4 PAYMENT
97 |
98 | The payment amount depends on the variation of this agreement (according to
99 | section 3.1) into which you want to enter. Concrete prices are listed on
100 | OBJECTIVE DEVELOPMENT's web site, usually at
101 | http://www.obdev.at/vusb/license.html. You agree to pay the amount listed
102 | there to OBJECTIVE DEVELOPMENT or OBJECTIVE DEVELOPMENT's payment processor
103 | or reseller.
104 |
105 |
106 | 5 COPYRIGHT AND OWNERSHIP
107 |
108 | V-USB is protected by copyright laws and international copyright
109 | treaties, as well as other intellectual property laws and treaties. V-USB
110 | is licensed, not sold.
111 |
112 |
113 | 6 TERM AND TERMINATION
114 |
115 | 6.1 Term. This Agreement shall continue indefinitely. However, OBJECTIVE
116 | DEVELOPMENT may terminate this Agreement and revoke the granted license and
117 | USB-IDs if you fail to comply with any of its terms and conditions.
118 |
119 | 6.2 Survival of Terms. All provisions regarding secrecy, confidentiality
120 | and limitation of liability shall survive termination of this agreement.
121 |
122 |
123 | 7 DISCLAIMER OF WARRANTY AND LIABILITY
124 |
125 | LIMITED WARRANTY. V-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
126 | KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, OBJECTIVE
127 | DEVELOPMENT AND ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES, EITHER
128 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
129 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
130 | NON-INFRINGEMENT, WITH REGARD TO V-USB, AND THE PROVISION OF OR FAILURE
131 | TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL
132 | RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO
133 | STATE/JURISDICTION.
134 |
135 | LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
136 | IN NO EVENT SHALL OBJECTIVE DEVELOPMENT OR ITS SUPPLIERS BE LIABLE FOR ANY
137 | SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
138 | (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
139 | BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY
140 | LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE V-USB OR THE
141 | PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIVE
142 | DEVELOPMENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY
143 | CASE, OBJECTIVE DEVELOPMENT'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS
144 | AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR V-USB.
145 |
146 |
147 | 8 MISCELLANEOUS TERMS
148 |
149 | 8.1 Marketing. OBJECTIVE DEVELOPMENT has the right to mention for marketing
150 | purposes that you entered into this agreement.
151 |
152 | 8.2 Entire Agreement. This document represents the entire agreement between
153 | OBJECTIVE DEVELOPMENT and you. It may only be modified in writing signed by
154 | an authorized representative of both, OBJECTIVE DEVELOPMENT and you.
155 |
156 | 8.3 Severability. In case a provision of these terms and conditions should
157 | be or become partly or entirely invalid, ineffective, or not executable,
158 | the validity of all other provisions shall not be affected.
159 |
160 | 8.4 Applicable Law. This agreement is governed by the laws of the Republic
161 | of Austria.
162 |
163 | 8.5 Responsible Courts. The responsible courts in Vienna/Austria will have
164 | exclusive jurisdiction regarding all disputes in connection with this
165 | agreement.
166 |
167 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/usbdrv/USB-ID-FAQ.txt:
--------------------------------------------------------------------------------
1 | Version 2012-07-09
2 |
3 | ==========================
4 | WHY DO WE NEED THESE IDs?
5 | ==========================
6 |
7 | USB is more than a low level protocol for data transport. It also defines a
8 | common set of requests which must be understood by all devices. And as part
9 | of these common requests, the specification defines data structures, the
10 | USB Descriptors, which are used to describe the properties of the device.
11 |
12 | From the perspective of an operating system, it is therefore possible to find
13 | out basic properties of a device (such as e.g. the manufacturer and the name
14 | of the device) without a device-specific driver. This is essential because
15 | the operating system can choose a driver to load based on this information
16 | (Plug-And-Play).
17 |
18 | Among the most important properties in the Device Descriptor are the USB
19 | Vendor- and Product-ID. Both are 16 bit integers. The most simple form of
20 | driver matching is based on these IDs. The driver announces the Vendor- and
21 | Product-IDs of the devices it can handle and the operating system loads the
22 | appropriate driver when the device is connected.
23 |
24 | It is obvious that this technique only works if the pair Vendor- plus
25 | Product-ID is unique: Only devices which require the same driver can have the
26 | same pair of IDs.
27 |
28 |
29 | =====================================================
30 | HOW DOES THE USB STANDARD ENSURE THAT IDs ARE UNIQUE?
31 | =====================================================
32 |
33 | Since it is so important that USB IDs are unique, the USB Implementers Forum,
34 | Inc. (usb.org) needs a way to enforce this legally. It is not forbidden by
35 | law to build a device and assign it any random numbers as IDs. Usb.org
36 | therefore needs an agreement to regulate the use of USB IDs. The agreement
37 | binds only parties who agreed to it, of course. Everybody else is free to use
38 | any numbers for their IDs.
39 |
40 | So how can usb.org ensure that every manufacturer of USB devices enters into
41 | an agreement with them? They do it via trademark licensing. Usb.org has
42 | registered the trademark "USB", all associated logos and related terms. If
43 | you want to put an USB logo on your product or claim that it is USB
44 | compliant, you must license these trademarks from usb.org. And this is where
45 | you enter into an agreement. See the "USB-IF Trademark License Agreement and
46 | Usage Guidelines for the USB-IF Logo" at
47 | http://www.usb.org/developers/logo_license/.
48 |
49 | Licensing the USB trademarks requires that you buy a USB Vendor-ID from
50 | usb.org (one-time fee of ca. 2,000 USD), that you become a member of usb.org
51 | (yearly fee of ca. 4,000 USD) and that you meet all the technical
52 | specifications from the USB spec.
53 |
54 | This means that most hobbyists and small companies will never be able to
55 | become USB compliant, just because membership is so expensive. And you can't
56 | be compliant with a driver based on V-USB anyway, because the AVR's port pins
57 | don't meet the electrical specifications for USB. So, in principle, all
58 | hobbyists and small companies are free to choose any random numbers for their
59 | IDs. They have nothing to lose...
60 |
61 | There is one exception worth noting, though: If you use a sub-component which
62 | implements USB, the vendor of the sub-components may guarantee USB
63 | compliance. This might apply to some or all of FTDI's solutions.
64 |
65 |
66 | =======================================================================
67 | WHY SHOULD YOU OBTAIN USB IDs EVEN IF YOU DON'T LICENSE USB TRADEMARKS?
68 | =======================================================================
69 |
70 | You have learned in the previous section that you are free to choose any
71 | numbers for your IDs anyway. So why not do exactly this? There is still the
72 | technical issue. If you choose IDs which are already in use by somebody else,
73 | operating systems will load the wrong drivers and your device won't work.
74 | Even if you choose IDs which are not currently in use, they may be in use in
75 | the next version of the operating system or even after an automatic update.
76 |
77 | So what you need is a pair of Vendor- and Product-IDs for which you have the
78 | guarantee that no USB compliant product uses them. This implies that no
79 | operating system will ever ship with drivers responsible for these IDs.
80 |
81 |
82 | ==============================================
83 | HOW DOES OBJECTIVE DEVELOPMENT HANDLE USB IDs?
84 | ==============================================
85 |
86 | Objective Development gives away pairs of USB-IDs with their V-USB licenses.
87 | In order to ensure that these IDs are unique, Objective Development has an
88 | agreement with the company/person who has bought the USB Vendor-ID from
89 | usb.org. This agreement ensures that a range of USB Product-IDs is reserved
90 | for assignment by Objective Development and that the owner of the Vendor-ID
91 | won't give it to anybody else.
92 |
93 | This means that you have to trust three parties to ensure uniqueness of
94 | your IDs:
95 |
96 | - Objective Development, that they don't give the same PID to more than
97 | one person.
98 | - The owner of the Vendor-ID that they don't assign PIDs from the range
99 | assigned to Objective Development to anybody else.
100 | - Usb.org that they don't assign the same Vendor-ID a second time.
101 |
102 |
103 | ==================================
104 | WHO IS THE OWNER OF THE VENDOR-ID?
105 | ==================================
106 |
107 | Objective Development has obtained ranges of USB Product-IDs under two
108 | Vendor-IDs: Under Vendor-ID 5824 from Wouter van Ooijen (Van Ooijen
109 | Technische Informatica, www.voti.nl) and under Vendor-ID 8352 from Jason
110 | Kotzin (now flirc.tv, Inc.). Both VID owners have received their Vendor-ID
111 | directly from usb.org.
112 |
113 |
114 | =========================================================================
115 | CAN I USE USB-IDs FROM OBJECTIVE DEVELOPMENT WITH OTHER DRIVERS/HARDWARE?
116 | =========================================================================
117 |
118 | The short answer is: Yes. All you get is a guarantee that the IDs are never
119 | assigned to anybody else. What more do you need?
120 |
121 |
122 | ============================
123 | WHAT ABOUT SHARED ID PAIRS?
124 | ============================
125 |
126 | Objective Development has reserved some PID/VID pairs for shared use. You
127 | have no guarantee of uniqueness for them, except that no USB compliant device
128 | uses them. In order to avoid technical problems, we must ensure that all
129 | devices with the same pair of IDs use the same driver on kernel level. For
130 | details, see the file USB-IDs-for-free.txt.
131 |
132 |
133 | ======================================================
134 | I HAVE HEARD THAT SUB-LICENSING OF USB-IDs IS ILLEGAL?
135 | ======================================================
136 |
137 | A 16 bit integer number cannot be protected by copyright laws. It is not
138 | sufficiently complex. And since none of the parties involved entered into the
139 | USB-IF Trademark License Agreement, we are not bound by this agreement. So
140 | there is no reason why it should be illegal to sub-license USB-IDs.
141 |
142 |
143 | =============================================
144 | WHO IS LIABLE IF THERE ARE INCOMPATIBILITIES?
145 | =============================================
146 |
147 | Objective Development disclaims all liabilities which might arise from the
148 | assignment of IDs. If you guarantee product features to your customers
149 | without proper disclaimer, YOU are liable for that.
150 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/usbdrv/USB-IDs-for-free.txt:
--------------------------------------------------------------------------------
1 | Version 2009-08-22
2 |
3 | ===========================
4 | FREE USB-IDs FOR SHARED USE
5 | ===========================
6 |
7 | Objective Development has reserved a set of USB Product-IDs for use according
8 | to the guidelines outlined below. For more information about the concept of
9 | USB IDs please see the file USB-ID-FAQ.txt. Objective Development guarantees
10 | that the IDs listed below are not used by any USB compliant devices.
11 |
12 |
13 | ====================
14 | MECHANISM OF SHARING
15 | ====================
16 |
17 | From a technical point of view, two different devices can share the same USB
18 | Vendor- and Product-ID if they require the same driver on operating system
19 | level. We make use of this fact by assigning separate IDs for various device
20 | classes. On application layer, devices must be distinguished by their textual
21 | name or serial number. We offer separate sets of IDs for discrimination by
22 | textual name and for serial number.
23 |
24 | Examples for shared use of USB IDs are included with V-USB in the "examples"
25 | subdirectory.
26 |
27 |
28 | ======================================
29 | IDs FOR DISCRIMINATION BY TEXTUAL NAME
30 | ======================================
31 |
32 | If you use one of the IDs listed below, your device and host-side software
33 | must conform to these rules:
34 |
35 | (1) The USB device MUST provide a textual representation of the manufacturer
36 | and product identification. The manufacturer identification MUST be available
37 | at least in USB language 0x0409 (English/US).
38 |
39 | (2) The textual manufacturer identification MUST contain either an Internet
40 | domain name (e.g. "mycompany.com") registered and owned by you, or an e-mail
41 | address under your control (e.g. "myname@gmx.net"). You can embed the domain
42 | name or e-mail address in any string you like, e.g. "Objective Development
43 | http://www.obdev.at/vusb/".
44 |
45 | (3) You are responsible for retaining ownership of the domain or e-mail
46 | address for as long as any of your products are in use.
47 |
48 | (4) You may choose any string for the textual product identification, as long
49 | as this string is unique within the scope of your textual manufacturer
50 | identification.
51 |
52 | (5) Application side device look-up MUST be based on the textual manufacturer
53 | and product identification in addition to VID/PID matching. The driver
54 | matching MUST be a comparison of the entire strings, NOT a sub-string match.
55 |
56 | (6) For devices which implement a particular USB device class (e.g. HID), the
57 | operating system's default class driver MUST be used. If an operating system
58 | driver for Vendor Class devices is needed, this driver must be libusb or
59 | libusb-win32 (see http://libusb.org/ and
60 | http://libusb-win32.sourceforge.net/).
61 |
62 | Table if IDs for discrimination by textual name:
63 |
64 | PID dec (hex) | VID dec (hex) | Description of use
65 | ==============+===============+============================================
66 | 1500 (0x05dc) | 5824 (0x16c0) | For Vendor Class devices with libusb
67 | --------------+---------------+--------------------------------------------
68 | 1503 (0x05df) | 5824 (0x16c0) | For generic HID class devices (which are
69 | | | NOT mice, keyboards or joysticks)
70 | --------------+---------------+--------------------------------------------
71 | 1505 (0x05e1) | 5824 (0x16c0) | For CDC-ACM class devices (modems)
72 | --------------+---------------+--------------------------------------------
73 | 1508 (0x05e4) | 5824 (0x16c0) | For MIDI class devices
74 | --------------+---------------+--------------------------------------------
75 |
76 | Note that Windows caches the textual product- and vendor-description for
77 | mice, keyboards and joysticks. Name-bsed discrimination is therefore not
78 | recommended for these device classes.
79 |
80 |
81 | =======================================
82 | IDs FOR DISCRIMINATION BY SERIAL NUMBER
83 | =======================================
84 |
85 | If you use one of the IDs listed below, your device and host-side software
86 | must conform to these rules:
87 |
88 | (1) The USB device MUST provide a textual representation of the serial
89 | number, unless ONLY the operating system's default class driver is used.
90 | The serial number string MUST be available at least in USB language 0x0409
91 | (English/US).
92 |
93 | (2) The serial number MUST start with either an Internet domain name (e.g.
94 | "mycompany.com") registered and owned by you, or an e-mail address under your
95 | control (e.g. "myname@gmx.net"), both terminated with a colon (":") character.
96 | You MAY append any string you like for further discrimination of your devices.
97 |
98 | (3) You are responsible for retaining ownership of the domain or e-mail
99 | address for as long as any of your products are in use.
100 |
101 | (5) Application side device look-up MUST be based on the serial number string
102 | in addition to VID/PID matching. The matching must start at the first
103 | character of the serial number string and include the colon character
104 | terminating your domain or e-mail address. It MAY stop anywhere after that.
105 |
106 | (6) For devices which implement a particular USB device class (e.g. HID), the
107 | operating system's default class driver MUST be used. If an operating system
108 | driver for Vendor Class devices is needed, this driver must be libusb or
109 | libusb-win32 (see http://libusb.org/ and
110 | http://libusb-win32.sourceforge.net/).
111 |
112 | (7) If ONLY the operating system's default class driver is used, e.g. for
113 | mice, keyboards, joysticks, CDC or MIDI devices and no discrimination by an
114 | application is needed, the serial number may be omitted.
115 |
116 |
117 | Table if IDs for discrimination by serial number string:
118 |
119 | PID dec (hex) | VID dec (hex) | Description of use
120 | ===============+===============+===========================================
121 | 10200 (0x27d8) | 5824 (0x16c0) | For Vendor Class devices with libusb
122 | ---------------+---------------+-------------------------------------------
123 | 10201 (0x27d9) | 5824 (0x16c0) | For generic HID class devices (which are
124 | | | NOT mice, keyboards or joysticks)
125 | ---------------+---------------+-------------------------------------------
126 | 10202 (0x27da) | 5824 (0x16c0) | For USB Mice
127 | ---------------+---------------+-------------------------------------------
128 | 10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards
129 | ---------------+---------------+-------------------------------------------
130 | 10204 (0x27dc) | 5824 (0x16c0) | For USB Joysticks
131 | ---------------+---------------+-------------------------------------------
132 | 10205 (0x27dd) | 5824 (0x16c0) | For CDC-ACM class devices (modems)
133 | ---------------+---------------+-------------------------------------------
134 | 10206 (0x27de) | 5824 (0x16c0) | For MIDI class devices
135 | ---------------+---------------+-------------------------------------------
136 |
137 |
138 | =================
139 | ORIGIN OF USB-IDs
140 | =================
141 |
142 | OBJECTIVE DEVELOPMENT Software GmbH has obtained all VID/PID pairs listed
143 | here from Wouter van Ooijen (see www.voti.nl) for exclusive disposition.
144 | Wouter van Ooijen has obtained the VID from the USB Implementers Forum, Inc.
145 | (see www.usb.org). The VID is registered for the company name "Van Ooijen
146 | Technische Informatica".
147 |
148 |
149 | ==========
150 | DISCLAIMER
151 | ==========
152 |
153 | OBJECTIVE DEVELOPMENT Software GmbH disclaims all liability for any
154 | problems which are caused by the shared use of these VID/PID pairs.
155 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/usbdrv/oddebug.c:
--------------------------------------------------------------------------------
1 | /* Name: oddebug.c
2 | * Project: AVR library
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2005-01-16
5 | * Tabsize: 4
6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
8 | */
9 |
10 | #include "oddebug.h"
11 |
12 | #if DEBUG_LEVEL > 0
13 |
14 | #warning "Never compile production devices with debugging enabled"
15 |
16 | static void uartPutc(char c)
17 | {
18 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */
19 | ODDBG_UDR = c;
20 | }
21 |
22 | static uchar hexAscii(uchar h)
23 | {
24 | h &= 0xf;
25 | if(h >= 10)
26 | h += 'a' - (uchar)10 - '0';
27 | h += '0';
28 | return h;
29 | }
30 |
31 | static void printHex(uchar c)
32 | {
33 | uartPutc(hexAscii(c >> 4));
34 | uartPutc(hexAscii(c));
35 | }
36 |
37 | void odDebug(uchar prefix, uchar *data, uchar len)
38 | {
39 | printHex(prefix);
40 | uartPutc(':');
41 | while(len--){
42 | uartPutc(' ');
43 | printHex(*data++);
44 | }
45 | uartPutc('\r');
46 | uartPutc('\n');
47 | }
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/firmware/gc_n64_usb-2.9.1-bitkit/usbdrv/oddebug.h:
--------------------------------------------------------------------------------
1 | /* Name: oddebug.h
2 | * Project: AVR library
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2005-01-16
5 | * Tabsize: 4
6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
8 | */
9 |
10 | #ifndef __oddebug_h_included__
11 | #define __oddebug_h_included__
12 |
13 | /*
14 | General Description:
15 | This module implements a function for debug logs on the serial line of the
16 | AVR microcontroller. Debugging can be configured with the define
17 | 'DEBUG_LEVEL'. If this macro is not defined or defined to 0, all debugging
18 | calls are no-ops. If it is 1, DBG1 logs will appear, but not DBG2. If it is
19 | 2, DBG1 and DBG2 logs will be printed.
20 |
21 | A debug log consists of a label ('prefix') to indicate which debug log created
22 | the output and a memory block to dump in hex ('data' and 'len').
23 | */
24 |
25 |
26 | #ifndef F_CPU
27 | # define F_CPU 12000000 /* 12 MHz */
28 | #endif
29 |
30 | /* make sure we have the UART defines: */
31 | #include "usbportability.h"
32 |
33 | #ifndef uchar
34 | # define uchar unsigned char
35 | #endif
36 |
37 | #if DEBUG_LEVEL > 0 && !(defined TXEN || defined TXEN0) /* no UART in device */
38 | # warning "Debugging disabled because device has no UART"
39 | # undef DEBUG_LEVEL
40 | #endif
41 |
42 | #ifndef DEBUG_LEVEL
43 | # define DEBUG_LEVEL 0
44 | #endif
45 |
46 | /* ------------------------------------------------------------------------- */
47 |
48 | #if DEBUG_LEVEL > 0
49 | # define DBG1(prefix, data, len) odDebug(prefix, data, len)
50 | #else
51 | # define DBG1(prefix, data, len)
52 | #endif
53 |
54 | #if DEBUG_LEVEL > 1
55 | # define DBG2(prefix, data, len) odDebug(prefix, data, len)
56 | #else
57 | # define DBG2(prefix, data, len)
58 | #endif
59 |
60 | /* ------------------------------------------------------------------------- */
61 |
62 | #if DEBUG_LEVEL > 0
63 | extern void odDebug(uchar prefix, uchar *data, uchar len);
64 |
65 | /* Try to find our control registers; ATMEL likes to rename these */
66 |
67 | #if defined UBRR
68 | # define ODDBG_UBRR UBRR
69 | #elif defined UBRRL
70 | # define ODDBG_UBRR UBRRL
71 | #elif defined UBRR0
72 | # define ODDBG_UBRR UBRR0
73 | #elif defined UBRR0L
74 | # define ODDBG_UBRR UBRR0L
75 | #endif
76 |
77 | #if defined UCR
78 | # define ODDBG_UCR UCR
79 | #elif defined UCSRB
80 | # define ODDBG_UCR UCSRB
81 | #elif defined UCSR0B
82 | # define ODDBG_UCR UCSR0B
83 | #endif
84 |
85 | #if defined TXEN
86 | # define ODDBG_TXEN TXEN
87 | #else
88 | # define ODDBG_TXEN TXEN0
89 | #endif
90 |
91 | #if defined USR
92 | # define ODDBG_USR USR
93 | #elif defined UCSRA
94 | # define ODDBG_USR UCSRA
95 | #elif defined UCSR0A
96 | # define ODDBG_USR UCSR0A
97 | #endif
98 |
99 | #if defined UDRE
100 | # define ODDBG_UDRE UDRE
101 | #else
102 | # define ODDBG_UDRE UDRE0
103 | #endif
104 |
105 | #if defined UDR
106 | # define ODDBG_UDR UDR
107 | #elif defined UDR0
108 | # define ODDBG_UDR UDR0
109 | #endif
110 |
111 | static inline void odDebugInit(void)
112 | {
113 | ODDBG_UCR |= (1<
38 | #ifndef __IAR_SYSTEMS_ASM__
39 | # include
40 | #endif
41 |
42 | #define __attribute__(arg) /* not supported on IAR */
43 |
44 | #ifdef __IAR_SYSTEMS_ASM__
45 | # define __ASSEMBLER__ /* IAR does not define standard macro for asm */
46 | #endif
47 |
48 | #ifdef __HAS_ELPM__
49 | # define PROGMEM __farflash
50 | #else
51 | # define PROGMEM __flash
52 | #endif
53 |
54 | #define USB_READ_FLASH(addr) (*(PROGMEM char *)(addr))
55 |
56 | /* The following definitions are not needed by the driver, but may be of some
57 | * help if you port a gcc based project to IAR.
58 | */
59 | #define cli() __disable_interrupt()
60 | #define sei() __enable_interrupt()
61 | #define wdt_reset() __watchdog_reset()
62 | #define _BV(x) (1 << (x))
63 |
64 | /* assembler compatibility macros */
65 | #define nop2 rjmp $+2 /* jump to next instruction */
66 | #define XL r26
67 | #define XH r27
68 | #define YL r28
69 | #define YH r29
70 | #define ZL r30
71 | #define ZH r31
72 | #define lo8(x) LOW(x)
73 | #define hi8(x) (((x)>>8) & 0xff) /* not HIGH to allow XLINK to make a proper range check */
74 |
75 | /* Depending on the device you use, you may get problems with the way usbdrv.h
76 | * handles the differences between devices. Since IAR does not use #defines
77 | * for MCU registers, we can't check for the existence of a particular
78 | * register with an #ifdef. If the autodetection mechanism fails, include
79 | * definitions for the required USB_INTR_* macros in your usbconfig.h. See
80 | * usbconfig-prototype.h and usbdrv.h for details.
81 | */
82 |
83 | /* ------------------------------------------------------------------------- */
84 | #elif __CODEVISIONAVR__ /* check for CodeVision AVR */
85 | /* ------------------------------------------------------------------------- */
86 | /* This port is not working (yet) */
87 |
88 | /* #define F_CPU _MCU_CLOCK_FREQUENCY_ seems to be defined automatically */
89 |
90 | #include
91 | #include
92 |
93 | #define __attribute__(arg) /* not supported on IAR */
94 |
95 | #define PROGMEM __flash
96 | #define USB_READ_FLASH(addr) (*(PROGMEM char *)(addr))
97 |
98 | #ifndef __ASSEMBLER__
99 | static inline void cli(void)
100 | {
101 | #asm("cli");
102 | }
103 | static inline void sei(void)
104 | {
105 | #asm("sei");
106 | }
107 | #endif
108 | #define _delay_ms(t) delay_ms(t)
109 | #define _BV(x) (1 << (x))
110 | #define USB_CFG_USE_SWITCH_STATEMENT 1 /* macro for if() cascase fails for unknown reason */
111 |
112 | #define macro .macro
113 | #define endm .endmacro
114 | #define nop2 rjmp .+0 /* jump to next instruction */
115 |
116 | /* ------------------------------------------------------------------------- */
117 | #else /* default development environment is avr-gcc/avr-libc */
118 | /* ------------------------------------------------------------------------- */
119 |
120 | #include
121 | #ifdef __ASSEMBLER__
122 | # define _VECTOR(N) __vector_ ## N /* io.h does not define this for asm */
123 | #else
124 | # include
125 | #endif
126 |
127 | #if USB_CFG_DRIVER_FLASH_PAGE
128 | # define USB_READ_FLASH(addr) pgm_read_byte_far(((long)USB_CFG_DRIVER_FLASH_PAGE << 16) | (long)(addr))
129 | #else
130 | # define USB_READ_FLASH(addr) pgm_read_byte(addr)
131 | #endif
132 |
133 | #define macro .macro
134 | #define endm .endm
135 | #define nop2 rjmp .+0 /* jump to next instruction */
136 |
137 | #endif /* development environment */
138 |
139 | /* for conveniecne, ensure that PRG_RDB exists */
140 | #ifndef PRG_RDB
141 | # define PRG_RDB(addr) USB_READ_FLASH(addr)
142 | #endif
143 | #endif /* __usbportability_h_INCLUDED__ */
144 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/Changelog.txt:
--------------------------------------------------------------------------------
1 | --- v1.9 (Nov 16, 2011)
2 | - Special features added to support the Famicom controller with
3 | microphone. Wire the 'jumpers' in NES mode and short PC0 and PC1
4 | together to enable this new mode.
5 |
6 | For reference, the famicom controller I used had the following color code:
7 | Red: GND
8 | Blue: VCC
9 | Brown: Microphone out
10 | White: Clock
11 | Yellow: Latch
12 | Orange: Data out
13 |
14 | Wire the extra input (PC2) for the microphone digital signal from the controller.
15 |
16 | In an attempt to compensate for the lack of start and select buttons,
17 | the following 3 Buttons mappings have been implemented:
18 |
19 | Configuration 1 (just connect the controller)
20 | Button A -> USB Button 1
21 | Button B -> USB Button 2
22 | Button A+B -> USB Button 3 (and buttons 1 & 2)
23 | Microphone -> USB Button 4
24 |
25 | Configuration 2 (connect adapter while holding A)
26 | Microphone -> USB Button 1
27 | Button B -> USB Button 2
28 | Button A + B -> USB Button 3 (buttons 2 and 4 off)
29 | Button A -> USB Button 4
30 |
31 | Configuration 3 (connect adapter while holding B)
32 | Button A -> USB Button 1
33 | Microphone -> USB Button 2
34 | Button A + B -> USB Button 3 (buttons 2 and 4 off)
35 | Button B -> USB Button 4
36 |
37 | - Fixed the device name. (It would be corrupted or would not appear)
38 |
39 | --- v1.8 (Jul 11, 2011)
40 | - TGFX has its own device name and VID/PID
41 | - Sega Paddle support (HPD-200). Auto-detected in DB9 mode.
42 | This controller has only one button. But if you install
43 | the circuit inside the controller, you can rewire
44 | a button to PB4 to get an extra button (BTN2).
45 | The "not rewired" button will be BTN1.
46 |
47 | A few modes of operation are available and selected
48 | by holding buttons when connecting the adapter:
49 |
50 | Mode 1 (default) : Paddle left-right, 1 button.
51 | Mode 2 (hold btn1) : Paddle up-down, 1 button.
52 | Mode 3 (hold btn2) : Paddle left-right, 2 buttons.
53 | Mode 4 (hold btn1 + btn2) : Paddle Up-down, 2 buttons.
54 | - Controller polling synchronized with USB polls. Helps maintain
55 | an accurate timing when polling the controllers.
56 |
57 | --- v1.7 (Sep 13, 2008)
58 | - TGFX Support
59 | - Improved Genesis 6 Button auto-detection
60 | - Mode button now usable with Genesis 6 Button controllers
61 | - Sega style Multitap support (tested with MK-1654 only!)
62 |
63 | --- v1.6 (Dec 12, 2007)
64 | - Changed the button IDs. Atari and SMS controllers were
65 | using button 2 and 3. Some emulators require button 1 so....
66 | - Added a way to force 6 Button mode for genesis controllers. Just
67 | in case your 6 button controller is not detected. Hold 'start' when connecting
68 | the USB cable to use this feature.
69 |
70 | --- v1.5 (Nov 10, 2007)
71 | - Added support for Genesis 3 and 6 button controllers.
72 | - All DB9 controllers (Genesis 3/6, SMS, Atari style 1 or 2 button and
73 | compatible) are auto-detected.
74 | - The wiring is now different for Atari style controllers. Easier to wire
75 | to the multiuse PCB.
76 | - NES controllers are now detected in SNES mode. This works great with
77 | original Nintendo controllers. If you have trouble with clones, use
78 | NES-only mode.
79 | - The project is now released under the GPL v2 license.
80 |
81 | --- v1.4 (Dec 3, 2006)
82 | - Added support for Atari style joysticks. Two button
83 | variations (SMS) are supported.
84 | - Added padding to nes report descriptor. This makes it
85 | work correcly on windows. Linux sure is tolerant...
86 |
87 | --- v1.3 (Oct 28, 2006)
88 | - Fixed a bug in nes.c, snes.c and snesmouse.c which prevented the pullup
89 | on the data pin (from device) from being enabled. This resulted in
90 | random button toggling when no controller was connected.
91 | - A separate USB PID is used when in NES mode.
92 | - PD1 is now left as input (no pullup) since it is shorted with PD0 on the
93 | PCB rev.C. (And I didnt want to scrap a batch of 50 pcb nor cut a track
94 | and solder a wire 50 times...)
95 |
96 | --- v1.2 (Oct 6, 2006)
97 | Added serial number
98 | Added support for Snes mouse (auto detected in snes mode)
99 | - Default speed: Low
100 | - 3 Speeds selectable by holding some buttons at
101 | startup (USB connect or mouse connect)
102 | Left+right buttons: Low speed
103 | Left buton: Medium speed
104 | Right button: High speed
105 | No button: Default speed when USB connect,
106 | continue using same speed for mouse (re)-connect
107 |
108 | --- v1.1
109 | Reworked report descriptor for better behaviour
110 | in Windows and Mac OS X
111 |
112 | --- v1.0 (Jul 5, 2006)
113 | Initial release:
114 | Snes gamepad support
115 | Nes gamepad support
116 |
117 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/Makefile:
--------------------------------------------------------------------------------
1 | # Name: Makefile
2 | # Project: HIDKeys
3 | # Author: Christian Starkjohann
4 | # Creation Date: 2006-02-02
5 | # Tabsize: 4
6 | # Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 | # License: Proprietary, free under certain conditions. See Documentation.
8 | # This Revision: $Id: Makefile,v 1.7 2008-09-13 18:34:09 raph Exp $
9 |
10 | UISP = uisp -dprog=stk500 -dpart=atmega8 -dserial=/dev/ttyS1
11 | COMPILE = avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8 -DF_CPU=12000000L #-DDEBUG_LEVEL=1
12 | COMMON_OBJS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
13 | HEXFILE=main.hex
14 | AVRDUDE=avrdude -p m8 -P usb -c usbasp
15 |
16 | OBJS = $(COMMON_OBJS) snes.o snesmouse.o nes.o db9.o devdesc.o tg16.o segamtap.o
17 |
18 |
19 | # symbolic targets:
20 | all: $(HEXFILE)
21 |
22 | .c.o:
23 | $(COMPILE) -c $< -o $@
24 |
25 | .S.o:
26 | $(COMPILE) -x assembler-with-cpp -c $< -o $@
27 | # "-x assembler-with-cpp" should not be necessary since this is the default
28 | # file type for the .S (with capital S) extension. However, upper case
29 | # characters are not always preserved on Windows. To ensure WinAVR
30 | # compatibility define the file type manually.
31 |
32 | .c.s:
33 | $(COMPILE) -S $< -o $@
34 |
35 |
36 | clean:
37 | rm -f $(HEXFILE) main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
38 |
39 | # file targets:
40 | main.bin: $(OBJS) snes.o nes.o snesmouse.o db9.o tg16.o devdesc.o
41 | $(COMPILE) -o main.bin $(OBJS) -Wl,-Map=main.map
42 |
43 | $(HEXFILE): main.bin
44 | rm -f $(HEXFILE) main.eep.hex
45 | avr-objcopy -j .text -j .data -O ihex main.bin $(HEXFILE)
46 | ./checksize main.bin
47 |
48 | flash_uisp: all
49 | $(UISP) --erase --upload --verify if=$(HEXFILE)
50 |
51 | flash:
52 | $(AVRDUDE) -Uflash:w:$(HEXFILE) -B 1.0
53 |
54 | # Fuse high byte:
55 | # 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
56 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
57 | # | | | | | +-------- BOOTSZ1
58 | # | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
59 | # | | | +-------------- CKOPT (full output swing)
60 | # | | +---------------- SPIEN (allow serial programming)
61 | # | +------------------ WDTON (WDT not always on)
62 | # +-------------------- RSTDISBL (reset pin is enabled)
63 | # Fuse low byte:
64 | # 0x9f = 1 0 0 1 1 1 1 1
65 | # ^ ^ \ / \--+--/
66 | # | | | +------- CKSEL 3..0 (external >8M crystal)
67 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
68 | # | +------------------ BODEN (BrownOut Detector enabled)
69 | # +-------------------- BODLEVEL (2.7V)
70 | fuse_uisp:
71 | $(UISP) --wr_fuse_h=0xc9 --wr_fuse_l=0x9f
72 |
73 | fuse:
74 | $(AVRDUDE) -Uhfuse:w:0xc9:m -Ulfuse:w:0x9f:m -B 10.0
75 |
76 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/Readme.txt:
--------------------------------------------------------------------------------
1 | This is nes_snes_db9_usb Readme.txt file.
2 |
3 | Table of contents:
4 |
5 | 1) What is nes_snes_db9_usb?
6 | 2) USB Implementation
7 | 3) Compilation and installation
8 | 4) License
9 | 5) About the vendor id/product id pair:
10 | 6) Where do I get more information and updates?
11 |
12 |
13 | 1) What is nes_snes_db9_usb?
14 | -------------------------
15 | nes_snes_db9_usb if a firmware for Atmel ATmega8 which
16 | allows one to connect supported controllers to a PC via an USB
17 | port as a standard HID device.
18 |
19 | Supported controllers:
20 | - Nintendo Entertainment System (NES)
21 | - Famicon controller with built-in microphone
22 | - Super Nintendo Entertainment System (SNES)
23 | - Super Nintendo Mouse,
24 | - Genesis 3/6 buttons controllers
25 | - 2 Button atari-style controllers (such as Sega master system)
26 | - 1 Button atari-style controllers
27 | - Sega multi-tap MK-1654
28 |
29 | 2) USB Implementation
30 | ------------------
31 | nes_snes_db9_usb uses the software-only usb driver from Objective Development.
32 | See http://www.obdev.at/products/avrusb/index.html
33 |
34 | A good portion of the main.c code was based on Objective Development's
35 | HIDKeys example.
36 |
37 |
38 | 3) Compilation and installation
39 | ----------------------------
40 | First, you must compile it. To compile, you need a working avr-gcc and
41 | avr-libc. Under linux or cygwin, simply type make in the project directory.
42 | (assuming avr-gcc is in your path).
43 |
44 | Next, you must upload the generated file (main.hex) to the Atmega8 using
45 | whatever tools you like. Personally, I use uisp. The 'flash' and 'fuse'
46 | targets in the makefile is a good example about how to use it.
47 |
48 | The Atmega fuse bits must also be set properly. The idea behind this is to
49 | enable the external 12mhz crystal instead of the internal clock. Check the
50 | makefile for good fuse bytes values.
51 |
52 |
53 | 4) License
54 | -------
55 | nes_snes_db9_usb is released under Objective Development's extended GPL
56 | license. See License.txt
57 |
58 |
59 | 5) About the vendor id/product id pair:
60 | ------------------------------------
61 | Please dont re-use them for other projects. Instead, get your own.
62 | I got mine from mecanique:
63 | http://www.mecanique.co.uk/products/usb/pid.html
64 |
65 |
66 | 6) Where do I get more information and updates?
67 | --------------------------------------------
68 | Visit my nes_snes_db9_usb page:
69 | http://www.raphnet.net/electronique/snes_nes_usb/index_en.php
70 | you may also contact me by email:
71 | Raphael Assenat
72 |
73 |
74 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/checksize:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Name: checksize
3 | # Project: AVR-USB
4 | # Author: Christian Starkjohann
5 | # Creation Date: 2004-12-29
6 | # Tabsize: 4
7 | # Copyright: (c) 2005 OBJECTIVE DEVELOPMENT Software GmbH.
8 | # Revision: $Id: checksize,v 1.1.1.1 2006/07/06 01:18:55 raph Exp $
9 |
10 | error=0
11 | codelimit=8192
12 | datalimit=960 # leave 64 bytes for stack
13 |
14 | if [ $# -gt 1 ]; then
15 | codelimit="$2"
16 | fi
17 | if [ $# -gt 2 ]; then
18 | datalimit="$3"
19 | fi
20 |
21 | set -- `avr-size -d "$1" | awk '/[0-9]/ {print $1 + $2, $2 + $3, $2}'`
22 | if [ $1 -gt $codelimit ]; then
23 | echo "*** code size $1 exceeds limit of $codelimit"
24 | error=1
25 | else
26 | echo "ROM: $1 bytes (data=$3)"
27 | fi
28 | if [ $2 -gt $datalimit ]; then
29 | echo "*** data size $2 exceeds limit of $datalimit"
30 | error=1
31 | else
32 | echo "RAM: $2 bytes"
33 | fi
34 |
35 | exit $error
36 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/db9.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/db9.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/db9.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *db9GetGamepad(void);
4 |
5 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/devdesc.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/devdesc.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/devdesc.h:
--------------------------------------------------------------------------------
1 | #ifndef _devdesc_h__
2 | #define _devdesc_h__
3 |
4 | #include
5 |
6 | extern const char usbDescrDevice[] PROGMEM;
7 | int getUsbDescrDevice_size(void);
8 |
9 | #endif // _devdesc_h__
10 |
11 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/gamepad.h:
--------------------------------------------------------------------------------
1 | #ifndef _gamepad_h__
2 | #define _gamepad_h__
3 |
4 | typedef struct {
5 | int num_reports;
6 |
7 | int reportDescriptorSize;
8 | void *reportDescriptor; // must be in flash
9 |
10 | int deviceDescriptorSize; // if 0, use default
11 | void *deviceDescriptor; // must be in flash
12 |
13 | char (*init)(void);
14 | void (*update)(void);
15 |
16 | /* \brief Return true if events have occured on specified controller */
17 | char (*changed)(char id);
18 |
19 | /**
20 | * \param id controller id (starting at 1 to match report IDs)
21 | * return The number of bytes written to buf
22 | */
23 | char (*buildReport)(unsigned char *buf, char id);
24 |
25 | /**
26 | * \param Called continuously from the main loop.
27 | * Used by nes.c to detect famicon microphone activity.
28 | */
29 | void (*ultraPoll)(void);
30 | } Gamepad;
31 |
32 | #endif // _gamepad_h__
33 |
34 |
35 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/leds.h:
--------------------------------------------------------------------------------
1 | #ifndef _leds_h__
2 | #define _leds_h__
3 |
4 | #ifndef PORTD
5 | #include
6 | #endif
7 |
8 |
9 | #define LED_OFF()
10 | #define LED_ON();
11 | #define LED_TOGGLE();
12 |
13 | //#define LED_OFF() do { PORTD |= 0x20; } while(0)
14 | //#define LED_ON() do { PORTD &= ~0x20; } while(0)
15 | //#define LED_TOGGLE() do { PORTD ^= 0x20; } while(0)
16 |
17 | #endif
18 |
19 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/main.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/main.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/nes.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/nes.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/nes.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *nesGetGamepad(void);
4 |
5 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/segamtap.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/segamtap.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/segamtap.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *segamtapGetGamepad(void);
4 |
5 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/snes.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/snes.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/snes.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *snesGetGamepad(void);
4 |
5 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/snes_descriptor.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/snes_descriptor.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/snes_descriptor.h:
--------------------------------------------------------------------------------
1 |
2 | extern const char snes_usbHidReportDescriptor[] PROGMEM;
3 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/snesmouse.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/snesmouse.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/snesmouse.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *snesmouseGetGamepad(void);
4 | char isSnesMouse();
5 |
6 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/tg16.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzip/eagle-usb-gamepad/bd2a874952c8934508fabcf889b60798095d8acb/firmware/nes_snes_db9_usb-1.9-bitkit/tg16.c
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/tg16.h:
--------------------------------------------------------------------------------
1 | #include "gamepad.h"
2 |
3 | Gamepad *tg16_GetGamepad(void);
4 |
5 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/usbdrv/CommercialLicense.txt:
--------------------------------------------------------------------------------
1 | AVR-USB Driver Software License Agreement
2 | Version 2006-07-24
3 |
4 | THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN
5 | ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING
6 | THE AMOUNT ACCORDING TO SECTION 4 ("PAYMENT") TO OBJECTIVE DEVELOPMENT.
7 |
8 |
9 | 1 DEFINITIONS
10 |
11 | 1.1 "OBJECTIVE DEVELOPMENT" shall mean OBJECTIVE DEVELOPMENT Software GmbH,
12 | Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA.
13 |
14 | 1.2 "You" shall mean the Licensee.
15 |
16 | 1.3 "AVR-USB" shall mean the firmware-only USB device implementation for
17 | Atmel AVR microcontrollers distributed by OBJECTIVE DEVELOPMENT and
18 | consisting of the files usbdrv.c, usbdrv.h, usbdrvasm.S, oddebug.c,
19 | oddebug.h, usbdrvasm.asm, iarcompat.h and usbconfig-prototype.h.
20 |
21 |
22 | 2 LICENSE GRANTS
23 |
24 | 2.1 Source Code. OBJECTIVE DEVELOPMENT shall furnish you with the source
25 | code of AVR-USB.
26 |
27 | 2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the
28 | non-exclusive right to use and distribute AVR-USB with your hardware
29 | product(s), restricted by the limitations in section 3 below.
30 |
31 | 2.3 Modifications. OBJECTIVE DEVELOPMENT grants you the right to modify
32 | your copy of AVR-USB according to your needs.
33 |
34 | 2.4 USB IDs. OBJECTIVE DEVELOPMENT grants you the exclusive rights to use
35 | USB Product ID(s) sent to you in e-mail after receiving your payment in
36 | conjunction with USB Vendor ID 5824. OBJECTIVE DEVELOPMENT has acquired an
37 | exclusive license for this pair of USB identifiers from Wouter van Ooijen
38 | (www.voti.nl), who has licensed the VID from the USB Implementers Forum,
39 | Inc. (www.usb.org).
40 |
41 |
42 | 3 LICENSE RESTRICTIONS
43 |
44 | 3.1 Number of Units. Only one of the following three definitions is
45 | applicable. Which one is determined by the amount you pay to OBJECTIVE
46 | DEVELOPMENT, see section 4 ("Payment") below.
47 |
48 | Hobby License: You may use AVR-USB according to section 2 above in no more
49 | than 5 hardware units. These units must not be sold for profit.
50 |
51 | Entry Level License: You may use AVR-USB according to section 2 above in no
52 | more than 150 hardware units.
53 |
54 | Professional License: You may use AVR-USB according to section 2 above in
55 | any number of hardware units, except for large scale production ("unlimited
56 | fair use"). Quantities below 10,000 units are not considered large scale
57 | production. If your reach quantities which are obviously large scale
58 | production, you must pay a license fee of 0.10 EUR per unit for all units
59 | above 10,000.
60 |
61 | 3.2 Rental. You may not rent, lease, or lend AVR-USB or otherwise encumber
62 | any copy of AVR-USB, or any of the rights granted herein.
63 |
64 | 3.3 Transfer. You may not transfer your rights under this Agreement to
65 | another party without OBJECTIVE DEVELOPMENT's prior written consent. If
66 | such consent is obtained, you may permanently transfer this License to
67 | another party. The recipient of such transfer must agree to all terms and
68 | conditions of this Agreement.
69 |
70 | 3.4 Reservation of Rights. OBJECTIVE DEVELOPMENT retains all rights not
71 | expressly granted.
72 |
73 | 3.5 Non-Exclusive Rights. Your license rights under this Agreement are
74 | non-exclusive.
75 |
76 | 3.6 Third Party Rights. This Agreement cannot grant you rights controlled
77 | by third parties. In particular, you are not allowed to use the USB logo or
78 | other trademarks owned by the USB Implementers Forum, Inc. without their
79 | consent. Since such consent depends on USB certification, it should be
80 | noted that AVR-USB will not pass certification because it does not
81 | implement checksum verification and the microcontroller ports do not meet
82 | the electrical specifications.
83 |
84 |
85 | 4 PAYMENT
86 |
87 | The payment amount depends on the variation of this agreement (according to
88 | section 3.1) into which you want to enter. Concrete prices are listed on
89 | OBJECTIVE DEVELOPMENT's web site, usually at
90 | http://www.obdev.at/avrusb/license.html. You agree to pay the amount listed
91 | there to OBJECTIVE DEVELOPMENT or OBJECTIVE DEVELOPMENT's payment processor
92 | or reseller.
93 |
94 |
95 | 5 COPYRIGHT AND OWNERSHIP
96 |
97 | AVR-USB is protected by copyright laws and international copyright
98 | treaties, as well as other intellectual property laws and treaties. AVR-USB
99 | is licensed, not sold.
100 |
101 |
102 | 6 TERM AND TERMINATION
103 |
104 | 6.1 Term. This Agreement shall continue indefinitely. However, OBJECTIVE
105 | DEVELOPMENT may terminate this Agreement and revoke the granted license and
106 | USB-IDs if you fail to comply with any of its terms and conditions.
107 |
108 | 6.2 Survival of Terms. All provisions regarding secrecy, confidentiality
109 | and limitation of liability shall survive termination of this agreement.
110 |
111 |
112 | 7 DISCLAIMER OF WARRANTY AND LIABILITY
113 |
114 | LIMITED WARRANTY. AVR-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
115 | KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, OBJECTIVE
116 | DEVELOPMENT AND ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES, EITHER
117 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
118 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
119 | NON-INFRINGEMENT, WITH REGARD TO AVR-USB, AND THE PROVISION OF OR FAILURE
120 | TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL
121 | RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO
122 | STATE/JURISDICTION.
123 |
124 | LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
125 | IN NO EVENT SHALL OBJECTIVE DEVELOPMENT OR ITS SUPPLIERS BE LIABLE FOR ANY
126 | SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
127 | (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
128 | BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY
129 | LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE AVR-USB OR THE
130 | PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIVE
131 | DEVELOPMENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY
132 | CASE, OBJECTIVE DEVELOPMENT'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS
133 | AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR AVR-USB.
134 |
135 |
136 | 8 MISCELLANEOUS TERMS
137 |
138 | 8.1 Marketing. OBJECTIVE DEVELOPMENT has the right to mention for marketing
139 | purposes that you entered into this agreement.
140 |
141 | 8.2 Entire Agreement. This document represents the entire agreement between
142 | OBJECTIVE DEVELOPMENT and you. It may only be modified in writing signed by
143 | an authorized representative of both, OBJECTIVE DEVELOPMENT and you.
144 |
145 | 8.3 Severability. In case a provision of these terms and conditions should
146 | be or become partly or entirely invalid, ineffective, or not executable,
147 | the validity of all other provisions shall not be affected.
148 |
149 | 8.4 Applicable Law. This agreement is governed by the laws of the Republic
150 | of Austria.
151 |
152 | 8.5 Responsible Courts. The responsible courts in Vienna/Austria will have
153 | exclusive jurisdiction regarding all disputes in connection with this
154 | agreement.
155 |
156 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/usbdrv/USBID-License.txt:
--------------------------------------------------------------------------------
1 | Royalty-Free Non-Exclusive License USB Product-ID
2 | =================================================
3 |
4 | Version 2006-06-19
5 |
6 | OBJECTIVE DEVELOPMENT Software GmbH hereby grants you the non-exclusive
7 | right to use three USB.org vendor-ID (VID) / product-ID (PID) pairs with
8 | products based on Objective Development's firmware-only USB driver for
9 | Atmel AVR microcontrollers:
10 |
11 | * VID = 5824 (=0x16c0) / PID = 1500 (=0x5dc) for devices implementing no
12 | USB device class (vendor-class devices with USB class = 0xff). Devices
13 | using this pair will be referred to as "VENDOR CLASS" devices.
14 |
15 | * VID = 5824 (=0x16c0) / PID = 1503 (=0x5df) for HID class devices
16 | (excluding mice and keyboards). Devices using this pair will be referred
17 | to as "HID CLASS" devices.
18 |
19 | * VID = 5824 (=0x16c0) / PID = 1505 (=0x5e1) for CDC class modem devices
20 | Devices using this pair will be referred to as "CDC-ACM CLASS" devices.
21 |
22 | Since the granted right is non-exclusive, the same VID/PID pairs may be
23 | used by many companies and individuals for different products. To avoid
24 | conflicts, your device and host driver software MUST adhere to the rules
25 | outlined below.
26 |
27 | OBJECTIVE DEVELOPMENT Software GmbH has licensed these VID/PID pairs from
28 | Wouter van Ooijen (see www.voti.nl), who has licensed the VID from the USB
29 | Implementers Forum, Inc. (see www.usb.org). The VID is registered for the
30 | company name "Van Ooijen Technische Informatica".
31 |
32 |
33 | RULES AND RESTRICTIONS
34 | ======================
35 |
36 | (1) The USB device MUST provide a textual representation of the
37 | manufacturer and product identification. The manufacturer identification
38 | MUST be available at least in USB language 0x0409 (English/US).
39 |
40 | (2) The textual manufacturer identification MUST contain either an Internet
41 | domain name (e.g. "mycompany.com") registered and owned by you, or an
42 | e-mail address under your control (e.g. "myname@gmx.net"). You can embed
43 | the domain name or e-mail address in any string you like, e.g. "Objective
44 | Development http://www.obdev.at/avrusb/".
45 |
46 | (3) You are responsible for retaining ownership of the domain or e-mail
47 | address for as long as any of your products are in use.
48 |
49 | (4) You may choose any string for the textual product identification, as
50 | long as this string is unique within the scope of your textual manufacturer
51 | identification.
52 |
53 | (5) Matching of device-specific drivers MUST be based on the textual
54 | manufacturer and product identification in addition to the usual VID/PID
55 | matching. This means that operating system features which are based on
56 | VID/PID matching only (e.g. Windows kernel level drivers, automatic actions
57 | when the device is plugged in etc) MUST NOT be used. The driver matching
58 | MUST be a comparison of the entire strings, NOT a sub-string match. For
59 | CDC-ACM CLASS devices, a generic class driver should be used and the
60 | matching is based on the USB device class.
61 |
62 | (6) The extent to which VID/PID matching is allowed for non device-specific
63 | drivers or features depends on the operating system and particular VID/PID
64 | pair used:
65 |
66 | * Mac OS X, Linux, FreeBSD and other Unixes: No VID/PID matching is
67 | required and hence no VID/PID-only matching is allowed at all.
68 |
69 | * Windows: The operating system performs VID/PID matching for the kernel
70 | level driver. You are REQUIRED to use libusb-win32 (see
71 | http://libusb-win32.sourceforge.net/) as the kernel level driver for
72 | VENDOR CLASS devices. HID CLASS devices all use the generic HID class
73 | driver shipped with Windows, except mice and keyboards. You therefore
74 | MUST NOT use any of the shared VID/PID pairs for mice or keyboards.
75 | CDC-ACM CLASS devices require a ".inf" file which matches on the VID/PID
76 | pair. This ".inf" file MUST load the "usbser" driver to configure the
77 | device as modem (COM-port).
78 |
79 | (7) OBJECTIVE DEVELOPMENT Software GmbH disclaims all liability for any
80 | problems which are caused by the shared use of these VID/PID pairs. You
81 | have been warned that the sharing of VID/PID pairs may cause problems. If
82 | you want to avoid them, get your own VID/PID pair for exclusive use.
83 |
84 |
85 | HOW TO IMPLEMENT THESE RULES
86 | ============================
87 |
88 | The following rules are for VENDOR CLASS and HID CLASS devices. CDC-ACM
89 | CLASS devices use the operating system's class driver and don't need a
90 | custom driver.
91 |
92 | The host driver MUST iterate over all devices with the given VID/PID
93 | numbers in their device descriptors and query the string representation for
94 | the manufacturer name in USB language 0x0409 (English/US). It MUST compare
95 | the ENTIRE string with your textual manufacturer identification chosen in
96 | (2) above. A substring search for your domain or e-mail address is NOT
97 | acceptable. The driver MUST NOT touch the device (other than querying the
98 | descriptors) unless the strings match.
99 |
100 | For all USB devices with matching VID/PID and textual manufacturer
101 | identification, the host driver must query the textual product
102 | identification and string-compare it with the name of the product it can
103 | control. It may only initialize the device if the product matches exactly.
104 |
105 | Objective Development provides examples for these matching rules with the
106 | "PowerSwitch" project (using libusb) and with the "Automator" project
107 | (using Windows calls on Windows and libusb on Unix).
108 |
109 |
110 | Technical Notes:
111 | ================
112 |
113 | Sharing the same VID/PID pair among devices is possible as long as ALL
114 | drivers which match the VID/PID also perform matching on the textual
115 | identification strings. This is easy on all operating systems except
116 | Windows, since Windows establishes a static connection between the VID/PID
117 | pair and a kernel level driver. All devices with the same VID/PID pair must
118 | therefore use THE SAME kernel level driver.
119 |
120 | We therefore demand that you use libusb-win32 for VENDOR CLASS devices.
121 | This is a generic kernel level driver which allows all types of USB access
122 | for user space applications. This is only a partial solution of the
123 | problem, though, because different device drivers may come with different
124 | versions of libusb-win32 and they may not work with the libusb version of
125 | the respective other driver. You are therefore encouraged to test your
126 | driver against a broad range of libusb-win32 versions. Do not use new
127 | features in new versions, or check for their existence before you use them.
128 | When a new libusb-win32 becomes available, make sure that your driver is
129 | compatible with it.
130 |
131 | For HID CLASS devices it is necessary that all those devices bind to the
132 | same kernel driver: Microsoft's generic USB HID driver. This is true for
133 | all HID devices except those with a specialized driver. Currently, the only
134 | HIDs with specialized drivers are mice and keyboards. You therefore MUST
135 | NOT use a shared VID/PID with mouse and keyboard devices.
136 |
137 | Sharing the same VID/PID among different products is unusual and probably
138 | violates the USB specification. If you do it, you do it at your own risk.
139 |
140 | To avoid possible incompatibilities, we highly recommend that you get your
141 | own VID/PID pair if you intend to sell your product. Objective
142 | Development's commercial licenses for AVR-USB include a PID for
143 | unrestricted exclusive use.
144 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/usbdrv/iarcompat.h:
--------------------------------------------------------------------------------
1 | /* Name: iarcompat.h
2 | * Project: AVR USB driver
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2006-03-01
5 | * Tabsize: 4
6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: iarcompat.h,v 1.2 2007/11/10 23:56:24 raph Exp $
9 | */
10 |
11 | /*
12 | General Description:
13 | This header is included when we compile with the IAR C-compiler and assembler.
14 | It defines macros for cross compatibility between gcc and IAR-cc.
15 |
16 | Thanks to Oleg Semyonov for his help with the IAR tools port!
17 | */
18 |
19 | #ifndef __iarcompat_h_INCLUDED__
20 | #define __iarcompat_h_INCLUDED__
21 |
22 | #if defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__
23 |
24 | /* Enable bit definitions */
25 | #ifndef ENABLE_BIT_DEFINITIONS
26 | # define ENABLE_BIT_DEFINITIONS 1
27 | #endif
28 |
29 | /* Include IAR headers */
30 | #include
31 | #ifndef __IAR_SYSTEMS_ASM__
32 | # include
33 | #endif
34 |
35 | #define __attribute__(arg)
36 | #define IAR_SECTION(section) @ section
37 |
38 | #ifndef USB_BUFFER_SECTION
39 | # define USB_BUFFER_SECTION "TINY_Z" /* if user has not selected a named section */
40 | #endif
41 |
42 | #ifdef __IAR_SYSTEMS_ASM__
43 | # define __ASSEMBLER__
44 | #endif
45 |
46 | #ifdef __HAS_ELPM__
47 | # define PROGMEM __farflash
48 | #else
49 | # define PROGMEM __flash
50 | #endif
51 |
52 | #define PRG_RDB(addr) (*(PROGMEM char *)(addr))
53 |
54 | /* The following definitions are not needed by the driver, but may be of some
55 | * help if you port a gcc based project to IAR.
56 | */
57 | #define cli() __disable_interrupt()
58 | #define sei() __enable_interrupt()
59 | #define wdt_reset() __watchdog_reset()
60 |
61 | /* Depending on the device you use, you may get problems with the way usbdrv.h
62 | * handles the differences between devices. Since IAR does not use #defines
63 | * for MCU registers, we can't check for the existence of a particular
64 | * register with an #ifdef. If the autodetection mechanism fails, include
65 | * definitions for the required USB_INTR_* macros in your usbconfig.h. See
66 | * usbconfig-prototype.h and usbdrv.h for details.
67 | */
68 |
69 | #endif /* defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__ */
70 | #endif /* __iarcompat_h_INCLUDED__ */
71 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/usbdrv/oddebug.c:
--------------------------------------------------------------------------------
1 | /* Name: oddebug.c
2 | * Project: AVR library
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2005-01-16
5 | * Tabsize: 4
6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: oddebug.c,v 1.2 2007/11/10 23:56:24 raph Exp $
9 | */
10 |
11 | #include "oddebug.h"
12 |
13 | #if DEBUG_LEVEL > 0
14 |
15 | #warning "Never compile production devices with debugging enabled"
16 |
17 | static void uartPutc(char c)
18 | {
19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */
20 | ODDBG_UDR = c;
21 | }
22 |
23 | static uchar hexAscii(uchar h)
24 | {
25 | h &= 0xf;
26 | if(h >= 10)
27 | h += 'a' - (uchar)10 - '0';
28 | h += '0';
29 | return h;
30 | }
31 |
32 | static void printHex(uchar c)
33 | {
34 | uartPutc(hexAscii(c >> 4));
35 | uartPutc(hexAscii(c));
36 | }
37 |
38 | void odDebug(uchar prefix, uchar *data, uchar len)
39 | {
40 | printHex(prefix);
41 | uartPutc(':');
42 | while(len--){
43 | uartPutc(' ');
44 | printHex(*data++);
45 | }
46 | uartPutc('\r');
47 | uartPutc('\n');
48 | }
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/usbdrv/oddebug.h:
--------------------------------------------------------------------------------
1 | /* Name: oddebug.h
2 | * Project: AVR library
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2005-01-16
5 | * Tabsize: 4
6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: oddebug.h,v 1.2 2007/11/10 23:56:24 raph Exp $
9 | */
10 |
11 | #ifndef __oddebug_h_included__
12 | #define __oddebug_h_included__
13 |
14 | /*
15 | General Description:
16 | This module implements a function for debug logs on the serial line of the
17 | AVR microcontroller. Debugging can be configured with the define
18 | 'DEBUG_LEVEL'. If this macro is not defined or defined to 0, all debugging
19 | calls are no-ops. If it is 1, DBG1 logs will appear, but not DBG2. If it is
20 | 2, DBG1 and DBG2 logs will be printed.
21 |
22 | A debug log consists of a label ('prefix') to indicate which debug log created
23 | the output and a memory block to dump in hex ('data' and 'len').
24 | */
25 |
26 |
27 | #ifndef F_CPU
28 | # define F_CPU 12000000 /* 12 MHz */
29 | #endif
30 |
31 | /* make sure we have the UART defines: */
32 | #include "iarcompat.h"
33 | #ifndef __IAR_SYSTEMS_ICC__
34 | # include
35 | #endif
36 |
37 | #ifndef uchar
38 | # define uchar unsigned char
39 | #endif
40 |
41 | #if DEBUG_LEVEL > 0 && !(defined TXEN || defined TXEN0) /* no UART in device */
42 | # warning "Debugging disabled because device has no UART"
43 | # undef DEBUG_LEVEL
44 | #endif
45 |
46 | #ifndef DEBUG_LEVEL
47 | # define DEBUG_LEVEL 0
48 | #endif
49 |
50 | /* ------------------------------------------------------------------------- */
51 |
52 | #if DEBUG_LEVEL > 0
53 | # define DBG1(prefix, data, len) odDebug(prefix, data, len)
54 | #else
55 | # define DBG1(prefix, data, len)
56 | #endif
57 |
58 | #if DEBUG_LEVEL > 1
59 | # define DBG2(prefix, data, len) odDebug(prefix, data, len)
60 | #else
61 | # define DBG2(prefix, data, len)
62 | #endif
63 |
64 | /* ------------------------------------------------------------------------- */
65 |
66 | #if DEBUG_LEVEL > 0
67 | extern void odDebug(uchar prefix, uchar *data, uchar len);
68 |
69 | /* Try to find our control registers; ATMEL likes to rename these */
70 |
71 | #if defined UBRR
72 | # define ODDBG_UBRR UBRR
73 | #elif defined UBRRL
74 | # define ODDBG_UBRR UBRRL
75 | #elif defined UBRR0
76 | # define ODDBG_UBRR UBRR0
77 | #elif defined UBRR0L
78 | # define ODDBG_UBRR UBRR0L
79 | #endif
80 |
81 | #if defined UCR
82 | # define ODDBG_UCR UCR
83 | #elif defined UCSRB
84 | # define ODDBG_UCR UCSRB
85 | #elif defined UCSR0B
86 | # define ODDBG_UCR UCSR0B
87 | #endif
88 |
89 | #if defined TXEN
90 | # define ODDBG_TXEN TXEN
91 | #else
92 | # define ODDBG_TXEN TXEN0
93 | #endif
94 |
95 | #if defined USR
96 | # define ODDBG_USR USR
97 | #elif defined UCSRA
98 | # define ODDBG_USR UCSRA
99 | #elif defined UCSR0A
100 | # define ODDBG_USR UCSR0A
101 | #endif
102 |
103 | #if defined UDRE
104 | # define ODDBG_UDRE UDRE
105 | #else
106 | # define ODDBG_UDRE UDRE0
107 | #endif
108 |
109 | #if defined UDR
110 | # define ODDBG_UDR UDR
111 | #elif defined UDR0
112 | # define ODDBG_UDR UDR0
113 | #endif
114 |
115 | static inline void odDebugInit(void)
116 | {
117 | ODDBG_UCR |= (1< /* for CPU I/O register definitions and vectors */
24 | #endif /* __IAR_SYSTEMS_ASM__ */
25 | #include "usbdrv.h" /* for common defs */
26 |
27 | /* register names */
28 | #define x1 r16
29 | #define x2 r17
30 | #define shift r18
31 | #define cnt r19
32 | #define x3 r20
33 | #define x4 r21
34 | #define bitcnt r22
35 | #define phase x4
36 | #define leap x4
37 |
38 | /* Some assembler dependent definitions and declarations: */
39 |
40 | #ifdef __IAR_SYSTEMS_ASM__
41 |
42 | # define nop2 rjmp $+2 /* jump to next instruction */
43 | # define XL r26
44 | # define XH r27
45 | # define YL r28
46 | # define YH r29
47 | # define ZL r30
48 | # define ZH r31
49 | # define lo8(x) LOW(x)
50 | # define hi8(x) (((x)>>8) & 0xff) /* not HIGH to allow XLINK to make a proper range check */
51 |
52 | extern usbRxBuf, usbDeviceAddr, usbNewDeviceAddr, usbInputBufOffset
53 | extern usbCurrentTok, usbRxLen, usbRxToken, usbTxLen
54 | extern usbTxBuf, usbMsgLen, usbTxLen1, usbTxBuf1, usbTxLen3, usbTxBuf3
55 | # if USB_COUNT_SOF
56 | extern usbSofCount
57 | # endif
58 | public usbCrc16
59 | public usbCrc16Append
60 |
61 | COMMON INTVEC
62 | # ifndef USB_INTR_VECTOR
63 | ORG INT0_vect
64 | # else /* USB_INTR_VECTOR */
65 | ORG USB_INTR_VECTOR
66 | # undef USB_INTR_VECTOR
67 | # endif /* USB_INTR_VECTOR */
68 | # define USB_INTR_VECTOR usbInterruptHandler
69 | rjmp USB_INTR_VECTOR
70 | RSEG CODE
71 |
72 | #else /* __IAR_SYSTEMS_ASM__ */
73 |
74 | # define nop2 rjmp .+0 /* jump to next instruction */
75 |
76 | # ifndef USB_INTR_VECTOR /* default to hardware interrupt INT0 */
77 | # define USB_INTR_VECTOR INT0_vect /* was SIG_INTERRUPT0 */
78 | # endif
79 | .text
80 | .global USB_INTR_VECTOR
81 | .type USB_INTR_VECTOR, @function
82 | .global usbCrc16
83 | .global usbCrc16Append
84 | #endif /* __IAR_SYSTEMS_ASM__ */
85 |
86 |
87 | #if USB_INTR_PENDING < 0x40 /* This is an I/O address, use in and out */
88 | # define USB_LOAD_PENDING(reg) in reg, USB_INTR_PENDING
89 | # define USB_STORE_PENDING(reg) out USB_INTR_PENDING, reg
90 | #else /* It's a memory address, use lds and sts */
91 | # define USB_LOAD_PENDING(reg) lds reg, USB_INTR_PENDING
92 | # define USB_STORE_PENDING(reg) sts USB_INTR_PENDING, reg
93 | #endif
94 |
95 |
96 | ;----------------------------------------------------------------------------
97 | ; Utility functions
98 | ;----------------------------------------------------------------------------
99 |
100 | #ifdef __IAR_SYSTEMS_ASM__
101 | /* Register assignments for usbCrc16 on IAR cc */
102 | /* Calling conventions on IAR:
103 | * First parameter passed in r16/r17, second in r18/r19 and so on.
104 | * Callee must preserve r4-r15, r24-r29 (r28/r29 is frame pointer)
105 | * Result is passed in r16/r17
106 | * In case of the "tiny" memory model, pointers are only 8 bit with no
107 | * padding. We therefore pass argument 1 as "16 bit unsigned".
108 | */
109 | RTMODEL "__rt_version", "3"
110 | /* The line above will generate an error if cc calling conventions change.
111 | * The value "3" above is valid for IAR 4.10B/W32
112 | */
113 | # define argLen r18 /* argument 2 */
114 | # define argPtrL r16 /* argument 1 */
115 | # define argPtrH r17 /* argument 1 */
116 |
117 | # define resCrcL r16 /* result */
118 | # define resCrcH r17 /* result */
119 |
120 | # define ptrL ZL
121 | # define ptrH ZH
122 | # define ptr Z
123 | # define byte r22
124 | # define bitCnt r19
125 | # define polyL r20
126 | # define polyH r21
127 | # define scratch r23
128 |
129 | #else /* __IAR_SYSTEMS_ASM__ */
130 | /* Register assignments for usbCrc16 on gcc */
131 | /* Calling conventions on gcc:
132 | * First parameter passed in r24/r25, second in r22/23 and so on.
133 | * Callee must preserve r1-r17, r28/r29
134 | * Result is passed in r24/r25
135 | */
136 | # define argLen r22 /* argument 2 */
137 | # define argPtrL r24 /* argument 1 */
138 | # define argPtrH r25 /* argument 1 */
139 |
140 | # define resCrcL r24 /* result */
141 | # define resCrcH r25 /* result */
142 |
143 | # define ptrL XL
144 | # define ptrH XH
145 | # define ptr x
146 | # define byte r18
147 | # define bitCnt r19
148 | # define polyL r20
149 | # define polyH r21
150 | # define scratch r23
151 |
152 | #endif
153 |
154 | ; extern unsigned usbCrc16(unsigned char *data, unsigned char len);
155 | ; data: r24/25
156 | ; len: r22
157 | ; temp variables:
158 | ; r18: data byte
159 | ; r19: bit counter
160 | ; r20/21: polynomial
161 | ; r23: scratch
162 | ; r24/25: crc-sum
163 | ; r26/27=X: ptr
164 | usbCrc16:
165 | mov ptrL, argPtrL
166 | mov ptrH, argPtrH
167 | ldi resCrcL, 0xff
168 | ldi resCrcH, 0xff
169 | ldi polyL, lo8(0xa001)
170 | ldi polyH, hi8(0xa001)
171 | crcByteLoop:
172 | subi argLen, 1
173 | brcs crcReady
174 | ld byte, ptr+
175 | ldi bitCnt, 8
176 | crcBitLoop:
177 | mov scratch, byte
178 | eor scratch, resCrcL
179 | lsr resCrcH
180 | ror resCrcL
181 | lsr byte
182 | sbrs scratch, 0
183 | rjmp crcNoXor
184 | eor resCrcL, polyL
185 | eor resCrcH, polyH
186 | crcNoXor:
187 | dec bitCnt
188 | brne crcBitLoop
189 | rjmp crcByteLoop
190 | crcReady:
191 | com resCrcL
192 | com resCrcH
193 | ret
194 |
195 | ; extern unsigned usbCrc16Append(unsigned char *data, unsigned char len);
196 | usbCrc16Append:
197 | rcall usbCrc16
198 | st ptr+, resCrcL
199 | st ptr+, resCrcH
200 | ret
201 |
202 |
203 | ;----------------------------------------------------------------------------
204 | ; Now include the clock rate specific code
205 | ;----------------------------------------------------------------------------
206 |
207 | #ifndef USB_CFG_CLOCK_KHZ
208 | # define USB_CFG_CLOCK_KHZ 12000
209 | #endif
210 |
211 | #if USB_CFG_CLOCK_KHZ == 12000
212 | # include "usbdrvasm12.S"
213 | #elif USB_CFG_CLOCK_KHZ == 15000
214 | # include "usbdrvasm15.S"
215 | #elif USB_CFG_CLOCK_KHZ == 16000
216 | # include "usbdrvasm16.S"
217 | #elif USB_CFG_CLOCK_KHZ == 16500
218 | # include "usbdrvasm165.S"
219 | #else
220 | # error "USB_CFG_CLOCK_KHZ is not one of the supported rates!"
221 | #endif
222 |
--------------------------------------------------------------------------------
/firmware/nes_snes_db9_usb-1.9-bitkit/usbdrv/usbdrvasm.asm:
--------------------------------------------------------------------------------
1 | /* Name: usbdrvasm.asm
2 | * Project: AVR USB driver
3 | * Author: Christian Starkjohann
4 | * Creation Date: 2006-03-01
5 | * Tabsize: 4
6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 | * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
8 | * This Revision: $Id: usbdrvasm.asm,v 1.2 2007/11/10 23:56:24 raph Exp $
9 | */
10 |
11 | /*
12 | General Description:
13 | The IAR compiler/assembler system prefers assembler files with file extension
14 | ".asm". We simply provide this file as an alias for usbdrvasm.S.
15 |
16 | Thanks to Oleg Semyonov for his help with the IAR tools port!
17 | */
18 |
19 | #include "usbdrvasm.S"
20 |
21 | end
22 |
--------------------------------------------------------------------------------
/gerbers/README.md:
--------------------------------------------------------------------------------
1 | # Gerber Layers
2 |
3 | | Layer Description | Extension |
4 | | ----------------------| ----------|
5 | | Bottom Copper | GBL |
6 | | Bottom Solder Mask | GBS |
7 | | Bottom Silk | GBO |
8 | | Top Copper | GTL |
9 | | Top Silk | GTO |
10 | | Top Solder Mask | GTS |
11 | | Outline | GML |
12 | | Holes/Drills | TXT |
13 |
--------------------------------------------------------------------------------
/gerbers/gerbmerge.cfg:
--------------------------------------------------------------------------------
1 | [DEFAULT]
2 | projdir = .
3 |
4 | MergeOut = panel
5 | ProjName = usb-gamepad
6 |
7 | [Options]
8 |
9 | #CropMarkLayers = *topsilkscreen,*bottomsilkscreen
10 |
11 | # Set the maximum dimensions of the final panel, if known. You can set the
12 | # dimensions of the maximum panel size supported by your board manufacturer,
13 | # and GerbMerge will print an error message if your layout exceeds these
14 | # dimensions. Alternatively, when using automatic placement, the panel sizes
15 | # listed here constrain the random placements such that only placements that
16 | # fit within the given panel dimensions will be considered. The dimensions are
17 | # specified in inches.
18 | # 10cm = 3.93701in
19 | # 5cm = 1.9685in
20 |
21 | PanelWidth = 3.93701
22 | PanelHeight = 3.93701
23 |
24 | # Set the amount of extra space to leave around the edges of the panel to
25 | # simplify tooling and handling. These margins are specified in inches, and
26 | # default to 0" if not specified. These spacings will only be visible to the
27 | # board manufacturer if you enable crop marks (see CropMarkLayers above) or use
28 | # an OutlineLayer.
29 | LeftMargin = 0.1
30 | RightMargin = 0.1
31 | TopMargin = 0.1
32 | BottomMargin = 0.1
33 |
34 | # Set the inter-job spacing (inches) in both the X-dimension (width) and
35 | # Y-dimension (height). Normally these would be the same unless you're trying
36 | # really hard to make your jobs fit into a panel of exact size and you need to
37 | # tweak these spacings to make it work. 0.125" is probably generous, about half
38 | # that is practical for using a band saw, but you probably want to leave it at
39 | # 0.125" if you have copper features close to the board edges and/or are using
40 | # less precise tools, like a hacksaw, for separating the boards.
41 | # 1mm = 0.0393701
42 | XSpacing = 0.0393701
43 | YSpacing = 0.0393701
44 |
45 | # Width of cut lines, in inches. The default value is 0.01". These are drawn on
46 | # the layers specified by CutLineLayers.
47 | CutLineWidth = 0.01
48 |
49 | # Width of crop marks, in inches. The default value is 0.01". These are drawn on
50 | # the layers specified by CropMarkLayers.
51 | CropMarkWidth = 0.01
52 |
53 | # This option is intended to reduce the probability of forgetting to include a
54 | # layer in a job description when panelizing two or more different jobs.
55 | # Unless this option is set to 1, an error will be raised if some jobs do not
56 | # have the same layer names as the others, i.e., are missing layers. For
57 | # example, if one job has a top-side soldermask layer and another doesn't, that
58 | # could be a mistake. Setting this option to 1 prevents this situation from
59 | # raising an error.
60 | AllowMissingLayers = 1
61 |
62 | # This option is intended to reduce the number of drills in the output by
63 | # eliminating drill sizes that are too close to make a difference. For example,
64 | # it probably does not make sense to have two separate 0.031" and 0.0315"
65 | # drills. The DrillClusterTolerance value specifies how much tolerance is
66 | # allowed in drill sizes, in units of inches. Multiple drill tools that span
67 | # twice this tolerance will be clustered into a single drill tool. For example,
68 | # a set of 0.031", 0.0315", 0.032", and 0.034" drills will all be replaced by a
69 | # single drill tool of diameter (0.031"+0.034")/2 = 0.0325". It is guaranteed
70 | # that all original drill sizes will be no farther than DrillClusterTolerance
71 | # from the drill tool size generated by clustering.
72 | #
73 | # Setting DrillClusterTolerance to 0 disables clustering.
74 | DrillClusterTolerance = 0.002
75 |
76 | # Use this option to automatically thicken features on particular layers. This
77 | # is intended for thickening silkscreen to some minimum width. The value of
78 | # this option must be a comma-separated list of layer names followed by minimum
79 | # feature sizes (in inches) for that layer. Comment this out to disable thickening.
80 | #MinimumFeatureSize = *topsilkscreen,0.008,*bottomsilkscreen,0.008
81 |
82 | [MergeOutputFiles]
83 | Prefix = %(projname)s_%(mergeout)s
84 |
85 | *TopLayer=%(prefix)s.GTL
86 | *BottomLayer=%(prefix)s.GBL
87 | *TopSilkscreen=%(prefix)s.GTO
88 | *BottomSilkscreen=%(prefix)s.GBO
89 | *TopSoldermask=%(prefix)s.GTS
90 | *BottomSoldermask=%(prefix)s.GBS
91 | Drills=%(prefix)s.TXT
92 | BoardOutline=%(prefix)s.GML
93 | ToolList = %(prefix)s.toollist.drl
94 | Placement = %(prefix)s.placement.plc
95 |
96 | [Proj]
97 |
98 | Prefix=%(projdir)s/%(projname)s
99 |
100 | *TopLayer=%(prefix)s.GTL
101 | *BottomLayer=%(prefix)s.GBL
102 | *TopSilkscreen=%(prefix)s.GTO
103 | *BottomSilkscreen=%(prefix)s.GBO
104 | *TopSoldermask=%(prefix)s.GTS
105 | *BottomSoldermask=%(prefix)s.GBS
106 | Drills=%(prefix)s.TXT
107 | BoardOutline=%(prefix)s.GML
108 |
109 |
--------------------------------------------------------------------------------
/gerbers/gerbmerge.def:
--------------------------------------------------------------------------------
1 | Row {
2 | Proj
3 | }
4 | Row {
5 | Proj
6 | }
7 | Row {
8 | Proj
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/gerbers/gerbview.gvp:
--------------------------------------------------------------------------------
1 | (gerbv-file-version! "2.0A")
2 | (define-layer! 7 (cons 'filename "usb-gamepad.GBS")(cons 'visible #f)(cons 'color #(57054 57054 57054)))
3 | (define-layer! 6 (cons 'filename "usb-gamepad.GBL")(cons 'visible #f)(cons 'color #(6871 6871 65535)))
4 | (define-layer! 5 (cons 'filename "usb-gamepad.GBO")(cons 'visible #f)(cons 'color #(65535 65535 65535)))
5 | (define-layer! 4 (cons 'filename "usb-gamepad.GTL")(cons 'visible #t)(cons 'color #(46104 1586 9148)))
6 | (define-layer! 3 (cons 'filename "usb-gamepad.GTS")(cons 'visible #t)(cons 'color #(57669 57669 57669)))
7 | (define-layer! 2 (cons 'filename "usb-gamepad.GTO")(cons 'visible #t)(cons 'color #(65535 65535 65535)))
8 | (define-layer! 1 (cons 'filename "usb-gamepad.TXT")(cons 'visible #t)(cons 'color #(0 0 0))(cons 'attribs (list (list 'autodetect 'Boolean 1) (list 'zero_supression 'Enum 0) (list 'units 'Enum 0) (list 'digits 'Integer 4))))
9 | (define-layer! 0 (cons 'filename "usb-gamepad.GML")(cons 'visible #t)(cons 'color #(33825 33825 33825)))
10 | (define-layer! -1 (cons 'filename "/home/g/sketchbook/eagle/nes_usb")(cons 'visible #f)(cons 'color #(0 0 0)))
11 | (set-render-type! 3)
12 |
--------------------------------------------------------------------------------
/gerbers/usb-gamepad.GBO:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | M02*
11 |
--------------------------------------------------------------------------------
/gerbers/usb-gamepad.GTS:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX24Y24*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.1340*%
11 | %ADD11C,0.0700*%
12 | %ADD12C,0.0700*%
13 | %ADD13OC8,0.0700*%
14 | %ADD14C,0.0820*%
15 | %ADD15C,0.0740*%
16 | %ADD16C,0.1380*%
17 | %ADD17R,0.0960X0.0560*%
18 | %ADD18R,0.0946X0.1497*%
19 | %ADD19OC8,0.0710*%
20 | %ADD20C,0.0710*%
21 | %ADD21OC8,0.0780*%
22 | %ADD22C,0.0780*%
23 | %ADD23R,0.0695X0.0695*%
24 | %ADD24C,0.0695*%
25 | D10*
26 | X002961Y001489D03*
27 | X002900Y010089D03*
28 | X036761Y010089D03*
29 | X036811Y001489D03*
30 | D11*
31 | X029961Y004129D02*
32 | X029961Y004749D01*
33 | X028961Y004749D02*
34 | X028961Y004129D01*
35 | X027961Y004129D02*
36 | X027961Y004749D01*
37 | X026961Y004749D02*
38 | X026961Y004129D01*
39 | X025961Y004129D02*
40 | X025961Y004749D01*
41 | X024961Y004749D02*
42 | X024961Y004129D01*
43 | X023961Y004129D02*
44 | X023961Y004749D01*
45 | X022961Y004749D02*
46 | X022961Y004129D01*
47 | X021961Y004129D02*
48 | X021961Y004749D01*
49 | X020961Y004749D02*
50 | X020961Y004129D01*
51 | X019961Y004129D02*
52 | X019961Y004749D01*
53 | X018961Y004749D02*
54 | X018961Y004129D01*
55 | X017961Y004129D02*
56 | X017961Y004749D01*
57 | X016961Y004749D02*
58 | X016961Y004129D01*
59 | X016961Y007129D02*
60 | X016961Y007749D01*
61 | X017961Y007749D02*
62 | X017961Y007129D01*
63 | X018961Y007129D02*
64 | X018961Y007749D01*
65 | X019961Y007749D02*
66 | X019961Y007129D01*
67 | X020961Y007129D02*
68 | X020961Y007749D01*
69 | X021961Y007749D02*
70 | X021961Y007129D01*
71 | X022961Y007129D02*
72 | X022961Y007749D01*
73 | X023961Y007749D02*
74 | X023961Y007129D01*
75 | X024961Y007129D02*
76 | X024961Y007749D01*
77 | X025961Y007749D02*
78 | X025961Y007129D01*
79 | X026961Y007129D02*
80 | X026961Y007749D01*
81 | X027961Y007749D02*
82 | X027961Y007129D01*
83 | X028961Y007129D02*
84 | X028961Y007749D01*
85 | X029961Y007749D02*
86 | X029961Y007129D01*
87 | D12*
88 | X024527Y001681D03*
89 | X022627Y001681D03*
90 | D13*
91 | X020561Y001189D03*
92 | X018561Y001189D03*
93 | X018561Y002189D03*
94 | X020561Y002189D03*
95 | X026656Y002217D03*
96 | X026656Y001217D03*
97 | X011311Y004339D03*
98 | X007311Y004339D03*
99 | X007311Y005939D03*
100 | X011311Y005939D03*
101 | X011311Y007539D03*
102 | X007311Y007539D03*
103 | D14*
104 | X013011Y007939D03*
105 | X015011Y007939D03*
106 | X015011Y003939D03*
107 | X013011Y003939D03*
108 | D15*
109 | X005841Y005447D03*
110 | X005061Y005447D03*
111 | X005061Y006431D03*
112 | X005841Y006431D03*
113 | D16*
114 | X003991Y008309D03*
115 | X003991Y003569D03*
116 | D17*
117 | X032141Y002949D03*
118 | X032141Y002039D03*
119 | X032141Y001129D03*
120 | D18*
121 | X034581Y002039D03*
122 | D19*
123 | X029199Y001209D03*
124 | D20*
125 | X029199Y002209D03*
126 | D21*
127 | X032461Y005439D03*
128 | X033461Y005439D03*
129 | X034461Y005439D03*
130 | X034461Y006439D03*
131 | X033461Y006439D03*
132 | X032461Y006439D03*
133 | D22*
134 | X016711Y001839D02*
135 | X016711Y001139D01*
136 | X015711Y001139D02*
137 | X015711Y001839D01*
138 | X014711Y001839D02*
139 | X014711Y001139D01*
140 | X013711Y001139D02*
141 | X013711Y001839D01*
142 | X012711Y001839D02*
143 | X012711Y001139D01*
144 | X011711Y001139D02*
145 | X011711Y001839D01*
146 | X010711Y001839D02*
147 | X010711Y001139D01*
148 | X009711Y001139D02*
149 | X009711Y001839D01*
150 | X008711Y001839D02*
151 | X008711Y001139D01*
152 | D23*
153 | X005711Y009939D03*
154 | X013661Y009939D03*
155 | X021661Y009939D03*
156 | X029561Y009939D03*
157 | D24*
158 | X030561Y009939D03*
159 | X031561Y009939D03*
160 | X032561Y009939D03*
161 | X033561Y009939D03*
162 | X034561Y009939D03*
163 | X026661Y009939D03*
164 | X025661Y009939D03*
165 | X024661Y009939D03*
166 | X023661Y009939D03*
167 | X022661Y009939D03*
168 | X018661Y009939D03*
169 | X017661Y009939D03*
170 | X016661Y009939D03*
171 | X015661Y009939D03*
172 | X014661Y009939D03*
173 | X010711Y009939D03*
174 | X009711Y009939D03*
175 | X008711Y009939D03*
176 | X007711Y009939D03*
177 | X006711Y009939D03*
178 | M02*
179 |
--------------------------------------------------------------------------------
/gerbers/usb-gamepad.TXT:
--------------------------------------------------------------------------------
1 | %
2 | M48
3 | M72
4 | T01C0.0157
5 | T02C0.0315
6 | T03C0.0320
7 | T04C0.0360
8 | T05C0.0400
9 | T06C0.0440
10 | T07C0.0900
11 | T08C0.1260
12 | %
13 | T01
14 | X13766Y3339
15 | X18061Y3289
16 | X15798Y5556
17 | X17153Y6017
18 | X9361Y5029
19 | X19081Y9520
20 | X24160Y9520
21 | X33382Y1129
22 | T02
23 | X33561Y9939
24 | X32561Y9939
25 | X31561Y9939
26 | X30561Y9939
27 | X29561Y9939
28 | X26661Y9939
29 | X25661Y9939
30 | X24661Y9939
31 | X23661Y9939
32 | X22661Y9939
33 | X21661Y9939
34 | X18661Y9939
35 | X17661Y9939
36 | X16661Y9939
37 | X15661Y9939
38 | X14661Y9939
39 | X13661Y9939
40 | X10711Y9939
41 | X9711Y9939
42 | X8711Y9939
43 | X7711Y9939
44 | X6711Y9939
45 | X5711Y9939
46 | X34561Y9939
47 | T03
48 | X29961Y7439
49 | X28961Y7439
50 | X27961Y7439
51 | X26961Y7439
52 | X25961Y7439
53 | X24961Y7439
54 | X23961Y7439
55 | X22961Y7439
56 | X21961Y7439
57 | X20961Y7439
58 | X19961Y7439
59 | X18961Y7439
60 | X17961Y7439
61 | X16961Y7439
62 | X11311Y7539
63 | X7311Y7539
64 | X7311Y5939
65 | X11311Y5939
66 | X11311Y4339
67 | X7311Y4339
68 | X16961Y4439
69 | X17961Y4439
70 | X18961Y4439
71 | X19961Y4439
72 | X20961Y4439
73 | X21961Y4439
74 | X22961Y4439
75 | X23961Y4439
76 | X24961Y4439
77 | X25961Y4439
78 | X26961Y4439
79 | X27961Y4439
80 | X28961Y4439
81 | X29961Y4439
82 | X29199Y2209
83 | X26656Y2217
84 | X24527Y1681
85 | X22627Y1681
86 | X20561Y1189
87 | X18561Y1189
88 | X18561Y2189
89 | X20561Y2189
90 | X26656Y1217
91 | X29199Y1209
92 | T04
93 | X5841Y5447
94 | X5061Y5447
95 | X5061Y6431
96 | X5841Y6431
97 | T05
98 | X8711Y1489
99 | X9711Y1489
100 | X10711Y1489
101 | X11711Y1489
102 | X12711Y1489
103 | X13711Y1489
104 | X14711Y1489
105 | X15711Y1489
106 | X16711Y1489
107 | X32461Y5439
108 | X33461Y5439
109 | X34461Y5439
110 | X34461Y6439
111 | X33461Y6439
112 | X32461Y6439
113 | T06
114 | X15011Y7939
115 | X13011Y7939
116 | X13011Y3939
117 | X15011Y3939
118 | T07
119 | X3991Y3569
120 | X3991Y8309
121 | T08
122 | X2961Y1489
123 | X2900Y10089
124 | X36761Y10089
125 | X36811Y1489
126 | M30
127 |
--------------------------------------------------------------------------------