/*
 * SuperFX table initialisation, from chips/fxtable.asm. InitFxTables() runs
 * once from initc.c and fills the opcode dispatch tables, the PLOT jump
 * tables, the bit-expansion lookups, the screen-line offsets and the memory
 * map. Handlers are the bodies in chips/fx_ops.h; the tables hold raw
 * addresses in endmem.c's u4 arrays, and CMODE patches entry $4C at run time.
 *
 * MainLoop threads the d table, whose bodies are the base table's except STOP
 * and the 8bpp dithered PLOT variants, which the assembly wired to the
 * undithered code.
 */
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

#include "../endmem.h"
#include "../types.h"
#include "../ui.h" /* romdata, sfxramdata */
#include "fxtable.h"

typedef void fxop(void);

extern fxop c_FxOp00, c_FxOp01, c_FxOp02, c_FxOp03, c_FxOp04, c_FxOp05, c_FxOp06, c_FxOp07, c_FxOp08, c_FxOp09, c_FxOp0A;
extern fxop c_FxOp0B, c_FxOp0C, c_FxOp0D, c_FxOp0E, c_FxOp0F, c_FxOp10, c_FxOp11, c_FxOp12, c_FxOp13, c_FxOp14, c_FxOp15;
extern fxop c_FxOp16, c_FxOp17, c_FxOp18, c_FxOp19, c_FxOp1A, c_FxOp1B, c_FxOp1C, c_FxOp1D, c_FxOp1E, c_FxOp1F, c_FxOp20;
extern fxop c_FxOp21, c_FxOp22, c_FxOp23, c_FxOp24, c_FxOp25, c_FxOp26, c_FxOp27, c_FxOp28, c_FxOp29, c_FxOp2A, c_FxOp2B;
extern fxop c_FxOp2C, c_FxOp2D, c_FxOp2E, c_FxOp2F, c_FxOp30, c_FxOp30A1, c_FxOp31, c_FxOp31A1, c_FxOp32, c_FxOp32A1, c_FxOp33;
extern fxop c_FxOp33A1, c_FxOp34, c_FxOp34A1, c_FxOp35, c_FxOp35A1, c_FxOp36, c_FxOp36A1, c_FxOp37, c_FxOp37A1, c_FxOp38;
extern fxop c_FxOp38A1, c_FxOp39, c_FxOp39A1, c_FxOp3A, c_FxOp3AA1, c_FxOp3B, c_FxOp3BA1, c_FxOp3C, c_FxOp3D, c_FxOp3E;
extern fxop c_FxOp3F, c_FxOp40, c_FxOp40A1, c_FxOp41, c_FxOp41A1, c_FxOp42, c_FxOp42A1, c_FxOp43, c_FxOp43A1, c_FxOp44;
extern fxop c_FxOp44A1, c_FxOp45, c_FxOp45A1, c_FxOp46, c_FxOp46A1, c_FxOp47, c_FxOp47A1, c_FxOp48, c_FxOp48A1, c_FxOp49;
extern fxop c_FxOp49A1, c_FxOp4A, c_FxOp4AA1, c_FxOp4B, c_FxOp4BA1, c_FxOp4C, c_FxOp4C1282b, c_FxOp4C1282bd, c_FxOp4C1282bz;
extern fxop c_FxOp4C1282bzd, c_FxOp4C1284b, c_FxOp4C1284bd, c_FxOp4C1284bz, c_FxOp4C1284bzd, c_FxOp4C1288b, c_FxOp4C1288bd;
extern fxop c_FxOp4C1288bdl, c_FxOp4C1288bl, c_FxOp4C1288bz, c_FxOp4C1288bzd, c_FxOp4C1288bzdl, c_FxOp4C1288bzl;
extern fxop c_FxOp4CA1, c_FxOp4D, c_FxOp4E, c_FxOp4EA1, c_FxOp4F, c_FxOp50, c_FxOp50A1, c_FxOp50A2, c_FxOp50A3, c_FxOp51;
extern fxop c_FxOp51A1, c_FxOp51A2, c_FxOp51A3, c_FxOp52, c_FxOp52A1, c_FxOp52A2, c_FxOp52A3, c_FxOp53, c_FxOp53A1, c_FxOp53A2;
extern fxop c_FxOp53A3, c_FxOp54, c_FxOp54A1, c_FxOp54A2, c_FxOp54A3, c_FxOp55, c_FxOp55A1, c_FxOp55A2, c_FxOp55A3, c_FxOp56;
extern fxop c_FxOp56A1, c_FxOp56A2, c_FxOp56A3, c_FxOp57, c_FxOp57A1, c_FxOp57A2, c_FxOp57A3, c_FxOp58, c_FxOp58A1, c_FxOp58A2;
extern fxop c_FxOp58A3, c_FxOp59, c_FxOp59A1, c_FxOp59A2, c_FxOp59A3, c_FxOp5A, c_FxOp5AA1, c_FxOp5AA2, c_FxOp5AA3, c_FxOp5B;
extern fxop c_FxOp5BA1, c_FxOp5BA2, c_FxOp5BA3, c_FxOp5C, c_FxOp5CA1, c_FxOp5CA2, c_FxOp5CA3, c_FxOp5D, c_FxOp5DA1, c_FxOp5DA2;
extern fxop c_FxOp5DA3, c_FxOp5E, c_FxOp5EA1, c_FxOp5EA2, c_FxOp5EA3, c_FxOp5F, c_FxOp5FA1, c_FxOp5FA2, c_FxOp5FA3, c_FxOp60;
extern fxop c_FxOp60A1, c_FxOp60A2, c_FxOp60A3, c_FxOp61, c_FxOp61A1, c_FxOp61A2, c_FxOp61A3, c_FxOp62, c_FxOp62A1, c_FxOp62A2;
extern fxop c_FxOp62A3, c_FxOp63, c_FxOp63A1, c_FxOp63A2, c_FxOp63A3, c_FxOp64, c_FxOp64A1, c_FxOp64A2, c_FxOp64A3, c_FxOp65;
extern fxop c_FxOp65A1, c_FxOp65A2, c_FxOp65A3, c_FxOp66, c_FxOp66A1, c_FxOp66A2, c_FxOp66A3, c_FxOp67, c_FxOp67A1, c_FxOp67A2;
extern fxop c_FxOp67A3, c_FxOp68, c_FxOp68A1, c_FxOp68A2, c_FxOp68A3, c_FxOp69, c_FxOp69A1, c_FxOp69A2, c_FxOp69A3, c_FxOp6A;
extern fxop c_FxOp6AA1, c_FxOp6AA2, c_FxOp6AA3, c_FxOp6B, c_FxOp6BA1, c_FxOp6BA2, c_FxOp6BA3, c_FxOp6C, c_FxOp6CA1, c_FxOp6CA2;
extern fxop c_FxOp6CA3, c_FxOp6D, c_FxOp6DA1, c_FxOp6DA2, c_FxOp6DA3, c_FxOp6E, c_FxOp6EA1, c_FxOp6EA2, c_FxOp6EA3, c_FxOp6F;
extern fxop c_FxOp6FA1, c_FxOp6FA2, c_FxOp6FA3, c_FxOp70, c_FxOp71, c_FxOp71A1, c_FxOp71A2, c_FxOp71A3, c_FxOp72, c_FxOp72A1;
extern fxop c_FxOp72A2, c_FxOp72A3, c_FxOp73, c_FxOp73A1, c_FxOp73A2, c_FxOp73A3, c_FxOp74, c_FxOp74A1, c_FxOp74A2, c_FxOp74A3;
extern fxop c_FxOp75, c_FxOp75A1, c_FxOp75A2, c_FxOp75A3, c_FxOp76, c_FxOp76A1, c_FxOp76A2, c_FxOp76A3, c_FxOp77, c_FxOp77A1;
extern fxop c_FxOp77A2, c_FxOp77A3, c_FxOp78, c_FxOp78A1, c_FxOp78A2, c_FxOp78A3, c_FxOp79, c_FxOp79A1, c_FxOp79A2, c_FxOp79A3;
extern fxop c_FxOp7A, c_FxOp7AA1, c_FxOp7AA2, c_FxOp7AA3, c_FxOp7B, c_FxOp7BA1, c_FxOp7BA2, c_FxOp7BA3, c_FxOp7C, c_FxOp7CA1;
extern fxop c_FxOp7CA2, c_FxOp7CA3, c_FxOp7D, c_FxOp7DA1, c_FxOp7DA2, c_FxOp7DA3, c_FxOp7E, c_FxOp7EA1, c_FxOp7EA2, c_FxOp7EA3;
extern fxop c_FxOp7F, c_FxOp7FA1, c_FxOp7FA2, c_FxOp7FA3, c_FxOp80, c_FxOp80A1, c_FxOp80A2, c_FxOp80A3, c_FxOp81, c_FxOp81A1;
extern fxop c_FxOp81A2, c_FxOp81A3, c_FxOp82, c_FxOp82A1, c_FxOp82A2, c_FxOp82A3, c_FxOp83, c_FxOp83A1, c_FxOp83A2, c_FxOp83A3;
extern fxop c_FxOp84, c_FxOp84A1, c_FxOp84A2, c_FxOp84A3, c_FxOp85, c_FxOp85A1, c_FxOp85A2, c_FxOp85A3, c_FxOp86, c_FxOp86A1;
extern fxop c_FxOp86A2, c_FxOp86A3, c_FxOp87, c_FxOp87A1, c_FxOp87A2, c_FxOp87A3, c_FxOp88, c_FxOp88A1, c_FxOp88A2, c_FxOp88A3;
extern fxop c_FxOp89, c_FxOp89A1, c_FxOp89A2, c_FxOp89A3, c_FxOp8A, c_FxOp8AA1, c_FxOp8AA2, c_FxOp8AA3, c_FxOp8B, c_FxOp8BA1;
extern fxop c_FxOp8BA2, c_FxOp8BA3, c_FxOp8C, c_FxOp8CA1, c_FxOp8CA2, c_FxOp8CA3, c_FxOp8D, c_FxOp8DA1, c_FxOp8DA2, c_FxOp8DA3;
extern fxop c_FxOp8E, c_FxOp8EA1, c_FxOp8EA2, c_FxOp8EA3, c_FxOp8F, c_FxOp8FA1, c_FxOp8FA2, c_FxOp8FA3, c_FxOp90, c_FxOp91;
extern fxop c_FxOp92, c_FxOp93, c_FxOp94, c_FxOp95, c_FxOp96, c_FxOp96A1, c_FxOp97, c_FxOp98, c_FxOp98A1, c_FxOp99, c_FxOp99A1;
extern fxop c_FxOp9A, c_FxOp9AA1, c_FxOp9B, c_FxOp9BA1, c_FxOp9C, c_FxOp9CA1, c_FxOp9D, c_FxOp9DA1, c_FxOp9E, c_FxOp9F;
extern fxop c_FxOp9FA1, c_FxOpA0, c_FxOpA0A1, c_FxOpA0A2, c_FxOpA1, c_FxOpA1A1, c_FxOpA1A2, c_FxOpA2, c_FxOpA2A1, c_FxOpA2A2;
extern fxop c_FxOpA3, c_FxOpA3A1, c_FxOpA3A2, c_FxOpA4, c_FxOpA4A1, c_FxOpA4A2, c_FxOpA5, c_FxOpA5A1, c_FxOpA5A2, c_FxOpA6;
extern fxop c_FxOpA6A1, c_FxOpA6A2, c_FxOpA7, c_FxOpA7A1, c_FxOpA7A2, c_FxOpA8, c_FxOpA8A1, c_FxOpA8A2, c_FxOpA9, c_FxOpA9A1;
extern fxop c_FxOpA9A2, c_FxOpAA, c_FxOpAAA1, c_FxOpAAA2, c_FxOpAB, c_FxOpABA1, c_FxOpABA2, c_FxOpAC, c_FxOpACA1, c_FxOpACA2;
extern fxop c_FxOpAD, c_FxOpADA1, c_FxOpADA2, c_FxOpAE, c_FxOpAEA1, c_FxOpAEA2, c_FxOpAF, c_FxOpAFA1, c_FxOpAFA2, c_FxOpB0;
extern fxop c_FxOpB1, c_FxOpB2, c_FxOpB3, c_FxOpB4, c_FxOpB5, c_FxOpB6, c_FxOpB7, c_FxOpB8, c_FxOpB9, c_FxOpBA, c_FxOpBB;
extern fxop c_FxOpBC, c_FxOpBD, c_FxOpBE, c_FxOpBF, c_FxOpC0, c_FxOpC1, c_FxOpC1A1, c_FxOpC1A2, c_FxOpC1A3, c_FxOpC2, c_FxOpC2A1;
extern fxop c_FxOpC2A2, c_FxOpC2A3, c_FxOpC3, c_FxOpC3A1, c_FxOpC3A2, c_FxOpC3A3, c_FxOpC4, c_FxOpC4A1, c_FxOpC4A2, c_FxOpC4A3;
extern fxop c_FxOpC5, c_FxOpC5A1, c_FxOpC5A2, c_FxOpC5A3, c_FxOpC6, c_FxOpC6A1, c_FxOpC6A2, c_FxOpC6A3, c_FxOpC7, c_FxOpC7A1;
extern fxop c_FxOpC7A2, c_FxOpC7A3, c_FxOpC8, c_FxOpC8A1, c_FxOpC8A2, c_FxOpC8A3, c_FxOpC9, c_FxOpC9A1, c_FxOpC9A2, c_FxOpC9A3;
extern fxop c_FxOpCA, c_FxOpCAA1, c_FxOpCAA2, c_FxOpCAA3, c_FxOpCB, c_FxOpCBA1, c_FxOpCBA2, c_FxOpCBA3, c_FxOpCC, c_FxOpCCA1;
extern fxop c_FxOpCCA2, c_FxOpCCA3, c_FxOpCD, c_FxOpCDA1, c_FxOpCDA2, c_FxOpCDA3, c_FxOpCE, c_FxOpCEA1, c_FxOpCEA2, c_FxOpCEA3;
extern fxop c_FxOpCF, c_FxOpCFA1, c_FxOpCFA2, c_FxOpCFA3, c_FxOpD0, c_FxOpD1, c_FxOpD2, c_FxOpD3, c_FxOpD4, c_FxOpD5, c_FxOpD6;
extern fxop c_FxOpD7, c_FxOpD8, c_FxOpD9, c_FxOpDA, c_FxOpDB, c_FxOpDC, c_FxOpDD, c_FxOpDE, c_FxOpDF, c_FxOpDFA2, c_FxOpDFA3;
extern fxop c_FxOpE0, c_FxOpE1, c_FxOpE2, c_FxOpE3, c_FxOpE4, c_FxOpE5, c_FxOpE6, c_FxOpE7, c_FxOpE8, c_FxOpE9, c_FxOpEA;
extern fxop c_FxOpEB, c_FxOpEC, c_FxOpED, c_FxOpEE, c_FxOpEF, c_FxOpEFA1, c_FxOpEFA2, c_FxOpEFA3, c_FxOpF0, c_FxOpF0A1;
extern fxop c_FxOpF0A2, c_FxOpF1, c_FxOpF1A1, c_FxOpF1A2, c_FxOpF2, c_FxOpF2A1, c_FxOpF2A2, c_FxOpF3, c_FxOpF3A1, c_FxOpF3A2;
extern fxop c_FxOpF4, c_FxOpF4A1, c_FxOpF4A2, c_FxOpF5, c_FxOpF5A1, c_FxOpF5A2, c_FxOpF6, c_FxOpF6A1, c_FxOpF6A2, c_FxOpF7;
extern fxop c_FxOpF7A1, c_FxOpF7A2, c_FxOpF8, c_FxOpF8A1, c_FxOpF8A2, c_FxOpF9, c_FxOpF9A1, c_FxOpF9A2, c_FxOpFA, c_FxOpFAA1;
extern fxop c_FxOpFAA2, c_FxOpFB, c_FxOpFBA1, c_FxOpFBA2, c_FxOpFC, c_FxOpFCA1, c_FxOpFCA2, c_FxOpFD, c_FxOpFDA1, c_FxOpFDA2;
extern fxop c_FxOpFE, c_FxOpFEA1, c_FxOpFEA2, c_FxOpFF, c_FxOpFFA1, c_FxOpFFA2, c_FxOpb05, c_FxOpb06, c_FxOpb07, c_FxOpb08;
extern fxop c_FxOpb09, c_FxOpb0A, c_FxOpb0B, c_FxOpb0C, c_FxOpb0D, c_FxOpb0E, c_FxOpb0F, c_FxOpb10, c_FxOpb11, c_FxOpb12;
extern fxop c_FxOpb13, c_FxOpb14, c_FxOpb15, c_FxOpb16, c_FxOpb17, c_FxOpb18, c_FxOpb19, c_FxOpb1A, c_FxOpb1B, c_FxOpb1C;
extern fxop c_FxOpb1D, c_FxOpb1E, c_FxOpb1F, c_FxOpb3D, c_FxOpb3E, c_FxOpb3F, c_FxOpbB0, c_FxOpbB1, c_FxOpbB2, c_FxOpbB3;
extern fxop c_FxOpbB4, c_FxOpbB5, c_FxOpbB6, c_FxOpbB7, c_FxOpbB8, c_FxOpbB9, c_FxOpbBA, c_FxOpbBB, c_FxOpbBC, c_FxOpbBD;
extern fxop c_FxOpbBE, c_FxOpbBF, c_FxOpc05, c_FxOpc06, c_FxOpc07, c_FxOpc08, c_FxOpc09, c_FxOpc0A, c_FxOpc0B, c_FxOpc0C;
extern fxop c_FxOpc0D, c_FxOpc0E, c_FxOpc0F, c_FxOpc10, c_FxOpc11, c_FxOpc12, c_FxOpc13, c_FxOpc14, c_FxOpc15, c_FxOpc16;
extern fxop c_FxOpc17, c_FxOpc18, c_FxOpc19, c_FxOpc1A, c_FxOpc1B, c_FxOpc1C, c_FxOpc1D, c_FxOpc1E, c_FxOpc1F, c_FxOpc3D;
extern fxop c_FxOpc3E, c_FxOpc3F, c_FxOpcB0, c_FxOpcB1, c_FxOpcB2, c_FxOpcB3, c_FxOpcB4, c_FxOpcB5, c_FxOpcB6, c_FxOpcB7;
extern fxop c_FxOpcB8, c_FxOpcB9, c_FxOpcBA, c_FxOpcBB, c_FxOpcBC, c_FxOpcBD, c_FxOpcBE, c_FxOpcBF, c_FxOpd00, c_FxOp01;
extern fxop c_FxOp02, c_FxOp03, c_FxOp04, c_FxOp05, c_FxOp06, c_FxOp07, c_FxOp08, c_FxOp09, c_FxOp0A, c_FxOp0B;
extern fxop c_FxOp0C, c_FxOp0D, c_FxOp0E, c_FxOp0F, c_FxOp10, c_FxOp11, c_FxOp12, c_FxOp13, c_FxOp14, c_FxOp15;
extern fxop c_FxOp16, c_FxOp17, c_FxOp18, c_FxOp19, c_FxOp1A, c_FxOp1B, c_FxOp1C, c_FxOp1D, c_FxOp1E, c_FxOp1F;
extern fxop c_FxOp20, c_FxOp21, c_FxOp22, c_FxOp23, c_FxOp24, c_FxOp25, c_FxOp26, c_FxOp27, c_FxOp28, c_FxOp29;
extern fxop c_FxOp2A, c_FxOp2B, c_FxOp2C, c_FxOp2D, c_FxOp2E, c_FxOp2F, c_FxOp30, c_FxOp30A1, c_FxOp31, c_FxOp31A1;
extern fxop c_FxOp32, c_FxOp32A1, c_FxOp33, c_FxOp33A1, c_FxOp34, c_FxOp34A1, c_FxOp35, c_FxOp35A1, c_FxOp36;
extern fxop c_FxOp36A1, c_FxOp37, c_FxOp37A1, c_FxOp38, c_FxOp38A1, c_FxOp39, c_FxOp39A1, c_FxOp3A, c_FxOp3AA1;
extern fxop c_FxOp3B, c_FxOp3BA1, c_FxOp3C, c_FxOp3D, c_FxOp3E, c_FxOp3F, c_FxOp40, c_FxOp40A1, c_FxOp41, c_FxOp41A1;
extern fxop c_FxOp42, c_FxOp42A1, c_FxOp43, c_FxOp43A1, c_FxOp44, c_FxOp44A1, c_FxOp45, c_FxOp45A1, c_FxOp46;
extern fxop c_FxOp46A1, c_FxOp47, c_FxOp47A1, c_FxOp48, c_FxOp48A1, c_FxOp49, c_FxOp49A1, c_FxOp4A, c_FxOp4AA1;
extern fxop c_FxOp4B, c_FxOp4BA1, c_FxOp4C1284b, c_FxOp4C1282b, c_FxOp4C1282bd, c_FxOp4C1282bz, c_FxOp4C1282bzd;
extern fxop c_FxOp4C1284b, c_FxOp4C1284bd, c_FxOp4C1284bz, c_FxOp4C1284bzd, c_FxOp4C1288b, c_FxOp4C1288b;
extern fxop c_FxOp4C1288bl, c_FxOp4C1288bl, c_FxOp4C1288bz, c_FxOp4C1288bz, c_FxOp4C1288bzl, c_FxOp4C1288bzl;
extern fxop c_FxOp4CA1, c_FxOp4D, c_FxOp4E, c_FxOp4EA1, c_FxOp4F, c_FxOp50, c_FxOp50A1, c_FxOp50A2, c_FxOp50A3;
extern fxop c_FxOp51, c_FxOp51A1, c_FxOp51A2, c_FxOp51A3, c_FxOp52, c_FxOp52A1, c_FxOp52A2, c_FxOp52A3, c_FxOp53;
extern fxop c_FxOp53A1, c_FxOp53A2, c_FxOp53A3, c_FxOp54, c_FxOp54A1, c_FxOp54A2, c_FxOp54A3, c_FxOp55, c_FxOp55A1;
extern fxop c_FxOp55A2, c_FxOp55A3, c_FxOp56, c_FxOp56A1, c_FxOp56A2, c_FxOp56A3, c_FxOp57, c_FxOp57A1, c_FxOp57A2;
extern fxop c_FxOp57A3, c_FxOp58, c_FxOp58A1, c_FxOp58A2, c_FxOp58A3, c_FxOp59, c_FxOp59A1, c_FxOp59A2, c_FxOp59A3;
extern fxop c_FxOp5A, c_FxOp5AA1, c_FxOp5AA2, c_FxOp5AA3, c_FxOp5B, c_FxOp5BA1, c_FxOp5BA2, c_FxOp5BA3, c_FxOp5C;
extern fxop c_FxOp5CA1, c_FxOp5CA2, c_FxOp5CA3, c_FxOp5D, c_FxOp5DA1, c_FxOp5DA2, c_FxOp5DA3, c_FxOp5E, c_FxOp5EA1;
extern fxop c_FxOp5EA2, c_FxOp5EA3, c_FxOp5F, c_FxOp5FA1, c_FxOp5FA2, c_FxOp5FA3, c_FxOp60, c_FxOp60A1, c_FxOp60A2;
extern fxop c_FxOp60A3, c_FxOp61, c_FxOp61A1, c_FxOp61A2, c_FxOp61A3, c_FxOp62, c_FxOp62A1, c_FxOp62A2, c_FxOp62A3;
extern fxop c_FxOp63, c_FxOp63A1, c_FxOp63A2, c_FxOp63A3, c_FxOp64, c_FxOp64A1, c_FxOp64A2, c_FxOp64A3, c_FxOp65;
extern fxop c_FxOp65A1, c_FxOp65A2, c_FxOp65A3, c_FxOp66, c_FxOp66A1, c_FxOp66A2, c_FxOp66A3, c_FxOp67, c_FxOp67A1;
extern fxop c_FxOp67A2, c_FxOp67A3, c_FxOp68, c_FxOp68A1, c_FxOp68A2, c_FxOp68A3, c_FxOp69, c_FxOp69A1, c_FxOp69A2;
extern fxop c_FxOp69A3, c_FxOp6A, c_FxOp6AA1, c_FxOp6AA2, c_FxOp6AA3, c_FxOp6B, c_FxOp6BA1, c_FxOp6BA2, c_FxOp6BA3;
extern fxop c_FxOp6C, c_FxOp6CA1, c_FxOp6CA2, c_FxOp6CA3, c_FxOp6D, c_FxOp6DA1, c_FxOp6DA2, c_FxOp6DA3, c_FxOp6E;
extern fxop c_FxOp6EA1, c_FxOp6EA2, c_FxOp6EA3, c_FxOp6F, c_FxOp6FA1, c_FxOp6FA2, c_FxOp6FA3, c_FxOp70, c_FxOp71;
extern fxop c_FxOp71A1, c_FxOp71A2, c_FxOp71A3, c_FxOp72, c_FxOp72A1, c_FxOp72A2, c_FxOp72A3, c_FxOp73, c_FxOp73A1;
extern fxop c_FxOp73A2, c_FxOp73A3, c_FxOp74, c_FxOp74A1, c_FxOp74A2, c_FxOp74A3, c_FxOp75, c_FxOp75A1, c_FxOp75A2;
extern fxop c_FxOp75A3, c_FxOp76, c_FxOp76A1, c_FxOp76A2, c_FxOp76A3, c_FxOp77, c_FxOp77A1, c_FxOp77A2, c_FxOp77A3;
extern fxop c_FxOp78, c_FxOp78A1, c_FxOp78A2, c_FxOp78A3, c_FxOp79, c_FxOp79A1, c_FxOp79A2, c_FxOp79A3, c_FxOp7A;
extern fxop c_FxOp7AA1, c_FxOp7AA2, c_FxOp7AA3, c_FxOp7B, c_FxOp7BA1, c_FxOp7BA2, c_FxOp7BA3, c_FxOp7C, c_FxOp7CA1;
extern fxop c_FxOp7CA2, c_FxOp7CA3, c_FxOp7D, c_FxOp7DA1, c_FxOp7DA2, c_FxOp7DA3, c_FxOp7E, c_FxOp7EA1, c_FxOp7EA2;
extern fxop c_FxOp7EA3, c_FxOp7F, c_FxOp7FA1, c_FxOp7FA2, c_FxOp7FA3, c_FxOp80, c_FxOp80A1, c_FxOp80A2, c_FxOp80A3;
extern fxop c_FxOp81, c_FxOp81A1, c_FxOp81A2, c_FxOp81A3, c_FxOp82, c_FxOp82A1, c_FxOp82A2, c_FxOp82A3, c_FxOp83;
extern fxop c_FxOp83A1, c_FxOp83A2, c_FxOp83A3, c_FxOp84, c_FxOp84A1, c_FxOp84A2, c_FxOp84A3, c_FxOp85, c_FxOp85A1;
extern fxop c_FxOp85A2, c_FxOp85A3, c_FxOp86, c_FxOp86A1, c_FxOp86A2, c_FxOp86A3, c_FxOp87, c_FxOp87A1, c_FxOp87A2;
extern fxop c_FxOp87A3, c_FxOp88, c_FxOp88A1, c_FxOp88A2, c_FxOp88A3, c_FxOp89, c_FxOp89A1, c_FxOp89A2, c_FxOp89A3;
extern fxop c_FxOp8A, c_FxOp8AA1, c_FxOp8AA2, c_FxOp8AA3, c_FxOp8B, c_FxOp8BA1, c_FxOp8BA2, c_FxOp8BA3, c_FxOp8C;
extern fxop c_FxOp8CA1, c_FxOp8CA2, c_FxOp8CA3, c_FxOp8D, c_FxOp8DA1, c_FxOp8DA2, c_FxOp8DA3, c_FxOp8E, c_FxOp8EA1;
extern fxop c_FxOp8EA2, c_FxOp8EA3, c_FxOp8F, c_FxOp8FA1, c_FxOp8FA2, c_FxOp8FA3, c_FxOp90, c_FxOp91, c_FxOp92;
extern fxop c_FxOp93, c_FxOp94, c_FxOp95, c_FxOp96, c_FxOp96A1, c_FxOp97, c_FxOp98, c_FxOp98A1, c_FxOp99, c_FxOp99A1;
extern fxop c_FxOp9A, c_FxOp9AA1, c_FxOp9B, c_FxOp9BA1, c_FxOp9C, c_FxOp9CA1, c_FxOp9D, c_FxOp9DA1, c_FxOp9E;
extern fxop c_FxOp9F, c_FxOp9FA1, c_FxOpA0, c_FxOpA0A1, c_FxOpA0A2, c_FxOpA1, c_FxOpA1A1, c_FxOpA1A2, c_FxOpA2;
extern fxop c_FxOpA2A1, c_FxOpA2A2, c_FxOpA3, c_FxOpA3A1, c_FxOpA3A2, c_FxOpA4, c_FxOpA4A1, c_FxOpA4A2, c_FxOpA5;
extern fxop c_FxOpA5A1, c_FxOpA5A2, c_FxOpA6, c_FxOpA6A1, c_FxOpA6A2, c_FxOpA7, c_FxOpA7A1, c_FxOpA7A2, c_FxOpA8;
extern fxop c_FxOpA8A1, c_FxOpA8A2, c_FxOpA9, c_FxOpA9A1, c_FxOpA9A2, c_FxOpAA, c_FxOpAAA1, c_FxOpAAA2, c_FxOpAB;
extern fxop c_FxOpABA1, c_FxOpABA2, c_FxOpAC, c_FxOpACA1, c_FxOpACA2, c_FxOpAD, c_FxOpADA1, c_FxOpADA2, c_FxOpAE;
extern fxop c_FxOpAEA1, c_FxOpAEA2, c_FxOpAF, c_FxOpAFA1, c_FxOpAFA2, c_FxOpB0, c_FxOpB1, c_FxOpB2, c_FxOpB3;
extern fxop c_FxOpB4, c_FxOpB5, c_FxOpB6, c_FxOpB7, c_FxOpB8, c_FxOpB9, c_FxOpBA, c_FxOpBB, c_FxOpBC, c_FxOpBD;
extern fxop c_FxOpBE, c_FxOpBF, c_FxOpC0, c_FxOpC1, c_FxOpC1A1, c_FxOpC1A2, c_FxOpC1A3, c_FxOpC2, c_FxOpC2A1;
extern fxop c_FxOpC2A2, c_FxOpC2A3, c_FxOpC3, c_FxOpC3A1, c_FxOpC3A2, c_FxOpC3A3, c_FxOpC4, c_FxOpC4A1, c_FxOpC4A2;
extern fxop c_FxOpC4A3, c_FxOpC5, c_FxOpC5A1, c_FxOpC5A2, c_FxOpC5A3, c_FxOpC6, c_FxOpC6A1, c_FxOpC6A2, c_FxOpC6A3;
extern fxop c_FxOpC7, c_FxOpC7A1, c_FxOpC7A2, c_FxOpC7A3, c_FxOpC8, c_FxOpC8A1, c_FxOpC8A2, c_FxOpC8A3, c_FxOpC9;
extern fxop c_FxOpC9A1, c_FxOpC9A2, c_FxOpC9A3, c_FxOpCA, c_FxOpCAA1, c_FxOpCAA2, c_FxOpCAA3, c_FxOpCB, c_FxOpCBA1;
extern fxop c_FxOpCBA2, c_FxOpCBA3, c_FxOpCC, c_FxOpCCA1, c_FxOpCCA2, c_FxOpCCA3, c_FxOpCD, c_FxOpCDA1, c_FxOpCDA2;
extern fxop c_FxOpCDA3, c_FxOpCE, c_FxOpCEA1, c_FxOpCEA2, c_FxOpCEA3, c_FxOpCF, c_FxOpCFA1, c_FxOpCFA2, c_FxOpCFA3;
extern fxop c_FxOpD0, c_FxOpD1, c_FxOpD2, c_FxOpD3, c_FxOpD4, c_FxOpD5, c_FxOpD6, c_FxOpD7, c_FxOpD8, c_FxOpD9;
extern fxop c_FxOpDA, c_FxOpDB, c_FxOpDC, c_FxOpDD, c_FxOpDE, c_FxOpDF, c_FxOpDFA2, c_FxOpDFA3, c_FxOpE0, c_FxOpE1;
extern fxop c_FxOpE2, c_FxOpE3, c_FxOpE4, c_FxOpE5, c_FxOpE6, c_FxOpE7, c_FxOpE8, c_FxOpE9, c_FxOpEA, c_FxOpEB;
extern fxop c_FxOpEC, c_FxOpED, c_FxOpEE, c_FxOpEF, c_FxOpEFA1, c_FxOpEFA2, c_FxOpEFA3, c_FxOpF0, c_FxOpF0A1;
extern fxop c_FxOpF0A2, c_FxOpF1, c_FxOpF1A1, c_FxOpF1A2, c_FxOpF2, c_FxOpF2A1, c_FxOpF2A2, c_FxOpF3, c_FxOpF3A1;
extern fxop c_FxOpF3A2, c_FxOpF4, c_FxOpF4A1, c_FxOpF4A2, c_FxOpF5, c_FxOpF5A1, c_FxOpF5A2, c_FxOpF6, c_FxOpF6A1;
extern fxop c_FxOpF6A2, c_FxOpF7, c_FxOpF7A1, c_FxOpF7A2, c_FxOpF8, c_FxOpF8A1, c_FxOpF8A2, c_FxOpF9, c_FxOpF9A1;
extern fxop c_FxOpF9A2, c_FxOpFA, c_FxOpFAA1, c_FxOpFAA2, c_FxOpFB, c_FxOpFBA1, c_FxOpFBA2, c_FxOpFC, c_FxOpFCA1;
extern fxop c_FxOpFCA2, c_FxOpFD, c_FxOpFDA1, c_FxOpFDA2, c_FxOpFE, c_FxOpFEA1, c_FxOpFEA2, c_FxOpFF, c_FxOpFFA1;
extern fxop c_FxOpFFA2;

