Benny Bunny: Burrows (Boriel BASIC)

Show us what you're working on, (preferably with screenshots).
Post Reply
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Benny Bunny: Burrows (Boriel BASIC)

Post by PeterJ »

As you may have seen by my recent posts I'm getting to grips with Boriel BASIC. Because of the current pandemic I have, unsurprisingly more spare time.

I've always liked the Benny Bunny series of type-ins from Sinclair Programs, so thought I would have a go at converting them. Mainly to gain experience of the difference between ZX BASIC and Boriel BASIC and to see the speed increases. It's probably around 5 times faster to draw the screen, and the moving bugs are the bottom of the screen move at lightning speed.

The original game is here:

https://spectrumcomputing.co.uk/index.p ... 6&id=24322

So far I have drawn up the screen and added some of the sounds. This WiP can be downloaded here (as a tzx file):

https://drive.google.com/drive/folders/ ... sp=sharing

Image

If anyone has any suggestions for BASIC programs that could do with a speedup, let me know!
llewelyn
Manic Miner
Posts: 205
Joined: Thu Feb 22, 2018 3:27 pm
Location: virginias eastern shore
Contact:

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by llewelyn »

Or you could use SpecBAS and see a really fast result. (Mischievous grin!)

I have never used Boriel Basic but I did ask Boriel about it recently on a chat site and it sounds like it would be an interesting application to try out, so I'm intrigued by your remarks.

However with Dunny helping me to get to grips with programming using strings and arrays (yes, I'm pretty backward) I think I'll get my SpecBAS efforts working properly before I try yet another application to add to my hard drive full of programming languages that were recommended to me but turned out not to be as easy as promised. EG Python.

You can't beat having a tutor who wrote the language though.
User avatar
RWAC
Manic Miner
Posts: 699
Joined: Sun Aug 18, 2019 9:59 pm

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by RWAC »

I'm going to send you over a long list of football management games! :lol:
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by PeterJ »

[mention]llewelyn[/mention] SpecBAS is on my list to try!

I tried Python too. I've loads of Raspberry Pis, but didn't really enjoy it.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by PeterJ »

RWAC wrote: Wed Apr 01, 2020 2:52 pm I'm going to send you over a long list of football management games! :lol:
Start getting that list together!
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by PeterJ »

Can anyone help me with what the purpose is of line 6015?

https://archive.org/stream/sinclair-pro ... 7/mode/1up

Whats the reason for the pointing Z to 99 below the first UDG address, then poking it with 255 in line 6200?

Thanks
llewelyn
Manic Miner
Posts: 205
Joined: Thu Feb 22, 2018 3:27 pm
Location: virginias eastern shore
Contact:

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by llewelyn »

PeterJ wrote: Wed Apr 01, 2020 3:31 pm @llewelyn SpecBAS is on my list to try!

I tried Python too. I've loads of Raspberry Pis, but didn't really enjoy it.
Peter I'm writing a blow by blow account at my ZX BASIC blogspot if you would care to take a look? If you scroll down through the entries, the saga starts at BASIC PARSER but the latest entry explains where I'm at and the previous two are saves of the chat sessions where Dunny teaches me how to create and use a string array in SpecBAS. Thanks. Mike
User avatar
Stefan
Manic Miner
Posts: 803
Joined: Mon Nov 13, 2017 9:51 pm
Location: Belgium
Contact:

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by Stefan »

PeterJ wrote: Wed Apr 01, 2020 3:33 pm Can anyone help me with what the purpose is of line 6015?

https://archive.org/stream/sinclair-pro ... 7/mode/1up

Whats the reason for the pointing Z to 99 below the first UDG address, then poking it with 255 in line 6200?
There is a small machine code routine at z - see line 60 which has randomize usr z. If someone else hasn't already, I'll piece the routine together later on tonight.
User avatar
Stefan
Manic Miner
Posts: 803
Joined: Mon Nov 13, 2017 9:51 pm
Location: Belgium
Contact:

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by Stefan »

The code is initially poked into memory by line 6015 using the data from line 6030, this disassembles to:

Code: Select all

	dec b		; line 8599 changes this to 243 = di
	ld de,&0210	; d changed by line 160
outer:
	ld h,1		; h changed by line 160 and line 1510
	ld a,(&5c48)	; border colour (https://skoolkid.github.io/rom/buffers/sysvars.html)
	rra
	rra
	rra
inner:
	ld c,254
	xor %00010000
	out (c),a
	ld b,e
wait:
	djnz wait
	dec h
	jr nz,inner
	inc e			; line 1510 changes this to 28 = inc e and then 29 = dec e
	dec d
	jr nz,outer
	ei
I'm not sure how this is returning to basic normally, but if you're running the listing in an emulator it shouldn't be hard to see.

So since this is sending outs to port 254 and toggling bit 4, this is "obviously" some sort of sound effect routine, the parameters are tweaked by various basic lines before use.

For hand disassembly you may find http://clrhome.org/table/ useful.
User avatar
Morkin
Bugaboo
Posts: 3264
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by Morkin »

Stefan wrote: Wed Apr 01, 2020 9:45 pm The code is initially poked into memory by line 6015 using the data from line 6030, this disassembles to:

Code: Select all

	dec b		; line 8599 changes this to 243 = di
	ld de,&0210	; d changed by line 160
outer:
	ld h,1		; h changed by line 160 and line 1510
	ld a,(&5c48)	; border colour (https://skoolkid.github.io/rom/buffers/sysvars.html)
	rra
	rra
	rra
inner:
	ld c,254
	xor %00010000
	out (c),a
	ld b,e
wait:
	djnz wait
	dec h
	jr nz,inner
	inc e			; line 1510 changes this to 28 = inc e and then 29 = dec e
	dec d
	jr nz,outer
	ei
I'm not sure how this is returning to basic normally, but if you're running the listing in an emulator it shouldn't be hard to see.

So since this is sending outs to port 254 and toggling bit 4, this is "obviously" some sort of sound effect routine, the parameters are tweaked by various basic lines before use.

For hand disassembly you may find http://clrhome.org/table/ useful.
Ah yeah, it looks like the sound effects for picking up the diamonds, getting caught, or dropping a boulder on the enemy sprite. All use the same (RANDOMIZE USR z) sound FX routine, but POKEing slightly different values into the code from BASIC (z+5, z+24 etc.) is making the sound different-sounding for each event.

Weirdly I never remember encountering many BASIC-with-machine-code type-in routines. I only realised later that they were fairly widespread. Must have been buying the wrong mags... :lol:
My Speccy site: thirdharmoniser.com
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Benny Bunny: Burrows (Boriel BASIC)

Post by PeterJ »

Thanks [mention]Stefan[/mention]
Post Reply