Commit Graph

31 Commits

Author SHA1 Message Date
Bradford Lamson-Scribner 6c789e3787 build: add small makefile with a test command that colors go test output 2020-06-04 21:07:12 -06:00
Bradford Lamson-Scribner 63a218e073 cmd/{root,run,version}: update the main pkg to be a CLI 2020-06-04 20:59:11 -06:00
Bradford Lamson-Scribner 67416900b4 internal/vm: update Appleone and all it’s `a` handlers to VM with `vm` handler 2020-06-04 20:47:35 -06:00
Bradford Lamson-Scribner b7a3ec4a6c internal/vm/{cpu,exec_funcs,opcodes,vm}: rename op -> operation for clarity (I hope), also general refactors 2020-05-31 22:50:07 -06:00
Bradford Lamson-Scribner 1b3f1f5b1f internal/vm/exec_funcs: remove the todo exec func! 2020-05-31 22:23:02 -06:00
Bradford Lamson-Scribner fea9257e84 internal/vm/{exec_funcs,vm}: refactor flag get/set/clears
Hit me like a brick wall, remove all the specific flag get/set/clear funcs
in favor of a single getFlag, setFlag, and clearFlag funcs that take a flag
(byte) as its argument.
2020-05-31 22:20:08 -06:00
Bradford Lamson-Scribner 2a17dda142 internal/vm/{cpu,mem,opcodes,vm}: stick to using byte instead of uint8
I can never decide on these things but I generally
prefer using `byte` in go.
2020-05-31 21:47:05 -06:00
Bradford Lamson-Scribner 01bb2379ce internal/vm/{exec_funcs,opcodes,vm}: update design around opcode addr and operand fetching
Refactor:
`(o op) getAddr` -> `(a *Appleone) getAddr`
`(o op) getOperand` `(a *Appleone) getOperand`

This makes way more sense to me and has been bothering me for a while.
2020-05-31 21:41:47 -06:00
Bradford Lamson-Scribner e5709ad58b Internal/vm/{exec_funcs,opcodes}: missed one, add exec func for BCS opcode 2020-05-31 21:34:48 -06:00
Bradford Lamson-Scribner a9a3ae5c0a internal/vm/{exec_funcs,opcodes,vm}: implement the rest of the opcode exec funcs 2020-05-31 21:32:00 -06:00
Bradford Lamson-Scribner ca699a78af internal/vm/{exec_funcs,opcodes,vm}: add support for executing LDX, LDY, and ADC 2020-05-31 09:59:58 -06:00
Bradford Lamson-Scribner 3730835466 Merge branch 'master' of github.com:bradford-hamilton/apple-1 2020-05-31 09:42:12 -06:00
Bradford Lamson-Scribner da70e2cfe3 internal/vm/{exec_funcs,opcodes}: add support for executing DEY, DEX, TAY, TAX opcodes 2020-05-31 09:41:57 -06:00
Bradford Lamson-Scribner 3743c0b0d8 internal/vm/{exec_funcs,opcodes}: add support for executing DEY, DEX, TAY, TAX opcodes 2020-05-31 09:38:10 -06:00
Bradford Lamson-Scribner 00cec5678e internal/vm/{exec_funcs,opcodes}: add support for executing INX 2020-05-31 08:59:09 -06:00
Bradford Lamson-Scribner 35bdeac2c8 internal/vm/{exec_funcs,opcodes}: handle INX instruction execution 2020-05-30 17:14:13 -06:00
Bradford Lamson-Scribner 71a1fa30ec merge small self-imposed conflict 2020-05-30 17:07:23 -06:00
Bradford Lamson-Scribner 8d6a0f8fd3 internal/vm: start playing with op executions
So far the pattern feels a tiny bit weird but also has been nice to work
with. As you can see, the op now contains it’s instruction execution func
which can be called directly from the op.
2020-05-30 17:06:36 -06:00
Bradford Lamson-Scribner d36d9c829a internal/vm: start playing with op executions
So far the pattern feels a tiny bit weird but also has been nice to work
with. As you can see, the op now contains it’s instruction execution func
which can be called directly from the op.
2020-05-30 17:06:14 -06:00
Bradford Lamson-Scribner 2bd748fccd docs: update some funcs with light docs 2020-05-30 11:13:35 -06:00
Bradford Lamson-Scribner cdca8f735d internal/vm: add the first few opcode handlers
Still a little iffy on the code design, although this seems like it
could be a desirable pattern. This way I would have to write an opcode
handler for all the cases and register it to the “op”. That way step
calls are super simple from Appleone’s point of view -> get the operation
and that operation has everything needed to execute on the vm.
2020-05-30 11:03:58 -06:00
Bradford Lamson-Scribner e91c4cdbca deps: initialize as go module 2020-05-30 11:01:48 -06:00
Bradford Lamson-Scribner 275143cf83 internal/cpu: small refactors to naming/comments 2020-05-28 08:04:12 -06:00
Bradford Lamson-Scribner 11dc1bdad9 internal/cpu: add cpu status register flags 2020-05-27 22:08:30 -06:00
Bradford Lamson-Scribner f77b94f885 internal/{cpu,vm}: add memory to the vm, and refactor cpu/vm/memory code 2020-05-27 21:19:43 -06:00
Bradford Lamson-Scribner 17df9a44f0 docs: add/update some godoc comments 2020-05-27 14:59:16 -06:00
Bradford Lamson-Scribner 3ff2e7f9ab pkg/appleone: add a public appleone pkg
Move cpu and opcodes (cpu package) to internal, while adding a public
appleone api package to `pkg/`
2020-05-27 14:52:39 -06:00
Bradford Lamson-Scribner 366b4ce53e pkg/{cpu,opcodes}: add some foundational work around the cpu and opcodes
Create some data structures to start building the CPU. Outside of some
new structures, the majority of the work in this CL was adding all
apple1 opcodes.
2020-05-27 14:41:38 -06:00
Bradford Lamson-Scribner b0bcd754d1 cmd: prepare cmd folder, as I will turn this into a cobra CLI at some point 2020-05-27 14:37:43 -06:00
Bradford Lamson-Scribner 5e3283bcc7 readme: update references I’m using to figure this thing out 2020-05-27 14:37:23 -06:00
Bradford Lamson-Scribner 3d1c093d95 initial commit 2020-05-24 15:41:24 -06:00