News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Arnaud

CPCEC a new emulator from cngsoft

Started by Arnaud, 08:14, 16 March 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cngsoft

#150
Quote from: cpcitor on 23:44, 23 May 21Looking again, there is a strange thins also correlated to image size: for a in abadia-*xrf ; do echo ; echo $a ; xrf $a - > /dev/null ; done abadia-1.xrf VIDEO 384x268px 25Hz - AUDIO 2ch08b 44100Hz ok: 1510 frames, 0 unused. abadia-2.xrf VIDEO 768x536px 25Hz - AUDIO 2ch16b 44100Hz ok: 1425 frames, 0 unused. abadia-3.xrf VIDEO 384x268px 50Hz - AUDIO 2ch08b 44100Hz ok: 3148 frames, 0 unused. abadia-4.xrf VIDEO 768x536px 50Hz - AUDIO 2ch16b 44100Hz ok: 3141 frames, 0 unused. Problem comes when XRF generates 2ch08b, no problem when XRF generated 2ch16b. Why would sound channel format depend on image size? Does cpcec generate different audio format in XRF depending on film option? Does XRF format even support that?

I think I found the bug in the raw AVI output: I forgot to propagate the sample size value. Line 365 of XRF.C stores it just once: `avi_header[0x0134]=flags_audio[flags_z&3];` but it should also fill the other fields requiring it: `avi_header[0x00FC]=avi_header[0x0114]=avi_header[0x0134]=flags_audio[flags_z&3];` (another bug, although invisible unless mute videos are recorded is line 399, `avi_mputcccc(&avi_h_mute[0x0108],count_z*audio_z); // avi_audios` -- it must be erased both because the index is out of bounds and the field is useless)

