-
Notifications
You must be signed in to change notification settings - Fork 19
/
scc_target.c
141 lines (127 loc) · 4.45 KB
/
scc_target.c
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/* ScummC
* Copyright (C) 2007 Alban Bedel
*
* This program 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.
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/// @defgroup scc_target ScummC target definitons
/**
* @file scc_target.c
* @ingroup scc_target
* @brief ScummC target definitions
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <errno.h>
#include "scc_util.h"
#include "scc_parse.h"
#include "scc_func.h"
static int scc_addr_max_v6[] = {
0, // unused
0x3FFF, // VAR
0xFF, // ROOM
0xC7, // SCR
0xFFFF, // COST
0xFFFF, // SOUND
0xFFFF, // CHSET
0xFF, // LSCR
0xFE, // VERB (0xFF is default)
0xFFFF, // OBJ
0x0F, // STATE
0x400F, // LVAR
0xFFFF, // BVAR
0xFFFF, // PALS
0x0F, // CYCL
0x0F, // ACTOR
0xFF, // BOX
SCC_MAX_CLASS, // CLASS
0x7FFFFFFF // VOICE
};
static int scc_addr_min_v6[] = {
0, // nothing
0x100, // VAR (don't use the engine vars)
1, // ROOM
1, // SCR
1, // COST
1, // SOUND
1, // CHSET
200, // LSCR
1, // VERB
17, // OBJ
1, // STATE
0x4000, // LVAR
0x8000, // BVAR
1, // PAL
1, // CYCL
1, // ACTOR
0, // BOX
1, // CLASS
0 // VOICE
};
static int scc_addr_max_v7[] = {
0, // unused
0x3FFF, // VAR
0xFF, // ROOM
0x7CF, // SCR
0xFFFF, // COST
0xFFFF, // SOUND
0xFFFF, // CHSET
0xFFFF, // LSCR
0xFE, // VERB (0xFF is default)
0xFFFF, // OBJ
0xFF, // STATE
0x400F, // LVAR
0xFFFF, // BVAR
0xFFFF, // PALS
0x0F, // CYCL
0x1D, // ACTOR
0xFF, // BOX
SCC_MAX_CLASS, // CLASS
0x7FFFFFFF // VOICE
};
static int scc_addr_min_v7[] = {
0, // nothing
0x100, // VAR (don't use the engine vars)
1, // ROOM
1, // SCR
1, // COST
1, // SOUND
1, // CHSET
2000, // LSCR
1, // VERB
32, // OBJ
1, // STATE
0x4000, // LVAR
0x8000, // BVAR
1, // PAL
1, // CYCL
1, // ACTOR
0, // BOX
1, // CLASS
0 // VOICE
};
static scc_target_t target_list[] = {
{ 6, scc_func_v6, scc_addr_max_v6, scc_addr_min_v6, 200 },
{ 7, scc_func_v7, scc_addr_max_v7, scc_addr_min_v7, 2000 },
{ -1 }
};
scc_target_t* scc_get_target(int version) {
int i;
for(i = 0 ; target_list[i].version >= 0 ; i++)
if(target_list[i].version == version)
return target_list+i;
return NULL;
}