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

0 Members and 1 Guest are viewing this topic.

Offline tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.015
  • Country: gb
    • index.php?action=treasury
  • Liked: 326
  • Likes Given: 291
Re: CPCEC a new emulator from cngsoft
« Reply #100 on: 01:10, 22 October 20 »
I have a usb pad type controller, is it possible to use it on this emulator?

Offline Skunkfish

  • Supporter
  • 6128 Plus
  • *
  • Posts: 709
  • Country: gb
  • Editor of Colour Personal Computing
    • CPCSTORE.CO.UK - Dedicated to the Amstrad CPC
  • Liked: 523
  • Likes Given: 1411
Re: CPCEC a new emulator from cngsoft
« Reply #101 on: 17:43, 22 October 20 »
I just hooked up a gamepad to test and it seemed fine (two of the 6 buttons got recognised as X & Z), although there's nothing really in the way of settings.
An expanding array of hardware available at www.cpcstore.co.uk (and issue 3 of CPC Fanzine!)

Offline tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.015
  • Country: gb
    • index.php?action=treasury
  • Liked: 326
  • Likes Given: 291
Re: CPCEC a new emulator from cngsoft
« Reply #102 on: 19:21, 22 October 20 »
@Skunkfish did you have to configure anything in the emulator to make the pad work?

Offline Skunkfish

  • Supporter
  • 6128 Plus
  • *
  • Posts: 709
  • Country: gb
  • Editor of Colour Personal Computing
    • CPCSTORE.CO.UK - Dedicated to the Amstrad CPC
  • Liked: 523
  • Likes Given: 1411
Re: CPCEC a new emulator from cngsoft
« Reply #103 on: 23:56, 22 October 20 »
Nope, just plug and play...
An expanding array of hardware available at www.cpcstore.co.uk (and issue 3 of CPC Fanzine!)

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 183
  • Country: es
  • Liked: 774
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #104 on: 02:08, 23 October 20 »
Following the previous talk about disc write protections, and after noticing that the recently added mouse support for SDL2 lacked wheel scrolling, I made a new minor release:

20201022 -- minor patch adding mouse wheel support to the SDL2 user interface and an option to set whether disc write conflicts in CPCEC and ZXSEC are strict (they raise errors) or relaxed (they do nothing).

The choice of disc write error mode is saved in the configuration file and sticks between sessions. By the way, and since we're speaking about things that the user can see (or cannot), Norecess' recent (and spectacular!) experiments with CPCEC's interfaces (both user and debugger) are making me ponder the convenience of further separating machine emulation and user interaction for the sake of "hackability" and extensibility.

@tjohnson : the joystick configuration is up to the operating system, I merely ask either the Windows API or the SDL2 library to tell me which joysticks are available and I choose the first one that is active.

