Games that used MODE 0?

reminisce about bbc micro & electron games like chuckie egg, repton, elite & exile

Related forum: adventures


User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Games that used MODE 0?

Postby SimonSideburns » Mon Mar 16, 2015 8:14 pm

I've been having random thoughts and questions going through my brain and the latest one is this:

Were any commercial games available that utilised MODE 0?

I guess there could have been a text adventure possibly, but that would require a lot of RAM for the text so probably wouldn't justify the large memory footprint used by MODE 0 but does anyone recall any game ever using that mode?
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
sydney
Posts: 1999
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: Games that used MODE 0?

Postby sydney » Mon Mar 16, 2015 8:36 pm

I can't think of any but I owned an elk bitd and there were almost certainly none for it. The elk version of thrust was in mode 4 and in the Thrust competition thread I asked what a mode 0 version would look like, much the same as mode 4 was the lone reply! :lol:
I think a mode 0 version of Plan B or Plan B 2 could look quite good though it's not too shabby in mode 4!

A text adventure would probably use mode 3?

User avatar
tricky
Posts: 1993
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Games that used MODE 0?

Postby tricky » Mon Mar 16, 2015 9:07 pm

I don't know of any, but was contemplating a mode 0 vertical scroller. The 007 game from the hi-score challenge and WAR were my inspirations. I think the extra res could more than make up for the lack of colours; although I do like my pixels squarish ;)

User avatar
1024MAK
Posts: 6873
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Games that used MODE 0?

Postby 1024MAK » Mon Mar 16, 2015 10:30 pm

A Master 128 game would of course not suffer lack of memory...

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Games that used MODE 0?

Postby SimonSideburns » Tue Mar 17, 2015 5:21 pm

Does seem I've unearthed a gap in the market...

Shame I'm not that great a programmer at the moment. Sure, I've done a couple of simple and fairly basic routines in 6502 in my time, but nothing great like some of you guys.

Even trying to work out how to program a game (of any sort) in 6502 assembly seems a bit too awkward for my brain to get itself around.

All I ever end up with is a multitude of questions, no answers and find that browsing the web doesn't really help.

Think I would benefit from almost being taken step by step through an example of a game being written, discuss and learn examples for the graphics & sound, necessary routines, how to optimise code, how to store the data/sprites/maps, and probably more on top of that. I think I'm aware of probably 75% of the 6502's instructions and what they do, but stringing them together in a coherent way to produce something that has some functionality, well that's another matter. There also seems to be quite a few techniques required in a game including manipulating the CTRC to make custom modes, changing the size of screen modes (e.g. the Mode 7 widescreen effect in Fire Track), compression of data, sprite handling, etc.

Does anyone know of any good books, targeting the BBC Micro, that go through all the stuff I'm looking for?

I would probably try to write something simple, basic, or that doesn't require fast smooth animation in order to get started, maybe a sudoku program or some other strategy game, but I'm still not sure how to start it.

Hopefully I'm still young enough to learn some of this stuff
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
richardtoohey
Posts: 3390
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Games that used MODE 0?

Postby richardtoohey » Tue Mar 17, 2015 6:17 pm

Don't know about the books - but Beebug and (at least) The Electron User ran good series on exactly these topics - writing games, graphics, 6502 etc.

I think Beebug released a Mode 0 game, but that's not really a commercial release.

User avatar
tricky
Posts: 1993
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Games that used MODE 0?

Postby tricky » Tue Mar 17, 2015 6:46 pm

