diff --git a/graphics/hgr/star_lady/hgr_clear_screen.s b/graphics/hgr/star_lady/hgr_clear_screen.s new file mode 100644 index 00000000..aa0805ab --- /dev/null +++ b/graphics/hgr/star_lady/hgr_clear_screen.s @@ -0,0 +1,89 @@ +hgr_clear_screen: + lda DRAW_PAGE + beq hgr_page1_clearscreen + lda #0 + beq hgr_page2_clearscreen + +hgr_page1_clearscreen: + + ldy #0 +hgr_page1_cls_loop: + sta $2000,Y + sta $2100,Y + sta $2200,Y + sta $2300,Y + sta $2400,Y + sta $2500,Y + sta $2600,Y + sta $2700,Y + sta $2800,Y + sta $2900,Y + sta $2A00,Y + sta $2B00,Y + sta $2C00,Y + sta $2D00,Y + sta $2E00,Y + sta $2F00,Y + sta $3000,Y + sta $3100,Y + sta $3200,Y + sta $3300,Y + sta $3400,Y + sta $3500,Y + sta $3600,Y + sta $3700,Y + sta $3800,Y + sta $3900,Y + sta $3A00,Y + sta $3B00,Y + sta $3C00,Y + sta $3D00,Y + sta $3E00,Y + sta $3F00,Y + iny + bne hgr_page1_cls_loop + + rts + + +hgr_page2_clearscreen: + + ldy #0 +hgr_page2_cls_loop: + sta $4000,Y + sta $4100,Y + sta $4200,Y + sta $4300,Y + sta $4400,Y + sta $4500,Y + sta $4600,Y + sta $4700,Y + sta $4800,Y + sta $4900,Y + sta $4A00,Y + sta $4B00,Y + sta $4C00,Y + sta $4D00,Y + sta $4E00,Y + sta $4F00,Y + sta $5000,Y + sta $5100,Y + sta $5200,Y + sta $5300,Y + sta $5400,Y + sta $5500,Y + sta $5600,Y + sta $5700,Y + sta $5800,Y + sta $5900,Y + sta $5A00,Y + sta $5B00,Y + sta $5C00,Y + sta $5D00,Y + sta $5E00,Y + sta $5F00,Y + iny + bne hgr_page2_cls_loop + + rts + diff --git a/graphics/hgr/star_lady/text_print.s b/graphics/hgr/star_lady/text_print.s new file mode 100644 index 00000000..34bae3db --- /dev/null +++ b/graphics/hgr/star_lady/text_print.s @@ -0,0 +1,93 @@ + + ;================================ + ; move_and_print + ;================================ + ; get X,Y from OUTL/OUTH + ; then print following string to that address + ; stop at NUL + ; convert to APPLE ASCII (or with 0x80) + ; leave OUTL/OUTH pointing to next string + +move_and_print: + ldy #0 + lda (OUTL),Y + sta CH + iny + lda (OUTL),Y + asl + tay + lda gr_offsets,Y ; lookup low-res memory address + clc + adc CH ; add in xpos + sta BASL ; store out low byte of addy + + lda gr_offsets+1,Y ; look up high byte + adc DRAW_PAGE ; + sta BASH ; and store it out + ; BASH:BASL now points at right place + + clc + lda OUTL + adc #2 + sta OUTL + lda OUTH + adc #0 + sta OUTH + + ;================================ + ; print_string + ;================================ + +print_string: + ldy #0 +print_string_loop: + lda (OUTL),Y + beq done_print_string +ps_smc1: + and #$3f ; make sure we are inverse + sta (BASL),Y + iny + bne print_string_loop +done_print_string: + iny + clc + tya + adc OUTL + sta OUTL + lda OUTH + adc #0 + sta OUTH + + rts + + ; set normal text +set_normal: + lda #$80 + sta ps_smc1+1 + + lda #09 ; ora + sta ps_smc1 + + rts + + ; restore inverse text +set_inverse: + lda #$29 + sta ps_smc1 + lda #$3f + sta ps_smc1+1 + + rts + + + ;================================ + ; move and print a list of lines + ;================================ + ; look for negative X meaning done +move_and_print_list: + jsr move_and_print + ldy #0 + lda (OUTL),Y + bpl move_and_print_list + + rts