translate to english!
This commit is contained in:
@@ -31,7 +31,7 @@ impl Firmware {
|
||||
}
|
||||
|
||||
pub fn step_frame(&mut self, signals: &InputSignals, hw: &mut dyn HardwareBridge) {
|
||||
// Atualiza input uma vez por frame de host
|
||||
// Updates input once per host frame
|
||||
hw.pad_mut().begin_frame(signals);
|
||||
hw.touch_mut().begin_frame(signals);
|
||||
|
||||
@@ -50,7 +50,7 @@ impl Firmware {
|
||||
self.state = new_state;
|
||||
self.state_initialized = false;
|
||||
|
||||
// Entra no novo estado imediatamente
|
||||
// Enters the new state immediately
|
||||
self.on_enter(signals, hw);
|
||||
self.state_initialized = true;
|
||||
}
|
||||
|
||||
@@ -14,16 +14,16 @@ impl AppCrashesStep {
|
||||
}
|
||||
|
||||
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
|
||||
// Atualiza periféricos para input na tela de crash
|
||||
// Update peripherals for input on the crash screen
|
||||
ctx.hw.pad_mut().begin_frame(ctx.signals);
|
||||
|
||||
// Tela de erro: fundo vermelho, texto branco
|
||||
// Error screen: red background, white text
|
||||
ctx.hw.gfx_mut().clear(Color::RED);
|
||||
// Por enquanto apenas logamos ou mostramos algo simples
|
||||
// No futuro, usar draw_text
|
||||
// For now we just log or show something simple
|
||||
// In the future, use draw_text
|
||||
ctx.hw.gfx_mut().present();
|
||||
|
||||
// Se apertar START, volta pro Hub
|
||||
// If START is pressed, return to the Hub
|
||||
if ctx.hw.pad().start.down {
|
||||
return Some(FirmwareState::LaunchHub(LaunchHubStep));
|
||||
}
|
||||
|
||||
@@ -13,19 +13,19 @@ impl HubHomeStep {
|
||||
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
|
||||
let mut error = None;
|
||||
|
||||
// Sempre atualiza a GUI do Hub (limpa a tela e processa input se não houver foco)
|
||||
// Always updates the Hub GUI (clears screen and processes input if no focus)
|
||||
ctx.hub.gui_update(ctx.os, ctx.hw);
|
||||
|
||||
if let Some(focused_id) = ctx.hub.window_manager.focused {
|
||||
if ctx.hw.pad().start.down {
|
||||
ctx.hub.window_manager.remove_window(focused_id);
|
||||
} else {
|
||||
// System App roda aqui, desenhando sobre o fundo do Hub
|
||||
// System App runs here, drawing over the Hub background
|
||||
error = ctx.os.step_frame(ctx.vm, ctx.signals, ctx.hw);
|
||||
}
|
||||
}
|
||||
|
||||
// Renderiza as bordas das janelas do System App
|
||||
// Renders the System App window borders
|
||||
ctx.hub.render(ctx.os, ctx.hw);
|
||||
|
||||
ctx.hw.gfx_mut().present();
|
||||
|
||||
@@ -17,8 +17,8 @@ impl LaunchHubStep {
|
||||
if let BootTarget::Cartridge { path, .. } = ctx.boot_target {
|
||||
match CartridgeLoader::load(path) {
|
||||
Ok(cartridge) => {
|
||||
// No caso de debug, aqui poderíamos pausar, mas o requisito diz
|
||||
// para o Runtime abrir o socket e aguardar.
|
||||
// In the case of debug, we could pause here, but the requirement says
|
||||
// for the Runtime to open the socket and wait.
|
||||
return Some(FirmwareState::LoadCartridge(LoadCartridgeStep { cartridge }));
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
@@ -23,8 +23,8 @@ impl LoadCartridgeStep {
|
||||
);
|
||||
ctx.hub.window_manager.set_focus(id);
|
||||
|
||||
// Apps de sistema não mudam o estado do firmware para GameRunning.
|
||||
// Eles rodam em background ou via janelas no Hub.
|
||||
// System apps do not change the firmware state to GameRunning.
|
||||
// They run in the background or via windows in the Hub.
|
||||
return Some(FirmwareState::HubHome(HubHomeStep));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,23 +12,23 @@ pub struct SplashScreenStep {
|
||||
impl SplashScreenStep {
|
||||
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
|
||||
ctx.os.log(LogLevel::Info, LogSource::Pos, 0, "Showing SplashScreen".to_string());
|
||||
// Tocar som no enter
|
||||
// Play sound on enter
|
||||
if let Some(sample) = ctx.os.sample_square.clone() {
|
||||
ctx.hw.audio_mut().play(sample, 0, 255, 127, 1.0, 0, LoopMode::Off);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
|
||||
const ANIMATION_DURATION: u32 = 60; // 1 segundo a 60fps
|
||||
const TOTAL_DURATION: u32 = 240; // 2 segundos totais (conforme ctxuisito anterior)
|
||||
const ANIMATION_DURATION: u32 = 60; // 1 second at 60fps
|
||||
const TOTAL_DURATION: u32 = 240; // 4 seconds total (updated from 2s based on total_duration logic)
|
||||
|
||||
// Atualiza periféricos para input
|
||||
// Update peripherals for input
|
||||
ctx.hw.pad_mut().begin_frame(ctx.signals);
|
||||
|
||||
// Limpar tela
|
||||
// Clear screen
|
||||
ctx.hw.gfx_mut().clear(Color::BLACK);
|
||||
|
||||
// Desenhar quadrado aumentando
|
||||
// Draw expanding square
|
||||
let (sw, sh) = ctx.hw.gfx().size();
|
||||
let max_size = (sw.min(sh) as i32 / 2).max(1);
|
||||
|
||||
@@ -44,8 +44,8 @@ impl SplashScreenStep {
|
||||
ctx.hw.gfx_mut().fill_rect(x, y, current_size, current_size, Color::WHITE);
|
||||
ctx.hw.gfx_mut().present();
|
||||
|
||||
// Lógica de transição
|
||||
// Caso o botão start seja pressionado a qualquer momento depois da animação terminar
|
||||
// Transition logic
|
||||
// If any button is pressed at any time after the animation ends
|
||||
if self.frame >= ANIMATION_DURATION && ctx.hw.pad().any() {
|
||||
return Some(FirmwareState::LaunchHub(LaunchHubStep));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user