this is the commit that gave the ICE.

This commit is contained in:
Lokathor 2021-05-01 18:38:52 -06:00
parent 8f4847306d
commit 6a709689ed
7 changed files with 27 additions and 20 deletions

View file

@ -10,11 +10,12 @@ edition = "2018"
license = "Zlib OR Apache-2.0 OR MIT" license = "Zlib OR Apache-2.0 OR MIT"
[features] [features]
default = ["serial"] default = []
serial = ["embedded-hal", "nb"] serial = ["embedded-hal", "nb"]
[dependencies] [dependencies]
voladdress = { version = "0.4" } voladdress = { version = "0.4" }
#
embedded-hal = { version = "0.2.4", optional = true } embedded-hal = { version = "0.2.4", optional = true }
nb = { version = "1", optional = true } nb = { version = "1", optional = true }

View file

@ -2,7 +2,7 @@
#![no_main] #![no_main]
#![feature(isa_attribute)] #![feature(isa_attribute)]
use gba::{prelude::*, warn}; use gba::prelude::*;
const BLACK: Color = Color::from_rgb(0, 0, 0); const BLACK: Color = Color::from_rgb(0, 0, 0);
const RED: Color = Color::from_rgb(31, 0, 0); const RED: Color = Color::from_rgb(31, 0, 0);
@ -70,7 +70,6 @@ fn main() -> ! {
flags = flags.with_timer1(true); flags = flags.with_timer1(true);
} }
warn!("IM = {:?}", flags);
unsafe { IE.write(flags) }; unsafe { IE.write(flags) };
// Puts the CPU into low power mode until a VBlank IRQ is received. This // Puts the CPU into low power mode until a VBlank IRQ is received. This

View file

