Skip to content

Commit

Permalink
neo geo pocket support
Browse files Browse the repository at this point in the history
  • Loading branch information
n-at committed Aug 30, 2023
1 parent f764b2e commit 47d514c
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/img/controller/credits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ https://commons.wikimedia.org/wiki/File:Atari-Jaguar-Controller.jpg
https://commons.wikimedia.org/wiki/File:Atari-Lynx-Flat-Front.jpg
https://commons.wikimedia.org/wiki/File:Xbox-360-S-Controller.jpg
https://commons.wikimedia.org/wiki/File:NEC-TurboGrafx-16-Controller-FL.jpg
https://commons.wikimedia.org/wiki/File:Neo-Geo-Pocket-Color-Blue-Left.jpg
Binary file added assets/img/controller/ngp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/controller/original/ngp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions assets/netplay-ui-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,17 @@
{region: 'right', top: 55, left: -20, input: 0, id:'ii', text: 'II', cls: 'btn-outline-secondary', circle: true},
{region: 'right', top: 55, right: 0, input: 8, id:'i', text: 'I', cls: 'btn-outline-secondary', circle: true},
],
'ngp': [
{region: 'left', top: 0, left: 55, input: 4, id:'up', icon: 'bi-caret-up-fill', cls: 'btn-outline-secondary', square: true},
{region: 'left', top: 110, left: 55, input: 5, id:'down', icon: 'bi-caret-down-fill', cls: 'btn-outline-secondary', square: true},
{region: 'left', top: 55, left: 0, input: 6, id:'left', icon: 'bi-caret-left-fill', cls: 'btn-outline-secondary', square: true},
{region: 'left', top: 55, left: 110, input: 7, id:'right', icon: 'bi-caret-right-fill', cls: 'btn-outline-secondary', square: true},

{region: 'center', top: 105, right: -15, input: 3, id:'option', text: 'option', cls: 'btn-outline-secondary', small: true},

{region: 'right', top: 55, left: -20, input: 0, id:'a', text: 'A', cls: 'btn-outline-secondary', circle: true},
{region: 'right', top: 55, right: 0, input: 8, id:'b', text: 'B', cls: 'btn-outline-secondary', circle: true},
],
'gb': 'nes',
'nds': 'snes',
'sega32x': 'segaMD',
Expand Down
6 changes: 6 additions & 0 deletions storage/core_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ var CoreOptionsBeetlePCE = []CoreOption{
{Id: "pce_ocmultiplier", Name: "pce_ocmultiplier", Variants: "1|2|3|4|5|6|7|8|9|10|20|30|40|50", Default: "1"},
}

var CoreOptionsBeetleNGP = []CoreOption{
{Id: "ngp_language", Name: "ngp_language", Variants: "english|japanese", Default: "english"},
}

func CoreOptionsByCore(core string) []CoreOption {
switch core {
case "fceumm":
Expand Down Expand Up @@ -780,6 +784,8 @@ func CoreOptionsByCore(core string) []CoreOption {
return CoreOptionsParallelN64
case "mednafen_pce":
return CoreOptionsBeetlePCE
case "mednafen_ngp":
return CoreOptionsBeetleNGP
}
return []CoreOption{}
}
Expand Down
38 changes: 38 additions & 0 deletions storage/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ var (
"mame2003",
"arcade",
"pce",
"ngp",
}

Platforms = map[string]Platform{
Expand Down Expand Up @@ -202,6 +203,11 @@ var (
Name: "NEC TurboGrafx-16 / SuperGrafx / PC Engine",
Extensions: []string{"pce"},
},
"ngp": {
Id: "ngp",
Name: "SNK Neo Geo Pocket",
Extensions: []string{"ngp", "ngc"},
},
"": {
Id: "",
Name: "Undefined",
Expand Down Expand Up @@ -232,6 +238,7 @@ var (
"atari7800": {"prosystem"},
"atari2600": {"stella2014"},
"pce": {"mednafen_pce"},
"ngp": {"mednafen_ngp"},
}

Bioses = map[string][]Bios{
Expand Down Expand Up @@ -554,6 +561,7 @@ var (
Description: "Game Express CD Card",
},
},
"ngp": {},
}

//Configuration reference: https://retropie.org.uk/docs/RetroArch-Configuration
Expand Down Expand Up @@ -785,6 +793,16 @@ var (
Right: "arrowright",
}

DefaultControlsNeoGeoPocket = EmulatorControlsMapping{
A: "x", //B
B: "z", //A
Start: "enter", //Option
Up: "arrowup",
Down: "arrowdown",
Left: "arrowleft",
Right: "arrowright",
}

DefaultControlsOther = EmulatorControlsMapping{
B: "x",
Y: "s",
Expand Down Expand Up @@ -1279,6 +1297,26 @@ func DefaultEmulatorSettings(systemType string) EmulatorSettings {
},
},
}

case "ngp":
return EmulatorSettings{
Core: Cores["ngp"][0],
Bios: "",
ColorScheme: DefaultColorScheme,
ColorBackground: DefaultColorBackground,
CacheLimit: DefaultCacheLimit,
Volume: DefaultVolume,
FastForwardRatio: DefaultFastForwardRatio,
SlowMotionRatio: DefaultSlowMotionRatio,
RewindGranularity: DefaultRewindGranularity,
Shader: Shaders[0].Value,
Buttons: DefaultButtons,
Controls: [4]EmulatorControls{
{
Keyboard: DefaultControlsNeoGeoPocket,
},
},
}
}

