Compare commits

..

4 Commits

Author SHA1 Message Date
a259518124 requested changes (all) 2026-03-08 18:15:42 +02:00
0b422c07ac use SSF_START_APP instead of hardcoded subfunction number 7 2026-03-07 14:20:29 +02:00
2c20243949 requested changes 2026-03-07 14:15:06 +02:00
d8d4759097 added quotkinizer binary 2026-03-03 20:17:25 +02:00
4 changed files with 82 additions and 2 deletions

View File

@@ -190,8 +190,8 @@ gbc=/kolibrios/emul/gameboy
min=/kolibrios/emul/pokemini
nc=/kolibrios/utils/cnc_editor/cnc_editor
ch8=/kolibrios/emul/chip8/chip8
md=/kolibrios/emul/dgen/dgen
gen=/kolibrios/emul/dgen/dgen
md=/kolibrios/emul/dgen/dgen_open
gen=/kolibrios/emul/dgen/dgen_open
rom=/kolibrios/emul/uxn
zip=$Unz

View File

@@ -65,3 +65,6 @@ tup.append_table(OBJS,
)
link_gcc("dgen")
tup.include(HELPERDIR .. "/use_fasm.lua")
tup.rule({"dgen_open.asm", extra_inputs = {"../../quotkinizer.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "dgen_open")

View File

@@ -0,0 +1,8 @@
; Wrapper for DGEN
; Wraps command line arguments in quotes and launches dgen.
format binary as ""
WRAPPER_SUFFIX equ '_open'
include '../../quotkinizer.inc'

69
programs/quotkinizer.inc Normal file
View File

@@ -0,0 +1,69 @@
; wraps command line arguments in quotes and launches a target.
; WRAPPER_SUFFIX equ '_wrapper_name' must be defined before including this file.
include 'KOSfuncs.inc'
virtual
db WRAPPER_SUFFIX
SUFFIX_SIZE = $ - $$
end virtual
org 0x0
use32
db 'MENUET01'
dd 1
dd start
dd i_end
dd m_end
dd m_end
dd path
dd target_path
start:
mov edi, target_path
or ecx, -1
xor al, al
repne scasb
sub edi, SUFFIX_SIZE + 1
mov byte [edi], 0
cmp byte [path], 0
je .launch
mov byte [q_path], '"'
mov edi, path
or ecx, -1
xor al, al
repne scasb
mov word [edi-1], '"'
mov dword [fi + 8], q_path
.launch:
mov eax, SF_FILE
mov ebx, fi
int 0x40
mov eax, SF_TERMINATE_PROCESS
int 0x40
fi:
dd SSF_START_APP, 0, 0, 0, 0
db 0
dd target_path
i_end:
params rb 256
virtual at params
q_path rb 1
path rb 255
end virtual
target_path rb 1024
m_end: