fixed glaring flaw where emulator ignores -b flag. Keyboard polling isn't that important, this emulator is now usable
This commit is contained in:
parent
a71da555bd
commit
13b3ec4b8d
2 changed files with 3 additions and 4 deletions
|
@ -328,7 +328,6 @@ fn execute(opcode: u32, instruction: Instruction, mut cpu: Cpu) -> Cpu {
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if instruction.name == "NOP" {
|
if instruction.name == "NOP" {
|
||||||
cpu.incrementpc();
|
cpu.incrementpc();
|
||||||
} else if instruction.name == "LOAD_MEM_REG" {
|
} else if instruction.name == "LOAD_MEM_REG" {
|
||||||
|
@ -532,7 +531,7 @@ fn uperipherals(mut cpu: Cpu) -> Cpu {
|
||||||
|
|
||||||
|
|
||||||
#[allow(unreachable_code)]
|
#[allow(unreachable_code)]
|
||||||
pub fn emulate(debug: bool, keyboarddisable: bool) -> io::Result<()> {
|
pub fn emulate(debug: bool, keyboarddisable: bool, file: String) -> io::Result<()> {
|
||||||
let stdin = 0;
|
let stdin = 0;
|
||||||
let mut stdout = io::stdout();
|
let mut stdout = io::stdout();
|
||||||
|
|
||||||
|
@ -546,7 +545,7 @@ pub fn emulate(debug: bool, keyboarddisable: bool) -> io::Result<()> {
|
||||||
println!("If you see anything about opcodes above, there's a bug!");
|
println!("If you see anything about opcodes above, there's a bug!");
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut f = File::open("program.rom")?;
|
let mut f = File::open(file)?;
|
||||||
let mut buffer: Vec<u8> = vec![];
|
let mut buffer: Vec<u8> = vec![];
|
||||||
if debug { println!("Buffer initialised!"); }
|
if debug { println!("Buffer initialised!"); }
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,6 @@ fn main() {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
if args.platform == "food8" {
|
if args.platform == "food8" {
|
||||||
food8::emulate(args.debug, args.keyboarddisable);
|
food8::emulate(args.debug, args.keyboarddisable, args.binary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue