BOP 7

developing/porting a new game or gaming framework? post in here!
Post Reply
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

BOP 7

Post by tnash »

I've been having fun relearning BBC BASIC and working on a very rudimentary version of the casual mobile puzzle game DROP7. I'm calling it BOP7 because it's on a Bbc rather than a DRoid. See the attached ssd disk image here
bop7-22.ssd
(6.75 KiB) Downloaded 53 times
Keys are Left, Right arrows and space to drop, and otherwise the instructions are per the first paragraph on the DROP 7 wikipedia page https://en.wikipedia.org/wiki/Drop7

Lots of things to fix - primarily optimising my very hacky code so that it's a bit snappier, maybe moving some more of the routines to machine code if I can work it out, improving the sound, adding some instructions and other quality-of-life bits. However it does play a game, and I'd really appreciate if anyone fancies testing it and giving me feedback - either on bugs or potential optimisations/improvements.

It's currently running in the MODE 8 from the AUG - I can't remember why I did that! I might move it to MODE 2 but I've grown strangely attached to the chunkiness...

As an aside, I've recently installed pitubedirect ( thanks Hoglet et al) and noticed that MODE 8 doesn't work with the 6502 co-pro (same in B-em). It shows garbled text, still appears to be 20 chars wide, and other graphics have some strange effects too. Does anyone know if there is there an easy fix for this?

Cheers all
Tom
tom_seddon
Posts: 889
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: BOP 7

Post by tom_seddon »

If running on the copro, the Beeb (often termed the I/O processor in this situation) is a little inaccessible. You don't have easy access to its memory, which complicates (as here) writing to screen memory and the OS variables, and it's a bit inconvenient to get it running code that isn't an OS routine (as required here to draw the discs).

You do have options, but the easiest of those options is just to say that the Tube isn't supported :lol: - OSBYTE &EA (AUG p230) will tell you if the Tube is enabled.

If you do want to do it, there's some notes about how Elite does things here: https://www.bbcelite.com/deep_dives/650 ... ation.html. For the Mode 8 setup, you could have a little machine code routine that runs on the I/O processor (which you'd call using whatever mechanism you use to call the disc drawing), or you could do it in BASIC on the copro and use OSWORD 6 (AUG p249) to write to &360, &361 and so on in the I/O processor.

--Tom
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Cheers Tom! For the time being I'll take your advice re disallowing the Tube :D
But also, thanks very much for taking the time to point me in the right direction. Even just from a quick scan I've got a much better idea of how the Tube works which is really useful, ta.
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: BOP 7

Post by ChrisB »

Having a brief scan of the code there doesn't seem to be anything to exciting in there which means converting to 6502 should be reasonably straight forward. You checking will be dramatically faster and it will make it a much smoother experience,
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Thanks Chris, much appreciate the advice. Right then... out with the 6502 books, I'll probably be back soon enough asking more stupid questions.
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: BOP 7

Post by ChrisB »

Just take it section by section. The first thing I'd probably do would be to translate your arrays into data tables in memory accessed by ? operators. This might seem a step backwards but would allow you BASIC/ASM to easily access the same data without copying back and forth. There are some multiplications (and a ^2.5 at one point) which could probably be achieved with lookup tables.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Belatedly thanks, you're quite right that that was the best first step (actually 2nd after retrieving it from the beeb and into a project in vscodium & beebasm) And it turned out to be relatively painless to convert the BASIC code to use the memory table rather than an array. Now I'm slowly chipping away at converting chunks to assembler and hopeful that they'll all coalesce in the end. I am so bad at 6502 but it's fun when it works.
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

In need of a bit of expert advice here!

All the main game logic is in 6502 now and it's too fast now ... discs are no longer seen to fall gently but instead drop so quickly the player doesnt see them!
So I'm trying to add in an osbyte 19 to wait for vsync. Slightly confused though... looking at tobylobster's annotations of the OS rom at https://tobylobster.github.io/mos/mos/S-s15.html#SP53 there is a BEQ going nowhere and then it seems to fall through to osbyte 160. So my reading is ... although my copy of the AUG says A is preserved, it isn't. And neither are X and Y because osbyte 160 alters them? So I would need to push all 3 registers onto the stack before calling osbyte 19...
Is this correct or have I totally misunderstood please?
Thanks so much
Tom
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: BOP 7

Post by ChrisB »

