Support for TS 2068 hi-colour mode sprites in SP1?

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
Stefan123
Member
Posts: 85
Joined: Fri Oct 21, 2016 7:57 am

Support for TS 2068 hi-colour mode sprites in SP1?

Post by Stefan123 »

Hi,

I just recently stumbled upon the Spectrum Next web site http://www.specnext.com/ and was overwhelmed with nostalgia and desire to have such a device when its available :) They also have a Facebook group for discussions around the Spectrum Next.

It would be fun to develop something for the Spectrum Next (and the vanilla Spectrum as well) and since my knowledge in Z80 assembler is quite limited (I played games and toyed with BASIC during the 80s) I thought of using C instead. After a bit of research, I decided that z88dk was the most promising C compiler and runtime library for Spectrum.

I'm now fiddling with the SP1 library and its sprites. The Spectrum Next will have support for several new graphics modes where the TS 2068 hi-colour mode is one of them. There's also talk of support for hardware sprites :)
I've read that splib2, the precursor to SP1, had support for sprites in TS 2068 hi-colour mode. Did that feature not make it into the SP1 library? I can only see references to the monochrome TS 2068 hi-res mode in SP1.

Regards,
Stefan
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I've read that splib2, the precursor to SP1, had support for sprites in TS 2068 hi-colour mode. Did that feature not make it into the SP1 library? I can only see references to the monochrome TS 2068 hi-res mode in SP1.
No it never made it that far unfortunately. While writing that version I realized it could be made faster and smaller using another method and simply finished the most commonly used ports in the expectation that the next version would be better and more easily accommodate more video modes. (The 512x192 mode is not commonly used at all but it is related to the zx81's high res 256x192 mode so was essentially free). I still intend to come back to it but there are several higher priorities currently.

Besides sp1, there are also the nirvana and bifrost engines inside z88dk. These engines are for the spectrum specifically and provide 8x1 colour resolution & eight 16x16 sprites to the spectrum without extra hardware. There are some simple examples in z88dk/libsrc/_DEVELOPMENT/EXAMPLES/zx ../demo_sp1, ../demo_nirvanap etc that show simple usage of sp1 / nirvana / bifrost. There is a game currently being developed that is a mario bros clone using nirvanap for high resolution colour so it is capable of doing good things. You can see some screenshots here http://www.worldofspectrum.org/forums/d ... os-demo/p2

At higher cpu speeds, sp1 would sing because it is a free running engine not tied to to the interrupts. The colour engines nirvana and bifrost are closely tied to the interrupt rate and cpu speed so they would have to be modified to accommodate a faster clock.

The sprite engines tend to require a lot of memory. For larger games, the new c library divides the library into fine grained sections that allow better control of placement in memory and extra memory banks of specific library modules and user code and data. For large games, it makes it possible to plan how the game is distributed across memory banks. z88dk has come a long way in the past year and it is now possible to write sw that spans multiple memory banks with programmer-supplied planning & guidance.
I just recently stumbled upon the Spectrum Next web site http://www.specnext.com/ and was overwhelmed with nostalgia and desire to have such a device when its available :) They also have a Facebook group for discussions around the Spectrum Next.

It would be fun to develop something for the Spectrum Next (and the vanilla Spectrum as well) and since my knowledge in Z80 assembler is quite limited (I played games and toyed with BASIC during the 80s) I thought of using C instead. After a bit of research, I decided that z88dk was the most promising C compiler and runtime library for Spectrum.
Yes I've seen the excitement around the next. I plan to add a target for the next and am trying to accelerate disk i/o for esxdos so that C stream i/o will be available for it.

When choosing a z80 c compiler, the choices in the past have normally been between z88dk and sdcc. That's no longer the case -- sdcc has been brought into z88dk and can be used as compiler from within the kit. The best of both projects have been brought together :)

If you're using windows or osx, sdcc is already part of the nightly build and can be put to immediate use. For linux, there are some install instructions here:

http://www.z88dk.org/wiki/doku.php?id=t ... s_optional

There are examples of using sdcc with the new c library in z88dk/_DEVELOPMENT/EXAMPLES (compile lines for both sdcc and sccz80 tend to be at the top of .c files). sdcc can also be used with the classic library. If you need more information, just ask :)
Stefan123
Member
Posts: 85
Joined: Fri Oct 21, 2016 7:57 am

Post by Stefan123 »

Alvin, thanks for your detailed answer. I'm impressed with all the great work you have put into z88dk, the C runtime libraries, SP1 etc! For the future, I hope you do find some time to add TS 2068 hi-colour support to SP1.

I will continue playing with SP1 and take a look at nirvana and bifrost.

Great to hear that you're working on a Spectrum Next target in z88dk! :)

Regards,
Stefan
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Stefan123 wrote:For the future, I hope you do find some time to add TS 2068 hi-colour support to SP1.
I'll have a quick look at it sometime soonish. If not a lot has to be done, I'll go ahead and add it. In the past no one has actually used it (the timex user base is quite small) but now there are devices coming out that support that video mode. Especially with the option on the next of increased cpu speed, this would be a very viable way to do high quality games. At regular cpu speed, you do have to balance against the fact that the hi-colour mode pushes around twice as much data.
I'm impressed with all the great work you have put into z88dk
That credit should be shared with the other devs -- others are also making significant contributions as well that have shaped where z88dk is and where it's going :)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Short note: the ts2068 "monochrome lib" has been broken for a while in the line drawing code.
It affected also the vector graphics (i.e. those pictures imported from the SVG format).

Now fixed.
Post Reply