diff --git a/extra/config/testMachine.dvm b/extra/config/testMachine.dvm index 93e2913..ecf8ba2 100644 --- a/extra/config/testMachine.dvm +++ b/extra/config/testMachine.dvm @@ -4,10 +4,10 @@ CMOS = dragon/cmos.dr cpuext = extmov, extalu fixed_clock = false -clock_rate_sec = 2000 +clock_rate_sec = 5000 memory_extension_pages = 16 -screen_redraw_rate_per_second = 50 +screen_redraw_rate_per_second = 10 SingleColor_foreground = #009900FF SingleColor_background = #111111FF diff --git a/extra/dragon/cmos.dr b/extra/dragon/cmos.dr index 357fb01..fbd3acf 100644 Binary files a/extra/dragon/cmos.dr and b/extra/dragon/cmos.dr differ diff --git a/extra/dragon/disk1.dr b/extra/dragon/disk1.dr index 23815bd..f7e074e 100644 Binary files a/extra/dragon/disk1.dr and b/extra/dragon/disk1.dr differ diff --git a/extra/dss/drake/bootsector.dss b/extra/dss/drake/bootsector.dss index 42b99b5..e2bd6dc 100644 --- a/extra/dss/drake/bootsector.dss +++ b/extra/dss/drake/bootsector.dss @@ -5,13 +5,19 @@ @include @include + + .data $string "Hello " $ddd $dpt_block $textCell + + .code + + _drake_bootsector_entry_point: push 0 call $_load_dpt_block @@ -22,10 +28,37 @@ _drake_bootsector_entry_point: push 2 call $_draw_palette - ## mov R9, { $dpt_block + DPTStructure.ENTRIES_START + (2 * DPTStructure.ENTRY_SIZE_B) + DPTStructure.ENTRY_PART_LBL } + + + movb [$textCell.CoordX], 2 + movb [$textCell.CoordY], 2 + movb [$textCell.Foreground], DefaultPalette.Orange + movb [$textCell.Background], DefaultPalette.Black + + push $string + push $textCell + push 2 + call $_print_string + + + + + movb [$textCell.CoordX], 8 + movb [$textCell.CoordY], 2 + movb [$textCell.Foreground], DefaultPalette.Black + movb [$textCell.Background], DefaultPalette.Orange + + push { $dpt_block + DPTStructure.ENTRIES_START + (2 * DPTStructure.ENTRY_SIZE_B) + DPTStructure.ENTRY_PART_LBL } + push $textCell + push 2 + call $_print_string + + hlt + + _load_dpt_block: mov [$ddd.Mode], DiskMode.READ mov [$ddd.Disk], 0x00 @@ -38,6 +71,27 @@ _load_dpt_block: call $_disk_load_from_ddd_blocking ret + + +_print_string: ## _print_string(String* str, Text16VModeCell* cell) + arg R1 ## @Param: String addr + arg R2 ## @Param: Cell addr +_print_string_loop: + mov R6, R2 ## Restore Cell addr + movb *R6, *R1 ## Move next character into cell + inc R1 ## Point address to next character + addip R6, 3 ## Offset to X coord of cell + movb R7, *R6 ## Store X coord in R7 + inc R7 ## Increment X coord + movb *R6, R7 ## Store new X coord in cell + mov R10, 0x21 ## int 0x30 parameter for print_char_text16 + mov R9, R2 ## int 0x30 parameter for text_cell address + int 0x30 ## bios_video_int + movb ACC, *R1 ## Copy current character in ACC + jne $_print_string_loop, 0 ## Jump if current character is not 0 (NULL_TERM) + ret + + .fixed 5120, 0xFF diff --git a/extra/dss/drake/palette.dss b/extra/dss/drake/palette.dss index 3fce7d0..e87d486 100644 --- a/extra/dss/drake/palette.dss +++ b/extra/dss/drake/palette.dss @@ -41,6 +41,5 @@ _draw_palette_loop: inc R5 mov ACC, R5 - debug_break jge $_draw_palette_loop, 15 ret \ No newline at end of file diff --git a/src/assembler/Assembler.cpp b/src/assembler/Assembler.cpp index 2afe323..8bed21c 100644 --- a/src/assembler/Assembler.cpp +++ b/src/assembler/Assembler.cpp @@ -2521,5 +2521,5 @@ namespace dragon if (opEdit == "fl") return data::Registers::FL; return data::Registers::Last; } - } + } } \ No newline at end of file diff --git a/src/runtime/DragonRuntime.cpp b/src/runtime/DragonRuntime.cpp index b1c1064..236b1c0 100644 --- a/src/runtime/DragonRuntime.cpp +++ b/src/runtime/DragonRuntime.cpp @@ -378,7 +378,7 @@ namespace dragon avg_count++; avg_tot += _time; s_avgInstTime = (uint64_t)std::round(avg_tot / avg_count); - // out.fg(ostd::ConsoleColors::Red).p(s_avgInstTime).nl().reset(); + // out.fg(ostd::ConsoleColors::Red).p(getAvgClockSpeed()).nl().reset(); acc = 0; } if (acc2 == (1000 / screenRedrawRate))