Jump to content
StickJock

Print Sheet (a Print Shop utility)

Recommended Posts

This is a utility that I wrote back in 1987.  It will print out a grid showing the pics & titles from a Print Shop graphics library disk.  BitD, I had acquired some Print Shop library disks, but did not have the reference sheets that came with them showing what pictures were on the disks.

 

I wrote this to print to an Epson printer (I had an RX-80 F/T+).  One thing that I discovered while developing this tool was that if the printer was in graphics mode, and I sent two $0D bytes in a row, the printer messed up.  I don't recall exactly what happened, I think maybe it exited graphics mode?  Anyway, Print Shop printed out the pic without a problem, but my tool messed up.  Upon investigation, I found that Print Shop tweaked the second byte, changing it from a $0D to a $0F (set bit 1).  So I added the same tweak to my code and then it printed out an identical, matching picture.

 

I was reminded of this tool that I wrote by this thread:  

 

I wrote about the tool in that thread, and even tracked it down and posted it.  I thought I would give it it's own thread so that it would be easier to find for anyone interested in it.

In that thread, @skr was able to download & run Print Sheet and posted a pic of the output on a STAR LC24-10 printer.  It prints out an 8x8 grid of the pics from the library disk, with the names of each pic centered below them.

 

Here is the source code inside a spoiler.  I wrote this when I was very young, before I did this sort of thing for a living, so please excuse the coding style.  I added a couple of edits to the text marked by "2020edit" that describes some ATASCII characters that didn't cut & paste properly.

 

 

Spoiler

