Skip to content

Commit

Permalink
Update README, improve code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
littleli committed May 11, 2020
1 parent 9a1f7b9 commit c6d8a97
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [DOSBox](#dosbox)
- [QEMU](#qemu)
- [VirtualBox](#virtualbox)
- [Interaction](#interaction)

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)

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

- Use `Other/DOS` as system setup
- No need to setup hardrive space, boot `b2plasma.img` from a floppy drive. This makes the whole image only ~3KB in size

## Interaction

After the boot, press `ESC` key to rotate color palette among:
- red + green
- green + blue
- blue + red
29 changes: 14 additions & 15 deletions b2plasma.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ entrypoint:

; palette computation
mov ax, 0x3F00
mov di, pal
mov di, pal1
mov cx, 768 * 3
rep stosb ; in DI rests offset of waves
pal_loop:
mov [bx + pal + RED + 0 * 3], al ; red ascending
mov [bx + pal + RED + 64 * 3], ah ; red descending
mov [bx + pal + GREEN + 128 * 3], al ; green ascending
mov [bx + pal + GREEN + 192 * 3], ah ; green descending
mov [bx + pal + RED + 256 * 3], al ; red ascending
mov [bx + pal + RED + 320 * 3], ah ; red descending
mov [bx + pal + BLUE + 384 * 3], al ; blue ascending
mov [bx + pal + BLUE + 448 * 3], ah ; blue descending
mov [bx + pal + GREEN + 512 * 3], al ; green ascending
mov [bx + pal + GREEN + 576 * 3], ah ; green descending
mov [bx + pal + BLUE + 640 * 3], al ; blue ascending
mov [bx + pal + BLUE + 704 * 3], ah ; blue descending
mov [bx + pal1 + RED + 0 * 3], al
mov [bx + pal1 + RED + 64 * 3], ah
mov [bx + pal1 + GREEN + 128 * 3], al
mov [bx + pal1 + GREEN + 192 * 3], ah
mov [bx + pal2 + GREEN + 0 * 3], al
mov [bx + pal2 + GREEN + 64 * 3], ah
mov [bx + pal2 + BLUE + 128 * 3], al
mov [bx + pal2 + BLUE + 192 * 3], ah
mov [bx + pal3 + BLUE + 0 * 3], al
mov [bx + pal3 + BLUE + 64 * 3], ah
mov [bx + pal3 + RED + 128 * 3], al
mov [bx + pal3 + RED + 192 * 3], ah
dec ah
inc al
add bx, 3
Expand Down Expand Up @@ -93,7 +93,7 @@ wave_loop:
sti

mov cx, 0x100
mov dx, pal
mov dx, pal1
call set_palette
push word 0xA000
Expand Down Expand Up @@ -197,7 +197,6 @@ tpos2: rb 1
tpos3: rb 1
tpos4: rb 1

pal:
pal1: rb 768
pal2: rb 768
pal3: rb 768
Expand Down

0 comments on commit c6d8a97

Please sign in to comment.