Skip to content

Commit

Permalink
Lovebyte 2022 release
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-lisowski committed Feb 5, 2022
1 parent 14901a7 commit 5f9ce51
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 166 deletions.
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

41 changes: 41 additions & 0 deletions FILE_ID.DIZ
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

xx xxx
xxx xxxx
xx xx xx
xx xxxxx x xxxxxx xxxxxxx
xxx xx x xxxxxx x xx xx
xx x x xx xx xx xxxxxx x
x xxxx x xxxxx xx xx x
x x x xx x xxxxxxx
x xx x xxxx x x
x xxx xx x xxxx xxx xx x
xxxxxx xxx xxxx xxxxxx x
xx xx
x xx xx xx
xxxxx xxxx
xxxx xxx

1935711 Presents
KMRIV

Type ... : .... 512B Bootsector Demo
Date ... : .............. 2022-02-12
Party .. : ........... Lovebyte 2022
Platform : .............. x86 >=8086

Various twisted mutations of physarum p-
olycephalum packaged in one tiny demo ;>

First ever demoparty entry so hope it's
enjoyable at the very least. Special th-
anks to family and friends who gave fee-
dback and supported this prod.

<3
LFT
kb
psenough
Jin X
unlord
Dresdenboy
baze
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

44 changes: 0 additions & 44 deletions README.md

This file was deleted.

1 change: 0 additions & 1 deletion lib/make-pal
Submodule make-pal deleted from 9e65ef
40 changes: 40 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include pal.mak
DIR_BUILD:=build
MAIN_NAME:=kmriv
MAIN_EXT:=bin
MAIN_SRC:= kmriv.asm
MAIN_ASM_FLAGS:=
QEMU_ARG:=-drive file=$(DIR_BUILD)/$(MAIN_NAME).$(MAIN_EXT),index=0,media=disk,format=raw
BOCHS_ARG:=-n -q 'boot:a' 'floppya: 1_44=$(DIR_BUILD)/$(MAIN_NAME).$(MAIN_EXT), status=inserted'
ifeq ($(OS),Windows_NT)
QEMU_ARG+=-display gtk,gl=off
else
QEMU_ARG+=-display x
endif

.PHONY: all main clean qemu-run qemu-dbg bochs-run bochs-dbg

all: main

main: $(DIR_BUILD) $(DIR_BUILD)/$(MAIN_NAME).$(MAIN_EXT)
$(DIR_BUILD)/$(MAIN_NAME).$(MAIN_EXT): $(MAIN_SRC)
fasm $(MAIN_SRC) $(@) -s $(DIR_BUILD)/$(MAIN_NAME).fas $(MAIN_ASM_FLAGS)
-listing $(DIR_BUILD)/$(MAIN_NAME).fas $(DIR_BUILD)/$(MAIN_NAME).lst
-symbols $(DIR_BUILD)/$(MAIN_NAME).fas $(DIR_BUILD)/$(MAIN_NAME).sym

$(DIR_BUILD):
$(call pal_mkdir,$(@))
clean:
$(call pal_rmdir,$(DIR_BUILD))
qemu-run: main
@qemu-system-x86_64 $(QEMU_ARG)
qemu-dbg: main
@qemu-system-x86_64 -S -s $(QEMU_ARG)
bochs-run: main
@bochs $(BOCHS_ARG)
bochs-dbg: main
ifeq ($(OS),Windows_NT)
@bochs $(BOCHS_ARG) 'display_library:win32, options="gui_debug"'
else
@bochs $(BOCHS_ARG) 'display_library:x, options="gui_debug"'
endif
30 changes: 0 additions & 30 deletions src/dbg.asm

This file was deleted.

65 changes: 32 additions & 33 deletions src/kmriv.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ format binary
org 0x7C00
use16

macro vid_mode_g
{
; @brief Set video mode to graphical (13h)
; @note Mode 13h is graphical 256-color 320x200 (video memory at 0xA000:0000)
xor ah, ah
mov al, 0x13
int 0x10
}

