Browse Source

imported TopDesk 1.3 source

$ md5 -r td*
7ba080948e td128_13_de.d71
cbabedcd32 td128_13_en.d71
82cdb55cac td64_13_de.d71
e040d69482 td64_13_en.d71
master
Michael Steil 4 months ago
commit
6f5ae9b437
100 changed files with 40437 additions and 0 deletions
  1. 527
    0
      128_de/DeskInclude/CopyFile.s
  2. 543
    0
      128_de/DeskInclude/DiskCopy.s
  3. 133
    0
      128_de/DeskInclude/DosFormat.s
  4. 446
    0
      128_de/DeskInclude/EditText.s
  5. 204
    0
      128_de/DeskInclude/SearchDisk.s
  6. 95
    0
      128_de/DeskInclude/SizeRectangle.s
  7. 461
    0
      128_de/DeskInclude/Validate+Undelet.s
  8. 105
    0
      128_de/GetDrivers/GetDrivers.s
  9. 49
    0
      128_de/GetDrivers/SaveDriver.s
  10. 1447
    0
      128_de/Include/DeskMain2.s
  11. 1085
    0
      128_de/Include/SubDir.src.s
  12. 53
    0
      128_de/Include/Symbol/CiMac.s
  13. 18
    0
      128_de/Include/Symbol/CiSym.s
  14. 16
    0
      128_de/Include/Symbol/Sym128.erg.s
  15. 350
    0
      128_de/Include/Symbol/TopMac.s
  16. 398
    0
      128_de/Include/Symbol/TopSym.s
  17. 2534
    0
      128_de/Main/DeskTop.main.s
  18. 325
    0
      128_de/Main/DeskTop.sub.s
  19. 347
    0
      128_de/Main/DeskTop.sub10.s
  20. 182
    0
      128_de/Main/DeskTop.sub2.s
  21. 741
    0
      128_de/Main/DeskTop.sub3.s
  22. 267
    0
      128_de/Main/DeskTop.sub4.s
  23. 382
    0
      128_de/Main/DeskTop.sub5.s
  24. 470
    0
      128_de/Main/DeskTop.sub6.s
  25. 557
    0
      128_de/Main/DeskTop.sub7.s
  26. 64
    0
      128_de/Main/DeskTop.sub8.s
  27. 368
    0
      128_de/Main/DeskTop.sub9.s
  28. 2172
    0
      128_de/Main/DeskWindows.akt.s
  29. 14
    0
      128_de/Main/Dos.lnk.s
  30. 2
    0
      128_de/Main/Ende.s
  31. 402
    0
      128_de/Main/InstallDriveD.s
  32. 30
    0
      128_de/Protect/Desksub0.s
  33. 91
    0
      128_de/Protect/SetProt.mod.s
  34. 104
    0
      128_de/Protect/Sources/ProtectDisk.s
  35. 115
    0
      128_de/Protect/Sources/RemProt.mod.s
  36. 106
    0
      128_de/Protect/Sources/RemProtection.s
  37. 121
    0
      128_de/Protect/Sources/SetBAM.s
  38. 108
    0
      128_de/Protect/Sources/SetProtection.s
  39. 319
    0
      128_de/WinInclude/InvFrame.s
  40. 95
    0
      128_de/WinInclude/SpeedFrame.s
  41. 527
    0
      128_en/DeskInclude/CopyFile.s
  42. 543
    0
      128_en/DeskInclude/DiskCopy.s
  43. 133
    0
      128_en/DeskInclude/DosFormat.s
  44. 446
    0
      128_en/DeskInclude/EditText.s
  45. 204
    0
      128_en/DeskInclude/SearchDisk.s
  46. 95
    0
      128_en/DeskInclude/SizeRectangle.s
  47. 461
    0
      128_en/DeskInclude/Validate+Undelet.s
  48. 105
    0
      128_en/GetDrivers/GetDrivers.s
  49. 49
    0
      128_en/GetDrivers/SaveDriver.s
  50. 1447
    0
      128_en/Include/DeskMain2.s
  51. 1085
    0
      128_en/Include/SubDir.src.s
  52. 53
    0
      128_en/Include/Symbol/CiMac.s
  53. 18
    0
      128_en/Include/Symbol/CiSym.s
  54. 16
    0
      128_en/Include/Symbol/Sym128.erg.s
  55. 350
    0
      128_en/Include/Symbol/TopMac.s
  56. 398
    0
      128_en/Include/Symbol/TopSym.s
  57. 2480
    0
      128_en/Main/DeskTop.main.s
  58. 325
    0
      128_en/Main/DeskTop.sub.s
  59. 347
    0
      128_en/Main/DeskTop.sub10.s
  60. 182
    0
      128_en/Main/DeskTop.sub2.s
  61. 741
    0
      128_en/Main/DeskTop.sub3.s
  62. 267
    0
      128_en/Main/DeskTop.sub4.s
  63. 382
    0
      128_en/Main/DeskTop.sub5.s
  64. 470
    0
      128_en/Main/DeskTop.sub6.s
  65. 557
    0
      128_en/Main/DeskTop.sub7.s
  66. 64
    0
      128_en/Main/DeskTop.sub8.s
  67. 368
    0
      128_en/Main/DeskTop.sub9.s
  68. 2172
    0
      128_en/Main/DeskWindows.akt.s
  69. 14
    0
      128_en/Main/Dos.lnk.s
  70. 2
    0
      128_en/Main/Ende.s
  71. 402
    0
      128_en/Main/InstallDriveD.s
  72. 30
    0
      128_en/Protect/Desksub0.s
  73. 91
    0
      128_en/Protect/SetProt.mod.s
  74. 104
    0
      128_en/Protect/Sources/ProtectDisk.s
  75. 115
    0
      128_en/Protect/Sources/RemProt.mod.s
  76. 106
    0
      128_en/Protect/Sources/RemProtection.s
  77. 121
    0
      128_en/Protect/Sources/SetBAM.s
  78. 108
    0
      128_en/Protect/Sources/SetProtection.s
  79. 319
    0
      128_en/WinInclude/InvFrame.s
  80. 95
    0
      128_en/WinInclude/SpeedFrame.s
  81. 527
    0
      64_de/DeskInclude/CopyFile.s
  82. 543
    0
      64_de/DeskInclude/DiskCopy.s
  83. 133
    0
      64_de/DeskInclude/DosFormat.s
  84. 441
    0
      64_de/DeskInclude/EditText.s
  85. 204
    0
      64_de/DeskInclude/SearchDisk.s
  86. 95
    0
      64_de/DeskInclude/SizeRectangle.s
  87. 461
    0
      64_de/DeskInclude/Validate+Undelet.s
  88. 105
    0
      64_de/GetDrivers/GetDrivers.s
  89. 49
    0
      64_de/GetDrivers/SaveDriver.s
  90. 1007
    0
      64_de/Include/DeskMain2.s
  91. 1085
    0
      64_de/Include/SubDir.src.s
  92. 53
    0
      64_de/Include/Symbol/CiMac.s
  93. 18
    0
      64_de/Include/Symbol/CiSym.s
  94. 16
    0
      64_de/Include/Symbol/Sym128.erg.s
  95. 350
    0
      64_de/Include/Symbol/TopMac.s
  96. 398
    0
      64_de/Include/Symbol/TopSym.s
  97. 2642
    0
      64_de/Main/DeskTop.main.s
  98. 325
    0
      64_de/Main/DeskTop.sub.s
  99. 347
    0
      64_de/Main/DeskTop.sub10.s
  100. 0
    0
      64_de/Main/DeskTop.sub2.s

