Re: Proyecto Churrero: AVORCHA - Dudas y sugerencias
Publicado: Sab, 01 Mar 2014, 13:09
¡Muchas gracias Na_th_an.
Permíteme que te corrija por si alguno quiere hacer lo mismo, sería
items [flags [FLAG_SLOT_SELECTED]]
Esto funciona muy bien cuando pulso la tecla Z:
$this->bbcode_second_pass_code('', '#ifdef MODE_128K
wyz_play_sound (0);
#else
peta_el_beeper (2);
#endif
flags [FLAG_SLOT_SELECTED] = (flags [FLAG_SLOT_SELECTED] + 1) % MSC_MAXITEMS;
display_items ();
//print_str (10, 10, 7, " "&flags [ITEM_SLOT_SELECTED-1]);
if (items [flags [FLAG_SLOT_SELECTED]] == 0) {
print_str (10, 10, 7, "NADA");
}
if (items [flags [FLAG_SLOT_SELECTED]] == 23) {
print_str (10, 10, 7, "BELLOTA NORMAL");
}
}
key_z_pressed = 1;
} else {
key_z_pressed = 0;
}
#endif ')
Pero me gustaría que cada vez que se lanza la función, actualice el texto:
display_items (void)
Veo que debería ponerlo en este archivo: msc.bas, ya que genera el archivo msc-config.h
Pero todo cambio que hago a msc.bas no vuelca :S ¿Dónde estoy metiendo la pata?
Imagino que sería meterle aquí el código en printf, algo tal que así:
$this->bbcode_second_pass_code('', ' ' Generate display_items
If itemSetOr = 0 Then
' Horizontal
print #f, "void display_items (void) {"
print #f, " its_p = " & itemSetX & ";"
print #f, " for (its_it = 0; its_it < MSC_MAXITEMS; its_it ++) {"
print #f, " draw_coloured_tile (its_p, " & itemSetY & ", items [its_it]);"
print #f, " if (its_it != flags [FLAG_SLOT_SELECTED]) {"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p, 0, 0);"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p + 1, 0, 0);"
print #f, " } else {"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p, " & itemSelectClr & ", " & itemSelectC1 & ");"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p + 1, " & itemSelectClr & ", " & itemSelectC2 & ");"
print #f, " }"
print #f, " its_p += " & itemSetStep & ";"
print #f, " }"
print #f, "if (items [flags [FLAG_SLOT_SELECTED]] == 23) {"
print #f, "print_str (10, 10, 7, "BELLOTA NORMAL");"
print #f, "}"
print #f, "}"')
Permíteme que te corrija por si alguno quiere hacer lo mismo, sería
items [flags [FLAG_SLOT_SELECTED]]
Esto funciona muy bien cuando pulso la tecla Z:
$this->bbcode_second_pass_code('', '#ifdef MODE_128K
wyz_play_sound (0);
#else
peta_el_beeper (2);
#endif
flags [FLAG_SLOT_SELECTED] = (flags [FLAG_SLOT_SELECTED] + 1) % MSC_MAXITEMS;
display_items ();
//print_str (10, 10, 7, " "&flags [ITEM_SLOT_SELECTED-1]);
if (items [flags [FLAG_SLOT_SELECTED]] == 0) {
print_str (10, 10, 7, "NADA");
}
if (items [flags [FLAG_SLOT_SELECTED]] == 23) {
print_str (10, 10, 7, "BELLOTA NORMAL");
}
}
key_z_pressed = 1;
} else {
key_z_pressed = 0;
}
#endif ')
Pero me gustaría que cada vez que se lanza la función, actualice el texto:
display_items (void)
Veo que debería ponerlo en este archivo: msc.bas, ya que genera el archivo msc-config.h
Pero todo cambio que hago a msc.bas no vuelca :S ¿Dónde estoy metiendo la pata?
Imagino que sería meterle aquí el código en printf, algo tal que así:
$this->bbcode_second_pass_code('', ' ' Generate display_items
If itemSetOr = 0 Then
' Horizontal
print #f, "void display_items (void) {"
print #f, " its_p = " & itemSetX & ";"
print #f, " for (its_it = 0; its_it < MSC_MAXITEMS; its_it ++) {"
print #f, " draw_coloured_tile (its_p, " & itemSetY & ", items [its_it]);"
print #f, " if (its_it != flags [FLAG_SLOT_SELECTED]) {"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p, 0, 0);"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p + 1, 0, 0);"
print #f, " } else {"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p, " & itemSelectClr & ", " & itemSelectC1 & ");"
print #f, " sp_PrintAtInv (" & (itemSetY + 2) & ", its_p + 1, " & itemSelectClr & ", " & itemSelectC2 & ");"
print #f, " }"
print #f, " its_p += " & itemSetStep & ";"
print #f, " }"
print #f, "if (items [flags [FLAG_SLOT_SELECTED]] == 23) {"
print #f, "print_str (10, 10, 7, "BELLOTA NORMAL");"
print #f, "}"
print #f, "}"')