Official hakchi2 - NES Mini very simple pimp tool

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
Well, I was hunting down a folder navigation memory leak and managed to get clover-kmod to go into freespin in kernel-land (looks like a bad mutex on a Linux API call) instead - it's taking up an entire CPU and the on-TV UI is completely hung (but did not crash out to a c8).

So far, it definitely appears there is a memory leak triggered by folder navigation, completely independent of Kachikachi or Retroarch...it's the UI itself (because, of course, there is no concept of 'folders' in the unhacked UI).

More soon...

Rodney

EDIT: I tried killing off clover-mcp, and was successful, system stayed up with no Nintendo code running. Issued a reboot via terminal, and sure enough, triggered a C2. There is absolutely a relationship between a UI memory leak (likely in ReedPlayer-Clover, which died before clover-mcp and hung the TV display), folder navigation, and the C2.

EDIT2: Bingo! When clover-mcp normally terminates, it must write some sort of check file. If you kill it manually, then reboot, you C2 every time. The Linux OOM killer is taking it out at some point, which triggers the C8, then the C2.

EDIT3: Same thing happens if you kill ReedPlayer-Clover then reboot.

EDIT4: clover-mcp is responsible for the "SHUTTING DOWN" message on reboot...if you kill it, no message. Not sure whether it's ReedPlayer-Clover or clover-mcp that's doing the checkpoint, because killing off either definitely triggers a C2 on restart. I can at least say with some confidence that the fears about droplets being left behind by the RetroArch emulators is unfounded...at least with FCEUMM, you can clearly see the filesystem is quite stable between starts (tested with ~70 attempts in one session).

Unfortunately, until I can cross-compile some debugging tools for this, it's going to be hard to track down any further. Sadly, it would seem very likely at this point that the memory leak is just a knock-on effect of the way the UI is 'manipulated' to achieve folders, being a bug in Nintendo code we have no source to and thus there's nothing that can be effectively done about it. It *might* be possible to reload ReedPlayer-Clover occasionally to mitigate this...we'll see.

EDIT5: Hrm. Any coders have a clue why this would be? It would seem ReedPlayer-Clover *can't* be reloaded, because it's missing a Locale function...but then how the hell does it run to begin with? Some missing environment variable?

Code:
root@CLOVER:~# ReedPlayer-Clover --bootapp=/usr/share/clover-ui --script VOLATILE_SUSPENSION_POINTS_PATH='/var/cache/clover//volatile/' --script PERSISTENT_SUSPENSION_POINTS_PATH='/var/lib/clover/profiles/0/' --script-file /usr/share/legal/licenses.lua --script-file /var/cache/clover//menu.lua --language=en --region=USA
ReedPlayer-Clover --bootapp=/usr/share/clover-ui --script VOLATIL
E_SUSPENSION_POINTS_PATH='/var/cache/clover//volatile/' --script PERSISTENT_SUSP
ENSION_POINTS_PATH='/var/lib/clover/profiles/0/' --script-file /usr/share/legal/
licenses.lua --script-file /var/cache/clover//menu.lua --language=en --region=US
A
Core needs an UTF-8 C locale, we set it to "en_US.UTF-8" instead of "C".
This is a global side-effect and is subject to change, please don't rely on this.
updated hinting sdl game controller
added hinting sdl game controller
added hinting sdl game controller
loaded 44 mappings from /etc/sdl2/gamecontrollerdb.txt
Unimplemented function: 'getUserLocale'!
File: '/home/cis/workspace/Clover-release/dd017d64/output/clover-dp-nes-final/build/nerd-reed-libs-f2d9a762fcd927fcee03a0de68d2cadfad21df45/src/reedframework/localization/reed_localization.cpp'
Line: 169
ReedPlayer: Main exited

This appears to be a missing function 'getUserLocale' which would return the UTF-8 C locale according to the code.

the "volatile" variables would be system-wide variables that would be accessible by reading from the main memory.

As for the memory issue, it's possible that Nintendo just used the reset system to clear the memory since there were only 30 games stored. The way the
folders act is similar in regards to how games are loaded into memory. Thus taking up precious space. It would appear Nintendo never anticipated this many games (or folders)
and by design just had the NES Classic clear the RAM/cache when you turn the system off.

Once Cluster has access to the "live" library this should hopefully shed some light on the subject and what can possibly be done to clear this (thus fixing the problem).

The other idea is to dump the stack when you power off the NES classic. To see if any system methods get called that could lead to a simulation of clearing the memory.
 

