mirror of
https://github.com/trudnai/Steve2.git
synced 2025-01-02 03:29:28 +00:00
- Fixed CMP
- Fixed SBC - Fixed RAM access from Swift
This commit is contained in:
parent
c907317419
commit
b9e8640178
@ -13,9 +13,13 @@ class ViewController: NSViewController {
|
|||||||
@IBOutlet weak var display: NSTextFieldCell!
|
@IBOutlet weak var display: NSTextFieldCell!
|
||||||
|
|
||||||
func check() {
|
func check() {
|
||||||
let ram = UnsafeRawBufferPointer(start: &RAM+0x400, count: 0x400)
|
let textBufferPointer = UnsafeRawBufferPointer(start: &RAM+0x400, count: 0x400)
|
||||||
let string = String(bytes: ram, encoding: .utf8)
|
// let string = String(bytes: ram, encoding: .utf8)
|
||||||
print(string)
|
// print(string)
|
||||||
|
|
||||||
|
for (index, byte) in textBufferPointer.enumerated() {
|
||||||
|
print("byte \(index): \(byte)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,9 +67,9 @@ class ViewController: NSViewController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0, execute: {
|
// DispatchQueue.main.asyncAfter(deadline: .now() + 5.0, execute: {
|
||||||
self.check()
|
// self.check()
|
||||||
})
|
// })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ static inline void set_flags_NVZ( uint8_t test ) {
|
|||||||
|
|
||||||
static inline void set_flags_NZC( int test ) {
|
static inline void set_flags_NZC( int test ) {
|
||||||
set_flags_NZ(test);
|
set_flags_NZ(test);
|
||||||
m6502.flags.C = (unsigned)test > 0xFF;
|
m6502.flags.C = test >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void set_flags_NZCV( int test ) {
|
static inline void set_flags_NZCV( int test ) {
|
||||||
|
@ -53,10 +53,7 @@ static inline void ADC( uint8_t imm ) {
|
|||||||
(indirect),Y SBC (oper),Y F1 2 5*
|
(indirect),Y SBC (oper),Y F1 2 5*
|
||||||
**/
|
**/
|
||||||
static inline void SBC( uint8_t imm ) {
|
static inline void SBC( uint8_t imm ) {
|
||||||
int tmp = (int)m6502.A - imm - m6502.flags.C;
|
ADC( ~imm );
|
||||||
dbgPrintf("SBC A:%02X - i:%02X - C:%u = %02X", m6502.A, imm, m6502.flags.C, tmp);
|
|
||||||
m6502.A = (uint8_t)tmp;
|
|
||||||
set_flags_NZCV( tmp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __6502_INSTR_ARITHMETIC_H__
|
#endif // __6502_INSTR_ARITHMETIC_H__
|
||||||
|
@ -93,7 +93,6 @@ static inline void STR( uint8_t * dst, uint8_t imm ) {
|
|||||||
*dst = imm;
|
*dst = imm;
|
||||||
|
|
||||||
// uint16_t v = dst - RAM;
|
// uint16_t v = dst - RAM;
|
||||||
|
|
||||||
// if ( ( v >= 0x400 ) && ( v < 0x800 ) ) {
|
// if ( ( v >= 0x400 ) && ( v < 0x800 ) ) {
|
||||||
// char c = charConv[imm];
|
// char c = charConv[imm];
|
||||||
// if (( imm > ' ' ) && ( c < 0x7F ))
|
// if (( imm > ' ' ) && ( c < 0x7F ))
|
||||||
|
Loading…
Reference in New Issue
Block a user