• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

ROM Replacement for Apple II+

tony359

Active member
Hi there,

I have an Apple II Europlus (an Apple II+ for Euro market I understand) which might have a faulty ROM as it lands on Monitor every time.

I built a "Rom Replacement" card. I don't have AT27C256 so I used an AT27C512.

The manual of the card says :


EPROM contents As mentioned before, the EPROM contains 2 banks of software. The 27C256 EPROM can contain 32K of data. Applesoft BASIC consists of 6x 2K ROMs and INTEGER BASIC consists of 4x 2K ROMs. The Inspector and Watson software is also included with the INTEGER BASIC bank and consists of 2x 2K ROMs. So in total we need 24K of space for our software. The EPROM is structured as follows: first it contains 4K empty data, followed by the 4x INTEGER ROMs, 1x Inspector ROM and 1x Watson ROM. Then 4K empty space again, followed by the 6x Applesoft ROMs in order D0, D8, E0, E8, F0 and F8

I'm using the TL866II software to concatenate the ROMs. I think I managed to get the Integer bank working - it doesn't autostart? - but not the AppleSoft (really, I don't know the difference so I might be mistaken).

The manual says to leave 4K blank, then write D0, D8, E0,E8,F0,F8. So I start writing at location 1000 with D0, 1800 for D8, 2000 for E0, 2800 for E8, 3000 for F0 and 3800 for F8. I disable the option to write FF on what is not being loaded of course.

For now I didn't try copying the same data on the other half of the ROM, considering it's a 512 and not 256.

I get question marks :) What am I doing wrong?

Thanks!
 

SuperSVGA

Well-known member
I think I managed to get the Integer bank working - it doesn't autostart?
This seems correct based on the manual:
Note on INTEGER BASIC:
When booting the INTEGER BASIC bank (jumper removed) you first boot into the monitor program. To actually start the BASIC, you need to press CTRL + B and then RETURN.


The manual says to leave 4K blank, then write D0, D8, E0,E8,F0,F8. So I start writing at location 1000 with D0, 1800 for D8, 2000 for E0, 2800 for E8, 3000 for F0 and 3800 for F8. I disable the option to write FF on what is not being loaded of course.

For now I didn't try copying the same data on the other half of the ROM, considering it's a 512 and not 256.
Well if you use a 27C512 in place of a 27C256 then what was previously VPP is going to be A15. Since VPP is held high in normal operation of a 27C256 this means A15 will always be high, so nothing below 0x8000 will be read.

So I believe that means the first ROM should start at 0x9000, so if you aren't duplicating the first half of the ROM to the second, then it probably won't work.

So as I understand in the manual it should be laid out like this:
0x9000
0x9800
0xA000
0xA800
0xB000
0xB800

0xD000
0xD800
0xE000
0xE800
0xF000
0xF800

It may be helpful to save the ROM before you write in and open it in a hex editor such as ImHex, and use the selection information at the bottom to make sure you've got everything at the correct addresses and sizes.
 

tony359

Active member
Thank you so much! I knew I should have checked the pinout!

I guess I could also tie A15 to ground and use the original layout. Or get a 256 :)

I'll try lmHex thanks.

Just for my understanding, how do you come up with those addresses? How does the Apple know where to look when it's switched on?

Thanks so far!
 

SuperSVGA

Well-known member
Just for my understanding, how do you come up with those addresses?
Addressing is a bit confusing, but it's mostly just a lot of math. The original ROMs are 2KB, or 2048 bytes. 2048 in hex is 0x800, and 4KB or 4096 is 0x1000.
A 256Kb or 32KB ROM like the 27C256 would end at 0x7FFF, and the 512Kb or 64KB 27C512 would end at 0xFFFF.
Every address line will double the available memory space, so for example with the 27C512 you have 16 address lines, which is 2^16 = 65536 = 64KB.

How does the Apple know where to look when it's switched on?
When the 6502 resets, it looks at the reset vector, which is the two bytes 0xFFFC. In AppleSoft Basic F8, this is 0x62FA. Since 6502 is little endian it reads the low byte first, so the address is 0xFA62.
 

tony359

Active member
Addressing is a bit confusing, but it's mostly just a lot of math. The original ROMs are 2KB, or 2048 bytes. 2048 in hex is 0x800, and 4KB or 4096 is 0x1000.
A 256Kb or 32KB ROM like the 27C256 would end at 0x7FFF, and the 512Kb or 64KB 27C512 would end at 0xFFFF.
Every address line will double the available memory space, so for example with the 27C512 you have 16 address lines, which is 2^16 = 65536 = 64KB.

Thanks! Fun and interesting indeed!
I understand the 2K = 0x0800 etc. What I am not sure I understand is how you ended up with the below

