From d8dee243a105ec6de0d1d184e816cd315e99418b Mon Sep 17 00:00:00 2001 From: OmniaX-dev Date: Tue, 2 Apr 2024 16:52:26 +0200 Subject: [PATCH] [0.3.1591] - Started work on first bootloader --- CMakeLists.txt | 2 +- build.nr | 2 +- create_win_release.sh | 16 +- extra/config/testMachine.dvm | 4 +- .../{DragonVM Information Sheet => info} | 23 ++- extra/dragon/bios.bin | Bin 4096 -> 4096 bytes extra/dragon/cmos.dr | Bin 128 -> 128 bytes extra/dss/activeTest.dss | 21 +++ extra/dss/bios/data.dss | 10 +- .../{logo_screen.dss => display_info.dss} | 89 ++++------- extra/dss/bios/drivers.dss | 7 + extra/dss/bios/entry.dss | 138 +----------------- extra/dss/{mbr.dss => drake.dss} | 0 extra/dss/{ => tests}/extmov_unit_tests.dss | 0 extra/dss/{ => tests}/newTest.dss | 0 extra/dss/{ => tests}/test1.dss | 0 extra/dss/{ => tests}/test2.dss | 0 extra/make_and_debug | 4 +- extra/make_and_run | 4 +- extra/scripts/load_mbr | 8 +- extra/scripts/run-test-1.bat | 2 +- extra/scripts/run-test-2.bat | 2 +- src/hardware/VirtualDisplay.cpp | 13 ++ src/hardware/VirtualDisplay.hpp | 2 + 24 files changed, 129 insertions(+), 218 deletions(-) rename extra/dragon info/{DragonVM Information Sheet => info} (82%) create mode 100644 extra/dss/activeTest.dss rename extra/dss/bios/{logo_screen.dss => display_info.dss} (64%) rename extra/dss/{mbr.dss => drake.dss} (100%) rename extra/dss/{ => tests}/extmov_unit_tests.dss (100%) rename extra/dss/{ => tests}/newTest.dss (100%) rename extra/dss/{ => tests}/test1.dss (100%) rename extra/dss/{ => tests}/test2.dss (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7617fdd..4c1a393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ #----------------------------------------------------------------------------------------- set(PROJ_NAME DragonVM) set(MAJOR_VER 0) -set(MINOR_VER 2) +set(MINOR_VER 3) #----------------------------------------------------------------------------------------- #Setup diff --git a/build.nr b/build.nr index d6d863f..2973cf2 100644 --- a/build.nr +++ b/build.nr @@ -1 +1 @@ -1590 +1592 diff --git a/create_win_release.sh b/create_win_release.sh index cd3aeae..e3cc50d 100644 --- a/create_win_release.sh +++ b/create_win_release.sh @@ -14,15 +14,15 @@ rm dragon/disk1.dr ./dtools new-vdisk dragon/disk1.dr 1048576 printf "\n${green}Compiling MBR Block...\n${clear}" -./dasm dss/mbr.dss -o dragon/mbr.bin --save-disassembly disassembly/mbr.dds --verbose +./dasm dss/drake.dss -o dragon/drake.bin --save-disassembly disassembly/drake.dds --verbose printf "\n${green}Loading MBR Block...\n${clear}" -./dtools load-binary dragon/disk1.dr dragon/mbr.bin 0x00000000 +./dtools load-binary dragon/disk1.dr dragon/drake.bin 0x00000000 printf "${green}Compiling Test Program 1...\n" -./dasm dss/test1.dss -o test1.bin --save-disassembly disassembly/test1.dds --verbose +./dasm dss/tests/test1.dss -o test1.bin --save-disassembly disassembly/test1.dds --verbose printf "${green}Compiling Test Program 2...\n" -./dasm dss/test2.dss -o test2.bin --save-disassembly disassembly/test2.dds --verbose +./dasm dss/tests/test2.dss -o test2.bin --save-disassembly disassembly/test2.dds --verbose printf "${green}Creating Windows Release...\n" cd .. @@ -36,7 +36,7 @@ cp ./bin/font.bmp ./win-release cp -r ./bin/config ./win-release cp -r ./bin/disassembly/bios.dds ./win-release/disassembly -cp -r ./bin/disassembly/mbr.dds ./win-release/disassembly +cp -r ./bin/disassembly/drake.dds ./win-release/disassembly cp -r ./bin/disassembly/test1.dds ./win-release/disassembly cp -r ./bin/disassembly/test2.dds ./win-release/disassembly cp -r ./bin/dragon ./win-release @@ -47,9 +47,9 @@ rm ./bin/disassembly/test2.dds mkdir ./win-release/dss4 mkdir ./win-release/dss/bios cp ./bin/dss/bios/* ./win-release/dss/bios -cp ./bin/dss/mbr.dss ./win-release/dss -cp ./bin/dss/test1.dss ./win-release/dss -cp ./bin/dss/test2.dss ./win-release/dss +cp ./bin/dss/drake.dss ./win-release/dss +cp ./bin/dss/tests/test1.dss ./win-release/dss +cp ./bin/dss/tests/test2.dss ./win-release/dss cp C:/msys64/ucrt64/bin/libgcc_s_seh-1.dll ./win-release cp C:/msys64/ucrt64/bin/libstdc++-6.dll ./win-release diff --git a/extra/config/testMachine.dvm b/extra/config/testMachine.dvm index 5886c4e..2b46009 100644 --- a/extra/config/testMachine.dvm +++ b/extra/config/testMachine.dvm @@ -2,8 +2,8 @@ Disks = dragon/disk1.dr Bios = dragon/bios.bin CMOS = dragon/cmos.dr cpuext = extmov, extalu -fixed_clock = false -clock_rate_sec = 512 +fixed_clock = true +clock_rate_sec = 644 SingleColor_foreground = #009900FF SingleColor_background = #111111FF \ No newline at end of file diff --git a/extra/dragon info/DragonVM Information Sheet b/extra/dragon info/info similarity index 82% rename from extra/dragon info/DragonVM Information Sheet rename to extra/dragon info/info index 41f9e30..de764e6 100644 --- a/extra/dragon info/DragonVM Information Sheet +++ b/extra/dragon info/info @@ -93,11 +93,13 @@ 0x04: Text SIngle Color - Direct Print buffer & Flush Buffer 0x05: Text Single Color - Flush Buffer 0x06: Text Single Color - Print Buffer Without Flushing + 0x07: Text Single Color - Print Buffered String 0xE0: Refresh Screen 0xE1: Clear Screen 0x04: Text Single Color Character (1 Byte) 0x05: Text Single Color Inverted colors (1 Byte) + 0x06: (2 bytes) Text Single Color Buffered String Address 0x16FF ------- 0x1700 GENERIC SERIAL INTERFACE (64 Bytes) @@ -144,4 +146,23 @@ MAX INTERRUPT 0xAA 0x80: Disk Interface Finished 0xA0: Keyboard Interface - Key Pressed 0xA1: Keyboard Interface - Key Released -0xA2: Keyboard Interface - Text Entered \ No newline at end of file +0xA2: Keyboard Interface - Text Entered + + + +#========================================================================================================================================== +# DPT - Partition Table +#========================================================================================================================================== + +Disk Address: 0x200 - 0x400 (512 bytes) +Header: (0x200 - 0x20B) (12 bytes) + 0x000: (2 bytes) - 0xF1CA - This number identifies this block as a DPT partition table + 0x002: (2 bytes) - DPT version + 0x004: (1 byte) - Partition count (max 5) + 0x005: (7 bytes) - Reserved +Partition Table: (0x20C - 0x3FF) (500 bytes) + Entry: (100 bytes) (x5) + 0x00: (4 bytes) - Start Address + 0x04: (4 bytes) - Size + 0x08: (28 bytes) - Reserved + 0x40: (64 bytes) - Partition label diff --git a/extra/dragon/bios.bin b/extra/dragon/bios.bin index d220f3cd4697c4dfda21d4639462b4e358b0b42a..8b67f0035743479d3c31daf6b065d31c55e08f91 100644 GIT binary patch literal 4096 zcmeHGO>Y!O5Utsn?txw(dS*QfC>+Mt$YZap#unfM2x$#DgoBlJR$loU12GaLvuY3s zG)U%47UD0Edk(op$`vG}+(Hid170cT`~$qH>Yi<{9fIJL%eL(5SJm}ieT-cOX8|Di zQh&Q${BZf|*WDD-E4Pblw=N)9yYYRY9}xQLA*7cd+`VxJ%1fVrN+?r0d6s2`GVl}3 zh-G=%R-x30t5k8}KNJpF6%T77wh{; z6SKy#Xfhm(-YrmS)nI4FXvE5M90x^gA(vHwjww&h!IV`kEMz+DIZh{UwelQ)P_Bm^ zx6=H!>(O;+SATBA+H@Ho0*-aGztv*ZECbhB;8Mo8YAZcpRdKaBDu;K+G>8-Dt)f_5 zG%1T&=U*(7IhxLl@5&&R4h?#^mNK!_t-Mg@F4`U(*SLpSCZr1680`no77|oek*&m$ zT2-*RTuE&E@XH5kxdfcR*6YwLDFl1CN{w@l5gr?TO?mTDqTC_ilB+h|^>TFnv8*k2_H7@*z10!FumWoP7bFW^+)} zY#Dsbu0o*MCNRymforBA)a)J{)9eu(*X$Vx&0axWvtM9Jv)8bv*>5l?+3yR@AWoZp z4Pn|01VSI-yom9EyjnY+=W!p40LEnqHR{CchO^f7$J|Pb1dz$`H?WZ5bs*_ilFy9f z9B;Bd`x$WK%rohXD#cA6d#Dgv1!@(&J-pt_7?$yCOzkhBt)Y!!+xZ@Psd=dzJB5B| zP|%3MH;8hSi!p<2wpIJlsS&#|%9MdY6q_^1X8(C8`?SjjgQ(US7b6CCj zHhSW`06!9ZS;(Ep=NMQQ^v(F+k??z5ho=B$#jp%d&kAUZlY(zZ0np=KKU|@|vZb~t z!!;eQ0Sr!X5QE5vrFFk8yfR$*CSDcvr5EtyL|pVK3rom4z&saip~L$C?RpvBjQsk> aaB?Oam~3FOfyo9Y8<=chvVs3&1OEVB;nP(B literal 4096 zcmeHIL2nyH6#mw`GcJ?M>^kcpB&12S>Lw-(0R;|4m7D?+s6uQowt6L@1&PwNrXUow z2e(yKD*gZ`&fK`c2~OPMzz>Ky^B0ovW_CSsLa6A8i$}?u@4b27``&v_e|8QH}9gl`t+wlrR>SGEGxBx|G~^y zH80yMwVrXcF0cGcg;Q3;BTeF#<^F(xCDm0nXSG}%&&pjm?^)KMaBm~(S(jO+mA0i^ ztTvuyC!@jadkwVSaoC$Vnq}oVjYCChA)nQN!pU3bbjn7Hgj|Os&nfa=FVE?R%8jVw zp2~0g9({-P>bGaC8$RPA;92MU+bMV4GH9J8EoF|Y_tYt?iR&9PIl2qiAWfY2%5rnl zrEF%!KUgkvHk}*a%MjHbJLp+0?PAKWywuyT*FAWybI-C|NSAeEc0Y9Xh@i8ET$ebf z)dZW%OH$isUoOz{2{b{iSJ+wR&y!d-k7Vju=SffOkP>xvUdFLW>*@cMuU1f9Kr#eM z9-b`AX>?b1D3Cgc7Bg-g_RB2<)@h;YOip6nG11qMCi)35(XR-q z=(pAMUeZri)B9vs(g$Si{jj+oHTUC0r4vy4ZoHcmXbsqrbqJ#Nj%;zZg21pfvMRbfZLd!xll+jRe7v z;JQfY!FsKJvd)t+)d$688!g*JFyN|o!#TI9WeX6K({EHmM%QV{uqiolB`@GwmrHI={i#BJzN%2Zlw3ca{2&RP9IwHs72;+XJWV2;psPH_9rkLiB|=} zSn!vHoWvogz^<@ev%g{yj=13~z?wLz_;YIleetZ|Ln(j}55}CnCJJozMa8chejS*u zaENIfVrw_-i=g7$?i)?~V&P4^q+U}io5`+$MifJEX4%O`ME?_UuGG*kDt(ebo{+yDRo literal 128 PcmWf4`2U}YVc-A&Cd>j@ diff --git a/extra/dss/activeTest.dss b/extra/dss/activeTest.dss new file mode 100644 index 0000000..f9f0e16 --- /dev/null +++ b/extra/dss/activeTest.dss @@ -0,0 +1,21 @@ +##================================================================================================================================= +## This is the test2 program for the Dragon Virtual Machine. This example simply demonstrates the Virtual Display in Text-Single-Color +## mode, by printing an increasing counter followed by whatever is in the $string variable. The program also clears the screen +## every 10 lines. +##================================================================================================================================= + +.load 0x1740 + +.data + $string "Hello World!!" + +.code + mov R10, 0x0C + mov R9, $string + int 0x30 + +end_loop: + jmp $end_loop + hlt + +.fixed 512, 0x00 \ No newline at end of file diff --git a/extra/dss/bios/data.dss b/extra/dss/bios/data.dss index 89f9b68..41ea5be 100644 --- a/extra/dss/bios/data.dss +++ b/extra/dss/bios/data.dss @@ -1,8 +1,9 @@ @guard _DATA_DSS_ -@export BIOS_API bios_api.dss +@export BIOS_API dss/bios_api.dss ## ============================= Memory Mapped Devices and Registers ============================= +@export_comment /BIOS_API "These are the base addresses of the memory map." @group MemoryAddresses MBR 0x1380 INT_VEC 0x1080 @@ -11,6 +12,7 @@ CMOS 0x1000 VGA 0x1600 @end +@export_comment /BIOS_API "\n" @group CMOS_Settings MEM_START { MemoryAddresses.CMOS + 0x0000 } @@ -38,6 +40,7 @@ SIGNAL { MemoryAddresses.VGA + 0x0003 } TEXT_SINGLE_CHAR { MemoryAddresses.VGA + 0x0004 } TEXT_SIGNLE_INVERT { MemoryAddresses.VGA + 0x0005 } + TEXT_SIGNLE_STR { MemoryAddresses.VGA + 0x0006 } BUFF_START { MemoryAddresses.VGA + 0x00E0 } @end @@ -61,6 +64,7 @@ PRINT_FLUSH_BUFF 0x04 FLUSH_BUFF 0x05 PRINT_BUFF 0x06 + PRINT_STRING 0x07 REFRESH_SCREEN 0xE0 CLEAR_SCREEN 0xE1 @@ -78,8 +82,8 @@ .data $_bios_version_number_maj 0x00, 0x00 - $_bios_version_number_min 0x00, 0x03 - $_bios_name " DragonBIOS " + $_bios_version_number_min 0x00, 0x04 + $_bios_name "DragonBIOS " $_clock_str " Clock: " $_mem_str " Memory: " $_hz_str " Hz" diff --git a/extra/dss/bios/logo_screen.dss b/extra/dss/bios/display_info.dss similarity index 64% rename from extra/dss/bios/logo_screen.dss rename to extra/dss/bios/display_info.dss index 105461c..9be5451 100644 --- a/extra/dss/bios/logo_screen.dss +++ b/extra/dss/bios/display_info.dss @@ -1,109 +1,78 @@ -@guard _LOGO_SCREEN_DSS_ - -_print_logo_screen: +@guard _DISPLAY_INFO_DSS_ +_print_machine_info: + mov R9, $_bios_logo_2_line_1 + mov R10, 0x0C + int 0x30 ## Print Next Logo Line + mov R10, 0x02 + int 0x30 ## Print New Line mov R9, $_bios_logo_2_line_2 - mov R10, 0x0A - int 0x30 - - - - - mov R9, $_bios_logo_2_line_2 - mov R10, 0x0A - int 0x30 - - mov R10, 0x03 + mov R10, 0x0C + int 0x30 ## Print Next Logo Line + mov R10, 0x01 + mov R9, 32 + int 0x30 ## Print ' ' character + mov R10, 0x0B + int 0x30 ## Invert colors + mov R10, 0x0C mov R9, $_bios_name int 0x30 ## Print BIOS Name - mov R10, 0x04 mov R9, [$_bios_version_number_maj] int 0x30 ## Print BIOS Version (Major) - mov R10, 0x01 mov R9, 46 int 0x30 ## Print '.' character - mov R10, 0x04 mov R9, [$_bios_version_number_min] int 0x30 ## Print BIOS Version (Minor) - + mov R10, 0x0B + int 0x30 ## Invert colors mov R10, 0x02 int 0x30 ## Print New Line - - - - mov R9, $_bios_logo_2_line_3 - mov R10, 0x0A - int 0x30 - - mov R10, 0x03 + mov R10, 0x0C + int 0x30 ## Print Next Logo Line + mov R10, 0x0C mov R9, $_clock_str int 0x30 ## Print Clock label - mov R10, 0x04 mov R9, [CMOS_Settings.CLOCK_SPEED] int 0x30 ## Print Clock speed - - mov R10, 0x03 + mov R10, 0x0C mov R9, $_hz_str int 0x30 ## Print hz label - mov R10, 0x02 int 0x30 ## Print New Line - - - - mov R9, $_bios_logo_2_line_4 - mov R10, 0x0A - int 0x30 - - mov R10, 0x03 + mov R10, 0x0C + int 0x30 ## Print Next Logo Line + mov R10, 0x0C mov R9, $_mem_str int 0x30 ## Print Memory label - mov R10, 0x04 mov R9, [CMOS_Settings.MEM_START] int 0x30 ## Print Memory start - mov R10, 0x01 mov R9, 47 int 0x30 ## Print '/' character - mov R10, 0x04 mov R9, [CMOS_Settings.MEM_SIZE] int 0x30 ## Print Memory size - - mov R10, 0x03 + mov R10, 0x0C mov R9, $_byte_str int 0x30 ## Print bytes label - mov R10, 0x02 int 0x30 ## Print New Line - - - - mov R9, $_bios_logo_2_line_5 mov R7, 4 mov ACC, 19 - mov R10, 0x0B - int 0x30 _print_machine_info_logo_loop: inc R7 - mov R10, 0x0A - int 0x30 - addip R9, 54 ## 90 is the length of a line - mov R10, 0x08 - int 0x30 + mov R10, 0x0C + int 0x30 ## Print Next Logo Line + addip R9, 54 ## 54 is the length of a line mov R10, 0x02 - int 0x30 - debug_break + int 0x30 ## Print New Line jls $_print_machine_info_logo_loop, R7 - mov R10, 0x0B - int 0x30 - ret \ No newline at end of file diff --git a/extra/dss/bios/drivers.dss b/extra/dss/bios/drivers.dss index 0fba845..810b1c2 100644 --- a/extra/dss/bios/drivers.dss +++ b/extra/dss/bios/drivers.dss @@ -53,6 +53,7 @@ _int_30_handler: jeq $_int_30_flush_buffer_text_single, 0x0009 jeq $_int_30_store_string_text_single, 0x000A jeq $_int_30_invert_colors_text_single, 0x000B + jeq $_int_30_print_string_buffered, 0x000C jeq $_int_30_clear_screen, 0x00E0 jeq $_int_30_refresh_screen, 0x00E1 jmp $_int_30_end @@ -114,6 +115,12 @@ _int_30_invert_colors_text_single: _int_30_invert_colors_text_single_normal: movb [VGA_Registers.TEXT_SIGNLE_INVERT], 0 jmp $_int_30_end +_int_30_print_string_buffered: + mov [VGA_Registers.TEXT_SIGNLE_STR], R9 + debug_break + movb [VGA_Registers.SIGNAL], Sig_VGA_Text_Single_Color.PRINT_STRING + jmp $_int_30_end + _int_30_clear_screen: diff --git a/extra/dss/bios/entry.dss b/extra/dss/bios/entry.dss index 2f37e4c..101083f 100644 --- a/extra/dss/bios/entry.dss +++ b/extra/dss/bios/entry.dss @@ -15,7 +15,7 @@ int 0x20 ## -Calling int 0x20 with 0x00 as parameter, to set new handler up push 0 - call $_print_machine_info + call $_print_machine_info ## Print BIOS logo and machine info ## MBR Loading and FL, 0b1111111111111110 ## Disable interrupts @@ -32,136 +32,10 @@ ## ======================================================================== @include +@include + +## This file contains the .data section, so it needs to be the last thing included @include +## =============================================================================== -_print_machine_info: - - - mov R9, $_bios_logo_2_line_1 - mov R10, 0x0A - int 0x30 - - mov R10, 0x08 ## Print and flush buffer - int 0x30 - - mov R10, 0x02 - int 0x30 - - - - mov R9, $_bios_logo_2_line_2 - mov R10, 0x0A - int 0x30 - - mov R10, 0x08 ## Print and flush buffer - int 0x30 - - - - mov R10, 0x0A - mov R9, $_bios_name - int 0x30 ## Print BIOS Name - - mov R10, 0x05 - mov R9, [$_bios_version_number_maj] - int 0x30 ## Print BIOS Version (Major) - - mov R10, 0x06 - mov R9, 46 - int 0x30 ## Print '.' character - - mov R10, 0x05 - mov R9, [$_bios_version_number_min] - int 0x30 ## Print BIOS Version (Minor) - - mov R10, 0x02 - int 0x30 ## Print New Line - - - - - - - mov R9, $_bios_logo_2_line_3 - mov R10, 0x0A - int 0x30 - - mov R10, 0x08 ## Print and flush buffer - int 0x30 - - - - mov R10, 0x0A - mov R9, $_clock_str - int 0x30 ## Print Clock label - - mov R10, 0x05 - mov R9, [CMOS_Settings.CLOCK_SPEED] - int 0x30 ## Print Clock speed - - mov R10, 0x0A - mov R9, $_hz_str - int 0x30 ## Print hz label - - mov R10, 0x02 - int 0x30 ## Print New Line - - - - - - - mov R9, $_bios_logo_2_line_4 - mov R10, 0x0A - int 0x30 - - mov R10, 0x08 ## Print and flush buffer - int 0x30 - - - - mov R10, 0x0A - mov R9, $_mem_str - int 0x30 ## Print Memory label - - mov R10, 0x05 - mov R9, [CMOS_Settings.MEM_START] - int 0x30 ## Print Memory start - - mov R10, 0x06 - mov R9, 47 - int 0x30 ## Print '/' character - - mov R10, 0x05 - mov R9, [CMOS_Settings.MEM_SIZE] - int 0x30 ## Print Memory size - - mov R10, 0x0A - mov R9, $_byte_str - int 0x30 ## Print bytes label - - mov R10, 0x02 - int 0x30 ## Print New Line - - - - - - mov R9, $_bios_logo_2_line_5 - mov R7, 4 - mov ACC, 19 -_print_machine_info_logo_loop: - inc R7 - mov R10, 0x0A - int 0x30 - addip R9, 54 ## 90 is the length of a line - mov R10, 0x08 - int 0x30 - mov R10, 0x02 - int 0x30 - jls $_print_machine_info_logo_loop, R7 - - - ret - -.fixed 4096, 0x00 ## BIOS Needs to be 4096 Bytes exactly +.fixed 4096, 0xFF ## BIOS Needs to be 4096 Bytes exactly diff --git a/extra/dss/mbr.dss b/extra/dss/drake.dss similarity index 100% rename from extra/dss/mbr.dss rename to extra/dss/drake.dss diff --git a/extra/dss/extmov_unit_tests.dss b/extra/dss/tests/extmov_unit_tests.dss similarity index 100% rename from extra/dss/extmov_unit_tests.dss rename to extra/dss/tests/extmov_unit_tests.dss diff --git a/extra/dss/newTest.dss b/extra/dss/tests/newTest.dss similarity index 100% rename from extra/dss/newTest.dss rename to extra/dss/tests/newTest.dss diff --git a/extra/dss/test1.dss b/extra/dss/tests/test1.dss similarity index 100% rename from extra/dss/test1.dss rename to extra/dss/tests/test1.dss diff --git a/extra/dss/test2.dss b/extra/dss/tests/test2.dss similarity index 100% rename from extra/dss/test2.dss rename to extra/dss/tests/test2.dss diff --git a/extra/make_and_debug b/extra/make_and_debug index 3cd9d86..07bb9e3 100755 --- a/extra/make_and_debug +++ b/extra/make_and_debug @@ -17,9 +17,9 @@ if [ $? -eq 0 ]; then /bin/bash ./load_mbr cd .. printf "${green}Compiling Test Program...\n" - ./dasm dss/newTest.dss -o newTest.bin --extmov --extalu --save-disassembly disassembly/newTest.dds --verbose + ./dasm dss/activeTest.dss -o activeTest.bin --extmov --extalu --save-disassembly disassembly/activeTest.dds --verbose printf "\n${green}Running Application...\n\n${clear}" - ./ddb config/testMachine.dvm --force-load newTest.bin 0x00 --verbose-load + ./ddb config/testMachine.dvm --force-load activeTest.bin 0x00 --verbose-load cp dragon/disk1.dr ../extra/dragon/disk1.dr cp dragon/cmos.dr ../extra/dragon/cmos.dr fi diff --git a/extra/make_and_run b/extra/make_and_run index fd22f20..1862670 100755 --- a/extra/make_and_run +++ b/extra/make_and_run @@ -17,9 +17,9 @@ if [ $? -eq 0 ]; then /bin/bash ./load_mbr cd .. printf "${green}Compiling Test Program...\n" - ./dasm dss/newTest.dss -o newTest.bin --extmov --extalu --save-disassembly disassembly/newTest.dds --verbose + ./dasm dss/activeTest.dss -o activeTest.bin --extmov --extalu --save-disassembly disassembly/activeTest.dds --verbose printf "\n${green}Running Application...\n\n${clear}" - ./dvm config/testMachine.dvm --force-load newTest.bin 0x00 + ./dvm config/testMachine.dvm --force-load activeTest.bin 0x00 cp dragon/disk1.dr ../extra/dragon/disk1.dr cp dragon/cmos.dr ../extra/dragon/cmos.dr fi diff --git a/extra/scripts/load_mbr b/extra/scripts/load_mbr index ff0b049..865c596 100644 --- a/extra/scripts/load_mbr +++ b/extra/scripts/load_mbr @@ -5,9 +5,9 @@ clear='\033[0m' printf "\n${green}Reloading MBR Block...\n${clear}" cd .. -cp ../extra/dss/mbr.dss ./dss/mbr.dss -./dasm dss/mbr.dss -o dragon/mbr.bin --save-disassembly disassembly/mbr.dds --verbose -./dtools load-binary dragon/disk1.dr dragon/mbr.bin 0x00000000 +cp ../extra/dss/drake.dss ./dss/drake.dss +./dasm dss/drake.dss -o dragon/drake.bin --save-disassembly disassembly/drake.dds --verbose +./dtools load-binary dragon/disk1.dr dragon/drake.bin 0x00000000 printf "\n" cp dragon/disk1.dr ../extra/dragon/disk1.dr -rm dragon/mbr.bin +rm dragon/drake.bin diff --git a/extra/scripts/run-test-1.bat b/extra/scripts/run-test-1.bat index 2b89fff..a1e9d8c 100644 --- a/extra/scripts/run-test-1.bat +++ b/extra/scripts/run-test-1.bat @@ -1,2 +1,2 @@ -dasm dss/test1.dss -o test1.bin --save-disassembly disassembly/test1.dds --verbose +dasm dss/tests/test1.dss -o test1.bin --save-disassembly disassembly/test1.dds --verbose ddb config/testMachine.dvm --force-load test1.bin 0x00 --verbose-load --hide-vdisplay \ No newline at end of file diff --git a/extra/scripts/run-test-2.bat b/extra/scripts/run-test-2.bat index 7080b39..918bb9a 100644 --- a/extra/scripts/run-test-2.bat +++ b/extra/scripts/run-test-2.bat @@ -1,2 +1,2 @@ -dasm dss/test2.dss -o test2.bin --save-disassembly disassembly/test2.dds --verbose +dasm dss/tests/test2.dss -o test2.bin --save-disassembly disassembly/test2.dds --verbose ddb config/testMachine.dvm --force-load test2.bin 0x00 --verbose-load --hide-vdisplay \ No newline at end of file diff --git a/src/hardware/VirtualDisplay.cpp b/src/hardware/VirtualDisplay.cpp index 5576b32..64d9ef9 100644 --- a/src/hardware/VirtualDisplay.cpp +++ b/src/hardware/VirtualDisplay.cpp @@ -54,6 +54,19 @@ namespace dragon char c = (char)mem.read8(vga_addr + tRegisters::TextSingleCharacter); single_text_add_char_to_line(c); } + else if (signal == tSignalValues::TextSingleColor_DirectPrintString) + { + uint16_t first_char_addr = mem.read16(vga_addr + tRegisters::TextSingleString); + char c = ' '; + int h = 0; + while (c != 0) + { + char c = (char)mem.read8(first_char_addr); + single_text_add_char_to_line(c); + first_char_addr++; + if (c == 0) break; + } + } else if (signal == tSignalValues::TextSingleColor_StoreChar) { char c = (char)mem.read8(vga_addr + tRegisters::TextSingleCharacter); diff --git a/src/hardware/VirtualDisplay.hpp b/src/hardware/VirtualDisplay.hpp index 093cc18..5834ef9 100644 --- a/src/hardware/VirtualDisplay.hpp +++ b/src/hardware/VirtualDisplay.hpp @@ -15,6 +15,7 @@ namespace dragon inline static constexpr uint8_t Signal = 0x03; inline static constexpr uint8_t TextSingleCharacter = 0x04; inline static constexpr uint8_t TextSingleInvertColors = 0x05; + inline static constexpr uint8_t TextSingleString = 0x06; }; public: struct tVideoModeValues { @@ -29,6 +30,7 @@ namespace dragon inline static constexpr uint8_t TextSingleColor_DirectPrintBuffAndFlush = 0x04; inline static constexpr uint8_t TextSingleColor_FlushBuffer = 0x05; inline static constexpr uint8_t TextSingleColor_DirectPrintBuffNoFlush = 0x06; + inline static constexpr uint8_t TextSingleColor_DirectPrintString = 0x07; inline static constexpr uint8_t RefreshScreen = 0xE0; inline static constexpr uint8_t ClearSCreen = 0xE1;