GP32 Porting 6502 Source


Gruntfuggly

Mostly Harmless
Joined
Feb 2, 2004
Messages
1,487
Location
Brighton, UK
Website
www.zaonce.com
Hi chaps

I wonder if anyone could give me an idea of the feasibility of porting a game written for a 6502 based machine (BBC Micro). I can get the sources and I used to do a bit of 6502 programming, so I might be able to do it, but how difficult do you think it will be to convert it to ARM assembler?
 
No idea how easy it'd be to convert to ARM, but you might find it easier to convert to a NES rom, since that uses the same processor, and then just run it on an emu.

But as always, native GP32 stuff is better :)
 
Gruntfuggly posted on May 18 2004 at 03:54 PM said:
Hi chaps

I wonder if anyone could give me an idea of the feasibility of porting a game written for a 6502 based machine (BBC Micro). I can get the sources and I used to do a bit of 6502 programming, so I might be able to do it, but how difficult do you think it will be to convert it to ARM assembler?


I was working on Beeb emu a while back - might release it one day :)

Out of interest, which game?

You can't really port it (unless you translate it line by line). You could emulate it or rewrite it.

Oh god - just noticed... please don't convert it to ARM assembler, that's crazy! Porting from one fixed machine to another? No, port it to C, that way you only have to do it once :p
 
Last edited by a moderator:
Even if you do a straight port from 6502 to ARM, you'll still need to understand how the graphics works on a BBC Micro and recode for the gp32, unless it was written with portability in mind (but then again, if that was the case, why was it written in 6502 in the first place?)
 
Why not just rewrite the thing in C?

Anything written for the BBC micro can't be that complex, and C source can compile on any system...
 
The Beeb didn't have all that many unique games for it...mostly it was Acornsoft's high quality rip offs of arcade hits (Planetoid = Defender, Meteors = Asteroids and such like). Is source code available for Exile... couldn't say. What does that leave? Hmmm... Repton and Elite???

Tbh, we've already had Elite: TNK (which was based exactly on the BBC original 6502 code, but ported to C and then) ported to GP32. Unfortunately, it wasn't finished. The GBA version was far better, and was (or at least appeared to be from my limited play) complete. For the record, Ian Bell's fave version is the Nes one. Handy, as we don't have all that many buttons (around 30 required to play the computer version properly).

Btw...the BBC graphics in Elite were trully nasty, the top half of the screen was in Mode 4, the instruments at the bottom, Mode 7. Where they got that idea, I'll never know! :D
 
The game I want to port is Freefall, which isn't on most peoples list of favourites, but I think the original stands up well as a great game and porting it to (or rewriting it for) the GP32 would give loads of scope for updates and enhancements...

Have a look at what Ian Bell (the Author, also of Elite) says about it:
Freefall