TokyoMario

Well-Known Member
Newcomer
Joined
May 1, 2011
Messages
69
Trophies
0
XP
153
Country
What I'm primarily concerned about is the following limits for clover-mcp:

Code:
Limit                     Soft Limit           Hard Limit           Units
Max processes             796                  796                  processes
Max open files            1024                 4096                 files
Max locked memory         65536                65536                bytes

Specifically, max open files seems low - I've seen it grow beyond 725 before a crash.

Will look harder at this particular angle.

Rodney


Do you mean that when it grows beyond 725, clover-mcp goes into a loop? When this happens, you see the crash? Wow. Seems like we are going deeper into the rabbit hole if this is not a RAM problem.
 

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
@pcm720 says "nothing is written to cache until you launch a game". So I'm not sure exactly what is causing it. But it seems like a lot of people have gotten it (and didn't worry about it) or are getting it because of testing/arranging their system. You can fix this by rebooting your system as you've said. So it does seem cache related, but I'm not an expert. pcm720 and clusterm know way more than me. It could be something entirely different. Hopefully we can pinpoint it and solve it. I'd love to have a completely stable system.

I see his point on not writing to cache until a game is launched, however.. I thought when you open a folder it acts in a similar way as opening a ROM (thus writing to cache and using RAM). If this is the case
then it would explain why people browsing the folders are getting a c8 error. Since the RAM is constantly being built up..

just a theory..
 

rhester72

Well-Known Member
Member
Joined
Feb 7, 2016
Messages
187
Trophies
0
Age
52
XP
273
Country
United States
Do you mean that when it grows beyond 725, clover-mcp goes into a loop? When this happens, you see the crash? Wow. Seems like we are going deeper into the rabbit hole if this is not a RAM problem.

I'm not 100% certain that 725 is any sort of magic limit - it's the highest I've been able to observe live, but far higher than I expected (and that it starts off with on the default-30-game menu). It's VERY hard to tell, as I can't get strace compiled statically for this target, so I can't see "under the hood", and I can't find an effective way to force higher limits given the way Hakchi2 works (it's not the same as Nintendo's, and can't be).

Couple all this with the fact that it does indeed literally take hours to get it to a C8 state from cold start, and this becomes a mess to debug. :/

The one thing I *am* certain of is that it's _NOT_ a memory problem. I hit C8 with 125MB of free memory. That's definately not the issue.

Rodney
 

sromeroi

Active Member
Newcomer
Joined
Mar 4, 2017
Messages
42
Trophies
0
Age
45
XP
90
Country
Sorry to ask but is there a easy way or a good guide to install MAME2003 (NeoGeo). I follow the Spanish video but it's don't understand a word and the video is a bit confusing with the steps to follow. :)

This is not mame2003 but FinalBurnAlpha / NeoGeo, but that's what I'm using and works:

INSTALL:

1.- Visit https://github.com/pcm720/retroarch-clover
2.- Download fbalpha2012_neogeo.hmod from core_modules_extra in that repo and the latest retroarch.hmod.
3.- Download libretro_core_template.hmod from that repo
4.- Rename libretro_core_template.hmod as "bios_files.hmod".
5.- Copy bios_files.hmod to your Hakchi2 directory inside "user_mods".
6.- Enter into user_mods/bios_files.hmod/etc/libretro and create a "system" folder.
7.- Copy neogeo.zip file (neogeo bios) inside that folder.
8.- In Hakchi, install both modules (fbalpha2012 and bios_files). I would install also fba and the last retroarch.

ADD GAMES:

1.- Drag the zip file with the game to Hakchi. Example of roms that work for me (ok for testing): cyberlip.zip, mslug.zip, wjammers.zip. Click on "Import as archive".
2.- Edit the path of the game and change /bin/zip with /bin/neo.
3.- Add the game cover.
4.- Flash.
5.- Profit!

Hope this helps, it works for me.
 
Last edited by sromeroi,
  • Like
Reactions: LuckY07

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
INSTALL:

1.- Visit https://github.com/pcm720/retroarch-clover
2.- Download fbalpha2012_neogeo.hmod from core_modules_extra in that repo.
3.- Download libretro_core_template.hmod from that repo.
4.- Rename libretro_core_template.hmod as "bios_files.hmod".
5.- Copy bios_files.hmod to your Hakchi2 directory inside "user_mods".
6.- Enter into user_mods/bios_files.hmod/etc/libretro and create a "system" folder.
7.- Copy neogeo.zip file (neogeo bios) inside that folder.
8.- In Hakchi, install both modules (fbalpha2012 and bios_files). I would install also fba.

