Your Spectrum
Issue 18, September 1985 - Interface 1 ROMs
Home Contents KwikPik
new   rom
antics
Ever since the new Interface 1 ROMs appeared, there's been a lot of confusion over converting from the old to the new. Well, now Andrew Pennell has come up with the complete ROM service!
If you cast your mind back to YS issue 10, you'll remember that I described there the new versions of the Interface 1 ROM. Well, since then, I've had many requests for the full details of the location of various routines in the new ROMs. So, to satisfy the demand, I've come up with a complete conversion chart from ROM 1 (the old one) to ROM 2 (the new one). I'll come on to ROM 3 later!
The first thing you've got to do is find out exactly which ROM you've got. Here's the best way to do this:

SAVE *"m";1;"rom" CODE 236,1: LOAD *"m";1;"rom" CODE 23296: PRINT PEEK 23296

This then copies one byte from the shadow ROM into RAM and should print one of the following numbers:
ROM 1...129
ROM 2...113
ROM 3...115

If you get any other number, it looks as though you've got an even newer ROM - in which case, write and tell me immediately!

MAP READING

Now, say you use a routine in ROM 1 and you want to find it in ROM 2, how do you go about it? Well, first find the block on the left hand side of the chart in which your block lies. Hopefully, it'll be white. If it's not, then there's no easy way of working out the new entry point 'cos there probably isn't one. But so long as it's white, note the address at the start of the block, which we'll call x1, and the corresponding address of the same block on the right, x2. If your routine is x, the new address is x-x1+x2.
To give you an example, a popular entry point is 1C58, the CAT routine. (I was hoping there'd be enough ROM to swing a CAT in! Ed)

ROM comparison chart

Click here for the BIG picture

This lies in the white block starting at 1C43 which has a corresponding value of 1C3D on the right. So, the new value is 1C58-1C43+1C3D=1C52. Simple when you know how!
Going the other way about, from ROM 2 to ROM 1 is just as easy. Given that the address is y, all you have to do is find the white block on the right and note its starting value, y1. Now, find the corresponding block on the left and note its starting value, y2. The resulting address in ROM 1 is then y-y1+y2.

THE THIRD ROM

ROM 3 is very similar to ROM 2, except that addresses from 1C3C are two bytes further on. To convert from ROM 1, here's the formula you'll need to work out the new address, t:

t=x-x1+x2: if t>=1C3C then t=t+2

To do an about face and convert from ROM 3 to ROM 1, do:

t=y: it t<1C3E then t=t-2
t=t-x1+x2

CHANGING ROMS

If you're still not sure that you've sussed how to convert from one ROM to another, have a crack at the following common routines and their locations - then use the same method in your own routines.
RoutineROM 1ROM 2ROM 3
Catalog1C581C521C54
Make M0FE810A510A5
"T" output0C3C0C3A0C3A
Error handler17B917B717B7
Home Contents KwikPik