-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MEGA65: CPUaddr2Linear little hack + cleanups #140
- Loading branch information
Showing
6 changed files
with
17 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
## A work-in-progess MEGA65 (Commodore-65 clone origins) emulator | ||
## Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
## Copyright (C)2016-2021 LGB (Gábor Lénárt) <[email protected]> | ||
## Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* A work-in-progess MEGA65 (Commodore 65 clone origins) emulator | ||
Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2021 LGB (Gábor Lénárt) <[email protected]> | ||
Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -77,6 +77,8 @@ extern Uint32 cpu65_read_linear_long_opcode_callback ( const Uint8 index ); | |
|
||
extern void cpu65_illegal_opcode_callback ( void ); | ||
|
||
extern int memory_cpurd2linear_xlat ( Uint16 cpu_addr); | ||
|
||
CPU_CUSTOM_FUNCTIONS_INLINE_DECORATOR Uint8 cpu65_read_callback ( Uint16 addr ) { | ||
return CALL_MEMORY_READER(addr >> 8, addr); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2021 LGB (Gábor Lénárt) <[email protected]> | ||
Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
THIS IS AN UGLY PIECE OF SOURCE REALLY. | ||
|
@@ -876,9 +876,12 @@ int cpu65_step ( | |
case 0x00: /* BRK Implied */ | ||
#ifdef DEBUG_CPU | ||
DEBUG("CPU: WARN: BRK is about executing at PC=$%04X" NL, (CPU65.pc - 1) & 0xFFFF); | ||
#ifdef MEGA65 | ||
DEBUG("CPU: BRK opcode linear address is $%X" NL, memory_cpurd2linear_xlat((CPU65.pc - 1) & 0xFFFF)); | ||
#endif | ||
#endif | ||
pushWord(CPU65.pc + 1); | ||
push(cpu65_get_pf() | CPU65_PF_B); // BRK always pushes 'B' bit set (like PHP too, unlike hardware interrupts | ||
push(cpu65_get_pf() | CPU65_PF_B); // BRK always pushes 'B' bit set (like PHP too, unlike hardware interrupts) | ||
CPU65.pf_d = 0; // actually, NMOS CPU does not do this for real, only 65C02+ | ||
CPU65.pf_i = 1; | ||
CPU65.pc = readWord(0xFFFE); | ||
|