Skip to content

Commit 91392c2

Browse files
committed
Joypad mapping through core options, cleanups
1 parent 7607093 commit 91392c2

File tree

4 files changed

+187
-183
lines changed

4 files changed

+187
-183
lines changed

src/libretro/b2_libretro.info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ display_name = "Acorn - BBC Micro (b2)"
88
categories = "Emulator"
99

1010
# Name of the authors who wrote the core:
11-
authors = "TBA"
11+
authors = "Tom Seddon|Zoltan Balogh"
1212

1313
# Name of the core:
1414
corename = "b2"
@@ -17,7 +17,7 @@ corename = "b2"
1717
supported_extensions = "ssd|dsd"
1818

1919
# License of the cores source code:
20-
license = "GPLv2"
20+
license = "GPLv3"
2121

2222
# Privacy-specific permissions needed for using the core:
2323
permissions = ""
@@ -47,7 +47,7 @@ savestate_features = "serialized"
4747
# Does the core support the libretro cheat interface?
4848
cheats = "false"
4949
# Does the core support libretro input descriptors
50-
input_descriptors = "true"
50+
input_descriptors = "false"
5151
# Does the core support memory descriptors commonly used for achievements
5252
memory_descriptors = "false"
5353
# Does the core use the libretro save interface or does it do its own thing (like with shared memory cards)?
@@ -76,4 +76,4 @@ disk_control = "true"
7676
is_experimental = "true"
7777

7878
# Descriptive text, useful for tooltips, etc.
79-
description = "Emulate the Z80 based home computers that the original ep128emu supports - that is, Enterprise 64/128, Videoton TVC, Amstrad CPC and ZX Spectrum. Focus is on Enterprise and TVC."
79+
description = "Libretro port of Tom Seddon's B2 emulator for BBC Micro."

src/libretro/b2_libretro_keymap.h

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,108 @@ const std::map<unsigned, BeebKey> beeb_libretro_keymap = {
112112
// TODO: map the 3 extra keypad keys on the Master somewhere (delete, ', #)
113113
};
114114

115+
const std::map<std::string, BeebKey> joypad_keymap = {
116+
// None is added separately in the code, since it should be the first and default
117+
// {"None", BeebKey_None},
118+
{"a", BeebKey_A},
119+
{"b", BeebKey_B},
120+
{"c", BeebKey_C},
121+
{"d", BeebKey_D},
122+
{"e", BeebKey_E},
123+
{"f", BeebKey_F},
124+
{"g", BeebKey_G},
125+
{"h", BeebKey_H},
126+
{"i", BeebKey_I},
127+
{"j", BeebKey_J},
128+
{"k", BeebKey_K},
129+
{"l", BeebKey_L},
130+
{"m", BeebKey_M},
131+
{"n", BeebKey_N},
132+
{"o", BeebKey_O},
133+
{"p", BeebKey_P},
134+
{"q", BeebKey_Q},
135+
{"r", BeebKey_R},
136+
{"s", BeebKey_S},
137+
{"t", BeebKey_T},
138+
{"u", BeebKey_U},
139+
{"v", BeebKey_V},
140+
{"w", BeebKey_W},
141+
{"x", BeebKey_X},
142+
{"y", BeebKey_Y},
143+
{"z", BeebKey_Z},
144+
{"Space", BeebKey_Space},
145+
{"0", BeebKey_0},
146+
{"1", BeebKey_1},
147+
{"2", BeebKey_2},
148+
{"3", BeebKey_3},
149+
{"4", BeebKey_4},
150+
{"5", BeebKey_5},
151+
{"6", BeebKey_6},
152+
{"7", BeebKey_7},
153+
{"8", BeebKey_8},
154+
{"9", BeebKey_9},
155+
{"Cursor up",BeebKey_Up},
156+
{"Cursor down",
157+
BeebKey_Down},
158+
{"Cursor left",
159+
BeebKey_Left},
160+
{"Cursor right",
161+
BeebKey_Right},
162+
{"; (semicolon)",
163+
BeebKey_Semicolon},
164+
{": (colon)", BeebKey_Colon},
165+
{"]", BeebKey_RightSquareBracket},
166+
{", (comma)",BeebKey_Comma},
167+
{". (dot)", BeebKey_Stop},
168+
{"/", BeebKey_Slash},
169+
{"F0", BeebKey_f0},
170+
{"F1", BeebKey_f1},
171+
{"F2", BeebKey_f2},
172+
{"F3", BeebKey_f3},
173+
{"F4", BeebKey_f4},
174+
{"F5", BeebKey_f5},
175+
{"F6", BeebKey_f6},
176+
{"F7", BeebKey_f7},
177+
{"F8", BeebKey_f8},
178+
{"F9", BeebKey_f9},
179+
{"Break", BeebKey_Break},
180+
{"Escape", BeebKey_Escape},
181+
{"- (minus)",BeebKey_Minus},
182+
{"=", BeebKey_Caret},
183+
{"\\ (backslash)",
184+
BeebKey_Backslash},
185+
{"Tab", BeebKey_Tab},
186+
{"@", BeebKey_At},
187+
{"[", BeebKey_LeftSquareBracket},
188+
{"_ (underline)",
189+
BeebKey_Underline},
190+
{"Ctrl", BeebKey_Ctrl},
191+
{"Return", BeebKey_Return},
192+
{"Shift", BeebKey_Shift},
193+
{"Caps Lock",BeebKey_CapsLock},
194+
{"Shift Lock",BeebKey_ShiftLock},
195+
{"Delete", BeebKey_Delete},
196+
{"Copy", BeebKey_Copy},
197+
// Keypad not added until BBC Master support is implemented/tested
198+
};
199+
200+
const std::map<std::string, unsigned> joypad_buttonmap = {
201+
{"Up", RETRO_DEVICE_ID_JOYPAD_UP},
202+
{"Down", RETRO_DEVICE_ID_JOYPAD_DOWN},
203+
{"Left", RETRO_DEVICE_ID_JOYPAD_LEFT},
204+
{"Right", RETRO_DEVICE_ID_JOYPAD_RIGHT},
205+
{"A", RETRO_DEVICE_ID_JOYPAD_A},
206+
{"B", RETRO_DEVICE_ID_JOYPAD_B},
207+
{"X", RETRO_DEVICE_ID_JOYPAD_X},
208+
{"Y", RETRO_DEVICE_ID_JOYPAD_Y},
209+
{"Select",RETRO_DEVICE_ID_JOYPAD_SELECT},
210+
{"Start", RETRO_DEVICE_ID_JOYPAD_START},
211+
{"L", RETRO_DEVICE_ID_JOYPAD_L},
212+
{"R", RETRO_DEVICE_ID_JOYPAD_R},
213+
{"L2", RETRO_DEVICE_ID_JOYPAD_L2},
214+
{"R2", RETRO_DEVICE_ID_JOYPAD_R2},
215+
{"L3", RETRO_DEVICE_ID_JOYPAD_L3},
216+
{"R3", RETRO_DEVICE_ID_JOYPAD_R3},
217+
};
218+
115219
#endif

0 commit comments

Comments
 (0)