diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index 4af7ff64..f0b303ae 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -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 diff --git a/c64/aliases/,aliases_cpu.s b/c64/aliases/,aliases_cpu.s index 79caf2d8..2050e2af 100644 --- a/c64/aliases/,aliases_cpu.s +++ b/c64/aliases/,aliases_cpu.s @@ -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 diff --git a/src/build_segment.cc b/src/build_segment.cc index 9211a291..877d2591 100644 --- a/src/build_segment.cc +++ b/src/build_segment.cc @@ -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