I'm afraid, I can't help with a book recommendation as I started with the AUG in about 1981, I had done a bit of BASIC on the the VIC-20 before that and a tiny bit of z80 on the Sharp MZ-80K before that. Without the internet, and with no one who knew how to code, it was a very slow way to learn.
Even now, I find that I write the graphics, sound and logic routines differently for each game, the keyboard/joystick code I copy and paste as there isn't any point in changing it.
I guess like maths (which I don't do) you just need to try some and keep practicing until certain patterns start to emerge, which, you jam together to make something interesting happen.
A simple "sprite" drawing loop looks like:

Code: Select all

.draw_sprite
    ldy #number_of_bytes - 1 ; -1 so that the last byte we write has offset 0
.loop
    lda (sprite),y ; sprite is a ZeroPage address of 2 bytes like &70 (&70=low byte, &71=high byte)
    sta (screen),y ; screen is a ZeroPage address of 2 bytes like &72 (&72=low byte, &73=high byte)
    dey
    bpl loop ; only works for up to 128 bytes
    RTS
If you know you want all your sprites to be two chars high, you could include a second lda/sta inside the same loop.
As far as game logic goes, for simplicity of coding, I usually try to convert what I know into one or two dimensions and then have a small table to choose what to do:

Code: Select all

    lda #0
    ldx my_x
    cpx enemy_x ; C=0 if enemy on right, C=1 otherwise
    asl A
    ldx my_y
    cpx enemy_y ; C=0 if enemy below, C=1 otherwise
    asl A
    tay : bne not_right_down
    ; do right down
    RTS
.not_right_down
    dey : bne not_right_up
    ; do right up
    RTS
.bne not_right_up
    dey : bne not_left_down
    ; do left down
    RTS
.bne not_left_down
    ; do left up
    RTS
This sample is needlessly optimised, but hopefully still gives the idea of collecting information and then acting on it. One advantage of this is that it is easier to debug as you can set a breakpoint or BRK and check the results of your data gathering in the debugger. There are many ways to do the same thing differently, but most of the fun (for me) is finding them.
As for things like messing with the CRTC, the simplest way to start would be to copy the settings for say 256x256 mode 4 (128x256 mode 5) and not worrying. This gives you an 8KB mode where incrementing the high byte of an address moves down a row, removing lots of faffing about with multiplying by 320 or adding &140 as a bonus, you can wrap any address into screen memory by anding the high byte with &1F and oring with &60. If you are taken with the idea of mode 0, you could store the address of the sprite divided by 2, this may make your brain hurt at first, but is quite cheap to implement and still leaves you with high byte is row address and low byte is roughly column address.

Code: Select all

.draw_sprites
    ldx last_sprite_index ; again 0 based, so num sprites -1
.next_sprite
    lda sprite_x,x ; x=sprite index
    asl A
    sta screen
    lda sprite_y,x
    rol A
    sta screen+1
    lda sprite_lo,x
    sta sprite
    lda sprite_hi,x
    sta sprite+1
    jsr draw_sprite
    dex
    bpl next_sprite
    RTS
You could equally store the address "natively" and then divide by 2 for logic, or even store both but then updating becomes a bit of a pain.
If you are familiar with coding, you generally want a struct of arrays, if not, don't worry, but it is easier to index things if they all have the same offset in bytes; here the x and y and lo and hi are stored in four separate blocks, so that they can all be accessed without changing x.
PS I am terrible at teaching, but can usually put a reasonable answer together once I have half an idea of the target audience ;)

User avatar
sydney
Posts: 1999
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: Games that used MODE 0?

Postby sydney » Tue Mar 17, 2015 8:50 pm

Creative assembler is a good book and the one I used to write about a fifth of a breakout clone. If you are familiar with 6502 assembler you should have no problem with it. I started out with the PDF but found it so useful I bought a copy!

User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Games that used MODE 0?

Postby SimonSideburns » Tue Mar 17, 2015 9:15 pm

My level of 6502 language is similar to my level of Spanish.

Ask me for the Spanish word for something and I probably (hopefully) could tell you what the word is. Ask me to give you a sentence using that word and I may just about speak in Pidgeon Spanish (if you see what I mean) but wouldn't be able to hold a meaningful conversation in that language.

When I see written 6502 code I understand what's going on in terms of each individual mnemonic and maybe could tell what they are doing as a whole, but then again maybe not. Does that make sense?

It's odd but years ago, I was writing complex MS-DOS batch files, programming in Turbo Pascal, started learning C, could write entry level COBOL, started learning PHP and MYSQL, even wrote two complete management and reporting systems in DBASE III for a couple of people - The guy who ran Southampton Samurai Judo Club had a complete membership program written (completely for free) and I wrote a searchable vehicle database as my flat-mate at the time worked for Hendy Ford and needed something to catalogue where the cars in the compound were stored. Still got those two systems on an old backup somewhere and occasionally I look at and marvel at the code I wrote (probably around 20 years ago).

Nowadays, I've got to get the manual out to even work out the syntax of some of the more obscure BBC Basic keywords.

Seems like I've forgotten more than I'm able to learn these days.
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
richardtoohey
Posts: 3390
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Games that used MODE 0?

Postby richardtoohey » Tue Mar 17, 2015 9:49 pm

SimonSideburns wrote:Seems like I've forgotten more than I'm able to learn these days.
I think it is called getting older! :lol:

