Skip to content

Commit

Permalink
fix 1-cycle NOPs in coarse emulation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ziplantil committed Oct 21, 2022
1 parent 287d9b1 commit 699891e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion include/w65c02s.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
w65c02s.h -- cycle-accurate C emulator of the WDC 65C02S
as a single-header library
by ziplantil 2022 -- under the CC0 license
version: 2022-10-20
version: 2022-10-21
*******************************************************************************/

#ifndef W65C02S_H
Expand Down Expand Up @@ -2009,7 +2009,11 @@ static unsigned w65c02s_mode_int_wait_stop(W65C02S_PARAMS_MODE) {
}

static unsigned w65c02s_mode_implied_1c(W65C02S_PARAMS_MODE) {
#if W65C02S_COARSE
return 1; /* spent 1 cycle doing nothing */
#else
return 0; /* return immediately */
#endif
}

static void w65c02s_prerun_mode(struct w65c02s_cpu *cpu) {
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif

HEADERS=../include/w65c02s.h

CEFLAGS=-DW65C02S_LINK=1
CEFLAGS=

ifdef PROFILE
CFLAGS:=$(CFLAGS) -pg -g2
Expand Down
3 changes: 2 additions & 1 deletion test/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
w65c02s.h -- cycle-accurate C emulator of the WDC 65C02S
as a single-header library
by ziplantil 2022 -- under the CC0 license
version: 2022-10-20
version: 2022-10-21
busdump.c - bus dump program
*******************************************************************************/
Expand All @@ -14,6 +14,7 @@
#include <time.h>

#define W65C02S_IMPL 1
#define W65C02S_LINK 1
#include "w65c02s.h"

#if __STDC_VERSION__ >= 201112L
Expand Down
3 changes: 2 additions & 1 deletion test/busdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
w65c02s.h -- cycle-accurate C emulator of the WDC 65C02S
as a single-header library
by ziplantil 2022 -- under the CC0 license
version: 2022-10-20
version: 2022-10-21
busdump.c - bus dump program
*******************************************************************************/
Expand All @@ -13,6 +13,7 @@
#include <string.h>

#define W65C02S_IMPL 1
#define W65C02S_LINK 1
#include "w65c02s.h"

uint8_t ram[65536];
Expand Down
3 changes: 2 additions & 1 deletion test/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
w65c02s.h -- cycle-accurate C emulator of the WDC 65C02S
as a single-header library
by ziplantil 2022 -- under the CC0 license
version: 2022-10-20
version: 2022-10-21
monitor.c - test monitor
*******************************************************************************/
Expand All @@ -17,6 +17,7 @@
#endif

#define W65C02S_IMPL 1
#define W65C02S_LINK 1
#include "w65c02s.h"

uint8_t ram[65536];
Expand Down

0 comments on commit 699891e

Please sign in to comment.