0x9000
0x9800
0xA000
0xA800
0xB000
0xB800
 

SuperSVGA

Well-known member
Thanks! Fun and interesting indeed!
I understand the 2K = 0x0800 etc. What I am not sure I understand is how you ended up with the below

0x9000
0x9800
0xA000
0xA800
0xB000
0xB800

We start at 32678 or 0x8000 since this is the second half of the 27C512. Since we are skipping the first 4KB we add 4096 or 0x1000. Then we add 2048 or 0x800 for each 2KB ROM.

Code:
   32678  0x8000
+   4096  0x1000
   36864  0x9000
+   2048  0x0800
   38912  0x9800
+   2048  0x0800
   40960  0xA000
+   2048  0x0800
   43008  0xA800
+   2048  0x0800
   45056  0xB000
+   2048  0x0800
   47014  0xB800
 

tony359

Active member
Understood.
I did write a ROM which was mirrored - 32KB + 32KB. Maybe I made a mistake then as that should have worked.

I think I understand now. When the Apple is looking for address 0x0000, because pin 15 is always high, the request is going to 0x8000 instead.

Thanks for the explanation, appreciated. I'll try as you say and also see if I can find a 27C256 as well.
Cheers!
 

tony359

Active member
Oh I forgot - slightly OT: what is the difference between Applesoft and integer ROM? Why would someone need both?
 

tony359

Active member
It may be helpful to save the ROM before you write in and open it in a hex editor such as ImHex, and use the selection information at the bottom to make sure you've got everything at the correct addresses and sizes.

I've played with lmhex a bit - looks interesting! Is there a way to say import the BIN files and place them on a new file while keeping track of the patterns with colours for example? So far I have discovered the bookmark section but I have a feeling there is a better way!

Thanks!
 

Arbee

Well-known member
Oh I forgot - slightly OT: what is the difference between Applesoft and integer ROM? Why would someone need both?
Integer BASIC is Woz's original BASIC. As the name states, it can't do floating-point math, so Pi being 3.141 isn't a thing. Applesoft is licensed Microsoft 6502 BASIC like most other 8-bit computers had and it can do floating-point. You need Integer mostly for a few very early games, and DOS 3.3 can switch back and forth using the language card on 64K+ machines regardless of what the ROM on the motherboard is.
 

tony359

Active member
very interesting thanks. So what I want is Applesoft and Integer there just in case. So fascinating, thanks!
 

tony359

Active member
I've got somewhere with the ROMs - I was using a AT27C512 instead of the expected AT27C256 - the extra address line ended up being pulled high all the time so the data I was saving was not accessible.

I got to a point where
- I can run Integer basic. I can type and run a basic code.
- I can run Applesoft Basic. I can run software from floppies.

However, Applesoft does not autostart - and with "autostart" I'm expecting the same behaviour I see with the Apple //e, that is, the floppy starts reading immediately at power up. Instead, it sits on "Apple ][" until I hit RESET. Then it drops me to Applesoft Basic. There I can type PR#6 and the disk starts fine.

What am I missing?

I am using the ROMs I found here: http://mirrors.apple2.org.za/Apple .../Computers/Apple II/Apple II plus/ROM Images/
 

tony359

Active member
thanks to Applefritter I found the issue - the IC looking after the slot select signal, likely stuck on slot 7. So my ROM is correct :)
 

Skate323k137

Well-known member
Good stuff!

For custom boot roms (somewhat self plug) I use the Brain Board by Mike Willegal, which I revised to have space for both applesoft and integer basic. It also has an Apple 1 mode with working cassette input on the Apple II. In theory you can run a board romless with one but I haven't actually tried.

 

tony359

Active member
That looks cool! To be fair I would now go for a ROM on a card now - I believe there is an open source language card available? Less hassle, the Apple is untouched and easier to move from one to another. One downside of the one I used is that the pins will inevitably deform the sockets so nothing else will fit in them anymore but those larger pins.
 

Skate323k137

Well-known member
That looks cool! To be fair I would now go for a ROM on a card now - I believe there is an open source language card available? Less hassle, the Apple is untouched and easier to move from one to another. One downside of the one I used is that the pins will inevitably deform the sockets so nothing else will fit in them anymore but those larger pins.
On my II+ I changed from the MSFT language card which has the supplementary ribbon cable that plugs into a RAM socket to the 'Saturn RAM expansion.' Much less power consumption and more reliable I find. Worst case you need to find a single RAM DIP to replace the one pulled from the motherboard for the original language card installation.
 

tony359

Active member
well the Apple II Europlus failed again so I had to repair it again. I also modded the ROM - with Jeff Mazur's help - to implement a simple feature. Plus I finally re-aligned that floppy!

 
Top