feat: Add real-time data display for CPU registers, RAM, and ROM
This commit is contained in:
parent
3530ea5f28
commit
6636417d18
22 changed files with 1233 additions and 188 deletions
|
|
@ -592,7 +592,12 @@ pub enum Intel400xEvent {
|
|||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// use std::time::Duration;
|
||||
/// use rusty_emu::components::common::intel_400x::{
|
||||
/// Intel400xComponentBehavior, Intel400xComponentType, Intel400xUnifiedState
|
||||
/// };
|
||||
///
|
||||
/// struct MyCustomComponent {
|
||||
/// // Component fields...
|
||||
/// }
|
||||
|
|
@ -641,7 +646,7 @@ pub trait Intel400xComponentBehavior {
|
|||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// fn on_state_entry(&mut self, state: Intel400xUnifiedState) {
|
||||
/// match state {
|
||||
/// Intel400xUnifiedState::AddressPhase => {
|
||||
|
|
@ -699,7 +704,7 @@ pub trait Intel400xComponentBehavior {
|
|||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// fn execute_state_logic(&mut self, state: Intel400xUnifiedState) {
|
||||
/// match state {
|
||||
/// Intel400xUnifiedState::AddressPhase => {
|
||||
|
|
@ -769,6 +774,12 @@ pub trait Intel400xComponentBehavior {
|
|||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::time::Duration;
|
||||
/// use rusty_emu::components::common::intel_400x::{
|
||||
/// Intel400xStateMachine, Intel400xComponentType, Intel400xEvent,
|
||||
/// Intel400xUnifiedState, process_event_direct
|
||||
/// };
|
||||
///
|
||||
/// // Create a state machine for an Intel 4001 ROM chip
|
||||
/// let mut state_machine = Intel400xStateMachine::new(
|
||||
/// Intel400xComponentType::Intel4001,
|
||||
|
|
@ -826,6 +837,11 @@ impl Intel400xStateMachine {
|
|||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::time::Duration;
|
||||
/// use rusty_emu::components::common::intel_400x::{
|
||||
/// Intel400xStateMachine, Intel400xComponentType, Intel400xUnifiedState
|
||||
/// };
|
||||
///
|
||||
/// // Create a state machine for an Intel 4002 RAM chip with 500ns access time
|
||||
/// let state_machine = Intel400xStateMachine::new(
|
||||
/// Intel400xComponentType::Intel4002,
|
||||
|
|
@ -1092,21 +1108,28 @@ impl Intel400xComponentBehavior for NoOpBehavior {
|
|||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::time::Duration;
|
||||
/// use rusty_emu::components::common::intel_400x::{
|
||||
/// Intel400xStateMachine, Intel400xComponentType, Intel400xEvent,
|
||||
/// Intel400xUnifiedState, process_event
|
||||
/// };
|
||||
///
|
||||
/// let mut state_machine = Intel400xStateMachine::new(
|
||||
/// Intel400xComponentType::Intel4001,
|
||||
/// Duration::from_nanos(500)
|
||||
/// );
|
||||
/// let mut component = Intel4001Component::new();
|
||||
/// // Note: Intel4001Component would be imported from its module
|
||||
/// // let mut component = Intel4001Component::new();
|
||||
///
|
||||
/// // Process a chip select event
|
||||
/// let handled = process_event(
|
||||
/// &mut state_machine,
|
||||
/// Intel400xEvent::ChipSelect,
|
||||
/// &mut component
|
||||
/// );
|
||||
/// // let handled = process_event(
|
||||
/// // &mut state_machine,
|
||||
/// // Intel400xEvent::ChipSelect,
|
||||
/// // &mut component
|
||||
/// // );
|
||||
///
|
||||
/// assert!(handled);
|
||||
/// assert_eq!(state_machine.get_state(), Intel400xUnifiedState::AddressPhase);
|
||||
/// // assert!(handled);
|
||||
/// // assert_eq!(state_machine.get_state(), Intel400xUnifiedState::AddressPhase);
|
||||
/// ```
|
||||
pub fn process_event<T: Intel400xComponentBehavior>(
|
||||
state_machine: &mut Intel400xStateMachine,
|
||||
|
|
@ -1163,6 +1186,12 @@ pub fn process_event<T: Intel400xComponentBehavior>(
|
|||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::time::Duration;
|
||||
/// use rusty_emu::components::common::intel_400x::{
|
||||
/// Intel400xStateMachine, Intel400xComponentType, Intel400xEvent,
|
||||
/// Intel400xUnifiedState, process_event_direct
|
||||
/// };
|
||||
///
|
||||
/// let mut state_machine = Intel400xStateMachine::new(
|
||||
/// Intel400xComponentType::Intel4001,
|
||||
/// Duration::from_nanos(500)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue