Skip to content

Commit

Permalink
1.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
seleuco committed Mar 29, 2024
1 parent e13ffe3 commit d10d03b
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 55 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAME4droid-2024

MAME4droid 2024 is developed by David Valdeita (Seleuco) as a port of the MAME 0.263 emulator by MAMEDev and contributors. It emulates arcade games and systems like ZX Spectrum, Amstrad CPC, MSX etc. This version of MAME support over 40000 different ROMs.
MAME4droid 2024 is developed by David Valdeita (Seleuco) as a port of the MAME 0.264 emulator by MAMEDev and contributors. It emulates arcade games and systems like ZX Spectrum, Amstrad CPC, MSX etc. This version of MAME support over 40000 different ROMs.

* MAME4droid is an EMULATOR and DOES NOT INCLUDE ROMS OR COPYRIGHTED MATERIAL OF ANY KIND.

Expand All @@ -14,7 +14,7 @@ With over 40000 games and system supported, some games will run better than othe

After installing, place your MAME-titled zipped ROMs in /storage/emulated/0/Android/data/com.seleuco.mame4d2024/files/roms folder (Read the help to see other possibilities for reading your ROMs).

This MAME4droid version uses only '0.263' romset.
This MAME4droid version uses only '0.264' romset.

FEATURES
========
Expand Down
4 changes: 2 additions & 2 deletions android-MAME4droid/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.seleuco.mame4d2024"
minSdkVersion 29
targetSdkVersion 34
versionCode 44
versionName '1.10.3'
versionCode 49
versionName '1.11.1'
setProperty("archivesBaseName", "MAME4droid 2024-$versionName")
ndk {
moduleName "mame4droid-jni"
Expand Down
1 change: 0 additions & 1 deletion android-MAME4droid/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<uses-feature android:name="android.hardware.gamepad" android:required="true" />
-->

<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.gamepad" android:required="false" />

<application android:icon="@mipmap/ic_launcher" android:label="@string/app_name"
Expand Down
1 change: 1 addition & 0 deletions android-MAME4droid/app/src/main/assets/changelog.htm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ <h3>MAME4droid CHANGELOG<br>
<ul>

</li>
<li><b>2024-03-26 Version 1.11 </b><br/>Updated to MAME 0.264. Improved haptics. Added BSP-D8 controller support. Added some new nogeo shaders.</li>
<li><b>2024-02-28 Version 1.10 </b><br/>Updated to MAME 0.263. Improved SAF support for MESS software media. Added right stick and analog triggers support to generic controllers</li>
<li><b>2024-02-09 Version 1.9 </b><br/>Added media scraping thanks to Arcade Database by motoschifo. Added MAME meta data resources thanks to Arcade History, MAME info and progetto-SNAPS</li>
<li><b>2024-01-31 Version 1.8 </b><br/>Updated to MAME 0.262. Added two small additional buttons so they can be configured through the input macro plugin for fighting games. Added touch controller transparency selectable</li>
Expand Down
2 changes: 1 addition & 1 deletion android-MAME4droid/app/src/main/assets/credits.htm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1 class="title">Credits</h1>
<h3>MAME4droid</h3>
<ul>
<li>MAME4droid by David Valdeita (<a class="link" href="mailto:seleuco.nicator@gmail.com" target="new">Seleuco</a>)</li>
<li>MAME 0.263 original version by MAMEDev and contributors.</li>
<li>MAME 0.264 original version by MAMEDev and contributors.</li>
<li>Art by Bryn Thompson.</li>
</ul>
<h3>Acknowledgments</h3>
Expand Down
2 changes: 1 addition & 1 deletion android-MAME4droid/app/src/main/assets/games.htm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 class="title">Supported Games</h1>
<div class="content">
<h3>Supported Games<br>
</h3>
<p>MAME4droid 2024 uses game ROMs from the MAME '0.263' ROM set (February 2024). Note: This is different than the ROMs used in <em>MAME4droid (0.139u1)</em>. These ROMs cannot be used interchangeably.</p>
<p>MAME4droid 2024 uses game ROMs from the MAME '0.264' ROM set (March 2024). Note: This is different than the ROMs used in <em>MAME4droid (0.139u1)</em>. These ROMs cannot be used interchangeably.</p>
<h3>ROM Location and Naming Convention</h3>
<p>ROMs should be placed in the &quot;roms&quot; folder of your MAME4droid installation folder. In a default install of MAME4droid, this path is <em>/storage/emulated/0/Android/data/ com.seleuco.mame4d2024/files/roms</em>. You should copy your roms from a PC using the Android Debug Bridge (ADB) tool</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);

}
mm.showDialog(DialogHelper.DIALOG_INFO);
}
Expand Down Expand Up @@ -821,8 +821,8 @@ public void showHelp() {
mm.getDialogHelper()
.setInfoMsg(
"When MAME4droid is first run, it will create a folder structure for you on the internal memory of your Android device. This folder contains all the other folders MAME uses as well as some basic configuration files."
+ "Since MAME4droid does not come with game ROM files, you will need to copy them to the selected or '/storage/emulated/0/Android/media/com.seleuco.mame4d2024/roms' folder (" +
"the one that applies) yourself. These should be properly named, ZIPped MAME v0.263 ROMs files with the filenames in all lower case.\n\nImportant: You should define or map your Android TV game controller on 'options/settings/input/External controller/define Keys' to avoid this help screen constantly showing if the controller is not auto detected.\n\n"
+ "Since MAME4droid does not come with game ROM files, you will need to copy them to (You can change it in options to external storage if your device allows it) '/storage/emulated/0/Android/media/com.seleuco.mame4d2024/roms' folder (" +
"the one that applies) yourself. These should be properly named, ZIPped MAME v0.264 ROMs files with the filenames in all lower case.\n\nImportant: You should define or map your Android TV game controller on 'options/settings/input/External controller/define Keys' to avoid this help screen constantly showing if the controller is not auto detected.\n\n"
+ "Controls: Buttons A,B,C,D,E,F on the controller map to buttons Button MAME 1 to 6 buttons."
+ " Coin button inserts coin/adds credit.START button starts 1P game. A+START is fast forward. B+START is toggle UI controls. START+A+B is service mode. SELECT+A+B is soft reset. Use SELECT(coin) or START for UI navigation."
+ "R1 + START loads a save state. L1 + START saves a save state. START + SELECT when gaming accesses the game's MAME menu (dip switches, etc)...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public class PrefsHelper implements OnSharedPreferenceChangeListener {
final static public String PREF_DEFINED_CONTROL_LAYOUT_P = "PREF_DEFINED_CONTROL_LAYOUT_P";

final static public String PREF_DISABLE_RIGHT_STICK = "PREF_DISABLE_RIGHT_STICK";
final static public String PREF_CONTROLLER_DISABLE_BUTTONS_IN_FRONTEND = "PREF_CONTROLLER_DISABLE_BUTTONS_IN_FRONTEND";
final static public String PREF_CONTROLLER_DISABLE_BUTTONS_IN_GAME = "PREF_CONTROLLER_DISABLE_BUTTONS_IN_GAME";

final static public String PREF_ANIMATED_INPUT = "PREF_ANIMATED_INPUT";
final static public String PREF_TOUCH_LIGHTGUN = "PREF_TOUCH_LIGHTGUN";
final static public String PREF_TOUCH_LIGHTGUN_FORCE = "PREF_TOUCH_LIGHTGUN_FORCE";
Expand Down Expand Up @@ -368,6 +371,14 @@ public boolean isDisabledRightStick() {
return getSharedPreferences().getBoolean(PREF_DISABLE_RIGHT_STICK, false);
}

public boolean isDisabledAllButtonsInFronted() {
return getSharedPreferences().getBoolean(PREF_CONTROLLER_DISABLE_BUTTONS_IN_FRONTEND, false);
}

public boolean isDisabledAllButtonsInGame() {
return getSharedPreferences().getBoolean(PREF_CONTROLLER_DISABLE_BUTTONS_IN_GAME, false);
}

public boolean isAnimatedInput() {
return getSharedPreferences().getBoolean(PREF_ANIMATED_INPUT, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ public class GameController implements IController {
};

public static int[] defaultKeyMapping = {
KeyEvent.KEYCODE_DPAD_UP,
KeyEvent.KEYCODE_DPAD_DOWN,
KeyEvent.KEYCODE_DPAD_LEFT,
KeyEvent.KEYCODE_DPAD_RIGHT,
KeyEvent.KEYCODE_BUTTON_B,
KeyEvent.KEYCODE_BUTTON_A,
KeyEvent.KEYCODE_BUTTON_X,
KeyEvent.KEYCODE_BUTTON_Y,
KeyEvent.KEYCODE_BUTTON_L1,
KeyEvent.KEYCODE_BUTTON_R1,
KeyEvent.KEYCODE_BUTTON_L2,
KeyEvent.KEYCODE_BUTTON_R2,
KeyEvent.KEYCODE_BUTTON_THUMBR ,
KeyEvent.KEYCODE_BUTTON_THUMBL,
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_DPAD_UP),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_DPAD_DOWN),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_DPAD_LEFT),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_DPAD_RIGHT),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_B),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_A),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_X),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_Y),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_L1),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_R1),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_L2),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_R2),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_THUMBR),
makeKeyCodeWithDeviceID(1,KeyEvent.KEYCODE_BUTTON_THUMBL),
KeyEvent.KEYCODE_BACK,
KeyEvent.KEYCODE_MENU,
//////
Expand Down Expand Up @@ -1300,6 +1300,27 @@ else if (name.contains("X-Box") || name.contains("Xbox")) {
detected = true;

desc = "NYKO PLAYPAD";
} else if (name.contains("BSP-D8")) {


deviceMappings[KeyEvent.KEYCODE_BUTTON_A][id] = B_VALUE;
deviceMappings[KeyEvent.KEYCODE_BUTTON_B][id] = A_VALUE;
deviceMappings[KeyEvent.KEYCODE_BUTTON_X][id] = C_VALUE;
deviceMappings[KeyEvent.KEYCODE_BUTTON_Y][id] = D_VALUE;

mapDPAD(id);
mapL1R1(id);
mapTHUMBS(id);

//mapSelectStart(id);
deviceMappings[KeyEvent.KEYCODE_BUTTON_SELECT][id] = OPTION_VALUE ;
deviceMappings[KeyEvent.KEYCODE_BUTTON_START][id] = EXIT_VALUE;

deviceMappings[KeyEvent.KEYCODE_BACK][id] = EXIT_VALUE;

desc = "BSP-D8";

detected = true;
}

