if .p
t "TopSym+"
t "TopMac"
t "32bitMac"
t "Sym128.erg"
endif
n "Text80"
c "Text80 V1.0"
a "Holger G. Heimes"
f APPLICATION
z $c0
o APP_RAM
p Start
:Start LoadW BRKVector,BRKError
LoadW r3,0 ;xmin
LoadW r4,319 ;xmax
LoadB r2L,0 ;ymin
LoadB r2H,99 ;ymax
jsr ScreenInit
jsr FontInit
jsr TastInit
; jsr DummyMenu
jsr DummyIcon
jsr MouseOff
rts
:xmin w 0
:xmax w 319
:ymin b 0
:ymax b 99
:ScreenInit lda r2L
cmp r2H
blt :yfolgeok
lda #1
rts
::yfolgeok sta ymin
cmp #191
ble :yminok
ldx #2
rts
::yminok lda r2H
cmp #199
ble :ymaxok
ldx #3
rts
::ymaxok sta ymax
CmpW r3,r4
blt :xfolgeok
ldx #4
rts
::xfolgeok CmpWI r3,632
ble :xminok
ldx #5
rts
::xminok MoveW r3,xmin
CmpWI r4,639
ble :xmaxok
ldx #6
rts
::xmaxok MoveW r4,xmax
lda #0
jsr SetPattern
jsr Rectangle
ldx #0
rts
:DummyMenu LoadW r0,DummyMenuTab
jmp DoMenu
:DummyMenuTab b 0,0
w 0,0
b 0
:DummyIcon LoadW r0,DummyIconTab
jmp DoIcons
:DummyIconTab b 1
w 0
b 0
w 0
b 0,0,1,1
w 0
:TastInit LoadW keyVector,TastAbfrage
MoveW xmin,xtext
lda ymin
clc
adc baselineOffset
sta ytext
rts
:xtext w 0
:ytext b 0
:TastAbfrage MoveW xtext,r11
MoveB ytext,r1H
ldx keyData
bmi :commodore
cpx #27
blt :control
txa
cmp #29
bne :1
lda #$08
::1 jsr PutChar
CmpW r11,xmax
ble :2
::3 MoveW xmin,r11
AddVB 8,r1H
CmpB r1H,ymax
ble :2
SubVB 8,r1H ;-> Scrollen !
::2 MoveW r11,xtext
MoveB r1H,ytext
rts
::commodore txa
and #%01111111
cmp #"q"
beq :exit
rts
::control cpx #13
bne :2
beq :3
::exit jsr FontExit
jmp EnterDeskTop
:FontInit
LoadW r0,ViewFont
jmp LoadCharSet
:FontExit jmp UseSystemFont
:BRKError sta akku
stx xreg
sty yreg
pla
sta addH
pla
sta addL
LoadW r0,ErrorTab
jsr DoDlgBox
jmp EnterDeskTop
:akku b 0
:xreg b 0
:yreg b 0
:addL b 0
:addH b 0
:ErrorTab b %10000000
b OK,6,80
b NULL
:ViewFont
v 7,"ViewFontGER"