Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a base branch
...
Choose a head branch
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on May 05, 2012
Showing with 5 additions and 9 deletions.
  1. +2 −2 app/emulator.py
  2. +3 −7 emulator/emulator.c
View
@@ -2,7 +2,7 @@
import os
dll = CDLL(os.path.realpath(os.path.join(
- os.path.basename(__file__), '..', '_emulator')))
+ os.path.dirname(__file__), '..', '_emulator')))
class cEmulator(Structure):
_fields_ = [
@@ -54,7 +54,7 @@ def load_raw(self, data):
words = [(ord(a) << 8) | ord(b) for a, b in zip(data[::2], data[1::2])]
self.load(words)
def step(self):
- dll.step(byref(self.emulator))
+ dll.one_step(byref(self.emulator))
def n_steps(self, steps):
dll.n_steps(byref(self.emulator), steps)
def n_cycles(self, cycles):
View
@@ -432,7 +432,7 @@ void do_interrupt(Emulator *emulator) {
}
}
-static void _step(Emulator *emulator) {
+void one_step(Emulator *emulator) {
do {
unsigned short word = RAM(PC++);
unsigned char op = word & 0x1f;
@@ -451,13 +451,9 @@ static void _step(Emulator *emulator) {
}
}
-void step(Emulator *emulator) {
- _step(emulator);
-}
-
void n_steps(Emulator *emulator, unsigned int steps) {
for (unsigned int i = 0; i < steps; i++) {
- _step(emulator);
+ one_step(emulator);
if (HALT) {
break;
}
@@ -467,7 +463,7 @@ void n_steps(Emulator *emulator, unsigned int steps) {
void n_cycles(Emulator *emulator, unsigned int cycles) {
unsigned long long int cycle = CYCLE + cycles;
while (CYCLE < cycle) {
- _step(emulator);
+ one_step(emulator);
if (HALT) {
break;
}

No commit comments for this range