mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-08-15 08:27:41 +00:00
duke: draw box around quit prompt
This commit is contained in:
@@ -42,7 +42,7 @@ DUKE: duke.o
|
|||||||
ld65 -o DUKE duke.o -C ../linker_scripts/apple2_2000.inc
|
ld65 -o DUKE duke.o -C ../linker_scripts/apple2_2000.inc
|
||||||
|
|
||||||
duke.o: duke.s zp.inc hardware.inc duke.s \
|
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 \
|
graphics/duke_graphics.inc \
|
||||||
maps/level1_map.lzsa \
|
maps/level1_map.lzsa \
|
||||||
status_bar.s draw_duke.s move_duke.s gr_putsprite_crop.s \
|
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 "status_bar.s"
|
||||||
.include "keyboard.s"
|
.include "keyboard.s"
|
||||||
.include "joystick.s"
|
.include "joystick.s"
|
||||||
|
|
||||||
|
.include "text_drawbox.s"
|
||||||
.include "print_help.s"
|
.include "print_help.s"
|
||||||
.include "quit_yn.s"
|
.include "quit_yn.s"
|
||||||
|
|
||||||
|
@@ -4,12 +4,22 @@ print_quit:
|
|||||||
bit KEYRESET ; clear keyboard
|
bit KEYRESET ; clear keyboard
|
||||||
bit SET_TEXT
|
bit SET_TEXT
|
||||||
|
|
||||||
jsr normal_text
|
|
||||||
|
|
||||||
lda #' '|$80
|
lda #' '|$80
|
||||||
sta clear_all_color+1
|
sta clear_all_color+1
|
||||||
jsr clear_all
|
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
|
lda #<quit_text
|
||||||
sta OUTL
|
sta OUTL
|
||||||
lda #>quit_text
|
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
|
||||||
|
|
Reference in New Issue
Block a user