Skip to content

Commit

Permalink
add 'old_name' attribute, add old names for some MenuMgr functions
Browse files Browse the repository at this point in the history
  • Loading branch information
autc04 committed Mar 8, 2020
1 parent 413a1f1 commit d7aac1e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 10 additions & 1 deletion cincludes.rb
Expand Up @@ -264,6 +264,13 @@ def declare_function(fun, variant_index:nil)
if not fun["inline"] and (m68kinlines.length == 0 or complex) then
@functions_needing_glue << name
end

if fun["old_name"] then
@out << "#if OLDROUTINENAMES\n"
argnames = args.map {|arg| arg["name"]}.join(", ")
@out << "#define #{fun["old_name"]}(#{argnames}) #{name}(#{argnames})\n"
@out << "#endif\n"
end
end

def declare_struct_union(what, value)
Expand Down Expand Up @@ -424,7 +431,9 @@ def generate(defs)
#define STACK_ROUTINE_PARAMETER(n, sz) ((sz) << (kStackParameterPhase + ((n)-1) * kStackParameterWidth))
#ifndef OLDROUTINENAMES
#define OLDROUTINENAMES 0
#endif
PREAMBLE

defs.topsort.each do |name|
Expand Down
6 changes: 6 additions & 0 deletions defs/MenuMgr.yaml
Expand Up @@ -304,6 +304,7 @@
type: ResType
trap: 0xA94D
executor: C_
old_name: AddResMenu

# ####

Expand All @@ -316,6 +317,7 @@
type: INTEGER
trap: 0xA952
executor: C_
old_name: DelMenuItem

# ####

Expand Down Expand Up @@ -344,6 +346,7 @@
type: INTEGER
trap: 0xA826
executor: C_
old_name: InsMenuItem

# ####

Expand Down Expand Up @@ -451,6 +454,7 @@
type: ConstStringPtr
trap: 0xA947
executor: C_
old_name: SetItem

# ####

Expand All @@ -465,6 +469,7 @@
type: StringPtr
trap: 0xA946
executor: C_
old_name: GetItem

# ####

Expand Down Expand Up @@ -609,6 +614,7 @@
type: INTEGER
trap: 0xA949
executor: C_
old_name: GetMHandle

# ####

Expand Down
3 changes: 2 additions & 1 deletion multiversal.schema.json
Expand Up @@ -127,7 +127,8 @@
"dispatcher": { "type": "string" },
"selector": { "type": "integer" },
"file_trap": { "oneOf": [ {"type":"string"}, {"type":"boolean"}] },
"comment": { "type": "string" }
"comment": { "type": "string" },
"old_name": { "type": "string" }
},
"additionalProperties": false,
"required": [ "name" ]
Expand Down

0 comments on commit d7aac1e

Please sign in to comment.