/* Where the SuperFX screen-line offset tables ended up in SuperFX RAM. */
zreg sfx128lineloc, sfx160lineloc, sfx192lineloc, sfxobjlineloc;

/* SuperFX disassembly mnemonics, eight characters per entry, indexed by opcode
 * and ALT mode. The assembly stored them packed 8 bytes apart; nothing reads
 * the table today, so this keeps the strings NUL-terminated instead. */
char const sfxnametab[1024][9] = {
    "STOP    ",
    "NOP     ",
    "CACHE   ",
    "LSR     ",
    "ROL     ",
    "BRA     ",
    "BLT     ",
    "BGE     ",
    "BNE     ",
    "BEQ     ",
    "BPL     ",
    "BMI     ",
    "BCC     ",
    "BCS     ",
    "BVC     ",
    "BVS     ",
    "TO  R0  ",
    "TO  R1  ",
    "TO  R2  ",
    "TO  R3  ",
    "TO  R4  ",
    "TO  R5  ",
    "TO  R6  ",
    "TO  R7  ",
    "TO  R8  ",
    "TO  R9  ",
    "TO  R10 ",
    "TO  R11 ",
    "TO  R12 ",
    "TO  R13 ",
    "TO  R14 ",
    "TO  R15 ",
    "WITH R0 ",
    "WITH R1 ",
    "WITH R2 ",
    "WITH R3 ",
    "WITH R4 ",
    "WITH R5 ",
    "WITH R6 ",
    "WITH R7 ",
    "WITH R8 ",
    "WITH R9 ",
    "WITH R10",
    "WITH R11",
    "WITH R12",
    "WITH R13",
    "WITH R14",
    "WITH R15",
    "STW(R0) ",
    "STW(R1) ",
    "STW(R2) ",
    "STW(R3) ",
    "STW(R4) ",
    "STW(R5) ",
    "STW(R6) ",
    "STW(R7) ",
    "STW(R8) ",
    "STW(R9) ",
    "STW(R10)",
    "STW(R11)",
    "LOOP    ",
    "ALT1    ",
    "ALT2    ",
    "ALT3    ",
    "LDW(R0) ",
    "LDW(R1) ",
    "LDW(R2) ",
    "LDW(R3) ",
    "LDW(R4) ",
    "LDW(R5) ",
    "LDW(R6) ",
    "LDW(R7) ",
    "LDW(R8) ",
    "LDW(R9) ",
    "LDW(R10)",
    "LDW(R11)",
    "PLOT    ",
    "SWAP    ",
    "COLOR   ",
    "NOT     ",
    "ADD R0  ",
    "ADD R1  ",
    "ADD R2  ",
    "ADD R3  ",
    "ADD R4  ",
    "ADD R5  ",
    "ADD R6  ",
    "ADD R7  ",
    "ADD R8  ",
    "ADD R9  ",
    "ADD R10 ",
    "ADD R11 ",
    "ADD R12 ",
    "ADD R13 ",
    "ADD R14 ",
    "ADD R15 ",
    "SUB R0  ",
    "SUB R1  ",
    "SUB R2  ",
    "SUB R3  ",
    "SUB R4  ",
    "SUB R5  ",
    "SUB R6  ",
    "SUB R7  ",
    "SUB R8  ",
    "SUB R9  ",
    "SUB R10 ",
    "SUB R11 ",
    "SUB R12 ",
    "SUB R13 ",
    "SUB R14 ",
    "SUB R15 ",
    "MERGE   ",
    "AND R1  ",
    "AND R2  ",
    "AND R3  ",
    "AND R4  ",
    "AND R5  ",
    "AND R6  ",
    "AND R7  ",
    "AND R8  ",
    "AND R9  ",
    "AND R10 ",
    "AND R11 ",
    "AND R12 ",
    "AND R13 ",
    "AND R14 ",
    "AND R15 ",
    "MULT R0 ",
    "MULT R1 ",
    "MULT R2 ",
    "MULT R3 ",
    "MULT R4 ",
    "MULT R5 ",
    "MULT R6 ",
    "MULT R7 ",
    "MULT R8 ",
    "MULT R9 ",
    "MULT R10",
    "MULT R11",
    "MULT R12",
    "MULT R13",
    "MULT R14",
    "MULT R15",
    "SBK     ",
    "LINK #$1",
    "LINK #$2",
    "LINK #$3",
    "LINK #$4",
    "SEX     ",
    "ASR     ",
    "ROR     ",
    "JMP R8  ",
    "JMP R9  ",
    "JMP R10 ",
    "JMP R11 ",
    "JMP R12 ",
    "JMP R13 ",
    "LOB     ",
    "FMULT   ",
    "IBT R0  ",
    "IBT R1  ",
    "IBT R2  ",
    "IBT R3  ",
    "IBT R4  ",
    "IBT R5  ",
    "IBT R6  ",
    "IBT R7  ",
    "IBT R8  ",
    "IBT R9  ",
    "IBT R10 ",
    "IBT R11 ",
    "IBT R12 ",
    "IBT R13 ",
    "IBT R14 ",
    "IBT R15 ",
    "FROM R0 ",
    "FROM R1 ",
    "FROM R2 ",
    "FROM R3 ",
    "FROM R4 ",
    "FROM R5 ",
    "FROM R6 ",
    "FROM R7 ",
    "FROM R8 ",
    "FROM R9 ",
    "FROM R10",
    "FROM R11",
    "FROM R12",
    "FROM R13",
    "FROM R14",
    "FROM R15",
    "HIB     ",
    "OR  R1  ",
    "OR  R2  ",
    "OR  R3  ",
    "OR  R4  ",
    "OR  R5  ",
    "OR  R6  ",
    "OR  R7  ",
    "OR  R8  ",
    "OR  R9  ",
    "OR  R10 ",
    "OR  R11 ",
    "OR  R12 ",
    "OR  R13 ",
    "OR  R14 ",
    "OR  R15 ",
    "INC R0  ",
    "INC R1  ",
    "INC R2  ",
    "INC R3  ",
    "INC R4  ",
    "INC R5  ",
    "INC R6  ",
    "INC R7  ",
    "INC R8  ",
    "INC R9  ",
    "INC R10 ",
    "INC R11 ",
    "INC R12 ",
    "INC R13 ",
    "INC R14 ",
    "GETC    ",
    "DEC R0  ",
    "DEC R1  ",
    "DEC R2  ",
    "DEC R3  ",
    "DEC R4  ",
    "DEC R5  ",
    "DEC R6  ",
    "DEC R7  ",
    "DEC R8  ",
    "DEC R9  ",
    "DEC R10 ",
    "DEC R11 ",
    "DEC R12 ",
    "DEC R13 ",
    "DEC R14 ",
    "GETB    ",
    "IWT R0  ",
    "IWT R1  ",
    "IWT R2  ",
    "IWT R3  ",
    "IWT R4  ",
    "IWT R5  ",
    "IWT R6  ",
    "IWT R7  ",
    "IWT R8  ",
    "IWT R9  ",
    "IWT R10 ",
    "IWT R11 ",
    "IWT R12 ",
    "IWT R13 ",
    "IWT R14 ",
    "IWT R15 ",
    "STOP    ",
    "NOP     ",
    "CACHE   ",
    "LSR     ",
    "ROL     ",
    "BRA     ",
    "BLT     ",
    "BGE     ",
    "BNE     ",
    "BEQ     ",
    "BPL     ",
    "BMI     ",
    "BCC     ",
    "BCS     ",
    "BVC     ",
    "BVS     ",
    "TO  R0  ",
    "TO  R1  ",
    "TO  R2  ",
    "TO  R3  ",
    "TO  R4  ",
    "TO  R5  ",
    "TO  R6  ",
    "TO  R7  ",
    "TO  R8  ",
    "TO  R9  ",
    "TO  R10 ",
    "TO  R11 ",
    "TO  R12 ",
    "TO  R13 ",
    "TO  R14 ",
    "TO  R15 ",
    "WITH R0 ",
    "WITH R1 ",
    "WITH R2 ",
    "WITH R3 ",
    "WITH R4 ",
    "WITH R5 ",
    "WITH R6 ",
    "WITH R7 ",
    "WITH R8 ",
    "WITH R9 ",
    "WITH R10",
    "WITH R11",
    "WITH R12",
    "WITH R13",
    "WITH R14",
    "WITH R15",
    "STB(R0) ",
    "STB(R1) ",
    "STB(R2) ",
    "STB(R3) ",
    "STB(R4) ",
    "STB(R5) ",
    "STB(R6) ",
    "STB(R7) ",
    "STB(R8) ",
    "STB(R9) ",
    "STB(R10)",
    "STB(R11)",
    "LOOP    ",
    "ALT1    ",
    "ALT2    ",
    "ALT3    ",
    "LDB(R0) ",
    "LDB(R1) ",
    "LDB(R2) ",
    "LDB(R3) ",
    "LDB(R4) ",
    "LDB(R5) ",
    "LDB(R6) ",
    "LDB(R7) ",
    "LDB(R8) ",
    "LDB(R9) ",
    "LDB(R10)",
    "LDB(R11)",
    "PLOT    ",
    "SWAP    ",
    "CMODE   ",
    "NOT     ",
    "ADC R0  ",
    "ADC R1  ",
    "ADC R2  ",
    "ADC R3  ",
    "ADC R4  ",
    "ADC R5  ",
    "ADC R6  ",
    "ADC R7  ",
    "ADC R8  ",
    "ADC R9  ",
    "ADC R10 ",
    "ADC R11 ",
    "ADC R12 ",
    "ADC R13 ",
    "ADC R14 ",
    "ADC R15 ",
    "SBC R0  ",
    "SBC R1  ",
    "SBC R2  ",
    "SBC R3  ",
    "SBC R4  ",
    "SBC R5  ",
    "SBC R6  ",
    "SBC R7  ",
    "SBC R8  ",
    "SBC R9  ",
    "SBC R10 ",
    "SBC R11 ",
    "SBC R12 ",
    "SBC R13 ",
    "SBC R14 ",
    "SBC R15 ",
    "MERGE   ",
    "BIC R1  ",
    "BIC R2  ",
    "BIC R3  ",
    "BIC R4  ",
    "BIC R5  ",
    "BIC R6  ",
    "BIC R7  ",
    "BIC R8  ",
    "BIC R9  ",
    "BIC R10 ",
    "BIC R11 ",
    "BIC R12 ",
    "BIC R13 ",
    "BIC R14 ",
    "BIC R15 ",
    "UMULTR0 ",
    "UMULTR1 ",
    "UMULTR2 ",
    "UMULTR3 ",
    "UMULTR4 ",
    "UMULTR5 ",
    "UMULTR6 ",
    "UMULTR7 ",
    "UMULTR8 ",
    "UMULTR9 ",
    "UMULTR10",
    "UMULTR11",
    "UMULTR12",
    "UMULTR13",
    "UMULTR14",
    "UMULTR15",
    "SBK     ",
    "LINK #$1",
    "LINK #$2",
    "LINK #$3",
    "LINK #$4",
    "SEX     ",
    "DIV2    ",
    "ROR     ",
    "LJMP R8 ",
    "LJMP R9 ",
    "LJMP R10",
    "LJMP R11",
    "LJMP R12",
    "LJMP R13",
    "LOB     ",
    "LMULT   ",
    "LMS R0  ",
    "LMS R1  ",
    "LMS R2  ",
    "LMS R3  ",
    "LMS R4  ",
    "LMS R5  ",
    "LMS R6  ",
    "LMS R7  ",
    "LMS R8  ",
    "LMS R9  ",
    "LMS R10 ",
    "LMS R11 ",
    "LMS R12 ",
    "LMS R13 ",
    "LMS R14 ",
    "LMS R15 ",
    "FROM R0 ",
    "FROM R1 ",
    "FROM R2 ",
    "FROM R3 ",
    "FROM R4 ",
    "FROM R5 ",
    "FROM R6 ",
    "FROM R7 ",
    "FROM R8 ",
    "FROM R9 ",
    "FROM R10",
    "FROM R11",
    "FROM R12",
    "FROM R13",
    "FROM R14",
    "FROM R15",
    "HIB     ",
    "XOR R1  ",
    "XOR R2  ",
    "XOR R3  ",
    "XOR R4  ",
    "XOR R5  ",
    "XOR R6  ",
    "XOR R7  ",
    "XOR R8  ",
    "XOR R9  ",
    "XOR R10 ",
    "XOR R11 ",
    "XOR R12 ",
    "XOR R13 ",
    "XOR R14 ",
    "XOR R15 ",
    "INC R0  ",
    "INC R1  ",
    "INC R2  ",
    "INC R3  ",
    "INC R4  ",
    "INC R5  ",
    "INC R6  ",
    "INC R7  ",
    "INC R8  ",
    "INC R9  ",
    "INC R10 ",
    "INC R11 ",
    "INC R12 ",
    "INC R13 ",
    "INC R14 ",
    "GETC    ",
    "DEC R0  ",
    "DEC R1  ",
    "DEC R2  ",
    "DEC R3  ",
    "DEC R4  ",
    "DEC R5  ",
    "DEC R6  ",
    "DEC R7  ",
    "DEC R8  ",
    "DEC R9  ",
    "DEC R10 ",
    "DEC R11 ",
    "DEC R12 ",
    "DEC R13 ",
    "DEC R14 ",
    "GETBH   ",
    "LM  R0  ",
    "LM  R1  ",
    "LM  R2  ",
    "LM  R3  ",
    "LM  R4  ",
    "LM  R5  ",
    "LM  R6  ",
    "LM  R7  ",
    "LM  R8  ",
    "LM  R9  ",
    "LM  R10 ",
    "LM  R11 ",
    "LM  R12 ",
    "LM  R13 ",
    "LM  R14 ",
    "LM  R15 ",
    "STOP    ",
    "NOP     ",
    "CACHE   ",
    "LSR     ",
    "ROL     ",
    "BRA     ",
    "BLT     ",
    "BGE     ",
    "BNE     ",
    "BEQ     ",
    "BPL     ",
    "BMI     ",
    "BCC     ",
    "BCS     ",
    "BVC     ",
    "BVS     ",
    "TO  R0  ",
    "TO  R1  ",
    "TO  R2  ",
    "TO  R3  ",
    "TO  R4  ",
    "TO  R5  ",
    "TO  R6  ",
    "TO  R7  ",
    "TO  R8  ",
    "TO  R9  ",
    "TO  R10 ",
    "TO  R11 ",
    "TO  R12 ",
    "TO  R13 ",
    "TO  R14 ",
    "TO  R15 ",
    "WITH R0 ",
    "WITH R1 ",
    "WITH R2 ",
    "WITH R3 ",
    "WITH R4 ",
    "WITH R5 ",
    "WITH R6 ",
    "WITH R7 ",
    "WITH R8 ",
    "WITH R9 ",
    "WITH R10",
    "WITH R11",
    "WITH R12",
    "WITH R13",
    "WITH R14",
    "WITH R15",
    "STW(R0) ",
    "STW(R1) ",
    "STW(R2) ",
    "STW(R3) ",
    "STW(R4) ",
    "STW(R5) ",
    "STW(R6) ",
    "STW(R7) ",
    "STW(R8) ",
    "STW(R9) ",
    "STW(R10)",
    "STW(R11)",
    "LOOP    ",
    "ALT1    ",
    "ALT2    ",
    "ALT3    ",
    "LDW(R0) ",
    "LDW(R1) ",
    "LDW(R2) ",
    "LDW(R3) ",
    "LDW(R4) ",
    "LDW(R5) ",
    "LDW(R6) ",
    "LDW(R7) ",
    "LDW(R8) ",
    "LDW(R9) ",
    "LDW(R10)",
    "LDW(R11)",
    "PLOT    ",
    "SWAP    ",
    "COLOR   ",
    "NOT     ",
    "ADD #$0 ",
    "ADD #$1 ",
    "ADD #$2 ",
    "ADD #$3 ",
    "ADD #$4 ",
    "ADD #$5 ",
    "ADD #$6 ",
    "ADD #$7 ",
    "ADD #$8 ",
    "ADD #$9 ",
    "ADD #$A ",
    "ADD #$B ",
    "ADD #$C ",
    "ADD #$D ",
    "ADD #$E ",
    "ADD #$F ",
    "SUB #$0 ",
    "SUB #$1 ",
    "SUB #$2 ",
    "SUB #$3 ",
    "SUB #$4 ",
    "SUB #$5 ",
    "SUB #$6 ",
    "SUB #$7 ",
    "SUB #$8 ",
    "SUB #$9 ",
    "SUB #$A ",
    "SUB #$B ",
    "SUB #$C ",
    "SUB #$D ",
    "SUB #$E ",
    "SUB #$F ",
    "MERGE   ",
    "AND #$1 ",
    "AND #$2 ",
    "AND #$3 ",
    "AND #$4 ",
    "AND #$5 ",
    "AND #$6 ",
    "AND #$7 ",
    "AND #$8 ",
    "AND #$9 ",
    "AND #$A ",
    "AND #$B ",
    "AND #$C ",
    "AND #$D ",
    "AND #$E ",
    "AND #$F ",
    "MULTIR0 ",
    "MULTIR1 ",
    "MULTIR2 ",
    "MULTIR3 ",
    "MULTIR4 ",
    "MULTIR5 ",
    "MULTIR6 ",
    "MULTIR7 ",
    "MULTIR8 ",
    "MULTIR9 ",
    "MULTIR10",
    "MULTIR11",
    "MULTIR12",
    "MULTIR13",
    "MULTIR14",
    "MULTIR15",
    "SBK     ",
    "LINK #$1",
    "LINK #$2",
    "LINK #$3",
    "LINK #$4",
    "SEX     ",
    "ASR     ",
    "ROR     ",
    "JMP R8  ",
    "JMP R9  ",
    "JMP R10 ",
    "JMP R11 ",
    "JMP R12 ",
    "JMP R13 ",
    "LOB     ",
    "FMULT   ",
    "SMS R0  ",
    "SMS R1  ",
    "SMS R2  ",
    "SMS R3  ",
    "SMS R4  ",
    "SMS R5  ",
    "SMS R6  ",
    "SMS R7  ",
    "SMS R8  ",
    "SMS R9  ",
    "SMS R10 ",
    "SMS R11 ",
    "SMS R12 ",
    "SMS R13 ",
    "SMS R14 ",
    "SMS R15 ",
    "FROM R0 ",
    "FROM R1 ",
    "FROM R2 ",
    "FROM R3 ",
    "FROM R4 ",
    "FROM R5 ",
    "FROM R6 ",
    "FROM R7 ",
    "FROM R8 ",
    "FROM R9 ",
    "FROM R10",
    "FROM R11",
    "FROM R12",
    "FROM R13",
    "FROM R14",
    "FROM R15",
    "HIB     ",
    "OR #$1  ",
    "OR #$2  ",
    "OR #$3  ",
    "OR #$4  ",
    "OR #$5  ",
    "OR #$6  ",
    "OR #$7  ",
    "OR #$8  ",
    "OR #$9  ",
    "OR #$A  ",
    "OR #$B  ",
    "OR #$C  ",
    "OR #$D  ",
    "OR #$E  ",
    "OR #$F  ",
    "INC R0  ",
    "INC R1  ",
    "INC R2  ",
    "INC R3  ",
    "INC R4  ",
    "INC R5  ",
    "INC R6  ",
    "INC R7  ",
    "INC R8  ",
    "INC R9  ",
    "INC R10 ",
    "INC R11 ",
    "INC R12 ",
    "INC R13 ",
    "INC R14 ",
    "RAMB    ",
    "DEC R0  ",
    "DEC R1  ",
    "DEC R2  ",
    "DEC R3  ",
    "DEC R4  ",
    "DEC R5  ",
    "DEC R6  ",
    "DEC R7  ",
    "DEC R8  ",
    "DEC R9  ",
    "DEC R10 ",
    "DEC R11 ",
    "DEC R12 ",
    "DEC R13 ",
    "DEC R14 ",
    "GETBL   ",
    "SM  R0  ",
    "SM  R1  ",
    "SM  R2  ",
    "SM  R3  ",
    "SM  R4  ",
    "SM  R5  ",
    "SM  R6  ",
    "SM  R7  ",
    "SM  R8  ",
    "SM  R9  ",
    "SM  R10 ",
    "SM  R11 ",
    "SM  R12 ",
    "SM  R13 ",
    "SM  R14 ",
    "SM  R15 ",
    "STOP    ",
    "NOP     ",
    "CACHE   ",
    "LSR     ",
    "ROL     ",
    "BRA     ",
    "BLT     ",
    "BGE     ",
    "BNE     ",
    "BEQ     ",
    "BPL     ",
    "BMI     ",
    "BCC     ",
    "BCS     ",
    "BVC     ",
    "BVS     ",
    "TO  R0  ",
    "TO  R1  ",
    "TO  R2  ",
    "TO  R3  ",
    "TO  R4  ",
    "TO  R5  ",
    "TO  R6  ",
    "TO  R7  ",
    "TO  R8  ",
    "TO  R9  ",
    "TO  R10 ",
    "TO  R11 ",
    "TO  R12 ",
    "TO  R13 ",
    "TO  R14 ",
    "TO  R15 ",
    "WITH R0 ",
    "WITH R1 ",
    "WITH R2 ",
    "WITH R3 ",
    "WITH R4 ",
    "WITH R5 ",
    "WITH R6 ",
    "WITH R7 ",
    "WITH R8 ",
    "WITH R9 ",
    "WITH R10",
    "WITH R11",
    "WITH R12",
    "WITH R13",
    "WITH R14",
    "WITH R15",
    "STW(R0) ",
    "STW(R1) ",
    "STW(R2) ",
    "STW(R3) ",
    "STW(R4) ",
    "STW(R5) ",
    "STW(R6) ",
    "STW(R7) ",
    "STW(R8) ",
    "STW(R9) ",
    "STW(R10)",
    "STW(R11)",
    "LOOP    ",
    "ALT1    ",
    "ALT2    ",
    "ALT3    ",
    "LDW(R0) ",
    "LDW(R1) ",
    "LDW(R2) ",
    "LDW(R3) ",
    "LDW(R4) ",
    "LDW(R5) ",
    "LDW(R6) ",
    "LDW(R7) ",
    "LDW(R8) ",
    "LDW(R9) ",
    "LDW(R10)",
    "LDW(R11)",
    "PLOT    ",
    "SWAP    ",
    "COLOR   ",
    "NOT     ",
    "ADC #$0 ",
    "ADC #$1 ",
    "ADC #$2 ",
    "ADC #$3 ",
    "ADC #$4 ",
    "ADC #$5 ",
    "ADC #$6 ",
    "ADC #$7 ",
    "ADC #$8 ",
    "ADC #$9 ",
    "ADC #$A ",
    "ADC #$B ",
    "ADC #$C ",
    "ADC #$D ",
    "ADC #$E ",
    "ADC #$F ",
    "CMP R0  ",
    "CMP R1  ",
    "CMP R2  ",
    "CMP R3  ",
    "CMP R4  ",
    "CMP R5  ",
    "CMP R6  ",
    "CMP R7  ",
    "CMP R8  ",
    "CMP R9  ",
    "CMP R10 ",
    "CMP R11 ",
    "CMP R12 ",
    "CMP R13 ",
    "CMP R14 ",
    "CMP R15 ",
    "MERGE   ",
    "BIC #$1 ",
    "BIC #$2 ",
    "BIC #$3 ",
    "BIC #$4 ",
    "BIC #$5 ",
    "BIC #$6 ",
    "BIC #$7 ",
    "BIC #$8 ",
    "BIC #$9 ",
    "BIC #$A ",
    "BIC #$B ",
    "BIC #$C ",
    "BIC #$D ",
    "BIC #$E ",
    "BIC #$F ",
    "UMULIR0 ",
    "UMULIR1 ",
    "UMULIR2 ",
    "UMULIR3 ",
    "UMULIR4 ",
    "UMULIR5 ",
    "UMULIR6 ",
    "UMULIR7 ",
    "UMULIR8 ",
    "UMULIR9 ",
    "UMULIR10",
    "UMULIR11",
    "UMULIR12",
    "UMULIR13",
    "UMULIR14",
    "UMULIR15",
    "SBK     ",
    "LINK #$1",
    "LINK #$2",
    "LINK #$3",
    "LINK #$4",
    "SEX     ",
    "ASR     ",
    "ROR     ",
    "JMP R8  ",
    "JMP R9  ",
    "JMP R10 ",
    "JMP R11 ",
    "JMP R12 ",
    "JMP R13 ",
    "LOB     ",
    "FMULT   ",
    "IBT R0  ",
    "IBT R1  ",
    "IBT R2  ",
    "IBT R3  ",
    "IBT R4  ",
    "IBT R5  ",
    "IBT R6  ",
    "IBT R7  ",
    "IBT R8  ",
    "IBT R9  ",
    "IBT R10 ",
    "IBT R11 ",
    "IBT R12 ",
    "IBT R13 ",
    "IBT R14 ",
    "IBT R15 ",
    "FROM R0 ",
    "FROM R1 ",
    "FROM R2 ",
    "FROM R3 ",
    "FROM R4 ",
    "FROM R5 ",
    "FROM R6 ",
    "FROM R7 ",
    "FROM R8 ",
    "FROM R9 ",
    "FROM R10",
    "FROM R11",
    "FROM R12",
    "FROM R13",
    "FROM R14",
    "FROM R15",
    "HIB     ",
    "XOR #$1 ",
    "XOR #$2 ",
    "XOR #$3 ",
    "XOR #$4 ",
    "XOR #$5 ",
    "XOR #$6 ",
    "XOR #$7 ",
    "XOR #$8 ",
    "XOR #$9 ",
    "XOR #$A ",
    "XOR #$B ",
    "XOR #$C ",
    "XOR #$D ",
    "XOR #$E ",
    "XOR #$F ",
    "INC R0  ",
    "INC R1  ",
    "INC R2  ",
    "INC R3  ",
    "INC R4  ",
    "INC R5  ",
    "INC R6  ",
    "INC R7  ",
    "INC R8  ",
    "INC R9  ",
    "INC R10 ",
    "INC R11 ",
    "INC R12 ",
    "INC R13 ",
    "INC R14 ",
    "ROMB    ",
    "DEC R0  ",
    "DEC R1  ",
    "DEC R2  ",
    "DEC R3  ",
    "DEC R4  ",
    "DEC R5  ",
    "DEC R6  ",
    "DEC R7  ",
    "DEC R8  ",
    "DEC R9  ",
    "DEC R10 ",
    "DEC R11 ",
    "DEC R12 ",
    "DEC R13 ",
    "DEC R14 ",
    "GETBS   ",
    "IWT R0  ",
    "IWT R1  ",
    "IWT R2  ",
    "IWT R3  ",
    "IWT R4  ",
    "IWT R5  ",
    "IWT R6  ",
    "IWT R7  ",
    "IWT R8  ",
    "IWT R9  ",
    "IWT R10 ",
    "IWT R11 ",
    "IWT R12 ",
    "IWT R13 ",
    "IWT R14 ",
    "IWT R15 ",
};

