What are your current Spectrum projects?

Show us what you're working on, (preferably with screenshots).
User avatar
Joefish
Rick Dangerous
Posts: 2041
Joined: Tue Nov 14, 2017 10:26 am

Re: What are your current Spectrum projects?

Post by Joefish »

R-Tape wrote: Tue Jul 10, 2018 8:39 pm Long delays could be an opportunity for some proper in game beeper FX too.
Thinking about this, I don't want to add a big artificial delay in there. But I could do the sort of thing I did with Buzzsaw+, and integrate the beeper loop with the screen copy loop (in Buzzsaw+ a beeper 0/1 was generated after each line of multicolour was copied).

The screen copy loop takes around 1.4 frames. If the game can run in 3 frames then that's nearly a 50% duty cycle for sound effects. I suppose I could artificially extend that period of speaker control, but I doubt I could do anything else productive with that extra time other than twiddle the speaker. If I entered a different loop to do something else then the sound frequency would shift (unless the loop had exactly the same timing as the screen copy). And I wouldn't want to extend it so the game goes any slower than 4 frames.

Come to think of it, the timing of a screen copy is going to be all over the place as it goes in and out of contention, so maybe that's not the best idea I've had...
Climacus
Drutt
Posts: 28
Joined: Thu Nov 30, 2017 7:40 pm

Re: What are your current Spectrum projects?

Post by Climacus »

MatGubbins wrote: Wed Jul 18, 2018 11:02 am
Climacus wrote: Wed Jul 18, 2018 10:25 am By now, I dont have any time for coding. Perhaps after summer.
The last Ive done for Spectrum is a video-series (in Spanish) analizing the code of Martianoids in this blog.
Perhaps it can be useful.

https://analisiscodigomartianoids.blogspot.com/

Nice!!
way back in 2002, I wrote a map editor for Martianoids
https://spectrumcomputing.co.uk/index.p ... 6&id=16646
Great!!!
Very interesting!!!!!
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: What are your current Spectrum projects?

Post by R-Tape »

Joefish wrote: Wed Jul 18, 2018 10:00 pm Come to think of it, the timing of a screen copy is going to be all over the place as it goes in and out of contention, so maybe that's not the best idea I've had...
You're more of a perfectionist than me! I'd be happy with a (slightly clunky) nearly but not quite constant framerate. I think some decent sounds could be achieved just by 'animating' the speaker twiddles/calculated delays during the spare 2 or so frames every loop.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: What are your current Spectrum projects?

Post by R-Tape »

Image

Finally some bad weather! Managed to get plenty of coding done on Bean Brothers.
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

I'm working on a new game for the Speccy (Castaway was my previous one, that feels ages ago!).

Shot from my ZX Spectrum+ with a Sony Trinitron TV:
Image

Regular screenshoot from emulator:
Image

I'm still not 100% sure what is the game about, but I think it may turn out the game I couldn't make when I released Escape from Colony 8.

A bit of adventure exploring a space base, with puzzles type of use object X with Y. The story may be a continuation of Castaway (not that it is too important).

I'm targeting 48K, but this time I started with my own routines from scratch using SDCC (if I'm not using the SP1 sprite library, it doesn't make sense using the Z88DK compiler). I'm implementing basic 1 char multi-directional scroll, and so far not using SP1 is paying off because I have lots of memory :D

In case you don't know, I usually tweet about 8-bit gamedev (inc. this game): https://twitter.com/reidrac

EDIT: the game title (for now) is Starblind.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: What are your current Spectrum projects?

Post by dfzx »

reidrac wrote: Wed Dec 26, 2018 3:16 pm I'm targeting 48K, but this time I started with my own routines from scratch using SDCC (if I'm not using the SP1 sprite library, it doesn't make sense using the Z88DK compiler).
I can't agree with that! Z88DK provides over 1,000 library routines, all hand coded in Z80 assembler. The SP1 sprite library is just a very small part of it, maybe a couple of dozen routines at most. Nothing in Z88DK forces a programmer to use SP1, or any other part of of the libraries. There's an awful lot of good stuff there, all ready to use!

If you're writing in C for the Spectrum, it makes perfect sense to use Z88DK. In fact, since Z88DK uses SDCC as its C compiler, by using raw SDCC you're really just restricting yourself to a subset of Z88DK anyway.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: What are your current Spectrum projects?

Post by Ralf »

Regular screenshoot from emulator:
I'm still not 100% sure what is the game about, but I think it may turn out the game I couldn't make when I released Escape from Colony 8.
The graphics looks like they are inspired by Laser Squad ;) Am I true about it?
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

Ralf wrote: Wed Dec 26, 2018 7:12 pm
Regular screenshoot from emulator:
I'm still not 100% sure what is the game about, but I think it may turn out the game I couldn't make when I released Escape from Colony 8.
The graphics looks like they are inspired by Laser Squad ;) Am I true about it?
Yes, they look similar, but I didn't look at Laser Squad for inspiration until someone said it looked like Laser Squad.

It is just top-down. As I mentioned, I made Escape from Colony 8 (4 years ago): https://www.usebox.net/jjm/colony8/
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

dfzx wrote: Wed Dec 26, 2018 6:45 pm
reidrac wrote: Wed Dec 26, 2018 3:16 pm I'm targeting 48K, but this time I started with my own routines from scratch using SDCC (if I'm not using the SP1 sprite library, it doesn't make sense using the Z88DK compiler).
I can't agree with that! Z88DK provides over 1,000 library routines, all hand coded in Z80 assembler. The SP1 sprite library is just a very small part of it, maybe a couple of dozen routines at most. Nothing in Z88DK forces a programmer to use SP1, or any other part of of the libraries. There's an awful lot of good stuff there, all ready to use!

If you're writing in C for the Spectrum, it makes perfect sense to use Z88DK. In fact, since Z88DK uses SDCC as its C compiler, by using raw SDCC you're really just restricting yourself to a subset of Z88DK anyway.
I've used both SDCC and Z88DK and I think SDCC is a more advanced compiler (I can use C99!). To be honest, other than SP1, input and some very specific runtime support, I always code everything else myself. I use SDCC for my CPC projects, so using it for the speccy wasn't too difficult.

I'm writing a lightweight library in ASM for SDCC, and that's what I'm using for the game (being almost everything else C).
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: What are your current Spectrum projects?

Post by dfzx »

reidrac wrote: Thu Dec 27, 2018 8:19 am I've used both SDCC and Z88DK and I think SDCC is a more advanced compiler (I can use C99!).
But Z88DK uses SDCC!* If you build Z88DK yourself you have to apply a small patch to the SDCC source and rebuild the compiler in order to enable a couple of things Z88DK needs. Other than that tweak, Z88DK is SDCC, C99 included.

[*] Z88DK actually provides 2 compilers, SDCC and the older sccz80. You can choose which one you want to use. Nowadays SDCC is the obvious choice unless your project needs some legacy feature support.
reidrac wrote: Thu Dec 27, 2018 8:19 am To be honest, other than SP1, input and some very specific runtime support, I always code everything else myself.
Yes, fair enough. All coders will recognise the fun and satisfaction in that approach. It was just that your original post suggested that SP1 was the only sensible reason to choose Z88DK, which is very far from the truth. :)

Your game looks great so far, way better than anything I'm ever likely to produce!
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: What are your current Spectrum projects?

Post by bob_fossil »

dfzx wrote: Thu Dec 27, 2018 12:37 pm [*] Z88DK actually provides 2 compilers, SDCC and the older sccz80. You can choose which one you want to use. Nowadays SDCC is the obvious choice unless your project needs some legacy feature support.
SDCC is more standards compliant and generates smaller and faster code but I still use sccz80 as my workflow compiler as I've found it's much faster for my projects - SDCC was a bottleneck in my edit / compile / run cycle.

I only use SDCC to do a final build after getting it into shape with sccz80. I've also had SDCC generate completely the wrong assembly for my C code on a couple of occasions which caused my program to crash. sccz80 generated the correct code without issue.
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

dfzx wrote: Thu Dec 27, 2018 12:37 pm
reidrac wrote: Thu Dec 27, 2018 8:19 am I've used both SDCC and Z88DK and I think SDCC is a more advanced compiler (I can use C99!).
But Z88DK uses SDCC!* If you build Z88DK yourself you have to apply a small patch to the SDCC source and rebuild the compiler in order to enable a couple of things Z88DK needs. Other than that tweak, Z88DK is SDCC, C99 included.

[*] Z88DK actually provides 2 compilers, SDCC and the older sccz80. You can choose which one you want to use. Nowadays SDCC is the obvious choice unless your project needs some legacy feature support.
reidrac wrote: Thu Dec 27, 2018 8:19 am To be honest, other than SP1, input and some very specific runtime support, I always code everything else myself.
Yes, fair enough. All coders will recognise the fun and satisfaction in that approach. It was just that your original post suggested that SP1 was the only sensible reason to choose Z88DK, which is very far from the truth. :)

Your game looks great so far, way better than anything I'm ever likely to produce!
You misunderstood my post. The only reason why I was using Z88DK was SP1. If I'm going to use the SDCC compiler in Z88DK, I rather use SDCC directly.

