https://spectrumcomputing.co.uk/forums/viewtopic.php?t=12416

Some time ago, there was a discussion here about a possible Donkey Kong for the Spectrum, which would be better than the ugly official Ocean version from 1986. There were some attempts to improve it, for example the Arcade Edition from 2019 with partially redrawn and recoloured graphics. There was also a new Retro-Sanctuary's version from 2017 made in AGD, a bit simpler. Then Highrise started to make his version, and later also Bubu. Both versions looked promising, but they were unfinished at the time. I started to make some graphics based on the original arcade version for Bubu, but finally he was busy with other great Spectrum arcade conversions and it turned out that Highrise too. Which I understand, mainly after making my own game, because it's very difficult and time demanding and I probably couldn't make multiple games at the same time.

So in 2022, I decided to add a game to my graphics to make my own version. About a year earlier, I started to learn the Spectrum assembler and to make some vector graphics, but I thought it would be nice to make also something similar to famous Spectrum games. I stopped working on my vector game and I tried to learn and figure out how to make a sprite based game. By the way, making the 3D vector system was easier.

It bothered me a bit that all Spectrum Donkey Kong attempts looked like typical Spectrum games, because they used 1-bit graphics on coloured background, and usually there was a massive colour clash which spoiled mainly the first stage. I didn't want to use sprites coloured by a background, or a background coloured by sprites, or 8 pixels movement, or a thick black border. Moreover, I wanted all sprites masked (including the monkey), with additional pixel and colour masks (which change in every frame), some sprites with more colours (Mario, springs), some of them filled with other colours (barrels on ladders, fires) and some with non-Spectrum colours (orange or blue-violet fire parts). I also remember a discussion about whether the girders should be red or purple, so I mixed both colours. And at least 12 sprites on the screen at the same time, plus the animated monkey in front of the background and behind sprites, plus the burning barrel in front of sprites, plus the banging hammer, plus moving ladders and belt pointers, plus the beeper sound, and all this at the same time in 25 frames per second. And all four stages with the same graphics, size, speed and behaviour as the arcade version - on the Spectrum 48K. Yes, a completely crazy idea, but what do I know about making games.

All graphics were made in Art Studio, converted to various formats using several Basic programs, the assembler program was written in a simple text editor and compiled using Pasmo.

Since I had no previous experience with this type of game, I had no reasonable plan and it's probably not surprising that I had problems to put everything in the Spectrum 48K's memory. So, I had to change some faster and longer program parts to slower and shorter parts, I had to use some already used parts as parts of other parts, and to put several things to the background buffer, which is erased when the main game starts, so we can see them only in the introduction. I was thinking about some kind of compression, but I didn't know how it would work during the game, so I didn't use it at all.