ADD GAMES:

1.- Drag the zip file with the game to Hakchi. Example of roms that work for me (ok for testing): cyberlip.zip, mslug.zip, wjammers.zip. Click on "Import as archive".
2.- Edit the path of the game and change /bin/zip with /bin/neo.
3.- Add the game cover.
4.- Flash.
5.- Profit!

Hope this helps, it works for me.

Is this the regular NeoGeo setup?

Quick question.. I thought MAME2003 or anything MAME was for arcade machines?
Is MAME2003 similar to TurboGrafx16 (PCE format)? What does MAME2003 stand for (or represent)?

Also, I assume this method isn't the method where you place the BIOS into a game folder and then the system copies or uses that extension for the other games, right?
 
Last edited by LuckY07,

sromeroi

Active Member
Newcomer
Joined
Mar 4, 2017
Messages
42
Trophies
0
Age
45
XP
90
Country
Is this the regular NeoGeo setup?

Quick question.. I thought MAME2003 or anything MAME was for arcade machines?
Is MAME2003 similar to TurboGrafx16 (PCE format)? What does MAME2003 stand for (or represent)? Thanks.

There are multiple emulators that can run arcade (and/or neogeo) games. I'm using FinalBurn Alpha Neogeo, but you can use also gngeo or MAME (which stands for Multi Arcade Machine Emulator). MAME, as an emulator that supports multiple machines, can also emulate neogeo. Games are in ZIP format because, unlike PCE, games are not a "single file" (game.pce) but a ZIP with multiple "rom chips dumps".

I'm using FBA NEOGEO because... well, it was the first one I tested in the miniNES, it's included in pcm's repository and almost all the games work. The non-NeoGeo arcade games (coin-op games like Shinobi, Golden Axe, etc etc) also work with this emulator using /bin/fba instead of /bin/neo, so I'm just using FBA for all the machines and not using mame2003 at all.

BUT, there are a couple of games that don't work for me (Example: Puyo Puyo). I'll just install mame2003 for those specific games.


It appears everyone here is using Picodrive for Genesis games though. Why is that?

I tested applying shaders to the games (Select+Start -> Quick Menu -> Shaders -> Load Presets -> retroarch.glslp -> Apply -> go back to game). Shaders work in all the emulators I tested EXCEPT FOR genesis_gx. In picodrive they work, so I switched to picodrive :)
 
Last edited by sromeroi,
  • Like
Reactions: LuckY07

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
There are multiple emulators that can run arcade (and/or neogeo) games. I'm using FinalBurn Alpha Neogeo, but you can use also gngeo or MAME (which stands for Multi Arcade Machine Emulator). MAME, as an emulator that supports multiple machines, can also emulate neogeo. Games are in ZIP format because, unlike PCE, games are not a "single file" (game.pce) but a ZIP with multiple "rom chips dumps".

I'm using FBA NEOGEO because... well, it was the first one I tested in the miniNES, it's included in pcm's repository and almost all the games work. The non-NeoGeo arcade games (coin-op games like Shinobi, Golden Axe, etc etc) also work with this emulator using /bin/fba instead of /bin/neo, so I'm just using FBA for all the machines and not using mame2003 at all.

BUT, there are a couple of games that don't work for me (Example: Puyo Puyo). I'll just install mame2003 for those specific games.

Thanks for the reply. I see what you mean about the MAME2003 being able to play NeoGeo.

If I were to use the included module > fbalpha2012_neogeo

What are the steps I would need to take to get NeoGeo working w Hakchi 2.13e?

I've loaded modules and play SNES/Genesis/N64/etc but I'm unsure about NeoGeo since you have to get a BIOS file
and then place that in 1 games folder, which will then be used for the other NeoGeo games.

Is there any instructions for the fbalpha2012_neogeo module? Thanks!
 

maande80

Well-Known Member
Member
Joined
May 30, 2010
Messages
202
Trophies
0
XP
222
Country
Indonesia
Hello everyone! I have two custom folder sets I would like share.

The first set was posted earlier - Custom Nintendo "Dust Sleeve" Folders
View attachment 79133
You can download these here: http://www.filedropper.com/sleevefolders

My second set was recently completed (some images were sourced from the internet and edited to fit the collection) - Custom Gamepad/Controller Custom Folders

