MZ-700 demos

Is there such a thing as an MZ demoscene?
MooZ
Posts: 33
Joined: Thu Mar 01, 2018 9:39 am

Re: MZ-700 demos

Post by MooZ » Wed May 20, 2020 6:34 am

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.

hlide
Posts: 373
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 demos

Post by hlide » Wed May 20, 2020 9:07 am

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.

hlide
Posts: 373
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 demos

Post by hlide » Wed May 20, 2020 9:17 am

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

MooZ
Posts: 33
Joined: Thu Mar 01, 2018 9:39 am

Re: MZ-700 demos

Post by MooZ » Sun May 24, 2020 2:52 pm

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 34 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 32 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
Attachments
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 32 times

hlide
Posts: 373
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 demos

Post by hlide » Sun May 24, 2020 9:51 pm

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

Post Reply