The game uses a graphic system which is a bit crazy and it depends on computer timings, so the program detects the Spectrum type and make different adjustments automatically for every type of Spectrum or its clone, otherwise sprites could flicker. It should detect and adapt it for the english and swedish Spectrum 48K, english, spanish and arabic Spectrum +, english and spanish 128K, english, spanish, french and arabic +2, english, spanish and arabic +2A, +2B, +2E, english and spanish +3, +3E, Timex TC 2048, Pentagon, Scorpion, Didaktik M and Kompakt, Spectrum 48K NTSC, brazilian and argentinian TK90X and TK95, Leningrad, Vesta IK-30, HC-91, BK-001, Dubna and Inves Spectrum +. It works, only the Inves Spectrum + does some strange video memory corruption (I don't know why). I also learned how to make a simple raster multicolour effect for the title screen, which should work on the same computer types. I don't know if machines like Harlequin, Sam Coupé, ATM Turbo, Orel BK-08, Spectrum Next, Timex TC 2048 NTSC etc. have different timings, because either I haven't been able to test the game it their emulators, or I haven't figured out how to detect them.

The game is currently available on cassettes or as a TAP file from Bubu, and I hope some of you will enjoy it.


In the "HOW HIGH" screen before every stage, there is the correct monkey picture and the correct font now. Therefore this screen is no longer needed in the introduction. I also corrected two little graphical errors, which I couldn't repair earlier. There is still one little error, but I have no more free memory. Maybe later.

One of the main criticisms of this game was that it was too easy. Therefore, there are two gameplay changes now. In the third stage, the lifts are faster in level 2 and above. During the first several levels, the fires and the ghosts are a little faster in each subsequent level. Together with the gradually accelerating addition of barrels, fires, springs, and ghosts from the previous version, I hope the game is already hard enough in higher levels. I have several other ideas, but I would need some free memory. Maybe later.

The second criticisms was the beeper sound. I personally like it and it was quite amusing to do. Making pulse-width modulation, sound volume and noise using the speaker vibrations, and tuning tones using a musical tuner has its charm. But now, there is a new possibility to turn on AY sound. It should work on every Spectrum type and clone with the AY sound chip, not only on Spectrum 128K. It is still a Spectrum 48K game, so Spectrum 48K with an external AY (Melodik, ZX-AY etc.) is enough. Several days ago, I made another change, so now it should also work with Fuller Box and DK'Tronics 3-Channel Sound Unit. If the program detects the AY chip (128K etc., Melodik etc., Fuller, DK'Tronics), it automatically selects AY sound (and changes ports for Fuller and DK'Tronics), but beeper/AY can also be selected in the controls screen.

I had no previous experience with programming Spectrum 128K, so the AY sound player probably isn't perfect. Moreover, it only uses the same sound data as for the beeper (not enough memory for other tables), so it can do only one voice, but at least I added a phaser effect with a sub-oscillator to make it sound more arcade. The AY player has to compute different numbers from the beeper data using a division of 16-bit number / 8-bit number, which is quite slow and maybe the music isn't at perfect pitch, but it sounds OK. Other sound and noise effects also could be better with more memory (volume changes, noise frequency changes, multiple sounds at the same time etc.).

The only thing I wanted to change but couldn't yet is the monkey ladder climbing animation, which is still only in the introduction. I will try to figure it out, but I am not sure if it would be possible. Two less important things still missing are a high score table and the monkey dance at the end.


The game detects and automatically adapts its variables for several more computer types including Orel BK-08, Spectrum Next (50 Hz - 48K, 128K, +3; 60 Hz - 48K, 128K, +3), Sam Coupé, Scorpion Turbo +, ATM Turbo and ATM Turbo 2+. I haven't yet found any emulation of the american version of Timex TC 2048 (NTSC) and several other popular types. I still appreciate tests on real computers, because I can't be sure that the game works correctly on machines which I know only from emulation. For example I still don't know which of several TK90X/TK95 emulators is accurate, because each of them emulates them differently (are there any TK90X or TK95 users in this forum?). So, this part of the program can still change in the future.


The current AY sound in Donkey Kong is a quick hack to fit in the 48K memory, so people with Spectrum 48K + AY can use it, too. A proper AY sound can be better, but it's a possibility for the 128K version for the next year.

Yes, the current Sam version plays only through the beeper, but I am working on the SAA sound support, so I hope I will upload it here soon. When the sound will work, I will be able to use it also in the possible 128K version for the Sam. Of course, a proper Sam version should have different graphics, but I don't know almost anything yet about the Sam graphics possibilities and how difficult it would be.



? I'm curious what the colours on that Mario sprite look like when he moves around in less than 8 pixels at a time, particularly jumping, as in all those screenshots he seems to be aligned in exactly the same position with respect to the character / attribute grid. 

Yes, his colours change when he moves horizontally and vertically. All his colours are computed according to his pixel position in the character grid to look the best possible. So for example sometimes his cap is magenta, sometimes it's yellow. Sometimes his trousers are full red, sometimes half red.


? Not much in this, but it's a weird choice to put the Kong climbing animation before the menu screen in DKZX, and only show both of them once (as well as the title screen and "DONKEY KONG" screen). Seems like a waste of nice work - since it lets you skip the animation by pressing fire anyway, why not have it at the start of every game?

Yes, you are right, it looks strange and I was disappointed that I couldn't put it the right way. It's because I didn't have enough free memory, so I couldn't make the high score table and I had to put the "DONKEY KONG" screen, the climbing animation and the proper monkey picture from the "HOW HIGH" screen in the screen buffer. That's why you can see it only after loading the game. But if you wait about 20 seconds on the control selection, it repeats. Sorry, I didn't know how to do it better. But I could do it better in the 128K version.


? This is your FIRST attempt at writing a game in assembly language? Unbelievable. This must be the greatest debut of all time...

It's my second attempt to write something in assembly language which would be bigger than 30 lines of code. The first attempt was a vector graphics system, but I was making it only for a short time just before Donkey Kong, it's unfinished and unfortunately I couldn't use almost anything I learned there for Donkey Kong. But now, when I gained some experience, I can return to the vector thing, improve it and maybe make the second game.

Yes, it's true that it would be better on Spectrum 128K. You can see how little I knew about making games, when I thought 48K would be enough for it. :) I think it could be done a bit better even on 48K, I am not completely satisfied with some program parts, but it would be too hard to modify them now.

By the way, when I studied the arcade game behaviour, I didn't notice the information that the conveyors and elevators speed up and you get more pies in higher levels. But I admit that I didn't know almost anything about Donkey Kong before making it. Can you post a link where I could read about it?


Bubu:

I'd like to explain the 2 versios of DK that are out there. @Art programmed the game, and then I bought him (at the agreed price) the license that allowed me to sell the game both digitaly and physically, with complete freedom. @Art did a special screen$ where "Arcade ZX Collection" was written, and he appeared as the programmer, and me (Bubu) as the producer.

By the other hand, @Art could do with his version (the non Arcade ZX Collection) what he wanted, donate it, offer it for download for free, etc.
