1 Commits

Author SHA1 Message Date
d8d4759097 added quotkinizer binary
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 56s
Build system / Build (pull_request) Successful in 16m53s
2026-03-03 20:17:25 +02:00
5 changed files with 73 additions and 33 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 ""
TARGET equ '/kolibrios/emul/dgen/dgen'
include '../../quotkinizer.inc'

View File

@@ -31,10 +31,6 @@
#include <OS.h>
#endif
#ifndef MAX_PATH
#define MAX_PATH 1024
#endif
#ifdef __MINGW32__
static long dgen_mingw_detach = 1;
#endif
@@ -431,34 +427,8 @@ int main(int argc, char *argv[])
samples = (dgen_soundsegs * (rate / dgen_hz));
pd_sound_init(rate, samples);
}
char path_buf[MAX_PATH];
char *p = path_buf;
int r;
path_buf[0] = '\0';
for (r = optind; r < argc; ++r) {
if (r > optind) { // Append a space in later iterations
if (p - path_buf < sizeof(path_buf) - 2) *p++ = ' ';
}
char *src = argv[r];
while (*src && (p - path_buf < sizeof(path_buf) - 1)) {
*p++ = *src++;
}
*p = '\0';
if (access(path_buf, F_OK) == 0) {
rom = path_buf; // Point rom to the static buffer
optind = r; // Update optind
break;
}
}
if (!rom && optind < argc) {
rom = argv[optind];
}
rom = argv[optind];
// Create the megadrive object.
megad = new md(dgen_pal, dgen_region);
if ((megad == NULL) || (!megad->okay())) {

59
programs/quotkinizer.inc Normal file
View File

@@ -0,0 +1,59 @@
; wraps command line arguments in quotes and launches a target.
; TARGET equ 'target_name' must be defined before including this file.
org 0x0
use32
db 'MENUET01'
dd 1
dd start
dd i_end
dd m_end
dd m_end
dd params
dd 0
start:
cmp byte [params], 0
je .launch
mov esi, params
mov edi, new_params
mov byte [edi], '"'
inc edi
.copy:
lodsb
test al, al
jz .done
stosb
jmp .copy
.done:
mov byte [edi], '"'
inc edi
mov byte [edi], 0
mov dword [fi + 8], new_params
.launch:
mov eax, 70
mov ebx, fi
int 0x40
mov eax, -1
int 0x40
fi:
dd 7, 0, 0, 0, 0
db 0
dd target_path
target_path db TARGET, 0
i_end:
params rb 1024
new_params rb 1024
m_end: