Commit Graph

4 Commits

Author SHA1 Message Date
Marco Peereboom 43f3d06988 Iterate over pointers instead of copies.
Modify addressable to become a pointer because Go's range does not
provide a pointer to the element but a copy of the element (urgh).

Go's range operator really can be considered broken.  In this case it
copies the addressable all the time which significantly slows things
down.  To boot, it isn't writing in the memory you think it is (it ends
up in the copy of memory).

Before the change:
$ go test -v -test.run Klaus
=== RUN TestKlausDormann6502
Running Klaus Dormann' 6502 functional tests. This may take some time...
Klaus Dormann's 6502 functional tests passed.
--- PASS: TestKlausDormann6502 (13.51s)
PASS
ok      github.com/ariejan/i6502        13.522s

After the change:
$ go test -v -test.run Klaus
=== RUN TestKlausDormann6502
Running Klaus Dormann' 6502 functional tests. This may take some time...
Klaus Dormann's 6502 functional tests passed.
--- PASS: TestKlausDormann6502 (4.87s)
PASS
ok      github.com/ariejan/i6502        4.877s
2015-04-08 16:56:35 -05:00
Ariejan de Vroom da43c2bca1 Update Memory interface
Because io.Reader and io.Writer already claim the functions Read and
Write it was necessary to rename the Memory interface methods Read and
Write to ReadByte and WriteByte.
2014-08-19 16:49:48 +02:00
Ariejan de Vroom 22432de785 Add docs for AddressBus; minor refactorings 2014-08-17 13:07:22 +02:00
Ariejan de Vroom e96ce1e84a Add basic Cpu/Bus/Ram architecture. 2014-08-13 09:26:33 +02:00