diff --git a/graphics/hgr/hgr_font_4am/bios_test.s b/graphics/hgr/hgr_font_4am/bios_test.s index 02745961..bbf8621f 100644 --- a/graphics/hgr/hgr_font_4am/bios_test.s +++ b/graphics/hgr/hgr_font_4am/bios_test.s @@ -111,41 +111,9 @@ test5: graphics_data: .incbin "graphics/a2_energy.hgr.zx02" +hposn_low = $1713 ; 0xC0 bytes (lifetime, used by DrawLargeCharacter) +hposn_high = $1800 ; 0xC0 bytes (lifetime, used by DrawLargeCharacter) + + .include "hgr_table.s" -; .hgrlo, .hgr1hi will each be filled with $C0 bytes -; based on routine by John Brooks -; posted on comp.sys.apple2 on 2018-07-11 -; https://groups.google.com/d/msg/comp.sys.apple2/v2HOfHOmeNQ/zD76fJg_BAAJ -; clobbers A,X -; preserves Y - - -build_tables: - ldx #0 -btmi: - txa - and #$F8 - bpl btpl1 - ora #5 -btpl1: - asl - bpl btpl2 - ora #5 -btpl2: - asl - asl - sta HGRLO, X - txa - and #7 - rol - asl HGRLO, X - rol - ora #$20 - sta HGRHI, X - inx - cpx #$C0 - bne btmi - - rts - diff --git a/graphics/hgr/hgr_font_4am/font_condensed.s b/graphics/hgr/hgr_font_4am/font_condensed.s index 5a9dad5b..bb7efba7 100644 --- a/graphics/hgr/hgr_font_4am/font_condensed.s +++ b/graphics/hgr/hgr_font_4am/font_condensed.s @@ -13,11 +13,6 @@ tmpx = $FE ; byte (used by DrawLargeCharacter, FindVal tmpy = $FF ; byte (used by DrawLargeCharacter, FindValidMove) -HGRLO = $1713 ; 0xC0 bytes (lifetime, used by DrawLargeCharacter) -read_buffer = $17D3 ; 0x2D bytes (used by nth, free before and after) -HGRHI = $1800 ; 0xC0 bytes (lifetime, used by DrawLargeCharacter) - - CondensedHGRTops: .byte 7,18,29,40,51,62,73,84,95,106,117,128,139,150,161,172 @@ -73,65 +68,65 @@ dcs1: ldy VTAB lda CondensedHGRTops, y tay - lda HGRLO, y + lda hposn_low, y clc adc HTAB sta @row0+1 - lda HGRHI, y + lda hposn_high, y sta @row0+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row1+1 - lda HGRHI, y + lda hposn_high, y sta @row1+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row2+1 - lda HGRHI, y + lda hposn_high, y sta @row2+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row3+1 - lda HGRHI, y + lda hposn_high, y sta @row3+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row4+1 - lda HGRHI, y + lda hposn_high, y sta @row4+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row5+1 - lda HGRHI, y + lda hposn_high, y sta @row5+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row6+1 - lda HGRHI, y + lda hposn_high, y sta @row6+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row7+1 - lda HGRHI, y + lda hposn_high, y sta @row7+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row8+1 - lda HGRHI, y + lda hposn_high, y sta @row8+2 iny - lda HGRLO, y + lda hposn_low, y adc HTAB sta @row9+1 - lda HGRHI, y + lda hposn_high, y sta @row9+2 @loop: ldy $FDFD, x lda CondensedRow0-$19, y diff --git a/graphics/hgr/hgr_font_4am/font_test.s b/graphics/hgr/hgr_font_4am/font_test.s index 3e9132a1..8e2948df 100644 --- a/graphics/hgr/hgr_font_4am/font_test.s +++ b/graphics/hgr/hgr_font_4am/font_test.s @@ -103,39 +103,7 @@ test5: .include "font_condensed_data.s" -; .hgrlo, .hgr1hi will each be filled with $C0 bytes -; based on routine by John Brooks -; posted on comp.sys.apple2 on 2018-07-11 -; https://groups.google.com/d/msg/comp.sys.apple2/v2HOfHOmeNQ/zD76fJg_BAAJ -; clobbers A,X -; preserves Y - - -build_tables: - ldx #0 -btmi: - txa - and #$F8 - bpl btpl1 - ora #5 -btpl1: - asl - bpl btpl2 - ora #5 -btpl2: - asl - asl - sta HGRLO, X - txa - and #7 - rol - asl HGRLO, X - rol - ora #$20 - sta HGRHI, X - inx - cpx #$C0 - bne btmi - - rts +hposn_low = $1713 ; 0xC0 bytes (lifetime, used by DrawLargeCharacter) +hposn_high = $1800 ; 0xC0 bytes (lifetime, used by DrawLargeCharacter) + .include "hgr_table.s" diff --git a/graphics/hgr/hgr_font_4am/hgr_table.s b/graphics/hgr/hgr_font_4am/hgr_table.s new file mode 100644 index 00000000..3462059b --- /dev/null +++ b/graphics/hgr/hgr_font_4am/hgr_table.s @@ -0,0 +1,37 @@ +; hposn_low, hposn_high will each be filled with $C0 bytes +; based on routine by John Brooks +; posted on comp.sys.apple2 on 2018-07-11 +; https://groups.google.com/d/msg/comp.sys.apple2/v2HOfHOmeNQ/zD76fJg_BAAJ +; clobbers A,X +; preserves Y + +; vmw note: version I was using based on applesoft HPOSN was ~64 bytes +; this one is 37 bytes + +build_tables: + ldx #0 +btmi: + txa + and #$F8 + bpl btpl1 + ora #5 +btpl1: + asl + bpl btpl2 + ora #5 +btpl2: + asl + asl + sta hposn_low, X + txa + and #7 + rol + asl hposn_low, X + rol + ora #$20 + sta hposn_high, X + inx + cpx #$C0 + bne btmi + + rts