Format code

This commit is contained in:
Matthias 2022-06-07 19:30:29 +02:00
parent e829122a5a
commit 363dc47755
6 changed files with 33 additions and 66 deletions

1
.gitignore vendored
View File

@ -65,3 +65,4 @@ TAGS.vi
\#*\# \#*\#
src/.DS_Store src/.DS_Store
tmp.*.rs tmp.*.rs
.vscode

View File

@ -26,8 +26,7 @@ fn main() {
0x4c, 0x12, 0x00, // Jump to .algo_ 0x4c, 0x12, 0x00, // Jump to .algo_
// .end // .end
0xa5, 0x00, // Load from S to A 0xa5, 0x00, // Load from S to A
0xff, 0xff, // .swap
// .swap
0xa6, 0x00, // load F to X 0xa6, 0x00, // load F to X
0xa4, 0x01, // load S to Y 0xa4, 0x01, // load S to Y
0x86, 0x01, // Store X to F 0x86, 0x01, // Store X to F

View File

@ -39,25 +39,13 @@ fn main() {
// "Load" a program // "Load" a program
let zero_page_data = [ let zero_page_data = [
// ZeroPage data start // ZeroPage data start
0x00, 0x00, 0x02, // ADC ZeroPage target
0x02, // ADC ZeroPage target 0x00, 0x04, // ADC ZeroPageX target
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // ADC IndexedIndirectX address
0x04, // ADC ZeroPageX target
0x00,
0x00,
0x00,
0x00,
0x10, // ADC IndexedIndirectX address
0x80, // ADC IndexedIndirectX address 0x80, // ADC IndexedIndirectX address
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ADC IndirectIndexedY address
0x00,
0x00,
0x00,
0x00,
0x08, // ADC IndirectIndexedY address
0x80, // ADC IndirectIndexedY address 0x80, // ADC IndirectIndexedY address
]; ];
@ -99,31 +87,11 @@ fn main() {
]; ];
let data = [ let data = [
0x00, 0x00, 0x09, // ADC Absolute target
0x09, // ADC Absolute target 0x00, 0x00, 0x40, // ADC AbsoluteY target
0x00, 0x00, 0x00, 0x00, 0x11, // ADC AbsoluteX target
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, // ADC IndexedIndirectX target
0x40, // ADC AbsoluteY target 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ADC IndirectIndexedY target
0x00,
0x00,
0x00,
0x11, // ADC AbsoluteX target
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x12, // ADC IndexedIndirectX target
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x06, // ADC IndirectIndexedY target
]; ];
cpu.memory.set_bytes(Address(0x0000), &zero_page_data); cpu.memory.set_bytes(Address(0x0000), &zero_page_data);

View File

@ -40,4 +40,3 @@ pub mod cpu;
pub mod instruction; pub mod instruction;
pub mod memory; pub mod memory;
pub mod registers; pub mod registers;