There are so many demands on one's time these days it is a wonder we remember anything.

I keep notebooks and make notes of things I learn, but I too surprise myself when I think I've learned something new - and then discover it a few pages back in the notebook. :shock:

Make notes, comment any code well, don't beat yourself up too much. There's lots of clever people on the forum that make the rest of us look bad! :mrgreen:

User avatar
sydney
Posts: 1999
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: Games that used MODE 0?

Postby sydney » Tue Mar 17, 2015 9:56 pm

Simon , your level of 6502 knowledge sounds exactly like mine! download the pdf and give it a read I think you will be fine.

RobC
Posts: 1848
Joined: Sat Sep 01, 2007 9:41 pm

Re: Games that used MODE 0?

Postby RobC » Wed Mar 18, 2015 5:34 pm

Have a look at Swift and "The Shell" over at RetroSoftware.

The Shell has loads of useful stuff (sprite routines, keyboard input etc.) that you can use in your own games. It forms the basis of Sparse Invaders so you can see how it's used to write a real game.

Developing in Swift is much easier than on a real Beeb as it has a built in sprite editor, a decent code editor and code can be built and run in an emulator so you can see the results immediately.

User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Games that used MODE 0?

Postby SimonSideburns » Wed Mar 18, 2015 9:25 pm

sydney wrote:Simon , your level of 6502 knowledge sounds exactly like mine! download the pdf and give it a read I think you will be fine.


Do you have a link to the PDF? I will try a quick search but a link would be helpful if I have no luck...
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Games that used MODE 0?

Postby SimonSideburns » Wed Mar 18, 2015 9:38 pm

I searched and found the following:

http://archive.retro-kit.co.uk/bbc.nvg.org/doc/AcornsoftCreativeAssembler.html

but the formatting and width of the document is shockingly awful.

Also, within the first few pages where it is talking about using the BBC Micro to convert between hex and decimal it's got errors in the example print statements.

Think I'm going to have to find a better copy.
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
richardtoohey
Posts: 3390
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Games that used MODE 0?

Postby richardtoohey » Wed Mar 18, 2015 9:55 pm

Try Beebug

http://8bs.com/beebugmags.htm

If you click on the cover image, you'll get a good idea of what is in each magazine (before you download the big PDFs).

I'll go find which one has the sprites etc. programming ...

User avatar
richardtoohey
Posts: 3390
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Games that used MODE 0?

Postby richardtoohey » Wed Mar 18, 2015 10:02 pm

Volume 2, issue 8 is the start of a machine codes graphics course.

But look at some of the others - MODE 8, split-screens (multiple modes), 3D lines & landscape plotting, interrupt-driven music, optimisation tips & tricks, etc.

Plus all the sample code and games (a lot of them are BASIC, but still good to see how people tackle the problem.)

It's a great resource. :D

Electron User magazine also did some how-to-write-games issues.

User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Games that used MODE 0?

Postby SimonSideburns » Wed Mar 18, 2015 10:16 pm

I'll take a look. Sounds just like the kind of introduction I'm looking for.

Thanks for the info.
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
richardtoohey
Posts: 3390
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Games that used MODE 0?

Postby richardtoohey » Wed Mar 18, 2015 10:37 pm

Good luck.

I've looked at that Beebug series on-and-off over the last 30 years, and still haven't actually got around to writing a game ... but I'd like to, one day.

That's why I have great admiration for the ones around here who are trying (and often succeeding!) It takes a lot of stamina and persistence. =D>

And when you look at some of those amazing games - Repton, Exile, Elite, Castle Quest, Labyrinth ... wow ... :shock:

User avatar
SimonSideburns
Posts: 257
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Games that used MODE 0?

Postby SimonSideburns » Wed Mar 18, 2015 10:49 pm

To me, in a simplified form, a game (or any heavy graphic) programming is really about transferring bits of data from one place to another.

If you can master that, however you go about it, you're bound to get results.

This is aside from the actual idea of the game you want to create, designing the sprites or whatever, good use of sound, whatever nice effects you can squeeze in, and so on, and so on.

So, I need to come up with an idea of something (not even necessarily a game) that I can start to code so I can learn all the different addressing modes, conditional branching and manipulation of bits within bytes to perform a particular function.

My idea is to learn to stand before I learn to walk.

Any ideas on where I can start?
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
richardtoohey
Posts: 3390
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Games that used MODE 0?

