2005-03-26 17:03:30 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 10.03.2004
|
|
|
|
;
|
2009-09-10 19:18:15 +00:00
|
|
|
; void __fastcall__ textframexy (unsigned char x, unsigned char y,
|
|
|
|
; unsigned char width, unsigned char height,
|
|
|
|
; unsigned char style);
|
|
|
|
; void __fastcall__ textframe (unsigned char width, unsigned char height,
|
|
|
|
; unsigned char style);
|
2005-03-26 17:03:30 +00:00
|
|
|
;
|
2013-05-01 20:02:47 +00:00
|
|
|
.ifdef __APPLE2ENH__
|
2005-03-26 17:03:30 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _textframexy, _textframe
|
|
|
|
.import popa, pusha, _gotoxy
|
|
|
|
.import chlinedirect, cvlinedirect
|
2005-03-26 17:03:30 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "zeropage.inc"
|
|
|
|
.include "apple2.inc"
|
2005-03-26 17:03:30 +00:00
|
|
|
|
|
|
|
WIDTH = tmp2
|
|
|
|
HEIGHT = tmp3
|
|
|
|
XORIGIN = tmp4
|
|
|
|
YORIGIN = ptr1
|
|
|
|
|
2009-09-10 19:18:15 +00:00
|
|
|
_textframexy:
|
2005-03-26 17:03:30 +00:00
|
|
|
sec
|
2013-05-09 11:56:54 +00:00
|
|
|
bra :+
|
2005-03-26 17:03:30 +00:00
|
|
|
|
2009-09-10 19:18:15 +00:00
|
|
|
_textframe:
|
2005-03-26 17:03:30 +00:00
|
|
|
clc
|
2013-05-09 11:56:54 +00:00
|
|
|
: ldx INVFLG
|
|
|
|
phx ; Save character display mode
|
|
|
|
ldx #$FF
|
|
|
|
stx INVFLG ; Set normal character display mode
|
|
|
|
pha ; Save index
|
|
|
|
jsr popa ; Get height
|
|
|
|
sta HEIGHT
|
|
|
|
jsr popa ; Get width
|
|
|
|
sta WIDTH
|
|
|
|
lda CH
|
|
|
|
ldx CV
|
|
|
|
bcc noxy
|
|
|
|
jsr popa ; Get y
|
2005-03-26 17:03:30 +00:00
|
|
|
tax
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr popa ; Get x
|
|
|
|
noxy: sta XORIGIN
|
|
|
|
stx YORIGIN
|
|
|
|
plx ; Restore index
|
|
|
|
loop: lda XOFFS,x
|
2005-03-26 17:03:30 +00:00
|
|
|
clc
|
2013-05-09 11:56:54 +00:00
|
|
|
bpl :+ ; Relative to left edge?
|
|
|
|
adc WIDTH
|
|
|
|
: adc XORIGIN
|
|
|
|
jsr pusha
|
|
|
|
lda YOFFS,x
|
2005-03-26 17:03:30 +00:00
|
|
|
clc
|
2013-05-09 11:56:54 +00:00
|
|
|
bpl :+ ; Relative to top?
|
|
|
|
adc HEIGHT
|
|
|
|
: adc YORIGIN
|
|
|
|
jsr _gotoxy ; Call this one, will pop params
|
2005-03-26 17:03:30 +00:00
|
|
|
txa
|
|
|
|
tay
|
2013-05-09 11:56:54 +00:00
|
|
|
lsr ; Get bit 0 (vline) into carry
|
|
|
|
lda LENGTH,x
|
|
|
|
phx ; Save index
|
|
|
|
ldx CHAR,y
|
|
|
|
bcc hline
|
2005-03-26 17:03:30 +00:00
|
|
|
clc
|
2013-05-09 11:56:54 +00:00
|
|
|
adc HEIGHT
|
|
|
|
jsr cvlinedirect
|
|
|
|
bra next
|
|
|
|
hline: adc WIDTH
|
|
|
|
jsr chlinedirect
|
|
|
|
next: plx ; Restore index
|
2005-03-26 17:03:30 +00:00
|
|
|
inx
|
|
|
|
txa
|
2013-05-09 11:56:54 +00:00
|
|
|
and #$03 ; Mask style
|
|
|
|
bne loop
|
2005-03-26 17:03:30 +00:00
|
|
|
pla
|
2013-05-09 11:56:54 +00:00
|
|
|
sta INVFLG ; Restore character display mode
|
2005-03-26 17:03:30 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
.rodata
|
|
|
|
|
|
|
|
; 2 styles with 4 lines each make up 8 entries per table
|
|
|
|
; - even entry numbers mean horizontal lines
|
|
|
|
; - odd entry numbers mean vertical lines
|
|
|
|
|
|
|
|
; x offset for the line starting point
|
|
|
|
; - a positive value means relative to the frame left edge
|
|
|
|
; - a negative value menas relative to the frame right edge
|
2013-05-09 11:56:54 +00:00
|
|
|
XOFFS: .byte 0, 0, 0, <-2, 1, 0, 1, <-2
|
2005-03-26 17:03:30 +00:00
|
|
|
|
|
|
|
; y offset for the line starting point
|
|
|
|
; - a positive value means relative to the frame top
|
|
|
|
; - a negative value menas relative to the frame bottom
|
2013-05-09 11:56:54 +00:00
|
|
|
YOFFS: .byte 0, 1, <-2, 1, 0, 0, <-2, 0
|
2005-03-26 17:03:30 +00:00
|
|
|
|
|
|
|
; length of the line relative to the frame size
|
|
|
|
; - a negative value for hlines means shorter than the width
|
|
|
|
; - a negative value for vlines menas shorter than the height
|
2013-05-09 11:56:54 +00:00
|
|
|
LENGTH: .byte 0, <-2, 0, <-2, <-2, 0, <-2, 0
|
2005-03-26 17:03:30 +00:00
|
|
|
|
|
|
|
; character to use for drawing the line
|
|
|
|
; - hibit set means normal printable character
|
|
|
|
; - hibit clear means MouseText character
|
2013-05-09 11:56:54 +00:00
|
|
|
CHAR: .byte '_'|$80, '_', 'L', 'Z', 'L', 'Z', '_'|$80, '_'
|
2013-05-01 20:02:47 +00:00
|
|
|
|
|
|
|
.endif ; __APPLE2ENH__
|