demos/bcdclk: Post-SVN tidy
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 24s
Build system / Build (pull_request) Successful in 4m35s

- Move source code from `trunk` into root directory.
- Update build files and ASM include paths.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
This commit is contained in:
2025-05-28 18:39:14 +01:00
parent 257514f3cb
commit 3900f7f29c
6 changed files with 156 additions and 153 deletions

View File

@@ -454,7 +454,7 @@ tup.append_table(img_files, {
{"3D/GEARS", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/gears"},
{"3D/RAY", VAR_PROGS .. "/demos/ray/ray"},
{"3D/VIEW3DS", VAR_PROGS .. "/demos/view3ds/view3ds"},
{"DEMOS/BCDCLK", VAR_PROGS .. "/demos/bcdclk/trunk/bcdclk"},
{"DEMOS/BCDCLK", VAR_PROGS .. "/demos/bcdclk/bcdclk"},
{"DEMOS/BUDHBROT", VAR_PROGS .. "/demos/buddhabrot/trunk/buddhabrot"},
{"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/trunk/eyes"},
{"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"},

View File

@@ -207,7 +207,7 @@ fasm demos\3dtcub10\3dtcub10.asm %BIN%\3d\3dtcub10
cd demos\aclock\trunk\
nasmw -t -f bin -o ..\..\..\%BIN%\demos\aclock aclock.asm
cd ..\..\..
fasm demos\bcdclk\trunk\bcdclk.asm %BIN%\demos\bcdclk
fasm demos\bcdclk\bcdclk.asm %BIN%\demos\bcdclk
fasm demos\bgitest\trunk\bgitest.asm %BIN%\fonts\bgitest
fasm demos\colorref\trunk\colorref.asm %BIN%\demos\colorref
fasm demos\crownscr\trunk\crownscr.asm %BIN%\3d\crownscr

View File

@@ -1,5 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())

View File

@@ -1,150 +1,153 @@
;
; BCD CLOCK
;
; Compile with FASM for Menuet
;
;
use32
org 0x0
db 'MENUET01'
dd 0x01
dd START
dd I_END
dd 0x1000
dd 0x1000
dd 0x0 , 0x0
include 'lang.inc'
include '../../../macros.inc'
START:
red:
call drawwindow
still:
mov eax,23 ; wait for timeout
mov ebx,50
mcall
cmp eax,1 ; redraw ?
je red
cmp eax, 2 ; key
je key
cmp eax,3 ; button in buffer ?
je button
call drawclock
jmp still
key:
mov eax, 2
int 0x40
jmp still
button:
mov al,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne noclose
or eax,-1 ; close this program
mcall
noclose:
jmp still
drawclock:
mov eax,3 ; get time
mcall
bswap eax
shr eax,8
mov edi,dg1
mov ecx,6
dgtomem:
push eax
and al,0x0f
mov [edi],al
inc edi
pop eax
shr eax,4
loop dgtomem
mov ebx,79*65536+11
mov edi,dg1
digitlp:
mov ecx,10*65536+11
xor esi,esi
plotlp:
xor edx,edx
test byte[edi],8
je nobit
mov edx,0x00ff0000
nobit:
mov eax,13 ; plot 8,4,2,1
mcall
add ecx,13*65536
shl byte[edi],1
inc esi
cmp esi,4
jne plotlp
shr byte[edi],4
mov edx,0x00880040
mov eax,13 ; draw digit box
mcall
pusha
mov edx,ebx
and edx,0xffff0000
shr ecx,16
or edx,ecx
add edx,3*65536+2
mov ebx,0x00010100
mov ecx,[edi]
mov esi,0x00ffffff
mov eax,47 ; display decimal
mcall
popa
sub ebx,13*65536
inc edi
cmp edi,dg1+6
jne digitlp
ret
drawwindow:
mov eax,12
mov ebx,1 ; start redraw
mcall
mov eax, 48
mov ebx, 4
mcall
mov ecx, eax
xor eax,eax ; window
mov ebx,100*65536+113
add ecx,100*65536+87
mov edx,0x34400088
mov edi,title
mcall
call drawclock
mov eax,12
mov ebx,2 ; end redraw
mcall
ret
title db 'BCD Clock',0
I_END:
dg1: db ?
; SPDX-License-Identifier: NOASSERTION
;
;
; BCD CLOCK
;
; Compile with FASM for Menuet
;
;
use32
org 0x0
db 'MENUET01'
dd 0x01
dd START
dd I_END
dd 0x1000
dd 0x1000
dd 0x0 , 0x0
include 'lang.inc'
include '../../macros.inc'
START:
red:
call drawwindow
still:
mov eax,23 ; wait for timeout
mov ebx,50
mcall
cmp eax,1 ; redraw ?
je red
cmp eax, 2 ; key
je key
cmp eax,3 ; button in buffer ?
je button
call drawclock
jmp still
key:
mov eax, 2
int 0x40
jmp still
button:
mov al,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne noclose
or eax,-1 ; close this program
mcall
noclose:
jmp still
drawclock:
mov eax,3 ; get time
mcall
bswap eax
shr eax,8
mov edi,dg1
mov ecx,6
dgtomem:
push eax
and al,0x0f
mov [edi],al
inc edi
pop eax
shr eax,4
loop dgtomem
mov ebx,79*65536+11
mov edi,dg1
digitlp:
mov ecx,10*65536+11
xor esi,esi
plotlp:
xor edx,edx
test byte[edi],8
je nobit
mov edx,0x00ff0000
nobit:
mov eax,13 ; plot 8,4,2,1
mcall
add ecx,13*65536
shl byte[edi],1
inc esi
cmp esi,4
jne plotlp
shr byte[edi],4
mov edx,0x00880040
mov eax,13 ; draw digit box
mcall
pusha
mov edx,ebx
and edx,0xffff0000
shr ecx,16
or edx,ecx
add edx,3*65536+2
mov ebx,0x00010100
mov ecx,[edi]
mov esi,0x00ffffff
mov eax,47 ; display decimal
mcall
popa
sub ebx,13*65536
inc edi
cmp edi,dg1+6
jne digitlp
ret
drawwindow:
mov eax,12
mov ebx,1 ; start redraw
mcall
mov eax, 48
mov ebx, 4
mcall
mov ecx, eax
xor eax,eax ; window
mov ebx,100*65536+113
add ecx,100*65536+87
mov edx,0x34400088
mov edi,title
mcall
call drawclock
mov eax,12
mov ebx,2 ; end redraw
mcall
ret
title db 'BCD Clock',0
I_END:
dg1: db ?