Author Topic: CPCEC a new emulator from cngsoft  (Read 21426 times)

0 Members and 1 Guest are viewing this topic.

Offline Carnivius

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.514
  • Country: gb
  • Mayhem Attack Squad
    • index.php?action=treasury
  • Liked: 1108
  • Likes Given: 606
Re: CPCEC a new emulator from cngsoft
« Reply #125 on: 19:16, 04 January 21 »
I made a provisional version based on the code supplied by Pelrun: http://cngsoft.no-ip.org/cpcec-20210103-2555.zip
I don't have any joysticks at home and right now I must head out, so please test it and tell me whether the new joystick code behaves as intended.
If everything goes well, I'll properly update the docs and make this version fully public. If not, I'll continue editing the code until both angular and axial joysticks work.
heya, i tested it and it's not detecting any input from my controller.  I checked again on the previous version to make sure that one still does and yeah the previous one still detects buttons and has the movement attached to analog but this new one I'm getting nothing from. Sorry. :/
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 171
  • Country: es
  • Liked: 733
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #126 on: 01:17, 05 January 21 »
heya, i tested it and it's not detecting any input from my controller.  I checked again on the previous version to make sure that one still does and yeah the previous one still detects buttons and has the movement attached to analog but this new one I'm getting nothing from. Sorry. :/
Second try: http://cngsoft.no-ip.org/CPCEC-20210104-2335.ZIP
Made after noticing three points: 1.- Win32 joyGetPosEx requires the dwSize and dwFlags fields of JOYINFOEX to be properly filled in advance, 2.- Win32 JOYINFOEX.dwPOV field is not -1 when the controller is a joystick, but 65535; 3.- the SDL2 SDL_GameController operation set must coexist with the SDL_Joystick set; the former does NOT include the later, the function SDL_IsGameController tells which operation set must be used.
« Last Edit: 11:06, 05 January 21 by cngsoft »
(if you can't see the banner right now my server is currently offline)

Offline Carnivius

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.514
  • Country: gb
  • Mayhem Attack Squad
    • index.php?action=treasury
  • Liked: 1108
  • Likes Given: 606
Re: CPCEC a new emulator from cngsoft
« Reply #127 on: 11:39, 05 January 21 »
Second try: http://cngsoft.no-ip.org/CPCEC-20210104-2335.ZIP
Made after noticing three points: 1.- Win32 joyGetPosEx requires the dwSize and dwFlags fields of JOYINFOEX to be properly filled in advance, 2.- Win32 JOYINFOEX.dwPOV field is not -1 when the controller is a joystick, but 65535; 3.- the SDL2 SDL_GameController operation set must coexist with the SDL_Joystick set; the former does NOT include the later, the function SDL_IsGameController tells which operation set must be used.
D-pad working fine now. Thanks! :)
My only other request would be to choose which buttons on the controller is Fire 1 and Fire 2 (and allow for some keys to be mapped to controller for games that require it like those that use Space or Return for smart bombs or menus or P/H keys for pausing) but don't worry about that.  Just having the more precise control of controlling CPC games correctly with the d-pad instead of the analog stick is a huge improvement and I can properly play games on it. :)
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 171
  • Country: es
  • Liked: 733
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #128 on: 20:09, 05 January 21 »
D-pad working fine now. Thanks! :)
My only other request would be to choose which buttons on the controller is Fire 1 and Fire 2 (and allow for some keys to be mapped to controller for games that require it like those that use Space or Return for smart bombs or menus or P/H keys for pausing) but don't worry about that.  Just having the more precise control of controlling CPC games correctly with the d-pad instead of the analog stick is a huge improvement and I can properly play games on it. :)
Excellent, it works at last! I just made a couple more edits (accepting more joystick buttons as virtual mirrors) and published the resulting package:

20210105 -- minor patch fixing a bug in video recording (it turned 44KHz stereo into 88KHz mono) and tape playback (16 and 24 bit WAVE files were improperly supported), extending the joystick support to handle directional controls (thanks to Pelrun for the Win32 and SDL2 code) and letting the Dandanator emulation modify the cartridge (configuration, savestates...) if the user requests it.

I'll have to think of a way to give the user the ability to redefine the keyboard and joystick mappings altogether, although I cannot easily imagine it working on Win32 and SDL2 at the same time. Perhaps in the next major release...
(if you can't see the banner right now my server is currently offline)

Offline tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 952
  • Country: gb
    • index.php?action=treasury
  • Liked: 299
  • Likes Given: 268
Re: CPCEC a new emulator from cngsoft
« Reply #129 on: 02:38, 06 January 21 »
This latest version has broken my gamepad, now seems to be show up arrow constantly pressed on the pad.  Checked with previous version and that works fine.

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 171
  • Country: es
  • Liked: 733
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #130 on: 23:35, 07 January 21 »
This latest version has broken my gamepad, now seems to be show up arrow constantly pressed on the pad.  Checked with previous version and that works fine.
After buying a game controller for 10 EUR I edited the code until it behaved as intended. Interestingly, the order of buttons in SDL2 is different from Win32, despite the controller being the same. Arthur also spotted a couple of things that needed fixing and helped me get them right.

- 20210107 -- minor patch fixing a bug in the ASIC's screen split trigger (SSSL must be checked when HSYNC rises, rather than when HDISP rises) and a glitch in the Win32 joystick support, and making the Playcity CTC more responsive.

That being said, configuring the joystick within the OS stays important; my own new controller can work in digital and analog modes, and things fared differently on each mode; changing modes while CPCEC was on led to undesired effects (i.e. going crazy)
« Last Edit: 15:06, 11 January 21 by cngsoft »
(if you can't see the banner right now my server is currently offline)

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 171
  • Country: es
  • Liked: 733
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #131 on: 16:39, 15 January 21 »
New update, made possible by a bug report from Xenomorph, and featuring several tweaks:
- 20210114 -- minor patch improving Playcity stereo autodetection ("Alcon 2020" uses the left chip only), adding ROM simulation to Dandanator cartridges ("CPC Soccer") and fixing a bug in Z80 instruction CPI introduced in version 20210105 (RAXOFT tests) and another one in the CRTC1 VSYNC length ("Pheelone").
(if you can't see the banner right now my server is currently offline)

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 320
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 161
  • Likes Given: 411
Re: CPCEC a new emulator from cngsoft
« Reply #132 on: 17:19, 15 January 21 »
New update, made possible by a bug report from Xenomorph, and featuring several tweaks:
- 20210114 -- minor patch improving Playcity stereo autodetection ("Alcon 2020" uses the left chip only), adding ROM simulation to Dandanator cartridges ("CPC Soccer") and fixing a bug in Z80 instruction CPI introduced in version 20210105 (RAXOFT tests) and another one in the CRTC1 VSYNC length ("Pheelone").

As usual, all those update are propagated on https://github.com/cpcitor/cpcec . (I have written a script, it's just a matter of running it.)

Congratulations cngsoft!

Strangely enough, about a month ago I had a bug where the CPC screen would refresh only about once a second (version was up to date at the time, SDL2 on Xubuntu 20.04). Tested several versions recently, not reproduced anyway. ¯\_(ツ)_/¯
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 171
  • Country: es
  • Liked: 733
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #133 on: 11:40, 16 January 21 »
Extremely quick fix: "20210115 -- minor patch fixing a bug in the CPC PIO: "Inertie" sends a value to port A, then reads the same value back instead of receiving a PSG register or keyboard bits." Thanks to Dlfrsilver for spotting the glitch.
(if you can't see the banner right now my server is currently offline)