Skip to content

Commit

Permalink
Launch neo4all menu with Power button
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodanyan committed Aug 7, 2020
1 parent d52f8cd commit 407dcb3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Makefile.rg350
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEO4ALL_OPK_NAME := neo4all_rg350.opk
CHAINPREFIX := /opt/gcw0-toolchain
CROSS_COMPILE := $(CHAINPREFIX)/usr/bin/mipsel-gcw0-linux-uclibc-

Expand Down Expand Up @@ -50,5 +51,5 @@ opk: all
neo4all/neo4all.png \
neo4all/neo4all.man.txt \
neo4all/data \
neo4all/neo4all.opk \
neo4all/$(NEO4ALL_OPK_NAME) \
-all-root -noappend -no-exports -no-xattrs
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ for Dingoo under Dingoo Linux (Dingux). It started life as NeoGeo home emulator
and has now been ported to the Dingoo. Additonal details about this project can be found
at http://chui.dcemu.co.uk/neo4all.html

Moreover, it has now been ported to RG350 handhelds with the creation of neo4all opk file.

2. INSTALLATION
------------
Expand All @@ -14,13 +15,16 @@ Unzip the zip file, and copy the content of the
directory game to your SD card.

Also needs a NeoGeo CD-ROM Bios image file named as 'neocd.bin' at same place than 'neo4all.dge' binary.
For RG350 handhelds, it should be located in: /media/data/local/home/.neo4all/neocd.bin


3. USAGE
------------

Choose NeoGeo CD-ROM disk image (ISOs) at filemanager. Supports ISO/TOC, BIN/CUE, CCD, MDS and SUB image types. But not supports CDDA tracks for now.

It can be launched in command line when the opk is called with the required rom path.


4. DEFAULT CONTROLS
------------
Expand Down
4 changes: 4 additions & 0 deletions neo4all/neo4all.man.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ for Dingoo under Dingoo Linux (Dingux). It started life as NeoGeo home emulator
and has now been ported to the Dingoo. Additonal details about this project can be found
at http://chui.dcemu.co.uk/neo4all.html

Moreover, it has now been ported to RG350 handhelds with the creation of neo4all opk file.

2. INSTALLATION
------------
Expand All @@ -14,13 +15,16 @@ Unzip the zip file, and copy the content of the
directory game to your SD card.

Also needs a NeoGeo CD-ROM Bios image file named as 'neocd.bin' at same place than 'neo4all.dge' binary.
For RG350 handhelds, it should be located in: /media/data/local/home/.neo4all/neocd.bin


3. USAGE
------------

Choose NeoGeo CD-ROM disk image (ISOs) at filemanager. Supports ISO/TOC, BIN/CUE, CCD, MDS and SUB image types. But not supports CDDA tracks for now.

It can be launched in command line when the opk is called with the required rom path.


4. DEFAULT CONTROLS
------------
Expand Down
27 changes: 21 additions & 6 deletions src/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>

#include "../neo4all.h"

#include "../menu/menu.h"
Expand Down Expand Up @@ -56,7 +57,6 @@ extern int menu_moving;

#define SPECIAL 0x01000000


/*--------------------------------------------------------------------------*/
Uint32 keys =~0;
Uint32 keyup [SDLK_LAST];
Expand All @@ -76,6 +76,7 @@ static int input_initted=0;
extern SDLKey menuControl_bt0[];
extern SDLKey menuControl_bt1[];


#ifdef AES
static int input_back_aes_system=-1234;
void input_init_aes_system(int system)
Expand Down Expand Up @@ -483,16 +484,16 @@ INPUT_STATIC_INLINE void keyDown (SDLKey key) {


INPUT_STATIC_INLINE void keyUp (SDLKey key) {
if(!(keyup[key]&SPECIAL)) {
if(!(keyup[key]&SPECIAL)) {

#ifdef DINGOO
if (!pulsando_escape)
#endif
keys |= keyup[key];
}
#ifdef DINGOO
else
if (key==SDLK_ESCAPE)
pulsando_escape=0;
if (key==SDLK_ESCAPE) pulsando_escape=0;
#endif
pulsando_menu=0;
}
Expand Down Expand Up @@ -526,8 +527,22 @@ void processEvents(void) {
update_coin();
while(SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_KEYDOWN: keyDown(event.key.keysym.sym); break;
case SDL_KEYUP: keyUp(event.key.keysym.sym); break;
case SDL_KEYDOWN:
#ifdef RG350
// If Power button is pressing we launch the menu
if (event.key.keysym.sym==SDLK_HOME) {
pulsando_menu = 1;
pulsando_escape = 1;
goMenu();
} else {
keyDown(event.key.keysym.sym);
}
#else
keyDown(event.key.keysym.sym);
#endif //RG350

break;
case SDL_KEYUP: keyUp(event.key.keysym.sym); break;
case SDL_JOYBUTTONDOWN: joyDown(event.jbutton.which, event.jbutton.button); break;
case SDL_JOYBUTTONUP: joyUp(event.jbutton.which, event.jbutton.button); break;
case SDL_JOYAXISMOTION: joyMotion(event.jaxis.which, event.jaxis.axis, event.jaxis.value);
Expand Down
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ int neo4all_load_bios(void)
FILE *fp;
do {
#ifndef RG350
/*sprintf(file, "%s/neocd.bin", neo4all_image_dir);
sprintf(file, "%s/neocd.bin", neo4all_image_dir);
fp = fopen(file, "rb");
if (fp) break;

Expand All @@ -388,10 +388,11 @@ int neo4all_load_bios(void)
console_println();
console_printf("NDA ENV: %s\n", getenv("HOME"));
sprintf(file, "%s/.neo4all/neocd.bin", getenv("HOME"));
if (fp) break;*/
if (fp) break;

fp = fopen("neocd.bin", "rb");
#else
// For RG350 handhelds, this is where it should be located
fp = fopen("/media/data/local/home/.neo4all/neocd.bin", "rb");
#endif //!RG350
if (fp) break;
Expand Down

0 comments on commit 407dcb3

Please sign in to comment.