HC2000 ROM                                      Roelof Koning, 2006
===========================================================================
The HC2000 has been marketed in (at least) two versions:
One with a 27C256 EPROM on the calculator part of the Printed Circuit Board (PCB, left hand side) together with a 27C128 EPROM on the IF1 interface part. (right hand side). This version also has two RAM chips type 2114 on the interface part of the PCB.
Another version holds only a 27C512 EPROM on the calculator part of the PCB, and one 6116 RAM chip on the disk interface part of the PCB.
It seems that the PCB is prepared for both versions, although the '64K'
version probably needs some modifications as on my board there are a few
extra wires.

27C128 = 16K EPROM	2114 = 1K RAM, 4 bits
27C256 = 32K EPROM	
27C512 = 64K EPROM	6116 = 2K RAM, 8 bits          

So the second version, which I own, has 16K of ROM and 1K of RAM more than the first version.

The 64K EPROM holds:
0     - 16383 = the IF1 system
16384 - 32767 = almost identical copy of  0-16
32768 - 49151 = the Spectrum ROM with some extra at 14446
49152 - 65535 = the CPM BIOS and bootstrap loader

When the Interface 1 EPROM is paged in, then a block of 1K RAM is paged
at address 10240, and again at 11264 and at 14336 and at 15360. 
The second 1K that is available in the 6116 chip is not used at all

The 6116 RAM chip is switched on and off ('selected') by means of a LS138-type chip which uses the signals A11 and A13 to discriminate between the EPROM and the RAM addresses. The signal A12 is not taken into account, that is why the RAM appears again at addresses that are 2K higher.
As also the chip's A10 connection (pin 19)is connected to ground (pin 20), the same 1K RAM is found 4 times! 

My first project was making the 'lost' 1K available by carefully cutting pin 19 free from pin 20 (of the 6116 chip) and then connecting this pin 19 to 'A10' available on the empty EPROM space (pin 21). 

The second project was making the address decoding more complete by taking
A12 into account. And also adding A14 of the 64K EPROM, to discriminate
between the 0-16K bank and the copy at 16-32K. The latter (16-32K) is not
used by the system, and I wanted this full 16K available.
I carefully cut pin 1 of the LS138 from the PCB, then soldered a wire to the point pin 1 was connected with on the PCB. The original signal arriving at pin 1 comes from an AND gate which inputs are A11 and A13.
So pin 1 is only 'high' when both A11 and A13 are 'high'. 
The new situation must be: 
Pin 1 is only hi when A11+A13 is hi, AND A12 is lo, AND A14 (EPROM) is lo.

A 74LS02 chip can be used for the job:
-----------------------------------------------------------------------
Pin 1 (the output) connected to LS138 pin 1.
Pin 2 connected to pin 13.
Pin 3 connected to pin 4.
Pin 5 connected to pin 6 and to the original signal from the board.
Pin 7 Ground (LS138 pin 8)
Pin 8 connected to A12 (available at p.2 of empty EPROM position)
Pin 9 connected to A14 of the 64K EPROM (pin 27)
Pin 10 connected to pin 11 and pin 12
Pin 14 connected to +5V (LS138 pin 16)

The netto result of al this modification is that I now have 20K of
space in EPROM available for my own code, and 1K RAM to play with. 
Even when an eprom programmer is not available, then the door to 
using FlashRAM instead of EPROM is open now!

==================================================================
Now a program to check all this:
LET L= USR 4e4
FOR F= 65500 TO 65523
PRINT F, PEEK F
NEXT F

Result: BASIC  CP/M    IF1     IF1copy  
3680      7     223     0        0
4366     13     255     0       62
5744    237     255     205     255
6272    198     219     205     205
11000   205      28     111     255 
14416    56     216     255     255

In the old situation the four underlined values were
poked to other values like 111 and 222. After the changes
only one 2K block in the IF1-ROM is left pokable.

;-----------------------------------------------------  
;* TORNADO *   Testing the switching of EPROM banks 
;               and the presence of RAM          
;-----------------------------------------------------  
           ORG  40000   
           DUMP 40000   

           DI           
           CALL test    
           EI           
           RET          

test       CALL doit2             ;BASIC bank, 32-48K 
           LD   (65500),BC  
           LD   (65502),DE  
           LD   (65504),HL  
;--------------------------
           LD   A,1               ;switch on CPM bank, 48-64K      
           OUT  (126),A 
           CALL doit2   
           XOR  A       
           OUT  (126),A           ;normal   
           LD   (65506),BC  
           LD   (65508),DE  
           LD   (65510),HL  
;--------------------------  
           LD   HL,doit           ;switch on IF1 bank, 0-16K  
           LD   (23789),HL  
           RST  8       
           DEFB #32               ;make sure IF1 is in, then jp to 'doit'          
           RET                    ;page out IF1 here
doit       CALL doit2             ;take from ROM
           LD   (65512),BC  
           LD   (65514),DE  
           LD   (65516),HL  
;--------------------------        
           LD   A,1               ;switch on 16-32K bank   
           OUT  (126),A           ; (The IF1 ROM is still paged in!!)
           CALL doit2             ;take from ROM again          
           XOR  A       
           OUT  (126),A           ;return to normal IF1
           LD   (65518),BC  
           LD   (65520),DE  
           LD   (65522),HL              
           RET          
    
doit2      LD   A,(3680)       ;peek a few ROM addresses
           LD   C,A     
           LD   A,(4366)
           LD   B,A     
           LD   A,(5744)
           LD   E,A     
           LD   A,(6272)
           LD   D,A     
           LD   A,111   
           LD   (11000),A      ;poke an address of the RAM area    
           LD   A,222   
           LD   (14416),A      ;an address in the mirrorred RAM 
           LD   HL,(11000)     ;read back the value
           LD   A,(14416)   
           LD   H,A            ;result in HL    
           RET          

;==============================================================
Roelof.