View attachment 79134
Download it here: http://www.filedropper.com/controllersv4

Here are the Custom Gamepad Folders in action:
View attachment 79135

Enjoy!

I use your custom folders and love them very much.
If it's not too much to ask, could you please make more with numbers 10 to 20? I put my NES roms alphabetically in A to Z folders, but when there were more than 30 games that worth-keeping in a folder, I had to duplicate the folder into two (e.g. C1: CAB-CON and C2: COS-CRY). Well, that doesn't look neat. Thus I want to place them in number folders instead, but the numbers you made were only until 9. So, maybe... you could continue to make up to number 20 or 30. ;)

Thank you in advance.
 
Last edited by maande80,

sromeroi

Active Member
Newcomer
Joined
Mar 4, 2017
Messages
42
Trophies
0
Age
45
XP
90
Country
Just a question... if anybody is able to use the RetroPie's shader crt-pi.glslp, please let me know how.

The default retroarch.glslp shader looks a bit weird and Kobe46's overlays (scanlines-fade) almost did the trick but I miss crt-pi.glslp...

I copied the files (glslp and glsl) to the Nes with an hmod but when I load them in retroarch nothing changes...

Thanks.
 
  • Like
Reactions: LuckY07

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
You have them 2 replies above my last reply (I already made a quick tutorial! xD).

https://gbatemp.net/threads/hakchi2-nes-mini-very-simple-pimp-tool.456256/page-365#post-7157150

Thanks for the reply.

So to clarify, to run Neo Geo you need some type of fb library, in this case it's fbalpha2012_neogeo? Is this what most people
run? I want to use whatever will play the majority of NeoGeo games, but also want to stick with what everyone here is using.

I guess the reason I'm having this problem is the cores aren't exactly labeled "for NeoGeo" like they are with Genesis/SNES.

What are the major cores used with NeoGeo (in case I ever need a diff one for a game)
 

youngtune27

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
573
Trophies
0
Age
34
XP
200
Country
United States
Thanks for the reply.

So to clarify, to run Neo Geo you need some type of fb library, in this case it's fbalpha2012_neogeo? Is this what most people
run? I want to use whatever will play the majority of NeoGeo games, but also want to stick with what everyone here is using.

I guess the reason I'm having this problem is the cores aren't exactly labeled "for NeoGeo" like they are with Genesis/SNES.

What are the major cores used with NeoGeo (in case I ever need a diff one for a game)
I use fbalphaneo which works fine for both my neo games, metal slug 1 and 2. You can see it below in the pic. Idk what the difference is between that one and the fbalpha2012neo one tho.

--------------------- MERGED ---------------------------

Thanks for the reply.

So to clarify, to run Neo Geo you need some type of fb library, in this case it's fbalpha2012_neogeo? Is this what most people
run? I want to use whatever will play the majority of NeoGeo games, but also want to stick with what everyone here is using.

I guess the reason I'm having this problem is the cores aren't exactly labeled "for NeoGeo" like they are with Genesis/SNES.

What are the major cores used with NeoGeo (in case I ever need a diff one for a game)
It's not an fb library. It's the core that emulates the games.
 

Attachments

  • IMG_0850.PNG
    IMG_0850.PNG
    79.6 KB · Views: 241
Last edited by youngtune27,
  • Like
Reactions: LuckY07

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
I use fbalphaneo which works fine for both my neo games, metal slug 1 and 2. You can see it below in the pic. Idk what the difference is between that one and the fbalpha2012neo one tho.

I'm curious what the difference between the two is, I'll have to look it up. Did you install your Neo Geo setup the same way sromeroi describes above? (by creating a bios file)

I like the way sromeroi's instructions work because it eliminates having to place the bios file in the same folder as the game.

The games I'm looking to play (if it helps) are:
Metal Slug 1
Metal Slug 2
Baseball Stars 2
Turf Masters
Last Blade
 

youngtune27

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
573
Trophies
0
Age
34
XP
200
Country
United States
I'm curious what the difference between the two is, I'll have to look it up. Did you install your Neo Geo setup the same way sromeroi describes above? (by creating a bios file)

I like the way sromeroi's instructions work because it eliminates having to place the bios file in the same folder as the game.

