dhgr: more plasma work

This commit is contained in:
Vince Weaver
2025-10-14 23:47:56 -04:00
parent 2818ae166a
commit a9fc7643ba
4 changed files with 47 additions and 33 deletions
+3
View File
@@ -0,0 +1,3 @@
the code in graphics/dhgr/plasma has this code commented a bit
more completely
+15 -2
View File
@@ -12,11 +12,12 @@ all: dhgr_plasma.dsk
####
dhgr_plasma.dsk: HELLO \
HGR_PLASMA DHGR_PLASMA1
HGR_PLASMA DHGR_PLASMA1 DHGR_PLASMA2
cp $(EMPTY_DISK)/empty.dsk dhgr_plasma.dsk
$(DOS33) -y dhgr_plasma.dsk SAVE A HELLO
$(DOS33) -y dhgr_plasma.dsk BSAVE -a 0x8000 HGR_PLASMA
$(DOS33) -y dhgr_plasma.dsk BSAVE -a 0x8000 DHGR_PLASMA1
$(DOS33) -y dhgr_plasma.dsk BSAVE -a 0x8000 DHGR_PLASMA2
####
@@ -38,6 +39,17 @@ dhgr_plasma1.o: dhgr_plasma1.s \
zp.inc hardware.inc
ca65 -o dhgr_plasma1.o dhgr_plasma1.s -l dhgr_plasma1.lst
####
DHGR_PLASMA2: dhgr_plasma2.o
ld65 -o DHGR_PLASMA2 dhgr_plasma2.o -C $(LINKER_SCRIPTS)/apple2_8000.inc
dhgr_plasma2.o: dhgr_plasma2.s \
init_plasma.s scroll_off.s \
zp.inc hardware.inc
ca65 -o dhgr_plasma2.o dhgr_plasma2.s -l dhgr_plasma2.lst
###
@@ -48,5 +60,6 @@ HELLO: hello.bas
clean:
rm -f *~ *.o *.lst HGR_PLASMA DHGR_PLASMA1 HELLO
rm -f *~ *.o *.lst HGR_PLASMA DHGR_PLASMA1 DHGR_PLASMA2 \
HELLO
@@ -71,9 +71,6 @@ plasma_loop:
;=============================
; do blue/orange
; lda #49
; sta plasma_end_smc+1
jsr init_plasma_colors
jsr do_plasma
@@ -84,9 +81,6 @@ plasma_loop:
jsr scroll_off
; lda #25
; jsr wait_ticks
;=============================
; do purple/green
@@ -98,12 +92,8 @@ change_purple:
dex
bpl change_purple
jsr init_plasma_colors
; lda #50
; sta plasma_end_smc+1
jsr do_plasma
; drop
@@ -113,9 +103,6 @@ change_purple:
jsr scroll_off
; lda #25
; jsr wait_ticks
;=============================
; do black/white?
@@ -130,9 +117,6 @@ change_mono:
jsr init_plasma_colors
; lda #52
; sta plasma_end_smc+1
jsr do_plasma
; drop
@@ -256,9 +240,6 @@ display_row_sin_smc:
; 18
; lda hires_colors_even_l0 ; attention: must be aligned
; sta color_smc+1
lda hposn_high_div8,X ; 4
clc ; 2
adc DRAW_PAGE ; 3
@@ -267,6 +248,9 @@ display_row_sin_smc:
lda #1 ; 2
sta COUNT ; 3
; 35
store_loop:
color_smc:
@@ -277,8 +261,13 @@ color_smc:
display_lookup_smc:
lda hires_colors_even_l0 ; attention: must be aligned ; 4
; lda #$fe
sta (GBASL),Y ; 6
clc ; 2
lda #$10 ; 2
adc GBASH ; 3
@@ -307,10 +296,6 @@ was_page1:
done_pageflip:
sta DRAW_PAGE ; 3
;plasma_end_smc:
; lda #52
; jsr wait_for_pattern
lda KEYPRESS
bpl wasnt_keypress
+21 -8
View File
@@ -2,6 +2,12 @@
; based on code by French Touch
; not this is a huge hack on the lo-res code
; it only draws every 4th line to save speed
; and actually every other line is a fake hack(?)
;
; it used a lookup table to fake color gradients
.include "zp.inc"
.include "hardware.inc"
@@ -45,6 +51,8 @@ plasma_debut:
; init div8
;=========================================
; lookup table only has 0..23 (0..184 / 8)
ldx #23
ldy #184
div8_loop:
@@ -71,9 +79,6 @@ plasma_loop:
;=============================
; do blue/orange
; lda #49
; sta plasma_end_smc+1
jsr init_plasma_colors
jsr do_plasma
@@ -130,9 +135,6 @@ change_mono:
jsr init_plasma_colors
; lda #52
; sta plasma_end_smc+1
jsr do_plasma
; drop
@@ -227,9 +229,14 @@ pc_off4:
; Display "Normal"
; AFFICHAGE "NORMAL"
; draws by column (????)
; only draws 24 rows, spread to 48 (so only every 4th row)
; on hgr in a group of 8 rows, to get from line 0 to 4 you add $1000
display_normal:
ldx #23 ; lines 0-23 lignes 0-23 ; 2
; X is ROW
display_line_loop:
; 0
@@ -237,6 +244,7 @@ display_line_loop:
sta GBASL ; 3
; 7
ldy #39 ; col 0-39 ; 2
; Y is column
lda Table2,X ; setup base sine value for row ; 4
sta display_row_sin_smc+1 ; 4
@@ -264,6 +272,11 @@ display_row_sin_smc:
adc DRAW_PAGE ; 3
sta GBASH ; 3
; 30
; go through twice
; hi-res every 4th pixel. In grous of 8 rows
; adding $1000 takes you down 4 rows
lda #1 ; 2
sta COUNT ; 3
; 35
@@ -271,7 +284,7 @@ store_loop:
color_smc:
lda display_lookup_smc+2 ; 4
eor #$02 ; 2
eor #$02 ; why? ; 2
sta display_lookup_smc+2 ; 4
; 10
@@ -280,7 +293,7 @@ display_lookup_smc:
; lda #$fe
sta (GBASL),Y ; 6
clc ; 2
lda #$10 ; 2
lda #$10 ; row 0 -> row 4 ; 2
adc GBASH ; 3
sta GBASH ; 3
dec COUNT ; 5