CPCEC a new emulator from cngsoft

Started by Arnaud, 09:14, 16 March 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tjohnson

I have a usb pad type controller, is it possible to use it on this emulator?

Skunkfish

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!)

tjohnson

@Skunkfish did you have to configure anything in the emulator to make the pad work?

Skunkfish

An expanding array of hardware available at www.cpcstore.co.uk (and issue 3 of CPC Fanzine!)

cngsoft

#104
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.
(if you can't see the banner right now my server is currently offline)

cpcitor

Quote from: cngsoft 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).
(...)
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:

git clone https://github.com/cpcitor/cpcec

To update:

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.

tjohnson

Quote from: cngsoft on 02:08, 23 October 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

cngsoft

#107
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.
(if you can't see the banner right now my server is currently offline)

Carnivius

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: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

tjohnson

I was trying this on my media pc and only 62% performance, the cpu is not stressed at all.  Any idea why?

cpcitor

Quote from: tjohnson on 13:20, 25 December 20You 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.

cngsoft

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)

Gryzor

Happy new year-and thanks for the update!! 😊

Carnivius

Quote from: cngsoft on 00:32, 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: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

pelrun

#114
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).

pelrun

#115
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.

reidrac

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.

tjohnson

Quote from: cngsoft on 00:32, 01 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.

Carnivius

Quote from: pelrun 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:
that's cool. how do i apply that?
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Spirax

Quote from: cngsoft on 00:32, 01 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

pelrun

Quote from: Carnivius on 12:28, 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.

reidrac

Quote from: pelrun on 16:30, 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.

pelrun

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.

pelrun

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.

cngsoft

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)

Powered by SMFPacks Menu Editor Mod