EDIT: extremely small update 20201024 -- minor patch solving a problem in the SDL_WINDOWEVENT_EXPOSED event, inverting the black/white bits in ZXSEC's graphics viewer and pointing CPCEC's viewer at RAM rather than ROM.
« Last Edit: 00:36, 26 October 20 by cngsoft »
(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: 362
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 198
  • Likes Given: 456
Re: CPCEC a new emulator from cngsoft
« Reply #105 on: 12:48, 08 November 20 »
Following the previous talk about disc write protections, and after noticing that the recently added mouse support for SDL2 lacked wheel scrolling, I made a new minor release:

20201022 -- minor patch adding mouse wheel support to the SDL2 user interface and an option to set whether disc write conflicts in CPCEC and ZXSEC are strict (they raise errors) or relaxed (they do nothing).
(...)
EDIT: extremely small update 20201024 -- minor patch solving a problem in the SDL_WINDOWEVENT_EXPOSED event, inverting the black/white bits in ZXSEC's graphics viewer and pointing CPCEC's viewer at RAM rather than ROM.

Thanks again cngsoft for the new releases!

For the people who prefer to get code and updates via git, I updated again the repo on https://github.com/cpcitor/cpcec with each new release.

To get code first time:

Code: [Select]
git clone https://github.com/cpcitor/cpcec
To update:

Code: [Select]
git fetch ; git rebase
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 tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.015
  • Country: gb
    • index.php?action=treasury
  • Liked: 326
  • Likes Given: 291
Re: CPCEC a new emulator from cngsoft
« Reply #106 on: 13:10, 08 November 20 »
@tjohnson : the joystick configuration is up to the operating system, I merely ask either the Windows API or the SDL2 library to tell me which joysticks are available and I choose the first one that is active.
Not sure what happened 1st time but my gamepad works fine now, it's just like playing on a GX4000

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 183
  • Country: es
  • Liked: 774
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #107 on: 13:16, 13 December 20 »
After releasing several minor versions with bugfixes and tweaks, a new major version is here:

20201212 -- nineteenth public release. The Windows version can use DirectDraw instead of GDI, and the SDL2 version uses Textures instead of Surfaces: performance rises when hardware acceleration is available. Just in case, however, command line parameter `-!` and the menu option "Video: Software render" can be used to disable the hardware acceleration in systems where it's missing or performs worse than pure software. CPC bugfix: PSG handles register 14 separately, as expected by "Gremlins (v1)". Spectrum bugfix: 128K ghost ports are properly emulated, the demo "Tiratok" plays music at last. New debug command "Y": fill memory with byte. XRF lists the available codecs on Windows when launched without parameters.




The software render is enabled by default, as the hardware mode is less likely to work on all machines, and in some cases (such as my desktop computer) it's actually less efficient than pure software. Disabling the software mode, then restarting the emulator, will show whether the video hardware provides 2D acceleration or not. You can always restore the software mode from the menu, or with the command line parameter "-!" if CPCEC becomes unlaunchable in the worst case.
« Last Edit: 22:57, 14 December 20 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 #108 on: 14:43, 20 December 20 »
Hello, this is a great emulator and I am using it to play Alcon2020 today with the PlayCity and such.
Using my controller though it only appears to let me move with the analog stick and not the d-pad and using analog stick with digital controls is of course quite clumsy, so is there a way to use the d-pad (think it uses POV?) or can there be an option for it in a future release?
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.015
  • Country: gb
    • index.php?action=treasury
  • Liked: 326
  • Likes Given: 291
Re: CPCEC a new emulator from cngsoft
« Reply #109 on: 13:20, 25 December 20 »
I was trying this on my media pc and only 62% performance, the cpu is not stressed at all.  Any idea why?

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 362
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 198
  • Likes Given: 456
Re: CPCEC a new emulator from cngsoft
« Reply #110 on: 15:01, 27 December 20 »
You would probably need to provide much more details, like operating system version, exact cpcec version you used, how you got it, etc.

You would probably need to provide much more details, like operating system version, exact cpcec version you used, how you got it, etc.
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: 183
  • Country: es
  • Liked: 774
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #111 on: 00:32, 01 January 21 »
2020 is almost over and I'd like to wish everyone a happy new year 2021. A new release of CPCEC is in development: writeable Dandanator cartridges will be its main novelty, together with several fixes and tweaks as usual.


By the way, I released a fourth public version of "Fire Tyre" back in Xmas, but I forgot to mention it here: mobile camera by default instead of static, four rival cars instead of three, maximum speed is now 225 mph instead of 180 ("Continental Circus" was a big inspiration), practice mode where you can play each track separately, etc.

Carnivius, CPCEC and ZXSEC do nothing special with the joystick, they simply request the first available joystick to Win32 or SDL2 (depending on the compiled version); the joystick configuration is up to the operating system.

tjohnson, I don't know, I'd have to know more about your system. Did CPCEC run faster in past versions? Is the "Video: software render" option on or off? Did you try different scanline and interlace modes? (some consume less CPU and video power than others)
(if you can't see the banner right now my server is currently offline)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.026
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4091
  • Likes Given: 7405
Re: CPCEC a new emulator from cngsoft
« Reply #112 on: 03:05, 01 January 21 »
Happy new year-and thanks for the update!! 😊

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 #113 on: 12:50, 01 January 21 »

Carnivius, CPCEC and ZXSEC do nothing special with the joystick, they simply request the first available joystick to Win32 or SDL2 (depending on the compiled version); the joystick configuration is up to the operating system.
Damn. I can't really play games well on this then as it forces me to use analog stick. There's no way to force movement to the d-pad in Windows. Other emulators and programs tend to have even a basic config menu to sort that stuff out. This is a really great emulator but not one I can use as my main for now.  Never mind. Happy new year. :)
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 782
  • Country: au
    • index.php?action=treasury
  • Liked: 455
  • Likes Given: 278
Re: CPCEC a new emulator from cngsoft
« Reply #114 on: 13:31, 01 January 21 »
Looks like it's mostly a misunderstanding of how the joystick APIs work - CPCEC asks for the analog position, and that's what it gets. The D-pad is actually simply mapped as extra buttons (or possibly the POV hat), so it's pretty trivial to read those as well (although it requires using JoyGetPosEx under win32).
« Last Edit: 13:42, 01 January 21 by pelrun »

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 782
  • Country: au
    • index.php?action=treasury
  • Liked: 455
  • Likes Given: 278
Re: CPCEC a new emulator from cngsoft
« Reply #115 on: 15:53, 01 January 21 »
So I couldn't sleep until I fixed the dpad issue, patch is attached. This is working under linux with my controller. I've not tested the equivalent changes I made on the win32 side but they *might* work...

Looks like SDL has a mechanism for loading a standard mapping file in for game controllers; adding the call to do this I leave as an exercise to the reader.  :laugh:
Edit: fixed a minor bug with the win32 changes.
« Last Edit: 17:43, 02 January 21 by pelrun »

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.013
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 1866
  • Likes Given: 1021
Re: CPCEC a new emulator from cngsoft
« Reply #116 on: 16:48, 01 January 21 »
Yep, this can be useful:

https://github.com/gabomdq/SDL_GameControllerDB

Perhaps?
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse and Brick Rick for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

Offline tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.015
  • Country: gb
    • index.php?action=treasury
  • Liked: 326
  • Likes Given: 291
Re: CPCEC a new emulator from cngsoft
« Reply #117 on: 01:04, 02 January 21 »

tjohnson, I don't know, I'd have to know more about your system. Did CPCEC run faster in past versions? Is the "Video: software render" option on or off? Did you try different scanline and interlace modes? (some consume less CPU and video power than others)


Well it turns out that using the amd automated driver installation installed a driver that was rubbish. It's a fairly old apu.  I uninstalled the drivers and used Microsofts update service,  that seems to have installed a driver that works.  I still skips a few frames but doesn't stick at 62% anymore.

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 #118 on: 12:28, 02 January 21 »
So I couldn't sleep until I fixed the dpad issue, patch is attached. This is working under linux with my controller. I've not tested the equivalent changes I made on the win32 side but they *might* work...

Looks like SDL has a mechanism for loading a standard mapping file in for game controllers; adding the call to do this I leave as an exercise to the reader.  :laugh:
that's cool. how do i apply that?
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline Spirax

  • CPC464
  • **
  • Posts: 7
  • Country: es
  • Liked: 22
  • Likes Given: 15
Re: CPCEC a new emulator from cngsoft
« Reply #119 on: 14:12, 02 January 21 »
A new release of CPCEC is in development: writeable Dandanator cartridges will be its main novelty
1st Happy new year to all :)
As tester of the writeable option for Dandanator, I can say it works as espected with the writing asm code routines I used on Sword Of Ianna and also on a new cartridge CPC ported game that is in development....I also can say title for the new game will be anounced tomorrow ....
thanks

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 782
  • Country: au
    • index.php?action=treasury
  • Liked: 455
  • Likes Given: 278