start:
vid_mode_g
jmp main ; Jump over data

; @note For keeping track/controlling the demo effects
frame dw 0x0000 ; How many frames have been simulated
effect db 0x00 ; To indicate what effects are active now
effect_drunk = 0x01
effect_rose = 0x02 ; Requires "drunk" effect
effect_galaxy = 0x04

; @note The seed will hold the latest generated random number
seed dw 0xAB1C ; Seed which determines the initial condition of all agents
; 0x1935
; 0xABC1
; 0x5711
; 0x1ABC

; @note No need for a large stack hence the small region
stack_mem = 0x0050 ; Size: 30KB (conventional memory)

Expand All @@ -50,6 +46,27 @@ moore_nbhd dw -1, -1, -1, 0, 1, 1, 1, 0, -1, -1
moore_nbhd_x = moore_nbhd + (2 * 2) ; Each element is a WORD so to skip 2 elements, skip 4 bytes
moore_nbhd_y = moore_nbhd

; @note For keeping track/controlling the demo effects
frame dw 0x0000 ; How many frames have been simulated
effect db 0x00 ; To indicate what effects are active now
effect_drunk = 0x01
effect_rose = 0x02 ; Requires "drunk" effect
effect_galaxy = 0x04

; @xxx The BIOS sets 0x1C-0x1F to 0x00, this makes sure nothing important is in that range
; (together with the 0 initialized variables above).
times 1 db 0

; @note The seed will hold the latest generated random number
seed dw 0xAB1C ; Seed which determines the initial condition of all agents
; 0x1935
; 0xABC1
; 0x5711
; 0x1ABC

; @xxx The BIOS sets 0x24 to 0x00, this makes sure nothing important is in that byte.
times 4 db 0

macro agent_init
{
; @brief Initialize all the agents
Expand Down Expand Up @@ -315,15 +332,6 @@ macro rot_to_idx
and bl, 0x0F ; BX = Byte offset in neighborhood list (mod 16)
}

macro vid_mode_g
{
; @brief Set video mode to graphical (13h)
; @note Mode 13h is graphical 256-color 320x200 (video memory at 0xA000:0000)
xor ah, ah
mov al, 0x13
int 0x10
}

macro vid_mode_g_palette
{
; @brief Setup the VGA color palette
Expand Down Expand Up @@ -353,12 +361,6 @@ macro vid_mode_g_palette
loop .palette_next
}

macro shutdown
{
; @brief TV shutdown animation

}

xy_to_idx:
; @brief Convert 2D coords X and Y to a 1D index in a linear array
; @param AX X position
Expand Down Expand Up @@ -388,7 +390,6 @@ rand:
ret

main:
vid_mode_g
vid_mode_g_palette

; The only location where segment regs are modified
Expand All @@ -414,7 +415,7 @@ main:
memcpy_vid1to0

mov bx, WORD [frame]
cmp bh, 0x0C ; Checks BX == 0x0FFF
cmp bh, 0x0C ; Checks BX == 0x0CFF
je .main_end
cmp bh, 0x01 ; Checks BX == 0x01FF
jne .effect_drunk_enable_skip
Expand All @@ -441,7 +442,5 @@ main:
.main_end:
hlt

db 0x00
aut dd 0x01935711
times 510-($-$$) db 0 ; Add 0s for padding until last 2 bytes
magic_number dw 0xAA55
15 changes: 15 additions & 0 deletions src/pal.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ifeq ($(OS),Windows_NT)
define pal_mkdir
if not exist "$(subst /,\,$(1))" mkdir "$(subst /,\,$(1))"
endef
define pal_rmdir
if exist "$(subst /,\,$(1))" rmdir /Q /S "$(subst /,\,$(1))"
endef
else
define pal_mkdir
mkdir -p $(1)
endef
define pal_rmdir
rm -rf $(1)
endef
endif

0 comments on commit 5f9ce51

Please sign in to comment.