Compare commits

...

3 Commits

Author SHA1 Message Date
Tamas Rudnai ceeba2793d BugFix: LDA (zp,X) 2023-12-19 01:04:59 -08:00
Tamas Rudnai 7b4f06ad70 Logo Change? 2023-10-15 00:04:23 -07:00
Tamas Rudnai ee30dea0c9 Eliminated warnings 2023-10-15 00:02:48 -07:00
19 changed files with 23020 additions and 22999 deletions

2
.gitignore vendored
View File

@ -24,3 +24,5 @@ Resources/rom/Downloads/apple_iie_rom.zip
Resources/rom/Downloads/077-0026-0027 for IIe.zip
**/Contents/**
.DS_Store
Brewfile

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1102,10 +1102,13 @@ class ViewController: NSViewController {
if textNeedRender || shadowTxt != unicodeTextString {
shadowTxt = unicodeTextString
// display.stringValue = unicodeTextString
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 textColor = NSColor.red
@ -1125,6 +1128,7 @@ class ViewController: NSViewController {
func UpdateCPUspeed() {
// DispatchQueue.main.async { [self] in
// under ~1.5 MHz -- 3 decimals to be able to display 1.023 MHz
if ( (mhz < 1.4) && (mhz != floor(mhz)) ) {
speedometer.stringValue = String(format: "%0.3lf MHz", mhz);
@ -1141,6 +1145,7 @@ class ViewController: NSViewController {
else {
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:
// 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...
// DispatchQueue.global(qos: .userInitiated).async {
DispatchQueue.main.async {
self.UpdateText()
self.UpdateCPUspeed()
@ -1306,6 +1312,8 @@ class ViewController: NSViewController {
let UpdateSemaphore = DispatchSemaphore(value: 1)
func Update() {
// clk_6502_per_frm_max = 0
if UpdateSemaphore.wait(timeout: .now() + 0.001) == .timedOut {
// get back here next time...
return
@ -1376,13 +1384,15 @@ class ViewController: NSViewController {
m6502.interrupt = NO_INT
}
else {
m6502_Run()
// DispatchQueue.global(qos: .userInitiated).async {
m6502_Run()
// }
// cpuState = cpuState_running
}
// video rendering
if ( frameCounter % video_fps_divider == 0 ) {
self.Render()
Render()
}
// TODO: This should be in Debugger!

View File

@ -289,17 +289,17 @@ unsigned long long epoch = 0;
void interrupt_IRQ() {
void interrupt_IRQ(void) {
m6502.PC = memread16(IRQ_VECTOR);
// TODO: PUSH things onto stack?
}
void interrupt_NMI() {
void interrupt_NMI(void) {
m6502.PC = memread16(NMI_VECTOR);
// TODO: PUSH things onto stack?
}
void hardReset() {
void hardReset(void) {
m6502.PC = memread16(RESET_VECTOR);
// make sure it will be a cold reset...
_memwrite(0x3F4, 0);
@ -309,7 +309,7 @@ void hardReset() {
setFlags(0x25);
}
void softReset() {
void softReset(void) {
// m6502.PC = memread16(SOFTRESET_VECTOR);
m6502.PC = memread16( RESET_VECTOR );
@ -324,7 +324,7 @@ void softReset() {
}
void m6502_Run() {
void m6502_Run(void) {
// init time
//#ifdef CLK_WAIT
@ -497,7 +497,7 @@ void rom_loadFile( const char * bundlePath, const char * filename ) {
}
void openLog() {
void openLog(void) {
#ifdef DISASS_TRACE
outdev = fopen("/Users/trudnai/Library/Containers/com.trudnai.steveii/Data/disassembly_new.log", "w+");
#endif
@ -508,7 +508,7 @@ void openLog() {
}
void closeLog() {
void closeLog(void) {
if ( ( outdev ) && ( outdev != stdout ) && ( outdev != stderr ) ) {
fclose(outdev);
}
@ -681,7 +681,7 @@ void m6502_ColdReset( const char * bundlePath, const char * romFileName ) {
}
void tst6502() {
void tst6502(void) {
// insert code here...
printf("6502\n");

View File

@ -35,7 +35,12 @@
//#define INSTR INLINE static
//#endif
#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 DEFAULT_MHZ_6502 (CRYSTAL_MHZ / 14) // 1.023 MHz
@ -230,16 +235,16 @@ extern double * pdl_diffarr;
extern double mips;
extern double mhz;
#define DEFAULT_FPS 60U
#define DEF_VIDEO_DIV 2U
#define DEFAULT_FPS 30U
#define DEF_VIDEO_DIV 1U
#define DEF_SPKR_DIV 1U
#define DEF_DRV_LED_DIV 4U
#define ECO_VIDEO_DIV 4U
#define ECO_VIDEO_DIV 2U
#define GAME_FPS 600U // 180U // 480U
#define GAME_VIDEO_DIV 10U // (GAME_FPS / DEFAULT_FPS)
#define GAME_SPKR_DIV 10U
#define GAME_FPS 180U // 90U // 120U // 180U // 240U // 480U // 600U
#define GAME_VIDEO_DIV 1U // (GAME_FPS / DEFAULT_FPS)
#define GAME_SPKR_DIV 6U // 16U
extern unsigned int video_fps_divider;
extern unsigned int fps;

View File

@ -172,7 +172,7 @@ uint16_t m6502_dbg_bp_get_first(uint16_t * bp) {
/// m6502_dbg_bp_get_empty
/// Get an empty slot in the bp storage
/// @return Index of the empty breakpoint or -1 if error
int m6502_dbg_bp_get_empty() {
int m6502_dbg_bp_get_empty(void) {
for (int i = 0; i < DEBUG_MAX_BREAKPOINTS; i++) {
if ( breakpoints[i] == 0 ) {
return i;

View File

@ -175,7 +175,7 @@ void printDisassembly( FILE * f ) {
size_t disassLineLength = 0;
const char * disassemblyLine() {
const char * disassemblyLine(void) {
static char line[256];
snprintf( line, sizeof(line), "%s %s: %-11s%-4s%s",

View File

@ -88,7 +88,7 @@ extern void printDisassembly( FILE * f );
extern size_t disassLineLength;
extern const char * disassemblyLine();
extern const char * disassemblyLine(void);
#endif /* _6502_dis_utils_h */

