Jump to content

Tux

Ultra Members
  • Posts

    1,061
  • Joined

  • Last visited

  • Days Won

    219

Posts posted by Tux

  1. Well it works here so you probably made a mistake somewhere.

    Of course not you can do whatever you want with it, but be careful if the loop never ends then raine will freeze and the only way to stop it will be to kill it (from the task manager).

    You can open the console and do a help for to check if for is really inside.

    And of course if you run a loop such as the one in your example in every frame in a run: script, it will probably be very very slow !

  2. Just pushed this simple for loop to git, your script becomes :

    script "test 2"
    on:
       poke $FF4BE1 $F3
       poke $FF26AD $71
       for counter=0 counter<=$2ac counter=counter+4 dpoke $90c090+counter $6000


    it's now a on: script, not a run: because everything executes in just 1 frame.

  3. There are 2 parts here :

    1) it's not a crash, it's the effect of the recent optimization to make the ifs faster, if you run raine from a console (which is always the case for me in linux, curse windows to make running programs from a console so difficult !), you'll see it prints an error message before exiting without crashing, the message says :
    no command for counter=dpeek($FF1020)
    It's not an error from you, it's because the optimization expects to have real commands inside an if, that is a function name and then some parameters, which is not the case here, something I forgot but I thought we would have found this kind of case earlier. Anyway its really easy to fix, I just pushed the fix in git.

    The script doesn't remove the gauntlet, it keeps the gauntlet alone on the title screen

    2) what you really need here is a loop, simply. Well the fact is that these scripts were never meant to be that complex so the notion of block is not really defined for them for now except for the if..elsif|else...endif case.
    What I could do is a simplified loop without block, like the c for loop, but without block which would look like :

    for init test increment instruction
    where init would be the initalization of the loop variable, like i=0
    test would be the test to run for each turn like i<=12
    increment would be what is executed at the end of the loop, like i=i+4 (the i+=4 from C is not supported by the console !)
    and finally instruction the optional instruction to run inside the loop, which would replace a whole block, like
    dpoke adr+i value

    This would be a good compromise, not too hard to do, and it would simplify quite a lot this kind of problem, plus the loop would execute in 1 frame, here your script runs a lot of frames for its loop. What do you think ?

  4. For the crash it was a stupid mistake, it happened only if the empty dir was not the 1st of the list ! And in my test it was, of course... !
    Anyway fixed in git and for next time ! (it's a 1 line fix... !).

    And by the way, I didn't know some people still had some windows8 around, one of the most hated windows version ever, with windows me (millenium but it's rather old now). The part about spying the user to get ad money was added in win8, but is more and more present now, luckily there are tools to block all of this... !

     

    • Like 1
  5. Yeah I was not totally sure it would be worth it for the speed, at least it's good news for my peek function, it's not so slow after all ! And yes it's clearer with the mode variable.

    Thanks for the fixes, updated in git.

  6. 9 hours ago, mer-curious said:

    Hello Tux! I was finally able to check the new version and here I am with my brief feedback.

    It seems that the issues I reported in my previous posts are finally corrected, except for the crash when clicking in an empty folder in the IPS selection menu. Do you intend to fix this eventually? Whatever you decide, I'm already very glad for these fixes.

    It's actually rather long... !

    I don't have the crash here, maybe some craziness from windows which escaped me ? I'll test this again to be sure.

    edit : don't have the crash at all, even in wine : empty ips directory -> messagebox to tell the dir is empty, empty dir inside ips directory -> just displays the .. dir to return 1 level higher, tested in wine, same thing.

    9 hours ago, mer-curious said:

    Now for some new discussions, I would like to report an issue I'm having with the Unibios: whenever I call the Unibios in-game menu with Start + Select/Coin it will go black after some moments. If I want to show the menu again I have to either touch the directional pad or the buttons, as you see here:

    https://drive.google.com/file/d/1VDqGCYPrRRjP258wOhGh4nmFUnmdxzme/

    I think this is a feature from the Unibios menu to protect CRT displays from the burn in effect, but recently it started to turn off too quickly in Raine, I don't know why. Maybe it's something on my side? But I don't remember changing anything related to the Unibios behavior... Anyway, I'll wait your comments on that.

    Very good diagnosis indeed, it's related to the recent optimization of the scanline counter for aodk and some other games, apparently there can't be any optimization here because this unibios just uses it to count the frames !!! (it's a very unefficient way to count frames, the best way is just to add a counter in the vbl irq, if they had done that there would be no bug).

    Anyway, I'll revert to some more classical code here then, there was a game which produced a black screen because of this recently, do you remember which one it was, I didn't write which one it was and since I change this again, it would be better to double check. (aodk already checked and ok)

    9 hours ago, mer-curious said:

    Now I have two feature requests:

    Request 1: an "Enable IPS patches" option to allow us to toggle the patches on and off just like in FBNeo.

    Currently if someone wants to disable the patches it is necessary to deselect all the *.dat files in the IPS selection menu, and repeat the process again to enable them. This is not so user-friendly, so this feature would make this process much easier and quicker.

    I have an idea where the feature could be placed: in the "Game options" menu or in the "Options" in the Game selection menu. If you place it in the Game Options menu it would become a game dependant setting, no? This could be interesting, except that it would require the user to load the game first in order to turn on/off the patches, and then a hard reset or a restart of the program so the option take effect, right? Now if you place it in "Options" in the Game selection menu it could be enabled or disabled before the game is loaded, so it would be more user friendly if placed there. Also, it would be "visually" closer to the "Preload IPS dat file" option, which is better for navigation and organization in the GUI.

    So I think it's best to place it there and set it to on as default. What do you think of this idea?

    Yeah you can't use game options here since it's not available until a game is loaded, but I don't like the idea to add lines in the header of the game selection dialog, there are already quite a few and I don't want a crowd here. Maybe simply as a line on top of the "preload ips dat file", a kind of "ips patches enabled globally" with a checkbox. I'll think about it.

    edit : done, not with a checkbox finally because they are not really convenient in the gui right now, so a classical menu with enabled/disabled displayed in text, it's easier. Setting saved in config file so it stays if you quit the emu, and is taken into account if you load a game from the command line.

    9 hours ago, mer-curious said:

    Request 2: a "Swap controller face buttons layout" (I don't know exactly how to name it) in the Inputs menu to quickly adapt the XBOX 360 controller face buttons layout to the Nintendo controller layout.

    I felt the need for that because recently I bought a Switch Pro Controller to play with my friend's Switch and then tried it in Raine to see how it would perform there. It turns out that it is recognized and mapped automatically but the official SDL mapping for the controller (and possibly for other Nintendo controllers) follows the A, B, X, Y button layout instead of Nintendo's B, A, Y, X. So in NEOGEO games, for example, NG button A becomes the right button (instead of the down), NG button B becomes the down button (instead of the right), NG C is now the top button (instead of the left), and finally the D button is mapped to the left button (instead of the top).

    This is the NEOGEO original button layout:

      D
    C   B
      A

    The X360 button layout

      Y
    X   B
      A

    PlayStation button layout

       triangle
    square   circle
        cross

    Nintendo button layout

      X
    Y   A
      B

    You see that both the X360 and PS button layout respect the NG one in the SDL configuration database, but that's not the case for the Switch controller. It is registered in SDL as exactly as it looks, so the NG buttons don't match with the original order. This new option would allow us to keep Raine's default configuration as suggested from the SDL database while easily adapting it to correct the face buttons layout for such controllers. I don't know if this could be easily doable but it would really come in handy for these uncommon SDL configurations.

    That's my comments for now.

    Thank you so much in advance for your time and for considering these requests.

    You're in luck because I have a similar problem here, I have a pad which tries to be clever and to autodetect what it's plugged to and then change its layout based on what it detects. It worked well until recently and was detected as an xbox pad on pc, but with linux kernel 6 it started to detect it as a nintendo console !

    There are ways around that : stick to a 5.x kernel, that's what I did 1st for about 1 year, but now the old kernel is not available anymore in arch and so I can't do that anymore.

    So I can experiment this button swap 1st hand ! ;-)

    I'd suggest using the controller mapping function instead, there is only a catch there : it doesn't change anything for the gui, you still have A & B inverted there, I'll change the gui to use the normal mapping then... !

    edit : actually I had a weird problem here, normally raine creates a userdb2.txt file in the config directory and then renames it in the end to userdb.txt but mine was not renamed for some reason, so actually the new mapping didn't work at all. I added an error message in case the renaming fails, but when I redid the mapping, it worked flawlessly, no error message, and the new mapping works everywhere, gui and games, so the buttons are once again in the "right" order.

    Oh well... at least it works, once the right userdb.txt file is created you don't need to touch this ever again anyway.

    • Like 1
  7. 20 minutes ago, ffman1985 said:

    I think i understand the reason of setting a variable instead of repeating using the peek. The $ff0000 is actually represented the mode selected, so it may be named as ‘mode’. It affects whether the vs mode script, training mode script… enable or not. All of my script have this part written in the same way. I think i have to re-write all of my scripts (including the part for up/down buttons pressed in the menu screen) which is a painful job for me, as i almost finish all script for the cps fighting games…

    Test 1st, maybe the improvement will be almost nothing, in this case don't bother.

  8. Ok, some little optimizations again, get them from git this time, I didn't review the whole script, stopped at the beginning of the menu (Menu Screen), but there is a big one here !

    You might eventually want to try :

    ff0=peek($FF0000)
    if ff0==0

    ...
    elsif ff0==1 ...

    instead of having the if peek($FF0000)==0 elsif peek($FF0000)==?? etc, the reason is that the variable version gets the peek result only once, the peek version might get it a lot of times, and functions are a lot slower to evaluate than simple variables.
    But you need to check if it really makes a difference by checking the misc counter when changing this, and I was too lazy to do it tonight, so it's just an idea !

  9. 5 hours ago, ffman1985 said:

    At first, i wrongly perceived the $618000, $618002… as unwrittable (since they return to $ff immediately after i change the value). But now i know that to see the effect of changing value, the 3 address should be poke together…

    And thank you for telling me that both $618000($618001) and $618002($618003) are both related to the sound code.

    I hope this technique can use on all cps games.

    The reason why your values are changed is because it's a shared ram which is mapped directly to the z80, it serves as a way of communication between the 68k & the z80. They were pretty in advance for multi cpus architecture considering it was in the 90s, but this way to communicate was probably already used in the 80s in the arcades too.

    For the z80 it's some normal ram. You can access it by using the z80 instead, but it obliges to do

    cpu z80a (to switch to the z80)
    poke $c000-$cfff for this shared ram, this time it's some normal ram for the z80, which means the sound command is in the word $c000-$c001.
    But I advise to keep the way it works now since almost all your work is for the 68k, it's just an explanation of why this ram is so weird ! So as soon as the z80 executes during a frame it reads what is there, and eventually changes the values.

    For the other games, well maybe, you'll see, maybe I was to careful with the whole area, but it's not a big problem anyway, if something fails you'll know where it comes from !
     

  10. Pushed to git, since you didn't explain in detail the changes I have put "mainly sound effects, fixes & improvements".

    Tested quickly, works perfectly, the shortcut to the service mode without reseting the game when you leave is quite impressive too !

    Congratulations !

  11. Yeah I know accessing this area is counterintuitive, you can keep $618001 it would be correct for normal ram, here it's the same as a poke to $618000, and poke to $618003 is the same as $618002. To remind you these are high byte of the word code for the music or sound effect to be played ($618000) and low byte in $618002 (or $618003 as you prefer).

    For $61801f if it's enough for you with sfad that's good, the song associations clears the whole area, but it works anywhere with any game.

    Good I'll test it a little later and update it to git...

  12. writes to $618003 are strictly equivalent to writes to $618002, there is a handler at this address, it takes the offset and divides it by 2, the use it as an index in the qsound shared ram.

    Anyway glad it worked for you, I'll take a look later.

  13. 14 hours ago, ffman1985 said:

    Very happy that my script to include in Raine again. Without big change or serious bug, i will not post a update. The next thing i want to do is to add some sound effect in the menu screen when switching choice. (Want to do since i posted the first console mode script, but still no idea how to do that, except for the coin sound which has different treatment(?).)

    Actually it's rather very tricky for cps2 because it's qsound, this chip doesn't take a single sound command, it has some shared ram which can be accessed directly by the 68k.

    I tracked how songs are played for the sound associations function, so I can explain this, but I didn't try to find how sound effects are played, but apparently it's something different, probably another offset...

    Anyway for a song, 1st init the game until you reach at least the copyright screen then go to sound commands / Associations and test one of the proposed sound commands until you find something you like. Here we'll take song number 1, the 1st one.

    So you need to 1st zero out the 16 1st addresses of the qsound ram ! And to make things worse this ram is not contiguous so you must access it this way

    poke $618000 0 for offset 0
    poke $618002 0 for offset 1
    ...
    poke $61801e 0 for offset $f

    If you want to experiment with that try that in the console, for a script you would need something like a memset command to clear the whole area in 1 line. Anyway once the whole 16 1st offsets have been cleared :

    poke $618000 commnad here the command would be 1 then
    poke $61800e 0 (from the console I am not sure this last poke is necessary since you just cleared it, the game always finish any qsound command by writing something to this offset).

    If you did things right you can close the console with the ESC key and you should hear something !

    Rather complicated, I'd advise to start with neogeo which is much easier than that because there are true sound commands in neogeo !

    edit : after testing quickly for the sound effects : they are simply after the musics, but it's on a word, high byte goes to offset 0, low byte goes to offset 1, so I guess in my example you should rather put 1 in $618002 even if putting it in $618000 seems to work.
    To experiment with this go to the service mode, sound test and browse the sounds... If you go backwards it goes to sound $2ff (which is nothing), but there are soon real sound effects to be heard close to this value. When you find 1 you like you can check the values in the qsound shared ram using peek($618000) for example. If you really want to try that, I'll add a memset function to clear the area in 1 line.

  14. 7 minutes ago, ffman1985 said:

    Actually, I am thinking of a function to allow user to freely set a combination of key (controller key not keyboard) for a shoutcut of a particular purpose, eg: ABX+start = reset, select + x = call cheat menu (the key in this example is the xbox controller), etc. I don't think this combination of buttons affect gameplay in most games. If yes, i hope player can change the key combination.

    I accept patches... ! on my side I just pushed the fix for alt-c

  15. 5 minutes ago, ffman1985 said:

    Good to find out the rare bug. Since I assign a key to controller to call the cheat menu, I never trigger the bug you mentioned. By the way, is it possible to add the shortcut of combination of buttons in the controller? For example, pressing ABX+start button to reset the emulator. So that I can have more buttons to use for gameplay.

    I don't think so, because A is used for normal input, so if you start pressing it then the corresponding control is enabled... !

    5 minutes ago, ffman1985 said:

    Also I try the modified script, it shows great improvent on the menu (misc 15% decrases to 11%), is the change only involves grouping of other parts into "if dpeek($FFAE18)==$02E7"? 

    However, when i group more title parts script under "if dpeek($FFAE18)==$02E7", it shows no improving.

    There was also the grouping under
    if ((peek($FF8051)==$04)or(peek($FF8055)==$04))
    instead of all these if which had this very same test in a and

    Well you can't win all the time with this kind of optimization, it came obvious to me when reading the script so I did it while looking for the cause of my problem...

  16. Much better with some documentation !

    So that's because I use alt-c as a keyboard shortcut to call the cheats dialog, I think that's the default shortcut, and since C is also the key for heavy kick, it's seen as always down when you return from the cheats dialog !

    At least we found a rare bug here. I'll fix it in git... !

  17. Ok, so here is a slightly improved version of the script, basically less tests in each frame by grouping the tests and the result of all that is that for me I have

    peek($ff8050) == $40 as soon as I start the 1st script, well almost, on the phoenix screen it's still ff8050 == 0 but after that something puts $40 in it during all the frames.

    Since your test to exit your menu is
           #Start game#
           if (peek($FF8050)>$00) #P1 start game#
              poke $FF8058 $01
              poke $FF817B $01
           endif
    it exits as soon as it reaches this point (I don't know what this ff8050 address is supposed to contain, I just know it's in ram).

    Actually it occurs all the time now with all the versions, 32 or 64 bits, I even wonder how I could have this menu to stay on screen before, now I can't, it's gone as soon as it appears.

    edit : and I finally understood how to get your menu to stay : you must start your script before starting the game ! That is, load the game with the option not to auto start it in the background, then enable the 1st script, then start the game. Then the peek stays at 0 all the time. If you start the script even during the phoenix screen, it's too late, the memory address will get $40 all the time.

    sfad.txt

  18. Well testing : I could get to the options menu only on my 1st try (with the 64 bits version). With the 32 bits version when I press 1p it displays press 1p or 2p, then I press 1p again, I see the option menu for a fraction of second and it goes directly to the character selection... !

    I didn't know there could be a difference between the 32 bits and 64 bits version, if it's something else then I don't know what it is... And what a long script for sure ! But congratulations for the way it's written, it's still quite clear even if you don't know the internals of the game because of all the comments.

    (I made a few attempts trying to press as quickly as possible on the 1p key, it doesn't change anything).

  19. Fixes only this time, there were quite a few annoying ones, plus a surprise from long past, a fix for 64street & chimerab attract mode! For these 2 to say the truth the fix itself was found by Haze for mame around version 0.170 so quite a long time ago already, and then found in the github web interface by Antiriad, and finally adapted by me to raine ! This bug made me crazy, such a simple memory map for such a crazy effect, no move during attact mode... It turns out it's something very similar to the nmk driver, they push what they can do with the 68000 to the limit, write bytes are mirrored to words in their main ram ! Actually this bug had been here since 0.28 and before, but I saw it only when testing the turbo key behavior, so it's a very special bug !!!

    Anyway except that the more classical bug fixes are :
     - better message for broken ips .dat files
     - Ignore repeated keys ! I had some trouble with the turbo key DEL, which must be held down as long as you want the acceleration to occur, but after a while it created havoc. It's because sdl2 handles key repetition and I missed it completely ! It's fixed now.
     - console : fix breakpoints for 68k cpus which I had stupidly broken when adding the z80 breakpoints !
     - The multiple files selector used for ips dat files doesn't loose its selection anymore when resizing the windows
     - Still for ips dat files : when no dat files are selected delete the corresponding ini file when leaving the directory or closing the dialog

     - some more fixes to this multiple files selector... !
     - a fix for a crash I got in the console while copying and pasting info from the console

    Get it from there : http://raine.1emulation.com/download/latest.html

    ... and updated the 2 appimages to 0.95.3, I won't do that for all releases but since the build system was updated very recently it was very easy to do just now.

    • Like 2
  20. Ok finally fixed the last bugs of the multi file selection for the ips dat file (resizing, + deletion of the ini file when there is no selection anymore, and counting the selections was wrong when changing an already existing ini file).

    I might release a binary later, it's just small bug fixes, but annoying ones.

    • Like 1
  21. For the conflict I had already spotted this one and told you about it in the original thread when I created the feature, quite a long time ago already. It's right, the 1st report of length 2 is harmless, but not the 2nd, so expect the last applied to take priority here.

    For the rest yeah the crash is fixable, but it's not a a generic file browser, the files here are supposed to be in a precise format, if not then it's not a surprise to get a crash.

    And for the glitch you are probably the only one thinking about maximizing the window in the middle of this and then complain that it looses its selection after doing this. I'll probably take a look at both... but it's really not a high priority !

    By the way : surprising bug found while testing the appimage and the turbo key : sdl2 actually handles key repetition despite the fact that they removed the function to control the key repeat speed ! There is a field to indicate is an event is from a key repeat and I completely missed it ! And nobody noticed until we tried the turbo key and so it's held down for long enough to trigger a key repeat, which triggers havoc !

    It's fixed, it's very easy to fix, but it was really surprising !

     

    • Like 1
  22. And I finally managed to update the i386 appimage too, you'll need an os which can run i386 binaries obviously though, on debian it requires what they call multiarch, look for that on the internet if you want details, you'll need at least dpkg --add-architecture i386 followed by the installation of a few basic libs.

    Tested on a mint 21.2 virtual machine, built on a bionic ubuntu docker container (and it obliged me to switch to a 5.x kernel to avoid to get an incompatible shared lib, but on arch 5.x is almost not supported anymore,  I could get it using downgrader, but it was in a text console only ! Luckily it was enough to build SDL2, and I had the problem only with SDL2).

    Anyway that's not the kind of thing I'd like to update often. Both versions have shrunk this time though, it's down to a little less than 14 Mb which is still huge for a raine release, but it was 16 Mb before !

    Also the command line is supported of course, from a terminal you can launch :

    ./Raine-x86_64.AppImage -gl

    to get the list of supported games for example.

    Anyʍay I learnt a few tricks while doing this, even if it was very long to do !

    • Like 1
  23. I was contacted by someone who couldn't make the appimage from about 1 year go to work, it was 0.93.x version, with very old dependencies... So this time I took the time to create a virtual machine to test this in mint 21.2 (which I don't like a lot !), and the appimage got a few updates (only the 64 bits version is updated, I have currently no setup to build the 32 bits version so I must restart it from scratch and it would take too much time). The audio seems slightly delayed in the VM, but except that everything seems ok now, couldn't contact internet archive but it was a VM problem, I should add a cancel button to the curl dialog but it will be for another time ! By the way this fat archive weights 16 Mb which is about 8 times the size of a normal release !!! At least you get all the optional data files + the dependencies inside, and it should work on any linux distrib having at least glibc-2.29 (which is very old, it's bionic ubuntu). It's a last resort if you can't install any normal version...

    And there were a few bugs in accessing some files in the appimage which pushed me to fix quite a few paths which were wrong also for windows, it's a miracle that some functions worked in windows, maybe I didn't test them enough, and it explains mer-curious problems with the ips files ! (and it's a crazy bug, sometimes a path with / is accepted, but sometimes not).

    Anyway except the big heap of paths fixed, there is the 2nd fix for the default value of speed hacks in neogeo... !

    Hoping it's the last time I cope with these silly bugs ! But the experience in the virtual machine was interesting anyway... !

    You can get this here : http://raine.1emulation.com/download/latest.html

    • Like 1
×
×
  • Create New...