3 * (C) 2018 by Andreas Eversberg <jolly@eversberg.eu>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 static int joystick_left = 0;
26 static int joystick_right = 0;
27 static int joystick_up = 0;
28 static int joystick_down = 0;
29 static int joystick_fire = 0;
31 #define CIAAPRA 0xbfe000
32 #define JOYDAT1 0xdff00c
34 uint16_t emulate_joystick_read(uint32_t address)
36 if (address == CIAAPRA) {
42 if (address == JOYDAT1) {
43 uint16_t joydat = 0x0000;
46 /* make bit 0 and 1 equal */
50 /* make bit 0 and 1 odd */
56 /* make bit 8 and 9 equal */
60 /* make bit 8 and 9 odd */
70 /* use -1 to keep state unchanged */
71 void set_joystick(int left, int right, int up, int down, int fire)
76 joystick_right = right;