What am I missing? - Calling RND from assembly.

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
dr beep
Posts: 2060
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: What am I missing? - Calling RND from assembly.

Post by dr beep »

You need to test before you move the elevator up if on the new position of the elevator your player is.
If so, then move that up too.
Spinnetti
Posts: 253
Joined: Sat Sep 12, 2020 11:29 pm

Re: What am I missing? - Calling RND from assembly.

Post by Spinnetti »

Thanks.. debugging the elevator. I've got variables for both elevator and player, so rather than do in either move routine, this runs and does a compare on both variables. The player rides up, but stops early. Not sure why yet. When we have this in the can, I want to try my hand at hirez Robotron.
Zeddy: ZX80, ZX81/ZXpand, TS1000/ZXpand, TS1500/Zxpand+
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: What am I missing? - Calling RND from assembly.

Post by stefano »

the problem with randomization often happens working on emulators when the autoloading features are used or when the emulated computer is reset automatically when a program file is open and "run".
In that case the frame counter will always be at a determined position and RANDOMIZE will initialise the SEED always with the same value.
on a real zx81 with the standard ROM this situation is just impossible.
Spinnetti
Posts: 253
Joined: Sat Sep 12, 2020 11:29 pm

Re: What am I missing? - Calling RND from assembly.

Post by Spinnetti »

Stefano, thanks, great point! When we are done with it, we'll run it on our real TS1000/TS1500's but sure is a lot easier to develop on modern computer. Even with that constraint we got it working ok now, and can only be more random on the real thing. On to code optimization and arrays....

Thanks!
Zeddy: ZX80, ZX81/ZXpand, TS1000/ZXpand, TS1500/Zxpand+
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: What am I missing? - Calling RND from assembly.

Post by stefano »

It was an easy guess to me because I'm hitting the same problem again and again when using the emulators.
Everytime the ancient randomization invented by Leor Zolman on his BDS C comes to my mind: his language variant had a funny randomization inside the a function which was just ..waiting for a keypress.
It strikes me for its simplicity, you might, e.g. invoke RND in a similar loop at the startup screen and you'll have it fixed because the SEED would be altered an indefinite number of times.
Spinnetti
Posts: 253
Joined: Sat Sep 12, 2020 11:29 pm

Re: What am I missing? - Calling RND from assembly.

Post by Spinnetti »

I should have thought of a key press... I dynamically define the key functions at startup anyway. I'll file that one away for future use too.
Zeddy: ZX80, ZX81/ZXpand, TS1000/ZXpand, TS1500/Zxpand+
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
JohnsBargs
Posts: 169
Joined: Fri Oct 19, 2018 2:22 am

Re: What am I missing? - Calling RND from assembly.

Post by JohnsBargs »

Spinnetti wrote: Sun Sep 27, 2020 10:03 pm Thanks!

That 1k Hi rez example is great - game premise is good too!

Next thing I'd like to learn, if ya'll are willing to guide or example is how to do an object array. I'm assuming this is the best way to track multiple objects, and move them?

In our Donkey Kong example (Zonkey Kong as we call it). We've got to spawn, move and remove all the barrels and flaming balls depending on level. Right now we just have a brute force method with 5 sets of variables for location and direction. How would we use an array for those so we can use common functions and just pass pointers to each object?

Game screens are attached. All the rounds work, The player can run and jump, Barrels roll out, the "Princess" dances about and cries for help, the monkey waves his arms and "flames" flicker, and you can knock out the girder keystones in level 4, but having a bit of trouble with the player on the elevators in round 3 and still need to finish up some of the animations. Hard stuff is done, just adding all the fun details since we are "splurging" on 16K. Our original was a single screen and ran on our original TS1000's that we initially developed it on (and hand typed in all the hex!).
Did this ever get finished/released?
Spinnetti
Posts: 253
Joined: Sat Sep 12, 2020 11:29 pm

Re: What am I missing? - Calling RND from assembly.

Post by Spinnetti »

Hi, we are just about done with "Zonkey Kong". Again, nothing special except our learning from it, and we think the game play is pretty good ;) its not an exact copy as we prefer a few things to work differently. it also speeds up with every level you finish so gets pretty frantic after a while. We aren't quick and are are doing finishing touches, and I want to do plenty of code cleanup. We've got some brute force code in there I'd like to replace with better, particularly tracking objects in arrays. All the screens and key bits work, and we've got some of the intro and end screen animations going too. A bit of animation and tweaks is all that's left. Once we've got that polished up, we are going to try our hand at the speccy and the Spectrum Next (still in assembler).
Zeddy: ZX80, ZX81/ZXpand, TS1000/ZXpand, TS1500/Zxpand+
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
Post Reply