-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsts.asm
121 lines (107 loc) · 4.81 KB
/
consts.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
;*******************************************************************************
;
; Copyright (C) 2023 Dave Moore
;
; This file is part of Space-Hockey.
;
; Space-Hockey is free software: you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free Software
; Foundation, either version 2 of the License, or (at your option) any later
; version.
;
; Space-Hockey is distributed in the hope that it will be useful, but WITHOUT
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
; details.
;
; You should have received a copy of the GNU General Public License along with
; Space-Hockey. If not, see <http://www.gnu.org/licenses/>.
;
; If you modify this program, or any covered work, by linking or combining it
; with the libraries referred to in README (or a modified version of said
; libraries), containing parts covered by the terms of said libraries, the
; licensors of this program grant you additional permission to convey the
; resulting work.
;
;*******************************************************************************
;###############################################################################
;
; Firmware Calls
;
; http://www.cantrell.org.uk/david/tech/cpc/cpc-firmware/
;
;###############################################################################
KM_GET_JOYSTICK EQU #BB24 ; Check the Joystick (INKEY)
KM_TEST_KEY EQU #BB1E ; Check the Keyboard (INKEY)
MC_WAIT_FLYBACK EQU #BD19 ; Wait for Frame Flyback (FRAME)
SCR_CLEAR EQU #BC14 ; Clear the Screen (CLS)
SCR_RESET EQU #BB02 ; Reset the Screen
SCR_SET_BORDER EQU #BC38 ; Set the Border Colour (BORDER)
SCR_SET_INK EQU #BC32 ; Set an Ink Colour (INK)
SCR_SET_MODE EQU #BC0E ; Set the Screen Mode (MODE)
SOUND_QUEUE EQU #BCAA ; Add a Sound to the Queue (SOUND)
TXT_CLEAR_WINDOW EQU #BB6C ; Clear the current Window
TXT_OUTPUT EQU #BB5A ; Print a Character (PRINT)
TXT_SET_CURSOR EQU #BB75 ; Set the Cursor Position (LOCATE)
TXT_SET_M_TABLE EQU #BBAB ; Start of the UDG Table (SYMBOL AFTER)
TXT_SET_MATRIX EQU #BBA8 ; Set the UDG (SYMBOL)
TXT_SET_PAPER EQU #BB96 ; Set the Paper Colour (PAPER)
TXT_SET_PEN EQU #BB90 ; Set the Pen Colour (PEN)
TXT_STR_SELECT EQU #BBB4 ; Choose the current Window
TXT_WIN_ENABLE EQU #BB66 ; Set the current Window (WINDOW)
;###############################################################################
;
; Keyboard Mappings
;
; https://lronaldo.github.io/cpctelera/files/keyboard/keyboard-h.html
;
;###############################################################################
P1_DOWN EQU 73 ; Joystick
P1_FIRE EQU 76
P1_LEFT EQU 74
P1_RIGHT EQU 75
P1_UP EQU 72
P2_DOWN EQU 69 ; Q/A/O/P/Space
P2_FIRE EQU 47
P2_LEFT EQU 34
P2_RIGHT EQU 27
P2_UP EQU 67
KEY_QUIT EQU 34 ; Q
RESET_KEY EQU 64 ; 1
;###############################################################################
;
; UDCs
;
;###############################################################################
UDC_FIRST EQU 250 ; First UDC
CHR_BANNER EQU 250
CHR_UP EQU 251
CHR_DOWN EQU 252
CHR_LEFT EQU 253
CHR_RIGHT EQU 254
CHR_BALL EQU 255
CHR_GOALS EQU '='
CHR_SPACE EQU ' '
;###############################################################################
;
; Game State Offsets
;
;###############################################################################
P1_OLD_Y EQU #00 ; P1 info
P1_OLD_X EQU #01
P1_Y EQU #02
P1_X EQU #03
P1_CHAR EQU #04
P1_SCORE EQU #05
P2_OLD_Y EQU #06 ; P2 info
P2_OLD_X EQU #07
P2_Y EQU #08
P2_X EQU #09
P2_CHAR EQU #0A
P2_SCORE EQU #0B
BALL_OLD_Y EQU #0C ; Ball info
BALL_OLD_X EQU #0D
BALL_Y EQU #0E
BALL_X EQU #0F
TIME_MSB EQU #10 ; Initial time BCD MSB
TIME_DIGITS EQU 2 ; Length of BCD number for BCD functions