adapted to Kick Assembler 65C02 support, slightly improved build segment tool

This commit is contained in:
FeralChild64 committed 2019-12-19 22:30:05 +01:00
1 parent 03b4e5146c
commit 42c516f44f
3 files changed
+42 -28

No files matched your search

+1 -14
View File
@@ -225,20 +225,6 @@
// Handle processor configuration
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
#define HAS_BCD_SAFE_INTERRUPTS
.pseudocommand phx { .byte $DA }
.pseudocommand phy { .byte $5A }
.pseudocommand plx { .byte $FA }
.pseudocommand ply { .byte $7A }
#endif
// Handle I/O configuration
#if CONFIG_RS232_UP2400 || CONFIG_RS232_UP9600
@@ -246,6 +232,7 @@
#endif
// Handle configuration of various features
#if CONFIG_BCD_SAFE_INTERRUPTS
+32 -13
View File
@@ -1,8 +1,27 @@
//
// Provide pseudocommands to make CPU optimizations easier
// Provide pseudocommands (and other goodies) to make CPU optimizations easier
//
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
.cpu _65c02
#define HAS_OPCODES_65C02
#endif
#if CONFIG_CPU_CSG_65CE02
#define HAS_OPCODES_65CE02
#endif
#if CONFIG_CPU_WDC_65816
#define HAS_OPCODES_65816
#endif
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
#define HAS_BCD_SAFE_INTERRUPTS
#endif
//
// These are not exactly for optimization - but to encourage proper usage of panic screen
//
@@ -35,7 +54,7 @@
.pseudocommand phx_trash_a
{
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
#if HAS_OPCODES_65C02
phx
#else
txa
@@ -45,7 +64,7 @@
.pseudocommand phy_trash_a
{
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
#if HAS_OPCODES_65C02
phy
#else
tya
@@ -55,7 +74,7 @@
.pseudocommand plx_trash_a
{
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
#if HAS_OPCODES_65C02
plx
#else
pla
@@ -65,7 +84,7 @@
.pseudocommand ply_trash_a
{
#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816
#if HAS_OPCODES_65C02
ply
#else
pla
@@ -81,7 +100,7 @@
.pseudocommand bcs_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $B3, mod(offset, $100), floor(offset / $100)
#else
@@ -93,7 +112,7 @@ __l:
.pseudocommand bcc_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $93, mod(offset, $100), floor(offset / $100)
#else
@@ -105,7 +124,7 @@ __l:
.pseudocommand beq_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02 && XXX_DISABLED // XXX causes problems with XEMU, investigate why
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $F3, mod(offset, $100), floor(offset / $100)
#else
@@ -117,7 +136,7 @@ __l:
.pseudocommand bne_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $D3, mod(offset, $100), floor(offset / $100)
#else
@@ -129,7 +148,7 @@ __l:
.pseudocommand bmi_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $33, mod(offset, $100), floor(offset / $100)
#else
@@ -141,7 +160,7 @@ __l:
.pseudocommand bpl_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $13, mod(offset, $100), floor(offset / $100)
#else
@@ -153,7 +172,7 @@ __l:
.pseudocommand bvc_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $53, mod(offset, $100), floor(offset / $100)
#else
@@ -165,7 +184,7 @@ __l:
.pseudocommand bvs_far dst
{
#if CONFIG_CPU_CSG_65CE02
#if HAS_OPCODES_65CE02
.var offset = mod($10000 + dst.getValue() - *, $10000)
.byte $73, mod(offset, $100), floor(offset / $100)
#else
+9 -1
View File
@@ -748,7 +748,8 @@ void BinningProblem::performObviousSteps(DualStream &logOutput)
std::string spacing;
bool repeat = true;
bool repeat = true;
bool lastGap = false;
while (repeat && !floatingRoutines.empty() && !gaps.empty())
{
repeat = false;
@@ -766,6 +767,13 @@ void BinningProblem::performObviousSteps(DualStream &logOutput)
}
}
if (!lastGap && gaps.size() == 1)
{
lastGap = true;
logOutput << "selected gap: $" << std::hex << gapAddress << std::dec <<
" (size: " << gaps[gapAddress] << ") - the last remaining" << "\n";
}
if (matchingGaps == 1)
{
// Routine can only be placed in this particular gap - do so