#define A(x) ((zreg)(uintptr_t)(x))
#define lengthof(x) (sizeof(x) / sizeof *(x))

static void fill(zreg* const dst, fxop* const* const src, u4 const n)
{
    for (u4 i = 0; i != n; ++i)
        dst[i] = A(src[i]);
}

static fxop* const init_FxTable[256] = {
    c_FxOp00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30,
    c_FxOp31,
    c_FxOp32,
    c_FxOp33,
    c_FxOp34,
    c_FxOp35,
    c_FxOp36,
    c_FxOp37,
    c_FxOp38,
    c_FxOp39,
    c_FxOp3A,
    c_FxOp3B,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40,
    c_FxOp41,
    c_FxOp42,
    c_FxOp43,
    c_FxOp44,
    c_FxOp45,
    c_FxOp46,
    c_FxOp47,
    c_FxOp48,
    c_FxOp49,
    c_FxOp4A,
    c_FxOp4B,
    c_FxOp4C,
    c_FxOp4D,
    c_FxOp4E,
    c_FxOp4F,
    c_FxOp50,
    c_FxOp51,
    c_FxOp52,
    c_FxOp53,
    c_FxOp54,
    c_FxOp55,
    c_FxOp56,
    c_FxOp57,
    c_FxOp58,
    c_FxOp59,
    c_FxOp5A,
    c_FxOp5B,
    c_FxOp5C,
    c_FxOp5D,
    c_FxOp5E,
    c_FxOp5F,
    c_FxOp60,
    c_FxOp61,
    c_FxOp62,
    c_FxOp63,
    c_FxOp64,
    c_FxOp65,
    c_FxOp66,
    c_FxOp67,
    c_FxOp68,
    c_FxOp69,
    c_FxOp6A,
    c_FxOp6B,
    c_FxOp6C,
    c_FxOp6D,
    c_FxOp6E,
    c_FxOp6F,
    c_FxOp70,
    c_FxOp71,
    c_FxOp72,
    c_FxOp73,
    c_FxOp74,
    c_FxOp75,
    c_FxOp76,
    c_FxOp77,
    c_FxOp78,
    c_FxOp79,
    c_FxOp7A,
    c_FxOp7B,
    c_FxOp7C,
    c_FxOp7D,
    c_FxOp7E,
    c_FxOp7F,
    c_FxOp80,
    c_FxOp81,
    c_FxOp82,
    c_FxOp83,
    c_FxOp84,
    c_FxOp85,
    c_FxOp86,
    c_FxOp87,
    c_FxOp88,
    c_FxOp89,
    c_FxOp8A,
    c_FxOp8B,
    c_FxOp8C,
    c_FxOp8D,
    c_FxOp8E,
    c_FxOp8F,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96,
    c_FxOp97,
    c_FxOp98,
    c_FxOp99,
    c_FxOp9A,
    c_FxOp9B,
    c_FxOp9C,
    c_FxOp9D,
    c_FxOp9E,
    c_FxOp9F,
    c_FxOpA0,
    c_FxOpA1,
    c_FxOpA2,
    c_FxOpA3,
    c_FxOpA4,
    c_FxOpA5,
    c_FxOpA6,
    c_FxOpA7,
    c_FxOpA8,
    c_FxOpA9,
    c_FxOpAA,
    c_FxOpAB,
    c_FxOpAC,
    c_FxOpAD,
    c_FxOpAE,
    c_FxOpAF,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1,
    c_FxOpC2,
    c_FxOpC3,
    c_FxOpC4,
    c_FxOpC5,
    c_FxOpC6,
    c_FxOpC7,
    c_FxOpC8,
    c_FxOpC9,
    c_FxOpCA,
    c_FxOpCB,
    c_FxOpCC,
    c_FxOpCD,
    c_FxOpCE,
    c_FxOpCF,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDF,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEF,
    c_FxOpF0,
    c_FxOpF1,
    c_FxOpF2,
    c_FxOpF3,
    c_FxOpF4,
    c_FxOpF5,
    c_FxOpF6,
    c_FxOpF7,
    c_FxOpF8,
    c_FxOpF9,
    c_FxOpFA,
    c_FxOpFB,
    c_FxOpFC,
    c_FxOpFD,
    c_FxOpFE,
    c_FxOpFF,
};

