add more linetests for debuging

This commit is contained in:
hugova 2025-07-17 13:42:39 +02:00
parent b4860b000c
commit 2caf71d8fe
4 changed files with 106 additions and 87 deletions

View file

@ -1,86 +1,14 @@
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
.scope line_test
;; Program for testing of line-drawing. It draws a bunch of lines
;;Start line-timer-here
.include "line.inc"
.include "../memory/mem.inc"
Y_pos_ = $0D
X_pos_ = $0E
Y_end_ = $10
X_end_ = $11
LDA #$d2
STA X_pos_
LDA #$62
STA Y_pos_
LDA #$ff
LDA #$30
STA X_pos
STA Y_pos
LDA #$d0
STA X_end
LDA #$0
LDA #$a0
STA Y_end
;; Short test for timing
@loop:
LDA Y_pos_
STA Y_pos
LDA X_pos_
STA X_pos
jsr line
INC Y_end
LDA Y_end
CMP #$aa
BEQ end__
jmp @loop
end__:
;; Full anfle test
@loop:
LDA Y_pos_
STA Y_pos
LDA X_pos_
STA X_pos
jsr line
INC Y_end
LDA Y_end
CMP #$bb
BEQ end
jmp @loop
end:
;;Long lines
;;Lets clear bitmap
VIC_bank = $4000
;;Paint the bitmap black. More bitmap: https://www.c64-wiki.com/wiki/53272, https://www.c64-wiki.com/wiki/Screen_RAM#Moving_of_screen_RAM
Mov_16 A_start, A_start + 1, #<VIC_bank, #>VIC_bank
Mov_16 length, length + 1, #<$1f40, #>$1f40
LDA #$00
jsr memset
LDA #$00
STA X_pos_
LDA #$60
STA Y_pos_
LDA #$ff
STA X_end
LDA #$0
STA Y_end
@loop:
LDA Y_pos_
STA Y_pos
LDA X_pos_
STA X_pos
jsr line
INC Y_end
LDA Y_end
CMP #$bb
BNE @loop
;;Lets clear bitmap
;;Paint the bitmap black. More bitmap: https://www.c64-wiki.com/wiki/53272, https://www.c64-wiki.com/wiki/Screen_RAM#Moving_of_screen_RAM
Mov_16 A_start, A_start + 1, #<VIC_bank, #>VIC_bank
Mov_16 length, length + 1, #<$1f40, #>$1f40
LDA #$00
jsr memset
JSR line
.endscope

View file

@ -0,0 +1,88 @@
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
.scope line_test_extensive
;; Program for testing of line-drawing. It draws a bunch of lines
;;Start line-timer-here
.include "line.inc"
.include "../memory/mem.inc"
Y_pos_ = $0D
X_pos_ = $0E
Y_end_ = $10
X_end_ = $11
LDA #$d2
STA X_pos_
LDA #$62
STA Y_pos_
LDA #$ff
STA X_end
LDA #$0
STA Y_end
;; Full angle test
@loop:
LDA Y_pos_
STA Y_pos
LDA X_pos_
STA X_pos
jsr line
INC Y_end
LDA Y_end
CMP #$bb
bne @loop
clear_screen:
;;Lets clear bitmap
VIC_bank = $4000
;;Paint the bitmap black. More bitmap: https://www.c64-wiki.com/wiki/53272, https://www.c64-wiki.com/wiki/Screen_RAM#Moving_of_screen_RAM
Mov_16 A_start, A_start + 1, #<VIC_bank, #>VIC_bank
Mov_16 length, length + 1, #<$1f40, #>$1f40
LDA #$00
jsr memset
long_line_test_a:
LDA #$00
STA X_pos_
LDA #$60
STA Y_pos_
LDA #$ff
STA X_end
LDA #$0
STA Y_end
@loop:
LDA Y_pos_
STA Y_pos
LDA X_pos_
STA X_pos
jsr line
INC Y_end
LDA Y_end
CMP #$bb
BNE @loop
clear_screen_:
;;Paint the bitmap black. More bitmap: https://www.c64-wiki.com/wiki/53272, https://www.c64-wiki.com/wiki/Screen_RAM#Moving_of_screen_RAM
Mov_16 A_start, A_start + 1, #<VIC_bank, #>VIC_bank
Mov_16 length, length + 1, #<$1f40, #>$1f40
LDA #$00
jsr memset
long_line_test_b:
LDA #$00
STA X_pos_
LDA #$60
STA Y_pos_
LDA #$ff
STA X_end
LDA #$0
STA Y_end
@loop:
LDA Y_pos_
STA Y_pos
LDA X_pos_
STA X_pos
jsr line
INC Y_pos_
LDA Y_pos_
CMP #$bb
BNE @loop
.endscope

View file

@ -53,5 +53,6 @@ calc_byte_to_paint: ;; aka small_x_offset
;; A = byte_to_paint (small_X_offset)
;; Y =small_y_offset
;; btp_mem_pos (bigg_X_offset + bigg_Y-offset)
;; C = 0
RTS
.endproc

View file

@ -8,16 +8,18 @@
.include "STARTUP.s"
;.include "dubbel_buffer/raster_irqs.s"
.include "routines/arithmatic/mult_test.s"
.include "routines/arithmatic/div_test.s"
.include "routines/circle/circle_test.s"
.include "routines/circle/circle_test_size.s"
.include "routines/circle/circle_test_position.s"
;.include "routines/arithmatic/mult_test.s"
;.include "routines/arithmatic/div_test.s"
;.include "routines/circle/circle_test.s"
;.include "routines/circle/circle_test_size.s"
;.include "routines/circle/circle_test_position.s"
.include "routines/line/line_test.s"
.include "routines/text/char_draw_test.s"
.include "routines/pixel/pixel_test.s"
.include "routines/memory/memcpy_test.s"
.include "routines/memory/memset_test.s"
.include "routines/line/line_test_extensive.s"
;.include "routines/text/char_draw_test.s"
;.include "routines/pixel/pixel_test.s"
;.include "routines/memory/memcpy_test.s"
;.include "routines/memory/memset_test.s"
;.include "routines/triangle/triangle_test.s"
exit:
JMP exit