0100 ; PRINT SHEET
0110 ; BY SCOTT J. SHAW
0120 ;
0130     .OPT NO LIST
0140     *=  $3000
0150     JMP START
0160 ; EQUATES
0170 RTCLOKL = $14
0180 PSPZ =  $80
0190 PLPZ =  $82
0200 SDLSTL = $0230
0210 COLOR0 = $02C4
0220 COLOR1 = $02C5
0230 COLOR2 = $02C6
0240 COLOR3 = $02C7
0250 COLOR4 = $02C8
0260 RUNAD = $02E0
0270 SECTLOC = $0600
0280 DUNIT = $0301
0290 DCOMND = $0302
0300 DBUFLO = $0304
0310 DBUFHI = $0305
0320 DAUX1 = $030A
0330 DAUX2 = $030B
0340 IOCB1 = $0350
0350 COLPF3 = $D019
0360 CONSOL = $D01F
0370 WSYNC = $D40A
0380 DSKINV = $E453
0390 CIOV =  $E456
0400 NAMES = $2000
0410 PICLOC = $4000
0420 PICSECT = $2800
0430 DONEYET
0440     .BYTE 0
0450 SECTOR
0460     .BYTE 0,0
0470 DRIVE
0480     .BYTE 1
0490 INDEX20S1
0500     .BYTE $10,$30,$50,$70,$90,$B0,$D0,$F0
0510 INDEX20S0
0520     .BYTE $00,$20,$40,$60,$80,$A0,$C0,$E0
0530 INDEX11
0540     .BYTE 0,11,22,33,44,55,66,77
0550 INDEXNAME
0560     .BYTE $08,$19,$2A,$3C,$4D,$5E,$6F,$80
0570 INDEX78LO
0580     .BYTE $00,$78,$F0,$68,$E0,$58,$D0,$48
0590 INDEX78HI
0600     .BYTE $00,$00,$00,$01,$01,$02,$02,$03
0610 SECNUMLO
0620     .BYTE 0,0,0,0,0,0,0,0
0630 SECNUMHI
0640     .BYTE 0,0,0,0,0,0,0,0
0650 TEMPNAME
0660     .BYTE "                "
0670 TEMPA
0680     .BYTE 0
0690 TEMPX2
0700     .BYTE 0
0710 TEMPX3
0720     .BYTE 0
0730 TEMPY1
0740     .BYTE 0
0750 TEMPY2
0760     .BYTE 0
0770 TEMPY3
0780     .BYTE 0
0790 PRADR
0800     .BYTE "P:"
0810 RETADR
0820     .BYTE $9B,$9B,$9B
0830 PRGRSET
0840     .BYTE "A",$08,"L",$C0,$03 ;2020edit "[ESC]A",..,"[ESC]L"...
0850 INTRODL
0860     .BYTE $70,$70,$70,$70,$70,$70,$70,$70,$46
0870     .WORD INTROSCR
0880     .BYTE $30,$02,$70,$70,$70,$02,$06,$06,$70,$70,$70,$02,$41
0890     .WORD INTRODL
0900 INTROSCR
0910     .SBYTE "    print  sheet     " ;2020edit inverse video, lower case "print sheet"
0920     .SBYTE "  Designed and written by Scott J. Shaw "
0930     .SBYTE "                                    TM  "
0940     .SBYTE " INSERT print shop  "
0950     .SBYTE "   GRAPHICS DISK    "
0960     .SBYTE "      READY PRINTER AND PUSH START      "
0970 INTRO
0980     .LOCAL 
0990     LDA #$00
1000     STA COLOR4
1010     STA COLOR2
1020     LDA #$60
1030     STA COLOR3
1040     LDA #$0F
1050     STA COLOR1
1060     LDA #$70
1070     STA COLOR0
1080     LDX # <INTRODL
1090     LDY # >INTRODL ; TURN ON
1100     STX SDLSTL  ; INTRO SCREEN
1110     STY SDLSTL+1
1120     LDA #$08
1130     STA CONSOL
1140 ?WAITSTART
1150     STX WSYNC
1160     INX 
1170     INX 
1180     STX COLPF3  ; FLASH COLORS
1190     LDA CONSOL  ; AND WAIT FOR
1200     CMP #$06    ; START
1210     BNE ?WAITSTART
1220     RTS 
1230 LOADDL
1240     .BYTE $70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$46
1250 SCRLINE
1260     .WORD LOADLINE
1270     .BYTE $41
1280     .WORD LOADDL
1290 LOADLINE
1300     .SBYTE "       LOADING      "
1310 LOAD
1320     .LOCAL 
1330     PHA 
1340     LDA # <LOADDL
1350     STA SDLSTL
1360     LDA # >LOADDL ; PRINT
1370     STA SDLSTL+1 ; "LOADING"
1380     LDA # <LOADLINE
1390     STA SCRLINE
1400     LDA # >LOADLINE
1410     STA SCRLINE+1
1420     LDA RTCLOKL
1430 ?WAITJIF
1440     CMP RTCLOKL
1450     BEQ ?WAITJIF
1460     PLA 
1470     RTS 
1480 THINKLINE
1490     .SBYTE "      THINKING      "
1500 THINK
1510     .LOCAL 
1520     PHA 
1530     LDA # <THINKLINE ; PRINT
1540     STA SCRLINE ; "THINKING"
1550     LDA # >THINKLINE
1560     STA SCRLINE+1
1570     PLA 
1580     RTS 
1590 PRINTLINE
1600     .SBYTE "      PRINTING      "
1610 PRINT
1620     .LOCAL 
1630     PHA 
1640     LDA # <PRINTLINE ; PRINT
1650     STA SCRLINE ; "PRINTING"
1660     LDA # >PRINTLINE
1670     STA SCRLINE+1
1680     PLA 
1690     RTS 
1700 PSHEADER
1710     .BYTE "PRINT SHOP:CLK!"
1720 CHKDSK
1730     .LOCAL 
1740     LDA DRIVE   ; CHECKS FOR A
1750     STA DUNIT   ; PRINT SHOP
1760     LDA #$69    ; DISK
1770     STA DAUX1
1780     LDA #$01
1790     STA DAUX2
1800     LDA # <SECTLOC
1810     STA DBUFLO
1820     LDA # >SECTLOC
1830     STA DBUFHI
1840     LDA #$52
1850     STA DCOMND
1860 ?CD1
1870     JSR DSKINV
1880     BMI ?CD1
1890     LDX #$0E
1900 ?CD2
1910     LDA SECTLOC,X
1920     CMP PSHEADER,X
1930     BNE ?NPSD
1940     DEX 
1950     BPL ?CD2
1960     LDA #$00
1970     RTS 
1980 ?NPSD
1990     LDA #$FF
2000     RTS 
2010 INITPS
2020     .LOCAL 
2030     LDY #$00    ; CLEARS MEMORY
2040     TYA         ; FOR PIC DATA
2050 ?INIT1
2060     STA PICSECT,Y
2070     STA PICSECT+$0100,Y
2080     STA PICSECT+$0200,Y
2090     DEY 
2100     BNE ?INIT1
2110     RTS 
2120 INIT
2130     .LOCAL 
2140     LDY #$00
2150     TYA 
2160 ?INIT1
2170     STA SECTLOC,Y
2180     LDA #$20    ; CLEARS MEMORY
2190     STA NAMES,Y ; FOR SECTOR AND
2200     LDA #$00    ; NAMES
2210     DEY 
2220     BNE ?INIT1
2230     LDX #$07
2240 ?INIT2
2250     STA SECNUMLO,X ; CLEARS OUT
2260     STA SECNUMHI,X ; SECTOR LIST
2270     DEX 
2280     BPL ?INIT2
2290     LDX #$40
2300     LDY #$00
2310     LDA # <PICLOC
2320     STA PSPZ
2330     LDA # >PICLOC
2340     STA PSPZ+1
2350     LDA #$00
2360 ?INIT3
2370     STA (PSPZ),Y
2380     DEY         ;CLEARS OUT
2390     BNE ?INIT3  ;GRAPHICS MEMORY
2400     INC PSPZ+1
2410     DEX 
2420     BNE ?INIT3
2430     RTS 
2440 START
2450     .LOCAL 
2460     JSR INTRO   ; INTRO SCREEN
2470     JSR CHKDSK  ; CHECK PS DISK
2480     CMP #$00
2490     BNE START
2500     STA DONEYET
2510     JSR LOAD    ; PRINT LOADING
2520     LDA #1
2530     STA SECTOR+1
2540     LDA #$6A
2550     STA SECTOR
2560 DOIT
2570     JSR INIT    ; WIPE MEMORY
2580     LDA SECTOR
2590     STA DAUX1
2600     LDA SECTOR+1
2610     STA DAUX2
2620     LDA # <SECTLOC
2630     STA DBUFLO
2640     LDA # >SECTLOC
2650     STA DBUFHI
2660     LDA DRIVE
2670     STA DUNIT
2680     LDA #$52
2690     STA DCOMND
2700 ?STDI1
2710     JSR DSKINV  ; GET PRINT SHOP
2720     BMI ?STDI1  ; DIRECTORY
2730     INC SECTOR  ; SECTORS
2740     LDA SECTOR
2750     STA DAUX1
2760     LDA #$80
2770     STA DBUFLO
2780     LDA #$52
2790     STA DCOMND
2800 ?STDI2
2810     JSR DSKINV
2820     BMI ?STDI2
2830     INC SECTOR
2840 GETNAMES
2850     .LOCAL 
2860     LDY #$07
2870 ?GN1
2880     LDX INDEX20S0,Y
2890     STY TEMPY1  ; COPY SECTORS
2900     LDY #$00    ; INTO TABLE
2910 ?GN2
2920     LDA SECTLOC,X
2930     CMP #$00
2940     BNE ?GNN0   ; COPY NAMES
2950     LDA #$20    ; INTO TEMP LOC
2960 ?GNN0
2970     STA TEMPNAME,Y
2980     INX 
2990     INY 
3000     CPY #$10
3010     BNE ?GN2
3020     DEY 
3030 ?GN3
3040     LDA TEMPNAME,Y
3050     CMP #$20    ; FIND LENGTH OF
3060     BNE ?GN4    ; NAME
3070     DEY 
3080     BPL ?GN3
3090     BMI ?GN5
3100 ?GN4
3110     TYA 
3120     INY 
3130     STY TEMPY2
3140     LSR A
3150     STA TEMPA
3160     LDY TEMPY1
3170     LDA INDEXNAME,Y
3180     SEC 
3190     SBC TEMPA
3200     TAX 
3210     LDY #$00
3220 ?GN6
3230     LDA TEMPNAME,Y
3240     STA NAMES,X ; CENTER NAME
3250     INX         ; BENEATH PIC
3260     INY 
3270     CPY TEMPY2
3280     BNE ?GN6
3290 ?GN5
3300     LDY TEMPY1
3310     DEY 
3320     BPL ?GN1
3330 GETSECS
3340     .LOCAL 
3350     LDY #$07
3360 ?GS1
3370     LDX INDEX20S1,Y ; SET UP TO
3380     LDA SECTLOC,X ; LOAD PIC
3390     STA SECNUMLO,Y ; DATA
3400     BNE ?GS2
3410     LDA SECTLOC+1,X
3420     BNE ?GS2
3430     STX DONEYET
3440 ?GS2
3450     LDA SECTLOC+1,X
3460     STA SECNUMHI,Y
3470     DEY 
3480     BPL ?GS1
3490     LDA DONEYET
3500     CMP #$10
3510     BNE GETPICS
3520     JMP START
3530 GETPICS
3540     .LOCAL 
3550     LDX #$00
3560 DNS
3570     JSR LOAD    ; PRINT LOADING
3580     STX TEMPX3
3590     JSR INITPS
3600     LDA SECNUMLO,X
3610     STA DAUX1
3620     LDA SECNUMHI,X
3630     STA DAUX2
3640     CMP #$00
3650     BNE ?TIAP
3660     LDY SECNUMLO,X
3670     CPY #$00
3680     BEQ CONVPIC
3690 ?TIAP
3700     LDA # <PICSECT
3710     STA DBUFLO
3720     LDA # >PICSECT
3730     STA DBUFHI
3740 ?GP1
3750     LDA #$52    ; LOAD THE PIC
3760     STA DCOMND  ; DATA SECTORS
3770     JSR DSKINV
3780     BMI ?BADPS  ; DISK ERROR?
3790     CLC 
3800     LDA DBUFLO
3810     STA PSPZ
3820     ADC #$7E
3830     STA DBUFLO
3840     LDA DBUFHI
3850     STA PSPZ+1
3860     ADC #$00
3870     STA DBUFHI
3880     LDY #$7E
3890     LDA (PSPZ),Y
3900     STA DAUX1   ; FIND NEXT SECT
3910     INY         ; TO LOAD
3920     LDA (PSPZ),Y
3930     STA DAUX2
3940     BNE ?GP1
3950     LDA DAUX1
3960     BNE ?GP1
3970 ?BADPS
3980     LDA #$00    ; WIPE OUT
3990     LDX #$30    ; "EXTRA" DATA
4000 ?ZE
4010     STA PICSECT+$023C,X
4020     DEX 
4030     BPL ?ZE
4040 CONVPIC
4050     .LOCAL 
4060     JSR THINK   ; PRINT THINKING
4070     LDX TEMPX3
4080     STX $02C6
4090     LDA # <PICSECT
4100     STA PSPZ
4110     LDA # >PICSECT
4120     STA PSPZ+1
4130     LDA INDEX78LO,X
4140     CLC 
4150     ADC # <PICLOC
4160     STA PLPZ
4170     LDA INDEX78HI,X
4180     ADC # >PICLOC
4190     STA PLPZ+1
4200     LDX #$06
4210 ?CV3
4220     STX TEMPX2
4230     LDY #$10
4240     STY TEMPY3
4250     LDY #11
4260 ?CV2
4270     STY TEMPY1
4280     LDY #$07
4290 ?CV
4300     STY TEMPY2
4310     LDX #$00
4320     STX TEMPA
4330 ?CV1
4340     LDY INDEX11,X
4350     LDA (PSPZ),Y
4360     ASL A
4370     STA (PSPZ),Y
4380     LDA TEMPA   ; CONVERT DATA
4390     ROL A       ; TO PRINTER
4400     STA TEMPA   ; CODE AND MOVE
4410     INX         ; IT TO PRINTER
4420     CPX #$08    ; OUTPUT MEMORY
4430     BNE ?CV1
4440     LDY TEMPY3
4450     STA (PLPZ),Y
4460     INY 
4470     STY TEMPY3
4480     LDY TEMPY2
4490     DEY 
4500     BPL ?CV
4510     LDY PSPZ
4520     INY 
4530     STY PSPZ
4540     BNE ?CV4
4550     INC PSPZ+1
4560 ?CV4
4570     LDY TEMPY1
4580     DEY 
4590     BNE ?CV2
4600     LDA PLPZ
4610     CLC 
4620     ADC #$C0
4630     STA PLPZ
4640     LDA PLPZ+1
4650     ADC #$03
4660     STA PLPZ+1
4670     LDA PSPZ
4680     CLC 
4690     ADC #$4D
4700     STA PSPZ
4710     LDA PSPZ+1
4720     ADC #$00
4730     STA PSPZ+1
4740     LDX TEMPX2
4750     DEX 
4760     BPL ?CV3
4770     LDX TEMPX3
4780     INX 
4790     CPX #$08
4800     BEQ PRINTPIC
4810     JMP DNS
4820 PRINTPIC
4830     .LOCAL 
4840     LDX #$20
4850     LDY #$00
4860     LDA # <PICLOC
4870     STA PSPZ
4880     LDA # >PICLOC
4890     STA PSPZ+1
4900 ?FIXD
4910     LDA (PSPZ),Y ; "FIX" CERTAIN
4920     CMP #$0D    ; DATA BYTES
4930     BNE ?ND     ; WHICH CAUSE
4940     INY         ; PECULIAR
4950     BNE ?NW1    ; PRINTER
4960     INC PSPZ+1  ; BEHAVIOR.
4970     DEX         ; ERROR OCCURS
4980     BEQ ?DCD    ; WHEN TWO $0D
4990 ?NW1
5000     LDA (PSPZ),Y ;(13) CHRS. ARE
5010     CMP #$0D    ; SENT TO THE
5020     BNE ?ND     ; PRINTER
5030     LDA #$0F    ; CONSECUTIVELY.
5040     STA (PSPZ),Y ; A $20 (32) IS
5050 ?ND
5060     INY         ; INSERTED
5070     BNE ?FIXD   ; BETWEEN THEM.
5080     INC PSPZ+1  ;PS AND I REMEDY
5090     DEX         ;BY CHANGING 2ND
5100     BNE ?FIXD   ; $0D TO A $0F
5110 ?DCD
5120     JSR PRINT   ; PRINT PRINTING
5130     LDA #$03
5140     STA IOCB1+2
5150     LDA #$08
5160     STA IOCB1+10
5170     LDA # <PRADR
5180     STA IOCB1+4
5190     LDA # >PRADR
5200     STA IOCB1+5
5210     LDA #$02
5220     STA IOCB1+8
5230     LDA #$00
5240     STA IOCB1+9
5250     LDX #$10    ; OPEN CHANNEL
5260     JSR CIOV    ; TO PRINTER
5270     LDA #$02    ; PRINT TWO
5280     JSR PRTRET  ; RETURNS
5290     LDA # <PICLOC
5300     SEC 
5310     SBC #$07
5320     STA PLPZ
5330     LDA # >PICLOC
5340     SBC #$00
5350     STA PLPZ+1
5360     LDY #$06
5370 ?PP
5380     STY TEMPY1
5390     LDA #$01
5400     JSR PRTRET  ; PRINT A RETURN
5410     LDA #$0B
5420     STA IOCB1+2
5430     LDY #$06
5440 ?PSGS
5450     LDA PRGRSET,Y
5460     STA (PLPZ),Y
5470     DEY         ; SET UP PRINTER
5480     BPL ?PSGS   ; CONTROL CODES
5490     LDA PLPZ
5500     STA IOCB1+4
5510     LDA PLPZ+1
5520     STA IOCB1+5
5530     LDA #$C7
5540     STA IOCB1+8
5550     LDA #$03
5560     STA IOCB1+9
5570     LDX #$10    ; PRINT LINE OF
5580     JSR CIOV    ; GRAPHICS
5590     LDA #$00
5600     LDY #$06
5610 ?PSCGS
5620     STA (PLPZ),Y
5630     DEY         ; REMOVE PRINTER
5640     BPL ?PSCGS  ; CONTROL CODES
5650     LDA PLPZ
5660     CLC 
5670     ADC #$C0    ; FIND NEXT LINE
5680     STA PLPZ    ; OF GRAPHIC
5690     LDA PLPZ+1  ; DATA
5700     ADC #$03
5710     STA PLPZ+1
5720     LDY TEMPY1  ; DONE WITH THAT
5730     DEY         ; ROW OF PICS?
5740     BPL ?PP     ; NOPE!
5750     LDA #$01
5760     JSR PRTRET  ; PRINT RETURN
5770     LDA #$0F
5780     STA NAMES-1
5790     LDA #$9B
5800     STA NAMES+$8A
5810     LDA #$0B
5820     STA IOCB1+2
5830     LDA # <NAMES-1
5840     STA IOCB1+4
5850     LDA # >NAMES-1
5860     STA IOCB1+5
5870     LDA #$8C
5880     STA IOCB1+8
5890     LDA #$00
5900     STA IOCB1+9
5910     LDX #$10
5920     JSR CIOV    ; PRINT NAMES
5930     LDA #$0C
5940     STA IOCB1+2
5950     LDX #$10
5960     JSR CIOV    ; CLOSE CHANNEL
5970     LDA DONEYET ; FINISHED ALL
5980     BNE ?DONE   ; PICS ON DISK?
5990     LDA SECTOR
6000     CMP #$8A
6010     BEQ ?DONE
6020     JMP DOIT
6030 ?DONE
6040     JMP START   ; RE-START PROG.
6050 PRTRET
6060     STA IOCB1+8 ; ROUTINE TO
6070     LDA #$00    ; PRINT RETURNS.
6080     STA IOCB1+9 ; NUMBER TO
6090     LDA #$0B    ; PRINT WAS HELD
6100     STA IOCB1+2 ; IN ACCUMULATOR
6110     LDA # <RETADR
6120     STA IOCB1+4
6130     LDA # >RETADR
6140     STA IOCB1+5
6150     LDX #$10
6160     JSR CIOV    ; PRINT 'EM
6170     RTS 
6180     *=  RUNAD
6190     .WORD START

 