static fxop* const init_FxTableA1[256] = {
    c_FxOp00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30A1,
    c_FxOp31A1,
    c_FxOp32A1,
    c_FxOp33A1,
    c_FxOp34A1,
    c_FxOp35A1,
    c_FxOp36A1,
    c_FxOp37A1,
    c_FxOp38A1,
    c_FxOp39A1,
    c_FxOp3AA1,
    c_FxOp3BA1,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40A1,
    c_FxOp41A1,
    c_FxOp42A1,
    c_FxOp43A1,
    c_FxOp44A1,
    c_FxOp45A1,
    c_FxOp46A1,
    c_FxOp47A1,
    c_FxOp48A1,
    c_FxOp49A1,
    c_FxOp4AA1,
    c_FxOp4BA1,
    c_FxOp4CA1,
    c_FxOp4D,
    c_FxOp4EA1,
    c_FxOp4F,
    c_FxOp50A1,
    c_FxOp51A1,
    c_FxOp52A1,
    c_FxOp53A1,
    c_FxOp54A1,
    c_FxOp55A1,
    c_FxOp56A1,
    c_FxOp57A1,
    c_FxOp58A1,
    c_FxOp59A1,
    c_FxOp5AA1,
    c_FxOp5BA1,
    c_FxOp5CA1,
    c_FxOp5DA1,
    c_FxOp5EA1,
    c_FxOp5FA1,
    c_FxOp60A1,
    c_FxOp61A1,
    c_FxOp62A1,
    c_FxOp63A1,
    c_FxOp64A1,
    c_FxOp65A1,
    c_FxOp66A1,
    c_FxOp67A1,
    c_FxOp68A1,
    c_FxOp69A1,
    c_FxOp6AA1,
    c_FxOp6BA1,
    c_FxOp6CA1,
    c_FxOp6DA1,
    c_FxOp6EA1,
    c_FxOp6FA1,
    c_FxOp70,
    c_FxOp71A1,
    c_FxOp72A1,
    c_FxOp73A1,
    c_FxOp74A1,
    c_FxOp75A1,
    c_FxOp76A1,
    c_FxOp77A1,
    c_FxOp78A1,
    c_FxOp79A1,
    c_FxOp7AA1,
    c_FxOp7BA1,
    c_FxOp7CA1,
    c_FxOp7DA1,
    c_FxOp7EA1,
    c_FxOp7FA1,
    c_FxOp80A1,
    c_FxOp81A1,
    c_FxOp82A1,
    c_FxOp83A1,
    c_FxOp84A1,
    c_FxOp85A1,
    c_FxOp86A1,
    c_FxOp87A1,
    c_FxOp88A1,
    c_FxOp89A1,
    c_FxOp8AA1,
    c_FxOp8BA1,
    c_FxOp8CA1,
    c_FxOp8DA1,
    c_FxOp8EA1,
    c_FxOp8FA1,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96A1,
    c_FxOp97,
    c_FxOp98A1,
    c_FxOp99A1,
    c_FxOp9AA1,
    c_FxOp9BA1,
    c_FxOp9CA1,
    c_FxOp9DA1,
    c_FxOp9E,
    c_FxOp9FA1,
    c_FxOpA0A1,
    c_FxOpA1A1,
    c_FxOpA2A1,
    c_FxOpA3A1,
    c_FxOpA4A1,
    c_FxOpA5A1,
    c_FxOpA6A1,
    c_FxOpA7A1,
    c_FxOpA8A1,
    c_FxOpA9A1,
    c_FxOpAAA1,
    c_FxOpABA1,
    c_FxOpACA1,
    c_FxOpADA1,
    c_FxOpAEA1,
    c_FxOpAFA1,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1A1,
    c_FxOpC2A1,
    c_FxOpC3A1,
    c_FxOpC4A1,
    c_FxOpC5A1,
    c_FxOpC6A1,
    c_FxOpC7A1,
    c_FxOpC8A1,
    c_FxOpC9A1,
    c_FxOpCAA1,
    c_FxOpCBA1,
    c_FxOpCCA1,
    c_FxOpCDA1,
    c_FxOpCEA1,
    c_FxOpCFA1,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDF,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEFA1,
    c_FxOpF0A1,
    c_FxOpF1A1,
    c_FxOpF2A1,
    c_FxOpF3A1,
    c_FxOpF4A1,
    c_FxOpF5A1,
    c_FxOpF6A1,
    c_FxOpF7A1,
    c_FxOpF8A1,
    c_FxOpF9A1,
    c_FxOpFAA1,
    c_FxOpFBA1,
    c_FxOpFCA1,
    c_FxOpFDA1,
    c_FxOpFEA1,
    c_FxOpFFA1,
};

