Closed leiradel closed 5 years ago
So the question is whats wrong with old method, it was working fine, and did make it usable for the most important arcade system.
@salvadorc17 answer here.
In no-meminspector-log.txt i see :
Moved recent file 0 to front "mslugx" - 13 - 27 Registered 0 bytes at 0x00000000 Installed 0 bytes at 0x00000000
Does that mean the core is reporting a size of 0 with a buffer filled with 0 ? If so then either my conditions are wrong (which would be weird, that kind of condition is all over the code), or retro_get_memory_data/retro_get_memory_size are called before the game is initialized (which is done in retro_load_game) CPS1/CPS2 are also reporting a size of 0 with a buffer filled with 0 ?
It's called after load game but before the first retro_run, so maybe it's an empty buffer at frame 0?
@barbudreadmon
CPS1/CPS2 are also reporting a size of 0 with a buffer filled with 0 ?
I think yes. Check the log: nocrash-cps1-log.txt
EDIT: by the way, the Moved recent file 0 to front "mslugx" - 13 - 27
is just saying that this game was added to the recently loaded files menu. The 0
is because my "history" was empty.
It's also called after retro_load_game
but before retro_run
in RALibretro.
Yes the API indicates it must be called before the first retro_run call
@fr500 even if the buffer is empty at frame 0, retro_get_memory_size should report a size of 0x00010000
if my nHardwareFlag == HARDWARE_SNK_NEOGEO
condition is true.
This is a problem for CPS1 and CPS2:
src/burner/libretro/libretro.cpp: In function 'void* retro_get_memory_data(unsigned int)':
src/burner/libretro/libretro.cpp:1847:24: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
return (state_ptr + offset);
^~~~~~
I'm testing Neo Geo now.
nHardwareFlag
has a bogus value of -2063532032 so it fails all the if
s:
Moved recent file 0 to front "mslug" - 13 - 27
retro_get_memory_size -2063532032
retro_get_memory_data -2063532032
retro_get_memory_size -2063532032
Registered 0 bytes at 0x00000000
Installed 0 bytes at 0x00000000
retro_get_memory_size -2063532032
The value in hexadecimal is 0x85010000
. 0x85000000
doesn't correspond to any prefix in burn.h
so BurnDrvGetHardwareCode
is returning an invalid value in retro_get_memory_data/size
.
Yeah, i noticed and was working on it, seems like some system actually needs something like (nHardwareCode & (HARDWARE_PUBLIC_MASK - HARDWARE_PREFIX_CARTRIDGE))
instead of (nHardwareCode & HARDWARE_PUBLIC_MASK)
, neogeo was one of them.
My last commit should fix both issues, i hope RA will work now.
Also, The Punisher is returning HARDWARE_CAPCOM_CPS1_QSOUND
, so maybe we need a mask of 0x7F000000
?
Now i found cause of issue, memory data is added but never updated. So this method will not work because is not updating the reported ram. With the previous method it worked because the run functions was allowing that for each driver.
Ok, what about the new one ?
@barbudreadmon your last commit makes RALibretro "freeze" right after loading a game.
Here are the logs:
CPS1: cps1-freeze-log.txt
NeoGeo: neogeo-freeze-log.txt
I'll only be able to test later today, but mainram_ptr
is initialized to NULL
at the top of burn_get_mainram_ptr_cb
, and then memcpy(mainram_ptr, pba->Data, pba->nLen)
is executed just below. This will cause a crash, or am I missing something?
Also, even if mainram_ptr
points to a block of memory at least the size of pba->nLen
, won't we get a copy of the System RAM, frozen in time at the instant memcpy
is executed?
He, I've just seen @meleu 's comment. Yeah, I believe it's the issue with mainram_ptr
.
What about now ?
@barbudreadmon @leiradel
https://www.youtube.com/watch?v=MdN0NXgjsn8
EDIT: in other words, yes!! it's working fine now!!!
@meleu Even the previous achievements from mslugx work ?
didn't check trying to earn them. I only checked the addresses and they seem to be fine. will make more tests later.
@barbudreadmon good news: yeah, it's working as expected!! Huge thanks for that!
Look the latest fbalpha commit hash on the bottom left "signature":
@meleu everything is ok in RALibretro too, right?
@leiradel yep yep. RALibretro is running fine with fbalpha 8eabf37
@meleu @leiradel Nice, i'll make some changes to how size is handled this evening (i'll retrieve it from pba->nLen
in burn_get_mainram_ptr_cb, it will make the code in retro_get_memory_size simpler).
Awsome @barbudreadmon let us know when the changes are in so we can test again.
Should we keep this issue open as new drivers get support for achievements, or should we open one issue for each driver the community asks for achievements support?
Let me know if my changes broke something. I guess we can keep this issue open for future request.
Also removed the cast to UINT8 now that we don't need arithmetic anymore.
I'm going to make some tests now.
I did one last change, it doesn't seem to me like BurnAreaScan
was needed again in retro_get_memory_data
as long as it is called once in fba_init
@barbudreadmon I've launched a bunch of games, for Neo Geo, CPS1, CPS2 and CPS3.
Neo Geo, CPS-1 and CPS-2 are running 100% fine.
CPS-3 is fine but when I open the Memory Inspector RALibretro crashes. Here are the crash logs:
playing "Street Fighter III: 3rd Impact" and then open Memory Inspector: cps3-sfiii3-freeze-meminspector-log.txt
playing "JoJo's Bizarre Adventure" and then open Memory Inspector: cps3-jojoba-crash-meminspector-log.txt
CPS-3 is not implemented yet.
I'll add CPS1 and 2 to the list of supported drivers
Alright then.
A curiosity: the memory size is the same for NeGeo, CPS1 and CPS2?
All of them show the same amount of RAM when opening the Memory Inspector (it says "aware of 65536 RAM locations").
A curiosity: the memory size is the same for NeGeo, CPS1 and CPS2?
Yes it is, their hardware is extremely similar.
CPS-3 will be 512k, and that's probably one of the biggest in fba, i'll add the support this week-end
@barbudreadmon is this serious?! e502e80
@meleu Why ? Is there something wrong with cps3 ?
@barbudreadmon I think that @meleu is just excited about having CPS3 support, and not that he's dismissing the implementation. It's hard to communicate using a foreign language.
oh, sorry about the confusion. @leiradel is right, I'm excited! :sweat_smile:
Is that commit adding support for CPS-3?
@meleu it should, let me know if there is any issue
@barbudreadmon oh yeah!! Opened Memory Inspector while running "Street Fighter III: 3rd Impact" and everything seems to be working fine!
@barbudreadmon i know this is irrelevant somehow but i felled the urge to ask about Capcom ZN1/ZN2, Namco System 11/12 and Taito FX1, support possible?
FBA doesn't emulate any of those, please keep the discussion on-topic, this is not a forum
On Fri, Mar 23, 2018 at 5:19 PM, Demetris Ierokipides < notifications@github.com> wrote:
@barbudreadmon http:///barbudreadmon i know this is irrelevant somehow but i felled the urge to ask about Capcom ZN1/ZN2, Namco System 11/12 and Taito FX1, support possible?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/fbalpha/issues/182#issuecomment-375813267, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpC0JchJs3fzYT_ChUx5gidx-nj638Cks5thXTsgaJpZM4SYpne .
Today i heard there was some incompatibility with RetroAchievements in neogeo games when changing bioses. Is that true ? Any idea what could be the issue ? Let me know if i can help with it.
@barbudreadmon it's intentional. We enforce the achievement developers to not allow their achievements trigger when using UniBIOS. The reason is on our docs: http://docs.retroachievements.org/Console-Specific-Tips/#mandatory-unibios-protection
I'm not sure if it should be worked out on your end... Is it possible for the core know if the Achievements feature is enabled on RetroArch? Does it worth to spend your time coding such cheat protection in the core?
Maybe it's better let we at RetroAchievements deal with it and on your end just let users know about the protection we use.
Libretro cores know nothing about achievements so it must be worked around on Retro Achievements.
Maybe we could deal with this in RALibretro but cheaters could just use RetroArch.
Ok, i don't see any problem if it's intentional then.
Maybe on detection disable hardcore mode :)
If going through this way I would suggest disable the Achievements feature as a whole. Even in softcore things like infinite lives/grenades/credits/whatever shouldn't be allowed.
I guess there is no way for the core to detect if retroachievements are enabled ? It would allow me to disable unibios.
Hi @barbudreadmon
I took a look in the source code and this core doesn't support achievements. Is it possible to implement the
RETRO_ENVIRONMENT_SET_MEMORY_MAPS
environment call, or theretro_get_memory_data/size
functions?