mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-27 02:31:00 +00:00
duke: draw box around quit prompt
This commit is contained in:
parent
8a222dd57a
commit
db9eaa4932
@ -42,7 +42,7 @@ DUKE: duke.o
|
||||
ld65 -o DUKE duke.o -C ../linker_scripts/apple2_2000.inc
|
||||
|
||||
duke.o: duke.s zp.inc hardware.inc duke.s \
|
||||
print_help.s gr_fast_clear.s quit_yn.s \
|
||||
print_help.s gr_fast_clear.s quit_yn.s text_drawbox.s \
|
||||
graphics/duke_graphics.inc \
|
||||
maps/level1_map.lzsa \
|
||||
status_bar.s draw_duke.s move_duke.s gr_putsprite_crop.s \
|
||||
|
@ -195,6 +195,8 @@ done_with_duke:
|
||||
.include "status_bar.s"
|
||||
.include "keyboard.s"
|
||||
.include "joystick.s"
|
||||
|
||||
.include "text_drawbox.s"
|
||||
.include "print_help.s"
|
||||
.include "quit_yn.s"
|
||||
|
||||
|
@ -4,12 +4,22 @@ print_quit:
|
||||
bit KEYRESET ; clear keyboard
|
||||
bit SET_TEXT
|
||||
|
||||
jsr normal_text
|
||||
|
||||
lda #' '|$80
|
||||
sta clear_all_color+1
|
||||
jsr clear_all
|
||||
|
||||
lda #6
|
||||
sta drawbox_x1
|
||||
lda #33
|
||||
sta drawbox_x2
|
||||
lda #8
|
||||
sta drawbox_y1
|
||||
lda #13
|
||||
sta drawbox_y2
|
||||
jsr drawbox
|
||||
|
||||
jsr normal_text
|
||||
|
||||
lda #<quit_text
|
||||
sta OUTL
|
||||
lda #>quit_text
|
||||
|
84
duke/text_drawbox.s
Normal file
84
duke/text_drawbox.s
Normal file
@ -0,0 +1,84 @@
|
||||
; draw inverse box on text screen
|
||||
|
||||
; we could use HLIN/VLIN instead?
|
||||
|
||||
; note Y should be in text coords (0..23) not GR (0..47)
|
||||
|
||||
drawbox:
|
||||
lda drawbox_y1
|
||||
jsr text_hlin
|
||||
lda drawbox_y2
|
||||
jsr text_hlin
|
||||
|
||||
jsr text_vlins
|
||||
|
||||
rts
|
||||
|
||||
;========================
|
||||
; text hlin
|
||||
;========================
|
||||
; draw from x1,A to x2,A
|
||||
|
||||
text_hlin:
|
||||
asl
|
||||
tay
|
||||
|
||||
lda gr_offsets,Y
|
||||
sta OUTL
|
||||
|
||||
lda gr_offsets+1,Y
|
||||
clc
|
||||
adc DRAW_PAGE
|
||||
sta OUTH
|
||||
|
||||
lda #' '
|
||||
ldy drawbox_x1
|
||||
drawbox_hlin_loop:
|
||||
sta (OUTL),Y
|
||||
iny
|
||||
cpy drawbox_x2
|
||||
bne drawbox_hlin_loop
|
||||
|
||||
rts
|
||||
|
||||
;========================
|
||||
; text vlin
|
||||
;========================
|
||||
; draw from A,y1 to A,y2
|
||||
|
||||
text_vlins:
|
||||
|
||||
ldx drawbox_y1
|
||||
|
||||
text_vlins_loop:
|
||||
txa
|
||||
asl
|
||||
tay
|
||||
lda gr_offsets,Y
|
||||
sta OUTL
|
||||
|
||||
lda gr_offsets+1,Y
|
||||
clc
|
||||
adc DRAW_PAGE
|
||||
sta OUTH
|
||||
|
||||
lda #' '
|
||||
|
||||
ldy drawbox_x1
|
||||
sta (OUTL),Y
|
||||
ldy drawbox_x2
|
||||
sta (OUTL),Y
|
||||
|
||||
inx
|
||||
cpx drawbox_y2
|
||||
bcc text_vlins_loop
|
||||
beq text_vlins_loop ; ble
|
||||
|
||||
rts
|
||||
|
||||
|
||||
drawbox_x1: .byte $00
|
||||
drawbox_x2: .byte $00
|
||||
drawbox_y1: .byte $00
|
||||
drawbox_y2: .byte $00
|
||||
|
Loading…
Reference in New Issue
Block a user