static fxop* const init_FxTableA2[256] = {
    c_FxOp00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30,
    c_FxOp31,
    c_FxOp32,
    c_FxOp33,
    c_FxOp34,
    c_FxOp35,
    c_FxOp36,
    c_FxOp37,
    c_FxOp38,
    c_FxOp39,
    c_FxOp3A,
    c_FxOp3B,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40,
    c_FxOp41,
    c_FxOp42,
    c_FxOp43,
    c_FxOp44,
    c_FxOp45,
    c_FxOp46,
    c_FxOp47,
    c_FxOp48,
    c_FxOp49,
    c_FxOp4A,
    c_FxOp4B,
    c_FxOp4C,
    c_FxOp4D,
    c_FxOp4E,
    c_FxOp4F,
    c_FxOp50A2,
    c_FxOp51A2,
    c_FxOp52A2,
    c_FxOp53A2,
    c_FxOp54A2,
    c_FxOp55A2,
    c_FxOp56A2,
    c_FxOp57A2,
    c_FxOp58A2,
    c_FxOp59A2,
    c_FxOp5AA2,
    c_FxOp5BA2,
    c_FxOp5CA2,
    c_FxOp5DA2,
    c_FxOp5EA2,
    c_FxOp5FA2,
    c_FxOp60A2,
    c_FxOp61A2,
    c_FxOp62A2,
    c_FxOp63A2,
    c_FxOp64A2,
    c_FxOp65A2,
    c_FxOp66A2,
    c_FxOp67A2,
    c_FxOp68A2,
    c_FxOp69A2,
    c_FxOp6AA2,
    c_FxOp6BA2,
    c_FxOp6CA2,
    c_FxOp6DA2,
    c_FxOp6EA2,
    c_FxOp6FA2,
    c_FxOp70,
    c_FxOp71A2,
    c_FxOp72A2,
    c_FxOp73A2,
    c_FxOp74A2,
    c_FxOp75A2,
    c_FxOp76A2,
    c_FxOp77A2,
    c_FxOp78A2,
    c_FxOp79A2,
    c_FxOp7AA2,
    c_FxOp7BA2,
    c_FxOp7CA2,
    c_FxOp7DA2,
    c_FxOp7EA2,
    c_FxOp7FA2,
    c_FxOp80A2,
    c_FxOp81A2,
    c_FxOp82A2,
    c_FxOp83A2,
    c_FxOp84A2,
    c_FxOp85A2,
    c_FxOp86A2,
    c_FxOp87A2,
    c_FxOp88A2,
    c_FxOp89A2,
    c_FxOp8AA2,
    c_FxOp8BA2,
    c_FxOp8CA2,
    c_FxOp8DA2,
    c_FxOp8EA2,
    c_FxOp8FA2,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96,
    c_FxOp97,
    c_FxOp98,
    c_FxOp99,
    c_FxOp9A,
    c_FxOp9B,
    c_FxOp9C,
    c_FxOp9D,
    c_FxOp9E,
    c_FxOp9F,
    c_FxOpA0A2,
    c_FxOpA1A2,
    c_FxOpA2A2,
    c_FxOpA3A2,
    c_FxOpA4A2,
    c_FxOpA5A2,
    c_FxOpA6A2,
    c_FxOpA7A2,
    c_FxOpA8A2,
    c_FxOpA9A2,
    c_FxOpAAA2,
    c_FxOpABA2,
    c_FxOpACA2,
    c_FxOpADA2,
    c_FxOpAEA2,
    c_FxOpAFA2,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1A2,
    c_FxOpC2A2,
    c_FxOpC3A2,
    c_FxOpC4A2,
    c_FxOpC5A2,
    c_FxOpC6A2,
    c_FxOpC7A2,
    c_FxOpC8A2,
    c_FxOpC9A2,
    c_FxOpCAA2,
    c_FxOpCBA2,
    c_FxOpCCA2,
    c_FxOpCDA2,
    c_FxOpCEA2,
    c_FxOpCFA2,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDFA2,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEFA2,
    c_FxOpF0A2,
    c_FxOpF1A2,
    c_FxOpF2A2,
    c_FxOpF3A2,
    c_FxOpF4A2,
    c_FxOpF5A2,
    c_FxOpF6A2,
    c_FxOpF7A2,
    c_FxOpF8A2,
    c_FxOpF9A2,
    c_FxOpFAA2,
    c_FxOpFBA2,
    c_FxOpFCA2,
    c_FxOpFDA2,
    c_FxOpFEA2,
    c_FxOpFFA2,
};

static fxop* const init_FxTableA3[256] = {
    c_FxOp00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30,
    c_FxOp31,
    c_FxOp32,
    c_FxOp33,
    c_FxOp34,
    c_FxOp35,
    c_FxOp36,
    c_FxOp37,
    c_FxOp38,
    c_FxOp39,
    c_FxOp3A,
    c_FxOp3B,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40,
    c_FxOp41,
    c_FxOp42,
    c_FxOp43,
    c_FxOp44,
    c_FxOp45,
    c_FxOp46,
    c_FxOp47,
    c_FxOp48,
    c_FxOp49,
    c_FxOp4A,
    c_FxOp4B,
    c_FxOp4C,
    c_FxOp4D,
    c_FxOp4E,
    c_FxOp4F,
    c_FxOp50A3,
    c_FxOp51A3,
    c_FxOp52A3,
    c_FxOp53A3,
    c_FxOp54A3,
    c_FxOp55A3,
    c_FxOp56A3,
    c_FxOp57A3,
    c_FxOp58A3,
    c_FxOp59A3,
    c_FxOp5AA3,
    c_FxOp5BA3,
    c_FxOp5CA3,
    c_FxOp5DA3,
    c_FxOp5EA3,
    c_FxOp5FA3,
    c_FxOp60A3,
    c_FxOp61A3,
    c_FxOp62A3,
    c_FxOp63A3,
    c_FxOp64A3,
    c_FxOp65A3,
    c_FxOp66A3,
    c_FxOp67A3,
    c_FxOp68A3,
    c_FxOp69A3,
    c_FxOp6AA3,
    c_FxOp6BA3,
    c_FxOp6CA3,
    c_FxOp6DA3,
    c_FxOp6EA3,
    c_FxOp6FA3,
    c_FxOp70,
    c_FxOp71A3,
    c_FxOp72A3,
    c_FxOp73A3,
    c_FxOp74A3,
    c_FxOp75A3,
    c_FxOp76A3,
    c_FxOp77A3,
    c_FxOp78A3,
    c_FxOp79A3,
    c_FxOp7AA3,
    c_FxOp7BA3,
    c_FxOp7CA3,
    c_FxOp7DA3,
    c_FxOp7EA3,
    c_FxOp7FA3,
    c_FxOp80A3,
    c_FxOp81A3,
    c_FxOp82A3,
    c_FxOp83A3,
    c_FxOp84A3,
    c_FxOp85A3,
    c_FxOp86A3,
    c_FxOp87A3,
    c_FxOp88A3,
    c_FxOp89A3,
    c_FxOp8AA3,
    c_FxOp8BA3,
    c_FxOp8CA3,
    c_FxOp8DA3,
    c_FxOp8EA3,
    c_FxOp8FA3,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96,
    c_FxOp97,
    c_FxOp98,
    c_FxOp99,
    c_FxOp9A,
    c_FxOp9B,
    c_FxOp9C,
    c_FxOp9D,
    c_FxOp9E,
    c_FxOp9F,
    c_FxOpA0,
    c_FxOpA1,
    c_FxOpA2,
    c_FxOpA3,
    c_FxOpA4,
    c_FxOpA5,
    c_FxOpA6,
    c_FxOpA7,
    c_FxOpA8,
    c_FxOpA9,
    c_FxOpAA,
    c_FxOpAB,
    c_FxOpAC,
    c_FxOpAD,
    c_FxOpAE,
    c_FxOpAF,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1A3,
    c_FxOpC2A3,
    c_FxOpC3A3,
    c_FxOpC4A3,
    c_FxOpC5A3,
    c_FxOpC6A3,
    c_FxOpC7A3,
    c_FxOpC8A3,
    c_FxOpC9A3,
    c_FxOpCAA3,
    c_FxOpCBA3,
    c_FxOpCCA3,
    c_FxOpCDA3,
    c_FxOpCEA3,
    c_FxOpCFA3,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDFA3,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEFA3,
    c_FxOpF0,
    c_FxOpF1,
    c_FxOpF2,
    c_FxOpF3,
    c_FxOpF4,
    c_FxOpF5,
    c_FxOpF6,
    c_FxOpF7,
    c_FxOpF8,
    c_FxOpF9,
    c_FxOpFA,
    c_FxOpFB,
    c_FxOpFC,
    c_FxOpFD,
    c_FxOpFE,
    c_FxOpFF,
};

