fix bug that still allow drawing outside screen with line.s and added this restriction to pixel_draw.s

This commit is contained in:
hugova 2025-07-28 18:48:30 +02:00
parent e59be7654d
commit fddaa64187
2 changed files with 11 additions and 2 deletions

View file

@ -11,7 +11,7 @@
STA Y_pos STA Y_pos
do_not_fix_y_pos: do_not_fix_y_pos:
LDA #$C8 LDA #$C8
CMP Y_pos ;y_max = $C8 CMP Y_end ;y_max = $C8
BCS do_not_fix_y_end BCS do_not_fix_y_end
STA Y_end STA Y_end
do_not_fix_y_end: do_not_fix_y_end:

View file

@ -1,9 +1,18 @@
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- ;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
;;Screen print. Draws a pixel at a specified position. ;;Screen print. Draws a pixel at a specified position.
.proc pixel_draw; user-procedure :clobbers (A X Y) :clobbers-arguments 0 .proc pixel_draw; user-procedure :clobbers (A X Y) :clobbers-arguments 2
.include "pixel.inc" .include "pixel.inc"
fix_to_big_y_pos
LDA #$C8
CMP Y_pos ;y_max = $C8
BCS fix_end
STA Y_pos
fix_end:
;;FIND position to write byte_to_paint (btp_mem_pos) ;;FIND position to write byte_to_paint (btp_mem_pos)
;; + + + + + > X ;; + + + + + > X
;; + ;; +