Mercurial > repos > simple16
annotate vint.s16 @ 59:b15187a99d6f default tip
Add a command line option for printing out label addresses on the command line. Useful for debugging purposes.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 07 Sep 2016 23:15:27 -0700 |
parents | 03177ff78094 |
children |
rev | line source |
---|---|
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 ldim vectors, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 setvbr r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 ;current color value |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 ldim 0, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 ;color increment |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
6 ldim $41, r3 |
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
7 ldimh $8, r3 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 ;color max |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
9 ldim $DF, r5 |
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
10 ldimh $FF, r5 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 ;counter |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 ldim 1, r4 |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
13 ;Palette RAM address/length |
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
14 ldim 1, r1 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 ;enable interrupt |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 ori 2, sr |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
17 ;enable VINT generation |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 ldim 0, r2 |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
19 ldimh $20, r2 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 outi $D, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 wait |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 bra wait |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
23 ;shouldn't get here, disable VINT so it's clear something broke |
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
24 xori 2, sr |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 ldimh $0, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 outi $D, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 bra wait |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 vectors: |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 dc.w 0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 dc.w vint_handler |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 vint_handler |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 addi -1, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 bne done |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 outi $E, r1 |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
37 outi $E, r0 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 cmp r0, r5 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 beq down |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 resume |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 add r3, r0, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 beq up |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 ldim 5, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 done |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 reti r13 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 down |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
47 ldim $BF, r3 |
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
48 ldimh $F7, r3 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 bra resume |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 up |
53
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
51 ldim $41, r3 |
03177ff78094
Update VINT example for hardware changes
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
52 ldimh $8, r3 |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 ldim 5, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 reti r13 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 |