I had an idea, which is that it might be interesting to develop an evolution model for bots that can play pong. I imagined that the strategy would be evolved and eventually, you would get a more or less perfect player. Leaving aside the fact that this requires me to develop or reuse a pong … Continue reading Swiftvolution
Author: jeremy pereira
Data Structures and Data Caches – part 1
I came across a presentation on Youtube by Bjarne Soustrup in which he claimed that linked lists are usually the wrong data structure. As an example he used the following You have a random stream of N integers You have to insert each one in turn in the right place in a list to make … Continue reading Data Structures and Data Caches – part 1
Synchronising the Screen
At the end of my previous post, the spectrum was at the point where it would boot up and display the Sinclair copyright statement on the screen. Nothing else would happen and, indeed, you had to manually force the screen to refresh to get anything at all to display. Since then, it has now been … Continue reading Synchronising the Screen
Beginning the Spectrum
So I got bored of implementing instructions and decided, instead, to start implementing the actual Spectrum. This may seem a bit presumptuous, but it's more fun than just slogging through implementing instructions that nobody ever uses. To start, I decided to reuse the main window and memory window from my Z80Diagnostic app. This meant refactoring … Continue reading Beginning the Spectrum
The Refactoring Results
So I completed the refactoring of the instruction decoding to allow two sources and two destinations. I'm pretty pleased with the results. It's allowed me to completely eliminate several operations from the decoding code. All the jumps, calls and returns (except RETI, which is not implemented yet and RET cc which requires the stack to … Continue reading The Refactoring Results
Some Refactoring
Whilst I was writing my post about instruction decoding, a thought struck me about improving the structure of decoding. In the existing decoder, I do four things: Get the displacement, if needed Get the source operand, if needed Do the operation Save the result to the destination if needed This works fine but the "do … Continue reading Some Refactoring
Decoding
The Decoding Table Let us talk about instruction decoding. What is instruction decoding? It is the process of taking opcodes and operands and doing what they tell you. Instruction decoding is the heart of a processor emulation and in mine takes up the vast majority of lines of code. In his blog, Andre Weissflog characterises two … Continue reading Decoding