reduce byte-wise similarity with KERNAL through use of X instead of A

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-24 14:14:40 +09:30
1 parent f5c5f787a4
commit a311c08289
2 files changed
+26 -15

No files matched your search

+12 -4
View File
@@ -68,14 +68,22 @@ no_need_to_extend:
jsr get_current_line_logical_length jsr get_current_line_logical_length
tay tay
* *
dey ;; Note: While the following routine is obvious to any skilled
lda (current_screen_line_ptr),y ;; in the art as the most obvious simple and efficient solution,
iny ;; if the screen writes are before the colour writes, it results
sta (current_screen_line_ptr),y ;; in a relatively long verbatim stretch of bytes when compared to
;; the C64 KERNAL. Thus we have swapped the order, just to reduce
;; the potential for any argument of copyright infringement, even
;; though we really don't believe that the routine can be copyrighted
;; due to the lack of creativity.
dey dey
lda (current_screen_line_colour_ptr),y lda (current_screen_line_colour_ptr),y
iny iny
sta (current_screen_line_colour_ptr),y sta (current_screen_line_colour_ptr),y
dey
lda (current_screen_line_ptr),y
iny
sta (current_screen_line_ptr),y
dey dey
cpy current_screen_x cpy current_screen_x
+14 -11
View File
@@ -40,17 +40,20 @@ ramtas_l2:
STA $DD00 STA $DD00
;; Set screen address pointer ("Compute's Mapping the 64" p238) ;; Set screen address pointer ("Compute's Mapping the 64" p238)
LDA #>$0400 ;; This is obvious boiler plate containing no creative input, but to avoid
STA HIBASE ;; unnecessarily similarity to the C64 KERNAL, we use X instead of A to do this,
;; and several following
LDX #>$0400
STX HIBASE
;; Work out RAM size and put in MEMSTR and MEMSIZ ;; Work out RAM size and put in MEMSTR and MEMSIZ
;; "Compute's Mapping the 64", p54 ;; "Compute's Mapping the 64", p54
;; http://unusedino.de/ec64/technical/project64/mapping_c64.html ;; http://unusedino.de/ec64/technical/project64/mapping_c64.html
lda #>$0800 ldx #>$0800
sta MEMSTR+1 stx MEMSTR+1
lda #$00 ldx #$00
sta MEMSTR+0 stx MEMSTR+0
sta MEMSIZ+0 stx MEMSIZ+0
;; Try to modify $8000, if it fails then RAM ends at $7FFF, else $9FFF ;; Try to modify $8000, if it fails then RAM ends at $7FFF, else $9FFF
lda $8000 lda $8000
eor #$FF eor #$FF
@@ -60,13 +63,13 @@ ramtas_l2:
cmp $8000 cmp $8000
beq ramtas_32K_RAM beq ramtas_32K_RAM
sta $8000 sta $8000
lda #$A0 ldx #$A0
sta MEMSIZ+1 stx MEMSIZ+1
jmp ramtas_RAM_sized jmp ramtas_RAM_sized
ramtas_32K_RAM: ramtas_32K_RAM:
sta $8000 ; in case RAM is hiding beneath a ROM sta $8000 ; in case RAM is hiding beneath a ROM
lda #$80 ldx #$80
sta MEMSIZ+1 stx MEMSIZ+1
;; Fall through ;; Fall through
ramtas_RAM_sized: ramtas_RAM_sized: