src/gbz80.c
void build_load_flag_block(gb_block *block)
{
    GList *instructions = NULL;

    /* run the fake instruction for flag loading */
    gbz80_inst *inst = g_new(gbz80_inst, 1);
    *inst = inst_table[0xfd];
    inst->args = NULL;
    inst->address = -1;
    instructions = g_list_prepend(instructions, inst);
    instructions = g_list_reverse(instructions);

    if (!optimize_cc(instructions)) {
        exit(1);
    }

    bool result = emit(block, instructions);
    g_list_free_full(instructions, g_free);

    if (result == false) {
        LOG_ERROR("Fail to compile instruction\n");
        exit(1);
    }
}
/* build_load_flag_block is used for generating JIT codes to load status flag.
 * Because the JIT codes for flag loading doesn't need any arguments, so we can
 * build it at the init stage and then cache it for reusing to avoid spending
 * time on avoidable codegen.
 */
build_load_flag_block is used for generating JIT codes to load status flag.
Because the JIT codes for flag loading doesn't need any arguments, so we can
build it at the init stage and then cache it for reusing to avoid spending
time on avoidable codegen.
build_load_flag_block is used for generating JIT codes to load status flag . Because the JIT codes for flag loading doesn ' t need any arguments so we can build it at the init stage and then cache it for reusing to avoid spending time on avoidable codegen .
void build_load_flag_block(gb_block *block)
{
    GList *instructions = NULL;
    gbz80_inst *inst = g_new(gbz80_inst, 1);
    *inst = inst_table[0xfd];
    inst->args = NULL;
    inst->address = -1;
    instructions = g_list_prepend(instructions, inst);
    instructions = g_list_reverse(instructions);
    if (!optimize_cc(instructions)) {
        exit(1);
    }
    bool result = emit(block, instructions);
    g_list_free_full(instructions, g_free);
    if (result == false) {
        LOG_ERROR("Fail to compile instruction\n");
        exit(1);
    }
}
void build_load_flag_block ( gb_block * block ) { GList * instructions = NULL ; gbz80_inst * inst = g_new ( gbz80_inst , 1 ) ; * inst = inst_table [ 0xfd ] ; inst -> args = NULL ; inst -> address = -1 ; instructions = g_list_prepend ( instructions , inst ) ; instructions = g_list_reverse ( instructions ) ; if ( ! optimize_cc ( instructions ) ) { exit ( 1 ) ; } bool result = emit ( block , instructions ) ; g_list_free_full ( instructions , g_free ) ; if ( result == false ) { LOG_ERROR ( " \n " ) ; exit ( 1 ) ; } }
build_load_flag_block is used for generating JIT codes to load status flag.
build_load_flag_block is used for generating JIT codes to load status flag .
/* run the fake instruction for flag loading */