From bb765bcbc7439f336e06371e1bb7e4339ff7ed13 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 27 Aug 2023 13:28:23 -0400 Subject: [PATCH] hgr_font: sorta have bios screen working --- graphics/hgr/hgr_font_4am/Makefile | 1 + graphics/hgr/hgr_font_4am/bios_test.s | 267 ++++++++++-------- graphics/hgr/hgr_font_4am/font_console_1x8.s | 94 +++++- graphics/hgr/hgr_font_4am/fonts/Makefile | 4 +- .../hgr/hgr_font_4am/fonts/a2_cga_thin.png | Bin 1437 -> 5165 bytes graphics/hgr/hgr_font_4am/hgr_clear_screen.s | 84 ++++++ graphics/hgr/hgr_font_4am/zp.inc | 9 +- utils/hgr-utils/png2font.c | 13 +- 8 files changed, 337 insertions(+), 135 deletions(-) create mode 100644 graphics/hgr/hgr_font_4am/hgr_clear_screen.s diff --git a/graphics/hgr/hgr_font_4am/Makefile b/graphics/hgr/hgr_font_4am/Makefile index a3803f61..c912aecd 100644 --- a/graphics/hgr/hgr_font_4am/Makefile +++ b/graphics/hgr/hgr_font_4am/Makefile @@ -27,6 +27,7 @@ BIOS_TEST: bios_test.o ld65 -o BIOS_TEST bios_test.o -C $(LINKER_SCRIPTS)/apple2_6000.inc bios_test.o: bios_test.s \ + hgr_clear_screen.s \ font_console_1x8.s fonts/a2_cga_thin.inc \ zx02_optim.s graphics/a2_energy.hgr.zx02 ca65 -o bios_test.o bios_test.s -l bios_test.lst diff --git a/graphics/hgr/hgr_font_4am/bios_test.s b/graphics/hgr/hgr_font_4am/bios_test.s index 662c9afc..eb578b02 100644 --- a/graphics/hgr/hgr_font_4am/bios_test.s +++ b/graphics/hgr/hgr_font_4am/bios_test.s @@ -83,9 +83,33 @@ done_memcount: ; clear/fade the energy star logo first ; clear offscreen so no blinds effect + lda #$cc + jsr fade_logo_mask + + lda #200 + jsr WAIT + + lda #$33 + jsr fade_logo_mask + + lda #200 + jsr WAIT + + ; clear screen while offscreen + ; avoid blinds effect + jsr hgr_page2_clearscreen + bit PAGE2 + jsr hgr_page1_clearscreen + bit PAGE1 + jsr HGR bit FULLGR + lda #10 + sta CH + lda #0 + sta CV + lda #bios_message_2 ldx #11 @@ -128,11 +152,6 @@ done_memcount: ; type the LEMM command ;======================= - jsr scroll_screen - - jsr wait_until_keypress - - ldx #5 jsr draw_dos_command @@ -154,88 +173,90 @@ bios_message_1a: .byte "02/13/78-6502-564D57",0 bios_message_2: - .byte 10,0,"System Configuration",0 - .byte 0,8, $1D + + .byte "System Configuration",13,0 + + .byte $1D ; 0,8 + .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$15,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$1E,$1E,$1E,$1E + .byte $1C, 13,0 + .byte $1F," CPU Type: 65C02 ",$14," Base Memory: 48K ",$1F,13,0 ; 16 + .byte $1F," Co-Proc: NONE ",$14," Lang Card: 16K ",$1F,13,0 ; 24 + .byte $1F," Clock: 1.023MHz ",$14," AUX Memory: 64K ",$1F,13,0 ; 32 + + .byte $19 ; 40 + .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$13,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E + .byte $1E,$1E,$1E,$1E,$1E,$1E + .byte $18, 13, 0 + + .byte $1F," Slot 6 Disk 1: Disk II 140K ",$1F,13,0 ; 48 + .byte $1F," Slot 6 Disk 2: Disk II 140K ",$1F,13,0 ; 56 + .byte $1F," Slot 4 : VIA 6522/Mockingboard ",$1F,13,0 ; 64 + .byte $1F," Slot 1 : Super Serial Card ",$1F,13,0 ; 72 + + + .byte $1B ; 80 .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E .byte $1E,$1E,$1E,$1E,$1E,$1E - .byte $1C, 0 - .byte 0,16, $1F," CPU Type: 65C02 Base Memory: 48K ",$1F,0 - .byte 0,24,$1F," Co-Proc: NONE Lang Card: 16K ",$1F,0 - .byte 0,32,$1F," Clock: 1.023MHz AUX Memory: 64K ",$1F,0 - - .byte 0,40,$19 - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E - .byte $18, 0 - - .byte 0,48,$1F," Slot 6 Disk 1: Disk II 140K ",$1F,0 - .byte 0,56,$1F," Slot 6 Disk 2: Disk II 140K ",$1F,0 - .byte 0,64,$1F," Slot 4 : VIA 6522/Mockingboard ",$1F,0 - .byte 0,72,$1F," Slot 1 : Super Serial Card ",$1F,0 - - - .byte 0,80,$1B - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E,$1E,$1E - .byte $1E,$1E,$1E,$1E,$1E,$1E - .byte $1A, 0 + .byte $1A, 13,0 bios_message3: - .byte 0,88,"Starting DOS 3.3...",0 + .byte "Starting DOS 3.3...",13,13,0 ; 88 bios_message4: - .byte 0,104,"S6D1>",0 - .byte 5,104,"c",0 - .byte 6,104,"d",0 - .byte 7,104," ",0 - .byte 8,104,"g",0 - .byte 9,104,"a",0 - .byte 10,104,"m",0 - .byte 11,104,"e",0 - .byte 12,104,"s",0 - .byte 13,104,"\",0 - .byte 14,104,"l",0 - .byte 15,104,"e",0 - .byte 16,104,"m",0 - .byte 17,104,"m",0 - .byte 18,104,"i",0 - .byte 19,104,"n",0 - .byte 20,104,"g",0 - .byte 21,104,"s",0 + .byte "S6D1>",0 ; 104 + .byte "c",0 + .byte "d",0 + .byte " ",0 + .byte "g",0 + .byte "a",0 + .byte "m",0 + .byte "e",0 + .byte "s",0 + .byte "\",0 + .byte "l",0 + .byte "e",0 + .byte "m",0 + .byte "m",0 + .byte "i",0 + .byte "n",0 + .byte "g",0 + .byte "s",13,13,0 bios_message5: - .byte 0,112,"S6D1>",0 - .byte 5,112,"d",0 - .byte 6,112,"i",0 - .byte 7,112,"r",0 - .byte 8,112," ",0 - .byte 9,112,"/",0 - .byte 10,112,"w",0 + .byte "S6D1>",0 ; 112 + .byte "d",0 + .byte "i",0 + .byte "r",0 + .byte " ",0 + .byte "/",0 + .byte "w",13,0 bios_message_6: - .byte 0,128,"Directory of s6d1:\games\lemmings\.",0 - .byte 0,136,"[.] [..] QBOOT QLOAD",0 - .byte 0,144,"LEVEL1 LEVEL2 LEVEL3 LEVEL4",0 - .byte 0,152,"LEVEL5 LEVEL6 LEVEL7 LEVEL8",0 - .byte 0,160,"LEVEL9 LEVEL10 LEMM",0 - .byte 0,168,"13 File(s) 90,624 Bytes.",0 - .byte 0,176," 2 Dir(s) 52,736 Bytes free.",0 + .byte "Directory of s6d1:\games\lemmings\.",13,0 ; 128 + .byte "[.] [..] QBOOT QLOAD",13,0 + .byte "LEVEL1 LEVEL2 LEVEL3 LEVEL4",13,0 + .byte "LEVEL5 LEVEL6 LEVEL7 LEVEL8",13,0 + .byte "LEVEL9 LEVEL10 LEMM",13,0 + .byte " 13 File(s) 90,624 Bytes.",13,0 + .byte " 2 Dir(s) 52,736 Bytes free.",13,13,0 bios_message7: - .byte 0,184,"S6D1>",0 - .byte 5,184,"l",0 - .byte 6,184,"e",0 - .byte 7,184,"m",0 - .byte 8,184,"m",0 + .byte "S6D1>",0 ; 184 + .byte "l",0 + .byte "e",0 + .byte "m",0 + .byte "m",0 .include "font_console_1x8.s" .include "fonts/a2_cga_thin.inc" @@ -378,75 +399,83 @@ draw_dos_command: dos_command_loop: jsr DrawCondensedStringAgain + lda OUTL + pha + lda OUTH + pha + dos_command_inner: ; draw curosr + lda #dos_cursor + jsr DrawCondensedString + dec CH + lda #200 + jsr WAIT - ; erase cursor + lda KEYPRESS + bmi dos_keypress + jsr DrawCondensedStringAgain + dec CH + lda #200 + jsr WAIT - jsr wait_until_keypress + lda KEYPRESS + bmi dos_keypress + + jmp dos_command_inner +dos_keypress: + bit KEYRESET + + pla + sta OUTH + pla + sta OUTL dec STRING_COUNT bne dos_command_loop rts +dos_cursor: + .byte "_",0 + .byte " ",0 - ;================================ - ;================================ - ;================================ - ;================================ -scroll_screen: - ldx #8 - stx INL - ldx #0 - stx OUTL -scroll_yloop: - ldx INL + ;======================= + ;======================= + ;======================= + ; 210,0 to 210,64 +fade_logo_mask: + sta mask_smc+1 + +fade_logo: + ldx #63 +outer_loop: + lda hposn_low,X - sta xloop_smc1+1 + sta inner_loop_smc1+1 + sta inner_loop_smc2+1 lda hposn_high,X - sta xloop_smc1+2 - - ldx OUTL - lda hposn_low,X - sta xloop_smc2+1 - lda hposn_high,X - sta xloop_smc2+2 + sta inner_loop_smc1+2 + sta inner_loop_smc2+2 ldy #39 -scroll_xloop: -xloop_smc1: +inner_loop: +inner_loop_smc1: lda $2000,Y -xloop_smc2: +mask_smc: + and #$CC +inner_loop_smc2: sta $2000,Y dey - bpl scroll_xloop + cpy #29 + bne inner_loop - inc INL - inc OUTL - - lda INL - cmp #192 - bne scroll_yloop - - ; blank bottom line - - - lda #$00 - ldy #39 -scroll_hline_xloop: - sta $23D0,Y - sta $27D0,Y - sta $2BD0,Y - sta $2FD0,Y - sta $33D0,Y - sta $37D0,Y - sta $3BD0,Y - sta $3FD0,Y - dey - bpl scroll_hline_xloop + dex + bpl outer_loop rts +.include "hgr_clear_screen.s" diff --git a/graphics/hgr/hgr_font_4am/font_console_1x8.s b/graphics/hgr/hgr_font_4am/font_console_1x8.s index 5f5b72d2..1ed4811c 100644 --- a/graphics/hgr/hgr_font_4am/font_console_1x8.s +++ b/graphics/hgr/hgr_font_4am/font_console_1x8.s @@ -10,6 +10,9 @@ ; VMW: commented, reformatted, minor changes, ca65 assembly ; hacked up some more +FONT_OFFSET = $13 + + ;------------------------------------------------------------------------------ ; DrawCondensedString ; @@ -121,6 +124,18 @@ dcb_loop_smc: adc #8 sta CV inx + + lda CV + cmp #192 + bcc dcb_loop + + lda #184 + sta CV + + stx XSAVE + jsr scroll_screen + ldx XSAVE + jmp dcb_loop @@ -128,28 +143,28 @@ not_linefeed: ; unrolled loop to write out each line dcb_row0: - lda CondensedRow0-$19, Y ; get 1-byte font row + lda CondensedRow0-FONT_OFFSET, Y ; get 1-byte font row sta $FDFD, X ; write out to graphics mem dcb_row1: - lda CondensedRow1-$19, Y + lda CondensedRow1-FONT_OFFSET, Y sta $FDFD, X dcb_row2: - lda CondensedRow2-$19, Y + lda CondensedRow2-FONT_OFFSET, Y sta $FDFD, X dcb_row3: - lda CondensedRow3-$19, Y + lda CondensedRow3-FONT_OFFSET, Y sta $FDFD, X dcb_row4: - lda CondensedRow4-$19, Y + lda CondensedRow4-FONT_OFFSET, Y sta $FDFD, X dcb_row5: - lda CondensedRow5-$19, Y + lda CondensedRow5-FONT_OFFSET, Y sta $FDFD, X dcb_row6: - lda CondensedRow6-$19, Y + lda CondensedRow6-FONT_OFFSET, Y sta $FDFD, X dcb_row7: - lda CondensedRow7-$19, Y + lda CondensedRow7-FONT_OFFSET, Y sta $FDFD, X inc CH @@ -171,3 +186,66 @@ dcb_done: rts + + ;================================ + ;================================ + ; scroll_screen + ;================================ + ;================================ + ; scrolls hgr page1 up by 8, filling with empty space at bottom + ; trashes A,X,Y + +scroll_screen: + ldx #8 + stx SCROLL_IN + ldx #0 + stx SCROLL_OUT + +scroll_yloop: + ldx SCROLL_IN + lda hposn_low,X + sta xloop_smc1+1 + lda hposn_high,X + sta xloop_smc1+2 + + ldx SCROLL_OUT + lda hposn_low,X + sta xloop_smc2+1 + lda hposn_high,X + sta xloop_smc2+2 + + ldy #39 +scroll_xloop: +xloop_smc1: + lda $2000,Y +xloop_smc2: + sta $2000,Y + dey + bpl scroll_xloop + + inc SCROLL_IN + inc SCROLL_OUT + + lda SCROLL_IN + cmp #192 + bne scroll_yloop + + ; blank bottom line + + + lda #$00 + ldy #39 +scroll_hline_xloop: + sta $23D0,Y + sta $27D0,Y + sta $2BD0,Y + sta $2FD0,Y + sta $33D0,Y + sta $37D0,Y + sta $3BD0,Y + sta $3FD0,Y + dey + bpl scroll_hline_xloop + + rts + diff --git a/graphics/hgr/hgr_font_4am/fonts/Makefile b/graphics/hgr/hgr_font_4am/fonts/Makefile index d96f427b..fef88595 100644 --- a/graphics/hgr/hgr_font_4am/fonts/Makefile +++ b/graphics/hgr/hgr_font_4am/fonts/Makefile @@ -4,10 +4,10 @@ PNG2FONT = ../../../../utils/hgr-utils/png2font all: a2_lowercase_font.inc a2_cga_thin.inc a2_lowercase_font.inc: a2_lowercase.png - $(PNG2FONT) -i a2_lowercase.png > a2_lowercase_font.inc + $(PNG2FONT) -i -o 0x19 a2_lowercase.png > a2_lowercase_font.inc a2_cga_thin.inc: a2_cga_thin.png - $(PNG2FONT) -i a2_cga_thin.png > a2_cga_thin.inc + $(PNG2FONT) -i -o 0x13 a2_cga_thin.png > a2_cga_thin.inc clean: diff --git a/graphics/hgr/hgr_font_4am/fonts/a2_cga_thin.png b/graphics/hgr/hgr_font_4am/fonts/a2_cga_thin.png index db7a69177019f6f524cc071f5635cab126bf4298..435766033c649da9ae466f1c6ec33e2ea249ac94 100644 GIT binary patch literal 5165 zcmeHKc~leE8V}ZuO`$FbSQ`VPAd_U0up|&ElCW5!hzLQUb}}=86ta*EBv8kNB}4r7 z?@9X#SM;BcK72gg&ba=)KU(*X+Aj5h%6uZpM6%2l{ zMPJ|VY5HK&`Vq$X(~gFlW+OL*T{E&aMgNpnfE55ac1S!t{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