-
Notifications
You must be signed in to change notification settings - Fork 2
/
elite-teletext-macros.asm
83 lines (74 loc) · 2.41 KB
/
elite-teletext-macros.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
\ ******************************************************************************
\
\ TELETEXT ELITE MACROS
\
\ Elite was written by Ian Bell and David Braben and is copyright Acornsoft 1984
\
\ The code on this site has been reconstructed from a disassembly of the version
\ released on Ian Bell's personal website at http://www.elitehomepage.org/
\
\ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes
\ in the documentation are entirely my fault
\
\ The terminology and notations used in this commentary are explained at
\ https://elite.bbcelite.com/terminology
\
\ The deep dive articles referred to in this commentary can be found at
\ https://elite.bbcelite.com/deep_dives
\
\ ******************************************************************************
\ ******************************************************************************
\
\ Name: SCALE_SIXEL_X
\ Type: Macro
\ Category: Teletext Elite
\ Summary: Scale a pixel x-coordinate to a sixel x-coordinate
\
\ ------------------------------------------------------------------------------
\
\ Arguments:
\
\ A The pixel x-coordinate
\
\ ------------------------------------------------------------------------------
\
\ Returns:
\
\ A The sixel x-coordinate
\
\ ******************************************************************************
MACRO SCALE_SIXEL_X
LSR A \ Set A = A / 4, rounded to the nearest integer
LSR A
BCC P%+4
ADC #0
ENDMACRO
\ ******************************************************************************
\
\ Name: SCALE_SIXEL_Y
\ Type: Macro
\ Category: Teletext Elite
\ Summary: Scale a pixel y-coordinate to a sixel y-coordinate, moving it down
\ a row to skip the border row along the top of the screen
\
\ ------------------------------------------------------------------------------
\
\ Arguments:
\
\ A The pixel y-coordinate
\
\ ------------------------------------------------------------------------------
\
\ Returns:
\
\ A The sixel y-coordinate
\
\ ******************************************************************************
MACRO SCALE_SIXEL_Y
LSR A \ Set A = A / 4, rounded to the nearest integer
LSR A
BCC P%+4
ADC #0
ADC #3 \ Move everything down one character row, so we don't
\ draw pixels on the title row
ENDMACRO