In the listing above, this line:

0840     .BYTE "A",$08,"L",$C0,$03 ;2020edit "[ESC]A",..,"[ESC]L"...
 

There are two characters inside each set of quotes.  The ESC character (press ESC twice on the Atari keyboard) followed by the letter shown.  So the line would be:

0840     .BYTE "[ESC]A",$08,"[ESC]L",$C0,$03 ;2020edit "[ESC]A",..,"[ESC]L"...

 

I've also attached the source code as a text file and the runtime .obj file.

I suppose the .obj file should be renamed to .xex to "get with the times".  😀

 

prtsheet.obj prtsheet.lst.editted.txt

Edited by StickJock
  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

Here is the printout that @skr posted on the other thread.

psprint.thumb.jpg.f0ac3881be0381501370ac84ebe503b6.jpg

Looks like the paper isn't quite centered in the printer.  Are you using the tractor feed or the friction feed?  I think I used to run with the tractor feed turned on.

You might need a new ribbon.  I used my original ribbon for years, and would do the WD-40 trick on it to keep it going.  I didn't realize how bad it had gotten (it was printing in grey instead of black!) until my Dad bought me a new ribbon.  Wow! what a difference that made!

 

 

Share this post


Link to post
Share on other sites

Actually, I didn´t setup anything. This is my second LC24-10 which was sitting in a box for a few months. Just quickly put it on the desk, somehow threw the paper in and let it go. Basically that was a good occasion to test that printer. Still three printers to test, that somehow ended up in my apartament. ;)

 

  • Like 1

