瀏覽代碼

Fix CPU cycle count overflow

A better idea might be to calculate the delta only rather than total cycles
master
Nathaniel Walizer 11 月之前
父節點
當前提交
00e20fa993
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. +2
    -2
      e6502.c
  2. +1
    -1
      e6502.h

+ 2
- 2
e6502.c 查看文件

@@ -933,8 +933,8 @@ int e6502_run(e6502_Core* core,
int instructions) {
int status = 0;
int i_count = 0;
int start = (instructions ? i_count : core->cycle);
int end = start + remaining;
uint64_t start = (instructions ? i_count : core->cycle);
uint64_t end = start + remaining;
int last_pc = -1;
while ((instructions ? i_count : core->cycle) < end) {
#ifdef E6502_HCF


+ 1
- 1
e6502.h 查看文件

@@ -45,7 +45,7 @@ typedef struct {
e6502_Write* bus_write;
void* bus_context;
#endif
int cycle;
uint64_t cycle;
} e6502_Core;

#define e6502_Memory_Stack (0x0100U)


Loading…
取消
儲存