+ 527
- 0
128_de/DeskInclude/CopyFile.s View File

@@ -0,0 +1,527 @@
; 12.8.91 Kn: Fehler bei leeren VLIR-Files behoben (S. 3/4)
; CopyFile (20.06.1991) dient zum kopieren/duplizieren von Files
; Par: DestinationDir: Nummer des Zieldirectories
; Achtung: Es findet keine Abfrage statt, ob Dir vorhanden ist.
; CopyMemLow,CopyMemHigh: freier Speicher
; r10: Zeiger auf SourceDisk
; r11: Zeiger auf DestinationDisk
; r12: Zeiger auf SourceName
; r13: Zeiger auf DestinationName
; r10=r11 f}r Duplicate, r12=r13 f}r CopyFile
; Ret: x: Fehlernummer
; Des: a,y,r0-r10L,r14-r15,diskBlkBuf,fileHeader,curDirHead,fileTrScBuf,dirEntryBuf
:dir3Head = $9c80
:SearchDrive b 0 ;Offset der zu suchenden Disk (s. Search_Turbo)
:Flag1581 b 0 ;Flag, ob dir3Head gerettet werden mu~
.DestinationDir b 0
.CopyFile MoveW r10,r6
jsr SearchDisk
txa
beq :01
::err rts
::01 MoveW r12,r6
jsr FindFile
txa
bne :err
jsr EnterTurbo
jsr InitForIO
LoadB r9L,0
sta r4L
lda dirEntryBuf+22
beq CopySeq ;=>non Geos
MoveB CopyMemHigh,r4H
MoveW dirEntryBuf+19,r1
jsr ReadBlock ;InfoBlock
txa
bne :errD
lda dirEntryBuf+21
beq CopySeq ;=>VLIR
jmp CopyVLIR
::errD jmp DoneWithIO

:CopySeq MoveB dirEntryBuf+2,r1H
MoveB dirEntryBuf+1,r1L
beq :90 ;=>keine Daten
::10 MoveB CopyMemLow,r4H
LoadB r4L,0
jsr ReadChain
txa
bne errD
MoveW r1,r15
ldx #r11
jsr Search_Turbo
txa
bne :err
lda r9L
bne :80
jsr Get1stBlock
txa
bne errD
MoveW r9,dirEntryBuf+1
::80 MoveB CopyMemLow,r4H
LoadB r4L,0
PushW r9
jsr WriteChain
PopW r1
txa
bne errD
MoveB CopyMemLow,r4H
LoadB r4L,0
jsr VerifyChain
txa
bne errD
lda r15L
bne :60
::90 jmp WriteInfo
::60 ldx #r10
jsr Search_Turbo
txa
bne :err
MoveW r15,r1
jmp :10
::err rts
:errD jmp DoneWithIO

:CopyVLIR LoadB r2L,$ff
MoveW dirEntryBuf+1,r1
LoadW r4,fileTrScTab ;Index-Block
jsr ReadBlock ;nach
txa ;fileTrScTab
bne errD
LoadB r15L,$ff
MoveB CopyMemLow,r4H
LoadB r4L,0
ldy #2 ;erstes Record
sty r14H ;letzter Zeiger
::10 lda fileTrScTab,y
sta r1L
iny
sty r14L ;aktueller Zeiger
ldx fileTrScTab,y
stx r1H
tay
bne :20 ;<leeres Record
txa
bne :30
LoadB r14L,$ff ;<letztes Record
bne :30
::20 jsr ReadChain
txa
bne errD
MoveB r1H,r15H
MoveB r1L,r15L
bne :40
inc r4H
lda r4H
cmp CopyMemHigh
bcs :40
::30 ldy r14L
iny
bne :10