@ -7,7 +7,7 @@
// blue at the end. // blue at the end.
use core::cmp; use core::cmp;
use gba::{fatal, prelude::*, save::*, warn}; use gba::prelude::*;
fn set_screen_color(r: u8, g: u8, b: u8) { fn set_screen_color(r: u8, g: u8, b: u8) {
const SETTING: DisplayControl = DisplayControl::new().with_display_mode(3).with_display_bg2(true); const SETTING: DisplayControl = DisplayControl::new().with_display_mode(3).with_display_bg2(true);
@ -74,7 +74,7 @@ fn get_timer_secs() -> f32 {
macro_rules! output { macro_rules! output {
($($args:tt)*) => { ($($args:tt)*) => {
// we use warn so it shows by default on mGBA, nothing more. // we use warn so it shows by default on mGBA, nothing more.
warn!("{:7.3}\t{}", get_timer_secs(), format_args!($($args)*)) warning!("{:7.3}\t{}", get_timer_secs(), format_args!($($args)*))
}; };
} }

View file

@ -1,3 +1,5 @@
#![allow(unused_macros)]
//! Special utilities for debugging ROMs on various emulators. //! Special utilities for debugging ROMs on various emulators.
//! //!
//! This is the underlying implementation behind the various print macros in //! This is the underlying implementation behind the various print macros in
@ -20,7 +22,6 @@ pub mod nocash;
/// Furthermore on mGBA, there is a maximum length of 255 bytes per message. /// Furthermore on mGBA, there is a maximum length of 255 bytes per message.
/// ///
/// This has no effect outside of a supported emulator. /// This has no effect outside of a supported emulator.
#[macro_export]
macro_rules! fatal { macro_rules! fatal {
($($arg:tt)*) => {{ ($($arg:tt)*) => {{
use $crate::debug; use $crate::debug;
@ -30,6 +31,7 @@ macro_rules! fatal {
debug::crash() debug::crash()
}}; }};
} }
pub(crate) use fatal;
/// Delivers a error message to the emulator debug output. /// Delivers a error message to the emulator debug output.
/// ///
@ -37,7 +39,6 @@ macro_rules! fatal {
/// Furthermore on mGBA, there is a maximum length of 255 bytes per message. /// Furthermore on mGBA, there is a maximum length of 255 bytes per message.
/// ///
/// This has no effect outside of a supported emulator. /// This has no effect outside of a supported emulator.
#[macro_export]
macro_rules! error { macro_rules! error {
($($arg:tt)*) => {{ ($($arg:tt)*) => {{
use $crate::debug; use $crate::debug;
@ -46,6 +47,7 @@ macro_rules! error {
} }
}}; }};
} }
pub(crate) use error;
/// Delivers a warning message to the emulator debug output. /// Delivers a warning message to the emulator debug output.
/// ///
@ -53,8 +55,7 @@ macro_rules! error {
/// Furthermore on mGBA, there is a maximum length of 255 bytes per message. /// Furthermore on mGBA, there is a maximum length of 255 bytes per message.
/// ///
/// This has no effect outside of a supported emulator. /// This has no effect outside of a supported emulator.
#[macro_export] pub macro_rules! warning {
macro_rules! warn {
($($arg:tt)*) => {{ ($($arg:tt)*) => {{
use $crate::debug; use $crate::debug;
if !debug::is_debugging_disabled() { if !debug::is_debugging_disabled() {
@ -62,6 +63,7 @@ macro_rules! warn {
} }
}}; }};
} }
//pub(crate) use warning;
/// Delivers an info message to the emulator debug output. /// Delivers an info message to the emulator debug output.
/// ///
@ -69,7 +71,6 @@ macro_rules! warn {
/// Furthermore on mGBA, there is a maximum length of 255 bytes per message. /// Furthermore on mGBA, there is a maximum length of 255 bytes per message.
/// ///
/// This has no effect outside of a supported emulator. /// This has no effect outside of a supported emulator.
#[macro_export]
macro_rules! info { macro_rules! info {
($($arg:tt)*) => {{ ($($arg:tt)*) => {{
use $crate::debug; use $crate::debug;
@ -78,6 +79,7 @@ macro_rules! info {
} }
}}; }};
} }
pub(crate) use info;
/// Delivers a debug message to the emulator debug output. /// Delivers a debug message to the emulator debug output.
/// ///
@ -85,7 +87,6 @@ macro_rules! info {
/// Furthermore on mGBA, there is a maximum length of 255 bytes per message. /// Furthermore on mGBA, there is a maximum length of 255 bytes per message.
/// ///
/// This has no effect outside of a supported emulator. /// This has no effect outside of a supported emulator.
#[macro_export]
macro_rules! debug { macro_rules! debug {
($($arg:tt)*) => {{ ($($arg:tt)*) => {{
use $crate::debug; use $crate::debug;
@ -94,6 +95,7 @@ macro_rules! debug {
} }
}}; }};
} }
pub(crate) use debug;
/// A cross-emulator debug level. /// A cross-emulator debug level.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]

View file

@ -4,10 +4,8 @@
//! you've got some older version of things there might be any number of //! you've got some older version of things there might be any number of
//! differences or problems. //! differences or problems.
use crate::{ use super::{DebugInterface, DebugLevel};
debug::{DebugInterface, DebugLevel}, use crate::prelude::InitOnce;
sync::InitOnce,
};
use core::fmt::{Arguments, Write}; use core::fmt::{Arguments, Write};
use voladdress::*; use voladdress::*;

View file

@ -1,5 +1,5 @@
#![no_std] #![no_std]
#![feature(asm, global_asm, isa_attribute)] #![feature(asm, global_asm, pub_macro_rules, isa_attribute)]
//! This crate helps you write GBA ROMs. //! This crate helps you write GBA ROMs.
//! //!
@ -24,11 +24,18 @@
pub mod prelude { pub mod prelude {
pub use crate::mmio_types::*; pub use crate::mmio_types::*;
#[cfg(target_arch = "arm")]
pub use crate::mmio_addresses::*;
#[cfg(target_arch = "arm")] #[cfg(target_arch = "arm")]
pub use crate::bios::*; pub use crate::bios::*;
#[cfg(target_arch = "arm")]
pub use crate::debugging::warning;
#[cfg(target_arch = "arm")]
pub use crate::debugging::*;
#[cfg(target_arch = "arm")]
pub use crate::mmio_addresses::*;
#[cfg(target_arch = "arm")]
pub use crate::save::*;
#[cfg(target_arch = "arm")]
pub use crate::sync::*;
} }
pub mod mmio_types; pub mod mmio_types;
@ -48,7 +55,7 @@ pub mod sync;
pub mod save; pub mod save;
#[cfg(target_arch = "arm")] #[cfg(target_arch = "arm")]
pub mod debug; pub mod debugging;
/* /*
extern "C" { extern "C" {