//JOYPAD_B = X_VALUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.view.MotionEvent;

Expand All @@ -66,7 +68,7 @@ public class TouchController implements IController {

static final int MAX_FINGERS = 20;

final byte vibrate_time = 1;//16;
//final byte vibrate_time = 1;//16;

protected static int[] newtouches = new int[MAX_FINGERS];
protected static int[] oldtouches = new int[MAX_FINGERS];
Expand Down Expand Up @@ -429,12 +431,8 @@ public void handleImageStates(boolean onlyStick, int [] digital_data) {
//System.out.println("CAMBIA STICK! "+stick_state+" != "+old_stick_state+" "+iv.getRect()+ " "+iv.getOrigRect()+" "+values.size()+" POS:"+j+ " "+onlyStick+ " "+this);
mm.getInputView().invalidate(iv.getRect());
}
if (pH.isVibrate()) {
try {
Vibrator v = (Vibrator) mm.getSystemService(Context.VIBRATOR_SERVICE);
if (v != null) v.vibrate(vibrate_time);
} catch (Exception ignored) {
}
if (pH.isVibrate() && stick_state != STICK_NONE) {
vibrate();
}
old_stick_state = stick_state;
}
Expand All @@ -447,12 +445,8 @@ public void handleImageStates(boolean onlyStick, int [] digital_data) {
else
mm.getInputView().invalidate(iv.getRect());
}
if (pH.isVibrate()) {
try {
Vibrator v = (Vibrator) mm.getSystemService(Context.VIBRATOR_SERVICE);
if (v != null) v.vibrate(vibrate_time);
} catch (Exception ignored) {
}
if (pH.isVibrate() && stick_state != STICK_NONE) {
vibrate();
}
old_stick_state = stick_state;
}
Expand All @@ -464,12 +458,8 @@ public void handleImageStates(boolean onlyStick, int [] digital_data) {
if (btnStates[iv.getValue()] != old_btnStates[iv.getValue()]) {
if (pH.isAnimatedInput())
mm.getInputView().invalidate(iv.getRect());
if (pH.isVibrate()) {
try {
Vibrator v = (Vibrator) mm.getSystemService(Context.VIBRATOR_SERVICE);
if (v != null) v.vibrate(15);
} catch (Exception ignored) {
}
if (pH.isVibrate() && btnStates[i] == BTN_PRESS_STATE) {
vibrate();
}
old_btnStates[iv.getValue()] = btnStates[iv.getValue()];
}
Expand Down Expand Up @@ -518,6 +508,15 @@ else if(type == TouchController.TYPE_BUTTON_IMG || type == TouchController.TYPE
handle = true;
}
else {

if(mm.getPrefsHelper().isDisabledAllButtonsInFronted() &&
mm.getInputHandler().getGameController().isEnabled() && !Emulator.isInGame() )
return false;

if(mm.getPrefsHelper().isDisabledAllButtonsInGame() &&
mm.getInputHandler().getGameController().isEnabled() && Emulator.isInGame() )
return false;

handle = true;
int n;
if (mm.getInputHandler().isHideTouchController() ||
Expand All @@ -527,23 +526,13 @@ else if(type == TouchController.TYPE_BUTTON_IMG || type == TouchController.TYPE
n = 0;
} else if (Emulator.isSaveorload()) {
n = 5;
/*if(mm.getPrefsHelper().getNumButtons() > 4)
n = 5;
else
n = 4;*/
}else if (!Emulator.isInGame() ){
if(mm.getPrefsHelper().getNumButtons() > 2)
n = mm.getPrefsHelper().getNumButtons();
else if(mm.getPrefsHelper().isHideStick())
n = 0;
else
n = 2;
//n=6;//all buttons
/*} else if(Emulator.isInGame() && Emulator.isInMenu()){
if(mm.getPrefsHelper().getNumButtons() > 2)
n = mm.getPrefsHelper().getNumButtons();
else
n = 2;*/
} else {
n = mm.getPrefsHelper().getNumButtons();
if (n == -1) {
Expand All @@ -552,7 +541,10 @@ else if(mm.getPrefsHelper().isHideStick())
else if (n <= 4) n = 4;
else n = 6;
}
if(Emulator.isInMenu() && n < 2)
n = 2;
}

int b = v.getValue();
if (b == IController.BTN_D && n < 4) handle=false;
if (b == IController.BTN_C && n < 3) handle=false;
Expand Down Expand Up @@ -736,4 +728,11 @@ protected void readInputValues(int id, ArrayList<InputValue> values) {
}
}

protected void vibrate() {
Vibrator vibrator = (Vibrator) mm.getSystemService(Context.VIBRATOR_SERVICE);
if (vibrator == null) return;
vibrator.vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK));
//vibrator.vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_TICK));
//vibrator.vibrate(VibrationEffect.createOneShot(1L, 180));
}
}
Binary file modified android-MAME4droid/app/src/main/res/raw/files.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion android-MAME4droid/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<string name="menu_quit">Exit App</string>
<string name="app_name">MAME4droid 2024</string>
<string name="don_t_bother">Don\'t ask again</string>
<string name="mame_version">0.263</string>
<string name="mame_version">0.264</string>
</resources>

9 changes: 9 additions & 0 deletions android-MAME4droid/app/src/main/res/xml/userpreferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,18 @@
android:title="Return always same controller ID" android:summary="If you enable this option, multi controller support will be disabled and will always returned the same device ID when you define your controller. This is useful to persist configuration on controllers or keyboards which lose their mappings when you disconnect and connect again"
android:defaultValue="false" />

<!--
<CheckBoxPreference android:key="PREF_DISABLE_RIGHT_STICK"
android:title="Disable right stick" android:summary="Disable right stick when controller is autodetected"
android:defaultValue="false" android:dependency="PREF_CONTROLLER_AUTODETECT"/>
-->
<CheckBoxPreference android:key="PREF_CONTROLLER_DISABLE_BUTTONS_IN_FRONTEND"
android:title="Hide all buttons in frontend" android:summary="Disable all buttons in frontend when a controller is detected and is full screen"
android:defaultValue="false"/>

<CheckBoxPreference android:key="PREF_CONTROLLER_DISABLE_BUTTONS_IN_GAME"
android:title="Hide all buttons in game" android:summary="Disable all buttons in game when a controller is detected and is full screen"
android:defaultValue="false"/>

<ListPreference
android:entries="@array/pref_dz_options"
Expand Down
5 changes: 4 additions & 1 deletion src/osd/myosd/myosd.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ class my_osd_interface : public osd_interface, osd_output
virtual bool execute_command(const char *command) override {return true;}

// midi interface
virtual std::unique_ptr<osd_midi_device> create_midi_device() override {return nullptr;}
//virtual std::unique_ptr<osd_midi_device> create_midi_device() override {return nullptr;}
virtual std::unique_ptr<osd::midi_input_port> create_midi_input(std::string_view name) override {return nullptr;}
virtual std::unique_ptr<osd::midi_output_port> create_midi_output(std::string_view name)override {return nullptr;}


// osd_output
virtual void output_callback(osd_output_channel channel, const util::format_argument_pack<char> &args) override;
Expand Down

0 comments on commit d10d03b

Please sign in to comment.