Skip to content

Commit c6d8a97

Browse files
committed
Update README, improve code a bit
1 parent 9a1f7b9 commit c6d8a97

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [DOSBox](#dosbox)
66
- [QEMU](#qemu)
77
- [VirtualBox](#virtualbox)
8+
- [Interaction](#interaction)
89

910
Boot to plasma is an assembler-only port of EXAMPLE1.C from PMODE/W examples. This port is using [fasmg](https://flatassembler.net/download.php), the next generation assembler authored by [@tgrysztar](https://github.com/tgrysztar)
1011

@@ -45,3 +46,10 @@ I keep installation procedure of virtual box upon a user, just with few notes he
4546

4647
- Use `Other/DOS` as system setup
4748
- No need to setup hardrive space, boot `b2plasma.img` from a floppy drive. This makes the whole image only ~3KB in size
49+
50+
## Interaction
51+
52+
After the boot, press `ESC` key to rotate color palette among:
53+
- red + green
54+
- green + blue
55+
- blue + red

b2plasma.asm

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ entrypoint:
2727

2828
; palette computation
2929
mov ax, 0x3F00
30-
mov di, pal
30+
mov di, pal1
3131
mov cx, 768 * 3
3232
rep stosb ; in DI rests offset of waves
3333
pal_loop:
34-
mov [bx + pal + RED + 0 * 3], al ; red ascending
35-
mov [bx + pal + RED + 64 * 3], ah ; red descending
36-
mov [bx + pal + GREEN + 128 * 3], al ; green ascending
37-
mov [bx + pal + GREEN + 192 * 3], ah ; green descending
38-
mov [bx + pal + RED + 256 * 3], al ; red ascending
39-
mov [bx + pal + RED + 320 * 3], ah ; red descending
40-
mov [bx + pal + BLUE + 384 * 3], al ; blue ascending
41-
mov [bx + pal + BLUE + 448 * 3], ah ; blue descending
42-
mov [bx + pal + GREEN + 512 * 3], al ; green ascending
43-
mov [bx + pal + GREEN + 576 * 3], ah ; green descending
44-
mov [bx + pal + BLUE + 640 * 3], al ; blue ascending
45-
mov [bx + pal + BLUE + 704 * 3], ah ; blue descending
34+
mov [bx + pal1 + RED + 0 * 3], al
35+
mov [bx + pal1 + RED + 64 * 3], ah
36+
mov [bx + pal1 + GREEN + 128 * 3], al
37+
mov [bx + pal1 + GREEN + 192 * 3], ah
38+
mov [bx + pal2 + GREEN + 0 * 3], al
39+
mov [bx + pal2 + GREEN + 64 * 3], ah
40+
mov [bx + pal2 + BLUE + 128 * 3], al
41+
mov [bx + pal2 + BLUE + 192 * 3], ah
42+
mov [bx + pal3 + BLUE + 0 * 3], al
43+
mov [bx + pal3 + BLUE + 64 * 3], ah
44+
mov [bx + pal3 + RED + 128 * 3], al
45+
mov [bx + pal3 + RED + 192 * 3], ah
4646
dec ah
4747
inc al
4848
add bx, 3
@@ -93,7 +93,7 @@ wave_loop:
9393
sti
9494

9595
mov cx, 0x100
96-
mov dx, pal
96+
mov dx, pal1
9797
call set_palette
9898
9999
push word 0xA000
@@ -197,7 +197,6 @@ tpos2: rb 1
197197
tpos3: rb 1
198198
tpos4: rb 1
199199

200-
pal:
201200
pal1: rb 768
202201
pal2: rb 768
203202
pal3: rb 768

0 commit comments

Comments
 (0)