Postby richardtoohey » Wed Mar 18, 2015 11:03 pm

Not really ... I think if it is something you are interested in, then it might make it easier to think of a little project. It's a good idea, though - some little projects to force you to think how you could achieve it in assembler.

For learning I found "Assembly Programming Made Easy for the BBC Micro" by Ian Murray a good book BITD (I was a teenager, then, mind you!)

The Birnbaum book has a lot of exercises, so that might force you to learn the ins-and-outs the 6502. Also the Zaks book - that has exercises.

User avatar
jbnbeeb
Posts: 370
Joined: Sat Apr 03, 2010 8:16 pm

Re: Games that used MODE 0?

Postby jbnbeeb » Thu Mar 19, 2015 11:37 am

SimonSideburns wrote:Any ideas on where I can start?


I started out learning 6502 on Beeb a couple of years back and coded snake, which I think is probably the simplest game you can do.

I did quite a detailed dev diary and you can download source which is reasonably well commented. This may help - plus the books people have linked to above. I would suggest to read, but also get coding, otherwise it won't sink in (at least, that is in my experience).

http://www.retrosoftware.co.uk/wiki/index.php/JSnake
I'm going to ..
ABUG North Halifax June 10-12
Image

User avatar
roland
Posts: 2829
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Games that used MODE 0?

Postby roland » Thu Mar 19, 2015 1:12 pm

If you ask me, writing a game (or a program in general) is like writing a story. You have to learn a few basic skills:

words -> mnemonics, statements
write sentences -> syntax
make up a story -> make a (game) strategy
and write it!

You already know what mnemonics the 6502 has. You probable know the syntax as well. But just like writing "random" phrases doesn't make a good story, writing "random" instructions for the 6502 doesn't probably make a useful program.

If you want to start writing a game, start with something really simple. Don't bother about exciting graphics, sounds etc. Start simple. For example with a version of Tic Tac Toe. You know the game rules and it gives you some exercises:

- draw simple graphics (a matrix with horizontal and vertical lines, a cross and a circle)
- get input from the user and reflect that to your screen
- let the computer calculate it's next move
- check for a winner or end of game
- keep track of scores

(Instead of a circle you can also use a square which is easier to draw).

If you manage that in assembler, you have made a good first step. You can refine the graphics by creating sprites instead of a cross and circle.

Don't start with a complicated game as you will probably give up before the game has finished.

If you keep portability in mind, you separate the core of the game and I/O. However I think that's something for later, if you have developed some game writing skills.

Good luck!


BTW: the game four-in-a-row is just and extended version of Tic-Tac-Toe, so that can be your second game :wink:
256K + 6502 Inside
MAN WOMAN :shock:

paulb
Posts: 786
Joined: Mon Jan 20, 2014 9:02 pm

Re: Games that used MODE 0?

Postby paulb » Thu Mar 19, 2015 5:38 pm

Back on topic, I seem to remember that the chapter on sprites in The Electron Gamesmaster featured MODE 0 (or maybe MODE 3 or 6), which seemed like an odd choice and was also disappointingly late in the book for someone as young (and enthusiastic about sprites and scrolling) as I was when I was reading it back in the day. More information here. I don't think there was a full game in the book, though.

User avatar
Elminster
Posts: 1632
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK

Re: Games that used MODE 0?

Postby Elminster » Sat May 09, 2015 11:22 am

richardtoohey wrote:For learning I found "Assembly Programming Made Easy for the BBC Micro" by Ian Murray a good book BITD (I was a teenager, then, mind you!)


Just finished this book. In the edition of the book I have out of the 5 large programs at the end. Two have typos or missing code in them (now working), two work fine. Just have one left outstanding to get working. (might be typo by me or a typo by Ian Murray, yet to be confirmed).

But generally I found a good introductory book.

Now halfway through 'Assembly Language Programming on the BBC Micro' by John Ferguson & Tony Shaw.

A combination of paper and electronic means I have most of the Assembly books ever made now. Just a case of finding time to read them and practice.

User avatar
tricky
Posts: 1993
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Games that used MODE 0?

Postby tricky » Tue Jun 09, 2015 9:46 pm

Inspired by your original post, I have started on an emulator for Sprint the arcade game in mode 0, although there will probably be a mode 1 option.
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=19&t=953


Return to “software: classic games”

Who is online

Users browsing this forum: No registered users and 3 guests