mirror of
https://github.com/DaanVandenBosch/phantasmal-world.git
synced 2025-04-04 22:58:29 +08:00
120 lines
4.2 KiB
JSON
120 lines
4.2 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Phantasy Star Online Instruction Set",
|
|
"type": "object",
|
|
"required": ["opcodes"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"opcodes": {
|
|
"type": "array",
|
|
"description": "List of every known opcode.",
|
|
"items": {
|
|
"$ref": "#/definitions/opcode"
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"opcode": {
|
|
"type": "object",
|
|
"required": ["code", "params"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"pattern": "^0x(f8|f9)?[0-9a-f]{2}$",
|
|
"description": "Unique byte representation of the opcode."
|
|
},
|
|
"mnemonic": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9=<>!_]+$",
|
|
"description": "Unique string representation of the opcode."
|
|
},
|
|
"doc": {
|
|
"type": "string",
|
|
"description": "Opcode documentation."
|
|
},
|
|
"params": {
|
|
"type": "array",
|
|
"description": "Opcode parameters. Whether or not the stack is used is determined by the stack property.",
|
|
"items": {
|
|
"$ref": "#/definitions/param"
|
|
}
|
|
},
|
|
"stack": {
|
|
"enum": ["push", "pop"],
|
|
"description": "Stack interaction. \"push\" if the instruction takes immediate arguments and pushes its arguments onto the stack. \"pop\" if the instruction doesn't take immediate arguments but pops its arguments off the stack."
|
|
}
|
|
}
|
|
},
|
|
"param": {
|
|
"type": "object",
|
|
"required": ["type"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": {
|
|
"$ref": "#/definitions/param_type"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Parameter name."
|
|
},
|
|
"doc": {
|
|
"type": "string",
|
|
"description": "Parameter-specific documentation."
|
|
},
|
|
"access": {
|
|
"$ref": "#/definitions/access"
|
|
},
|
|
"registers": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"description": "Specifies the way the referenced registers will be interpreted. Should only be specified if the parameter type is \"reg_tup_ref\".",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["type", "access"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": {
|
|
"$ref": "#/definitions/param_type"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"doc": {
|
|
"type": "string"
|
|
},
|
|
"access": {
|
|
"$ref": "#/definitions/access"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"param_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"any",
|
|
"byte",
|
|
"short",
|
|
"int",
|
|
"float",
|
|
"label",
|
|
"instruction_label",
|
|
"data_label",
|
|
"string_label",
|
|
"string",
|
|
"instruction_label_var",
|
|
"reg_ref",
|
|
"reg_ref_var",
|
|
"pointer"
|
|
]
|
|
},
|
|
"access": {
|
|
"type": "string",
|
|
"enum": ["read", "write", "read_write"],
|
|
"description": "Specifies the way the instruction accesses the referenced register(s)."
|
|
}
|
|
}
|
|
}
|