diff --git a/asm/ozmoo.asm b/asm/ozmoo.asm index e7f9ec46..637c000e 100644 --- a/asm/ozmoo.asm +++ b/asm/ozmoo.asm @@ -912,7 +912,7 @@ game_id !byte 0,0,0,0 cld cli !ifdef TARGET_X16 { - jsr x16_backup_basic_zp + jsr x16_backup_basic_zp } !ifdef TARGET_C128 { lda #$f0 ; Background colour @@ -1597,9 +1597,41 @@ vmem_cache_count = vmem_cache_size / 256 stack_start +!ifdef TARGET_X16 { +!ifdef CUSTOM_FONT { +fontfile_name !pet "zfont" +fontfile_name_len = * - fontfile_name + +font_read_error + lda #ERROR_FLOPPY_READ_ERROR + jmp fatalerror +} +} + deletable_screen_init_1 ; start text output from bottom of the screen +!ifdef TARGET_X16 { +!ifdef CUSTOM_FONT { + lda #fontfile_name_len + ldx #fontfile_name + jsr kernal_setnam ; call SETNAM + lda #2 ; file number 2 + ldx #8 + ldy #2 ; secondary address + jsr kernal_setlfs ; call SETLFS + lda #3 ; Load into VRAM, bank 1 + ldx #$00 + ldy #$f0 + jsr kernal_load + php + jsr close_io + plp + bcs font_read_error +} +} + !ifndef Z4PLUS { !ifdef TARGET_C128 { bit COLS_40_80 diff --git a/make.rb b/make.rb index ae5e6dfd..8a85ef07 100644 --- a/make.rb +++ b/make.rb @@ -1203,7 +1203,7 @@ def build_specific_boot_file(vmem_preload_blocks, vmem_contents) font_clause = "" asm_clause = "" decrunch_effect = "" - if $font_filename + if $font_filename and $target != 'x16' font_clause = " \"#{$font_filename}\"@#{$font_address}" end exo_target = "" @@ -2101,8 +2101,9 @@ def build_zip(storyname, diskimage_filename, config_data, vmem_data, # Add terp and story file FileUtils.cp($ozmoo_file, foldername+"/"+$file_name.upcase) -# FileUtils.cp($story_file, foldername+"/ZCODE") IO.binwrite(foldername+"/ZCODE", $story_file_data); + # Add font, if any + FileUtils.cp($font_filename, foldername+"/ZFONT") if $font_filename # Create the zip file command = "#{$ZIP} #{foldername}.zip #{foldername}" @@ -2614,6 +2615,9 @@ def print_usage elsif $target == 'plus4' $font_address = 0x1000 $start_address = 0x1800 + elsif $target == 'x16' + $font_address = 0xf000 +# $start_address = 0x1800 else puts "ERROR: Custom fonts are currently not supported for this target platform." exit 1 diff --git a/releasenotes.txt b/releasenotes.txt index 9966eb7f..7ee6c223 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -7,6 +7,7 @@ New/changed features: - Made restart fast on X16 (don't reload statmem after restart) - Enabled scroll speed control and tear-free scrolling on X16 - Made Z-machine beeps work on X16 +- Added support for custom fonts on X16 Optimizations: - Moved print_buffer, print_buffer2, memory_buffer and directory_buffer to leave more continuous space for future use. diff --git a/version.txt b/version.txt index f27c8dcc..f96c7934 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -14.6 +14.7