demos/bcdclk: Post-SVN tidy
- 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:
@@ -454,7 +454,7 @@ tup.append_table(img_files, {
|
|||||||
{"3D/GEARS", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/gears"},
|
{"3D/GEARS", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/gears"},
|
||||||
{"3D/RAY", VAR_PROGS .. "/demos/ray/ray"},
|
{"3D/RAY", VAR_PROGS .. "/demos/ray/ray"},
|
||||||
{"3D/VIEW3DS", VAR_PROGS .. "/demos/view3ds/view3ds"},
|
{"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/BUDHBROT", VAR_PROGS .. "/demos/buddhabrot/trunk/buddhabrot"},
|
||||||
{"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/trunk/eyes"},
|
{"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/trunk/eyes"},
|
||||||
{"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"},
|
{"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"},
|
||||||
|
@@ -207,7 +207,7 @@ fasm demos\3dtcub10\3dtcub10.asm %BIN%\3d\3dtcub10
|
|||||||
cd demos\aclock\trunk\
|
cd demos\aclock\trunk\
|
||||||
nasmw -t -f bin -o ..\..\..\%BIN%\demos\aclock aclock.asm
|
nasmw -t -f bin -o ..\..\..\%BIN%\demos\aclock aclock.asm
|
||||||
cd ..\..\..
|
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\bgitest\trunk\bgitest.asm %BIN%\fonts\bgitest
|
||||||
fasm demos\colorref\trunk\colorref.asm %BIN%\demos\colorref
|
fasm demos\colorref\trunk\colorref.asm %BIN%\demos\colorref
|
||||||
fasm demos\crownscr\trunk\crownscr.asm %BIN%\3d\crownscr
|
fasm demos\crownscr\trunk\crownscr.asm %BIN%\3d\crownscr
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
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")
|
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||||
add_include(tup.getvariantdir())
|
add_include(tup.getvariantdir())
|
||||||
|
|
@@ -1,150 +1,153 @@
|
|||||||
;
|
; SPDX-License-Identifier: NOASSERTION
|
||||||
; BCD CLOCK
|
;
|
||||||
;
|
|
||||||
; Compile with FASM for Menuet
|
;
|
||||||
;
|
; BCD CLOCK
|
||||||
;
|
;
|
||||||
|
; Compile with FASM for Menuet
|
||||||
use32
|
;
|
||||||
|
;
|
||||||
org 0x0
|
|
||||||
|
use32
|
||||||
db 'MENUET01'
|
|
||||||
dd 0x01
|
org 0x0
|
||||||
dd START
|
|
||||||
dd I_END
|
db 'MENUET01'
|
||||||
dd 0x1000
|
dd 0x01
|
||||||
dd 0x1000
|
dd START
|
||||||
dd 0x0 , 0x0
|
dd I_END
|
||||||
|
dd 0x1000
|
||||||
include 'lang.inc'
|
dd 0x1000
|
||||||
include '../../../macros.inc'
|
dd 0x0 , 0x0
|
||||||
|
|
||||||
|
include 'lang.inc'
|
||||||
START:
|
include '../../macros.inc'
|
||||||
red:
|
|
||||||
call drawwindow
|
|
||||||
|
START:
|
||||||
still:
|
red:
|
||||||
|
call drawwindow
|
||||||
|
|
||||||
mov eax,23 ; wait for timeout
|
still:
|
||||||
mov ebx,50
|
|
||||||
mcall
|
|
||||||
|
mov eax,23 ; wait for timeout
|
||||||
cmp eax,1 ; redraw ?
|
mov ebx,50
|
||||||
je red
|
mcall
|
||||||
|
|
||||||
cmp eax, 2 ; key
|
cmp eax,1 ; redraw ?
|
||||||
je key
|
je red
|
||||||
|
|
||||||
cmp eax,3 ; button in buffer ?
|
cmp eax, 2 ; key
|
||||||
je button
|
je key
|
||||||
|
|
||||||
call drawclock
|
cmp eax,3 ; button in buffer ?
|
||||||
|
je button
|
||||||
jmp still
|
|
||||||
|
call drawclock
|
||||||
key:
|
|
||||||
mov eax, 2
|
jmp still
|
||||||
int 0x40
|
|
||||||
jmp still
|
key:
|
||||||
|
mov eax, 2
|
||||||
button:
|
int 0x40
|
||||||
mov al,17 ; get id
|
jmp still
|
||||||
mcall
|
|
||||||
|
button:
|
||||||
cmp ah,1 ; button id=1 ?
|
mov al,17 ; get id
|
||||||
jne noclose
|
mcall
|
||||||
or eax,-1 ; close this program
|
|
||||||
mcall
|
cmp ah,1 ; button id=1 ?
|
||||||
noclose:
|
jne noclose
|
||||||
|
or eax,-1 ; close this program
|
||||||
jmp still
|
mcall
|
||||||
|
noclose:
|
||||||
drawclock:
|
|
||||||
|
jmp still
|
||||||
mov eax,3 ; get time
|
|
||||||
mcall
|
drawclock:
|
||||||
bswap eax
|
|
||||||
shr eax,8
|
mov eax,3 ; get time
|
||||||
mov edi,dg1
|
mcall
|
||||||
mov ecx,6
|
bswap eax
|
||||||
dgtomem:
|
shr eax,8
|
||||||
push eax
|
mov edi,dg1
|
||||||
and al,0x0f
|
mov ecx,6
|
||||||
mov [edi],al
|
dgtomem:
|
||||||
inc edi
|
push eax
|
||||||
pop eax
|
and al,0x0f
|
||||||
shr eax,4
|
mov [edi],al
|
||||||
loop dgtomem
|
inc edi
|
||||||
mov ebx,79*65536+11
|
pop eax
|
||||||
mov edi,dg1
|
shr eax,4
|
||||||
digitlp:
|
loop dgtomem
|
||||||
mov ecx,10*65536+11
|
mov ebx,79*65536+11
|
||||||
xor esi,esi
|
mov edi,dg1
|
||||||
plotlp:
|
digitlp:
|
||||||
xor edx,edx
|
mov ecx,10*65536+11
|
||||||
test byte[edi],8
|
xor esi,esi
|
||||||
je nobit
|
plotlp:
|
||||||
mov edx,0x00ff0000
|
xor edx,edx
|
||||||
nobit:
|
test byte[edi],8
|
||||||
mov eax,13 ; plot 8,4,2,1
|
je nobit
|
||||||
mcall
|
mov edx,0x00ff0000
|
||||||
add ecx,13*65536
|
nobit:
|
||||||
shl byte[edi],1
|
mov eax,13 ; plot 8,4,2,1
|
||||||
inc esi
|
mcall
|
||||||
cmp esi,4
|
add ecx,13*65536
|
||||||
jne plotlp
|
shl byte[edi],1
|
||||||
shr byte[edi],4
|
inc esi
|
||||||
mov edx,0x00880040
|
cmp esi,4
|
||||||
mov eax,13 ; draw digit box
|
jne plotlp
|
||||||
mcall
|
shr byte[edi],4
|
||||||
pusha
|
mov edx,0x00880040
|
||||||
mov edx,ebx
|
mov eax,13 ; draw digit box
|
||||||
and edx,0xffff0000
|
mcall
|
||||||
shr ecx,16
|
pusha
|
||||||
or edx,ecx
|
mov edx,ebx
|
||||||
add edx,3*65536+2
|
and edx,0xffff0000
|
||||||
mov ebx,0x00010100
|
shr ecx,16
|
||||||
mov ecx,[edi]
|
or edx,ecx
|
||||||
mov esi,0x00ffffff
|
add edx,3*65536+2
|
||||||
mov eax,47 ; display decimal
|
mov ebx,0x00010100
|
||||||
mcall
|
mov ecx,[edi]
|
||||||
popa
|
mov esi,0x00ffffff
|
||||||
sub ebx,13*65536
|
mov eax,47 ; display decimal
|
||||||
inc edi
|
mcall
|
||||||
cmp edi,dg1+6
|
popa
|
||||||
jne digitlp
|
sub ebx,13*65536
|
||||||
ret
|
inc edi
|
||||||
|
cmp edi,dg1+6
|
||||||
|
jne digitlp
|
||||||
drawwindow:
|
ret
|
||||||
|
|
||||||
|
|
||||||
mov eax,12
|
drawwindow:
|
||||||
mov ebx,1 ; start redraw
|
|
||||||
mcall
|
|
||||||
|
mov eax,12
|
||||||
mov eax, 48
|
mov ebx,1 ; start redraw
|
||||||
mov ebx, 4
|
mcall
|
||||||
mcall
|
|
||||||
mov ecx, eax
|
mov eax, 48
|
||||||
xor eax,eax ; window
|
mov ebx, 4
|
||||||
mov ebx,100*65536+113
|
mcall
|
||||||
add ecx,100*65536+87
|
mov ecx, eax
|
||||||
mov edx,0x34400088
|
xor eax,eax ; window
|
||||||
mov edi,title
|
mov ebx,100*65536+113
|
||||||
mcall
|
add ecx,100*65536+87
|
||||||
|
mov edx,0x34400088
|
||||||
call drawclock
|
mov edi,title
|
||||||
|
mcall
|
||||||
mov eax,12
|
|
||||||
mov ebx,2 ; end redraw
|
call drawclock
|
||||||
mcall
|
|
||||||
|
mov eax,12
|
||||||
ret
|
mov ebx,2 ; end redraw
|
||||||
|
mcall
|
||||||
title db 'BCD Clock',0
|
|
||||||
I_END:
|
ret
|
||||||
dg1: db ?
|
|
||||||
|
title db 'BCD Clock',0
|
||||||
|
I_END:
|
||||||
|
dg1: db ?
|
Reference in New Issue
Block a user