; r9 - n{chster freier Block
; r14L - Offset in fileTrScTab (aktuell ; lesen)
; r14H - Offset in fileTrScTab (erster ; lesen)
; r15 - Track/Sektor des zuletzt gelesenen Blocks
::40 ldx #r11
jsr Search_Turbo
txa
beq :45
rts
::45 lda r9L
bne :46 ; :50
jsr Get1stBlock
txa
beq :46
jmp :errD2
::46 lda r15L
cmp #$ff
bne :50
jmp WriteInfo
::50 lda r2L
beq :55
::51 ldy r14H
lda fileTrScTab,y
bne :52
inc r14H
inc r14H
beq :100
bne :51
::52 lda r9L
sta fileTrScTab,y
lda r9H
sta fileTrScTab+1,y
::55 PushW r9
PushB r14H
MoveB CopyMemLow,r4H
LoadB r4L,0
::60 jsr WriteChain
txa
bne :100
ldy #0
lda (r4),y
bne :100 ;=>Buffer voll
::70 ldy r14H
iny
iny
sty r14H
beq :100 ;fertig
lda fileTrScTab,y
bne :80
lda fileTrScTab+1,y
beq :100
bne :70
::80 inc r4H
lda r4H
cmp CopyMemHigh
bcs :100
lda r9L
sta fileTrScTab,y
lda r9H
sta fileTrScTab+1,y
jmp :60
::100 PopB r14H
PopW r1
txa
bne :errD2

MoveB CopyMemLow,r4H
LoadB r4L,0
::110 jsr VerifyChain
txa
::errD2 bne :errD
ldy #0
lda (r4),y
bne :190 ;=>Buffer voll
::120 ldy r14H
iny
iny
sty r14H
beq WriteInfo ;=>fertig
ldx fileTrScTab+1,y
stx r1H
lda fileTrScTab,y
sta r1L
bne :130 ;<leeres Record
txa
bne :120
beq WriteInfo
::130 inc r4H
lda r4H
cmp CopyMemHigh
bcc :110
jsr :160
txa
bne :errD
LoadB r2L,$ff
ldy r14L
iny
jmp :10
::190 jsr :160
txa
bne :errD
stx r2L
MoveB r15H,r1H
MoveB r15L,r1L
jmp :20
::160 ldx #r10
jsr Search_Turbo
MoveB CopyMemLow,r4H
LoadB r4L,0
::err rts
::errD jmp DoneWithIO

:WriteInfo jsr DoneWithIO
lda dirEntryBuf+22
bne :10
MoveW r9,r6
jsr FreeBlock
txa
beq :20
::err rts
::10 MoveB r9L,r1L
sta dirEntryBuf+19
MoveB r9H,r1H
sta dirEntryBuf+20
MoveB CopyMemHigh,r4H
LoadB r4L,0
jsr PutBlock
txa
bne :err
lda dirEntryBuf+21
beq :20
MoveW r9,r3
jsr SetNextFree
txa
bne :err
MoveB r3L,r1L
sta dirEntryBuf+1
MoveB r3H,r1H
sta dirEntryBuf+2
LoadW r4,fileTrScTab
jsr PutBlock
txa
bne :err
::20 LoadB r10L,0
jsr GetFreeDirBlk
txa
::err2 bne :err
tya
pha
ldy #0
::30 lda (r13),y
beq :40
sta dirEntryBuf+3,y
iny
bne :30
::40 cpy #16
bcs :50
lda #$a0
sta dirEntryBuf+3,y
iny
bne :40
::50 pla
pha
tay
ldx #0
::60 lda dirEntryBuf,x
sta diskBlkBuf,y
iny
inx
cpx #$1e
bcc :60

pla
cmp #2
bne :70
clc
adc #30+1
::70 tay
dey
lda DestinationDir
sta diskBlkBuf,y
LoadW r4,diskBlkBuf
jsr PutBlock
txa
bne :err2
jmp PutDirHead

;ReadChain
;Par: r1 - Track/Sektor des ersten zu lesenden Blocks
; r4 - Zeiger auf den freien Speicherbereich
;Ret: x - Fehlernummer
:ReadChain2 inc r4H
:ReadChain jsr ReadBlock
txa
bne :err
ldy #1
lda (r4),y
sta r1H
dey
lda (r4),y
sta r1L
beq :err
lda r4H
tay
iny
cpy CopyMemHigh
bcc ReadChain2
::err rts

:WriteChain
;Par: r9 - n{chster zu schreibender Block
; r4 - Zeiger auf die zu schreibenden Bl|cke
;Ret: r9 - s.o.
; r1: TrSe des n{chsten Blocks
; r4: Zeiger auf den Speicher des zulezt geschriebenen Blocks
; x - Fehlernummer
lda r9L ;n{chster Block
sta r3L ;als aktueller
sta r1L
lda r9H
sta r3H
sta r1H
dec r4H
::20 inc r4H
jsr SetNextFree ;n{chsten Block
txa
bne :err
ldy #0
lda (r4),y
beq :10 ;=>letzter Block
lda r3L
sta (r4),y
iny
lda r3H
sta (r4),y
::10 jsr WriteBlock
txa
bne :err
MoveB r3L,r1L
sta r9L
MoveB r3H,r1H
sta r9H
ldy #0
lda (r4),y
beq :err ;=>letzter Block
lda r4H
tay
iny
cpy CopyMemHigh
bcc :20
::err rts

;Par: r1 - Track/Sektor des ersten zu lesenden Blocks
; r4 - Zeiger auf den freien Speicherbereich
;Ret: x - Fehlernummer
:VerifyChain2 inc r4H
:VerifyChain jsr VerWriteBlock
txa
bne :err
ldy #1
lda (r4),y
sta r1H
dey
lda (r4),y
sta r1L
beq :30
lda r4H
tay
iny
cpy CopyMemHigh
bcc VerifyChain2
::30 ldx #0
::err rts

:Get1stBlock ldy #1
sty r3L
dey
sty r3H
jsr SetNextFree
MoveW r3,r9
rts
:]berschreibenBox b $81
b DBVARSTR,$10,$10,r13
b DBTXTSTR,$10,$20
w :t1
b DBTXTSTR,$10,$30
w :t2
b DBTXTSTR,$10,$40
w :t3
b YES,1,72
b NO,17,72
b NULL
::t1 b BOLDON,"ist bereits vorhanden.",0
::t2 b "Soll die Datei }berschrieben",0
::t3 b "werden ?",PLAINTEXT,0

:nicht}berschreibenbox
b $81
b DBVARSTR,$10,$10,r13
b DBTXTSTR,$10,$20
w :t1
b DBTXTSTR,$10,$30
w :t2
b OK,17,72
b NULL
::t1 b BOLDON,"ist bereits vorhanden",0
::t2 b "und schreibgesch}tzt.",PLAINTEXT,0

:Search_Turbo PushB r2L
lda $00,x
sta r6L
lda $01,x
sta r6H
stx SearchDrive
lda Flag1581
beq :noretdir3
cpx #r10L
bne :noretdir3
jsr i_MoveData
w dir3Head,fileHeader,256
::noretdir3 jsr DoneWithIO
jsr NewSearchDisk
txa
bne :err
lda r9L
bne :noinit
jsr :initsearchturbo
txa
beq :nogetdir3
::err PopB r2L
::err2 rts
::noinit lda Flag1581
beq :nogetdir3
lda SearchDrive
cmp #r11L
bne :nogetdir3
jsr i_MoveData
w fileHeader,dir3Head,256
::nogetdir3 jsr EnterTurbo
txa
bne :err
PopB r2L
jmp InitForIO

::initsearchturbo jsr OpenDisk ; BAM holen
txa
bne :err2
ldx #0 ; Flag1581 entspr. setzen
lda curType
and #DRIVE_MASK
cmp #3
bne :no1581
ldx #$ff
::no1581 stx Flag1581
ldy #9 ; Werte retten
::10 lda r9L,y
pha
dey
bpl :10
ldy #$1d ; dirEntryBuf retten
::20 lda dirEntryBuf,y
pha
dey
bpl :20
MoveB r13L,r6L ; Zeiger auf Filenamen
sta fileHeader
MoveB r13H,r6H
sta fileHeader+1
jsr FindFile
cpx #5
bne :evtlfehler
ldx #0 ; File existiert noch nicht
beq :getwerte
::evtlfehler txa
bne :getwerte
lda dirEntryBuf
and #%01000000
beq :nocare
LoadWr0 nicht}berschreibenbox
jsr NewDoDlgBox
jmp :dberr
::nocare lda SureFlag
beq :notsure
jmp :delete
::notsure LoadWr0 ]berschreibenBox
jsr NewDoDlgBox
lda sysDBData
cmp #YES
beq :delete
::dberr ldx #$41
bne :getwerte
::delete MoveW fileHeader,r0
jsr DeleteFile
::getwerte ldy #0 ; gerettete Werte holen
::30 pla
sta dirEntryBuf,y
iny
cpy #$1e
bcc :30
ldy #0
::40 pla
sta r9L,y
iny
cpy #10
bcc :40
rts

+ 543
- 0
128_de/DeskInclude/DiskCopy.s View File

@@ -0,0 +1,543 @@
;CopyDisk
; Date: 21.6.1991
; Par: r6 - Zeiger auf den SourceDiskNamen (mu~ nicht unbedingt eingelegt sein)
; Ret: x - Fehlernummer
; Des: alles

:dir3Head = $9c80
:INV_TRACK = $02
:IDD_DDr b "B:"
:DestinationName s 17
:MyInterleave b 0
:VerifyFlag b $ff
:Make2SFlag b 0
:CopyDrives w 0
:SourceName w 0
:SourceType b 0

:StartCopyDisk ldy #0
lda #0
jsr ChangeDisk
txa
beq :01
rts
::01 MoveB curType,SourceType
ldy #0
sty r1H
sty r11H
iny
sty r1L
sty r11L
::00 LoadW r0,ReadBlock
jsr :100
cpx #INV_TRACK
beq :05
txa
bne :err
::05 MoveW r1,r10
ldy #1
tya
jsr ChangeDisk
txa
bne :err
MoveW r11,r1
LoadW r0,DirTrack
jsr :100
cpx #INV_TRACK
beq :07
txa
bne :err
::07 lda VerifyFlag
beq :10
MoveW r11,r1
LoadW r0,VerWriteBlock
jsr :100
::10 cpx #INV_TRACK
beq :30
txa
bne :err
ldy #0
lda #1
jsr ChangeDisk
txa
bne :err
lda r10L
sta r1L
sta r11L
lda r10H
sta r1H
sta r11H
jmp :00
::30 ldy #1
lda #0
jsr ChangeDisk
ldx Make2SFlag
beq :err
jsr Make2Sides
ldx #0
::err rts

::100 jsr InitCount
txa
bne :130
LoadW r4,MemBegin
jsr EnterTurbo
txa
bne :130
jsr InitForIO
::110 MoveW r1,r6
jsr FindBAMBit
bne :115
lda r0L
ldx r0H
jsr CallRoutine
txa
bne :130
ldy r4H
iny
cpy CopyMemHigh
beq :120
sty r4H
::115 jsr CountBlock
txa
beq :110
bne :130
::120 ldx #0
::130 jmp DoneWithIO
:DirTrack lda #00
cmp r1L
bne :40
lda r1H
bne :40
ldy #144
::30 lda DestinationName-144,y
beq :20
sta (r4),y
iny
cpy #160
bcc :30
bcs :10
::20 lda #$a0
sta (r4),y
iny
cpy #160
bcc :20
::10 ldx Make2SFlag
beq :40
ldy #3
lda #$80
sta (r4),y
::40 jmp WriteBlock

:ChangeDisk ;wechselt Source- nach Destinationdisk usw.
; Par: y - 0 f}r Source einlegen und 1 entspr. f}r Destination
; a - 0 f}r vollst{ndigen Diskettenwechsel
; Ret: x - evtl. Fehlernummer (0-kein Fehler)
; Use: CopyDrives,SourceName,DestinationName
; Des: a,x,y,
tax
MoveW SourceName,r6
tya
beq :20
LoadW r6,DestinationName
::20 txa
bne :30
jmp SearchDisk
::30 lda SourceType
and #DRIVE_MASK
cmp #3
bne :noretdir3
jsr i_MoveData
w dir3Head,fileHeader,256
::noretdir3 jsr NewSearchDisk
txa
bne :err
lda SourceType
and #DRIVE_MASK
cmp #3
bne :err
jsr i_MoveData
w fileHeader,dir3Head,256
::err rts

;InitCount
; initialisiert CountBlock
; Par: r1 - Track/Sektor des erstenBlocks
; Ret: x - Fehlernummer (0=kein Fehler)
; Use: SeperTr,FirstSektor,Track,Sektor,GetSectors
; Des: a,x,y,r6-r9
:InitCount MoveB r1L,Track
lda r1H
pha
sta Sektor
jsr GetSectors
txa
bne :10
MoveB r1H,SeperTr
lda #0
sta r6H
sta r7H
MoveB Sektor,r6L
MoveB MyInterleave,r7L
ldx #r6L
ldy #r7L
jsr Ddiv
MoveB r8L,FirstSektor
ldx #0
::10 pla
sta r1H
rts

:Track b 0
:Sektor b 0
:SeperTr b 0
:FirstSektor b 0

;CountBlock
; z{hlt in Abh{ngigkeit von MyInterleave 1 Block weiter
; Par: keine
; Ret: r1 - n{chster Track/Sektor
; x - Fehlernummer
; Use: SeperTr,FirstSektor,Track,Sektor,InitCount2
; Des: a,y
:CountBlock
lda Sektor
clc
adc MyInterleave
sta Sektor
sta r1H
cmp SeperTr
bcc :10
inc FirstSektor
lda FirstSektor
cmp MyInterleave
bcs :20
sta r1H
sta Sektor
::10 MoveB Track,r1L
ldx #0
rts
::20 inc Track
MoveB Track,r1L
LoadB r1H,0
jmp InitCount

;GetSectors gibt zu einem bestimmten Track die Anzahl der
;m|glichen Sektoren.
;Par: r1L - Track
;Ret: r1H - Sektoren
; x - Fehlernummer:
; $00 - kein Fehler
;Des: a,y
:GetSectors
lda SourceType
and #DRIVE_MASK
tay
lda r1L
beq :err
dey
bne :10
cmp #36 ;1541
bcc :20
::err ldx #INV_TRACK
rts
::10 dey
bne :50
cmp #71 ;1571
bcs :err
::20 ldy #7 ;1571/41
::30 cmp Tracks,y
bcs :40
dey
bpl :30
bmi :err
::40 tya
and #%0000 0011
tay
lda Sectors,y
::45 sta r1H
ldx #0
rts
::50 cmp #81
bcs :err
lda #40
bne :45

:Tracks b 1,18,25,31,36,53,60,66
:Sectors b 21,19,18,17

:Make2Sides jsr i_FillRam
w 256,dir2Head
b 0
LoadW r0,Content18
jsr InitRam
jmp PutDirHead
:Content18 w curDirHead+221
b 35
b $15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15,$15
b 0,$13,$13,$13,$13,$13,$13,$12,$12,$12,$12,$12,$12
b $11,$11,$11,$11,$11
:Content53 w dir2Head
b 105
b $ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f
b $ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f
b $ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f
b $ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f,$ff,$ff,$1f
b $ff,$ff,$1f,$00,$00,$00
b $ff,$ff,$07,$ff,$ff,$07,$ff,$ff,$07,$ff,$ff,$07,$ff,$ff,$07,$ff,$ff,$07
b $ff,$ff,$03,$ff,$ff,$03,$ff,$ff,$03,$ff,$ff,$03,$ff,$ff,$03,$ff,$ff,$03
b $ff,$ff,$01,$ff,$ff,$01,$ff,$ff,$01,$ff,$ff,$01,$ff,$ff,$01
w 0

:CopyDisk
; Par: r6 - Zeiger auf den SourceDiskNamen (mu~ nicht unbedingt eingelegt sein)
MoveW r6,SourceName
jsr SearchDisk
txa
beq :00
rts
::00 MoveB curDirHead,DirTrack+1
MoveB interleave,MyInterleave
lda curType
and #DRIVE_MASK
cmp #2
bne :05
ldx curDirHead+3
bmi :05
lda #1
::05 sta SourceType
lda curDrive
sta CopyDrives
sta CopyDrives+1
jsr NextDrive
txa
bne :err
LoadW :IDD_DIT,DummyDIconTab
lda CopyDrives
cmp CopyDrives+1
beq :10
LoadW :IDD_DIT,DrivesIconTab
::10 lda CopyDrives
clc
adc #"A"-8
sta IDD_SDr
::15 ldx #DISK
lda curType
and #%1000 0000
beq :20
ldx #0
::20 stx :IDD_RAM
::25 lda CopyDrives+1
clc
adc #"A"-8
sta IDD_DDr
LoadW r0,:InsertDiskDial
jsr DoDlgBox
lda r0L
cmp #OK
bne :30
lda curDirHead+189
cmp #$50
beq :27
cmp #$42
bne :28
::27 LoadW r0,:NoSystemBox
jsr DoDlgBox
ldx #12
rts
::28 jmp StartCopyDisk

::30 cmp #DISK
bne :40
jsr InsertNewDisk
txa
beq :25
::err rts
::40 cmp #128
bne :50
jsr NextDrive
txa
beq :15
bne :err
::50 ldx #CANCEL_ERR
rts
::InsertDiskDial b $81,DB_USR_ROUT
w InitClickingOutSide
b DBOPVEC
w ClickOutSide
b OK,17,6
b CANCEL,17,72
b DBTXTSTR,4,14
w :IDD_t1
b DBTXTSTR,4,30
w :IDD_t2
b DBTXTSTR,4,58
w :IDD_t3
b DBTXTSTR,18,88
w :IDD_t4
b DBTXTSTR,10,69
w IDD_DDr
b DBUSRICON,17,50
::IDD_DIT w DrivesIconTab
::IDD_RAM b DISK,17,28,0
::IDD_t1 b BOLDON,"Zieldiskette ausw{hlen:",0
::IDD_t2 b "Startdiskette",0
::IDD_t3 b "Zieldiskette",PLAINTEXT,0
::IDD_t4 b "Verify",0
::NoSystemBox
b $81
b $0b,$10,$10
w :t1
b $0b,$10,$20
w :t2
b $0b,$10,$30
w :t3
b OK,17,72,NULL
::t1 b "Die Zieldiskette darf keine ",0
::t2 b "System- oder Hauptdiskette",0
::t3 b "sein.",0

:IDD_SDr b "A:",0

:NextDrive ldy CopyDrives+1
::10 iny
cpy #12
bcc :20
ldy #8
::20 lda driveType-8,y
beq :10
and #DRIVE_MASK
cmp SourceType ;mit Sourcetype vergleichen
beq :30
tax
lda SourceType
cmp #1
bne :10
cpx #2
bne :10
::30 cpy CopyDrives
bne :40
lda driveType-8,y
and #%1000 0000
beq :40
lda CopyDrives
cmp CopyDrives+1
bne :10
ldx #115
rts
::40 tya
sta CopyDrives+1
jsr NewSetDevice

:InsertNewDisk jsr OpenDisk
txa
bne :30
ldy #15
::10 lda curDirHead+144,y
cmp #$a0
bne :20
lda #0
::20 sta DestinationName,y
dey
bpl :10
LoadW r5,DestinationName
MoveW SourceName,r6
ldx #r5L
ldy #r6L
jsr CmpString
bne :40
::30 lda curDrive
clc
adc #"A"-8
sta :IZD_Dr
LoadW r0,:InsertZielDial
jsr DoDlgBox
lda r0L
cmp #OK
beq InsertNewDisk
ldx #CANCEL_ERR
rts
::40 lda interleave
cmp MyInterleave
bcc :50
sta MyInterleave
::50 ldx #0
lda SourceType
cmp #1
bne :60
lda curType
and #DRIVE_MASK & %1111 1101
bne :60
lda curDirHead+3
bpl :60
dex
::60 stx Make2SFlag
lda SourceType
cmp #2
bne :70
lda curType
and #DRIVE_MASK & %1111 1101
bne :70
lda curDirHead+3
bpl :30
::70 ldx #0
rts
::InsertZielDial b $81,OK,1,72,CANCEL,17,72
b DBTXTSTR,16,16
w :IZD_t1
b DBTXTSTR,16,32
w :IZD_t2
b 0
::IZD_t1 b BOLDON,"Bitte Zieldisk in Laufwerk "
::IZD_Dr b "A",0
::IZD_t2 b "einlegen.",PLAINTEXT,0

:InitClickingOutSide LoadW r0,IDD_SDr
LoadW r11,74+$8000
LoadB r1H,75
jsr PutString
MoveW SourceName,r0
jsr PutString
jsr i_FrameRectangle
b 82+32,88+32
w 8+64+$8000,14+64+$a000
b %1111 1111
lda VerifyFlag
beq :10
jsr InvertRectangle
::10 rts
:ClickOutSide lda mouseData
beq :10
LoadB r2L,82+32
LoadB r2H,88+32
LoadW r3,8+64+$8000
LoadW r4,14+64+$a000
jsr IsMseInRegion
beq :10
lda VerifyFlag
eor #$ff
sta VerifyFlag
jmp InvertRectangle
::10 rts

:MemBegin = (CopyDisk&$ff00)+$100
:DummyDIconTab w 0
b 0,0,1,1
w 0
:DrivesIconTab w DrivesIcon
b 0,0,6+$80,16
w DrivesIconRout
:DrivesIconRout LoadB sysDBData,128
jmp RstrFrmDialogue
:DrivesIcon b $06,$10,$00,$05,$ff,$82,$fe,$80
b $04,$00,$82,$03,$80,$04,$00,$b2
b $03,$b0,$38,$00,$00,$00,$c3,$b0
b $60,$00,$00,$00,$c3,$b0,$f0,$18
b $67,$3e,$db,$b0,$60,$18,$6d,$b8
b $f3,$b0,$67,$cf,$cf,$b0,$e3,$b0
b $60,$0f,$cc,$30,$e3,$b0,$60,$07
b $8d,$b0,$f3,$be,$60,$07,$87,$30
b $db,$80,$04,$00,$82,$03,$80,$04
b $00,$82,$03,$80,$04,$00,$81,$03
b $06,$ff,$81,$7f,$05,$ff,$0c,$bf


+ 133
- 0
128_de/DeskInclude/DosFormat.s View File

@@ -0,0 +1,133 @@
;DosFormat (27.06.1991)
;formatiert die Diskette im aktuellen Laufwerk
;Das aktuelle Laufwerk darf keine RAM sein !!!
; Par: r0: Zeiger auf Name als Geos-String
; r1L: Flag bei 1571-Floppies
; = 0 -> ein- sonst doppelseitig formatieren
;Des: r0-r15 (Durch InitForIO und Kernalroutinen ?)
; a0,a1,a,x,y
if .p
:WaitTime = $2000
:SetFilePar = $ffba
:SetFileName = $ffbd
:Open = $ffc0
:Close = $ffc3
:Listen = $ffb1
:SecListen = $ff93
:UnListen = $ffae
:Talk = $ffb4
:SecTalk = $ff96
:UnTalk = $ffab
:IECIn = $ffa5
:IECOut = $ffa8
endif

:DosFormat PushW r0
MoveB r1L,a1L
jsr PurgeTurbo
jsr InitForIO
lda #$01 ;Open
ldx curDrive
ldy #$6f
jsr SetFilePar
lda #$00
jsr SetFileName
jsr Open
lda curDrive
jsr Listen
lda #$6f
jsr SecListen
lda curType
and #DRIVE_MASK
cmp #02
bne :10
LoadW a0,:u0mx
LoadB :u0mx+4,"0"
lda a1L
beq :20
LoadB :u0mx+4,"1"
::20 jsr SendString
::10 lda #"N"
jsr IECOut
lda #"0"
jsr IECOut
lda #":"
jsr IECOut
PopW a0
jsr SendString
LoadW a0,:fm
jsr SendString
lda curType
and #DRIVE_MASK
cmp #2
bne :30
lda a1L
bne :30
LoadW a0,:u0mx
LoadB :u0mx+4,"1"
jsr SendString
::30 lda curDrive
jsr UnListen

LoadB $90,0
lda curDrive
jsr Talk
lda #$6f
jsr SecTalk
jsr IECIn
sec
sbc #$30
asl
sta a1H
asl
asl
clc
adc a1H
sta a1H
jsr IECIn
sec
sbc #$30
clc
adc a1H
sta a1H
::40 jsr IECIn
bit $90
bvc :40
lda curDrive
jsr UnTalk
lda #$01
jsr Close
jsr DoneWithIO
ldx a1H
bne :err
LoadW r0,WaitTime
::waitloop ldx #r0L
jsr Ddec
bne :waitloop
jsr OpenDisk
txa
bne :err
jmp SetGEOSDisk
::err rts

::fm b ",TD",$0d,0
::u0mx b "U0>MX",$0d,"I",$0d,0
:SendString ldy #0
::10 lda (a0),y
beq :20
sty a1H
pha
jsr IECOut
pla
cmp #$0d
bne :nocr
lda curDrive
jsr UnListen
lda curDrive
jsr Listen
lda #$6f
jsr SecListen
::nocr ldy a1H
iny
bne :10
::20 rts

+ 446
- 0
128_de/DeskInclude/EditText.s View File

@@ -0,0 +1,446 @@
:EditText ; Text-Editierung
; Par: keine
; Ret: keine
; Des: alles
lda dirEntryBuf+22
bne :05
rts
::05 MoveW otherPressVec,oldotherPress
LoadW otherPressVec,MouseRoutine
LoadW keyVector,TextKeyRoutine
lda curHeight
jsr InitTextPrompt
ldy #MaxTextLength-1
::testcodeloop lda Text,y
beq :codeok
cmp #$0d
beq :codeok
cmp #32
bcc :undefinedcode
cmp #127
bcc :codeok
::undefinedcode lda #"*"
sta Text,y
::codeok dey
bpl :testcodeloop
LoadW r3,$8000+80
ldx #r3
jsr NormalizeX
MoveW r3,PositionXL
LoadW r3,$8000+80+160
ldx #r3
jsr NormalizeX
MoveW r3,PositionXR
ldy #5
::10 lda PositionYO,y
sta r2L,y
sta windowTop,y
dey
bpl :10
dec r2L
inc r2H
ldx #r3L
jsr Ddec
inc r4L
bne :20
inc r4H
::20 lda #$ff
jsr FrameRectangle
LoadB ActualCharacter,0
jmp NewText
:oldotherPress w 0

:TextKeyRoutine lda keyData
cmp #32
bcs :100
::noputkey cmp #128+20
bne :noclose
jmp RstrFrmDialog
::noclose cmp #08
bne :10
lda ActualCharacter
beq :99
dec ActualCharacter
jmp NewDisplay
::10 cmp #30
bne :20
ldy ActualCharacter
iny
cpy TextLength
bcs :99
inc ActualCharacter
jmp NewDisplay
::20 cmp #17
bne :30
lda stringY
clc
adc #10
::25 sta r1H
MoveW stringX,r11
jmp SetTextPtr
::30 cmp #16
bne :40
ldy ActualCharPointer
beq :99
lda stringY
sec
sbc #10
jmp :25
::40 ldx #$ff
stx AlternateFlag
cmp #29
bne :50
ldy ActualCharacter
beq :99
jsr DeleteChar
dec ActualCharacter
jmp NewText
::50 cmp #$0d
beq :102
::70
::99 rts ;Sonderzeichen

::100 cmp #127
bcs :noputkey
::102 ldx #$ff
stx AlternateFlag
ldy TextLength
cpy #MaxTextLength
bcs :99
jsr InsertChar
inc ActualCharacter
ldy ActualCharacter
cpy TextLength
bcs :110
jmp NewText
::110 jsr RethinkText
MoveW stringX,r11
MoveW stringX,r0
lda stringY
clc
adc #7
sta r1H
lda keyData
jsr GetCharWidth
beq :117
clc
adc r0L
sta r0L
bcc :115
inc r0H
::115 CmpW r0,PositionXR
bcc :118
::117 inc ActualCharPointer
jmp NewText
::118 lda keyData
jsr PutChar
jmp NewDisplay

:MouseRoutine lda mouseData
bpl :10
::05 lda oldotherPress
ldx oldotherPress+1
jmp CallRoutine
::10 ldy #5
::15 lda PositionYO,y
sta r2L,y
dey
bpl :15
jsr IsMseInRegion
beq :05
MoveW mouseXPos,r11
MoveB mouseYPos,r1H
:SetTextPtr jsr TextPosition
bcc :20
ldx ActualCharacter
beq :20
dex
dex
stx ActualCharacter
jsr NewDisplay
LoadB keyData,30
jmp TextKeyRoutine
::20 jmp NewDisplay

:NewText
; rechnet alle Zeiger neu aus und gibt alle Zeilen ab der aktuellen aus
jsr RethinkText
jsr RethinkActChrPtr
PushB ActualCharPointer
lda ActualCharPointer
beq :10
dec ActualCharPointer
::10 jsr RefreshLine
inc ActualCharPointer
lda ActualCharPointer
cmp #MaxZeilen
bcc :10
PopB ActualCharPointer
jmp NewDisplay

:NewDisplay
; aktualisiert den Cursor
jsr RethinkActChrPtr
lda ActualCharPointer
asl
sta r1H
asl
asl
clc
adc r1H
adc PositionYO
bcs :drau~en
cmp PositionYU
bcc :drin
::drau~en lda PositionYU
clc
adc #3
::drin sta r1H
MoveW PositionXL,r11
ldy ActualCharPointer
ldx Pointer,y
::30 cpx ActualCharacter
beq :40
lda Text,x
jsr GetCharWidth
clc
adc r11L
sta r11L
bcc :35
inc r11H
::35 inx
bne :30
::40 CmpW r11,PositionXR
bcc :50
MoveW PositionXR,r11
::50 MoveW r11,stringX
MoveB r1H,stringY
jmp PromptOn

:RethinkText
; aktualisiert Pointer und TextLength
; Des: a,x,y,r0-r2
ldy #0 ;Variablen initialisieren
sty r2L
sty Pointer
::loop2 LoadB r2H,0
MoveW PositionXL,r0
ldy r2L
ldx Pointer,y
dex
::loop inx
lda Text,x
beq :ende
cmp #$0d
beq :15
cmp #32
bne :05
stx r1L
dec r2H
::05 jsr GetCharWidth ;CRSR-Pos aktualisieren
clc
adc r0L
sta r0L
bcc :10
inc r0H
::10 CmpW r0,PositionXR ;Rechter Rand erreicht
bcc :loop
lda r2H ;Space vorhanden
beq :20
ldx r1L ;Space = gew. Position
::15 inx ;n{chstes Zeichen
::20 ldy r2L ;MaxZeilen erreicht
cpy #MaxZeilen-1
bcs :search0
inc r2L
txa
sta Pointer+1,y
jmp :loop2
::search0 lda Text,x
beq :ende
inx
bne :search0
::ende inc r2L
ldy r2L
inx
txa
sta TextLength
::30 sta Pointer,y
iny
cpy #MaxZeilen
bcc :30
rts

:TextPosition
; Par: r11,r1H: gew}nschte Textposition
; Ret: ActualCharacter: Zeichenposition
; Des: a,x,y,r0-r3
MoveW PositionXL,r0
MoveW r11,r2
SubW r0,r2
lda r1H
sec
sbc PositionYO
ldy #0
::10 sec
sbc #10
bcc :20
iny
bne :10
::20 sty r3H
ldx Pointer,y
cpx TextLength
bcs :ende
stx r3L
; inx
; cpx Pointer+1,y
; bne :initloop
; lda Text-1,x
; cmp #$0d
; bne :initloop
;
;::initloop ldx r3L
::loop lda Text,x
beq :40
cmp #$0d
bne :nocr
lda #"M"
::nocr jsr GetCharWidth
clc
adc r0L
sta r0L
bcc :30
inc r0H
::30 MoveW r0,r1 ;Abstand errechnen
SubW r11,r1
txa
pha
ldx #r1L
jsr Dabs
pla
tax
inx
CmpW r2,r1 ;kleinerer Abstand ?
bcc :gr|~er
MoveW r1,r2 ;neuen Abstand merken
stx r3L ;Offset merken
::gr|~er ldy r3H
inx
txa
dex
cmp Pointer+1,y
bcc :loop
::40 clc
::50 MoveB r3L,ActualCharacter
rts
::ende ldx TextLength
dex
stx ActualCharacter
clc
rts

:RethinkActChrPtr
; rechnet ActualCharPointer neu aus
ldy #0
::05 lda Pointer,y
cmp ActualCharacter
beq :20
bcs :10
iny
cpy #MaxZeilen
bcc :05
::10 dey
::20 sty ActualCharPointer
rts

:RefreshLine
; gibt die aktuelle Zeile neu aus
; Des: a,y
lda ActualCharPointer
asl
sta r2L
asl
asl
clc
adc r2L
clc
adc PositionYO
sta r2L
bcs :20
cmp PositionYU
bcs :20
clc
adc #9
cmp PositionYU
bcc :01
lda PositionYU
::01 sta r2H
MoveW PositionXL,r3
MoveW PositionXR,r4
lda #0
jsr SetPattern
jsr Rectangle
lda r2L
clc
adc #7
sta r1H
MoveW PositionXL,r11
ldy ActualCharPointer
lda Pointer,y
cmp TextLength
bcs :20
sta r15L
lda Pointer+1,y
sta r15H
::10 ldy r15L
lda Text,y
beq :15
jsr PutChar
::15 inc r15L
lda r15L
cmp r15H
bcc :10
::20 rts

:InsertChar
; InsertChar f}gt an der aktuellen Position den Inhalt von keyData ein
; Par: keyData: einzuf}gendes Zeichen
; Des: a,y
ldy TextLength
iny
::10 dey
lda Text,y
sta Text+1,y
cpy ActualCharacter
beq :20
bcs :10
::20 lda keyData
sta Text,y
rts
:DeleteChar
; DeleteChar nimmt aus dem Text das aktuelle Zeichen heraus
; Des: a,y
ldy ActualCharacter
::10 lda Text,y
sta Text-1,y
iny
cpy TextLength
bcc :10
rts

; Position der EingabeBox :
:PositionYO b 136
:PositionYU b 136+39
:PositionXL w 80
:PositionXR w 80+160
:MaxTextLength = 96
:TextLength b 0
; Offset des Abschlu~byte Null des Textes
:ActualCharacter b 0
; ActualCharacter enth{lt den Offset des aktuell zu bearbeitenden Zeichens
:ActualCharPointer b 0
; ActualCharPointer enth{lt die Nummer der aktuellen Zeile
:MaxZeilen = 5
:Pointer s MaxZeilen+1
; Pointer enth{lt f}r jede Zeile einen Offset auf das erste Zeichen der Zeile
; max. 22 Zeilen

+ 204
- 0
128_de/DeskInclude/SearchDisk.s View File

@@ -0,0 +1,204 @@
; SearchDisk (11.02.1991) sucht nach der korrekten Diskette
; NewSearchDisk sucht nach der korrekten Diskette, ohne DirHead zu zerst|ren
; Par: r6: Diskettenname als String
; Ret: curType: (1571 einseitig=1541) ???
; x: Fehlernummer
; x: CANCEL_ERR Vorgang abgebrochen
; Des: a,y,curDirHead(SearchDisk),diskBlkBuf(NewSearchDisk)
.DRIVE_MASK = %0001 1111
.CANCEL_ERR = $0c
.SearchDisk LoadB OpenDiskFlag,1
jsr MemSearchDisk
jsr DriveSearchDisk
txa
bne Ende
lda curType
cmp #2 ; 1571 ?
bne :10
LoadB interleave,8
::10 jmp OpenDisk
if 0
jsr MemSearchDisk
lda OpenDiskFlag
beq :03
LoadB OpenDiskFlag,0
jsr OpenDisk
clc
::03 bcc :05
php
jsr NewDisk
plp
::05 php
jsr DriveSearchDisk
txa
bne :end
bcs :10 ; wenn kein SetDevice u. NewDisk ausgef}hrt
plp
bcc Ende
bcs :20
::10 pla
::20 jmp OpenDisk ; wurde, braucht auch kein OpenDisk ausgef}hrt
::end pla
endif
:Ende rts ; zu werden
.NewSearchDisk LoadB OpenDiskFlag,0
jsr MemSearchDisk
txa
bne DriveSearchDisk
lda curType
cmp #2 ; 1571 ?
bne Ende
LoadB interleave,8
bne Ende
:DriveSearchDisk ldx #1
b $2c
:MemSearchDisk ldx #0
LoadB :d,0
ldy #29
::20 lda r0L,y
pha
dey
bpl :20
stx r7H
::50 ldy curDrive
sty r7L
::10 tya
jsr :TestDisk
txa
beq :end
ldy numDrives
dey
beq :19
ldy curDrive
::18 iny
lda driveType-8,y
beq :18
cpy #12
bcc :17
ldy #8
::17 cpy r7L
bne :10
::19 lda r7H
beq :err
lda AskDiskFlag
beq :err
PushW r6
PushW r7
LoadW r0,:insertdial
jsr NewDoDlgBox
ldx r0L
PopW r7
PopW r6
cpx #CANCEL
bne :50
::err ldx #CANCEL_ERR
::end ldy #0
::30 pla
sta r0L,y
iny
cpy #30
bcc :30
lda :d
bne :n30
clc
::n30 rts
::insertdial
b $81
b $0b,$10,$10
w :t1
b $0c,$10,$20,r6
b $0b,$10,$30
w :t2
b OK
b 1,72
b CANCEL
b 17,72
b NULL
::t1 b $18,"Bitte legen Sie die Disk",$1b,NULL
::t2 b $18,"ein.",$1b,NULL

::TestDisk
; cmp curDrive
; beq :n10
; inc :d
jsr NewSetDevice
ldy r7H
beq :110 ;beq :n10
lda OpenDiskFlag
beq :n01
jsr OpenDisk
txa
beq :n10
jmp :240
::n01 jsr NewDisk
::n10 ldy r7H
beq :110
LoadB r1H,0
lda curType
and #DRIVE_MASK
cmp #2
beq :d05
cmp #1
bne :d10
::d05 LoadB r1L,18
bne :d20
::d10 cmp #3
bne :d05 ; bei unbek. Laufwerk wird von 1541 ausgegangen
LoadB r1L,40
::d20 LoadW r4,$8000
jsr GetBlock
LoadW r5,$8000+144
txa
bne :240
beq :120
::110 ldx #r5L
jsr GetPtrCurDkNm
::120 ;jsr ConvCurType
ldy #0
::210 lda (r6),y
beq :220
cmp (r5),y
bne :240
iny
cpy #16
bne :210
beq :230
::220 lda (r5),y
cmp #$a0
bne :240
::230 jsr :sub
ldx #0
rts
::240 jsr :sub
ldx #1
rts
::d b 0
::sub lda r7H
beq :e10
ldx #r4
jsr GetPtrCurDkNm
ldy #15
::loop lda $8000+144,y
sta (r4),y
dey
bpl :loop
::e10 rts

if 0
.ConvCurType
;Par: r4 - Zeiger auf den ersten BAM-Block einer Diskette
;Ret: curType (1571 einseitig = 1541)
;Des: a,y
lda curType
and #DRIVE_MASK
cmp #2
bne :10
ldy #3
lda (r4),y
bne :10
lda curType
and #%1100 0000
ora #1
sta curType
::10 rts
endif

+ 95
- 0
128_de/DeskInclude/SizeRectangle.s View File

@@ -0,0 +1,95 @@
;SizeRectangle (mod. 24.07.1990) (mod. 24.4.91)
;Par: r0 - Zahl, die der Maximalgr|~e entspricht
; r1 - Darzustellende Zahl
; r2L - y-oben
; r2H - y-unten
; r3 - linke x-Koordinate
; r4 - rechte x-Koordinate
;Des: r0,r1,r5-r9,r11
:SizeRectangle
lda #1
jsr SetPattern
ldy #5
::loop lda r2L,y
pha
dey
bpl :loop
jsr NewRectangle
ldy #0
::loop2 pla
sta r2L,y
iny
cpy #6
bne :loop2
; lda #$ff
; jsr FrameRectangle
lda #0
ldy #5
::10 sta r5L,y
dey
bpl :10
lda r2H
sec
sbc r2L ; H|he ermitteln
sbc #2 ; -2
sta r5L ; ->r5L
ldx #r0L
ldy #r5L
jsr NewDdiv ; Max / H|he
ldy #$ff
::20 iny
CmpW r6,r1
bge :40
AddW r0,r6
AddW r8,r7
CmpW r7,r5
blt :20
SubW r5,r7
inc r6L
bne :20
inc r6H
bne :20
::40 tya
beq :30
iny
::30 sty r9L
; lda r2H
; sec
; sbc r9L
; sta r2L
; lda #1
lda r2H
sec
sbc r2L
sec
sbc r9L
clc
adc r2L
sta r2H
inc r2L
IncW r3
DecW r4
lda #0
jsr SetPattern
jmp NewRectangle

;NewDdiv
; behebt den Fehler von Ddiv und kann auch kleine bzw. 0
; durch gr|~ere Werte dividieren.
; Par & Ret: s. Ddiv
:NewDdiv
lda $01,x
cmp $01,y
bne :10
lda $00,x
cmp $00,y
::10 bcc :20
jmp Ddiv
::20 lda $00,x
sta r8L
lda $01,x
sta r8H
lda #0
sta $00,x
sta $01,x
rts

+ 461
- 0
128_de/DeskInclude/Validate+Undelet.s View File

@@ -0,0 +1,461 @@
;letzte Modifizierungen der Routinen: 21.06.1991
:dir3Head = $9c80
if 0
:UndeleteFile
; Par: r5 - Zeiger auf den Directory-Eintrag
; (wird aktualisiert)
; Ret: x - Fehlernummer
; Des: diskBlkBuf,fileTrScTab,a,y,r7,r8H,r2,r4,r1
jsr EnterTurbo
txa
beq :05
rts
::05 jsr InitForIO
jsr ValidateFile
txa
bne :err
ldx #$82
ldy #21
lda (r5),y
beq :10
inx
::10 txa
ldy #0
sta (r5),y
ldx #0
::err jmp DoneWithIO
endif

:Validate
;Des: diskBlkBuf,fileTrScTab,curDirHead,fileHeader,ValidateBuffer,a,y,r1-r2,r4-r8
jsr OpenDisk
txa
bne :10
jsr ClearBAM
txa
bne :10
jsr EnterTurbo
txa
beq :20
::10 rts
::20 jsr InitForIO
ldy #63
lda #0
::15 sta ValidateBuffer,y
dey
bpl :15
lda curType
jsr Get1stDirBlock
::70 jsr :ValidateDirBlock
txa
bne :err
MoveB fileHeader+1,r1H
MoveB fileHeader,r1L
bne :70
lda isGEOS
bmi :80
MoveB curDirHead+172,r1H
MoveB curDirHead+171,r1L
beq :80
jsr :ValidateDirBlock
txa
beq :80
::err jmp DoneWithIO
::80 lda curType
jsr Get1stDirBlock
jsr :200
txa
bne :err
lda isGEOS
bmi :85
MoveB curDirHead+172,r1H
MoveB curDirHead+171,r1L
beq :85
jsr :200
txa
bne :err
::85 jsr DoneWithIO
jmp PutDirHead

::200 LoadW r4,fileHeader
::110 jsr ReadBlock
txa
bne :err2
PushB fileHeader+1
MoveB fileHeader+32,fileHeader+1
lda #2
::90 tay
lda (r4),y
beq :100
dey
lda (r4),y
tax
lda ValidateBuffer,x
bne :95
sta (r4),y
::95 iny
::100 tya
clc
adc #32
bcc :90
MoveB fileHeader+1,fileHeader+32
PopB fileHeader+1
jsr WriteBlock
txa
bne :err2
jsr VerWriteBlock
txa
bne :err2
MoveB fileHeader+1,r1H
MoveB fileHeader,r1L
bne :110
::err2 rts

::ValidateDirBlock LoadW r4,fileHeader
PushW r1
jsr ReadBlock
txa
bne :err3
lda r4L
clc
adc #2
sta r5L
lda r4H
adc #00
sta r5H
::360 ldy #0
lda (r5),y
beq :350
ldy #22
lda (r5),y
cmp #11
bne :340
ldy #19
lda (r5),y
sta r1L
iny
lda (r5),y
sta r1H
LoadW r4,diskBlkBuf
jsr ReadBlock
txa
bne :err3
ldx diskBlkBuf+117
inc ValidateBuffer,x
::340 jsr ValidateFile
txa
bne :err3
::350 lda r5L
clc
adc #32
sta r5L
bcc :360
PopW r1
LoadW r4,fileHeader
jsr WriteBlock
txa
bne :err4
jmp VerWriteBlock
::err3 PopW r1
::err4 rts

; ClearBAM
; l|scht alle Bl|cke in der BAM
; Par: curDirHead
; Ret: x - Fehlernummer
; Des: a,y,r1,r4,r5-r8
:ClearBAM lda curType
and #DRIVE_MASK
cmp #3
bne :no1581
ldy #16
::3a lda #40
sta dir2Head,y
sta dir3Head,y
iny
ldx #4
lda #$ff
::3b sta dir2Head,y
sta dir3Head,y
iny
dex
bpl :3b
tya
bne :3a
LoadB dir2Head,40
LoadB dir2Head+1,2
LoadB dir3Head,0
LoadB dir3Head+1,$ff
LoadB dir2Head+250,37
LoadB dir2Head+251,%1111 1000
jmp :allocdir
::no1581 pha
LoadB r1L,1
ldy #4
::1a sty r0L
jsr GetSectors
ldy r0L
lda r1H
sta curDirHead,y
lda #$ff
sta curDirHead+1,y
sta curDirHead+2,y
lda r1H
sec
sbc #16
tax
lda :setbits-1,x
sta