Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Mode enhancement #1052

Merged
merged 8 commits into from
Jun 24, 2024
Merged

Text Mode enhancement #1052

merged 8 commits into from
Jun 24, 2024

Conversation

vip-delete
Copy link
Contributor

@vip-delete vip-delete commented May 26, 2024

  1. Add BLINK flag support (3rd bit in VGA Attribute Mode Control Register).

When this bit is set to 0, the most significant bit of the attribute selects the background intensity (allows 16 colors for background). When set to 1, this bit enables blinking.

blink

A test program which writes a blinking text to the text buffer

org 100h

mov ax, 0xB800 ; text buffer address
mov es, ax     ; segment register points to the text buffer
xor di, di     ; text buffer offset

mov ah, 0x92   ; XRGBIRGB, X-blink, RGB-bg, I-intensity, RGB-fg
xor bx, bx     ; text buffer index
mov cx, len    ; message length
mov bp, msg    ; message address

print:
mov al, [bp]            ; put next char from msg to al
mov word [es:di+bx], ax ; direct write to the text buffer
add bx, 2               ; video memory cell is 2-bytes long
inc bp                  ; move to the next char from msg
loop print

mov ah, 94h             ; red on blue (blink)
mov al, 3               ; heart char
mov word [es:di+bx], ax ; direct write to the text buffer

xor ah, ah     ; press any key to continue
int 16h

mov ah, 4Ch    ; exit
int 21h

msg db 'Hello + World = '
len equ $ - msg

A test program to clear/set BLINK flag

org 100h

mov dx, 3DAh
in al, dx

mov dx, 3C0h
mov al, 30h
out dx, al

inc dx
in al, dx
and al, 11110111b ; clear BLINK flag
;or al, 00001000b ; set BLINK flag
dec dx
out dx, al

mov ah, 4Ch    ; exit
int 21h

SuperCalc 4 clears BLINK on start to use high intensity yellow for background:

sc

on exit, it sets the flag back.

  1. fill the cursor with the foreground color of the character at the cursor's current location:
    cursor1
    cursor2
    cursor3

Copy link
Owner

@copy copy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've left a few comments.

Just like for the other PR, could you send me a disk image with the programs to reproduce the issues? (ideally uploaded in github)

src/browser/dummy_screen.js Outdated Show resolved Hide resolved
v86.css Outdated Show resolved Hide resolved
@vip-delete
Copy link
Contributor Author

(ideally uploaded in github)

uploaded #1055 (comment)

@vip-delete
Copy link
Contributor Author

is there any action required from my side to mark the PR somehow that all is done?

@copy
Copy link
Owner

copy commented Jun 20, 2024

is there any action required from my side to mark the PR somehow that all is done?

I'm a bit busy right now and haven't gotten around to testing this yet. I'll try to get it done some time next week.

@copy
Copy link
Owner

copy commented Jun 24, 2024

Cheers!

@copy copy merged commit 21f5b05 into copy:master Jun 24, 2024
2 checks passed
@vip-delete vip-delete deleted the blink_support branch July 2, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants