A club member mentioned that he was using the artist program Tech Draw Jr., and asked whether anyone had modified it to allow for saving screen images to disk. This prompted me to look at the program a little more closely.
Tech Draw Jr. has a Basic program plus a block of some 35400 bytes of code, starting at address 30000. It has options in the Basic part of the program to permit saving screens to tape, to an Aerco system, and to the A & J system. The user is expected to choose one of these options and then save a customized version of the program.
In looking at these options I found that each option did a RAND USR to a different address in the program code. I decided that I would look more closely at the address pointed to by the tape option, namely 55291. I had earlier decided that it would be easier to modify the tape option, primarily because I thought I would recognise it’s m/c routines more easily.
I was familiar with the Spectrum LOAD and SAVE routines at addresses 1366 and 1218. However, here we were working with the 2068 which had the SAVE/LOAD routines in the EXROM. I was not sure what to expect.
In looking at the m/c at address 55291 with a disassembler I identified two locations worth looking at. One m/c sequence, starting at 53602, showed a typical SAVE routine, while a second sequence starting at 53780 indicated a LOAD routine. See the disassembled code sequences in Figure 1. The CALL 104 is the W_TAPE (SAVE) routine in the EXROM, while the CALL 252 is the R_TAPE (LOAD) routine. We are hot!!
I decided that I would use the same method as I had used with the program “Snodgits”, written about in an earlier issue of the newsletter. That is to say, I would locate the Larken SAVE/LOAD routines in some spare part of the computer memory. Then I would locate the tape LOAD amd SAVE routines in the code part of the program and substitute a CALL to my Larken routines, replacing the EXROM calls 104 and 252.
The code started at 30000 and ran to the top of memory. I decided to locate my Larken SAVE/LOAD code routines at address 29900. This would place it below and adjacent to the existing program code. That way it could be saved as part of the Tech Draw Jr. code. The disassembled code is in figure 2, while the Basic program to install it is in Figure 3.
Having done this it was a simple matter to place a CALL at address 53659 to SAVE and at address 53794 to LOAD. I also deleted some now-unneeded code. See Figure 4 for the details.
There was another thing. In the program when a SAVE or LOAD function was called, you were asked to input the name of the screen to be saved or loaded. I decided that I would determine where these names were stored, and have the Larken routine look to that location for the file name. I loaded the Tech Draw Jr. program, went into the SAVE routine, entering a name, and then breaking out of the program with an NMI-SAVE to a protencted disk. I then searched through the code, looking for the name that had been entered. I did the same thing for a LOAD routine. I found that both the SAVE and the LOAD names were stored at the same location. starting at address 36373.
I revised my Larken code, using an LDIR routine to pull the name from that location.
This completed the SAVE/LOAD disk routines. There remained one other minor item to finish up the job. In the program, the save and load screen messages make references to tape. Again, using the disassembler, I located text sequences containing the word “tape” at three locations; 53566, 53745, and 53868. I simply POKEd the code values for the word “disk”, to replace the tape references.
The program still has some shortcomings. It requires that any name that is input be a valid Larken format. If it is incorrect, not only will the Larken system reject it, but the program will crash and lock up. Also there is a VERIFY routine on the I/O screen which is not easily romoved and which, if selected, attempts a Larken LOAD.
Figure 1
53647 00 NOP
53648 00 NOP
53649 00 NOP
53650 CDF9D0 CALL 53497
53653 CDBFD1 CALL 53695
53656 CDA0D2 CALL 53920
53659 3E00 LD A,0
53661 111100 LD DE,17
53664 DD21148E LD IX,36372
53668 CD6800 CALL 104
53671 01E8FD LD BC,65000
53674 CD9EC3 CALL 50078
53677 3EFF LD A,255
53679 110018 LD DE,6144
53682 DD210040 LD IX,16384
53686 CD6800 CALL 104
53689 CDACD2 CALL 53932
53692 C304C4 JP 50180
53695 21148E LD HL,36372
53698 3603 LD (HL),3
53700 211F8E LD HL,36383
53794 37 SCF
53795 3E00 LD A,0
53797 111100 LD DE,17
53800 DD21258E LD IX,36389
53804 CDFC00 CALL 252
53807 CD87D2 CALL 53895
53810 38EE JR C,53794
53812 3A268E LD A,(36390)
53815 FE40 CP 64
53817 2006 JR NZ,53825
53819 0E40 LD C,64
53821 3E01 LD A,1
53823 ED79 OUT (C),A
53825 37 SCF
53826 216BBF LD HL,49003
53829 CB5E BIT 3,(HL)
53831 2001 JR NZ,53834
53833 3F CCF
53834 3EFF LD A,255
53836 110018 LD DE,6144
53839 DD210040 LD IX,16384
53843 CDFC00 CALL 252
53846 F5 PUSH AF
53847 CDACD2 CALL [illegible]
53850 F1 [illegible]
Figure 2
29900 C362C5 JP 50530
29903 CDD974 CALL 29913
29906 C9 RET
29907 00 NOP
29908 CD0575 CALL 29957
29911 C9 RET
29912 00 NOP
29913 F3 DI
29914 CD6200 CALL 98
29917 21158E LD HL,36373
29920 112220 LD DE,8226
29923 010A00 LD BC,10
29926 EDB0 LDIR
29928 3E0B LD A,11
29930 320220 LD (8194),A
29933 CDC600 CALL 198
29936 210040 LD HL,16384
29939 223320 LD (8243),HL
29942 210018 LD HL,6144
29945 223120 LD (8241),HL
29948 CDC900 CALL 201
29951 3A6400 LD A,(100)
29954 FB EI
29955 C9 RET
29956 00 NOP
29957 F3 DI
29958 00 NOP
29959 CD6200 CALL 98
29962 21158E LD HL,36373
29965 112220 LD DE,8226
29968 010A00 LD BC,10
29971 EDB0 LDIR
29973 3E0B LD A,11
29975 320220 LD (8194),A
29978 CDCC00 CALL 204
29981 210040 LD HL,16384
29984 223320 LD (8243),HL
29987 210018 LD HL,6144
29990 223120 LD (8241),HL
29993 CDCF00 CALL 207
29996 3A6400 LD A,(100)
29999 FB EI
30000 C9 RET
Figure 3
10 RESTORE 100
20 FOR n=29900 TO 30000
30 READ a: POKE n,a
40 NEXT n
50 STOP
100 DATA 195,98,197,205,217,116,201,0
101 DATA 205,5,117,201,0
102 DATA 243,205,98,0,33,21,142,17,34,32,1,10,0,237
103 DATA 176,62,11,50,2,32,205,198,0,33,0,64,34,51,32
104 DATA 33,0,24,34,49,32,205,201,0,58,100,0,251,201,0
105 DATA 243,0,205,98,0,33,21,142,17
106 DATA 34,32,1,10,0,237,176,62,11,50,2,32,205,204,0
107 DATA 33,0,64,34,51,32,33,0,24,34,49,32,205,207,0
108 DATA 58,100,0,251,201,0,0,0
1000 SAVE "data"
I just couldn’t pass up a buy in the April issue of Computer Shopper (I’m addicted, can’t quit buying it!). A 9″ Sony Trinitron RGB Monitor. It works great with my 2068. It came from:
SPECTRON SYSTEMS
3429 Calico Ave.
San Jose, CA 95124
1-800-283-4080 ext. 875
They do not take COD orders and so I sent a M.O. for $154 ($139 + $15 for s/h) and in less than a week I received the monitor. I’m very pleased!
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.