Page 1 of 2

BBC Micro "Sideways ROM" code

Posted: Thu Mar 06, 2008 1:45 am
by mdpenny
OK - I have, within the last week, finally got around to doing something that I've been meaning to do for a (long) while now [1], and that's to unearth some code I'd been working on for my Beeb.

The reason I'd shelved working on the code was that, even with the grand total of 44KB 8) of available RAM on a 6502 Second Processor, my BBC BASIC-wrapped code just plain ran out of memory, and I had no other way (at the time) of squeezing more source code in.

Anyhow, as cross-assemblers on modern machines have access to (effectively) unlimited RAM, this is no longer a problem - but who here is (or has) written ROM code for a BBC Micro using a cross assembler, which did you use, and why?

(I'm looking for a simple way of producing an 8KB or 16KB binary image, that can - initially - be loaded into an emulator for testing, before being burnt out to EPROM for more permanent use in a physical machine.)

(And, yes, I can - and will - submit the source code and ROM image to the code repository, especially if people ask me to :D )

--Martin

[1] From the copyright message in the code, 6 years :oops:

Re: BBC Micro "Sideways ROM" code

Posted: Thu Mar 06, 2008 7:41 am
by kc5tja
mdpenny wrote:
Anyhow, as cross-assemblers on modern machines have access to (effectively) unlimited RAM, this is no longer a problem - but who here is (or has) written ROM code for a BBC Micro using a cross assembler, which did you use, and why?
I do not have a Beeb, and won't likely in the future. But I have been hacking on a 65816-based home computer design I call "Kestrel" for some time.

I use the ca65 assembler (part of the cc65 package), because it gives me precise control over how various sections of code and/or data map to which memory locations. Additionally, it supports the 65816 perfectly (NOTE: the C compiler, however, is strictly 6502 only!).

Posted: Thu Mar 06, 2008 8:59 am
by BitWise
Most of the BBC emulators I've used like a simple binary file containing the 16K of ROM image from $8000 upwards.

In the past I used Frank Kingswood's AS65 from here ...
http://www.kingswood-consulting.co.uk/assemblers/
... to build ROM images but when Windows XP service pack 2 removed support for 16-bit DOS applications I decided to right my own portable Java based relocatable macros assembler.
http://www.obelisk.demon.co.uk/files/6502.zip
The linker can be configured to produce a binary image after linking (Lk65 -code $8000-$BFFF -bin -output image.rom *.obj)

Nice to know someone else still dabbles in BBC code.

Posted: Sat Mar 08, 2008 4:21 pm
by mdpenny
I now have a (workable) solution, and can generate the required images.

Although I still have a bit of work to do on the code - I hadn't finished all the extra "*"-commands (the Acorn command-prompt utilities) when I had shelved the code, due to lack of space - if anyone would like me to -email them a copy of the current "test" image, just email me via the forum.

--Martin

Posted: Sat Mar 08, 2008 6:23 pm
by BitWise
What does the ROM do?

Posted: Sat Mar 08, 2008 9:11 pm
by mdpenny
BitWise wrote:
What does the ROM do?
The ROM adds (among other commands):-

- Character-set related commands:
*CDISPLAY, *CRESET, *CDEFINE, *CREVERSE, *CINVERT, *CNEGATE
- Sideways ROM-related commands:
*SWROMS, *SWINFO, *SWDUMP, *SWCLEAR, *SWSEND
- Acorn Electron soft-key expansions (untested so far)

--Martin

Posted: Sat Jul 26, 2008 1:34 pm
by mdpenny
OK, here's a bit of an update - I've got to a convienient point in adding extra code & stuff, and I'm doing a bit of "tidying up" before I go for a release.

The source code (still largely uncommented :roll: ) currently weighs in at a bit over 64KB, and produces object code that (just) fits into an 8KB ROM image - I have approx. 256 bytes spare before having to forcibly trim hooks I've left in place "for future expansion" (a beloved phrase from Acorn-produced documents :D ).

--Martin

Posted: Sun Aug 10, 2008 8:07 pm
by mdpenny
Right - I've finished the coding I wanted to! I'm just writing a simple "Read Me" file, and it'll be ready for release - this version, as a zip file, by e-mail.

As I haven't been able to test the code (at all, let alone properly) on an Electron, I'd particulary appreciate someone who *can* test the ROM image on an Electron getting in touch with me, to help with testing.

Anyone wanting a copy, let me know.

TIA,

--Martin

Posted: Mon Sep 07, 2009 10:37 pm
by Thom
Hi, it won't produce a binary blob, but the most popular assembler at least over at Retrosoft, is BeebASM owing to the way it assembles from source directly to a bootable disk image. As you don't want that, I'm not sure there's any real reason to recommend it over any of the generic tools.

Also, I'm the author of ElectrEm, an Electron emulator. The emulator hasn't supported user ROMs for years, but only due to user interface concerns. I'd be more than happy to test your ROM against the emulator if it would help. The version of the emulator I have accurately emulates 100% of known software (well, known and available from the 'net), including all memory/timing issues, so it's not as much worse than testing on a real machine as you might assume.