As far as I can tell it doesn't destroy A - but you need to load it with 19 anyway so whatever's there will need to be saved in any case. The code you refer to - the beq jumps back a few instructions to the minus symbol - so it waits for the memory value to change - which is changed by the vsync interrupt. It would have been nice if osbyte 19 had X as the number of vsync interrupts to wait for on entry. However if you're just looking for a delay performing an inkey (osbyte 129) will wait for a time - but again uses all the registers. However it is timed in centiseconds and if the user presses a key will quit so allowing an automatic speed up.

If you want to be really naughty you could watch the same memory location that osbyte 19 does - and wait for it to change...
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Why didn't I think of that! Thanks so much Sensei.

I'm very nearly at the stage where the whole game is now converted to extremely messy 6502. I'll post another ssd over the next few days which might be the final version. It's been a great learning experience, thanks very much to collected historical wisdom on this forum and the external sites and tools that by-and-large are maintained by stardot people too ( oh and if Tricky reads this I used one of your random number generators, hope that's ok ?)

And then I'll need a new project...
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Hi all,
Came back to this and fixed the snags this afternoon so am happy with it now as basically everything is in 6502 and so it's nice and responsive where the BASIC version was sluggish. Hope you enjoy, let me know here if you find any bugs ( I'm aware of a couple)

Does anyone know who runs bbcmicro.co.uk please ? How can I ask them to update their file?
(They grabbed the version I posted above, which was a nice surprise particularly as they added an instructions screen, but it was somewhat premature as it was nowhere near finished!)

Cheers
Tom
Attachments
bop7.ssd
(11.5 KiB) Downloaded 31 times
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: BOP 7

Post by leenew »

I will update this tomorrow for you :D

Lee
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Fantastic, thanks Lee :-)
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BOP 7

Post by tricky »

tnash wrote: Wed Sep 27, 2023 12:47 pm ... if Tricky reads this I used one of your random number generators, hope that's ok ?)

And then I'll need a new project...
Of course, all my code is free to be used, the only thing that I didn't want was people selling very expensive MMC devices using it to sell them for even more!

New project sounds great.

If you are planning on supporting the master etc, you might want to check that out uses the same memory address :)
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

tricky wrote: Mon Oct 30, 2023 7:04 am
Of course, all my code is free to be used, the only thing that I didn't want was people selling very expensive MMC devices using it to sell them for even more!

New project sounds great.

If you are planning on supporting the master etc, you might want to check that out uses the same memory address :)
Thanks Tricky!

Re supporting the Master, BOP7 seemed to work fine on a Master under emulation, is there something I've missed that means it won't work on a real machine?
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BOP 7

Post by tricky »

No that I know of :)
Some memory address are used for different things, the don't isn't available and the a2d hardware is at a different address. There are other differences, but the emulators are excellent these days.
User avatar
SuperBadger99
Posts: 13
Joined: Sun Aug 30, 2020 7:49 pm
Location: Macclesfield
Contact:

Re: BOP 7

Post by SuperBadger99 »

Just downloaded and added to my BBC Batocera build on my RG552 - gonna give this a go tonight. Thank you!
DeadMeatGF
Posts: 2
Joined: Mon Jan 15, 2024 5:40 pm
Contact:

Re: BOP 7

Post by DeadMeatGF »

Had a great deal of fun playing this, thanks for creating it.
I think I found a small bug, I have a game running right now where all of the Tiles are 4 ... sadly I have no idea how that happened.

I've dropped a couple of screen grabs of the score looping to illustrate - and I have a weight on the down arrow just to see if it loops forever or eventually crashes the game ;)
Attachments
Bop7BlitzB.png
Bop7BlitzA.png
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

Aha... this bug happened to me exactly once and I could never recreate it. However I think I know the cause so I'll try a fix at the weekend and post here when done. Glad you're enjoying the game!
Cheers
Tom
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: BOP 7

Post by tnash »

@Dead
DeadMeatGF wrote: Mon Jan 15, 2024 9:04 pm Had a great deal of fun playing this, thanks for creating it.
I think I found a small bug, I have a game running right now where all of the Tiles are 4 ... sadly I have no idea how that happened.

I've dropped a couple of screen grabs of the score looping to illustrate - and I have a weight on the down arrow just to see if it loops forever or eventually crashes the game ;)
See attached SSD which should fix the bug. Drop me a note back here if it doesn't please :-)
Thanks very much again
Tom
Attachments
bop7.ssd
(11.75 KiB) Downloaded 5 times
DeadMeatGF
Posts: 2
Joined: Mon Jan 15, 2024 5:40 pm
Contact:

Re: BOP 7

Post by DeadMeatGF »

I've mostly been playing online, but when I get a chance I'll bang that into an emulator and let you know, although I've not had it again in the original version since!
Post Reply

Return to “new projects in development: games”