Re: CPCEC a new emulator from cngsoft
« Reply #120 on: 16:30, 02 January 21 »
that's cool. how do i apply that?
Under unix it's usually as simple as "patch < file.patch", as long as the files have the same line-ending type. And then compile.

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.013
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 1866
  • Likes Given: 1021
Re: CPCEC a new emulator from cngsoft
« Reply #121 on: 16:59, 02 January 21 »
Under unix it's usually as simple as "patch < file.patch", as long as the files have the same line-ending type. And then compile.

I think Scott may need someone to build the Windows version for him, with the patch (I'm on Linux and I don't think I have cross-compilation setup).

Or wait to see if César likes the patch and includes it in the next release!
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse and Brick Rick for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 782
  • Country: au
    • index.php?action=treasury
  • Liked: 455
  • Likes Given: 278
Re: CPCEC a new emulator from cngsoft
« Reply #122 on: 17:17, 02 January 21 »
Hence why I didn't go into too much detail - either you're in a position to build it and don't need much handholding, or you can't and there's no point trying.
At the moment getting César to accept the changes into an official release is the best route for people who can't build it themselves. Which means I should probably test the win32 side.

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 782
  • Country: au
    • index.php?action=treasury
  • Liked: 455
  • Likes Given: 278
Re: CPCEC a new emulator from cngsoft
« Reply #123 on: 18:01, 02 January 21 »
I fixed a minor bug in the win32 code but it looks like the basic win32 joystick api might not be sufficient and I'd need to rewrite it to use DirectInput. Yaaay microsoft.

Offline cngsoft

  • CPC6128
  • ****
  • Posts: 183
  • Country: es
  • Liked: 774
  • Likes Given: 362
Re: CPCEC a new emulator from cngsoft
« Reply #124 on: 18:49, 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.
(if you can't see the banner right now my server is currently offline)