return EmulatorSettings{}
Expand Down
2 changes: 2 additions & 0 deletions templates/includes/control_scheme/controls_by_platform.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
{% include "../platform_settings/controls/jaguar.twig" with control_template="../control_scheme/control.twig" %}
{% elif platform_id == "pce" %}
{% include "../platform_settings/controls/pce.twig" with control_template="../control_scheme/control.twig" %}
{% elif platform_id == "ngp" %}
{% include "../platform_settings/controls/ngp.twig" with control_template="../control_scheme/control.twig" %}
{% else %}
{# a5200, mame2003, arcade #}
{% include "../platform_settings/controls/default.twig" with control_template="../control_scheme/control.twig" %}
Expand Down
31 changes: 31 additions & 0 deletions templates/includes/platform_settings/controls/ngp.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "../controls_tab.twig" %}

{% block controls_definitions %}
{% set platform_id = platform_id %}
{% set player = player %}
{% set controller_img = "ngp.png" %}
{% set controller_img_alt = "Neo Geo Pocket" %}
{% set control_template = control_template %}
{% endblock %}

{% block controls_keyboard %}
{% include control_template with input="keyboard" btn_id="a" btn_title="A" btn_value=controls.Keyboard.B %}
{% include control_template with input="keyboard" btn_id="b" btn_title="B" btn_value=controls.Keyboard.A %}
{% include control_template with input="keyboard" btn_id="option" btn_title="Option" btn_value=controls.Keyboard.Start %}
{% include control_template with input="keyboard" btn_id="up" btn_title="Up" btn_value=controls.Keyboard.Up %}
{% include control_template with input="keyboard" btn_id="down" btn_title="Down" btn_value=controls.Keyboard.Down %}
{% include control_template with input="keyboard" btn_id="left" btn_title="Left" btn_value=controls.Keyboard.Left %}
{% include control_template with input="keyboard" btn_id="right" btn_title="Right" btn_value=controls.Keyboard.Right %}
{% include "common_keyboard_controls.twig" %}
{% endblock %}

{% block controls_gamepad %}
{% include control_template with input="gamepad" btn_id="a" btn_title="A" btn_value=controls.Gamepad.B %}
{% include control_template with input="gamepad" btn_id="b" btn_title="B" btn_value=controls.Gamepad.A %}
{% include control_template with input="gamepad" btn_id="option" btn_title="Option" btn_value=controls.Gamepad.Start %}
{% include control_template with input="gamepad" btn_id="up" btn_title="Up" btn_value=controls.Gamepad.Up %}
{% include control_template with input="gamepad" btn_id="down" btn_title="Down" btn_value=controls.Gamepad.Down %}
{% include control_template with input="gamepad" btn_id="left" btn_title="Left" btn_value=controls.Gamepad.Left %}
{% include control_template with input="gamepad" btn_id="right" btn_title="Right" btn_value=controls.Gamepad.Right %}
{% include "common_gamepad_controls.twig" %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
{% include "controls/jaguar.twig" with control_template="controls/control.twig" %}
{% elif platform_id == "pce" %}
{% include "controls/pce.twig" with control_template="controls/control.twig" %}
{% elif platform_id == "ngp" %}
{% include "controls/ngp.twig" with control_template="controls/control.twig" %}
{% else %}
{# a5200, mame2003, arcade #}
{% include "controls/default.twig" with control_template="controls/control.twig" %}
Expand Down

0 comments on commit 47d514c

Please sign in to comment.