I know Z88DK reasonably well (this is my game: https://github.com/z88dk/z88dk/tree/mas ... /BlackStar), thanks for the tips!
Last edited by reidrac on Thu Dec 27, 2018 2:21 pm, edited 1 time in total.
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

bob_fossil wrote: Thu Dec 27, 2018 1:01 pm
dfzx wrote: Thu Dec 27, 2018 12:37 pm [*] Z88DK actually provides 2 compilers, SDCC and the older sccz80. You can choose which one you want to use. Nowadays SDCC is the obvious choice unless your project needs some legacy feature support.
SDCC is more standards compliant and generates smaller and faster code but I still use sccz80 as my workflow compiler as I've found it's much faster for my projects - SDCC was a bottleneck in my edit / compile / run cycle.

I only use SDCC to do a final build after getting it into shape with sccz80. I've also had SDCC generate completely the wrong assembly for my C code on a couple of occasions which caused my program to crash. sccz80 generated the correct code without issue.
Yes, I had that same issues with SDCC (bugs in the optimizer I believe). It has improved over the time (although there are regressions every now and then), but there are still few issues. I have to say that Z88DK has crashed few times while compiling, but it never generated broken code :lol:

Sorry, we hijacked this thread to discus SDCC vs Z88DK.
Last edited by reidrac on Thu Dec 27, 2018 2:22 pm, edited 1 time in total.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: What are your current Spectrum projects?

Post by dfzx »

bob_fossil wrote: Thu Dec 27, 2018 1:01 pm SDCC is more standards compliant and generates smaller and faster code but I still use sccz80 as my workflow compiler as I've found it's much faster for my projects - SDCC was a bottleneck in my edit / compile / run cycle.
I'm aware that the SDCC optimiser can be painfully slow, but I have no speed problems with optimisation turned off. But then I use makefiles for anything greater than trivial, so maybe that helps? My biggest project is about 5000 lines of code in 14 C files and 10 ASM files. With 12 concurrent compiles/assemblies and SDCC optimisation off, my 6 year old PC (8 core CPU) builds it from scratch in about 4 seconds, including a handful of housekeeping and information extraction scripts.
bob_fossil wrote: Thu Dec 27, 2018 1:01 pm I've also had SDCC generate completely the wrong assembly for my C code on a couple of occasions which caused my program to crash. sccz80 generated the correct code without issue.
That surprises me. I've never seen it do that. Did you manage to isolate and report the problem? Compiler developers are normally all over incorrect code generation like a rash.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: What are your current Spectrum projects?

Post by dfzx »

reidrac wrote: Thu Dec 27, 2018 2:15 pm I know Z88DK reasonably well (this is my game: https://github.com/z88dk/z88dk/tree/mas ... /BlackStar), thanks for the tips!
:lol: Talk about my teaching Granny to suck eggs. (An expression for non native English speakers to look up!)

Apologies. Blackstar is the definite reference work for Z88DK/SP1 development, although I'm very slowly trying to change that. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

dfzx wrote: Thu Dec 27, 2018 2:24 pm
reidrac wrote: Thu Dec 27, 2018 2:15 pm I know Z88DK reasonably well (this is my game: https://github.com/z88dk/z88dk/tree/mas ... /BlackStar), thanks for the tips!
:lol: Talk about my teaching Granny to suck eggs. (An expression for non native English speakers to look up!)

Apologies. Blackstar is the definite reference work for Z88DK/SP1 development, although I'm very slowly trying to change that. :)
I don't really like too much the patronising comments on the README when the game was imported (dammit! :mrgreen:), but if you have questions or want to discuss anything, I'm happy to help.

After that one I wrote Castaway (not open source for now), and I concluded that SP1 is not the right tool for mid-sized 48K games. When I finish my current game I'll open source my SDCC library (although it won't be as powerful as SP1, I can tell you that).

Btw, I bit more on-topic in this thread, I was debugging my dirty/clean tile engine and I produced this video: https://twitter.com/reidrac/status/1077934804576931841
Alcoholics Anonymous
Microbot
Posts: 194
Joined: Mon Oct 08, 2018 3:36 am

Re: What are your current Spectrum projects?

Post by Alcoholics Anonymous »

reidrac wrote: Thu Dec 27, 2018 2:15 pm You misunderstood my post. The only reason why I was using Z88DK was SP1. If I'm going to use the SDCC compiler in Z88DK, I rather use SDCC directly.
There is a big difference in sdcc on its own and sdcc within z88dk (called zsdcc). Many of the code generation bugs in sdcc have been addressed in zsdcc and the code generated is better. Usually you will see 5-10% difference in size, depending on what you are doing, on just the C code and it can go much higher if you are hitting expensive portions of the library. There are examples where zsdcc compiles to 40k whereas sdcc compiles to 60k when using things like 32-bit ints or floats.

The library in z88dk is much more comprehensive and standards compliant than sdcc. In addition, its written in assembly language whereas sdcc's is written in C. This leads to programs being smaller (see the edge case 40k versus 60k above) as well as faster. I do see a lot of people writing their own library code instead of using what comes with the compiler. On sdcc it doesn't make a difference because what it provides is in C already but in z88dk your program is being punished. If you're not using the library functions, you are still using compiler code for things like multiplication, division, reading/writing 32-bit / 64-bit integers (should you use such a thing). In sdcc, only 16-bit mult and div is in assembly language. In z88dk all of this is in assembly language including going up to 72-bit math.

The tooling around sdcc is very basic. The tooling around z88dk allows you to generate standard output forms for target machines like tap, sna, eg. The banking capabilities of machines is also built-in so z88dk can deal with that too without extra work.

The only reason to use sdcc on its own for zilog-related stuff is because you're used to it. Otherwise you are ending up with a more difficult toolset that produces poorer code :)
User avatar
reidrac
Drutt
Posts: 20
Joined: Sun Dec 09, 2018 4:27 pm
Location: Bristol, UK
Contact:

Re: What are your current Spectrum projects?

Post by reidrac »

Post Reply