static fxop* const init_FxTabled[256] = {
    c_FxOpd00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30,
    c_FxOp31,
    c_FxOp32,
    c_FxOp33,
    c_FxOp34,
    c_FxOp35,
    c_FxOp36,
    c_FxOp37,
    c_FxOp38,
    c_FxOp39,
    c_FxOp3A,
    c_FxOp3B,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40,
    c_FxOp41,
    c_FxOp42,
    c_FxOp43,
    c_FxOp44,
    c_FxOp45,
    c_FxOp46,
    c_FxOp47,
    c_FxOp48,
    c_FxOp49,
    c_FxOp4A,
    c_FxOp4B,
    c_FxOp4C1284b,
    c_FxOp4D,
    c_FxOp4E,
    c_FxOp4F,
    c_FxOp50,
    c_FxOp51,
    c_FxOp52,
    c_FxOp53,
    c_FxOp54,
    c_FxOp55,
    c_FxOp56,
    c_FxOp57,
    c_FxOp58,
    c_FxOp59,
    c_FxOp5A,
    c_FxOp5B,
    c_FxOp5C,
    c_FxOp5D,
    c_FxOp5E,
    c_FxOp5F,
    c_FxOp60,
    c_FxOp61,
    c_FxOp62,
    c_FxOp63,
    c_FxOp64,
    c_FxOp65,
    c_FxOp66,
    c_FxOp67,
    c_FxOp68,
    c_FxOp69,
    c_FxOp6A,
    c_FxOp6B,
    c_FxOp6C,
    c_FxOp6D,
    c_FxOp6E,
    c_FxOp6F,
    c_FxOp70,
    c_FxOp71,
    c_FxOp72,
    c_FxOp73,
    c_FxOp74,
    c_FxOp75,
    c_FxOp76,
    c_FxOp77,
    c_FxOp78,
    c_FxOp79,
    c_FxOp7A,
    c_FxOp7B,
    c_FxOp7C,
    c_FxOp7D,
    c_FxOp7E,
    c_FxOp7F,
    c_FxOp80,
    c_FxOp81,
    c_FxOp82,
    c_FxOp83,
    c_FxOp84,
    c_FxOp85,
    c_FxOp86,
    c_FxOp87,
    c_FxOp88,
    c_FxOp89,
    c_FxOp8A,
    c_FxOp8B,
    c_FxOp8C,
    c_FxOp8D,
    c_FxOp8E,
    c_FxOp8F,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96,
    c_FxOp97,
    c_FxOp98,
    c_FxOp99,
    c_FxOp9A,
    c_FxOp9B,
    c_FxOp9C,
    c_FxOp9D,
    c_FxOp9E,
    c_FxOp9F,
    c_FxOpA0,
    c_FxOpA1,
    c_FxOpA2,
    c_FxOpA3,
    c_FxOpA4,
    c_FxOpA5,
    c_FxOpA6,
    c_FxOpA7,
    c_FxOpA8,
    c_FxOpA9,
    c_FxOpAA,
    c_FxOpAB,
    c_FxOpAC,
    c_FxOpAD,
    c_FxOpAE,
    c_FxOpAF,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1,
    c_FxOpC2,
    c_FxOpC3,
    c_FxOpC4,
    c_FxOpC5,
    c_FxOpC6,
    c_FxOpC7,
    c_FxOpC8,
    c_FxOpC9,
    c_FxOpCA,
    c_FxOpCB,
    c_FxOpCC,
    c_FxOpCD,
    c_FxOpCE,
    c_FxOpCF,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDF,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEF,
    c_FxOpF0,
    c_FxOpF1,
    c_FxOpF2,
    c_FxOpF3,
    c_FxOpF4,
    c_FxOpF5,
    c_FxOpF6,
    c_FxOpF7,
    c_FxOpF8,
    c_FxOpF9,
    c_FxOpFA,
    c_FxOpFB,
    c_FxOpFC,
    c_FxOpFD,
    c_FxOpFE,
    c_FxOpFF,
};

static fxop* const init_FxTabledA1[256] = {
    c_FxOpd00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30A1,
    c_FxOp31A1,
    c_FxOp32A1,
    c_FxOp33A1,
    c_FxOp34A1,
    c_FxOp35A1,
    c_FxOp36A1,
    c_FxOp37A1,
    c_FxOp38A1,
    c_FxOp39A1,
    c_FxOp3AA1,
    c_FxOp3BA1,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40A1,
    c_FxOp41A1,
    c_FxOp42A1,
    c_FxOp43A1,
    c_FxOp44A1,
    c_FxOp45A1,
    c_FxOp46A1,
    c_FxOp47A1,
    c_FxOp48A1,
    c_FxOp49A1,
    c_FxOp4AA1,
    c_FxOp4BA1,
    c_FxOp4CA1,
    c_FxOp4D,
    c_FxOp4EA1,
    c_FxOp4F,
    c_FxOp50A1,
    c_FxOp51A1,
    c_FxOp52A1,
    c_FxOp53A1,
    c_FxOp54A1,
    c_FxOp55A1,
    c_FxOp56A1,
    c_FxOp57A1,
    c_FxOp58A1,
    c_FxOp59A1,
    c_FxOp5AA1,
    c_FxOp5BA1,
    c_FxOp5CA1,
    c_FxOp5DA1,
    c_FxOp5EA1,
    c_FxOp5FA1,
    c_FxOp60A1,
    c_FxOp61A1,
    c_FxOp62A1,
    c_FxOp63A1,
    c_FxOp64A1,
    c_FxOp65A1,
    c_FxOp66A1,
    c_FxOp67A1,
    c_FxOp68A1,
    c_FxOp69A1,
    c_FxOp6AA1,
    c_FxOp6BA1,
    c_FxOp6CA1,
    c_FxOp6DA1,
    c_FxOp6EA1,
    c_FxOp6FA1,
    c_FxOp70,
    c_FxOp71A1,
    c_FxOp72A1,
    c_FxOp73A1,
    c_FxOp74A1,
    c_FxOp75A1,
    c_FxOp76A1,
    c_FxOp77A1,
    c_FxOp78A1,
    c_FxOp79A1,
    c_FxOp7AA1,
    c_FxOp7BA1,
    c_FxOp7CA1,
    c_FxOp7DA1,
    c_FxOp7EA1,
    c_FxOp7FA1,
    c_FxOp80A1,
    c_FxOp81A1,
    c_FxOp82A1,
    c_FxOp83A1,
    c_FxOp84A1,
    c_FxOp85A1,
    c_FxOp86A1,
    c_FxOp87A1,
    c_FxOp88A1,
    c_FxOp89A1,
    c_FxOp8AA1,
    c_FxOp8BA1,
    c_FxOp8CA1,
    c_FxOp8DA1,
    c_FxOp8EA1,
    c_FxOp8FA1,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96A1,
    c_FxOp97,
    c_FxOp98A1,
    c_FxOp99A1,
    c_FxOp9AA1,
    c_FxOp9BA1,
    c_FxOp9CA1,
    c_FxOp9DA1,
    c_FxOp9E,
    c_FxOp9FA1,
    c_FxOpA0A1,
    c_FxOpA1A1,
    c_FxOpA2A1,
    c_FxOpA3A1,
    c_FxOpA4A1,
    c_FxOpA5A1,
    c_FxOpA6A1,
    c_FxOpA7A1,
    c_FxOpA8A1,
    c_FxOpA9A1,
    c_FxOpAAA1,
    c_FxOpABA1,
    c_FxOpACA1,
    c_FxOpADA1,
    c_FxOpAEA1,
    c_FxOpAFA1,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1A1,
    c_FxOpC2A1,
    c_FxOpC3A1,
    c_FxOpC4A1,
    c_FxOpC5A1,
    c_FxOpC6A1,
    c_FxOpC7A1,
    c_FxOpC8A1,
    c_FxOpC9A1,
    c_FxOpCAA1,
    c_FxOpCBA1,
    c_FxOpCCA1,
    c_FxOpCDA1,
    c_FxOpCEA1,
    c_FxOpCFA1,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDF,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEFA1,
    c_FxOpF0A1,
    c_FxOpF1A1,
    c_FxOpF2A1,
    c_FxOpF3A1,
    c_FxOpF4A1,
    c_FxOpF5A1,
    c_FxOpF6A1,
    c_FxOpF7A1,
    c_FxOpF8A1,
    c_FxOpF9A1,
    c_FxOpFAA1,
    c_FxOpFBA1,
    c_FxOpFCA1,
    c_FxOpFDA1,
    c_FxOpFEA1,
    c_FxOpFFA1,
};

static fxop* const init_FxTabledA2[256] = {
    c_FxOpd00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30,
    c_FxOp31,
    c_FxOp32,
    c_FxOp33,
    c_FxOp34,
    c_FxOp35,
    c_FxOp36,
    c_FxOp37,
    c_FxOp38,
    c_FxOp39,
    c_FxOp3A,
    c_FxOp3B,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40,
    c_FxOp41,
    c_FxOp42,
    c_FxOp43,
    c_FxOp44,
    c_FxOp45,
    c_FxOp46,
    c_FxOp47,
    c_FxOp48,
    c_FxOp49,
    c_FxOp4A,
    c_FxOp4B,
    c_FxOp4C1284b,
    c_FxOp4D,
    c_FxOp4E,
    c_FxOp4F,
    c_FxOp50A2,
    c_FxOp51A2,
    c_FxOp52A2,
    c_FxOp53A2,
    c_FxOp54A2,
    c_FxOp55A2,
    c_FxOp56A2,
    c_FxOp57A2,
    c_FxOp58A2,
    c_FxOp59A2,
    c_FxOp5AA2,
    c_FxOp5BA2,
    c_FxOp5CA2,
    c_FxOp5DA2,
    c_FxOp5EA2,
    c_FxOp5FA2,
    c_FxOp60A2,
    c_FxOp61A2,
    c_FxOp62A2,
    c_FxOp63A2,
    c_FxOp64A2,
    c_FxOp65A2,
    c_FxOp66A2,
    c_FxOp67A2,
    c_FxOp68A2,
    c_FxOp69A2,
    c_FxOp6AA2,
    c_FxOp6BA2,
    c_FxOp6CA2,
    c_FxOp6DA2,
    c_FxOp6EA2,
    c_FxOp6FA2,
    c_FxOp70,
    c_FxOp71A2,
    c_FxOp72A2,
    c_FxOp73A2,
    c_FxOp74A2,
    c_FxOp75A2,
    c_FxOp76A2,
    c_FxOp77A2,
    c_FxOp78A2,
    c_FxOp79A2,
    c_FxOp7AA2,
    c_FxOp7BA2,
    c_FxOp7CA2,
    c_FxOp7DA2,
    c_FxOp7EA2,
    c_FxOp7FA2,
    c_FxOp80A2,
    c_FxOp81A2,
    c_FxOp82A2,
    c_FxOp83A2,
    c_FxOp84A2,
    c_FxOp85A2,
    c_FxOp86A2,
    c_FxOp87A2,
    c_FxOp88A2,
    c_FxOp89A2,
    c_FxOp8AA2,
    c_FxOp8BA2,
    c_FxOp8CA2,
    c_FxOp8DA2,
    c_FxOp8EA2,
    c_FxOp8FA2,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96,
    c_FxOp97,
    c_FxOp98,
    c_FxOp99,
    c_FxOp9A,
    c_FxOp9B,
    c_FxOp9C,
    c_FxOp9D,
    c_FxOp9E,
    c_FxOp9F,
    c_FxOpA0A2,
    c_FxOpA1A2,
    c_FxOpA2A2,
    c_FxOpA3A2,
    c_FxOpA4A2,
    c_FxOpA5A2,
    c_FxOpA6A2,
    c_FxOpA7A2,
    c_FxOpA8A2,
    c_FxOpA9A2,
    c_FxOpAAA2,
    c_FxOpABA2,
    c_FxOpACA2,
    c_FxOpADA2,
    c_FxOpAEA2,
    c_FxOpAFA2,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1A2,
    c_FxOpC2A2,
    c_FxOpC3A2,
    c_FxOpC4A2,
    c_FxOpC5A2,
    c_FxOpC6A2,
    c_FxOpC7A2,
    c_FxOpC8A2,
    c_FxOpC9A2,
    c_FxOpCAA2,
    c_FxOpCBA2,
    c_FxOpCCA2,
    c_FxOpCDA2,
    c_FxOpCEA2,
    c_FxOpCFA2,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDFA2,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEFA2,
    c_FxOpF0A2,
    c_FxOpF1A2,
    c_FxOpF2A2,
    c_FxOpF3A2,
    c_FxOpF4A2,
    c_FxOpF5A2,
    c_FxOpF6A2,
    c_FxOpF7A2,
    c_FxOpF8A2,
    c_FxOpF9A2,
    c_FxOpFAA2,
    c_FxOpFBA2,
    c_FxOpFCA2,
    c_FxOpFDA2,
    c_FxOpFEA2,
    c_FxOpFFA2,
};

