OpenCores
URL https://opencores.org/ocsvn/rtftextcontroller/rtftextcontroller/trunk

Subversion Repositories rtftextcontroller

[/] [rtftextcontroller/] [trunk/] [software/] [rtfTextControllerSampleUsageCode.x68] - Blame information for rev 18

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 robfinch
;------------------------------------------------------------------------------
2
; Code Sample from system bios ROM.
3
;------------------------------------------------------------------------------
4
 
5
 
6
TEXTSCR         EQU             0xFFD00000
7
COLORSCR        EQU             0xFFD10000
8
TEXTCTRL        EQU             0xFFDA0000
9
TEXT_COLS       EQU             0xFFDA0000
10
TEXT_ROWS       EQU             0xFFDA0002
11
TEXT_CURPOS     EQU             0xFFDA0016
12
 
13
 
14
;------------------------------------------------------------------------------
15
; Clear the screen and the screen color memory
16
; We clear the screen to give a visual indication that the system
17
; is working at all.
18
;------------------------------------------------------------------------------
19
;
20
ClearScreen:
21
        move.w  TEXT_COLS,d1    ; calc number to clear
22
        mulu.w  TEXT_ROWS,d1
23
        move.w  #32,d0                  ; space character
24
        move.l  #TEXTSCR,a0             ; text screen address
25
csj4:
26
        move.w  d0,(a0)+
27
        dbeq    d1,csj4
28
 
29
        move.w  TEXT_COLS,d1    ; calc number to clear
30
        mulu.w  TEXT_ROWS,d1
31
        move.w  ScreenColor,d0          ; a nice color blue, light blue
32
        move.l  #COLORSCR,a0            ; text color address
33
csj3:
34
        move.w  d0,(a0)+
35
        dbeq    d1,csj3
36
        rts
37
 
38
;------------------------------------------------------------------------------
39
; Scroll text on the screen upwards
40
;------------------------------------------------------------------------------
41
;
42
ScrollUp:
43
        movem.l d0/d1/d2/a0,-(a7)
44
        move.w  TEXT_COLS,d0            ; calc number of chars to scroll
45
        mulu.w  TEXT_ROWS,d0
46
        sub.w   TEXT_COLS,d0            ; one less row
47
        lea             TEXTSCR,a0
48
        move.w  TEXT_COLS,d2
49
        asl.w   #1,d2
50
scrup1:
51
        move.w  (a0,d2.w),(a0)+
52
        dbeq    d0,scrup1
53
 
54
        move.w  TEXT_ROWS,d1
55
        subi.w  #1,d1
56
        jsr             BlankLine
57
        movem.l (a7)+,d0/d1/d2/a0
58
        rts
59
 
60
;------------------------------------------------------------------------------
61
; Blank out a line on the display
62
; line number to blank is in D1.W
63
;------------------------------------------------------------------------------
64
;
65
BlankLine:
66
        movem.l d0/a0,-(a7)
67
        move.w  TEXT_COLS,d0
68
        mulu.w  d1,d0                           ; d0 = row * cols
69
        asl.w   #1,d0                           ; *2 for moving words, not bytes
70
        add.l   #TEXTSCR,d0                     ; add in screen base
71
        move.l  d0,a0
72
        move.w  TEXT_COLS,d0            ; d0 = number of chars to blank out
73
blnkln1:
74
        move.w  #' ',(a0)+
75
        dbeq    d0,blnkln1
76
        movem.l (a7)+,d0/a0
77
        rts
78
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.