diff --git a/wip-hugo/routines/memory/memset.s b/wip-hugo/routines/memory/memset.s index 1322528..a0f0bac 100755 --- a/wip-hugo/routines/memory/memset.s +++ b/wip-hugo/routines/memory/memset.s @@ -11,7 +11,7 @@ LDX length +1 BNE big_set JMP small_set - +LDX length + 1 big_set: ;sets $ff of memory LDY #$ff .repeat $ff @@ -22,7 +22,7 @@ big_set: ;sets $ff of memory big_set_end: ;;set all hole $ff memory chunks! INC A_start + 1 - DEC length + 1 + DEX ;; length +1 -- BEQ small_set JMP big_set diff --git a/wip-hugo/routines/pixel/pixel_draw.s b/wip-hugo/routines/pixel/pixel_draw.s index fb91601..4dedf41 100755 --- a/wip-hugo/routines/pixel/pixel_draw.s +++ b/wip-hugo/routines/pixel/pixel_draw.s @@ -4,20 +4,6 @@ .proc pixel_draw; user-procedure :clobbers (A X Y) :clobbers-arguments 0 .include "pixel.inc" - ;; Lets clear some memory for later - LDA #$00 - STA btp_mem_pos + 1 - -calc_byte_to_paint: - ;; X = X_pos (mod 8) - LDA X_pos - AND #%00000111 - TAX - - ;;this is the same as: byte_to_paint = 2^X - LDA binary_factor, X;; (see END.s) - STA byte_to_paint - ;;FIND position to write byte_to_paint (btp_mem_pos) ;; + + + + + > X ;; + @@ -39,26 +25,33 @@ calc_byte_to_paint: ;; We need to remove the last digit if its still there ;; same as LSR ASR AND #%11111110 - TAX - LDA big_y_offset, X - STA btp_mem_pos - INX - LDA big_y_offset,X - STA btp_mem_pos + 1 - - ;; btp_mem_pos = big_x_offset + ;; big_y_offset + big_x_offset + CLC + ;;A = big_x_offset LDA #%11111000 AND X_pos - Add_16 btp_mem_pos, btp_mem_pos +1, A, #$00 + ADC big_y_offset, X + STA btp_mem_pos + LDA #$00 + INX + ADC big_y_offset, X + STA btp_mem_pos + 1 - ;; + smal_y_offset + ;; + small_y_offset LDA #%00000111 ; A = y (mod 8) AND Y_pos ;; offset to add TAY - ;;Let draw some stuff - LDA byte_to_paint ;; note that both bytes are used! +calc_byte_to_paint: ;; aka small_x_offset + LDA X_pos + AND #%00000111 + TAX + ;;this is the same as: byte_to_paint = 2^X + LDA binary_factor, X;; (see END.s) + STA byte_to_paint ;; should be removed, here for other code! + +draw: ;;Let draw some stuff ORA (btp_mem_pos), Y STA (btp_mem_pos), Y RTS