Page 3 of 9

Re: MZ-700 demos

Posted: Wed May 20, 2020 6:34 am
by MooZ
I haven't since I'm testing using the MZ-700 emulator from the common source code project. It's like running them on a NTSC machin with international charset.
I tried Mame when I started but it was not that great.

I'll make a test this week end.

Re: MZ-700 demos

Posted: Wed May 20, 2020 9:07 am
by hlide
I modified EmuZ-700 source to make a PAL version with PAL timings (borrowed from EmuZ-800). The purpose was to test my current game which is written to use the PAL timings. I tried several demos (including yours) I could find on Pouët website. There is only one demo (neotokyo) which fails on the last part (the one with graphics), be it with PAL or NTSC EmuZ-700.

Re: MZ-700 demos

Posted: Wed May 20, 2020 9:17 am
by hlide
Here is the link to the binary package offering both PAL and NTSC version of EmuZ-700: the PAL version runs the CPU at the expected frequency (17MHz/5 and not 14MHz/4), the FPS will be capped to 50 instead of 60 and the video timings are those given in the PAL MZ-700 service manual. I maybe miss something as things in EmuZ-700 tend to be hardcoded though. It is no clear the video capture is really capturing 60fps or means a full capture (and so 50fps in fact).

The handling of BLNK signal doesn't seem to be emulated strictly as the document says: /BLNK is shorter than /HBLNK and should have a shift that I don't see in the emulator. I wonder it may explain the bad result with neotokyo at the end.

Link: https://www.dropbox.com/s/6tuyibps8zb4g ... 00.7z?dl=0

Re: MZ-700 demos

Posted: Sun May 24, 2020 2:52 pm
by MooZ
I made a quick test by adding a extra push/pop to the line update. It worked but the last word is repeated as I ran out of registers.

Code: Select all

macro raster_update, index
    ld sp, ix
    pop bc
    pop de
    pop hl
    exx
    pop bc
    pop de
    pop hl
    pop hl

    ld sp, iy
    push hl
    push hl
    push de
    push bc
    exx
    push hl
    push de
    push bc
    
    ld bc, 14
    add ix, bc
mend
Capture d’écran du 2020-05-24 16-33-09.png
Capture d’écran du 2020-05-24 16-33-09.png (13.34 KiB) Viewed 8898 times
I tried to save the penultimate hl but it's taking too long.

Code: Select all

macro raster_update, index
    ld sp, ix
    pop bc
    pop de
    pop hl
    exx
    pop bc
    pop de
    pop hl
    ld (dummy_{index}), hl
    pop hl

    ld sp, iy
    push hl
dummy_{index} = $ + 1
    ld hl, 0x0000
    push hl
    push de
    push bc
    exx
    push hl
    push de
    push bc
    
    ld bc, 14
    add ix, bc
mend
Capture d’écran du 2020-05-24 16-37-28.png
Capture d’écran du 2020-05-24 16-37-28.png (13.3 KiB) Viewed 8896 times
One solution may to remove inline the whole display loop in order to save 29 cycles by removing:

Code: Select all

    ld bc, 14
    add ix, bc

Re: MZ-700 demos

Posted: Sun May 24, 2020 9:51 pm
by hlide
What about something like that?

Code: Select all

macro raster_update, index, start
    ld sp, start ; to set it with the right initial value before the first raster_update, 0 otherwise
    pop bc
    pop de
    pop hl
    exx
    pop bc
    pop de
    pop hl
    pop ix

    ld sp, iy
    push ix
    push hl
    push de
    push bc
    exx
    push hl
    push de
    push bc
    
    ld a, 14
    add a,(.sp{index}+1)
    ld a,0
    adc a,(.sp{index}+2)
mend
I counted 85 cycles for the critical BLNK part (<92 cycles) and the whole macro is taking 201 cycles for a line (<228 cycles)

EDIT: I added a second argument.

Code: Select all

raster_update 0, ix
...
.sp0: raster_update 1, 0
...
.sp1: raster_update 2, 0
...
.sp{N-1}: raster_update N, 0
...
	db $DD
.sp{N}: ld hl,0 ; ld ix, 0

Re: MZ-700 demos

Posted: Sat May 30, 2020 9:56 pm
by MooZ
I completely forgot about ex af,af' :)
test.zip
(1.59 KiB) Downloaded 358 times

Re: MZ-700 demos

Posted: Sat May 30, 2020 10:16 pm
by hlide
I was always unconfortable to use EX AF,AF' because I wrongly thought POPing AF could enable interrupt but you're right it could perfectly fit here! good finding!

Re: MZ-700 demos

Posted: Sat May 30, 2020 10:25 pm
by hlide
So with EmuZ-700 (PAL timings): should work.
2020-05-31_00-19-40.png
2020-05-31_00-19-40.png (9.61 KiB) Viewed 8786 times
And with EmuZ-700 (NTSC timings): shouldn't work.
2020-05-31_00-19-55.png
2020-05-31_00-19-55.png (11 KiB) Viewed 8786 times
So the last test is to run it on my real MZ-700 to check it works.

The source will be available on GITHUB?

Re: MZ-700 demos

Posted: Sat May 30, 2020 10:30 pm
by hlide
MooZ, serais-tu français ou francophile ? les noms de tes fichiers de capture d'écran sont... en français.

Re: MZ-700 demos

Posted: Sun May 31, 2020 10:59 am
by MooZ
Exactement :)

And... it doesn't work on a real mz700.