The games I'm looking to play (if it helps) are:
Metal Slug 1
Metal Slug 2
Baseball Stars 2
Turf Masters
Last Blade
no I did not do it the same. I'm still on 2.12 and I don't have any of pcms updated retroarch mods. I still have the first retro released by cluster. Pcm made it to where you can add cores as mods. And keeps updating retroarch. My setup I don't do that. I figured out how to just add cores and change out cores without additional mods. I find it way easier than having to rely on someone else's mods to be what I want. I can just use the .so file. Doesn't need to be hmod. Metal slug 1 and 2 are the only neo games I've gotten or even tried to get. I do have the bios file in each game but it's only 2 games so don't matter to me. I read somewhere ms1 and ms2 use same bios file but the rest of the metal slugs use different. Dunno if that's true.
 
Last edited by youngtune27,

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
no I did not do it the same. I'm still on 2.12 and I don't have any of pcms updated retroarch mods. I still have the first retro released by cluster. Pcm made it to where you can add cores as mods. And keeps updating retroarch. My setup I don't do that. I figured out how to just add cores and change out cores without additional mods. I find it way easier than having to rely on someone else's mods to be what I want. I can just use the .so file. Doesn't need to be hmod. Metal slug 1 and 2 are the only neo games I've gotten or even tried to get. I do have the bios file in each game but it's only 2 games so don't matter to me. I read somewhere ms1 and ms2 use same bios file but the rest of the metal slugs use different. Dunno if that's true.

Ahh, I would just update. The longer you wait the less familiar you will be when it does come time to update. I don't think you will have anything to lose since you can go right back to 2.12 (assuming you made a backup). The C8 errors don't seem to be a big deal or noticeable if you just play 1 game at a time anyways.
 

youngtune27

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
573
Trophies
0
Age
34
XP
200
Country
United States
Ahh, I would just update. The longer you wait the less familiar you will be when it does come time to update. I don't think you will have anything to lose since you can go right back to 2.12 (assuming you made a backup). The C8 errors don't seem to be a big deal or noticeable if you just play 1 game at a time anyways.
I can't. 2.12 right now is everything I need. I don't get errors. Usually have around 317mb and no problems. All this compression stuff I don't need either. In 3 years when better core versions are out I can just swap them out in 2 min.
 

LuckY07

Well-Known Member
Member
Joined
Mar 6, 2017
Messages
172
Trophies
0
Age
42
XP
103
Country
United States
I can't. 2.12 right now is everything I need. I don't get errors. Usually have around 317mb and no problems. All this compression stuff I don't need either. In 3 years when better core versions are out I can just swap them out in 2 min.

I hear you. I'm trying to keep my setup > NES (670 games, 30 games a subfolder), SNES (top 45 games, split into 2 folders), N64 (3 games no sub folders), and TurboGrafx16 (Top 20 all in 1 folder).

I just want to add some Neo Geo, possibly some arcade titles and I think I'm pretty much done. The N64 doesn't run that great so I was even contemplating removing those titles.. but it's still cool just to have 1 or 2.
 

youngtune27

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
573
Trophies
0
Age
34
XP
200
Country
United States
I hear you. I'm trying to keep my setup > NES (670 games, 30 games a subfolder), SNES (top 45 games, split into 2 folders), N64 (3 games no sub folders), and TurboGrafx16 (Top 20 all in 1 folder).

I just want to add some Neo Geo, possibly some arcade titles and I think I'm pretty much done. The N64 doesn't run that great so I was even contemplating removing those titles.. but it's still cool just to have 1 or 2.
It gets tricky tryIng to get everything to sync. I had to have ms1 in its own main neo geo folder and it had to sync first. Then I had to have ms2 in its own neo geo folder and it had to sync last "6th". 64 doesn't work great so it's not worth it so I took it off. I have 677 nes. 19 snes 10 genesis 5 gba and 2 neo.
 

Kobe46

Well-Known Member
Newcomer
Joined
Jul 23, 2006
Messages
94
Trophies
0
XP
273
Country
Canada
Just a question... if anybody is able to use the RetroPie's shader crt-pi.glslp, please let me know how.

The default retroarch.glslp shader looks a bit weird and Kobe46's overlays (scanlines-fade) almost did the trick but I miss crt-pi.glslp...

I copied the files (glslp and glsl) to the Nes with an hmod but when I load them in retroarch nothing changes...

Thanks.

I can take a look at this to see if the shaders can be applied properly. I found a bunch here, can you confirm if the shader you used is in this listing?
https://github.com/RetroPie/common-shaders/tree/rpi

If so I can do some tests or look at the shader themselves to see if there is something in it that needs to be edited.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Sorry I let @HiradeGirl get into my alcohol