Преглед изворни кода

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…
Откажи
Сачувај