View Full Version : Atari 7800 gets its first BBC Micro game
GroovyBee
03-15-2010, 07:43 AM
I've adapted a game directly from the executable file that runs on the BBC Micro home computer (http://en.wikipedia.org/wiki/BBC_Micro) (the Beeb to us Brits) to run from ROM on the Atari 7800. Its a bit buggy but its mostly there. See :-
http://www.atariage.com/forums/topic/159728-7800-first-bbc-micro-cross-port-is-here/
Its a wire frame game so that's a big :p to all the nay-sayers that said the 7800 couldn't do that type of game :evil:.
There are no screen shots at the moment because the game does not run correctly in the ProSystem 1.3e emulator (I haven't tried MESS). You need to run it on a real PAL or NTSC system using a CC2.
GroovyBee
03-15-2010, 03:18 PM
A teaser screenshot. I've updated the #1 post on the AA thread too.
Greg2600
03-15-2010, 06:51 PM
Neat game. Works on MESS, but has no sound, and seems to go to game over quickly.
slapdash
03-16-2010, 12:09 AM
Ha ha, that's neat. Are the BBC Micro and 7800 that similar architecturally?
Steve W
03-16-2010, 02:23 AM
I thought the Beeb was based on a Z80 processor?
If you really want to impress people, port Elite to the 7800! Or Mercenary.
GroovyBee
03-16-2010, 06:23 AM
Neat game. Works on MESS, but has no sound, and seems to go to game over quickly.
Do you see the baddies in MESS? You don't get them in ProSystem 1.3e for some reason.
GroovyBee
03-16-2010, 06:26 AM
Ha ha, that's neat. Are the BBC Micro and 7800 that similar architecturally?
Not really. They are similar in that they both have a 6502 and that is about it really. The Beeb has 32K of RAM compared to the 4K of the stock 7800. The Beeb's 6502 is also clocked at 2MHz compared to the 1.79MHz of the 7800. The video modes are quite different too.
GroovyBee
03-16-2010, 06:30 AM
I thought the Beeb was based on a Z80 processor?
Nope! Its a 6502 at 2MHz.
If you really want to impress people, port Elite to the 7800! Or Mercenary.
:rolleyes: You mean adapting a game between systems that only share a common CPU isn't impressive enough?
Steve W
03-16-2010, 11:43 PM
Nope! Its a 6502 at 2MHz.
Yeah, I had to look up the BBC computer in my Retro Gamer Hardware Guide to refresh myself on it's stats. For some reason, I was thinking of the Amstrad.
:rolleyes: You mean adapting a game between systems that only share a common CPU isn't impressive enough?
How difficult is it to port over 6502 code? I know that back in ye olden times a few shameful companies took their Atari 2600 games and ported the code over to the Atari 400/800 computers with basically no change in graphics (Fantastic Voyage, I'm waggling my finger at you!). I'd think that it would be easier to port Atari 2600 code since there's very little other non-processor hardware for the software to interact with, whereas home computers are far more technically complicated. How much work was the source code to port?
Greg2600
03-17-2010, 09:09 AM
Do you see the baddies in MESS? You don't get them in ProSystem 1.3e for some reason.
How would I know what they looked like?
GroovyBee
03-17-2010, 12:28 PM
How would I know what they looked like?
Have you seen screenshots of the arcade game Tempest in action? If not, I've updated the original thread over at AA with some pictures taken from my TV. If there aren't things moving around the walls of the "tube" and getting bigger as they come towards you then there are no baddies and its the same as ProSystem 1.3e.
GroovyBee
03-17-2010, 12:54 PM
How difficult is it to port over 6502 code? I know that back in ye olden times a few shameful companies took their Atari 2600 games and ported the code over to the Atari 400/800 computers with basically no change in graphics (Fantastic Voyage, I'm waggling my finger at you!). I'd think that it would be easier to port Atari 2600 code since there's very little other non-processor hardware for the software to interact with, whereas home computers are far more technically complicated. How much work was the source code to port?
The 2600 generates its games on a display line per line as they electron beam travels down the screen. Basically its "chasing the beam". This requires what is known as a display kernel. Basically its a cycle exact piece of code that writes to TIA (video chip) registers at specific times to get the desired effects. All the game logic and AI would take place in the VBLANK time (the time when no display is active). It also has 128 bytes of RAM and that includes the stack! To convert a game from the 2600 would require the display kernel to be rewritten.
There was no source code for the Tempest adaptation. The starting point was a binary that was loaded into a specific RAM address on the BBC Micro. The first task was to disassemble the code. Then look for things that won't work in a ROM image like self modifying code and copying code sections around (basically you are looking for writes to RAM that effect CPU execution sequences). The code was run on a Beeb emulator until it had performed its initialisation and started the main game loop. At that point the RAM dumped and another pass of reverse engineering. At that stage you are looking for variables that are written to, tables that are used, programmer tricks, self modifying code, OS calls etc. When you are happy that you've found all the tables you should be able to insert a simple instruction, rebuild for the BBC and the image should still run. If it doesn't keep going round this loop until it does.
At that point you are ready to adapt the game. The Beeb has 32K of RAM an OS and game's are loaded in from tape/disk. Whilst the 7800 has 4K of RAM, no OS and games execute from cartridge. You find workarounds for the self modifying code, hunt out all the variables that can reside in RAM and find out what the "magic writes" to the Beeb OS RAM locations are doing Then you have to replace OS calls with equivalent functionality as well as handle the different video display bitmap formats and how to turn keyboard input into suitable joystick movements for menu navigation and the like. When you've done all that the game is pretty much ready for testing on the console. Then you keep going around the adaptation loop until the game is running how it should be.
Aswald
03-17-2010, 02:22 PM
I've adapted a game directly from the executable file that runs on the BBC Micro home computer (http://en.wikipedia.org/wiki/BBC_Micro) (the Beeb to us Brits) to run from ROM on the Atari 7800. Its a bit buggy but its mostly there. See :-
http://www.atariage.com/forums/topic/159728-7800-first-bbc-micro-cross-port-is-here/
Its a wire frame game so that's a big :p to all the nay-sayers that said the 7800 couldn't do that type of game :evil:.
There are no screen shots at the moment because the game does not run correctly in the ProSystem 1.3e emulator (I haven't tried MESS). You need to run it on a real PAL or NTSC system using a CC2.
Who thought the 7800 couldn't? Both the CV and 5200 could do respectable-looking games like that, so why not the 7800?
GroovyBee
03-17-2010, 05:35 PM
Who thought the 7800 couldn't? Both the CV and 5200 could do respectable-looking games like that, so why not the 7800?
Unlike the other two machines the 7800 does not have full screen video RAM on the motherboard. It has two video line RAMs. One is displayed while the other is filled using DMA. It is best known for its ability to push sprites onto the screen e.g. Robotron 2084. To create arbitrary lines on a display you need RAM (or you need to make lots of compromises). With only 4K of RAM in total on the stock 7800 its not possible to have a video bitmap display without having some RAM on cart. Atari did not want RAM in carts back in the day due to the extra cost.
GroovyBee
03-17-2010, 05:40 PM
A fix for the ProSystem emulator is explained in this post here (http://www.atariage.com/forums/topic/159728-7800-tempest/page__view__findpost__p__1966308). You'll also need v1.02 of the game to match the MD5 checksum given.
I've also tried the game in MESS but it plays too quickly.
Aswald
03-17-2010, 06:22 PM
*****************
Unlike the other two machines the 7800 does not have full screen video RAM on the motherboard. It has two video line RAMs. One is displayed while the other is filled using DMA.
*****************
What does that mean? Keep in mind that my programming experience is with Commodore computers.
slapdash
03-17-2010, 10:30 PM
He means that you can't define an entire screen of graphics and only move the sprites around that need to move; you have to redraw everything one line at a time. On the 2600 it was REALLY only one line at a time, but on the 7800 (I gather from his post), you could at least start filling the next line while the first line was being output, which would mean that timing isn't quite as critical, I would think.
GroovyBee
03-18-2010, 07:16 AM
Lets say on the C64 you have a screen of 160 pixels wide by 200 pixels high. For each vertical line there is a section of RAM that contains the data for 160 pixels. If you know the based address of the RAM you can write data into it and the pixel colours will change. You can think of the C64 display as being like a bitmap in an art package. You can draw anywhere on the bitmap and the pixels stay like that until you change them.
On the stock 7800 its nothing like that. Everything is a sprite. Lets say you have a screen of 160x192 on the 7800. The 192 vertical pixels need to be divided into zones of between 1 and 16 pixels high. If we choose the zone height to be 16 pixels there will be 12 zones (the zone height is the height of the sprites). Each zone has a Display List (DL) associated with it. The DL tells MARIA (the 7800 video chip) how to construct the pixel data for the zone. Each DL entry contains a source data pointer (where the sprite data will come from), a length to copy, an X offset (to go on screen) and other control information. The DL is read from left to right which controls how sprites are overlaid on top of each other. For example the DL entries for background would be at the front of the list, enemies, player and bullets next and so on. While MARIA is reading data the 6502 is halted because it needs access to the RAM and ROM. MARIA fills its internal video line RAM based on the contents of the DLs it is supplied with. You give MARIA a pointer to a Display List List (DLL). The DLL has an entry for each zone. Each entry has a pointer to its DL and some control information. As MARIA works its way through the DLL and each DL in turn the display is created.
In the BBC Micro adaptation I did it needs a bitmap display like the C64. To achieve it some RAM on cartridge is required. The source data in each zone's DL entry points to the RAM. The game writes to the RAM and MARIA just "thinks" its a large sprite block.
Aswald
03-18-2010, 03:55 PM
To completely fill a C-64 screen would take 8K. This was because you had 25(V)x40(H) character spaces; each had 8 lines (horizontal) of 8 pixels.
So, to fill a space took 8 numbers from 0-255. A Byte. Since there were 1000 such spaces, that would take 8000 Bytes. About 8K (I know a "K" was actually 1024 Bytes).
Of course, this assumes that you want to create a screen without repetition. Because of memory limitations, obviously many such screens were out of the question. This is why custom characters and repetition were common, or large blank areas. To get an Arkanoid background, I simply used 4 custom characters 1,2/3,4 to form a block; thus, only 32 numbers were needed. Even in BASIC, a change would be quick.
Naturally, none of this takes color codes into account. If you wanted to give each space its own, that was 1000 numbers, or 1K. So figure 9K/screen of RAM, unless you used a formula of some kind.
Multi-colored mode did not cut memory requirements in half, even if horizontal resolution was. This was because a single dot of color was actually 2 combined: 00, 01, 10, or 11. Background ("nuthin'"), 2 shared, and one independent/space.
What you are saying is that EVERYTHING with a 7800 is a sprite- there is no true background. Thus, what you are really doing is filling the screen with sprites, some of which are for background or playfield.
And you can't just leave anything alone if there's any action- it's almost as if, with a C-64, a weird malfunction keeps erasing everything so you have to keep redrawing it.
So in Xevious, Tower Toppler, and Ms. Pac-Man- anything with extensive background- is going to take a lot of effort on the part of the 7800 to maintain. This must have sapped a tremendous amount of power from the 7800 for any such game, meaning that its advantages over the CV and 5200 were not as great as was believed back in 1984.
In other words, for games like Asteroids, Space Duel- any game with simple or blank backgrounds with great amounts of on-screen motion- the 7800 was hard to beat, even by 16-Bit systems, but with games with any kind of background it lost much of its advantage.
Shouldn't that be...way back the BBC got an Atari game, now it's given back to its rightful platform.
GroovyBee
03-18-2010, 04:13 PM
What you are saying is that EVERYTHING with a 7800 is a sprite- there is no true background. Thus, what you are really doing is filling the screen with sprites, some of which are for background or playfield.
The 7800 supports indirect mode too. That is like character mode on other machines. Basically the DL entry points at an area of RAM/ROM that contains indexes into a graphics block to use. You can change the graphics block base address on a zone by zone basis (if you want) so its not really limited to 256 entries.
And you can't just leave anything alone if there's any action- it's almost as if, with a C-64, a weird malfunction keeps erasing everything so you have to keep redrawing it.
The DLL and DL are both held in RAM. Therefore if you don't change them the display will be generated exactly the same for every video frame. Its more work in software with moving sprites because you have to split them over zones.
So in Xevious, Tower Toppler, and Ms. Pac-Man- anything with extensive background- is going to take a lot of effort on the part of the 7800 to maintain. This must have sapped a tremendous amount of power from the 7800 for any such game, meaning that its advantages over the CV and 5200 were not as great as was believed back in 1984.
Not quite! Both Xevious and PacMan would be using indirect mode for the background with sprites laid on top. Its easy to get vertical scrolling on the 7800 too.
In other words, for games like Asteroids, Space Duel- any game with simple or blank backgrounds with great amounts of on-screen motion- the 7800 was hard to beat, even by 16-Bit systems, but with games with any kind of background it lost much of its advantage.
It depends on the colour depth of the background. If you have a full screen 4 colour background and 4 colour sprites on top the 7800 is going to be hard to beat. Each 4 colour sprite's DL entry can choose one of 8 mini palettes. This means there are 25 colours on screen at the same time (24 unique colours and a common background colour to all sprites). It can also scroll left/right and clip sprites to left/right edges too. You just update the offsets in the DL entries. In 4 colour mode MARIA (7800 video chip) will max out around 29 8 pixel wide sprites per zone (over 3 times the C64!). So its well capable of pushing sprites. The software overhead in handling those sprites and splitting them into zones and updating the DLs is another matter entirely.
Aswald
03-18-2010, 04:39 PM
Man, when they said the Commodore computers were "user friendly," they weren't kidding...
GroovyBee
03-18-2010, 05:00 PM
Shouldn't that be...way back the BBC got an Atari game, now it's given back to its rightful platform.
My thoughts exactly ;)
Man, when they said the Commodore computers were "user friendly," they weren't kidding...
Not as user-friendly as Atari 8-bit computer though.
GroovyBee
03-18-2010, 05:47 PM
Not as user-friendly as Atari 8-bit computer though.
And neither were graphical power houses compared to the Atari 7800.
Mayhem
03-18-2010, 06:09 PM
It depends in what way I suppose. There's no way I'd expect the 7800 to manage games such as Turrican, Armalyte, Turbocharge or Mayhem in Monsterland. Machines all had their plus and minus points in general.
GroovyBee
03-18-2010, 06:21 PM
It depends in what way I suppose. There's no way I'd expect the 7800 to manage games such as Turrican, Armalyte, Turbocharge or Mayhem in Monsterland. Machines all had their plus and minus points in general.
Hmmm.... "Stay tuned!" is all I'm going to say ;).
certain games not possible on certain machines is always rubbish, I mean Turrican is even on Speccy and CPC and GB, so of course it's possible on the 7800.
Mayhem
03-19-2010, 10:08 AM
By "manage" I mean actually approach the quality of the original. The Speccy isn't suited to a Turrican like game. Stuff like Knight Lore, definitely though.
GroovyBee
03-19-2010, 10:43 AM
The 7800 is breaking new ground all the time ;). Never say never LOL!