public int Cur_Seed; // random numbers counter /// <summary> /// Create ayemu_ay_t /// </summary> public ayemu_ay_t() { magic = MAGIC1; table = new int[32]; type = new ayemu_chip_t(); eq = new int[6]; regs = new ayemu_regdata_t(); sndfmt = new ayemu_sndfmt_t(); vols = new int[6][]; for (int i = 0; i < 6; i++) { vols[i] = new int[32]; } }
/** Set chip type. */ public static int ayemu_set_chip_type(ayemu_ay_t ay, ayemu_chip_t type, int[] custom_table) { if (!check_magic(ay)) { return(0); } if (!(type == ayemu_chip_t.AYEMU_AY_CUSTOM || type == ayemu_chip_t.AYEMU_YM_CUSTOM) && custom_table != null) { ayemu_err = "For non-custom chip type 'custom_table' param must be NULL"; return(0); } switch (type) { case ayemu_chip_t.AYEMU_AY: case ayemu_chip_t.AYEMU_AY_LION17: set_table_ay(ay, Lion17_AY_table); break; case ayemu_chip_t.AYEMU_YM: case ayemu_chip_t.AYEMU_YM_LION17: set_table_ym(ay, Lion17_YM_table); break; case ayemu_chip_t.AYEMU_AY_KAY: set_table_ay(ay, KAY_AY_table); break; case ayemu_chip_t.AYEMU_YM_KAY: set_table_ym(ay, KAY_YM_table); break; case ayemu_chip_t.AYEMU_AY_CUSTOM: set_table_ay(ay, custom_table); break; case ayemu_chip_t.AYEMU_YM_CUSTOM: set_table_ym(ay, custom_table); break; default: ayemu_err = "Incorrect chip type"; return(0); } ay.default_chip_flag = 0; ay.dirty = true; return(1); }