First step of implementing Scroll in Text16Color mode
This commit is contained in:
parent
e3cb57e454
commit
dcbf3cce66
18 changed files with 233 additions and 4 deletions
2
build.nr
2
build.nr
|
|
@ -1 +1 @@
|
|||
1620
|
||||
1621
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
132
extra/dss/DragonOS/ascii.dss
Normal file
132
extra/dss/DragonOS/ascii.dss
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
@guard _ASCII_DSS_
|
||||
|
||||
@group ASCII
|
||||
NULL 0x00
|
||||
SOH 0x01
|
||||
STX 0x02
|
||||
ETX 0x03
|
||||
EOT 0x04
|
||||
ENQ 0x05
|
||||
ACK 0x06
|
||||
BEL 0x07
|
||||
BS 0x08
|
||||
HT 0x09
|
||||
LF 0x0A
|
||||
VT 0x0B
|
||||
FF 0x0C
|
||||
CR 0x0D
|
||||
SO 0x0E
|
||||
SI 0x0F
|
||||
DLE 0x10
|
||||
DC1 0x11
|
||||
DC2 0x12
|
||||
DC3 0x13
|
||||
DC4 0x14
|
||||
NAK 0x15
|
||||
SYN 0x16
|
||||
ETB 0x17
|
||||
CAN 0x18
|
||||
EM 0x19
|
||||
SUB 0x1A
|
||||
ESC 0x1B
|
||||
FS 0x1C
|
||||
GS 0x1D
|
||||
RS 0x1E
|
||||
US 0x1F
|
||||
SPACE 0x20
|
||||
EXCLAMATION_MARK 0x21
|
||||
DOUBLE_QUOTE 0x22
|
||||
HASH 0x23
|
||||
DOLLAR_SIGN 0x24
|
||||
PERCENT_SIGN 0x25
|
||||
AMPERSAND 0x26
|
||||
SINGLE_QUOTE 0x27
|
||||
OPEN_PARENTHESIS 0x28
|
||||
CLOSE_PARENTHESIS 0x29
|
||||
ASTERISK 0x2A
|
||||
PLUS_SIGN 0x2B
|
||||
COMMA 0x2C
|
||||
HYPHEN 0x2D
|
||||
PERIOD 0x2E
|
||||
FORWARD_SLASH 0x2F
|
||||
DIGIT_0 0x30
|
||||
DIGIT_1 0x31
|
||||
DIGIT_2 0x32
|
||||
DIGIT_3 0x33
|
||||
DIGIT_4 0x34
|
||||
DIGIT_5 0x35
|
||||
DIGIT_6 0x36
|
||||
DIGIT_7 0x37
|
||||
DIGIT_8 0x38
|
||||
DIGIT_9 0x39
|
||||
COLON 0x3A
|
||||
SEMICOLON 0x3B
|
||||
LESS_THAN_SIGN 0x3C
|
||||
EQUALS_SIGN 0x3D
|
||||
GREATER_THAN_SIGN 0x3E
|
||||
QUESTION_MARK 0x3F
|
||||
AT_SIGN 0x40
|
||||
UPPERCASE_A 0x41
|
||||
UPPERCASE_B 0x42
|
||||
UPPERCASE_C 0x43
|
||||
UPPERCASE_D 0x44
|
||||
UPPERCASE_E 0x45
|
||||
UPPERCASE_F 0x46
|
||||
UPPERCASE_G 0x47
|
||||
UPPERCASE_H 0x48
|
||||
UPPERCASE_I 0x49
|
||||
UPPERCASE_J 0x4A
|
||||
UPPERCASE_K 0x4B
|
||||
UPPERCASE_L 0x4C
|
||||
UPPERCASE_M 0x4D
|
||||
UPPERCASE_N 0x4E
|
||||
UPPERCASE_O 0x4F
|
||||
UPPERCASE_P 0x50
|
||||
UPPERCASE_Q 0x51
|
||||
UPPERCASE_R 0x52
|
||||
UPPERCASE_S 0x53
|
||||
UPPERCASE_T 0x54
|
||||
UPPERCASE_U 0x55
|
||||
UPPERCASE_V 0x56
|
||||
UPPERCASE_W 0x57
|
||||
UPPERCASE_X 0x58
|
||||
UPPERCASE_Y 0x59
|
||||
UPPERCASE_Z 0x5A
|
||||
OPEN_SQUARE_BRACKET 0x5B
|
||||
BACKSLASH 0x5C
|
||||
CLOSE_SQUARE_BRACKET 0x5D
|
||||
CARET 0x5E
|
||||
UNDERSCORE 0x5F
|
||||
GRAVE_ACCENT 0x60
|
||||
LOWERCASE_A 0x61
|
||||
LOWERCASE_B 0x62
|
||||
LOWERCASE_C 0x63
|
||||
LOWERCASE_D 0x64
|
||||
LOWERCASE_E 0x65
|
||||
LOWERCASE_F 0x66
|
||||
LOWERCASE_G 0x67
|
||||
LOWERCASE_H 0x68
|
||||
LOWERCASE_I 0x69
|
||||
LOWERCASE_J 0x6A
|
||||
LOWERCASE_K 0x6B
|
||||
LOWERCASE_L 0x6C
|
||||
LOWERCASE_M 0x6D
|
||||
LOWERCASE_N 0x6E
|
||||
LOWERCASE_O 0x6F
|
||||
LOWERCASE_P 0x70
|
||||
LOWERCASE_Q 0x71
|
||||
LOWERCASE_R 0x72
|
||||
LOWERCASE_S 0x73
|
||||
LOWERCASE_T 0x74
|
||||
LOWERCASE_U 0x75
|
||||
LOWERCASE_V 0x76
|
||||
LOWERCASE_W 0x77
|
||||
LOWERCASE_X 0x78
|
||||
LOWERCASE_Y 0x79
|
||||
LOWERCASE_Z 0x7A
|
||||
OPEN_CURLY_BRACE 0x7B
|
||||
VERTICAL_BAR 0x7C
|
||||
CLOSE_CURLY_BRACE 0x7D
|
||||
TILDE 0x7E
|
||||
DELETE 0x7F
|
||||
@end
|
||||
|
|
@ -24,7 +24,6 @@ _kernel0_main:
|
|||
push DefaultPalette.Black
|
||||
push 1
|
||||
call $_clear_screen
|
||||
debug_break
|
||||
push $test_str
|
||||
push 1
|
||||
call $_print_string
|
||||
|
|
@ -34,12 +33,38 @@ _kernel0_main:
|
|||
push 1
|
||||
call $_init_keyboard
|
||||
|
||||
_infinite_loop:
|
||||
jmp $_infinite_loop
|
||||
|
||||
hlt
|
||||
## =========================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
## =========================================================================================================================
|
||||
_key_pressed:
|
||||
## debug_break
|
||||
mov R1, [Keyboard_Registers.KEYCODE]
|
||||
|
||||
mov ACC, ASCII.LOWERCASE_A
|
||||
jls $_key_pressed_end, R1
|
||||
mov ACC, ASCII.LOWERCASE_Z
|
||||
jgr $_key_pressed_end, R1
|
||||
push R1
|
||||
push 10
|
||||
push 10
|
||||
push DefaultPalette.Red
|
||||
push 4
|
||||
call $_print_char
|
||||
|
||||
_key_pressed_end:
|
||||
ret
|
||||
## =========================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
## =========================================================================================================================
|
||||
_print_string: ## _print_string(string* str)
|
||||
arg R1 ## @Param: str
|
||||
|
|
@ -54,6 +79,26 @@ _print_string: ## _print_string(string* str)
|
|||
ret
|
||||
## =========================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
## =========================================================================================================================
|
||||
_print_char: ## _print_char(int16 char, int16 x, int16 y, int16 color)
|
||||
arg R1 ## @Param: char
|
||||
arg R2 ## @Param: x
|
||||
arg R3 ## @Param: y
|
||||
arg R4 ## @Param: color
|
||||
movb [$textCell.CoordX], R2
|
||||
movb [$textCell.CoordY], R3
|
||||
movb [$textCell.Foreground], R4
|
||||
movb [$textCell.Background], DefaultPalette.Black
|
||||
movb [$textCell.Character], R1
|
||||
mov R10, 0x21
|
||||
mov R9, $textCell
|
||||
int 0x30
|
||||
ret
|
||||
## =========================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
@guard _KEYBOARD_DRIVER_DSS_
|
||||
|
||||
@include <ascii.dss>
|
||||
|
||||
.code
|
||||
|
||||
_init_keyboard: ## _init_keyboard(func_ptr* key_pressed_handler)
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@
|
|||
|
||||
SWAP_BUFFERS 0x10
|
||||
WRITE_VRAM 0x11
|
||||
SCROLL 0x12
|
||||
|
||||
FORCE_REFRESH_SCREEN 0xE0
|
||||
FORCE_CLEAR_SCREEN 0xE1
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ _int_30_handler:
|
|||
jeq $_int_30_print_string_text16, 0x0022
|
||||
jeq $_int_30_print_integer_text16, 0x0023
|
||||
jeq $_int_30_clear_screen_text16, 0x0024
|
||||
jeq $_int_30_scroll_text16, 0x0025
|
||||
|
||||
jeq $_int_30_clear_screen, 0x00E0
|
||||
jeq $_int_30_refresh_screen, 0x00E1
|
||||
|
|
@ -166,6 +167,9 @@ _int_30_clear_screen_text16:
|
|||
movb [VGA_Registers.MEMORY_CONTROLLER_BG_COL], *R9
|
||||
movb [VGA_Registers.SIGNAL], Sig_VGA_Text_16_Color.FORCE_CLEAR_SCREEN
|
||||
jmp $_int_30_end
|
||||
_int_30_scroll_text16:
|
||||
movb [VGA_Registers.SIGNAL], Sig_VGA_Text_16_Color.SCROLL
|
||||
jmp $_int_30_end
|
||||
|
||||
_int_30_clear_screen:
|
||||
movb [VGA_Registers.SIGNAL], Sig_VGA_Text_Single_Color.CLEAR_SCREEN
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@
|
|||
CONTINUE 0x00
|
||||
SWAP_BUFFERS 0x10
|
||||
WRITE_VRAM 0x11
|
||||
SCROLL 0x12
|
||||
FORCE_REFRESH_SCREEN 0xE0
|
||||
FORCE_CLEAR_SCREEN 0xE1
|
||||
FORCE_REDRAW_SCREEN 0xE2
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ _endless_loop:
|
|||
mov R10, 0x12 ## int 0x20 parameter for load_from_ddd_blocking
|
||||
int 0x20 ## Bios interrupt
|
||||
|
||||
debug_break
|
||||
jmp OS_LOAD_ADDR
|
||||
jmp $_main_end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
Runtime:
|
||||
Add option to disable screenRedrawRate in debugger top-level prompt
|
||||
|
||||
Assembler:
|
||||
Add subroutine address export functionality
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ namespace dragon
|
|||
m_lines = IncludePreprocessor::loadEntryFile(fileName);
|
||||
if (m_lines.size() == 0)
|
||||
return { }; //TODO: Error
|
||||
// for (auto& line : m_lines)
|
||||
// std::cout << line << "\n";
|
||||
removeComments();
|
||||
parseExportSpecifications();
|
||||
createExports();
|
||||
|
|
|
|||
|
|
@ -179,6 +179,11 @@ namespace dragon
|
|||
DragonRuntime::vGraphicsInterface.swapBuffers_16Colors();
|
||||
__redraw_screen();
|
||||
}
|
||||
else if (signal == tSignalValues::Text16Color_Scroll)
|
||||
{
|
||||
DragonRuntime::vGraphicsInterface.scroll_16Colors();
|
||||
__redraw_screen();
|
||||
}
|
||||
}
|
||||
else return;
|
||||
mem.write8(vga_addr + tRegisters::Signal, tSignalValues::Continue);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ namespace dragon
|
|||
|
||||
inline static constexpr uint8_t Text16Color_SwapBuffers = 0x10;
|
||||
inline static constexpr uint8_t Text16Color_WriteMemory = 0x11;
|
||||
inline static constexpr uint8_t Text16Color_Scroll = 0x12;
|
||||
|
||||
inline static constexpr uint8_t RefreshScreen = 0xE0;
|
||||
inline static constexpr uint8_t ClearSCreen = 0xE1;
|
||||
|
|
|
|||
|
|
@ -799,6 +799,28 @@ namespace dragon
|
|||
m_16Color_secondFrameAddr = tmp;
|
||||
}
|
||||
|
||||
void Graphics::scroll_16Colors(void)
|
||||
{
|
||||
int32_t line_len = (RawTextRenderer::CONSOLE_CHARS_H * 4);
|
||||
for (int32_t i = m_16Color_currentFrameAddr + line_len; i < m_16Color_currentFrameAddr + m_16Color_frameSize; i += 4)
|
||||
{
|
||||
int32_t k = i;
|
||||
int8_t outByte = 0;
|
||||
m_videoMemory.r_Byte(k, outByte);
|
||||
m_videoMemory.w_Byte(k - line_len, outByte);
|
||||
k++;
|
||||
m_videoMemory.r_Byte(k, outByte);
|
||||
m_videoMemory.w_Byte(k - line_len, outByte);
|
||||
k++;
|
||||
m_videoMemory.r_Byte(k, outByte);
|
||||
m_videoMemory.w_Byte(k - line_len, outByte);
|
||||
}
|
||||
for (int32_t i = m_16Color_currentFrameAddr + m_16Color_frameSize - line_len; i < m_16Color_currentFrameAddr + m_16Color_frameSize; i += 4)
|
||||
{
|
||||
m_videoMemory.w_Byte(i, 0x20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@ namespace dragon
|
|||
bool writeVRAM_16Colors(uint8_t x, uint8_t y, uint8_t character = 0, uint8_t background = 0xFF, uint8_t foreground = 0xFF);
|
||||
bool clearVRAM_16Colors(uint8_t character = 0, uint8_t background = 0x00, uint8_t foreground = 0xFF);
|
||||
void swapBuffers_16Colors(void);
|
||||
void scroll_16Colors(void);
|
||||
|
||||
private:
|
||||
ostd::serial::SerialIO m_videoMemory;
|
||||
|
|
|
|||
|
|
@ -403,8 +403,19 @@ namespace dragon
|
|||
__get_machine_footprint(&s_machineInfo, trackedAddresses, true);
|
||||
__track_call_stack(&s_machineInfo);
|
||||
bool running = cpu.execute() && vDisplay.isRunning();
|
||||
uint8_t screenRedrawRate = vCMOS.read8(data::CMOSRegisters::ScreenRedrawRate);
|
||||
vDisplay.update();
|
||||
vDisplay.redrawScreen(); // This is slow...maybe it should be on a 100ms rate, like in normal runtime mode
|
||||
if (s_enableScreenRedrawDelay && s_stepAcc2 == (1000 / screenRedrawRate))
|
||||
{
|
||||
vDisplay.redrawScreen();
|
||||
s_stepAcc2 = 0;
|
||||
}
|
||||
else if (!s_enableScreenRedrawDelay)
|
||||
{
|
||||
vDisplay.redrawScreen();
|
||||
}
|
||||
s_stepAcc2++;
|
||||
// vDisplay.redrawScreen(); // This is slow...maybe it should be on a 100ms rate, like in normal runtime mode
|
||||
vDiskInterface.cycleStep();
|
||||
__get_machine_footprint(&s_machineInfo, trackedAddresses, false);
|
||||
return running || vDiskInterface.isBusy();
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ namespace dragon
|
|||
inline static tMachineConfig machine_config;
|
||||
|
||||
inline static uint64_t s_avgInstTime { 0 };
|
||||
inline static double s_stepAcc2 { 0 };
|
||||
inline static bool s_enableScreenRedrawDelay { true };
|
||||
|
||||
private:
|
||||
inline static tMachineDebugInfo s_machineInfo;
|
||||
|
|
|
|||
Loading…
Reference in a new issue