address all detected similarities to C64 BASIC ROM.
This commit is contained in:
1 parent
dfd64a706f
commit
86ea5fba39
23 files changed
+130
-3
No files matched your search
@@ -45,3 +45,4 @@ test: newkern newbasic
|
||||
|
||||
testsimilarity: newkern newbasic src/similarity
|
||||
src/similarity kernal newrom
|
||||
src/similarity basic newrom
|
||||
@@ -284,7 +284,7 @@ next_row:
|
||||
lda #$00
|
||||
sta key_bucky_state
|
||||
lda ScanResult+6
|
||||
eor #$ff
|
||||
eor #%10000000
|
||||
and #%10000000 ;// Left shift
|
||||
rol
|
||||
rol
|
||||
@@ -294,7 +294,7 @@ next_row:
|
||||
|
||||
;; Right shift
|
||||
lda ScanResult+1
|
||||
eor #$ff
|
||||
eor #$10
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
@@ -305,7 +305,7 @@ next_row:
|
||||
|
||||
;; Control
|
||||
lda ScanResult+0
|
||||
eor #$ff
|
||||
eor #$04
|
||||
and #$04
|
||||
ora key_bucky_state
|
||||
sta key_bucky_state
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Fragment / LDA #$00 / STA $xxxx
|
||||
|
||||
Store zero in a memory location somewhere.
|
||||
Not copyrightable.
|
||||
@@ -0,0 +1,3 @@
|
||||
fragment / JMP $xx08
|
||||
|
||||
Not even a whole instruction. Not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
fragment / BNE <skip following JMP instruction> / JMP somewhere
|
||||
|
||||
Conditionally jump somewhere. Would be a single instruction
|
||||
on many architectures. Not copyrightable.
|
||||
@@ -0,0 +1,3 @@
|
||||
Conditionally decrement X before incrementing Y
|
||||
|
||||
Simple register manipulation. Not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
"ASIC" part of the word BASIC
|
||||
|
||||
Part of a word, the name of a common programming language.
|
||||
Not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
PHA / LDY #$00 / TYA
|
||||
|
||||
Save A on stack, load Y and A both with zero.
|
||||
Simple register manipulation. Not copyrightable.
|
||||
@@ -0,0 +1,3 @@
|
||||
EOR #$FF / AND #$80
|
||||
|
||||
Single instruction. Not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
List of ASCII/PETSCII keys corresponding to C64 key combinations
|
||||
|
||||
This is a list of facts, so is not copyrightable.
|
||||
Also too short to have any specific meaning.
|
||||
@@ -0,0 +1,4 @@
|
||||
Restore Y from stack, load A from memory location offset by Y
|
||||
|
||||
The 6502 is register poor, so it is very common to pull a register
|
||||
from the stack and then use it in some way. Not copyrightable.
|
||||
@@ -0,0 +1,5 @@
|
||||
PLA / TAX / LDA $nn
|
||||
|
||||
Restore X register value, load A from ZP memory location.
|
||||
Rather common fiddling of register values.
|
||||
Not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
TXA / PHA / LDA #$xx
|
||||
|
||||
Save X on stack, load A register with a value.
|
||||
Simple register manipulation. Not copyrightable.
|
||||
@@ -0,0 +1,5 @@
|
||||
TYA / CLC / ADC $nn
|
||||
|
||||
Perform addition to contents of Y register.
|
||||
Would be a single instruction on many architectures.
|
||||
Nothing creative. Not copyrightable.
|
||||
@@ -0,0 +1,6 @@
|
||||
TYA / PHA / JSR $xxxx
|
||||
|
||||
Save Y on stack and call a routine.
|
||||
This is common when calling routines that might corrupt
|
||||
a given register.
|
||||
Not creative. Not copyrightable.
|
||||
@@ -0,0 +1,3 @@
|
||||
STA $0200,X / INX
|
||||
|
||||
Loop fragment. Not copyrightable
|
||||
@@ -0,0 +1,4 @@
|
||||
LDX #$02 / LDA #$00
|
||||
|
||||
Load X and A registers with values.
|
||||
Not copyrightable.
|
||||
@@ -0,0 +1,43 @@
|
||||
LDA #$28 / BIT $nnnn
|
||||
|
||||
It is a common convention in 6502 programming to allow easy
|
||||
skipping over the next two bytes, to use the BIT instruction
|
||||
(opcode $2C) for this. This allows code like:
|
||||
|
||||
entry1:
|
||||
LDA #$01
|
||||
.byte $2C
|
||||
entry2:
|
||||
LDA #$02
|
||||
.byte $2C
|
||||
entry3:
|
||||
LDA #$03
|
||||
...
|
||||
; Do something based on value of A
|
||||
|
||||
This works because the BIT $nnnn instruction eats the two bytes
|
||||
that follows it as arguments, thus preventing the later LDA #$xx
|
||||
instructions from being run. This typically saves some bytes
|
||||
compared to do it any other way.
|
||||
|
||||
It is used on all 6502 platforms, for example this discussion
|
||||
on the trick for the Atari 2600:
|
||||
|
||||
http://atariage.com/forums/topic/100922-two-player-sprites-without-vdel/
|
||||
|
||||
It is not copyrightable.
|
||||
|
||||
Here is an example as we have used it to save space when determining
|
||||
the correct width of a line:
|
||||
|
||||
;; Get pointers to screen/colour RAM source
|
||||
lda screen_line_link_table+0
|
||||
bmi +
|
||||
lda #40
|
||||
.byte $2C ; BIT $nnnn to skip next instruction
|
||||
*
|
||||
lda #80
|
||||
sta load_or_scroll_temp_pointer+0
|
||||
sta load_save_verify_end_address+0
|
||||
|
||||
Only one of the LDA #40 or LDA #80 instructions will be executed.
|
||||
@@ -0,0 +1,5 @@
|
||||
TAX / TYA / PHA
|
||||
|
||||
Manipulate registers.
|
||||
Such transfering values to/from registers and the stack is common
|
||||
on 6502. Not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
CMP #$22 / BNE <skip a couple instructions> / LDA $nn
|
||||
|
||||
Take a branch based on value of A.
|
||||
Very common. Not copyrightable.
|
||||
@@ -0,0 +1,5 @@
|
||||
fragment / CLC / RTS
|
||||
|
||||
Return from subroutine with C clear.
|
||||
C flag is frequently used as a convention for returning success
|
||||
of failure from a routine, and thus is encountered quite often.
|
||||
@@ -0,0 +1,5 @@
|
||||
fragment / CLC / RTS
|
||||
|
||||
Clear carry flag before returning from a routine.
|
||||
The C flag is often used to indicate success/failure in
|
||||
routines. Thus is is not surprising and is not copyrightable.
|
||||
@@ -0,0 +1,4 @@
|
||||
SBC #$00 / LDA
|
||||
|
||||
Perform very small part of an arithmetic calculation.
|
||||
Not copyrightable.
|
||||
Reference in new issue
Block a user