Posted: Wed Dec 30, 2009 11:36 pm
by mdpenny
I've been doing some further work on my code; I've added a couple of commands, rewritten some bits (including "fixing" a long-standing potential problem, and finding a long-forgotten incomplete routine), and carried out a general tidy-up.

So, all-in-all, I'm nearly ready to push out a point-release; as before, if anyone wants a copy, get in touch, and I'll e-mail it out, once I've got it ready.

(Alternatively, if anyone wants me to submit the code the 6502.org code repository, let me know.)

--Martin

Posted: Thu Dec 31, 2009 12:04 am
by GARTHWILSON
Quote:
(Alternatively, if anyone wants me to submit the code the 6502.org code repository, let me know.)
I've never seen a BBC Micro in person or been involved, but I would say that when/if you feel like the info is presentable and you're more-or-less done, it probably should go up on the website. As long as we're not just cluttering it with junk and untrue things and making the real gold harder to find, we should present all the materials we can and make 6502.org the greatest possible resource for the 6502 family of processors and peripherals with whatever amount of time we're able to give it. (I'm quite familiar with the time limitations, since I myself have started plenty of things for the website that never made it to completion.)

Re: BBC Micro "Sideways ROM" code

Posted: Thu Dec 31, 2009 5:50 pm
by BigEd
mdpenny wrote:
(I'm looking for a simple way of producing an 8KB or 16KB binary image, that can - initially - be loaded into an emulator for testing, before being burnt out to EPROM for more permanent use in a physical machine.)
I know you have a solution now, but here's how I'm doing it, using ca65:

Code: Select all

ca65 -l boot816.as -D BASE=0x8000
cl65 boot816.o --target none --start-addr 0x8000 -o boot816.bin
Also
mdpenny wrote:
... if anyone wants a copy, get in touch, and I'll e-mail it out, once I've got it ready.
Yes please!

Posted: Mon Jan 04, 2010 9:03 am
by mdpenny
A quick update - I've managed to find an Electron emulator that allows me to load my ROM code as if it were a cartridge; this has allowed me to do some Electron-specific testing.

I've found some bugs (not just in Electron-specific code), and fixed most of them. However, the "firm key expansion" code is - sadly - rather badly broken; I'm having a look to see if I can easily fix it - if not, I'll disable it for this release (0.91), and work on fixing it properly for the next release (0.92).

--Martin

Posted: Sat Jan 09, 2010 12:15 pm
by mdpenny
I now have some working code, and have wrapped version 0.91; anyone who wants me to e-mail them a copy, please send me a private message - the .zip file is a mere 20KB, so shouldn't break anyone's Inbox.

--Martin

Updated version available...

Posted: Thu Nov 24, 2011 12:33 am
by mdpenny
I've updated the "MUTILS" Sideways ROM to v0.92, and have made it available in this Retro Software thread:

http://www.retrosoftware.co.uk/forum/vi ... f=73&t=710

--Martin