EDIT: there's also a bug in CPCEC-RT.H that leads to "dirty" videos because of bad cleanup between new videos: the last line of session_createfilm() uses MEMZERO with a pointer rather than an array, failing to fulfill its purpose. Replace it with `return memset(session_filmvideo,0,sizeof(VIDEO_UNIT)*SESSION_FILMVIDEO_LENGTH),session_filmcount=0;`
(if you can't see the banner right now my server is currently offline)

cpcitor

I have written your changes in the source files and will test the result.


Here's a prod that seems to be not faithfully emulated in current cpcec: Galaxie. See screenshots on cpc-power: https://www.cpc-power.com/index.php?page=detail&num=7446

Here's the result on my screen:
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.

cpcitor

#152
Quote from: cngsoft on 10:48, 24 May 21
I think I found the bug in the raw AVI output:

I wrote the changes you asked.

Here are the result:

This seems correct again:

for a in abadia-*xrf ; do echo ; echo $a ; xrf $a - > /dev/null ; done

abadia-1.xrf
VIDEO 384x268px 25Hz - AUDIO 2ch08b 44100Hz
ok: 1510 frames, 0 unused.

abadia-2.xrf
VIDEO 768x536px 25Hz - AUDIO 2ch16b 44100Hz
ok: 1425 frames, 0 unused.

abadia-3.xrf
VIDEO 384x268px 50Hz - AUDIO 2ch08b 44100Hz
ok: 3148 frames, 0 unused.

abadia-4.xrf
VIDEO 768x536px 50Hz - AUDIO 2ch16b 44100Hz
ok: 3141 frames, 0 unused.


Generate AVI again

for XRF in *xrf ; do STEM=${XRF%%.xrf} ;  xrf $XRF - | ffmpeg -y -i - ${STEM}.avi 2>|${STEM}.ffmpeg.log ; done


This shows minor discrepancy in abadia-2.avi, perhaps an effet of closing the emulator during xrf capture maybe?

for a in abadia-*.avi ; do mediainfo $a | egrep '^Duration' | sort | uniq | xargs echo $a ; done | sed 's/Duration *//g' | column  -t -s ":"

abadia-1.avi    1 min 0 s
abadia-2.avi    57 s 40 ms    57 s 51 ms
abadia-3.avi    1 min 3 s
abadia-4.avi    1 min 2 s


Playing the avi in mpv and VLC appears to play correctly.

One thing remains mysterious: all files now last around 1 minute.  How comes the same XRF data could appear to produce 2 minutes of music before?

What is the true duration of these captures?
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

Quote from: cpcitor on 13:48, 24 May 21
I wrote the changes you asked.

Here are the result:

This seems correct again:

for a in abadia-*xrf ; do echo ; echo $a ; xrf $a - > /dev/null ; done

abadia-1.xrf
VIDEO 384x268px 25Hz - AUDIO 2ch08b 44100Hz
ok: 1510 frames, 0 unused.

abadia-2.xrf
VIDEO 768x536px 25Hz - AUDIO 2ch16b 44100Hz
ok: 1425 frames, 0 unused.

abadia-3.xrf
VIDEO 384x268px 50Hz - AUDIO 2ch08b 44100Hz
ok: 3148 frames, 0 unused.

abadia-4.xrf
VIDEO 768x536px 50Hz - AUDIO 2ch16b 44100Hz
ok: 3141 frames, 0 unused.


Generate AVI again

for XRF in *xrf ; do STEM=${XRF%%.xrf} ;  xrf $XRF - | ffmpeg -y -i - ${STEM}.avi 2>|${STEM}.ffmpeg.log ; done


This shows minor discrepancy in abadia-2.avi, perhaps an effet of closing the emulator during xrf capture maybe?

for a in abadia-*.avi ; do mediainfo $a | egrep '^Duration' | sort | uniq | xargs echo $a ; done | sed 's/Duration *//g' | column  -t -s ":"

abadia-1.avi    1 min 0 s
abadia-2.avi    57 s 40 ms    57 s 51 ms
abadia-3.avi    1 min 3 s
abadia-4.avi    1 min 2 s


Playing the avi in mpv and VLC appears to play correctly.

One thing remains mysterious: all files now last around 1 minute.  How comes the same XRF data could appear to produce 2 minutes of music before?

What is the true duration of these captures?

Re: "Galaxie", that intro is for CRTC0, what you show is one of the quirks of CRTC1: R12 and R13 are checked while VCC=0, rather than only when VCC becomes 0.

Re: video duration, the header of AVI files includes several measurements, including the expected duration of the video and audio streams. Both values must match time-wise (they can differ sample-wise because of the impact of lossy data compression) but the old XRF, by storing the audio sample size improperly (always 4 bytes, rather than 4 bytes for 16-bit stereo and 2 bytes for 8-bit stereo) made the AVI header look like the audio stream was twice as long (4:2) as the video stream. (also, abadia-2 is shorter because I simply stopped recording when the writer paused before turning pages, rather than actually keeping a timer)
(if you can't see the banner right now my server is currently offline)

cngsoft

#154
Alright, I upgraded the upgrade with the XRF and AVI fixes:

20210522 -- minor patch fixing bugs in the ASIC (modifying the SSCR has an immediate impact; SSSL is checked when HCC==R1 rather than when HCC==R0; reported by NoRecess), the PSG (register 15 is valid, even if the hardware doesn't use it: the Plus demo "Phat" plays its music properly now), the Z80 (EI always delays the next IRQ, no matter the previous state of the interrupt enable flag, and OUTI sends the OUT signal during its last microsecond rather than during the second-to-last; "KKB First" demo needed both fixes to run correctly; reported by Hicks) and the FDC (errors imply delays that must be emulated: the original protected disc of "Bad Cat" accidentally relies on this; reported by Dlfrsilver). The debugger accepts very simple expressions (additions and substractions) when entering 16-bit values (address of "Go To", length of "Output"...) and the integer zoom allows 50% steps rather than 100% because the default size is technically 200% rather than 100%.
20210524 -- minor patch fixing bugs in film recording: field size errors on 64-bit machines, improper AVI header sound sample size on 8-bit output (both reported by Cpcitor), and accumulated dirt between multiple recordings within the same session. XRF also shows the length of the output file..
(if you can't see the banner right now my server is currently offline)

cpcitor

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.

cpcitor

Quote from: cpcitor on 10:50, 25 May 21
https://github.com/cpcitor/cpcec updated with latest patch!

https://github.com/cpcitor/cpcec updated again from http://cngsoft.no-ip.org/cpcec.htm .

Quote from: cngsoftminor patch aligning the X-Masking video effect to the right instead of
    the left. The debugger expressions accept three new operators: & (AND),
    | (OR) and ^ (XOR). XRF shows the output file's accurate byte length
    rather than just the megabytes, and running it without a target
    parameter prints the source video parameters and the expected size.

    This commit corresponds to archive: cpcec-20210526.zip
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

#157
Let's update the update with further updates: (pictured here, "Trigger" for CPC, "Enforcer" for CPC Plus, "Mike Gunner" for Spectrum 48k and "Solo" for Spectrum 128K)




20210609 -- minor patch adding lightgun emulation for CPC (Trojan, Gunstick and Westphaser on joystick port) and Spectrum (Gunstick on Sinclair 1 and Kempston ports), recreating a CRTC0 quirk (when R6==0 a single scanline is shown, rather than none as in other CRTC types) and improving the choice of the filler colour when half scanlines are on. The SDL2 version now handles mouse clicks when the button is up to improve consistency with other user interfaces. Tape acceleration options stick between sessions.
(if you can't see the banner right now my server is currently offline)

cpcitor

Quote from: cngsoft on 13:52, 10 June 21
Let's update the update with further updates: (pictured here, "Trigger" for CPC, "Enforcer" for CPC Plus, "Mike Gunner" for Spectrum 48k and "Solo" for Spectrum 128K)

Propagated to https://github.com/cpcitor/cpcec . Congrats again cngsoft for your work.
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

Here we have two small updates in a row:
* 20210624 -- minor patch adding Spectrum Dandanator support, and making both emulators able to load Dandanator cartridges from the command line and the key F3. Several heuristics ensure that the cartridges match the current system.
* 20210626 -- minor patch fixing several format errors ("%i" in place of "%d" or "%u" and so on), a bug in the CRTC (3D cylinders part of "PhX" on CRTC3) and another one in the Spectrum Dandanator ("LD (DE),A" trap). Slightly safer snapshot block loading on both CPCEC and ZXSEC.

The CHIPNSFX tracker got an update, too:
* 20210626 -- minor patch making vibratos fully stable even in fringe cases reported by Adrián, and reworking the +512 experimental flag into a read-only mode where the player exclusively relies on the chipnsfx_bss buffer, instead of using self-modifying operations, also following an idea from Adrián.
(if you can't see the banner right now my server is currently offline)

cpcitor

Quote from: cngsoft on 22:57, 28 June 21
Here we have two small updates in a row:
* 20210624 -- minor patch adding Spectrum Dandanator support, and making both emulators able to load Dandanator cartridges from the command line and the key F3. Several heuristics ensure that the cartridges match the current system.
* 20210626 -- minor patch fixing several format errors ("%i" in place of "%d" or "%u" and so on), a bug in the CRTC (3D cylinders part of "PhX" on CRTC3) and another one in the Spectrum Dandanator ("LD (DE),A" trap). Slightly safer snapshot block loading on both CPCEC and ZXSEC.

The CHIPNSFX tracker got an update, too:
* 20210626 -- minor patch making vibratos fully stable even in fringe cases reported by Adrián, and reworking the +512 experimental flag into a read-only mode where the player exclusively relies on the chipnsfx_bss buffer, instead of using self-modifying operations, also following an idea from Adrián.

Propagated to https://github.com/cpcitor/cpcec . Congrats again cngsoft for your work.
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.

MiguelSky

I'm having some trouble saving data from some games/program to disk. One example is Le Voyage du Nephi: it does not save game to disk (it does in other emus).

pelrun

The emulator defaults to opening disc images read only, have you checked that?

SkulleateR

got the same problem with my Raspberry Pi compiled version ... is there a way to set READ/WRITE permanent at boot ? Perhaps in INI ? Found nothing about it in the readme or help file ...

MiguelSky

Oh, thanks! I hadn't realized that option.

MiguelSky

#165
Oh, I'm afraid the option is not saved from one session to another even when the tick keeps on being off. :( I wasted some time this morning playing Le Voyage du Nephi  :picard:
In fact, a BASIC test program is not saved to disc (although the firmware doesn't complain).

SkulleateR

That's what my question was about ... I must enable read/write every time I attach a disk image and that's not very comfortable ....

pelrun

There is a persistent setting for it in the code, but it looks like it's only available if you're using the windows UI...

SkulleateR

Quote from: pelrun on 03:37, 12 August 21
There is a persistent setting for it in the code, but it looks like it's only available if you're using the windows UI...
Thanks for the info, don't have a Windows machine anymore so I couldn't test myself ....

cngsoft

How old are the versions you're using? Either way, here are the three ways to set the read-write disc flag:
1.- the configuration file: "fdcw 1" sets the read-only default mode, while "fdcw 0" sets the read-write mode.
2.- the SDL2 interface's menu: right-click on the emulator window or press F10 to see it. The option's name is "Read-only as default" and it's together with the disc and tape options.
3.- the disc file picker: the read/write mode checkbox is visible on Windows versions before Windows 7; later versions hide it into a context menu on the "open" button. The SDL2 version shows the read/write menu if you press TAB.
(if you can't see the banner right now my server is currently offline)

SkulleateR

Using CPCEC 20201215 here, was the only one I got compiled on my Pi400 64Bit


Setting the read/write in the "insert disk" menu works but it's fiddly when you swap disks often. Also tried to alter the CPCEC.INI with "fdcw 0" but it doesn't do anything.

MiguelSky

#171
Using 20210626. I try to keep it updated all time. As I said in my former message, form W10 with the option unticked any saving to disc are not done, but there is no error message from AMSDOS.


EDITO: Testing a bit more, in the conf file I see fdcw set to 2, both setting it to 1 or 0 now launch dis is write protected when trying to save, If I toggle the Strict write to disc option to off (I think it already was of before, it must have changed when editing cfg file), the behaviour is the same I described upper.

cngsoft

Two months, two updates:
- 20210730 -- minor patch adding mouse support to the debugger and fixing bugs in the ASIC (modifying register 9 tests whether the new value is equal or lower than its counter, horizontal splitting doesn't draw garbage or retrigger IRQs: final scroller of "PhX") and the CRTC: reading the wrong port no longer returns the right value (secret part of "École Buissonière") and HSYNC events are filtered more carefully ("Chany Dream Demo 5", "Madness Demo", "Sub Hunter"...) unless the user prefers the old behavior ("Hard H-Hold" option). Several menu items have been relocated to set hardware traits and emulation options apart. CPCEC saves compressed memory blocks within snapshots unless "Strict SNA files" is enabled.
- 20210831 -- minor patch adding performance improvements to TZX/CDT playback and emulation of the Turbo Sound musical extension for ZXSEC, and removing the "Hard H-Hold" option from CPCEC, now useless thanks to further CRTC tweaks and the incipient emulation of the LA-7800 chip. The Windows version fixes a bug in joystick allocation, the SDL2 version understands UTF-8 filesystems and its user interface is a little more agile, and both versions can open GZIP archives and fix bugs in temporary file handling and YM file logging. CPCEC got a new icon.



One more thing on the disc-write protection, by the way. The protection is handled when the disc image is opened (i.e., the fopen() option "rb" versus "wb"); changing the disc-write settings while a disc is inside the virtual drive doesn't change its write-enabled status.
(if you can't see the banner right now my server is currently offline)

cpcitor

Quote from: cngsoft on 20:31, 01 September 21Two months, two updates:
- 20210730 -- minor patch adding mouse support to the debugger and fixing bugs in the ASIC (modifying register 9 tests whether the new value is equal or lower than its counter, horizontal splitting doesn't draw garbage or retrigger IRQs: final scroller of "PhX") and the CRTC: reading the wrong port no longer returns the right value (secret part of "École Buissonière") and HSYNC events are filtered more carefully ("Chany Dream Demo 5", "Madness Demo", "Sub Hunter"...) unless the user prefers the old behavior ("Hard H-Hold" option). Several menu items have been relocated to set hardware traits and emulation options apart. CPCEC saves compressed memory blocks within snapshots unless "Strict SNA files" is enabled.
- 20210831 -- minor patch adding performance improvements to TZX/CDT playback and emulation of the Turbo Sound musical extension for ZXSEC, and removing the "Hard H-Hold" option from CPCEC, now useless thanks to further CRTC tweaks and the incipient emulation of the LA-7800 chip. The Windows version fixes a bug in joystick allocation, the SDL2 version understands UTF-8 filesystems and its user interface is a little more agile, and both versions can open GZIP archives and fix bugs in temporary file handling and YM file logging. CPCEC got a new icon.

Propagated to https://github.com/cpcitor/cpcec . Congrats again cngsoft for your work. ;-)
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

Another small update, focusing more on ZXSEC than on CPCEC:


20210909 -- minor patch fixing bugs in the video render logic of ZXSEC, effectively ensuring that the multicolour effects seen in the tests ULA48, ULA128, FPGA48 and FPGA128 and the games made with the Nirvana engine ("Dreamwalker", "Multidude", "Stormfinch", "Sunbucket"...) show properly, and adding new audio extensions for CPCEC (Digiblaster audio) and ZXSEC (Covox $FB DAC) plus preliminary emulation of Pentagon 128 timings and (if the TRDOS.ROM file is available) the Beta128 disc drive and its TRD and SCL files.
(if you can't see the banner right now my server is currently offline)

Powered by SMFPacks Menu Editor Mod