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

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [boot/] [demo.asm] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 robfinch
; ============================================================================
2
;        __
3
;   \\__/ o\    (C) 2013-2022  Robert Finch, Waterloo
4
;    \  __ /    All rights reserved.
5
;     \/_//     robfinch@opencores.org
6
;       ||
7
;
8
;
9
; BSD 3-Clause License
10
; Redistribution and use in source and binary forms, with or without
11
; modification, are permitted provided that the following conditions are met:
12
;
13
; 1. Redistributions of source code must retain the above copyright notice, this
14
;    list of conditions and the following disclaimer.
15
;
16
; 2. Redistributions in binary form must reproduce the above copyright notice,
17
;    this list of conditions and the following disclaimer in the documentation
18
;    and/or other materials provided with the distribution.
19
;
20
; 3. Neither the name of the copyright holder nor the names of its
21
;    contributors may be used to endorse or promote products derived from
22
;    this software without specific prior written permission.
23
;
24
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
;
35
; ============================================================================
36
;
37 15 robfinch
 
38
OPT include "d:\cores2022\rf6809\software\boot\mon_equates.asm"
39
OPT include "d:\cores2022\rf6809\software\boot\io_equates.asm"
40
 
41
sprite_xpos     EQU             $1000
42
sprite_ypos     EQU             $1020
43
sprite_dx               EQU             $1040
44
sprite_dy               EQU             $1080
45
 
46
        org             $FF8000
47
        lbra    sprite_demo
48
        lbra    disassem
49
 
50
;==============================================================================
51
; Disassembler
52
;==============================================================================
53
 
54
OPT     include "d:\cores2022\rf6809\software\boot\disassem.asm"
55
 
56
;==============================================================================
57
; Sprite Demo
58
;==============================================================================
59
sprite_demo:
60
        ldb             #1
61
        tfr             b,dpr
62
        setdp   1
63
        ldd             #-1                                             ; show them all
64
        tfr             d,x
65
        swi
66
        fcb             MF_ShowSprites
67
        ldy             #0
68
sprite_demo1:
69
        ; Assign random positions
70
        swi
71
        fcb             MF_Random
72
        andb    #$1FF
73
        clra
74
        addd    #200
75
        std             SPRITE_CTRL+0,y         ; hpos
76
        tfr             x,d
77
        andb    #$FF
78
        clra
79
        addd    #64
80
        std             SPRITE_CTRL+1,y         ; vpos
81
        leay    8,y
82
        cmpy    #$100
83
        blo             sprite_demo1
84
        ; turn on sprite DMA
85
        ldd             #-1
86
        std             SPRITE_CTRL+$3D0
87
        std             SPRITE_CTRL+$3D2
88
        ldy             #0
89
sprite_demo2:
90
        swi
91
        fcb             MF_Random
92
        andb    #$15
93
        subb    #8
94
        stb             sprite_dx,y
95
        anda    #15
96
        suba    #8
97
        sta             sprite_dx,y
98
        iny
99
        cmpy    #32
100
        blo             sprite_demo2
101
        ldy             #300000
102
sprite_demo3:
103
        dey
104
        bne             sprite_demo3
105
        ldx             #0
106
        ldy             #0
107
sprite_demo4:
108
        lda             SPRITE_CTRL+0,x
109
        adda    sprite_dx,y
110
        sta             SPRITE_CTRL+0,x
111
        lda             SPRITE_CTRL+1,x
112
        adda    sprite_dy,y
113
        sta             SPRITE_CTRL+1,x
114
        leax    8,x
115
        iny
116
        cmpy    #32
117
        blo             sprite_demo4
118
        clra
119
        clrb
120
        swi
121
        fcb             MF_INCH
122
        cmpb    #CTRLC
123
        bne             sprite_demo3
124
        ldd             #0
125
        tfr             d,x
126
        swi
127
        fcb             MF_ShowSprites
128
sprite_demo5:
129
        swi
130
        fcb             MF_Monitor
131
        bra             sprite_demo5

powered by: WebSVN 2.1.0

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