static fxop* const init_FxTabledA3[256] = {
    c_FxOpd00,
    c_FxOp01,
    c_FxOp02,
    c_FxOp03,
    c_FxOp04,
    c_FxOp05,
    c_FxOp06,
    c_FxOp07,
    c_FxOp08,
    c_FxOp09,
    c_FxOp0A,
    c_FxOp0B,
    c_FxOp0C,
    c_FxOp0D,
    c_FxOp0E,
    c_FxOp0F,
    c_FxOp10,
    c_FxOp11,
    c_FxOp12,
    c_FxOp13,
    c_FxOp14,
    c_FxOp15,
    c_FxOp16,
    c_FxOp17,
    c_FxOp18,
    c_FxOp19,
    c_FxOp1A,
    c_FxOp1B,
    c_FxOp1C,
    c_FxOp1D,
    c_FxOp1E,
    c_FxOp1F,
    c_FxOp20,
    c_FxOp21,
    c_FxOp22,
    c_FxOp23,
    c_FxOp24,
    c_FxOp25,
    c_FxOp26,
    c_FxOp27,
    c_FxOp28,
    c_FxOp29,
    c_FxOp2A,
    c_FxOp2B,
    c_FxOp2C,
    c_FxOp2D,
    c_FxOp2E,
    c_FxOp2F,
    c_FxOp30,
    c_FxOp31,
    c_FxOp32,
    c_FxOp33,
    c_FxOp34,
    c_FxOp35,
    c_FxOp36,
    c_FxOp37,
    c_FxOp38,
    c_FxOp39,
    c_FxOp3A,
    c_FxOp3B,
    c_FxOp3C,
    c_FxOp3D,
    c_FxOp3E,
    c_FxOp3F,
    c_FxOp40,
    c_FxOp41,
    c_FxOp42,
    c_FxOp43,
    c_FxOp44,
    c_FxOp45,
    c_FxOp46,
    c_FxOp47,
    c_FxOp48,
    c_FxOp49,
    c_FxOp4A,
    c_FxOp4B,
    c_FxOp4C1284b,
    c_FxOp4D,
    c_FxOp4E,
    c_FxOp4F,
    c_FxOp50A3,
    c_FxOp51A3,
    c_FxOp52A3,
    c_FxOp53A3,
    c_FxOp54A3,
    c_FxOp55A3,
    c_FxOp56A3,
    c_FxOp57A3,
    c_FxOp58A3,
    c_FxOp59A3,
    c_FxOp5AA3,
    c_FxOp5BA3,
    c_FxOp5CA3,
    c_FxOp5DA3,
    c_FxOp5EA3,
    c_FxOp5FA3,
    c_FxOp60A3,
    c_FxOp61A3,
    c_FxOp62A3,
    c_FxOp63A3,
    c_FxOp64A3,
    c_FxOp65A3,
    c_FxOp66A3,
    c_FxOp67A3,
    c_FxOp68A3,
    c_FxOp69A3,
    c_FxOp6AA3,
    c_FxOp6BA3,
    c_FxOp6CA3,
    c_FxOp6DA3,
    c_FxOp6EA3,
    c_FxOp6FA3,
    c_FxOp70,
    c_FxOp71A3,
    c_FxOp72A3,
    c_FxOp73A3,
    c_FxOp74A3,
    c_FxOp75A3,
    c_FxOp76A3,
    c_FxOp77A3,
    c_FxOp78A3,
    c_FxOp79A3,
    c_FxOp7AA3,
    c_FxOp7BA3,
    c_FxOp7CA3,
    c_FxOp7DA3,
    c_FxOp7EA3,
    c_FxOp7FA3,
    c_FxOp80A3,
    c_FxOp81A3,
    c_FxOp82A3,
    c_FxOp83A3,
    c_FxOp84A3,
    c_FxOp85A3,
    c_FxOp86A3,
    c_FxOp87A3,
    c_FxOp88A3,
    c_FxOp89A3,
    c_FxOp8AA3,
    c_FxOp8BA3,
    c_FxOp8CA3,
    c_FxOp8DA3,
    c_FxOp8EA3,
    c_FxOp8FA3,
    c_FxOp90,
    c_FxOp91,
    c_FxOp92,
    c_FxOp93,
    c_FxOp94,
    c_FxOp95,
    c_FxOp96,
    c_FxOp97,
    c_FxOp98,
    c_FxOp99,
    c_FxOp9A,
    c_FxOp9B,
    c_FxOp9C,
    c_FxOp9D,
    c_FxOp9E,
    c_FxOp9F,
    c_FxOpA0,
    c_FxOpA1,
    c_FxOpA2,
    c_FxOpA3,
    c_FxOpA4,
    c_FxOpA5,
    c_FxOpA6,
    c_FxOpA7,
    c_FxOpA8,
    c_FxOpA9,
    c_FxOpAA,
    c_FxOpAB,
    c_FxOpAC,
    c_FxOpAD,
    c_FxOpAE,
    c_FxOpAF,
    c_FxOpB0,
    c_FxOpB1,
    c_FxOpB2,
    c_FxOpB3,
    c_FxOpB4,
    c_FxOpB5,
    c_FxOpB6,
    c_FxOpB7,
    c_FxOpB8,
    c_FxOpB9,
    c_FxOpBA,
    c_FxOpBB,
    c_FxOpBC,
    c_FxOpBD,
    c_FxOpBE,
    c_FxOpBF,
    c_FxOpC0,
    c_FxOpC1A3,
    c_FxOpC2A3,
    c_FxOpC3A3,
    c_FxOpC4A3,
    c_FxOpC5A3,
    c_FxOpC6A3,
    c_FxOpC7A3,
    c_FxOpC8A3,
    c_FxOpC9A3,
    c_FxOpCAA3,
    c_FxOpCBA3,
    c_FxOpCCA3,
    c_FxOpCDA3,
    c_FxOpCEA3,
    c_FxOpCFA3,
    c_FxOpD0,
    c_FxOpD1,
    c_FxOpD2,
    c_FxOpD3,
    c_FxOpD4,
    c_FxOpD5,
    c_FxOpD6,
    c_FxOpD7,
    c_FxOpD8,
    c_FxOpD9,
    c_FxOpDA,
    c_FxOpDB,
    c_FxOpDC,
    c_FxOpDD,
    c_FxOpDE,
    c_FxOpDFA3,
    c_FxOpE0,
    c_FxOpE1,
    c_FxOpE2,
    c_FxOpE3,
    c_FxOpE4,
    c_FxOpE5,
    c_FxOpE6,
    c_FxOpE7,
    c_FxOpE8,
    c_FxOpE9,
    c_FxOpEA,
    c_FxOpEB,
    c_FxOpEC,
    c_FxOpED,
    c_FxOpEE,
    c_FxOpEFA3,
    c_FxOpF0,
    c_FxOpF1,
    c_FxOpF2,
    c_FxOpF3,
    c_FxOpF4,
    c_FxOpF5,
    c_FxOpF6,
    c_FxOpF7,
    c_FxOpF8,
    c_FxOpF9,
    c_FxOpFA,
    c_FxOpFB,
    c_FxOpFC,
    c_FxOpFD,
    c_FxOpFE,
    c_FxOpFF,
};

/* The opcodes whose behaviour differs in the "b" and "c" cores. The rest of
 * those tables is a straight copy of the corresponding base table. */
typedef struct {
    u2 idx;
    fxop* fn;
} fxpatch;

static void patch(zreg* const dst, fxpatch const* const p, u4 const n)
{
    for (u4 i = 0; i != n; ++i)
        dst[p[i].idx] = A(p[i].fn);
}

static fxpatch const init_FxTableb[] = {
    { 0x05, c_FxOpb05 },
    { 0x06, c_FxOpb06 },
    { 0x07, c_FxOpb07 },
    { 0x08, c_FxOpb08 },
    { 0x09, c_FxOpb09 },
    { 0x0A, c_FxOpb0A },
    { 0x0B, c_FxOpb0B },
    { 0x0C, c_FxOpb0C },
    { 0x0D, c_FxOpb0D },
    { 0x0E, c_FxOpb0E },
    { 0x0F, c_FxOpb0F },
    { 0x10, c_FxOpb10 },
    { 0x11, c_FxOpb11 },
    { 0x12, c_FxOpb12 },
    { 0x13, c_FxOpb13 },
    { 0x14, c_FxOpb14 },
    { 0x15, c_FxOpb15 },
    { 0x16, c_FxOpb16 },
    { 0x17, c_FxOpb17 },
    { 0x18, c_FxOpb18 },
    { 0x19, c_FxOpb19 },
    { 0x1A, c_FxOpb1A },
    { 0x1B, c_FxOpb1B },
    { 0x1C, c_FxOpb1C },
    { 0x1D, c_FxOpb1D },
    { 0x1E, c_FxOpb1E },
    { 0x1F, c_FxOpb1F },
    { 0x3D, c_FxOpb3D },
    { 0x3E, c_FxOpb3E },
    { 0x3F, c_FxOpb3F },
    { 0xB0, c_FxOpbB0 },
    { 0xB1, c_FxOpbB1 },
    { 0xB2, c_FxOpbB2 },
    { 0xB3, c_FxOpbB3 },
    { 0xB4, c_FxOpbB4 },
    { 0xB5, c_FxOpbB5 },
    { 0xB6, c_FxOpbB6 },
    { 0xB7, c_FxOpbB7 },
    { 0xB8, c_FxOpbB8 },
    { 0xB9, c_FxOpbB9 },
    { 0xBA, c_FxOpbBA },
    { 0xBB, c_FxOpbBB },
    { 0xBC, c_FxOpbBC },
    { 0xBD, c_FxOpbBD },
    { 0xBE, c_FxOpbBE },
    { 0xBF, c_FxOpbBF },
};

static fxpatch const init_FxTablebA1[] = {
    { 0x05, c_FxOpb05 },
    { 0x06, c_FxOpb06 },
    { 0x07, c_FxOpb07 },
    { 0x08, c_FxOpb08 },
    { 0x09, c_FxOpb09 },
    { 0x0A, c_FxOpb0A },
    { 0x0B, c_FxOpb0B },
    { 0x0C, c_FxOpb0C },
    { 0x0D, c_FxOpb0D },
    { 0x0E, c_FxOpb0E },
    { 0x0F, c_FxOpb0F },
    { 0x10, c_FxOpb10 },
    { 0x11, c_FxOpb11 },
    { 0x12, c_FxOpb12 },
    { 0x13, c_FxOpb13 },
    { 0x14, c_FxOpb14 },
    { 0x15, c_FxOpb15 },
    { 0x16, c_FxOpb16 },
    { 0x17, c_FxOpb17 },
    { 0x18, c_FxOpb18 },
    { 0x19, c_FxOpb19 },
    { 0x1A, c_FxOpb1A },
    { 0x1B, c_FxOpb1B },
    { 0x1C, c_FxOpb1C },
    { 0x1D, c_FxOpb1D },
    { 0x1E, c_FxOpb1E },
    { 0x1F, c_FxOpb1F },
    { 0x3D, c_FxOpb3D },
    { 0x3E, c_FxOpb3E },
    { 0x3F, c_FxOpb3F },
    { 0xB0, c_FxOpbB0 },
    { 0xB1, c_FxOpbB1 },
    { 0xB2, c_FxOpbB2 },
    { 0xB3, c_FxOpbB3 },
    { 0xB4, c_FxOpbB4 },
    { 0xB5, c_FxOpbB5 },
    { 0xB6, c_FxOpbB6 },
    { 0xB7, c_FxOpbB7 },
    { 0xB8, c_FxOpbB8 },
    { 0xB9, c_FxOpbB9 },
    { 0xBA, c_FxOpbBA },
    { 0xBB, c_FxOpbBB },
    { 0xBC, c_FxOpbBC },
    { 0xBD, c_FxOpbBD },
    { 0xBE, c_FxOpbBE },
    { 0xBF, c_FxOpbBF },
};

static fxpatch const init_FxTablebA2[] = {
    { 0x05, c_FxOpb05 },
    { 0x06, c_FxOpb06 },
    { 0x07, c_FxOpb07 },
    { 0x08, c_FxOpb08 },
    { 0x09, c_FxOpb09 },
    { 0x0A, c_FxOpb0A },
    { 0x0B, c_FxOpb0B },
    { 0x0C, c_FxOpb0C },
    { 0x0D, c_FxOpb0D },
    { 0x0E, c_FxOpb0E },
    { 0x0F, c_FxOpb0F },
    { 0x10, c_FxOpb10 },
    { 0x11, c_FxOpb11 },
    { 0x12, c_FxOpb12 },
    { 0x13, c_FxOpb13 },
    { 0x14, c_FxOpb14 },
    { 0x15, c_FxOpb15 },
    { 0x16, c_FxOpb16 },
    { 0x17, c_FxOpb17 },
    { 0x18, c_FxOpb18 },
    { 0x19, c_FxOpb19 },
    { 0x1A, c_FxOpb1A },
    { 0x1B, c_FxOpb1B },
    { 0x1C, c_FxOpb1C },
    { 0x1D, c_FxOpb1D },
    { 0x1E, c_FxOpb1E },
    { 0x1F, c_FxOpb1F },
    { 0x3D, c_FxOpb3D },
    { 0x3E, c_FxOpb3E },
    { 0x3F, c_FxOpb3F },
    { 0xB0, c_FxOpbB0 },
    { 0xB1, c_FxOpbB1 },
    { 0xB2, c_FxOpbB2 },
    { 0xB3, c_FxOpbB3 },
    { 0xB4, c_FxOpbB4 },
    { 0xB5, c_FxOpbB5 },
    { 0xB6, c_FxOpbB6 },
    { 0xB7, c_FxOpbB7 },
    { 0xB8, c_FxOpbB8 },
    { 0xB9, c_FxOpbB9 },
    { 0xBA, c_FxOpbBA },
    { 0xBB, c_FxOpbBB },
    { 0xBC, c_FxOpbBC },
    { 0xBD, c_FxOpbBD },
    { 0xBE, c_FxOpbBE },
    { 0xBF, c_FxOpbBF },
};

static fxpatch const init_FxTablebA3[] = {
    { 0x05, c_FxOpb05 },
    { 0x06, c_FxOpb06 },
    { 0x07, c_FxOpb07 },
    { 0x08, c_FxOpb08 },
    { 0x09, c_FxOpb09 },
    { 0x0A, c_FxOpb0A },
    { 0x0B, c_FxOpb0B },
    { 0x0C, c_FxOpb0C },
    { 0x0D, c_FxOpb0D },
    { 0x0E, c_FxOpb0E },
    { 0x0F, c_FxOpb0F },
    { 0x10, c_FxOpb10 },
    { 0x11, c_FxOpb11 },
    { 0x12, c_FxOpb12 },
    { 0x13, c_FxOpb13 },
    { 0x14, c_FxOpb14 },
    { 0x15, c_FxOpb15 },
    { 0x16, c_FxOpb16 },
    { 0x17, c_FxOpb17 },
    { 0x18, c_FxOpb18 },
    { 0x19, c_FxOpb19 },
    { 0x1A, c_FxOpb1A },
    { 0x1B, c_FxOpb1B },
    { 0x1C, c_FxOpb1C },
    { 0x1D, c_FxOpb1D },
    { 0x1E, c_FxOpb1E },
    { 0x1F, c_FxOpb1F },
    { 0x3D, c_FxOpb3D },
    { 0x3E, c_FxOpb3E },
    { 0x3F, c_FxOpb3F },
    { 0xB0, c_FxOpbB0 },
    { 0xB1, c_FxOpbB1 },
    { 0xB2, c_FxOpbB2 },
    { 0xB3, c_FxOpbB3 },
    { 0xB4, c_FxOpbB4 },
    { 0xB5, c_FxOpbB5 },
    { 0xB6, c_FxOpbB6 },
    { 0xB7, c_FxOpbB7 },
    { 0xB8, c_FxOpbB8 },
    { 0xB9, c_FxOpbB9 },
    { 0xBA, c_FxOpbBA },
    { 0xBB, c_FxOpbBB },
    { 0xBC, c_FxOpbBC },
    { 0xBD, c_FxOpbBD },
    { 0xBE, c_FxOpbBE },
    { 0xBF, c_FxOpbBF },
};

