diff --git a/dhgr/Makefile b/dhgr/Makefile new file mode 100644 index 00000000..b67886b5 --- /dev/null +++ b/dhgr/Makefile @@ -0,0 +1,41 @@ +include ../Makefile.inc + +DOS33 = ../dos33fs-utils/dos33 +TOKENIZE = ../asoft_basic-utils/tokenize_asoft + +all: dhgr.dsk + +dhgr.dsk: RASTER BITS LOTS + $(DOS33) -y dhgr.dsk BSAVE -a 0x0300 RASTER + $(DOS33) -y dhgr.dsk BSAVE -a 0x0300 BITS + $(DOS33) -y dhgr.dsk BSAVE -a 0x0300 LOTS + +### + +RASTER: raster.o + ld65 -o RASTER raster.o -C ../linker_scripts/apple2_300.inc + +raster.o: raster.s + ca65 -o raster.o raster.s -l raster.lst + +### + +LOTS: lots.o + ld65 -o LOTS lots.o -C ../linker_scripts/apple2_300.inc + +lots.o: lots.s + ca65 -o lots.o lots.s -l lots.lst + + +### + +BITS: bits.o + ld65 -o BITS bits.o -C ../linker_scripts/apple2_300.inc + +bits.o: bits.s + ca65 -o bits.o bits.s -l bits.lst + +#### + +clean: + rm -f *~ *.o *.lst RASTER BITS LOTS diff --git a/dhgr/bits.s b/dhgr/bits.s new file mode 100644 index 00000000..71084df4 --- /dev/null +++ b/dhgr/bits.s @@ -0,0 +1,104 @@ +GBASL = $26 +GBASH = $27 +HGRPAGE = $E6 +YPOS = $FD +LINE = $FE +COLOR = $FF + +HGR = $F3E2 +HGR2 = $F3D8 +HPOSN = $F411 + +raster: + jsr HGR + jsr HGR2 +; sta $C050 ; set graphics +; sta $C057 ; set hires +; sta $C052 ; set fullscreen + sta $C05E ; set double hires + sta $C00D ; 80 column + sta $C001 ; 80 store + + sta $C055 ; set page2 + + lda #$20 + sta HGRPAGE + +bit_rain: + ; blue + + lda #$0 + sta COLOR +bit_rain_smc: + lda #100 + sta YPOS + jsr draw_raster_bit + + ; red + + lda #$8 + sta COLOR +bit_rain2_smc: + lda #50 + sta YPOS + jsr draw_raster_bit + + + lda bit_rain_smc+1 + clc + adc #1 + and #$7f + sta bit_rain_smc+1 + + lda bit_rain2_smc+1 + clc + adc #1 + and #$7f + sta bit_rain2_smc+1 + + jmp bit_rain + + + ;========================= + ; draw line of color in COLOR + ;========================= +draw_raster_bit: + + ldx #0 + stx LINE + +draw_raster_bit_loop: + + ldx #0 + ldy #0 + lda YPOS + jsr HPOSN + + clc + lda LINE + adc COLOR + tax + lda color_table,X + + ldy #0 +inside_loop: + sta (GBASL),Y + iny + iny + cpy #40 + bne inside_loop + + inc YPOS + + inc LINE + ldx LINE + cpx #9 + bne draw_raster_bit_loop + + rts + +color_table: + .byte $0 + .byte $1,$3,$B,$F,$B,$3,$1,$0 + .byte $8,$9,$D,$F,$D,$9,$8,$0 + diff --git a/dhgr/dhgr.dsk b/dhgr/dhgr.dsk new file mode 100644 index 00000000..18c4cfa5 Binary files /dev/null and b/dhgr/dhgr.dsk differ diff --git a/dhgr/lots.s b/dhgr/lots.s new file mode 100644 index 00000000..83fe19cf --- /dev/null +++ b/dhgr/lots.s @@ -0,0 +1,76 @@ +GBASL = $26 +GBASH = $27 +HGRPAGE = $E6 +YPOS = $FE +COLOR = $FF + +HGR = $F3E2 +HGR2 = $F3D8 +HPOSN = $F411 + +raster: + jsr HGR + jsr HGR2 +; sta $C050 ; set graphics +; sta $C057 ; set hires +; sta $C052 ; set fullscreen + sta $C05E ; set double hires + sta $C00D ; 80 column + sta $C001 ; 80 store + + lda #$20 + sta HGRPAGE + + lda #0 + sta YPOS +color_loop: + lda YPOS + and #$f + sta COLOR + asl + asl + asl + asl + ora COLOR + sta COLOR + lda YPOS + jsr draw_line_color + + inc YPOS + lda YPOS + cmp #192 + bne color_loop + +forever: + jmp forever + + + ;========================= + ; draw line of color in COLOR + ;========================= +draw_line_color: + ldx #0 + ldy #0 + jsr HPOSN + + ldy #0 +loop_it: + ; set page2 + sta $C055 + lda COLOR + sta (GBASL),Y + cmp #$80 + rol COLOR + + ; set page1 + sta $C054 + lda COLOR + sta (GBASL),Y + cmp #$80 + rol COLOR + iny + + cpy #40 + bne loop_it + + rts diff --git a/dhgr/raster.s b/dhgr/raster.s new file mode 100644 index 00000000..d704071b --- /dev/null +++ b/dhgr/raster.s @@ -0,0 +1,123 @@ +GBASL = $26 +GBASH = $27 +HGRPAGE = $E6 +COLOR = $ff + +HGR = $F3E2 +HGR2 = $F3D8 +HPOSN = $F411 + +raster: + jsr HGR + jsr HGR2 +; sta $C050 ; set graphics +; sta $C057 ; set hires +; sta $C052 ; set fullscreen + sta $C05E ; set double hires + sta $C00D ; 80 column + sta $C001 ; 80 store + + lda #$20 + sta HGRPAGE + + lda #$0 + sta COLOR + lda #100 + jsr draw_line_color + + lda #$4 + sta COLOR + lda #99 + jsr draw_line_color + + lda #$4 + sta COLOR + lda #101 + jsr draw_line_color + + lda #$8 + sta COLOR + lda #98 + jsr draw_line_color + + lda #$8 + sta COLOR + lda #102 + jsr draw_line_color + + + +forever: + jmp forever + + + ;========================= + ; draw line of color in COLOR + ; at location A + ;========================= +draw_line_color: + ldx #0 + ldy #0 + jsr HPOSN + + ; set page2 + sta $C055 + + ; page2 first + ldx COLOR + lda color_table,X + + ldy #0 +aux_part1_loop: + sta (GBASL),Y + iny + iny + cpy #40 + bcc aux_part1_loop + + ; page2 first + ldx COLOR + lda color_table+1,X + + ldy #1 +aux_part2_loop: + sta (GBASL),Y + iny + iny + cpy #40 + bcc aux_part2_loop + + ; set page1 + sta $C054 + + ; page1 next + ldx COLOR + lda color_table+2,X + + ldy #0 +main_part1_loop: + sta (GBASL),Y + iny + iny + cpy #40 + bcc main_part1_loop + + ; page1 next + ldx COLOR + lda color_table+3,X + + ldy #1 +main_part2_loop: + sta (GBASL),Y + iny + iny + cpy #40 + bcc main_part2_loop + + rts + +color_table: + .byte $FF,$FF,$FF,$FF ; white + .byte $3B,$6E,$77,$5D ; 0xB = light blue + .byte $33,$4C,$66,$19 ; 0x3 = medium blue + diff --git a/two-liners/Makefile b/two-liners/Makefile index 5f60cf8b..596a04b5 100644 --- a/two-liners/Makefile +++ b/two-liners/Makefile @@ -7,7 +7,7 @@ all: entropy.dsk convert_to convert_back convert_qkumba entropy.dsk: ENTROPY ENTROPY.BAS E2.BAS FLAME.BAS FLAME2.BAS \ CIRCLES.BAS AUTUMN.BAS QKUMBA.BAS ASTEROID.BAS PERSON.BAS SHIP.BAS \ - CONCERT.BAS NYAN.BAS LOAD + CONCERT.BAS NYAN.BAS RASTER.BAS LOTS.BAS LOAD $(DOS33) -y entropy.dsk BSAVE -a 0x0C00 ENTROPY $(DOS33) -y entropy.dsk BSAVE -a 0x0300 LOAD $(DOS33) -y entropy.dsk SAVE A ENTROPY.BAS @@ -22,6 +22,8 @@ entropy.dsk: ENTROPY ENTROPY.BAS E2.BAS FLAME.BAS FLAME2.BAS \ $(DOS33) -y entropy.dsk SAVE A SHIP.BAS $(DOS33) -y entropy.dsk SAVE A NYAN.BAS $(DOS33) -y entropy.dsk SAVE A CONCERT.BAS + $(DOS33) -y entropy.dsk SAVE A RASTER.BAS + $(DOS33) -y entropy.dsk SAVE A LOTS.BAS ### @@ -132,6 +134,16 @@ PERSON.BAS: person.bas SHIP.BAS: ship.bas $(TOKENIZE) < ship.bas > SHIP.BAS +#### + +RASTER.BAS: raster.bas + $(TOKENIZE) < raster.bas > RASTER.BAS + +#### + +LOTS.BAS: lots.bas + $(TOKENIZE) < lots.bas > LOTS.BAS + #### diff --git a/two-liners/lots.bas b/two-liners/lots.bas new file mode 100644 index 00000000..09198b72 --- /dev/null +++ b/two-liners/lots.bas @@ -0,0 +1,2 @@ +1REM(X\(V\C7PC#PC PJ(AYJ A_I_*#A_""""!_A_I_(- Y_I_RPTY3, H H ($]H C5PI_D)R@)_C5PI_D)R@)_RP*TY8XP)%%1&9VMJ=GT:&$N $01GA'T9X $ +2FORI=0TO90:C=INT((PEEK(2144+I/3)-32)/4^(I-INT(I/3)*3)):POKE768+I,((PEEK(2054+I)-32)*4)+C-INT(C/4)*4:NEXT:CALL768 diff --git a/two-liners/raster.bas b/two-liners/raster.bas new file mode 100644 index 00000000..eaaf627a --- /dev/null +++ b/two-liners/raster.bas @@ -0,0 +1,8 @@ +10 HGR:HGR2 +50 POKE 49246,0: REM TURN ON DHR +60 POKE 49165,0: REM TURN ON 80COLUMNS +70 POKE 49153,0:REM TURN ON 80STORE +75 POKE POKE 49237,0 +80 HCOLOR=3:HPLOT 0,100 TO 279,100 + +