I was thinking about it on the way home from work and I agree that it would probably be better to re-write it in C (I'd probably do it in C++ actually)...

Squidge: Portability was never an issue in the Beeb days - you only got about 10k at best to work with for writing games, so 6502 was the only real option...

ColinR: The beeb had loads of original games! Off the top of my head, Frak, Savage Pond, Freefall, Imogen, Starship Command... and in Elite, the reason for the mode change half way down the screen was for the same reasons - the modes in the BBC were memory mapped, so different res modes using up more/less memory, hence the usefulness of saving a few bytes by changing to a lower res mode half way down!

fDave: How complete was your beeb emulator? There are quite a few people on these boards who would love one - I remember reading several threads a while back and there was loads of interest...
 
Gruntfuggly posted on May 18 2004 at 06:41 PM said:
The game I want to port is Freefall, which isn't on most peoples list of favourites, but I think the original stands up well as a great game and porting it to (or rewriting it for) the GP32 would give loads of scope for updates and enhancements...

Have a look at what Ian Bell (the Author, also of Elite) says about it:
Freefall

I was thinking about it on the way home from work and I agree that it would probably be better to re-write it in C (I'd probably do it in C++ actually)...

Squidge: Portability was never an issue in the Beeb days - you only got about 10k at best to work with for writing games, so 6502 was the only real option...

ColinR: The beeb had loads of original games! Off the top of my head, Frak, Savage Pond, Freefall, Imogen, Starship Command... and in Elite, the reason for the mode change half way down the screen was for the same reasons - the modes in the BBC were memory mapped, so different res modes using up more/less memory, hence the usefulness of saving a few bytes by changing to a lower res mode half way down!

fDave: How complete was your beeb emulator? There are quite a few people on these boards who would love one - I remember reading several threads a while back and there was loads of interest...

Not very I'm afraid - it runs Repton 3 with sound a Repton 1 without, but it doesn't have disk support yet. Haven't worked on it for about a year
 
Last edited by a moderator:
Err, runs Repton 3 with sound - and you say not very complete?
You are either the master of understatement, a perfectionist, or very modest!

The Horizon emulator I use on the Mac doesn't have disc support but still manages to play stacks of stuff - there is a convertor tool to convert disk images to tape somehow, so that probably isn't a huge issue...

Any chance of trying Freefall on it, or letting me try :D
 
Gruntfuggly posted on May 18 2004 at 07:05 PM said:
Err, runs Repton 3 with sound - and you say not very complete?
You are either the master of understatement, a perfectionist, or very modest!

The Horizon emulator I use on the Mac doesn't have disc support but still manages to play stacks of stuff - there is a convertor tool to convert disk images to tape somehow, so that probably isn't a huge issue...

Any chance of trying Freefall on it, or letting me try :D


It's really not that complete, it's got the bare bones, namely 6502 (no BCD stuff yet), the psg stuff (from Dega), and that's just enough to run Repton 3. It runs pretty much nothing else and only does Mode 5! Plus you have to use BeebEm save states because I haven't tackled the disk yet.

No modesty involved I'm afraid!

Freefall? Will have a quick go...
Yeah it seems to work sort of, space button thrusts or something. No idea how to rotate. I think the mode is slightly buggered though - looks like it may be mode4 instead of mode 5.

By the way, I can't quite release it yet, but sometime over the next few months maybe, just keep an eye on finalburn.com and they'll be both PC binaries and source code (it's all in C). It might chug a bit on the GP32 though by the way, because it's all C.

I should really finish it too, people at work have been keen for me to continue it and do an XBox version.... would certainly be a first, BBC for XBox!
 
Last edited by a moderator:
Keys for Freefall (if you fancy giving it another go) are:

D - Thrust clockwise
K - Thrust anticlockwise
F - punch left
J - punch right
V - kick left
N - kick right
B - grab bomb (punch to throw it again)
SPACE - Thrust forward
D + K - Thrust backward

Yup - I think it is mode 4 - nice and retro...

So the question is: Should I wait for you to finish your BBC emulator, or should I attempt to re-write it myself?
 
Why not do both? If you can manage to re-write it in C, you open up the possiblity to exceed the capabilities of the BBC dramatically, whether graphically or sound-wise. Or even in play extensions. Then we'd be able to play the original and truly retro version on the Beeb emu, and a nicer looking but less retro one for the GP natively...
 
Gruntfuggly posted on May 19 2004 at 09:01 AM said:
Keys for Freefall (if you fancy giving it another go) are:

D - Thrust clockwise
K - Thrust anticlockwise
F - punch left
J - punch right
V - kick left
N - kick right
B - grab bomb (punch to throw it again)
SPACE - Thrust forward
D + K - Thrust backward

Yup - I think it is mode 4 - nice and retro...

So the question is: Should I wait for you to finish your BBC emulator, or should I attempt to re-write it myself?


re-write it definitely - it's a good idea in any event because you can enhance it and do all kinds of crazy stuff! Plus it's fun :)
 
Last edited by a moderator:
Back
Top