static fxpatch const init_FxTablec[] = {
    { 0x05, c_FxOpc05 },
    { 0x06, c_FxOpc06 },
    { 0x07, c_FxOpc07 },
    { 0x08, c_FxOpc08 },
    { 0x09, c_FxOpc09 },
    { 0x0A, c_FxOpc0A },
    { 0x0B, c_FxOpc0B },
    { 0x0C, c_FxOpc0C },
    { 0x0D, c_FxOpc0D },
    { 0x0E, c_FxOpc0E },
    { 0x0F, c_FxOpc0F },
    { 0x10, c_FxOpc10 },
    { 0x11, c_FxOpc11 },
    { 0x12, c_FxOpc12 },
    { 0x13, c_FxOpc13 },
    { 0x14, c_FxOpc14 },
    { 0x15, c_FxOpc15 },
    { 0x16, c_FxOpc16 },
    { 0x17, c_FxOpc17 },
    { 0x18, c_FxOpc18 },
    { 0x19, c_FxOpc19 },
    { 0x1A, c_FxOpc1A },
    { 0x1B, c_FxOpc1B },
    { 0x1C, c_FxOpc1C },
    { 0x1D, c_FxOpc1D },
    { 0x1E, c_FxOpc1E },
    { 0x1F, c_FxOpc1F },
    { 0x3D, c_FxOpc3D },
    { 0x3E, c_FxOpc3E },
    { 0x3F, c_FxOpc3F },
    { 0xB0, c_FxOpcB0 },
    { 0xB1, c_FxOpcB1 },
    { 0xB2, c_FxOpcB2 },
    { 0xB3, c_FxOpcB3 },
    { 0xB4, c_FxOpcB4 },
    { 0xB5, c_FxOpcB5 },
    { 0xB6, c_FxOpcB6 },
    { 0xB7, c_FxOpcB7 },
    { 0xB8, c_FxOpcB8 },
    { 0xB9, c_FxOpcB9 },
    { 0xBA, c_FxOpcBA },
    { 0xBB, c_FxOpcBB },
    { 0xBC, c_FxOpcBC },
    { 0xBD, c_FxOpcBD },
    { 0xBE, c_FxOpcBE },
    { 0xBF, c_FxOpcBF },
};

static fxpatch const init_FxTablecA1[] = {
    { 0x05, c_FxOpc05 },
    { 0x06, c_FxOpc06 },
    { 0x07, c_FxOpc07 },
    { 0x08, c_FxOpc08 },
    { 0x09, c_FxOpc09 },
    { 0x0A, c_FxOpc0A },
    { 0x0B, c_FxOpc0B },
    { 0x0C, c_FxOpc0C },
    { 0x0D, c_FxOpc0D },
    { 0x0E, c_FxOpc0E },
    { 0x0F, c_FxOpc0F },
    { 0x10, c_FxOpc10 },
    { 0x11, c_FxOpc11 },
    { 0x12, c_FxOpc12 },
    { 0x13, c_FxOpc13 },
    { 0x14, c_FxOpc14 },
    { 0x15, c_FxOpc15 },
    { 0x16, c_FxOpc16 },
    { 0x17, c_FxOpc17 },
    { 0x18, c_FxOpc18 },
    { 0x19, c_FxOpc19 },
    { 0x1A, c_FxOpc1A },
    { 0x1B, c_FxOpc1B },
    { 0x1C, c_FxOpc1C },
    { 0x1D, c_FxOpc1D },
    { 0x1E, c_FxOpc1E },
    { 0x1F, c_FxOpc1F },
    { 0x3D, c_FxOpc3D },
    { 0x3E, c_FxOpc3E },
    { 0x3F, c_FxOpc3F },
    { 0xB0, c_FxOpcB0 },
    { 0xB1, c_FxOpcB1 },
    { 0xB2, c_FxOpcB2 },
    { 0xB3, c_FxOpcB3 },
    { 0xB4, c_FxOpcB4 },
    { 0xB5, c_FxOpcB5 },
    { 0xB6, c_FxOpcB6 },
    { 0xB7, c_FxOpcB7 },
    { 0xB8, c_FxOpcB8 },
    { 0xB9, c_FxOpcB9 },
    { 0xBA, c_FxOpcBA },
    { 0xBB, c_FxOpcBB },
    { 0xBC, c_FxOpcBC },
    { 0xBD, c_FxOpcBD },
    { 0xBE, c_FxOpcBE },
    { 0xBF, c_FxOpcBF },
};

static fxpatch const init_FxTablecA2[] = {
    { 0x05, c_FxOpc05 },
    { 0x06, c_FxOpc06 },
    { 0x07, c_FxOpc07 },
    { 0x08, c_FxOpc08 },
    { 0x09, c_FxOpc09 },
    { 0x0A, c_FxOpc0A },
    { 0x0B, c_FxOpc0B },
    { 0x0C, c_FxOpc0C },
    { 0x0D, c_FxOpc0D },
    { 0x0E, c_FxOpc0E },
    { 0x0F, c_FxOpc0F },
    { 0x10, c_FxOpc10 },
    { 0x11, c_FxOpc11 },
    { 0x12, c_FxOpc12 },
    { 0x13, c_FxOpc13 },
    { 0x14, c_FxOpc14 },
    { 0x15, c_FxOpc15 },
    { 0x16, c_FxOpc16 },
    { 0x17, c_FxOpc17 },
    { 0x18, c_FxOpc18 },
    { 0x19, c_FxOpc19 },
    { 0x1A, c_FxOpc1A },
    { 0x1B, c_FxOpc1B },
    { 0x1C, c_FxOpc1C },
    { 0x1D, c_FxOpc1D },
    { 0x1E, c_FxOpc1E },
    { 0x1F, c_FxOpc1F },
    { 0x3D, c_FxOpc3D },
    { 0x3E, c_FxOpc3E },
    { 0x3F, c_FxOpc3F },
    { 0xB0, c_FxOpcB0 },
    { 0xB1, c_FxOpcB1 },
    { 0xB2, c_FxOpcB2 },
    { 0xB3, c_FxOpcB3 },
    { 0xB4, c_FxOpcB4 },
    { 0xB5, c_FxOpcB5 },
    { 0xB6, c_FxOpcB6 },
    { 0xB7, c_FxOpcB7 },
    { 0xB8, c_FxOpcB8 },
    { 0xB9, c_FxOpcB9 },
    { 0xBA, c_FxOpcBA },
    { 0xBB, c_FxOpcBB },
    { 0xBC, c_FxOpcBC },
    { 0xBD, c_FxOpcBD },
    { 0xBE, c_FxOpcBE },
    { 0xBF, c_FxOpcBF },
};

static fxpatch const init_FxTablecA3[] = {
    { 0x05, c_FxOpc05 },
    { 0x06, c_FxOpc06 },
    { 0x07, c_FxOpc07 },
    { 0x08, c_FxOpc08 },
    { 0x09, c_FxOpc09 },
    { 0x0A, c_FxOpc0A },
    { 0x0B, c_FxOpc0B },
    { 0x0C, c_FxOpc0C },
    { 0x0D, c_FxOpc0D },
    { 0x0E, c_FxOpc0E },
    { 0x0F, c_FxOpc0F },
    { 0x10, c_FxOpc10 },
    { 0x11, c_FxOpc11 },
    { 0x12, c_FxOpc12 },
    { 0x13, c_FxOpc13 },
    { 0x14, c_FxOpc14 },
    { 0x15, c_FxOpc15 },
    { 0x16, c_FxOpc16 },
    { 0x17, c_FxOpc17 },
    { 0x18, c_FxOpc18 },
    { 0x19, c_FxOpc19 },
    { 0x1A, c_FxOpc1A },
    { 0x1B, c_FxOpc1B },
    { 0x1C, c_FxOpc1C },
    { 0x1D, c_FxOpc1D },
    { 0x1E, c_FxOpc1E },
    { 0x1F, c_FxOpc1F },
    { 0x3D, c_FxOpc3D },
    { 0x3E, c_FxOpc3E },
    { 0x3F, c_FxOpc3F },
    { 0xB0, c_FxOpcB0 },
    { 0xB1, c_FxOpcB1 },
    { 0xB2, c_FxOpcB2 },
    { 0xB3, c_FxOpcB3 },
    { 0xB4, c_FxOpcB4 },
    { 0xB5, c_FxOpcB5 },
    { 0xB6, c_FxOpcB6 },
    { 0xB7, c_FxOpcB7 },
    { 0xB8, c_FxOpcB8 },
    { 0xB9, c_FxOpcB9 },
    { 0xBA, c_FxOpcBA },
    { 0xBB, c_FxOpcBB },
    { 0xBC, c_FxOpcBC },
    { 0xBD, c_FxOpcBD },
    { 0xBE, c_FxOpcBE },
    { 0xBF, c_FxOpcBF },
};

/* PLOT handler selection. The table index encodes bits 0-1 colour depth,
 * bit 2 the transparency check ("z" when clear), bit 3 dithering ("d") and
 * bit 5 the low-nibble variant ("l") of the 256-colour handler. */
static fxop* const plot_a[4][4] = {
    { c_FxOp4C1282b, c_FxOp4C1284b, c_FxOp4C1288b, c_FxOp4C1288bl }, /* b */
    { c_FxOp4C1282bd, c_FxOp4C1284bd, c_FxOp4C1288bd, c_FxOp4C1288bdl }, /* bd */
    { c_FxOp4C1282bz, c_FxOp4C1284bz, c_FxOp4C1288bz, c_FxOp4C1288bzl }, /* bz */
    { c_FxOp4C1282bzd, c_FxOp4C1284bzd, c_FxOp4C1288bzd, c_FxOp4C1288bzdl }, /* bzd */
};

static fxop* const plot_b[4][4] = {
    { c_FxOp4C1282b, c_FxOp4C1284b, c_FxOp4C1288b, c_FxOp4C1288bl }, /* b */
    { c_FxOp4C1282bd, c_FxOp4C1284bd, c_FxOp4C1288b, c_FxOp4C1288bl }, /* bd */
    { c_FxOp4C1282bz, c_FxOp4C1284bz, c_FxOp4C1288bz, c_FxOp4C1288bzl }, /* bz */
    { c_FxOp4C1282bzd, c_FxOp4C1284bzd, c_FxOp4C1288bz, c_FxOp4C1288bzl }, /* bzd */
};

static void fill_plot(zreg* const dst, fxop* const (*const src)[4])
{
    for (u4 i = 0; i != 64; ++i) {
        u4 const c = i & 3;
        u4 const grp = (i & 4 ? 0 : 2) + (i & 8 ? 1 : 0);
        u4 const var = c == 0 ? 0 : c == 3 ? (i & 0x20 ? 3 : 2)
                                           : 1;
        dst[i] = A(src[grp][var]);
    }
}

/* Screen-line offset tables. Each is a 256x256 map from (x, y) to the word
 * offset of the containing 8x8 tile, with 0xFFFFFFFF where x is past the right
 * edge of the mode's screen. They are laid out back to back in SuperFX RAM,
 * one megabyte in, and the four *lineloc variables point at the starts. */
static u4* fill_lines(u4* p, u4 const width, u4 const tilerow)
{
    for (u4 y = 0; y != 256; ++y) {
        for (u4 x = 0; x != 256; ++x) {
            *p++ = x >= width ? 0xFFFFFFFF : (y >> 3) * tilerow + (x >> 3);
        }
    }
    return p;
}

/* The object-mode table has no width limit and interleaves the high bit of x
 * and y into the tile number differently from the bitmap modes. */
static u4* fill_objlines(u4* p)
{
    for (u4 y = 0; y != 256; ++y) {
        for (u4 x = 0; x != 256; ++x) {
            *p++ = (y & 0x80) * 2 + (x & 0x80) * 4 + ((y & 0x78) >> 3) + ((x & 0x78) * 2);
        }
    }
    return p;
}

/* The SuperFX sees the ROM twice: banks $00-$5F and $80-$DF map 64 whole banks
 * followed by 32 that only expose the upper half, and SuperFX RAM appears at
 * $70-$73 and $F0-$F3. */
static void fill_memtable(void)
{
    u1* p = romdata;

    for (u4 i = 0; i != 256; ++i)
        SfxMemTable[i] = A(romdata);

    u4 i = 0;
    for (u4 n = 0; n != 64; ++n, ++i, p += 65536)
        SfxMemTable[i] = A(p);
    p = romdata + 32768;
    for (u4 n = 0; n != 32; ++n, ++i, p += 65536 * 2)
        SfxMemTable[i] = A(p);

    for (u4 n = 0; n != 4; ++n)
        SfxMemTable[0x70 + n] = A(sfxramdata + 65536 * n);

    p = romdata;
    i = 0x80;
    for (u4 n = 0; n != 64; ++n, ++i, p += 65536)
        SfxMemTable[i] = A(p);
    p = romdata + 32768;
    for (u4 n = 0; n != 32; ++n, ++i, p += 65536 * 2)
        SfxMemTable[i] = A(p);

    for (u4 n = 0; n != 4; ++n)
        SfxMemTable[0xF0 + n] = A(sfxramdata + 65536 * n);
}

void InitFxTables(void)
{
    fill_plot(PLOTJmpa, plot_a);
    fill_plot(PLOTJmpb, plot_b);

    /* fxxand[i] clears the two bytes of the plane pair that pixel i&7 lives in. */
    for (u4 i = 0; i != 256; ++i)
        fxxand[i] = ~(0x0101u << ((i & 7) ^ 7));

    /* Expand each bit pair of i into a byte mask: bit 0 -> $00FF, bit 1 -> $FF00. */
    for (u4 i = 0; i != 256; ++i) {
        fxbit01[i] = (i & 0x01 ? 0x00FF : 0) | (i & 0x02 ? 0xFF00 : 0);
        fxbit23[i] = (i & 0x04 ? 0x00FF : 0) | (i & 0x08 ? 0xFF00 : 0);
        fxbit45[i] = (i & 0x10 ? 0x00FF : 0) | (i & 0x20 ? 0xFF00 : 0);
        fxbit67[i] = (i & 0x40 ? 0x00FF : 0) | (i & 0x80 ? 0xFF00 : 0);
    }

    u4* p = (u4*)(sfxramdata + 1024 * 1024);
    sfx128lineloc = A(p);
    p = fill_lines(p, 128, 16);
    sfx160lineloc = A(p);
    p = fill_lines(p, 160, 20);
    sfx192lineloc = A(p);
    p = fill_lines(p, 192, 24);
    sfxobjlineloc = A(p);
    fill_objlines(p);

    fill_memtable();

    fill(FxTable, init_FxTable, 256);
    fill(FxTableA1, init_FxTableA1, 256);
    fill(FxTableA2, init_FxTableA2, 256);
    fill(FxTableA3, init_FxTableA3, 256);

    /* The "b" and "c" cores start out as copies of the base tables. The
     * original copied all four in one block, relying on them being adjacent. */
    memcpy(FxTableb, FxTable, sizeof FxTable);
    memcpy(FxTablebA1, FxTableA1, sizeof FxTableA1);
    memcpy(FxTablebA2, FxTableA2, sizeof FxTableA2);
    memcpy(FxTablebA3, FxTableA3, sizeof FxTableA3);
    memcpy(FxTablec, FxTable, sizeof FxTable);
    memcpy(FxTablecA1, FxTableA1, sizeof FxTableA1);
    memcpy(FxTablecA2, FxTableA2, sizeof FxTableA2);
    memcpy(FxTablecA3, FxTableA3, sizeof FxTableA3);

    patch(FxTableb, init_FxTableb, lengthof(init_FxTableb));
    patch(FxTablebA1, init_FxTablebA1, lengthof(init_FxTablebA1));
    patch(FxTablebA2, init_FxTablebA2, lengthof(init_FxTablebA2));
    patch(FxTablebA3, init_FxTablebA3, lengthof(init_FxTablebA3));
    patch(FxTablec, init_FxTablec, lengthof(init_FxTablec));
    patch(FxTablecA1, init_FxTablecA1, lengthof(init_FxTablecA1));
    patch(FxTablecA2, init_FxTablecA2, lengthof(init_FxTablecA2));
    patch(FxTablecA3, init_FxTablecA3, lengthof(init_FxTablecA3));

    fill(FxTabled, init_FxTabled, 256);
    fill(FxTabledA1, init_FxTabledA1, 256);
    fill(FxTabledA2, init_FxTabledA2, 256);
    fill(FxTabledA3, init_FxTabledA3, 256);
}
