Adding RAM display
This commit is contained in:
parent
7c1b805f1a
commit
22fac611d8
BIN
src/color.hex
BIN
src/color.hex
Binary file not shown.
|
@ -21,4 +21,4 @@ macro_rules! prog_err {
|
|||
};
|
||||
}
|
||||
|
||||
prog_err!(glib::BoolError, crate::emulator::error::EmulatorError);
|
||||
prog_err!(glib::BoolError, crate::sixty_five::error::EmulatorError);
|
||||
|
|
169
src/main.rs
169
src/main.rs
|
@ -6,8 +6,8 @@ use gio::prelude::*;
|
|||
use gtk::prelude::*;
|
||||
use gtk::Builder;
|
||||
|
||||
mod emulator;
|
||||
use emulator::Emulator;
|
||||
mod sixty_five;
|
||||
use sixty_five::Emulator;
|
||||
mod graphic;
|
||||
use graphic::{Color, Image};
|
||||
|
||||
|
@ -30,92 +30,115 @@ impl std::convert::From<&str> for Cmd {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn init(app: >k::Application) {
|
||||
pub fn init(app: >k::Application) -> Result<(), ProgErr> {
|
||||
let img = Image::new();
|
||||
let (img_width, img_height) = (img.width, img.height);
|
||||
use std::sync::{Arc, Mutex};
|
||||
let img_m = Arc::from(Mutex::from(img));
|
||||
let palette = Arc::from(Mutex::from([Color::default(); 16]));
|
||||
|
||||
// Handle emulator CMDs
|
||||
let (tcmd, rcmd) = std::sync::mpsc::channel::<Cmd>();
|
||||
let (tdata, rdata) = glib::MainContext::channel(glib::source::Priority::default());
|
||||
let emulator = Arc::from(Mutex::from(Emulator::new()));
|
||||
{
|
||||
let emulator_clone = emulator.clone();
|
||||
std::thread::spawn(move || {
|
||||
let emulator = emulator_clone;
|
||||
loop {
|
||||
if let Ok(cmd) = rcmd.recv() {
|
||||
let mut emulator = match emulator.try_lock() {
|
||||
Err(_) => continue,
|
||||
Ok(v) => v,
|
||||
};
|
||||
match cmd {
|
||||
Cmd::Step => {
|
||||
let emulator = emulator.clone();
|
||||
std::thread::spawn(move || loop {
|
||||
if let Ok(cmd) = rcmd.recv() {
|
||||
let mut emulator = match emulator.try_lock() {
|
||||
Err(_) => continue,
|
||||
Ok(v) => v,
|
||||
};
|
||||
match cmd {
|
||||
Cmd::Step => {
|
||||
if let Err(e) = emulator.step() {
|
||||
println!("{:#?}", e);
|
||||
}
|
||||
}
|
||||
Cmd::Reset => {
|
||||
emulator.restart();
|
||||
emulator.ram = *include_bytes!("color.hex");
|
||||
}
|
||||
Cmd::Run => loop {
|
||||
if let Ok(_) = rcmd.recv_timeout(std::time::Duration::from_millis(1)) {
|
||||
break;
|
||||
} else {
|
||||
if let Err(e) = emulator.step() {
|
||||
println!("{:#?}", e);
|
||||
}
|
||||
}
|
||||
Cmd::Reset => {
|
||||
emulator.restart();
|
||||
emulator.ram = *include_bytes!("color.hex");
|
||||
}
|
||||
Cmd::Run => loop {
|
||||
if let Ok(cmd) = rcmd.recv_timeout(std::time::Duration::from_millis(1))
|
||||
{
|
||||
println!("Emulator error: {:?}", e);
|
||||
break;
|
||||
} else {
|
||||
emulator.step();
|
||||
println!("Tick {}", emulator.cycles);
|
||||
let page_02 = Vec::from(&emulator.ram[0x200..0x300]);
|
||||
tdata.send(page_02);
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
};
|
||||
println!("Tick {}", emulator.cycles);
|
||||
let page_02 = Vec::from(&emulator.ram[0x200..0x300]);
|
||||
tdata.send(page_02);
|
||||
}
|
||||
println!("Tick {}", emulator.cycles);
|
||||
let page_02 = Vec::from(&emulator.ram[0x200..0x300]);
|
||||
tdata.send(page_02);
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
};
|
||||
println!("Tick {}", emulator.cycles);
|
||||
let page_02 = Vec::from(&emulator.ram[0x200..0x300]);
|
||||
tdata.send(page_02);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let builder: Builder = Builder::new_from_string(include_str!("ui.glade"));
|
||||
let window: gtk::ApplicationWindow = builder.get_object("Window").unwrap();
|
||||
let da: gtk::DrawingArea = builder.get_object("Display").unwrap();
|
||||
|
||||
let drawing_area: gtk::DrawingArea = builder.get_object("Display").unwrap();
|
||||
let drawing_area = Arc::from(drawing_area);
|
||||
{
|
||||
da.set_size_request(img_width as i32, img_height as i32);
|
||||
drawing_area.set_size_request(img_width as i32, img_height as i32);
|
||||
let img_m = img_m.clone();
|
||||
da.connect_draw(move |_: >k::DrawingArea, ctx: &cairo::Context| {
|
||||
let img: Result<_, _> = img_m.try_lock();
|
||||
if let Ok(img) = img {
|
||||
println!("Redrawing!");
|
||||
img.draw(&ctx);
|
||||
}
|
||||
glib::signal::Inhibit(false)
|
||||
});
|
||||
drawing_area.connect_draw(
|
||||
move |drawing_area: >k::DrawingArea, ctx: &cairo::Context| {
|
||||
let widget_width = drawing_area.get_allocated_width();
|
||||
let widget_height = drawing_area.get_allocated_height();
|
||||
let img: Result<_, _> = img_m.try_lock();
|
||||
if let Ok(img) = img {
|
||||
img.draw(&ctx, (widget_width, widget_height));
|
||||
}
|
||||
glib::signal::Inhibit(false)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
for widget_name in &["Step", "Reset", "Run"] {
|
||||
for widget_name in &["Step", "Reset", "Run", "Stop"] {
|
||||
let tcmd_clone = tcmd.clone();
|
||||
let widget: gtk::Button = builder.get_object(widget_name).expect("Not found");
|
||||
widget.connect_clicked(move |s: >k::Button| {
|
||||
let name = s.get_widget_name().unwrap();
|
||||
let name = name.as_str();
|
||||
println!("Sending from {}", name);
|
||||
let cmd = Cmd::from(name);
|
||||
tcmd_clone.send(cmd).expect("Couldn't send cmd");
|
||||
tcmd_clone.send(Cmd::from(name)).expect("Couldn't send cmd");
|
||||
});
|
||||
}
|
||||
|
||||
// Ram Display
|
||||
{
|
||||
let ram_display_window: gtk::Window = builder.get_object("RamDisplayWindow").unwrap();
|
||||
let switch: gtk::Switch = builder.get_object("RamDisplay").expect("Not Found");
|
||||
switch.connect_state_set(move |switch: >k::Switch, state: bool| {
|
||||
if state {
|
||||
ram_display_window.show_all();
|
||||
} else {
|
||||
ram_display_window.close();
|
||||
}
|
||||
println!("{}", state);
|
||||
|
||||
Inhibit(false)
|
||||
});
|
||||
let ram_list: gtk::Window = builder.get_object("RamList").unwrap();
|
||||
}
|
||||
|
||||
let registers: gtk::Label = builder.get_object("Registers").unwrap();
|
||||
let registers = Mutex::from(registers);
|
||||
|
||||
// Receive GPU page
|
||||
{
|
||||
let drawing_area = drawing_area.clone();
|
||||
let palette = palette.clone();
|
||||
let emulator = emulator.clone();
|
||||
let img_m = img_m.clone();
|
||||
rdata.attach(None, move |data: Vec<_>| {
|
||||
let img: Result<_, _> = img_m.try_lock();
|
||||
println!("Received page");
|
||||
for line in data.chunks(16) {
|
||||
println!(
|
||||
|
@ -125,24 +148,14 @@ pub fn init(app: >k::Application) {
|
|||
.collect::<String>()
|
||||
)
|
||||
}
|
||||
if let Ok(mut img) = img {
|
||||
println!("Updating image");
|
||||
if let Ok(mut img) = img_m.try_lock() {
|
||||
let (w, h) = (img.width, img.height);
|
||||
let pixels: &mut [Color] = &mut img.pixels;
|
||||
let palette = [
|
||||
Color::from(0x00_00_00),
|
||||
Color::from(0xFF_00_00),
|
||||
Color::from(0x00_FF_00),
|
||||
Color::from(0xFF_FF_00),
|
||||
Color::from(0x00_00_FF),
|
||||
Color::from(0xFF_00_FF),
|
||||
Color::from(0x00_FF_FF),
|
||||
Color::from(0xFF_FF_FF),
|
||||
];
|
||||
for x in 0..w {
|
||||
for y in 0..h {
|
||||
let palette = palette.lock().expect("Couldn't get palette");
|
||||
for y in 0..h {
|
||||
for x in 0..w {
|
||||
let i = y * w + x;
|
||||
pixels[i] = palette[data[i] as usize & 0b111];
|
||||
pixels[i] = palette[data[i] as usize & 0x0F];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,19 +164,39 @@ pub fn init(app: >k::Application) {
|
|||
registers.set_text(&format!("{:#?}", emulator.cpu));
|
||||
}
|
||||
}
|
||||
da.queue_draw();
|
||||
drawing_area.queue_draw();
|
||||
glib::Continue(true)
|
||||
});
|
||||
}
|
||||
|
||||
// Color palette
|
||||
{
|
||||
for i in 0..16 {
|
||||
let drawing_area = drawing_area.clone();
|
||||
let palette = palette.clone();
|
||||
let color_button: gtk::ColorButton =
|
||||
builder.get_object(&format!("ColorPalette{}", i)).unwrap();
|
||||
color_button.connect_color_set(move |s: >k::ColorButton| {
|
||||
let color = s.get_rgba();
|
||||
let color = Color::from((color.red, color.green, color.blue));
|
||||
let mut palette = palette.lock().expect("Couldn't acquire palette lock");
|
||||
palette[i] = color;
|
||||
println!("New color: {:?}", color);
|
||||
drawing_area.queue_draw();
|
||||
});
|
||||
color_button.emit("color-set", &[])?;
|
||||
}
|
||||
}
|
||||
|
||||
window.set_application(Some(app));
|
||||
window.show_all();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() -> Result<(), ProgErr> {
|
||||
let app: gtk::Application =
|
||||
gtk::Application::new(Some("com.ducklings_corp.emulator"), Default::default())?;
|
||||
app.connect_activate(move |app| init(app));
|
||||
app.connect_activate(move |app| init(app).expect("Init failed"));
|
||||
app.run(&std::env::args().collect::<Vec<_>>());
|
||||
Ok(())
|
||||
}
|
||||
|
|
417
src/ui.glade
417
src/ui.glade
|
@ -2,6 +2,112 @@
|
|||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkWindow" id="RamDisplayWindow">
|
||||
<property name="name">RamDisplayWindow</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">15</property>
|
||||
<property name="margin_right">15</property>
|
||||
<property name="margin_top">10</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="label" translatable="yes">Jump to: </property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Address</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">.0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .A. B. C. D. E .F</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkApplicationWindow" id="Window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="default_width">800</property>
|
||||
|
@ -10,20 +116,33 @@
|
|||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">6502 Emulator</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButtonBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="layout_style">expand</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="Reset">
|
||||
<property name="label" translatable="yes">Reset</property>
|
||||
<property name="name">Reset</property>
|
||||
<object class="GtkButton" id="Run">
|
||||
<property name="label" translatable="yes">Run</property>
|
||||
<property name="name">Run</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
|
@ -35,9 +154,9 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="Run">
|
||||
<property name="label" translatable="yes">Run</property>
|
||||
<property name="name">Run</property>
|
||||
<object class="GtkButton" id="Stop">
|
||||
<property name="label" translatable="yes">Stop</property>
|
||||
<property name="name">Stop</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
|
@ -62,10 +181,37 @@
|
|||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="Reset">
|
||||
<property name="label" translatable="yes">Reset</property>
|
||||
<property name="name">Reset</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="RamDisplay">
|
||||
<property name="name">RamDisplay</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -76,21 +222,9 @@
|
|||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">6502 Emulator</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">2</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -98,15 +232,234 @@
|
|||
<property name="name">Registers</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">A: 0x00 X: 0x00 Y: 0x00 PC: 0x000</property>
|
||||
<property name="label" translatable="yes">Registers' status (Reset to see)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkGrid" id="ColorPalette">
|
||||
<property name="name">ColorPalette</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">False</property>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette0">
|
||||
<property name="name">ColorPalette0</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,0,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette1">
|
||||
<property name="name">ColorPalette1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,0,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette2">
|
||||
<property name="name">ColorPalette2</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,127,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette3">
|
||||
<property name="name">ColorPalette3</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,127,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette4">
|
||||
<property name="name">ColorPalette4</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,0,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette5">
|
||||
<property name="name">ColorPalette5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,0,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette6">
|
||||
<property name="name">ColorPalette6</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,127,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">6</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette7">
|
||||
<property name="name">ColorPalette7</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,127,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">7</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette8">
|
||||
<property name="name">ColorPalette8</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,85,85)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette9">
|
||||
<property name="name">ColorPalette9</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgba(255,85,85,0.9)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette10">
|
||||
<property name="name">ColorPalette10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,255,85)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette11">
|
||||
<property name="name">ColorPalette11</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(255,255,85)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette12">
|
||||
<property name="name">ColorPalette12</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,85,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette13">
|
||||
<property name="name">ColorPalette13</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(255,85,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette14">
|
||||
<property name="name">ColorPalette14</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,255,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">6</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette15">
|
||||
<property name="name">ColorPalette15</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(255,255,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">7</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
|
432
src/ui.glade~
432
src/ui.glade~
|
@ -2,6 +2,127 @@
|
|||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkWindow" id="RamDisplayWindow">
|
||||
<property name="name">RamDisplayWindow</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">15</property>
|
||||
<property name="margin_right">15</property>
|
||||
<property name="margin_top">10</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="label" translatable="yes">Jump to: </property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Address</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">.0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .A. B. C. D. E .F</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkApplicationWindow" id="Window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="default_width">800</property>
|
||||
|
@ -10,20 +131,33 @@
|
|||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">6502 Emulator</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButtonBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="layout_style">expand</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="Reset">
|
||||
<property name="label" translatable="yes">Reset</property>
|
||||
<property name="name">Reset</property>
|
||||
<object class="GtkButton" id="Run">
|
||||
<property name="label" translatable="yes">Run</property>
|
||||
<property name="name">Run</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
|
@ -35,9 +169,9 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="Run">
|
||||
<property name="label" translatable="yes">Run</property>
|
||||
<property name="name">Run</property>
|
||||
<object class="GtkButton" id="Stop">
|
||||
<property name="label" translatable="yes">Stop</property>
|
||||
<property name="name">Stop</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
|
@ -62,10 +196,37 @@
|
|||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="Reset">
|
||||
<property name="label" translatable="yes">Reset</property>
|
||||
<property name="name">Reset</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="RamDisplay">
|
||||
<property name="name">RamDisplay</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -76,21 +237,9 @@
|
|||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">6502 Emulator</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">2</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -98,15 +247,234 @@
|
|||
<property name="name">Registers</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">A: 0x00 X: 0x00 Y: 0x00 PC: 0x000</property>
|
||||
<property name="label" translatable="yes">Registers' status (Reset to see)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkGrid" id="ColorPalette">
|
||||
<property name="name">ColorPalette</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">False</property>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette0">
|
||||
<property name="name">ColorPalette0</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,0,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette1">
|
||||
<property name="name">ColorPalette1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,0,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette2">
|
||||
<property name="name">ColorPalette2</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,127,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette3">
|
||||
<property name="name">ColorPalette3</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,127,0)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette4">
|
||||
<property name="name">ColorPalette4</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,0,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette5">
|
||||
<property name="name">ColorPalette5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,0,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette6">
|
||||
<property name="name">ColorPalette6</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(0,127,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">6</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette7">
|
||||
<property name="name">ColorPalette7</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(127,127,127)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">7</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette8">
|
||||
<property name="name">ColorPalette8</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,85,85)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette9">
|
||||
<property name="name">ColorPalette9</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgba(255,85,85,0.9)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette10">
|
||||
<property name="name">ColorPalette10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,255,85)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette11">
|
||||
<property name="name">ColorPalette11</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(255,255,85)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette12">
|
||||
<property name="name">ColorPalette12</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,85,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette13">
|
||||
<property name="name">ColorPalette13</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(255,85,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette14">
|
||||
<property name="name">ColorPalette14</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(85,255,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">6</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="ColorPalette15">
|
||||
<property name="name">ColorPalette15</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="rgba">rgb(255,255,255)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">7</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
|
Loading…
Reference in New Issue