Share this post


Link to post
Share on other sites

Well, I'm glad that I gave you an opportunity to test out your printer!


Looks like the paper is also feeding slightly crooked.  The bottom looks like it printed farther to the left than at the top.  

I'm guessing that you are not using the tractor feed, as that should automatically center it.  Also, I remember that it didn't work well to have both the tractor feed and the friction feed both engaged at the same time.  If the paper isn't perfectly aligned, they tend to fight against each other and mess things up.

 

How many people still have & use these old printers?  I still have my Epson RX-80 F/T+ boxed up in the top of the closet, along with the 850 interface and my 2400 baud modem.  I remember selling my 1200 baud modem by putting up a few For Sale printouts in the engineering buildings in college with my phone number in tear-off tabs on the bottom.  I think I got almost enough for it to buy the 2400 baud one.

 

I think I got my printer for Christmas in 1984.  Maybe 1985?

Share this post


Link to post
Share on other sites

I have a Panasonic KXP-2135 which is in need of some minor repairs now.  The foam under the lid needs replaced, I probably need another new ribbon unless I can re-ink it, and the print head is also severely worn out (even with a brand new ribbon it prints lightly).

Share this post


Link to post
Share on other sites

For those curious about the format of Print Shop library disks, the source code posted in the spoiler in the first post reveals how they are set up.

 

