mirror of
https://github.com/trudnai/Steve2.git
synced 2024-06-02 14:41:30 +00:00
BugFix: LDA (zp,X)
This commit is contained in:
parent
7b4f06ad70
commit
ceeba2793d
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -24,3 +24,5 @@ Resources/rom/Downloads/apple_iie_rom.zip
|
||||||
Resources/rom/Downloads/077-0026-0027 for IIe.zip
|
Resources/rom/Downloads/077-0026-0027 for IIe.zip
|
||||||
|
|
||||||
**/Contents/**
|
**/Contents/**
|
||||||
|
.DS_Store
|
||||||
|
Brewfile
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1102,10 +1102,13 @@ class ViewController: NSViewController {
|
||||||
|
|
||||||
if textNeedRender || shadowTxt != unicodeTextString {
|
if textNeedRender || shadowTxt != unicodeTextString {
|
||||||
shadowTxt = unicodeTextString
|
shadowTxt = unicodeTextString
|
||||||
// display.stringValue = unicodeTextString
|
|
||||||
let selectedRange = textDisplay.selectedRange()
|
let selectedRange = textDisplay.selectedRange()
|
||||||
textDisplay.string = unicodeTextString
|
|
||||||
textDisplay.setSelectedRange(selectedRange)
|
// DispatchQueue.main.async { [self] in
|
||||||
|
textDisplay.string = unicodeTextString
|
||||||
|
textDisplay.setSelectedRange(selectedRange)
|
||||||
|
// }
|
||||||
|
|
||||||
// let bold14 = NSFont.boldSystemFont(ofSize: 14.0)
|
// let bold14 = NSFont.boldSystemFont(ofSize: 14.0)
|
||||||
// let textColor = NSColor.red
|
// let textColor = NSColor.red
|
||||||
|
@ -1125,6 +1128,7 @@ class ViewController: NSViewController {
|
||||||
|
|
||||||
|
|
||||||
func UpdateCPUspeed() {
|
func UpdateCPUspeed() {
|
||||||
|
// DispatchQueue.main.async { [self] in
|
||||||
// under ~1.5 MHz -- 3 decimals to be able to display 1.023 MHz
|
// under ~1.5 MHz -- 3 decimals to be able to display 1.023 MHz
|
||||||
if ( (mhz < 1.4) && (mhz != floor(mhz)) ) {
|
if ( (mhz < 1.4) && (mhz != floor(mhz)) ) {
|
||||||
speedometer.stringValue = String(format: "%0.3lf MHz", mhz);
|
speedometer.stringValue = String(format: "%0.3lf MHz", mhz);
|
||||||
|
@ -1141,6 +1145,7 @@ class ViewController: NSViewController {
|
||||||
else {
|
else {
|
||||||
speedometer.stringValue = String(format: "%0.0lf MHz", mhz);
|
speedometer.stringValue = String(format: "%0.0lf MHz", mhz);
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1193,6 +1198,7 @@ class ViewController: NSViewController {
|
||||||
// Rendering is happening in the main thread, which has two implications:
|
// Rendering is happening in the main thread, which has two implications:
|
||||||
// 1. We can update UI elements
|
// 1. We can update UI elements
|
||||||
// 2. it is independent of the simulation, de that is running in the background thread while we are busy with rendering...
|
// 2. it is independent of the simulation, de that is running in the background thread while we are busy with rendering...
|
||||||
|
// DispatchQueue.global(qos: .userInitiated).async {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.UpdateText()
|
self.UpdateText()
|
||||||
self.UpdateCPUspeed()
|
self.UpdateCPUspeed()
|
||||||
|
@ -1306,6 +1312,8 @@ class ViewController: NSViewController {
|
||||||
|
|
||||||
let UpdateSemaphore = DispatchSemaphore(value: 1)
|
let UpdateSemaphore = DispatchSemaphore(value: 1)
|
||||||
func Update() {
|
func Update() {
|
||||||
|
// clk_6502_per_frm_max = 0
|
||||||
|
|
||||||
if UpdateSemaphore.wait(timeout: .now() + 0.001) == .timedOut {
|
if UpdateSemaphore.wait(timeout: .now() + 0.001) == .timedOut {
|
||||||
// get back here next time...
|
// get back here next time...
|
||||||
return
|
return
|
||||||
|
@ -1376,13 +1384,15 @@ class ViewController: NSViewController {
|
||||||
m6502.interrupt = NO_INT
|
m6502.interrupt = NO_INT
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m6502_Run()
|
// DispatchQueue.global(qos: .userInitiated).async {
|
||||||
|
m6502_Run()
|
||||||
|
// }
|
||||||
// cpuState = cpuState_running
|
// cpuState = cpuState_running
|
||||||
}
|
}
|
||||||
|
|
||||||
// video rendering
|
// video rendering
|
||||||
if ( frameCounter % video_fps_divider == 0 ) {
|
if ( frameCounter % video_fps_divider == 0 ) {
|
||||||
self.Render()
|
Render()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This should be in Debugger!
|
// TODO: This should be in Debugger!
|
||||||
|
|
|
@ -35,7 +35,12 @@
|
||||||
//#define INSTR INLINE static
|
//#define INSTR INLINE static
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
#define INSTR static inline
|
#ifdef DEBUG
|
||||||
|
#define INSTR static
|
||||||
|
#else
|
||||||
|
#define INSTR static inline __attribute__((always_inline)) UNUSED
|
||||||
|
//#define INSTR static inline __attribute__((always_inline)) __attribute__((regcall)) UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CRYSTAL_MHZ 14.31818 // NTSC version (original)
|
#define CRYSTAL_MHZ 14.31818 // NTSC version (original)
|
||||||
#define DEFAULT_MHZ_6502 (CRYSTAL_MHZ / 14) // 1.023 MHz
|
#define DEFAULT_MHZ_6502 (CRYSTAL_MHZ / 14) // 1.023 MHz
|
||||||
|
|
|
@ -1401,13 +1401,13 @@ INLINE uint8_t _src_ind_dis(void) {
|
||||||
effective address is word in (LL + X, LL + X + 1), inc. without carry: C.w($00LL + X)
|
effective address is word in (LL + X, LL + X + 1), inc. without carry: C.w($00LL + X)
|
||||||
**/
|
**/
|
||||||
INLINE uint16_t _addr_ind_X(void) {
|
INLINE uint16_t _addr_ind_X(void) {
|
||||||
return memread16( _fetch() + m6502.X );
|
return memread16( (uint8_t)(_fetch() + m6502.X) );
|
||||||
}
|
}
|
||||||
INLINE uint16_t _addr_ind_X_rd_dbg(void) {
|
INLINE uint16_t _addr_ind_X_rd_dbg(void) {
|
||||||
return _memread16_dbg( _fetch() + m6502.X );
|
return _memread16_dbg( (uint8_t)(_fetch() + m6502.X) );
|
||||||
}
|
}
|
||||||
INLINE uint16_t _addr_ind_X_dbg(void) {
|
INLINE uint16_t _addr_ind_X_dbg(void) {
|
||||||
uint16_t addr = _memread16_dbg(_fetch() + m6502.X);
|
uint16_t addr = _memread16_dbg( (uint8_t)(_fetch() + m6502.X));
|
||||||
check_mem_wr_bp(addr); // write debug on the target address
|
check_mem_wr_bp(addr); // write debug on the target address
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
@ -1415,7 +1415,7 @@ INLINE uint16_t _addr_ind_X_dis(void) {
|
||||||
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "($%02X,X)", memread8(m6502.PC) );
|
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "($%02X,X)", memread8(m6502.PC) );
|
||||||
_disPrintf(disassembly.comment, sizeof(disassembly.comment), "ind_addr:%04X", memread16( memread8(m6502.PC) + m6502.X) );
|
_disPrintf(disassembly.comment, sizeof(disassembly.comment), "ind_addr:%04X", memread16( memread8(m6502.PC) + m6502.X) );
|
||||||
|
|
||||||
return memread16( _fetch_dis() + m6502.X );
|
return memread16( (uint8_t)(_fetch_dis() + m6502.X) );
|
||||||
}
|
}
|
||||||
INLINE uint8_t _src_X_ind(void) {
|
INLINE uint8_t _src_X_ind(void) {
|
||||||
return _memread( _addr_ind_X() );
|
return _memread( _addr_ind_X() );
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define INLINE UNUSED
|
#define INLINE UNUSED
|
||||||
#else
|
#else
|
||||||
// #define INLINE static __attribute__((always_inline))
|
#define INLINE __attribute__((always_inline)) UNUSED
|
||||||
#define INLINE __attribute__((always_inline)) UNUSED
|
//#define INLINE __attribute__((always_inline)) __attribute__((fastcall)) UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user