diff --git a/c64/kernal/chrout.s b/c64/kernal/chrout.s index b641accf..7f255c68 100644 --- a/c64/kernal/chrout.s +++ b/c64/kernal/chrout.s @@ -418,10 +418,10 @@ count_rows_loop: copy_line_down_loop: ldy #39 cl_inner: - lda (load_or_scroll_temp_pointer),y - sta (current_screen_line_ptr),y lda (load_save_verify_end_address),y sta (current_screen_line_colour_ptr),y + lda (load_or_scroll_temp_pointer),y + sta (current_screen_line_ptr),y dey bpl cl_inner @@ -429,13 +429,14 @@ cl_inner: ;; Low bytes are in common pairs ;; Old source is new destination - lda load_or_scroll_temp_pointer+0 - sta current_screen_line_ptr+0 - sta current_screen_line_colour_ptr+0 - lda load_or_scroll_temp_pointer+1 - sta current_screen_line_ptr+1 + ;; Use different registers to minimise byte similarity with C64 KERNAl + ldy load_or_scroll_temp_pointer+1 + sty current_screen_line_ptr+1 lda load_save_verify_end_address+1 + ldy load_or_scroll_temp_pointer+0 sta current_screen_line_colour_ptr+1 + sty current_screen_line_ptr+0 + sty current_screen_line_colour_ptr+0 ;; Decrementing source pointers lda load_or_scroll_temp_pointer+0 @@ -462,10 +463,10 @@ no_copy_down: ;; Erase newly inserted line ldy #79 * - lda #$20 - sta (current_screen_line_ptr),y lda text_colour sta (current_screen_line_colour_ptr),y + lda #$20 + sta (current_screen_line_ptr),y dey cpy #40 bne - @@ -530,10 +531,10 @@ scroll_screen_up: ldy #$00 ldx #3 scroll_copy_loop: - lda (load_or_scroll_temp_pointer),y - sta (current_screen_line_ptr),y lda (load_save_verify_end_address),y sta (current_screen_line_colour_ptr),y + lda (load_or_scroll_temp_pointer),y + sta (current_screen_line_ptr),y iny bne scroll_copy_loop @@ -554,10 +555,10 @@ scroll_copy_loop: sbc load_or_scroll_temp_pointer+0 tax scroll_copy_loop2: - lda (load_or_scroll_temp_pointer),y - sta (current_screen_line_ptr),y lda (load_save_verify_end_address),y sta (current_screen_line_colour_ptr),y + lda (load_or_scroll_temp_pointer),y + sta (current_screen_line_ptr),y iny dex bne scroll_copy_loop2 diff --git a/src/similarity.c b/src/similarity.c index 17c04e4a..6cb18b76 100644 --- a/src/similarity.c +++ b/src/similarity.c @@ -132,6 +132,7 @@ int main(int argc,char **argv) if (f1[i]==0x85) break; if (f1[i]==0xa2) break; // LDX #$xx if (f1[i]==0xa9) break; // LDA #$xx + if (f1[i]==0xa5) break; // LDA $xx if (f1[i]==0xa0) break; // LDY #$xx if (f1[i]==0x69) break; if (f1[i]==0xc9) break; diff --git a/strings/028D8D02 b/strings/028D8D02 new file mode 100644 index 00000000..34f38973 --- /dev/null +++ b/strings/028D8D02 @@ -0,0 +1,3 @@ +Fragment + STA $028D + +Only one whole instruction here. Nothing creative or copyrightable. diff --git a/strings/0D8D028D8D02 b/strings/0D8D028D8D02 new file mode 100644 index 00000000..5c96f0f9 --- /dev/null +++ b/strings/0D8D028D8D02 @@ -0,0 +1,5 @@ +ORA $028D / STA $028D + +This sequence of ORA + STA on a location is the simplest way to +perform a logical OR of the contents of the A register and a memory +location. Nothing creative or copyrightable. diff --git a/strings/880285D2 b/strings/880285D2 new file mode 100644 index 00000000..3ba49602 --- /dev/null +++ b/strings/880285D2 @@ -0,0 +1,6 @@ +Most likely LDA $0288 / STA $D2 - Set upper half of screen RAM address + +$0288 is publicly documented as the location where screen RAM lives. +$D1/$D2 is the current pointer to screen memory. This is the simplest +way to set this. Also, copying one memory location to another is not +copyrightable. diff --git a/strings/A5D185F3A5D2 b/strings/A5D185F3A5D2 new file mode 100644 index 00000000..64c69627 --- /dev/null +++ b/strings/A5D185F3A5D2 @@ -0,0 +1,4 @@ +STA $D1 / LDA $F3 / STA $D2 - manipulate screen pointers + +$D1 = screen RAM pointer +$F3 = colour RAM pointer diff --git a/strings/A9008D8D02 b/strings/A9008D8D02 new file mode 100644 index 00000000..7aa8b7e1 --- /dev/null +++ b/strings/A9008D8D02 @@ -0,0 +1,5 @@ +$00 -> $028D + +Simplest way to achieve this effect. Zeroing the contents +of a memory location is not copyrightable. + diff --git a/strings/A9118D0E b/strings/A9118D0E new file mode 100644 index 00000000..a891d851 --- /dev/null +++ b/strings/A9118D0E @@ -0,0 +1,5 @@ +$nn -> $nnnn + +Byte sequence is whole or part of instruction sequence +to store a specific value in a specific memory location. +Nothing creative or copyrightable. diff --git a/strings/A92091D1 b/strings/A92091D1 new file mode 100644 index 00000000..271d532d --- /dev/null +++ b/strings/A92091D1 @@ -0,0 +1,5 @@ +LDA #$20 / STA ($D1),Y - Write a space onto screen memory + +No simpler sequence for this. There are many functional requirements +that require writing space characters to the screen. Not copyrightable. +No creativity. diff --git a/strings/AD18D049028D18D0 b/strings/AD18D049028D18D0 new file mode 100644 index 00000000..001a7322 --- /dev/null +++ b/strings/AD18D049028D18D0 @@ -0,0 +1,4 @@ +LDA $D018 / EOR #$02 / STA $D018 + +This is the shortest simplest sequence to toggle bit 1 in +$D018. No creativitity. Not copyrightable. diff --git a/strings/AD860291F3 b/strings/AD860291F3 new file mode 100644 index 00000000..19e6960c --- /dev/null +++ b/strings/AD860291F3 @@ -0,0 +1,3 @@ +LDA $0286 / STA $F3 + +Copying a byte from one memory location to another is not copyrightable.