The CHKDSK subroutine at line 1720 shows that there is an ID (PRINT SHOP:CLK!) on the disk that identifies it as a Print Shop library disk.  It's been ages since I've programmed on an Atari, but it looks like it is looking for it at the beginning of sector 361 ($169).  

Spoiler

1700 PSHEADER
1710     .BYTE "PRINT SHOP:CLK!"
1720 CHKDSK
1730     .LOCAL 
1740     LDA DRIVE   ; CHECKS FOR A
1750     STA DUNIT   ; PRINT SHOP
1760     LDA #$69    ; DISK
1770     STA DAUX1
1780     LDA #$01
1790     STA DAUX2
1800     LDA # <SECTLOC
1810     STA DBUFLO
1820     LDA # >SECTLOC
1830     STA DBUFHI
1840     LDA #$52
1850     STA DCOMND
1860 ?CD1
1870     JSR DSKINV
1880     BMI ?CD1
1890     LDX #$0E
1900 ?CD2
1910     LDA SECTLOC,X
1920     CMP PSHEADER,X
1930     BNE ?NPSD
1940     DEX 
1950     BPL ?CD2
1960     LDA #$00
1970     RTS 
 

 

It looks like the code then loads up the names and sector locations for the pics starting at sector 362 ($16A).  The directory appears (I'm just looking at the code, not at an actual PS disk for verification, so here's hoping I know what I'm doing (or what I did, as it were)) to be in $20 byte chunks, with the names occupying the first $10 bytes, with the starting sector of the each pic in the second half.  Each data sector has a zero-terminated link to the next sector in the last two bytes (so 126 data bytes per sector).

 

  • Like 1

Share this post


Link to post
Share on other sites

It's interesting, and a bit cringe-worthy, to look at code that I wrote 33 years ago.  I am frankly embarrassed by some of the obviously sloppy code.  For example, this gem here:

 

3550     LDX #$00
3560 DNS
3570     JSR LOAD    ; PRINT LOADING
3580     STX TEMPX3
 

Sure, the code is correct and functions properly, but I really should have cached X before the JSR LOAD.  I mean, *I* know that LOAD isn't going to mess with X, but it would be cleaner to store it before the jsr.

I also see several places where the code could be optimized.

 

Kids these days don't know the joy/pain of working on such constrained systems.  At my last job, I was writing assembly code for a custom microprocessor that had 2K words of OTP ROM, 128 words of RAM and ran at 2 MIPS.  Every instruction, bit & cycle mattered.  It felt like a luxury when we spun the chip to have 4K words of Flash ROM (truly a game changer), and 204 words of RAM (still ran at 2 MIPS).  These days, even microcontrollers have C compilers, tons of ROM & RAM, and CPU cycles to spare! 

 

Oddly enough, even though saving bytes is hard-wired into me, I still use two spaces after a period, just as God intended.

 

Now, if you will excuse me, I need to yell at some kids to get off of my lawn!  😀

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...