peasant: optimize text box drawing

This commit is contained in:
Vince Weaver 2021-10-18 14:18:13 -04:00
parent 7bece92e85
commit f4ae730fab
3 changed files with 30 additions and 30 deletions

View File

@ -248,7 +248,7 @@ game_over.o: game_over.s zp.inc \
PEASANT1: peasant1.o PEASANT1: peasant1.o
ld65 -o PEASANT1 peasant1.o -C $(LINKER_SCRIPTS)/apple2_6000.inc ld65 -o PEASANT1 peasant1.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
peasant1.o: peasant1.s zp.inc inventory.inc \ peasant1.o: peasant1.s zp.inc inventory.inc dialog_peasant2.inc \
sprites/peasant_sprites.inc sprites/inventory_sprites.inc \ sprites/peasant_sprites.inc sprites/inventory_sprites.inc \
graphics_peasantry/graphics_peasant1.inc \ graphics_peasantry/graphics_peasant1.inc \
graphics_peasantry/priority_peasant1.inc \ graphics_peasantry/priority_peasant1.inc \

View File

@ -27,6 +27,7 @@ peasant2 18302
20050 -- parse lookup table 20050 -- parse lookup table
20493 -- more parse code (release 0.76) 20493 -- more parse code (release 0.76)
16995 -- move inventory to language card 16995 -- move inventory to language card
17122 -- add all verbs in (+), optimize text box drawing (-)
partial save, can we fit in 4k? partial save, can we fit in 4k?
102 lines ; inventory was 115? 102 lines ; inventory was 115?

View File

@ -610,41 +610,48 @@ verb_lookup:
print_text_message: print_text_message:
jsr count_message_lines jsr count_message_lines
ldy message_len lda #0 ; always 0
dey
lda message_x1h,Y
sta BOX_X1H sta BOX_X1H
lda message_x1l,Y
sta BOX_X1L
lda message_y1,Y
sta BOX_Y1
lda message_x2h,Y
sta BOX_X2H sta BOX_X2H
lda message_x2l,Y lda #35 ; always 35
sta BOX_X1L
lda #24 ; always 24
sta BOX_Y1
lda #253 ; always 253
sta BOX_X2L sta BOX_X2L
lda message_y2,Y ; 1 2 3 4 5 6 7 8
;message_y2: .byte 54, 62, 70, 78, 86, 94, 102, 110
; y2 is 46+(8*(len))
lda message_len
asl
asl
asl
clc
adc #46
; lda message_y2,Y
sta BOX_Y2 sta BOX_Y2
tya ; tya
pha ; pha
jsr hgr_partial_save jsr hgr_partial_save
jsr draw_box jsr draw_box
pla ; pla
tay ; tay
lda message_tx,Y lda #7 ; always 7
sta CURSOR_X sta CURSOR_X
lda message_ty,Y lda #36 ; always 36
sta CURSOR_Y sta CURSOR_Y
jsr disp_put_string_cursor jsr disp_put_string_cursor
@ -662,15 +669,7 @@ print_text_message:
; .byte 7,49 ; .byte 7,49
; 1 2 3 4 5 6 7 8
message_x1h: .byte 0, 0, 0, 0, 0, 0, 0, 0
message_x1l: .byte 35, 35, 35, 35, 35, 35, 35, 35
message_y1: .byte 24, 24, 24, 24, 24, 24, 24, 24
message_x2h: .byte 0, 0, 0, 0, 0, 0, 0, 0
message_x2l: .byte 253, 253, 253, 253, 253, 253, 253, 253
message_y2: .byte 54, 62, 70, 78, 86, 94, 102, 110
message_tx: .byte 7, 7, 7, 7, 7, 7, 7, 7
message_ty: .byte 36, 36, 36, 36, 36, 36, 36, 36
;====================== ;======================