mirror of
https://github.com/spicyjpeg/573in1.git
synced 2025-03-01 07:20:42 +01:00
Add schemas for all JSON files
This commit is contained in:
parent
3fd0bca0fc
commit
aac5f4abb1
@ -1,4 +1,6 @@
|
||||
{
|
||||
"$schema": "../../schema/metrics.json",
|
||||
|
||||
"spaceWidth": 4,
|
||||
"tabWidth": 32,
|
||||
"lineHeight": 10,
|
||||
|
@ -1,4 +1,6 @@
|
||||
{
|
||||
"$schema": "schema/cdrom.json",
|
||||
|
||||
"identifiers": {
|
||||
"system": "PLAYSTATION",
|
||||
"volume": "${CD_VOLUME_NAME}",
|
||||
|
248
resources.json
248
resources.json
@ -1,124 +1,128 @@
|
||||
[
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/main.psexe.lz4",
|
||||
"source": "${PROJECT_BINARY_DIR}/main.psexe",
|
||||
"compression": "lz4"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher801fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher801fd000.psexe"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher803fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher803fd000.psexe"
|
||||
},
|
||||
{
|
||||
"$schema": "schema/resources.json",
|
||||
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/background.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/background.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 960, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 0 }
|
||||
},
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/font.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 984, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 1 }
|
||||
},
|
||||
{
|
||||
"type": "metrics",
|
||||
"name": "assets/textures/font.metrics",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.metrics.json"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/startup.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/startup.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/about.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/about.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/alert.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/alert.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/move.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/move.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/enter.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/enter.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/exit.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/exit.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/click.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/click.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/screenshot.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/screenshot.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "palette",
|
||||
"name": "assets/app.palette",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.palette.json"
|
||||
},
|
||||
{
|
||||
"type": "strings",
|
||||
"name": "assets/app.strings",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.strings.json"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"name": "assets/about.txt",
|
||||
"source": "${PROJECT_BINARY_DIR}/about.txt"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/main.psexe.lz4",
|
||||
"source": "${PROJECT_BINARY_DIR}/main.psexe",
|
||||
"compression": "lz4"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher801fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher801fd000.psexe"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher803fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher803fd000.psexe"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/fpga.bit",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/fpga.bit"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/x76f041.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/x76f041.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/zs01.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/zs01.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/flash.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/flash.db"
|
||||
}
|
||||
]
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/background.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/background.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 960, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 0 }
|
||||
},
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/font.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 984, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 1 }
|
||||
},
|
||||
{
|
||||
"type": "metrics",
|
||||
"name": "assets/textures/font.metrics",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.metrics.json"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/startup.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/startup.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/about.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/about.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/alert.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/alert.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/move.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/move.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/enter.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/enter.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/exit.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/exit.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/click.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/click.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/screenshot.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/screenshot.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "palette",
|
||||
"name": "assets/app.palette",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.palette.json"
|
||||
},
|
||||
{
|
||||
"type": "strings",
|
||||
"name": "assets/app.strings",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.strings.json"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"name": "assets/about.txt",
|
||||
"source": "${PROJECT_BINARY_DIR}/about.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/fpga.bit",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/fpga.bit"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/x76f041.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/x76f041.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/zs01.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/zs01.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/flash.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/flash.db"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,118 +1,122 @@
|
||||
[
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/main.psexe.lz4",
|
||||
"source": "${PROJECT_BINARY_DIR}/main.psexe",
|
||||
"compression": "lz4"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher801fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher801fd000.psexe"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher803fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher803fd000.psexe"
|
||||
},
|
||||
{
|
||||
"$schema": "schema/resources.json",
|
||||
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/background.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/background.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 960, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 0 }
|
||||
},
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/font.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 984, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 1 }
|
||||
},
|
||||
{
|
||||
"type": "metrics",
|
||||
"name": "assets/textures/font.metrics",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.metrics.json"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/startup.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/startup.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/alert.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/alert.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/move.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/move.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/enter.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/enter.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/exit.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/exit.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/click.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/click.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/screenshot.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/screenshot.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "palette",
|
||||
"name": "assets/app.palette",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.palette.json"
|
||||
},
|
||||
{
|
||||
"type": "strings",
|
||||
"name": "assets/app.strings",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.strings.json"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"name": "assets/about.txt",
|
||||
"source": "${PROJECT_BINARY_DIR}/about.txt"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/main.psexe.lz4",
|
||||
"source": "${PROJECT_BINARY_DIR}/main.psexe",
|
||||
"compression": "lz4"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher801fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher801fd000.psexe"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "binaries/launcher803fd000.psexe",
|
||||
"source": "${PROJECT_BINARY_DIR}/launcher803fd000.psexe"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/fpga.bit",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/fpga.bit"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/x76f041.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/x76f041.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/zs01.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/zs01.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/flash.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/flash.db"
|
||||
}
|
||||
]
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/background.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/background.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 960, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 0 }
|
||||
},
|
||||
{
|
||||
"type": "tim",
|
||||
"name": "assets/textures/font.tim",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.png",
|
||||
"quantize": 16,
|
||||
"imagePos": { "x": 984, "y": 0 },
|
||||
"clutPos": { "x": 1008, "y": 1 }
|
||||
},
|
||||
{
|
||||
"type": "metrics",
|
||||
"name": "assets/textures/font.metrics",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/textures/font.metrics.json"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/startup.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/startup.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/alert.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/alert.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/move.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/move.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/enter.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/enter.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/exit.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/exit.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/click.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/click.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "assets/sounds/screenshot.vag",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/sounds/screenshot.vag",
|
||||
"compression": "none"
|
||||
},
|
||||
{
|
||||
"type": "palette",
|
||||
"name": "assets/app.palette",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.palette.json"
|
||||
},
|
||||
{
|
||||
"type": "strings",
|
||||
"name": "assets/app.strings",
|
||||
"source": "${PROJECT_SOURCE_DIR}/assets/app.strings.json"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"name": "assets/about.txt",
|
||||
"source": "${PROJECT_BINARY_DIR}/about.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/fpga.bit",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/fpga.bit"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/x76f041.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/x76f041.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/zs01.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/zs01.db"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "data/flash.db",
|
||||
"source": "${PROJECT_SOURCE_DIR}/data/flash.db"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
95
schema/cart.json
Normal file
95
schema/cart.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "schema/cart.json",
|
||||
|
||||
"title": "Security cartridge description",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "pcb", "dataFormat" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"pcb": {
|
||||
"title": "Security cartridge PCB type",
|
||||
"description": "Name of the PCB used by this security cartridge. The cartridge's EEPROM type and presence of a DS2401 are inferred from this field.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [
|
||||
"GX700-PWB(D)",
|
||||
"GX700-PWB(E)",
|
||||
"GX700-PWB(J)",
|
||||
"GX883-PWB(D)",
|
||||
"GX894-PWB(D)",
|
||||
"GX896-PWB(A)A",
|
||||
"GE949-PWB(D)A",
|
||||
"GE949-PWB(D)B",
|
||||
"PWB0000068819",
|
||||
"PWB0000088954"
|
||||
]
|
||||
},
|
||||
"dataFormat": {
|
||||
"title": "Data format type",
|
||||
"description": "Format of the data stored in the cartridge's EEPROM. The 'simple' format is just the region string, the 'basic' format includes some additional information and the 'extended' format is the full 16-byte game header plus any IDs.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [ "simple", "basic", "extended" ]
|
||||
},
|
||||
|
||||
"traceIDType": {
|
||||
"title": "Trace ID type",
|
||||
"description": "Format of the trace ID (TID) stored in the cartridge's EEPROM. 'v1' is an arbitrary identifier assigned at manufacture time, while 'v2big' and 'v2little' are checksums derived from the SID. Omit if no trace ID is present.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [ "none", "v1", "v2big", "v2little" ]
|
||||
},
|
||||
"traceIDWidth": {
|
||||
"title": "Trace ID bit width",
|
||||
"description": "Number of bits used to calculate the checksum in the trace ID. Only valid for 'v2big' and 'v2little' trace ID types.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 16,
|
||||
"default": 16
|
||||
},
|
||||
"mediumIDValue": {
|
||||
"title": "Medium ID value",
|
||||
"description": "Value of the first byte of the medium ID (MID) stored in the EEPROM, if any (0, 1 or 2). Omit if no medium ID is present. Note that an empty (zerofilled) medium ID is different from one set to 0 due to the presence of a checksum.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 2,
|
||||
"default": 2
|
||||
},
|
||||
"hasSiliconID": {
|
||||
"title": "Silicon ID present",
|
||||
"description": "Whether or not the silicon ID (SID), i.e. the ID of the cartridge's DS2401, is stored in the EEPROM. Only valid if the cartridge PCB has a DS2401.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"hasExternalID": {
|
||||
"title": "External ID present",
|
||||
"description": "Whether or not the external ID (XID), i.e. the ID of the 573's I/O board, is stored in the EEPROM. Only valid if the game uses an I/O board with a DS2401.",
|
||||
"type": "boolean"
|
||||
},
|
||||
|
||||
"lowercaseRegion": {
|
||||
"title": "Lower case region code",
|
||||
"description": "Whether to convert the region and version code to lower case when storing it in the EEPROM. Some installation cartridges use lower case region codes.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"hasSpecification": {
|
||||
"title": "Store specification code",
|
||||
"description": "Whether or not to store the game's specification code in the EEPROM. Only valid for the 'basic' format, as the 'extended' format always includes it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"invertChecksum": {
|
||||
"title": "Invert header checksum",
|
||||
"description": "Whether to negate all bits of the header's checksum. Only valid for the 'basic' and 'extended' formats.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"gx706Workaround": {
|
||||
"title": "GX706 checksum workaround",
|
||||
"description": "If true, the specification code will be temporarily set to 'GX' when the checksum is calculated. Required by GX706, which sets the specification to 'GE' due to a bug. Only valid for the 'basic' and 'extended' formats.",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
150
schema/cdrom.json
Normal file
150
schema/cdrom.json
Normal file
@ -0,0 +1,150 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "schema/cdrom.json",
|
||||
|
||||
"title": "Root",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "entries" ],
|
||||
|
||||
"properties": {
|
||||
"identifiers": {
|
||||
"title": "ISO9660 identifier strings",
|
||||
"type": "object",
|
||||
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"system": {
|
||||
"title": "System identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"volume": {
|
||||
"title": "Volume identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"volumeSet": {
|
||||
"title": "Volume set identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"publisher": {
|
||||
"title": "Publisher identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"dataPreparer": {
|
||||
"title": "Data preparer identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"application": {
|
||||
"title": "Application identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"copyright": {
|
||||
"title": "Copyright file identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"abstract": {
|
||||
"title": "Abstract file identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"bibliographic": {
|
||||
"title": "Bibliographic file identifier",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"entries": {
|
||||
"title": "File and directory entries",
|
||||
"type": "array",
|
||||
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"title": "Entry object",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "type", "name" ],
|
||||
|
||||
"properties": {
|
||||
"type": {
|
||||
"title": "Entry type",
|
||||
"description": "Must be 'empty' (empty or zerofilled file), 'file', 'directory', 'fileAlias' or 'directoryAlias' (hard link to another entry).",
|
||||
"type": "string",
|
||||
|
||||
"enum": [
|
||||
"empty",
|
||||
"file",
|
||||
"directory",
|
||||
"fileAlias",
|
||||
"directoryAlias"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"title": "Entry path",
|
||||
"description": "Full path of the entry within the CD-ROM image. Should follow ISO9660 file name restrictions (upper case alphanumeric characters and underscores only, with an optional period-separated extension for files).",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
|
||||
"oneOf": [
|
||||
{
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "empty" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"size": {
|
||||
"title": "File size",
|
||||
"description": "Number of dummy null bytes to fill the file with. If zero or omitted, the file will be empty.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "source" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "file" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"source": {
|
||||
"title": "Path to source file",
|
||||
"description": "Path to the source file to add to the image, relative to the configuration file's directory by default.",
|
||||
"type": "string",
|
||||
|
||||
"format": "uri-reference"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "directory" },
|
||||
"name": { "type": "string" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "source" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "pattern": "^fileAlias|directoryAlias$" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"source": {
|
||||
"title": "Path to linked entry",
|
||||
"description": "Full path to the entry in the CD-ROM image this entry shall be a hard link to.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
144
schema/games.json
Normal file
144
schema/games.json
Normal file
@ -0,0 +1,144 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "schema/games.json",
|
||||
|
||||
"title": "Root",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "games" ],
|
||||
|
||||
"properties": {
|
||||
"games": {
|
||||
"title": "Game list",
|
||||
"type": "array",
|
||||
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
|
||||
"items": {
|
||||
"title": "Game entry object",
|
||||
"type": "object",
|
||||
|
||||
"required": [
|
||||
"specifications",
|
||||
"code",
|
||||
"regions",
|
||||
"name",
|
||||
"year"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"specifications": {
|
||||
"title": "Game specification list",
|
||||
"description": "List of known specification codes used by this game (GX, GE, GN and so on).",
|
||||
"type": "array",
|
||||
|
||||
"items": {
|
||||
"title": "Game specification",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^G[BCEKLNQUX]$",
|
||||
"default": "GX"
|
||||
}
|
||||
},
|
||||
"code": {
|
||||
"title": "Game code",
|
||||
"description": "The 3-digit code that uniquely identifies this game (700-999 or A00-A99 ~ D00-D99).",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^[0-9A-D][0-9][0-9]$",
|
||||
"default": "700"
|
||||
},
|
||||
"regions": {
|
||||
"title": "Game region and version list",
|
||||
"description": "List of known region and version codes used by this game. If different versions of the game have different names, specifications or hardware, each variant should be a separate entry in the game list with the same code.",
|
||||
"type": "array",
|
||||
|
||||
"items": {
|
||||
"title": "Game region and version",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^[AEJKSU][A-FR-WX-Z]([A-D]|Z[0-9][0-9])?$",
|
||||
"default": "JAA"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"title": "Game name",
|
||||
"description": "The full name of this game. Must contain ASCII characters only.",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^[ -~]+$"
|
||||
},
|
||||
"series": {
|
||||
"title": "Series name",
|
||||
"description": "The full name of the series this game belongs to, if any. Must contain ASCII characters only. Games that belong to the same series will be grouped together.",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^[ -~]+$"
|
||||
},
|
||||
"year": {
|
||||
"title": "Year",
|
||||
"description": "The year this game came out in.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 1998,
|
||||
"maximum": 2004,
|
||||
"default": 2000
|
||||
},
|
||||
"identifier": {
|
||||
"title": "MAME game identifier",
|
||||
"description": "The name used by MAME to identify this game. Omit if the game is not currently emulated by MAME.",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^[0-9a-z_]*$"
|
||||
},
|
||||
|
||||
"ioBoard": {
|
||||
"title": "I/O board PCB type",
|
||||
"description": "The I/O expansion board required by this game. Omit if the game does not need any.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [
|
||||
"GX700-PWB(F)",
|
||||
"GX700-PWB(K)",
|
||||
"GE765-PWB(B)A",
|
||||
"GX894-PWB(B)A",
|
||||
"GX921-PWB(B)",
|
||||
"PWB0000073070"
|
||||
]
|
||||
},
|
||||
"bootloaderVersion": {
|
||||
"title": "Bemani bootloader version",
|
||||
"description": "Version number of the Bemani bootloader used by this game. Omit if the game has no bootloader.",
|
||||
"type": "string",
|
||||
|
||||
"pattern": "^1\\.[0-9]+$",
|
||||
"default": "1.0"
|
||||
},
|
||||
|
||||
"rtcHeader": {
|
||||
"title": "RTC RAM header",
|
||||
"description": "Object describing the header written by the game to the first 32 bytes of RTC RAM. Omit if the game does not write a header to RTC RAM.",
|
||||
"$ref": "header.json"
|
||||
},
|
||||
"flashHeader": {
|
||||
"title": "Internal flash header",
|
||||
"description": "Object describing the header written by the game to the first 32 bytes of the internal flash memory. Omit if the game does not write a header to the flash.",
|
||||
"$ref": "header.json"
|
||||
},
|
||||
"installCartridge": {
|
||||
"title": "Installation cartridge",
|
||||
"description": "Object describing the game's installation security cartridge. Omit if the game needs no such cartridge.",
|
||||
"$ref": "cart.json"
|
||||
},
|
||||
"gameCartridge": {
|
||||
"title": "Game cartridge",
|
||||
"description": "Object describing the game's main security cartridge. Omit if the game needs no such cartridge.",
|
||||
"$ref": "cart.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
schema/header.json
Normal file
49
schema/header.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "schema/header.json",
|
||||
|
||||
"title": "Flash/RTC game header description",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "dataFormat" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"dataFormat": {
|
||||
"title": "Data format type",
|
||||
"description": "Format of the header. Currently only the 'extended' format is supported.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [ "extended" ]
|
||||
},
|
||||
|
||||
"ioBoardIDType": {
|
||||
"title": "I/O board ID type",
|
||||
"description": "Format of the I/O board ID stored as part of the header. Omit if no I/O board ID is stored.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [ "checksum", "md5" ]
|
||||
},
|
||||
|
||||
"required": {
|
||||
"title": "Header required by game",
|
||||
"description": "Whether or not the game requires the header to be present and will refuse to run if missing, rather than initializing it. Only valid for RTC RAM headers.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"specificationWildcard": {
|
||||
"title": "Use specification wildcard",
|
||||
"description": "Whether to set the specification code in the header to 'G*' instead of the game's actual specification.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"invertChecksum": {
|
||||
"title": "Invert header checksum",
|
||||
"description": "Whether to negate all bits of the header's checksum.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"gx706Workaround": {
|
||||
"title": "GX706 checksum workaround",
|
||||
"description": "If true, the specification code will be temporarily set to 'GX' when the checksum is calculated. Required by GX706, which sets the specification to 'GE' due to a bug.",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
85
schema/metrics.json
Normal file
85
schema/metrics.json
Normal file
@ -0,0 +1,85 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "schema/metrics.json",
|
||||
|
||||
"title": "Root",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "spaceWidth", "tabWidth", "lineHeight", "characterSizes" ],
|
||||
|
||||
"properties": {
|
||||
"spaceWidth": {
|
||||
"title": "Space width",
|
||||
"description": "Width of the space character in pixels.",
|
||||
"type": "integer"
|
||||
},
|
||||
"tabWidth": {
|
||||
"title": "Tab width",
|
||||
"description": "Width of the tab character in pixels.",
|
||||
"type": "integer"
|
||||
},
|
||||
"lineHeight": {
|
||||
"title": "Line height",
|
||||
"description": "Height of each line in pixels, including any padding. Note that characters whose height is lower than this value will be aligned to the top of the line, rather than the bottom.",
|
||||
"type": "integer"
|
||||
},
|
||||
|
||||
"characterSizes": {
|
||||
"title": "Character list",
|
||||
"description": "List of all glyphs in the texture. Each entry's key must be a single-character string containing a printable ASCII or extended (\\u0080-\\u00ff) character.",
|
||||
"type": "object",
|
||||
|
||||
"additionalProperties": false,
|
||||
|
||||
"patternProperties": {
|
||||
"^[ -\\u00ff]$": {
|
||||
"title": "Character metrics",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "x", "y", "width", "height" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"x": {
|
||||
"title": "X offset",
|
||||
"description": "X coordinate of the glyph's top left corner within the texture.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"y": {
|
||||
"title": "Y offset",
|
||||
"description": "Y coordinate of the glyph's top left corner within the texture.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"width": {
|
||||
"title": "Character width",
|
||||
"description": "Width of the glyph in pixels.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 127
|
||||
},
|
||||
"height": {
|
||||
"title": "Character height",
|
||||
"description": "Height of the glyph in pixels.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 127
|
||||
},
|
||||
"icon": {
|
||||
"title": "Colored icon flag",
|
||||
"description": "If true, the glyph will not be colorized when drawing colored text. Useful for glyphs that are not monochrome such as icons.",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
237
schema/resources.json
Normal file
237
schema/resources.json
Normal file
@ -0,0 +1,237 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "schema/resources.json",
|
||||
|
||||
"title": "Root",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "resources" ],
|
||||
|
||||
"properties": {
|
||||
"resources": {
|
||||
"title": "Resource archive entries",
|
||||
"type": "array",
|
||||
|
||||
"uniqueItems": true,
|
||||
|
||||
"items": {
|
||||
"title": "Entry object",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "type", "name" ],
|
||||
|
||||
"properties": {
|
||||
"type": {
|
||||
"title": "Entry type",
|
||||
"description": "Must be 'empty', 'text', 'binary', 'tim', 'metrics', 'palette' or 'strings'.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [
|
||||
"empty",
|
||||
"text",
|
||||
"binary",
|
||||
"tim",
|
||||
"metrics",
|
||||
"palette",
|
||||
"strings"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"title": "Entry path",
|
||||
"description": "Full path of the entry within the resource archive.",
|
||||
"type": "string"
|
||||
},
|
||||
"compression": {
|
||||
"title": "Compression type",
|
||||
"description": "Must be 'none', 'deflate' or 'lz4'. If unspecified, defaults to 'deflate' unless manually overridden on the command line.",
|
||||
"type": "string",
|
||||
|
||||
"enum": [ "none", "deflate", "lz4" ]
|
||||
},
|
||||
"compressLevel": {
|
||||
"title": "Compression level",
|
||||
"description": "DEFLATE or LZ4 compression level in 0-9 range, ignored for uncompressed files. If unspecified, defaults to 9 unless manually overridden on the command line.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 9,
|
||||
"default": 9
|
||||
}
|
||||
},
|
||||
|
||||
"oneOf": [
|
||||
{
|
||||
"properties": {
|
||||
"type": { "const": "empty" },
|
||||
|
||||
"size": {
|
||||
"title": "File size",
|
||||
"description": "Number of dummy null bytes to fill the file with. If zero or omitted, the file will be empty.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "source" ],
|
||||
|
||||
"properties": {
|
||||
"type": { "pattern": "^text|binary$" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"source": {
|
||||
"title": "Path to source file",
|
||||
"description": "Path to the source text or binary file, relative to the configuration file's directory by default.",
|
||||
"type": "string",
|
||||
|
||||
"format": "uri-reference"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "source", "imagePos", "clutPos" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "tim" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"source": {
|
||||
"title": "Path to source file",
|
||||
"description": "Path to the source image file, relative to the configuration file's directory by default.",
|
||||
"type": "string",
|
||||
|
||||
"format": "uri-reference"
|
||||
},
|
||||
"quantize": {
|
||||
"title": "Maximum color depth",
|
||||
"description": "Maximum number of colors to use when converting the image to indexed color. The converted file will have 8bpp color depth if this value is greater than 16 and 4bpp otherwise. Ignored if the source image is already in indexed color format.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 2,
|
||||
"maximum": 256,
|
||||
"default": 16
|
||||
},
|
||||
"imagePos": {
|
||||
"title": "VRAM coordinates of image data",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "x", "y" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"x": {
|
||||
"name": "Image X offset",
|
||||
"description": "X coordinate of the VRAM area the image will be loaded into.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 1023
|
||||
},
|
||||
"y": {
|
||||
"name": "Image Y offset",
|
||||
"description": "Y coordinate of the VRAM area the image will be loaded into.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 1023
|
||||
}
|
||||
}
|
||||
},
|
||||
"clutPos": {
|
||||
"title": "VRAM coordinates of palette data",
|
||||
"type": "object",
|
||||
|
||||
"required": [ "x", "y" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"x": {
|
||||
"name": "Palette X offset",
|
||||
"description": "X coordinate of the VRAM area the image's palette will be loaded into. Must be a multiple of 16 due to hardware limitations.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 1023,
|
||||
"multipleOf": 16
|
||||
},
|
||||
"y": {
|
||||
"name": "Palette Y offset",
|
||||
"description": "Y coordinate of the VRAM area the image's palette will be loaded into.",
|
||||
"type": "integer",
|
||||
|
||||
"minimum": 0,
|
||||
"maximum": 1023
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "source" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "pattern": "^metrics|palette|strings$" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"source": {
|
||||
"title": "Path to source file",
|
||||
"description": "Path to the JSON file containing font metrics, palette entries or strings (if such data is not part of the entry object), relative to the configuration file's directory by default.",
|
||||
"type": "string",
|
||||
|
||||
"format": "uri-reference"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "metrics" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "metrics" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"metrics": {
|
||||
"title": "Font metrics",
|
||||
"description": "Font metrics root object. If not specified, the source attribute must be a path to a JSON file containing this object.",
|
||||
"$ref": "metrics.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "palette" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "palette" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"palette": {
|
||||
"title": "Color entries",
|
||||
"description": "Object containing a list of color names and their respective RGB values. If not specified, the source attribute must be a path to a JSON file containing this object.",
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [ "strings" ],
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"type": { "const": "strings" },
|
||||
"name": { "type": "string" },
|
||||
|
||||
"strings": {
|
||||
"title": "String table",
|
||||
"description": "Object representing the string table's keys and values. If not specified, the source attribute must be a path to a JSON file containing this object.",
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -241,6 +241,12 @@ def main():
|
||||
)
|
||||
isoEntries.append(iso.inodes[-1])
|
||||
|
||||
case "directory":
|
||||
name: str = normalizePath(entry["name"], True)
|
||||
|
||||
iso.add_directory(iso_path = name)
|
||||
isoEntries.append(iso.get_record(iso_path = name))
|
||||
|
||||
case "fileAlias":
|
||||
iso.add_hard_link(
|
||||
iso_old_path = normalizePath(entry["source"]),
|
||||
@ -253,12 +259,6 @@ def main():
|
||||
iso_new_path = normalizePath(entry["name"], True)
|
||||
)
|
||||
|
||||
case "directory":
|
||||
name: str = normalizePath(entry["name"], True)
|
||||
|
||||
iso.add_directory(iso_path = name)
|
||||
isoEntries.append(iso.get_record(iso_path = name))
|
||||
|
||||
case _type:
|
||||
raise KeyError(f"unsupported entry type '{_type}'")
|
||||
|
||||
|
@ -57,9 +57,9 @@ def createParser() -> ArgumentParser:
|
||||
metavar = "dir"
|
||||
)
|
||||
group.add_argument(
|
||||
"resourceList",
|
||||
"configFile",
|
||||
type = FileType("rt"),
|
||||
help = "Path to JSON resource list",
|
||||
help = "Path to JSON configuration file",
|
||||
)
|
||||
group.add_argument(
|
||||
"output",
|
||||
@ -73,16 +73,18 @@ def main():
|
||||
parser: ArgumentParser = createParser()
|
||||
args: Namespace = parser.parse_args()
|
||||
|
||||
with args.resourceList as _file:
|
||||
assetList: list[dict[str, Any]] = json.load(_file)
|
||||
sourceDir: Path = \
|
||||
with args.configFile as _file:
|
||||
configFile: dict[str, Any] = json.load(_file)
|
||||
sourceDir: Path = \
|
||||
args.source_dir or Path(_file.name).parent
|
||||
|
||||
assetList: list[dict[str, Any]] = configFile["resources"]
|
||||
|
||||
with ZipFile(args.output, "w", allowZip64 = False) as _zip:
|
||||
for asset in assetList:
|
||||
match asset.get("type", "file").strip():
|
||||
case "empty":
|
||||
data: ByteString = b""
|
||||
data: ByteString = bytes(int(asset.get("size", 0)))
|
||||
|
||||
case "text":
|
||||
with open(sourceDir / asset["source"], "rt") as _file:
|
||||
|
Loading…
x
Reference in New Issue
Block a user