summaryrefslogtreecommitdiff
path: root/opcode.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2019-12-02 18:02:37 -0500
committermrb0nk500 <b0nk@b0nk.xyz>2019-12-02 18:18:36 -0500
commit245940209d5b8458f5d998783f7992573e2951bf (patch)
treee928a56d70f1a54a00bfe5597aa9bd8c712113b0 /opcode.c
parentcbad8aabbc82efbe7a49572a2da74224ae9c9f85 (diff)
Started implementing some pthreads support.
Diffstat (limited to 'opcode.c')
-rw-r--r--opcode.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/opcode.c b/opcode.c
index 4484466..e4bd510 100644
--- a/opcode.c
+++ b/opcode.c
@@ -372,7 +372,7 @@ void bfc(struct sux *cpu, uint8_t flag, uint64_t adr, uint8_t thread) {
uint64_t immaddr(struct sux *cpu, uint8_t thread, uint8_t size) {
uint64_t adr = cpu->pc[thread];
cpu->pc[thread]+=size;
- clk+=size;
+ clk++;
return adr;
}
@@ -386,7 +386,6 @@ uint64_t absaddr(struct sux *cpu, uint8_t thread) {
| (uint64_t)addr[cpu->pc[thread]+6] << 48
| (uint64_t)addr[cpu->pc[thread]+7] << 56;
cpu->pc[thread]+=8;
- ibcount+=8;
clk++;
return adr;
}
@@ -397,11 +396,7 @@ uint32_t zeromtx(struct sux *cpu, uint8_t thread) {
| (uint32_t)addr[cpu->pc[thread]+2] << 16
| (uint32_t)addr[cpu->pc[thread]+3] << 24;
cpu->pc[thread]+=4;
- ibcount+=4;
- if (ibcount > 8) {
- clk++;
- ibcount = 0;
- }
+ clk++;
return adr;
}
@@ -412,11 +407,7 @@ uint32_t zeromx(struct sux *cpu, uint8_t thread) {
| (uint32_t)addr[cpu->pc[thread]+3] << 24;
adr += cpu->x[thread];
cpu->pc[thread]+=4;
- ibcount+=4;
- if (ibcount > 8) {
- clk++;
- ibcount = 0;
- }
+ clk++;
return adr;
}
@@ -427,10 +418,6 @@ uint32_t zeromy(struct sux *cpu, uint8_t thread) {
| (uint32_t)addr[cpu->pc[thread]+3] << 24;
adr += cpu->y[thread];
cpu->pc[thread]+=4;
- ibcount+=4;
- if (ibcount > 8) {
- clk++;
- ibcount = 0;
- }
+ clk++;
return adr;
}