View File

@ -291,7 +291,7 @@ static void spkr_debug(FILE * file) {
// initialize OpenAL
void spkr_init() {
void spkr_init(void) {
const char *defname = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
dbgPrintf2( "Default device: %s\n", defname );
@ -390,7 +390,7 @@ void spkr_init() {
}
void spkr_vol_up() {
void spkr_vol_up(void) {
spkr_vol += 0.1;
if ( spkr_vol > 1 ) {
spkr_vol = 1;
@ -399,7 +399,7 @@ void spkr_vol_up() {
al_check_error();
}
void spkr_vol_dn() {
void spkr_vol_dn(void) {
spkr_vol -= 0.1;
if ( spkr_vol < 0.1 ) {
// use mute to make it completely silent
@ -409,7 +409,7 @@ void spkr_vol_dn() {
al_check_error();
}
void spkr_mute() {
void spkr_mute(void) {
ALfloat vol = 0;
alGetListenerf(AL_GAIN, &vol);
al_check_error();
@ -459,7 +459,7 @@ void spkr_unqueueAll(void) {
// Dealloc OpenAL
void spkr_exit() {
void spkr_exit(void) {
if ( spkr_src[SPKR_SRC_GAME_SFX] ) {
spkr_stopAll();
spkr_unqueueAll();
@ -564,7 +564,7 @@ float SPKR_INITIAL_LEADING_EDGE = 0.64; // leading edge should be pretty steep
float SPKR_INITIAL_TRAILING_EDGE = 0.64; // need a bit of slope to get Xonix sound good
void spkr_toggle() {
void spkr_toggle(void) {
// do not sleep while sound is playing
m6502.ecoSpindown = ecoSpindown;
@ -941,7 +941,7 @@ INLINE static spkr_sample_t spkr_avg_new(const spkr_sample_t * buf, int len) {
}
INLINE static void spkr_downsample() {
INLINE static void spkr_downsample(void) {
for (int i = 0; i < SPKR_BUF_SIZE; ) {
int buf_idx = i * SPKR_OVERSAMPLING;
@ -956,7 +956,7 @@ INLINE static void spkr_downsample() {
#endif
INLINE static void spkr_filter() {
INLINE static void spkr_filter(void) {
// Debug SPKR Buffer Before filters
spkr_debug(spkr_debug_raw_file);
@ -1162,7 +1162,7 @@ void spkr_buffer_with_prebuf(void) {
}
void spkr_update() {
void spkr_update(void) {
if ( ++spkr_frame_cntr >= spkr_fps_divider ) {
spkr_frame_cntr = 0;
@ -1358,7 +1358,7 @@ void spkr_stop_sfx( ALuint src ) {
}
bool spkr_is_disk_motor_playing() {
bool spkr_is_disk_motor_playing(void) {
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= FRAME(iicplus_MHz_6502) ) ) {
ALenum state;
alGetSourcei( spkr_src[SPKR_SRC_DISK_MOTOR_SFX], AL_SOURCE_STATE, &state );
@ -1369,7 +1369,7 @@ bool spkr_is_disk_motor_playing() {
}
void spkr_play_disk_motor() {
void spkr_play_disk_motor(void) {
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= FRAME(iicplus_MHz_6502) ) ) {
spkr_play_sfx( spkr_src[SPKR_SRC_DISK_MOTOR_SFX], diskmotor_sfx, diskmotor_sfx_len );
}
@ -1383,7 +1383,7 @@ void spkr_stop_disk_motor( int time ) {
}
void spkr_play_disk_arm() {
void spkr_play_disk_arm(void) {
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= FRAME(iicplus_MHz_6502) ) ) {
if ( spkr_play_disk_ioerr_time == 0 ) {
spkr_play_sfx( spkr_src[SPKR_SRC_DISK_ARM_SFX], diskarm_sfx, diskarm_sfx_len );
@ -1393,7 +1393,7 @@ void spkr_play_disk_arm() {
}
void spkr_play_disk_ioerr() {
void spkr_play_disk_ioerr(void) {
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= FRAME(iicplus_MHz_6502) ) ) {
spkr_playqueue_sfx( spkr_src[SPKR_SRC_DISK_IOERR_SFX], diskioerr_sfx, diskioerr_sfx_len);
spkr_play_disk_ioerr_time = fps / 10; // 4 for 30 FPS, 8 for 60 FPS
@ -1401,19 +1401,19 @@ void spkr_play_disk_ioerr() {
}
void spkr_stopAll() {
void spkr_stopAll(void) {
for ( int i = 0; i < SOURCES_COUNT; i++ ) {
spkr_stop_sfx( spkr_src[i] );
}
}
void spkr_stop_game_sfx() {
void spkr_stop_game_sfx(void) {
spkr_stop_sfx( spkr_src[SPKR_SRC_GAME_SFX] );
}
void spkr_stop_disk_sfx() {
void spkr_stop_disk_sfx(void) {
spkr_stop_sfx( spkr_src[SPKR_SRC_DISK_ARM_SFX] );
spkr_stop_sfx( spkr_src[SPKR_SRC_DISK_MOTOR_SFX] );
spkr_stop_sfx( spkr_src[SPKR_SRC_DISK_IOERR_SFX] );
@ -1432,7 +1432,7 @@ void update_disk_sfx( int * time, ALuint src ) {
}
void spkr_update_disk_sfx() {
void spkr_update_disk_sfx(void) {
// is user speeds up the machine, disk sfx needs to be stopped
if ( ( ! disk_sfx_enabled ) || ( clk_6502_per_frm > FRAME(iicplus_MHz_6502) ) ) {
if ( spkr_play_disk_motor_time ) {

View File

@ -88,7 +88,7 @@ const uint8_t log2phy_cpm[16] = {
void disk_accelerator_speedup() {
void disk_accelerator_speedup(void) {
if ( ( diskAccelerator_enabled ) && ( FRAME(diskAccelerator_speed) >= clk_6502_per_frm ) ) {
clk_6502_per_frm =
clk_6502_per_frm_max = FRAME(diskAccelerator_speed); // clk_6502_per_frm_diskAccelerator;
@ -96,7 +96,7 @@ void disk_accelerator_speedup() {
}
}
void disk_phase() {
void disk_phase(void) {
int position = magnet_to_Poistion[disk.phase.magnet];
if ( position >= 0 ) {
@ -146,16 +146,16 @@ void disk_phase_off( uint8_t currentMagnet ) {
disk_phase();
}
void disk_motor_on() {
void disk_motor_on(void) {
spkr_play_disk_motor();
spkr_stop_disk_motor( -1 );
}
void disk_motor_off() {
void disk_motor_off(void) {
spkr_stop_disk_motor( 3 * fps ); // 3 second delay
}
uint8_t disk_read() {
uint8_t disk_read(void) {
dbgPrintf("io_DISK_READ (S%u)\n", 6);
disk.clk_last_access = m6502.clktime;

View File

@ -312,7 +312,7 @@ INLINE uint8_t woz_readByte(unsigned trk, unsigned ofs) {
return (*woz_trks)[trk].data[ofs];
}
uint8_t woz_read() {
uint8_t woz_read(void) {
if ( woz_tmap && woz_trks ) {
int track = woz_tmap->phase[disk.phase.count];
@ -500,7 +500,7 @@ void woz_free_buffer(void) {
}
int woz_parseBuffer() {
int woz_parseBuffer(void) {
woz_flags.disk_modified = 0;
woz_flags.disk_write_protected = 0;
@ -627,7 +627,7 @@ int woz_loadFile( const char * filename ) {
void woz_ask_to_save(void);
void woz_eject() {
void woz_eject(void) {
if ( woz_flags.disk_modified ) {
woz_ask_to_save();
}

View File

@ -34,7 +34,7 @@ double * pdl_valarr = pdl_value;
double * pdl_prevarr = pdl_prev;
double * pdl_diffarr = pdl_diff;
INLINE uint8_t pdl_reset() {
INLINE uint8_t pdl_reset(void) {
pdl_reset_time = m6502.clktime + m6502.clkfrm;
return 0;
}

View File

@ -159,7 +159,7 @@ INLINE void save_AUX(void) {
/// Save entire
void save_RAM() {
void save_RAM(void) {
// save the content of Shadow ZP + Stack
memcpy( (void*) currentZPSTCKMEM, shadowZPSTCKMEM, 0x200);
// save LoMem
@ -1137,7 +1137,7 @@ INLINE void _memwrite( uint16_t addr, uint8_t data ) {
Fetching 1 byte from memory address pc (program counter)
increase pc by one
**/
INLINE uint8_t _fetch() {
INLINE uint8_t _fetch(void) {
disHexB( disassembly.pOpcode, memread8_low(m6502.PC) );
#ifdef CLK_ABSOLUTE_PRECISE
if ( (m6502.PC & 0xFF) >= 0xFF ) {
@ -1147,7 +1147,7 @@ INLINE uint8_t _fetch() {
return memread8_low( m6502.PC++ );
}
INLINE uint8_t _fetch_dis() {
INLINE uint8_t _fetch_dis(void) {
_disHexB( &disassembly.pOpcode, memread8_low(m6502.PC) );
return memread8_low( m6502.PC++ );
}
@ -1156,7 +1156,7 @@ INLINE uint8_t _fetch_dis() {
Fetching 2 bytes as a 16 bit number from memory address pc (program counter)
increase pc by one
**/
INLINE uint16_t _fetch16() {
INLINE uint16_t _fetch16(void) {
uint16_t word = memread16( m6502.PC );
// disPrintf(disassembly.comment, "fetch16:%04X", word);
#ifdef CLK_ABSOLUTE_PRECISE
@ -1174,7 +1174,7 @@ INLINE uint16_t _fetch16() {
return word;
}
INLINE uint16_t _fetch16_dis() {
INLINE uint16_t _fetch16_dis(void) {
uint16_t word = memread16( m6502.PC );
// disPrintf(disassembly.comment, "fetch16:%04X", word);
m6502.PC += 2;
@ -1197,25 +1197,25 @@ INLINE uint16_t _fetch16_dis() {
abs .... absolute OPC $LLHH,X
operand is address; effective address is address incremented by X with carry **
**/
INLINE uint16_t _addr_abs() {
INLINE uint16_t _addr_abs(void) {
return _fetch16();
}
INLINE uint16_t _addr_abs_dbg() {
INLINE uint16_t _addr_abs_dbg(void) {
uint16_t addr = _fetch16();
check_mem_wr_bp(addr);
return addr;
}
INLINE uint16_t _addr_abs_dis() {
INLINE uint16_t _addr_abs_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%04X", memread16(m6502.PC));
return _fetch16_dis();
}
INLINE uint8_t _src_abs() {
INLINE uint8_t _src_abs(void) {
return _memread( _addr_abs() );
}
INLINE uint8_t _src_abs_dbg() {
INLINE uint8_t _src_abs_dbg(void) {
return _memread_dbg( _addr_abs() );
}
INLINE uint8_t _src_abs_dis() {
INLINE uint8_t _src_abs_dis(void) {
return _memread_dis( _addr_abs_dis() );
}
//INLINE uint8_t * dest_abs() {
@ -1223,27 +1223,27 @@ INLINE uint8_t _src_abs_dis() {
//}
INLINE int8_t _rel_addr() {
INLINE int8_t _rel_addr(void) {
return _fetch();
}
INLINE int8_t _rel_addr_dis() {
INLINE int8_t _rel_addr_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%04X", m6502.PC + 1 + (int8_t)memread8(m6502.PC));
return _fetch_dis();
}
INLINE uint16_t _abs_addr() {
INLINE uint16_t _abs_addr(void) {
return _fetch16();
}
INLINE uint16_t _abs_addr_dis() {
INLINE uint16_t _abs_addr_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%04X", memread16(m6502.PC));
return _fetch16_dis();
}
INLINE uint16_t _ind_addr() {
INLINE uint16_t _ind_addr(void) {
return memread16( _fetch16() );
}
INLINE uint16_t _ind_addr_dbg() {
INLINE uint16_t _ind_addr_dbg(void) {
return _memread16_dbg( _fetch16() );
}
INLINE uint16_t _ind_addr_dis() {
INLINE uint16_t _ind_addr_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "($%04X)", memread16(m6502.PC));
_disPrintf(disassembly.comment, sizeof(disassembly.comment), "ind_addr:%04X", memread16(memread16(m6502.PC)));
@ -1254,32 +1254,32 @@ INLINE uint16_t _ind_addr_dis() {
abs,X .... absolute, X-indexed OPC $LLHH,X
operand is address; effective address is address incremented by X with carry **
**/
INLINE uint16_t _abs_addr_X() {
INLINE uint16_t _abs_addr_X(void) {
return _fetch16() + m6502.X;
}
INLINE uint16_t _abs_addr_X_dis() {
INLINE uint16_t _abs_addr_X_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%04X,X", memread16(m6502.PC));
return _fetch16_dis() + m6502.X;
}
INLINE uint16_t _addr_abs_X() {
INLINE uint16_t _addr_abs_X(void) {
return _fetch16() + m6502.X;
}
INLINE uint16_t _addr_abs_X_dbg() {
INLINE uint16_t _addr_abs_X_dbg(void) {
uint16_t addr = _fetch16() + m6502.X;
check_mem_wr_bp(addr);
return addr;
}
INLINE uint16_t _addr_abs_X_dis() {
INLINE uint16_t _addr_abs_X_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%04X,X", memread16(m6502.PC));
return _fetch16_dis() + m6502.X;
}
INLINE uint8_t _src_abs_X() {
INLINE uint8_t _src_abs_X(void) {
return _memread( _addr_abs_X() );
}
INLINE uint8_t _src_abs_X_dbg() {
INLINE uint8_t _src_abs_X_dbg(void) {
return _memread_dbg( _addr_abs_X() );
}
INLINE uint8_t _src_abs_X_dis() {
INLINE uint8_t _src_abs_X_dis(void) {
return _memread_dis( _addr_abs_X_dis() );
}
//INLINE uint8_t * dest_abs_X() {
@ -1291,35 +1291,35 @@ INLINE uint8_t _src_abs_X_dis() {
abs,Y .... absolute, Y-indexed OPC $LLHH,Y
operand is address; effective address is address incremented by Y with carry **
**/
INLINE uint16_t _addr_abs_Y() {
INLINE uint16_t _addr_abs_Y(void) {
return _fetch16() + m6502.Y;
}
INLINE uint16_t _addr_abs_Y_dbg() {
INLINE uint16_t _addr_abs_Y_dbg(void) {
uint16_t addr = _fetch16() + m6502.Y;
check_mem_wr_bp(addr);
return addr;
}
INLINE uint16_t _addr_abs_Y_dis() {
INLINE uint16_t _addr_abs_Y_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%04X,Y", memread16(m6502.PC));
return _fetch16_dis() + m6502.Y;
}
INLINE uint8_t _src_abs_Y() {
INLINE uint8_t _src_abs_Y(void) {
return _memread(_addr_abs_Y());
}
INLINE uint8_t _src_abs_Y_dbg() {
INLINE uint8_t _src_abs_Y_dbg(void) {
return _memread_dbg(_addr_abs_Y());
}
INLINE uint8_t _src_abs_Y_dis() {
INLINE uint8_t _src_abs_Y_dis(void) {
return _memread_dis(_addr_abs_Y_dis());
}
//INLINE uint8_t * dest_abs_Y() {
// return WRLOMEM + addr_abs_Y();
//}
INLINE uint8_t _imm() {
INLINE uint8_t _imm(void) {
return _fetch();
}
INLINE uint8_t _imm_dis() {
INLINE uint8_t _imm_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "#$%02X", memread8(m6502.PC));
return _fetch_dis();
}
@ -1329,27 +1329,27 @@ INLINE uint8_t _imm_dis() {
zpg .... zeropage OPC $LL
operand is zeropage address (hi-byte is zero, address = $00LL)
**/
INLINE uint8_t _addr_zp() {
INLINE uint8_t _addr_zp(void) {
uint16_t addr = _fetch();
check_mem_wr_bp(addr);
return addr;
}
INLINE uint8_t _addr_zp_dbg() {
INLINE uint8_t _addr_zp_dbg(void) {
uint16_t addr = _fetch();
check_mem_wr_bp(addr);
return addr;
}
INLINE uint8_t _addr_zp_dis() {
INLINE uint8_t _addr_zp_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%02X", memread8(m6502.PC));
return _fetch_dis();
}
INLINE uint8_t _src_zp() {
INLINE uint8_t _src_zp(void) {
return memread8_low(_addr_zp());
}
INLINE uint8_t _src_zp_dbg() {
INLINE uint8_t _src_zp_dbg(void) {
return _memread_dbg(_addr_zp_dbg());
}
INLINE uint8_t _src_zp_dis() {
INLINE uint8_t _src_zp_dis(void) {
return memread8_low(_addr_zp_dis());
}
//INLINE uint8_t * dest_zp() {
@ -1371,27 +1371,27 @@ INLINE uint8_t _src_zp_dis() {
operand is zeropage address;
effective address is word in (LL, LL + 1), inc. without carry: C.w($00LL)
**/
INLINE uint16_t _addr_ind() {
INLINE uint16_t _addr_ind(void) {
return memread16( _fetch() );
}
INLINE uint16_t _addr_ind_dbg() {
INLINE uint16_t _addr_ind_dbg(void) {
uint16_t addr = _memread16_dbg(_fetch());
check_mem_wr_bp(addr); // write debug on the target address
return addr;
}
INLINE uint16_t _addr_ind_dis() {
INLINE uint16_t _addr_ind_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "($%02X,X)", memread8(m6502.PC) );
_disPrintf(disassembly.comment, sizeof(disassembly.comment), "ind_addr:%04X", memread16( memread8(m6502.PC)) );
return memread16( _fetch_dis() );
}
INLINE uint8_t _src_ind() {
INLINE uint8_t _src_ind(void) {
return _memread( _addr_ind() );
}
INLINE uint8_t _src_ind_dbg() {
INLINE uint8_t _src_ind_dbg(void) {
return _memread_dbg( _addr_ind_dbg() );
}
INLINE uint8_t _src_ind_dis() {
INLINE uint8_t _src_ind_dis(void) {
return _memread_dis( _addr_ind_dis() );
}
@ -1400,30 +1400,30 @@ INLINE uint8_t _src_ind_dis() {
operand is zeropage address;
effective address is word in (LL + X, LL + X + 1), inc. without carry: C.w($00LL + X)
**/
INLINE uint16_t _addr_ind_X() {
return memread16( _fetch() + m6502.X );
INLINE uint16_t _addr_ind_X(void) {
return memread16( (uint8_t)(_fetch() + m6502.X) );
}
INLINE uint16_t _addr_ind_X_rd_dbg() {
return _memread16_dbg( _fetch() + m6502.X );
INLINE uint16_t _addr_ind_X_rd_dbg(void) {
return _memread16_dbg( (uint8_t)(_fetch() + m6502.X) );
}
INLINE uint16_t _addr_ind_X_dbg() {
uint16_t addr = _memread16_dbg(_fetch() + m6502.X);
INLINE uint16_t _addr_ind_X_dbg(void) {
uint16_t addr = _memread16_dbg( (uint8_t)(_fetch() + m6502.X));
check_mem_wr_bp(addr); // write debug on the target address
return addr;
}
INLINE uint16_t _addr_ind_X_dis() {
INLINE uint16_t _addr_ind_X_dis(void) {
_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) );
return memread16( _fetch_dis() + m6502.X );
return memread16( (uint8_t)(_fetch_dis() + m6502.X) );
}
INLINE uint8_t _src_X_ind() {
INLINE uint8_t _src_X_ind(void) {
return _memread( _addr_ind_X() );
}
INLINE uint8_t _src_X_ind_dbg() {
INLINE uint8_t _src_X_ind_dbg(void) {
return _memread_dbg( _addr_ind_X_rd_dbg() );
}
INLINE uint8_t _src_X_ind_dis() {
INLINE uint8_t _src_X_ind_dis(void) {
return _memread_dis( _addr_ind_X_dis() );
}
//INLINE uint8_t * dest_X_ind() {
@ -1435,27 +1435,27 @@ INLINE uint8_t _src_X_ind_dis() {
operand is zeropage address;
effective address is word in (LL, LL + 1) incremented by Y with carry: C.w($00LL) + Y
**/
INLINE uint16_t _addr_ind_Y() {
INLINE uint16_t _addr_ind_Y(void) {
return memread16( _fetch() ) + m6502.Y;
}
INLINE uint16_t _addr_ind_Y_dbg() {
INLINE uint16_t _addr_ind_Y_dbg(void) {
uint16_t addr = _memread16_dbg( _fetch() ) + m6502.Y;
check_mem_wr_bp(addr);
return addr;
}
INLINE uint16_t _addr_ind_Y_dis() {
INLINE uint16_t _addr_ind_Y_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "($%02X),Y", memread8(m6502.PC) );
_disPrintf(disassembly.comment, sizeof(disassembly.comment), "ind_addr:%04X", memread16( memread8(m6502.PC) ) + m6502.Y );
return memread16( _fetch_dis() ) + m6502.Y;
}
INLINE uint8_t _src_ind_Y() {
INLINE uint8_t _src_ind_Y(void) {
return _memread( _addr_ind_Y() );
}
INLINE uint8_t _src_ind_Y_dbg() {
INLINE uint8_t _src_ind_Y_dbg(void) {
return _memread_dbg( _addr_ind_Y() );
}
INLINE uint8_t _src_ind_Y_dis() {
INLINE uint8_t _src_ind_Y_dis(void) {
return _memread_dis( _addr_ind_Y_dis() );
}
//INLINE uint8_t * dest_ind_Y() {
@ -1468,26 +1468,26 @@ INLINE uint8_t _src_ind_Y_dis() {
operand is zeropage address;
effective address is address incremented by X without carry **
**/
INLINE uint8_t _addr_zp_X() {
INLINE uint8_t _addr_zp_X(void) {
return _fetch() + m6502.X;
}
INLINE uint8_t _addr_zp_X_dbg() {
INLINE uint8_t _addr_zp_X_dbg(void) {
uint16_t addr = _fetch() + m6502.X;
check_mem_wr_bp(addr);
return addr;
}
INLINE uint8_t _addr_zp_X_dis() {
INLINE uint8_t _addr_zp_X_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%02X,X", memread8(m6502.PC));
return _fetch_dis() + m6502.X;
}
INLINE uint8_t _src_zp_X() {
INLINE uint8_t _src_zp_X(void) {
return memread8_low(_addr_zp_X());
}
INLINE uint8_t _src_zp_X_dbg() {
INLINE uint8_t _src_zp_X_dbg(void) {
return _memread_dbg(_addr_zp_X());
}
INLINE uint8_t _src_zp_X_dis() {
INLINE uint8_t _src_zp_X_dis(void) {
return memread8_low(_addr_zp_X_dis());
}
//INLINE uint8_t * dest_zp_X() {
@ -1499,26 +1499,26 @@ INLINE uint8_t _src_zp_X_dis() {
operand is zeropage address;
effective address is address incremented by Y without carry **
**/
INLINE uint8_t _addr_zp_Y() {
INLINE uint8_t _addr_zp_Y(void) {
return _fetch() + m6502.Y;
}
INLINE uint8_t _addr_zp_Y_dbg() {
INLINE uint8_t _addr_zp_Y_dbg(void) {
uint16_t addr = _fetch() + m6502.Y;
check_mem_wr_bp(addr);
return addr;
}
INLINE uint8_t _addr_zp_Y_dis() {
INLINE uint8_t _addr_zp_Y_dis(void) {
_disPrintf(disassembly.oper, sizeof(disassembly.oper), "$%02X,Y", memread8(m6502.PC));
return _fetch_dis() + m6502.Y;
}
INLINE uint8_t _src_zp_Y() {
INLINE uint8_t _src_zp_Y(void) {
return memread8_low(_addr_zp_Y());
}
INLINE uint8_t _src_zp_Y_dbg() {
INLINE uint8_t _src_zp_Y_dbg(void) {
return _memread_dbg(_addr_zp_Y());
}
INLINE uint8_t _src_zp_Y_dis() {
INLINE uint8_t _src_zp_Y_dis(void) {
return memread8_low(_addr_zp_Y_dis());
}
//INLINE uint8_t * dest_zp_Y() {
@ -1692,7 +1692,7 @@ void CxMemorySelect( MEMcfg_t newMEMcfg ) {
}
void resetMemory() {
void resetMemory(void) {
newMEMcfg = initMEMcfg;
WRZEROPG= Apple2_64K_MEM; // for Write $0000 - $0200 (shadow memory)
@ -1713,7 +1713,7 @@ void resetMemory() {
}
void initMemory() {
void initMemory(void) {
// Aux Video Memory
memset( Apple2_64K_AUX, 0, sizeof(Apple2_64K_AUX) );
// 64K Main Memory Area
@ -1730,13 +1730,13 @@ void initMemory() {
}
inline uint8_t *extracted() {
inline uint8_t *extracted(void) {
uint8_t * shadow = Apple2_64K_MEM + 0x400;
return shadow;
}
void textPageSelect() {
void textPageSelect(void) {
uint8_t textAuxPage = MEMcfg.is_80STORE && MEMcfg.txt_page_2;
if ( activeTextAuxPage != textAuxPage ) {
@ -1809,7 +1809,7 @@ void kbdInput ( uint8_t code ) {
}
void kbdUp () {
void kbdUp (void) {
// mark key depressed
Apple2_64K_RAM[io_KBDSTRB] &= 0x7F;
}

View File

@ -98,7 +98,7 @@ void hires_clearChanges(void) {
}
void hires_renderMono() {
void hires_renderMono(void) {
int height = PixelHeight;
// do not even render it...

View File

@ -32,8 +32,8 @@
#ifdef DEBUG
#define INLINE UNUSED
#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

BIN
stashed/Steve2Icon_.icns Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB