Compare commits

..

2 Commits

Author SHA1 Message Date
b96437334b Krn: The IDE controller initialization code has been rewritten.
This commit is not compiled!!!
2025-07-15 23:39:16 +05:00
bff8f4e5a5 Krn: The fdd driver code has been cleared and unused files have been deleted 2025-07-15 23:39:15 +05:00
45 changed files with 2154 additions and 2788 deletions

View File

@@ -5,7 +5,7 @@ diamond'ом. Она используется в проектах xonix и fara
Kolibri-программу. Утилита всего лишь изменяет формат exe-шника, так что,
чтобы действительно получилась работающая программа, нужно выполнение
определённых условий. Понятно, что требуется, чтобы программа общалась
с внешним миром средствами КолибриОС (т.е. int 0x40) и не использовала
с внешним миром средствами Колибри (т.е. int 0x40) и не использовала
никаких Windows-библиотек. Помимо этого, требуется также, чтобы программа
размещалась по нулевому адресу (ключ линкера "/base:0"). Как писать такие
программы - смотрите в уже упомянутых проектах xonix и fara.

View File

@@ -205,7 +205,6 @@ extra_files = {
{"kolibrios/emul/chip8/roms/", SRC_PROGS .. "/emulator/chip8/roms/*"},
{"kolibrios/emul/kwine/kwine", SRC_PROGS .. "/emulator/kwine/bin/kwine"},
{"kolibrios/emul/kwine/lib/", SRC_PROGS .. "/emulator/kwine/bin/lib/*"},
{"kolibrios/emul/uxn", SRC_PROGS .. "/emulator/uxn/uxn"},
{"kolibrios/emul/uarm/", "common/emul/uarm/*"},
{"kolibrios/emul/zsnes/", "common/emul/zsnes/*"},
{"kolibrios/games/BabyPainter", "common/games/BabyPainter"},
@@ -533,7 +532,6 @@ tup.append_table(img_files, {
{"MEDIA/MP3INFO", VAR_PROGS .. "/media/mp3info/mp3info"},
{"MEDIA/PALITRA", VAR_PROGS .. "/media/palitra/trunk/palitra"},
{"MEDIA/PIANO", VAR_PROGS .. "/media/piano/piano"},
{"MEDIA/PIANO.MAP", VAR_PROGS .. "/media/piano/piano.map"},
{"MEDIA/STARTMUS", VAR_PROGS .. "/media/startmus/trunk/STARTMUS"},
{"NETWORK/PING", VAR_PROGS .. "/network/ping/ping"},
{"NETWORK/NETCFG", VAR_PROGS .. "/network/netcfg/netcfg"},

View File

@@ -162,7 +162,6 @@ min=23
nes=23
sna=23
snes=23
rom=23
bat=24
sh=24
sys=25

View File

@@ -68,7 +68,6 @@ sna=/kolibrios/emul/e80/e80
gb=/kolibrios/emul/gameboy
gbc=/kolibrios/emul/gameboy
min=/kolibrios/emul/pokemini
rom=/kolibrios/emul/uxn
nc=/kolibrios/utils/cnc_editor/cnc_editor
kf=/sys/KF_VIEW
csv=/sys/table

View File

@@ -22,5 +22,3 @@ ToggleBar=Tab
path=/usbhd0/1/kolibri.img
autoclose=0
[WebView]
proxy=http://proxy.kolibrios.org:82/?site=

View File

@@ -192,7 +192,6 @@ nc=/kolibrios/utils/cnc_editor/cnc_editor
ch8=/kolibrios/emul/chip8/chip8
md=/kolibrios/emul/dgen/dgen
gen=/kolibrios/emul/dgen/dgen
rom=/kolibrios/emul/uxn
zip=$Unz
7z=$Unz

View File

@@ -9,15 +9,15 @@
pre {white-space: pre-wrap;}
h2 {margin-bottom:0;}
blockquote {
margin-bottom:0;
border-left: 5px solid #EFE8D5;
margin-bottom:0;
border-left: 5px solid #EFE8D5;
padding-left: 10px;}
</style>
</head>
<body bgcolor="#FDF6E3" link="#5551FF"><pre><h1>Решение проблем и часто задаваемые вопросы</h1>
<a href="guide.htm" param="d">&lt; Назад</a>
<b>Какие есть варианты загрузки КолибриОС?</b>
<b>Какие есть варианты загрузки Колибри?</b>
С флешки, жесткого диска, CD, дискеты. Смотрите папку /HD_Load в скачанном дистрибутиве.
При загрузке с флешки иногда может требоваться использование setmbr.exe, иногда нет. Вначале попробуйте загрузится без него, если не получится, то с ним.
@@ -27,7 +27,7 @@
2. Поменять настройки в BIOS: зайти в раздел с жесткими дисками и выставить режим совместимости с IDE или что-то похожее. (После всех эксперименов не забудьте поменять все обратно!)
3. Воспользоваться драйвером ACHI. Для этого зайдите в SYSPANEL &gt; <a href="/kolibrios/drivers/DRVINST.KEX">DriverInstall</a>.
<b>Как установить КолибриОС как основную ОС, скажем, на старенький ноутбук?</b>
<b>Как установить Колибри как основную ОС, скажем, на старенький ноутбук?</b>
Есть масса вариантов. Вот один из них.
Если на ноутбуке нет ОС, то ставим на него Windows 98. Если на нем уже стоит Windows 95/98/2k/XP, то они тоже подойдут.
Заходим в папку /HD_Load поставляемую в дистрибутиве. Там с помощью утилит устанавливаем Kolibri в дуалбут с Windows.
@@ -49,7 +49,7 @@
MTRRs (Memory type range registers — Диапазонные регистры типа памяти) — используются для назначения типа (политики кеширования) участкам памяти. Регистры MTRR предоставляют механизм, связывающий типы памяти с физическими адресными диапазонами системной памяти. Они позволяют процессору оптимизировать операции для разных типов памяти, таких как ПЗУ, ОЗУ, кадровый буфер и отображаемые в памяти устройства ввода-вывода. Они также упрощают разработку системного оборудования, уменьшая количество контактов управляющих памятью, которые использовались для этой цели в ранних процессорах и внешних логических устройствах.
<b>На каких ещё языках программирования, кроме ассемблера, можно разрабатывать приложения для КолибриОС?</b>
<b>На каких ещё языках программирования, кроме ассемблера, можно разрабатывать приложения для Колибри?</b>
Портированы:
&bull; Компилятор Oberon-07
@@ -68,7 +68,7 @@ MTRRs (Memory type range registers — Диапазонные регистры
Подробная статья по поддерживаемым компиляторам и их настройке <a href="http://kolibri-n.org/inf/hll/hll">здесь</a>.
<b>Wi-Fi работает?</b>
Нет ни драйверов ни подсистемы.
Нет ни драйверов ни подсистемы.
Если вы хотите разработать подсистему и драйвер(а) WiFi - напишите нам на форум или в группу ВК, есть возможность оплатить разработку. Для этого нужно весьма неплохо знать ассемблер.
<b>Не работает мышь, флешка, клавиатура</b>
@@ -79,28 +79,28 @@ MTRRs (Memory type range registers — Диапазонные регистры
&bull; Использовать PS/2 мышь...
&bull; Купить PCI карту на несколько USB 2.0 портов, благо стоит она копейки, часто продается на барахолках
<b>Можно ли в КолибриОС запускать EXE (приложения Windows)?</b>
<b>Можно ли в Колибри запускать EXE (приложения Windows)?</b>
Нет, это невозможно.
Есть эмулятор DOS и <a href="http://board.kolibrios.org/viewtopic.php?f=9&t=2318&p=48991">PELoad</a> эмулятор некоторых функций WIN32 (в зачаточном состоянии).
<b>Когда будет нормальный браузер?</b>
Браузер штука очень сложная, как в написании, так и в портировании. Есть наработки по портированию Netsurf, но пока все заглохло.
Что и когда будет не известно.
Что и когда будет не известно.
<b>У меня есть идея, давайте я вам ее напишу, а вы реализуете!</b>
Чаще всего эти идеи мало полезны. Дело в том, что у каждого человека уже вовлеченного в проект, тоже есть множество нереализованных идей, подчас более ценных, чем у новичков, за счет того, что участники лучше разбираются в системе, ее возможностях и ограничениях. Проблема, как всегда, или в мотивации, или в отсутствии времени. Пожалуйста, учитывайте это приходя в проект и не требуйте ничего от незнакомых вам людей. Участвуйте, как наблюдатель и комментатор; и со временем вы сможете генерировать хорошие идеи предметно.
К сожалению даже клевая идея не гарантирует ее скорейшей реализации, потому самый надежный шанс воплотить идею в жизнь - реализовать самому.
Чаще всего эти идеи мало полезны. Дело в том, что у каждого человека уже вовлеченного в проект, тоже есть множество нереализованных идей, подчас более ценных, чем у новичков, за счет того, что участники лучше разбираются в системе, ее возможностях и ограничениях. Проблема, как всегда, или в мотивации, или в отсутствии времени. Пожалуйста, учитывайте это приходя в проект и не требуйте ничего от незнакомых вам людей. Участвуйте, как наблюдатель и комментатор; и со временем вы сможете генерировать хорошие идеи предметно.
К сожалению даже клевая идея не гарантирует ее скорейшей реализации, потому самый надежный шанс воплотить идею в жизнь - реализовать самому.
<b>Почему в КолибриОС все еще нет ХХХ? Это же так важно!</b>
Потому что это ХХХ еще никто не сделал.
<b>Почему в Колибри все еще нет ХХХ? Это же так важно!</b>
Потому что это ХХХ еще никто не сделал.
См. предыдущий ответ.
<b>Какие у вас дальнейшие планы развития?</b>
Большинство путей развития упирается не в планы, а в свободные руки. Особенно в квалифицированные рабочие руки.
<b>Как насчет версии для ARM вместо Android?</b>
Нативно это невозможно. Абсолютно и полностью.
Дело в том, что КолибриОС написана на ассемблере x86, тем самым овермаксимально оптимизирована под процессоры x86. На мобильных девайсах используется другой тип процессора и другая архитектура - arm, что делает портирование невозможным.
Нативно это невозможно. Абсолютно и полностью.
Дело в том, что Колибри ОС написана на ассемблере x86, тем самым овермаксимально оптимизирована под процессоры x86. На мобильных девайсах используется другой тип процессора и другая архитектура - arm, что делает портирование невозможным.
Колибри - десктопная ОС для Пека, любите ее такой, какая она есть.
</body>
</html>

View File

@@ -5,7 +5,7 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Загрузочный сектор для КолибриОС (FAT12, дискета)
Загрузочный сектор для ОС Колибри (FAT12, дискета)
- Описание
Позволяет загружать KERNEL.MNT с дискет/образов

View File

@@ -5,7 +5,7 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Загрузочный сектор для КолибриОС (FAT12, дискета)
Загрузочный сектор для ОС Колибри (FAT12, дискета)
- Описание
Позволяет загружать KERNEL.MNT с дискет/образов

View File

@@ -5,7 +5,7 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Загрузочный сектор для КолибриОС (FAT12, дискета)
Загрузочный сектор для ОС Колибри (FAT12, дискета)
- Описание
Позволяет загружать KERNEL.MNT с дискет/образов

View File

@@ -12,13 +12,6 @@
; Source code author - Kulakov Vladimir Gennadievich.
; Adaptation and improvement - Mario79.
give_back_application_data_1:
mov esi, FDD_BUFF;FDD_DataBuffer ;0x40000
mov ecx, 128
cld
rep movsd
ret
take_data_from_application_1:
mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000
mov ecx, 128
@@ -717,18 +710,38 @@ endg
; This function is called in boot process.
; It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives.
proc floppy_init
; search for FDDs and add them to the list of disks
; author - Mario79
mov al, 0x10
out 0x70, al
mov cx, 0xff
.wait_cmos:
dec cx
test cx, cx
jnz .wait_cmos
in al, 0x71
test al, al
jz .no_fdd
push eax ; b[esp]=al [esp+1..3]- ??
stdcall attach_int_handler, 6, FDCInterrupt, 0
DEBUGF 1, "K : Set Floppy IRQ6 return code %x\n", eax
mov ecx, floppy_mutex
call mutex_init
; First floppy is present if [DRIVE_DATA] and 0xF0 is nonzero.
test byte [DRIVE_DATA], 0xF0
; First floppy is present if [esp] and 0xF0 is nonzero.
test byte [esp], 0xF0
jz .no1
stdcall disk_add, floppy_functions, floppy1_name, 1, DISK_NO_INSERT_NOTIFICATION
.no1:
; Second floppy is present if [DRIVE_DATA] and 0x0F is nonzero.
test byte [DRIVE_DATA], 0x0F
; Second floppy is present if [esp] and 0x0F is nonzero.
test byte [esp], 0x0F
jz .no2
stdcall disk_add, floppy_functions, floppy2_name, 2, DISK_NO_INSERT_NOTIFICATION
.no2:
add esp, 4
.no_fdd:
ret
endp

View File

@@ -5,7 +5,7 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Загрузочный сектор для КолибриОС (FAT12, дискета)
Загрузочный сектор для ОС Колибри (FAT12, дискета)
- Описание
Позволяет загружать KERNEL.MNT с дискет/образов

View File

@@ -878,37 +878,6 @@ struct PCIDEV
owner dd ? ; pointer to SRV or 0
ends
struct IDE_DATA
ProgrammingInterface dd ?
Interrupt dw ?
RegsBaseAddres dw ?
BAR0_val dw ?
BAR1_val dw ?
BAR2_val dw ?
BAR3_val dw ?
dma_hdd_channel_1 db ?
dma_hdd_channel_2 db ?
pcidev dd ? ; pointer to corresponding PCIDEV structure
ends
struct IDE_CACHE
pointer dd ?
size dd ? ; not use
data_pointer dd ?
system_data_size dd ? ; not use
appl_data_size dd ? ; not use
system_data dd ?
appl_data dd ?
system_sad_size dd ?
appl_sad_size dd ?
search_start dd ?
appl_search_start dd ?
ends
struct IDE_DEVICE
UDMA_possible_modes db ?
UDMA_set_mode db ?
ends
; The following macro assume that we are on uniprocessor machine.
; Serious work is needed for multiprocessor machines.

View File

@@ -1,36 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;***************************************************
; clear the DRIVE_DATA table,
; search for FDDs and add them into the table
; author - Mario79
;***************************************************
xor eax, eax
mov edi, DRIVE_DATA
mov ecx, DRIVE_DATA_SIZE/4
cld
rep stosd
mov al, 0x10
out 0x70, al
mov cx, 0xff
wait_cmos:
dec cx
test cx, cx
jnz wait_cmos
in al, 0x71
mov [DRIVE_DATA], al
test al, al
jz @f
stdcall attach_int_handler, 6, FDCInterrupt, 0
DEBUGF 1, "K : Set IDE IRQ6 return code %x\n", eax
call floppy_init
@@:

View File

@@ -1,13 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include 'dev_fd.inc'
include 'dev_hdcd.inc'
include 'getcache.inc'
include 'sear_par.inc'

File diff suppressed because it is too large Load Diff

View File

@@ -754,7 +754,7 @@ end if
;-----------------------------------------------------------------------------
mov esi, boot_detectfloppy
call boot_log
include 'detect/dev_fd.inc'
call floppy_init
;-----------------------------------------------------------------------------
; create pci-devices list
;-----------------------------------------------------------------------------

View File

@@ -1,9 +1,10 @@
//Copyright 2007-2025 by Veliant & Leency
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr, Burer...
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
//BUGS
//if maximize a window on image load => crash
//issues with a long line
//add proxy settings
//===================================================//
// //
@@ -12,7 +13,6 @@
//===================================================//
#define MEMSIZE 1024 * 160
#include "..\lib\gui.h"
#include "..\lib\draw_buf.h"
#include "..\lib\list_box.h"
@@ -21,7 +21,6 @@
#include "..\lib\random.h"
#include "..\lib\clipboard.h"
#include "..\lib\obj\libini.h"
#include "..\lib\obj\box_lib.h"
#include "..\lib\obj\libimg.h"
#include "..\lib\obj\http.h"
@@ -68,10 +67,6 @@ _http http = 0;
progress_bar prbar;
proc_info Form;
char settings_file[256];
char proxy_address[768];
#include "settings.h"
#include "tabs.h"
dword cur_img_url;
@@ -95,7 +90,6 @@ edit_box omnibox_edit = {250, 0, 0, 0xffffff,
void LoadLibraries()
{
load_dll(libini, #lib_init,1);
load_dll(boxlib, #box_lib_init,0);
load_dll(libimg, #libimg_init,1);
load_dll(libHTTP, #http_lib_init,1);
@@ -136,7 +130,6 @@ void main()
TOOLBAR_H = PADDING+TSZE+PADDING+2;
LoadLibraries();
LoadIniConfig();
HandleParam();
omnibox_edit.left = PADDING+TSZE*2+PADDING+6;
@@ -524,17 +517,14 @@ bool GetLocalFileData(dword _path)
bool GetUrl(dword _http_url)
{
char new_url_full[URL_SIZE+1];
if (!strncmp(_http_url,"http://",7)) {
if (!strncmp(_http_url,"http:",5)) {
http.get(_http_url);
return true;
} else if (!strncmp(_http_url,"https://",8)) {
if (#proxy_address) {
strcpy(#new_url_full, #proxy_address);
strncat(#new_url_full, _http_url, URL_SIZE);
http.get(#new_url_full);
return true;
}
return false;
strcpy(#new_url_full, "http://gate.aspero.pro/?site=");
strncat(#new_url_full, _http_url, URL_SIZE);
http.get(#new_url_full);
return true;
}
return false;
}

View File

@@ -70,7 +70,7 @@ Copy link
Download link contents";
char loading_text[] = "Loading...";
char update_param[] = "-e http://builds.kolibrios.org/en_US/data/programs/cmm/browser/WebView.com";
char update_download_error[] = "'WebView\nError receiving update information!' -tE";
char update_download_error[] = "'WebView\nError receiving an up to date information!' -tE";
char update_ok[] = "'WebView\nThe browser has been updated!' -tO";
char update_is_current[] = "'WebView\nThe browser is up to date.' -tI";
char update_can_not_copy[] = "'WebView\nError copying a new version from Downloads folder!\nProbably too litle space on Ramdisk.' -tE";
@@ -112,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
char version[]="WebView 3.92";
char version[]="WebView 3.91";

View File

@@ -14,7 +14,7 @@
| || | | |
\_____||__|________|__|<font color=#DDD>lc</font>
<font bg=#F8F15B> web <font bg=#FF5A7E color=#fff> 1.0 <font bg=#47D018> compatible
<font bg=#F8F15B> web <font bg=#FF5A7E color=#fff> 1.0 <font bg=#47D018> compatable
<font bg=#3CE7FF> </font></font></font></font>
<td>
@@ -26,9 +26,9 @@
By the way,
<font color="#555555">&bull; You can check for browser updates from the main menu.
&bull; To run a web search, type text in the address box and press Ctrl+Enter.
&bull; Pressing F6 moves the text cursor to the omnibox.
&bull; You can manually change the encoding of a page by clicking on the label in the bottom right corner.
&bull; To run a web search, type a text in the adress box and press Ctrl+Enter.
&bull; Pressing F6 moves a text cursor to the omnibox.
&bull; You can manually change the encoding of a page by clicking on a label in the bottom right corner.

View File

@@ -4,11 +4,11 @@
<h1>&nbsp;Webpage Not Available</h1>
<h2>&nbsp;What could be done:</h2>
<ul>
<li>Make sure that you have a working Internet connection.<br>
<li>Make sure that evetything fine with Internet connection.<br>
Open <a href="/sys/network/netcfg">Netcfg</a> network diagnostic tool.<br>
<li>Check the page address for any typos.<br>
<li>Check page address, there may have been made a typo.<br>
<li>Server is temporarily unavailable.<br>
Refresh the page.<br>
<li>Browser didn't properly handle the server's response.<br>
<li>Browser doesn't handled properly server's response.<br>
Please, report an error.<br>
</ul>

View File

@@ -1,9 +0,0 @@
_ini ini;
void LoadIniConfig()
{
ini.path = GetIni(#settings_file, "app.ini");
ini.section = "WebView";
ini.GetString("proxy", #proxy_address, sizeof(proxy_address), NULL);
}

View File

@@ -1,12 +1,7 @@
//Copyright 2020 - 2025 by Leency
//Burer...
#define MEMSIZE 1024 * 40
//Copyright 2020 - 2021 by Leency
#include "../lib/gui.h"
#include "../lib/random.h"
#include "../lib/obj/libini.h"
#include "../lib/obj/box_lib.h"
#include "../lib/obj/http.h"
@@ -26,11 +21,6 @@ char uEdit[URL_SIZE];
char filepath[4096];
char save_dir[4096];
char settings_file[256];
char proxy_address[768];
#include "settings.h"
char* active_status;
edit_box ed = {WIN_W-GAPX-GAPX,GAPX,20,0xffffff,0x94AECE,0xffffff,0xffffff,
@@ -42,13 +32,9 @@ progress_bar pb = {0, GAPX, 52, WIN_W - GAPX - GAPX, 17, 0, NULL, NULL,
void main()
{
dword shared_url;
load_dll(libini, #lib_init,1);
load_dll(boxlib, #box_lib_init,0);
load_dll(libHTTP, #http_lib_init,1);
LoadIniConfig();
strcpy(#save_dir, DEFAULT_SAVE_DIR);
if (!dir_exists(#save_dir)) CreateDir(#save_dir);
SetCurDir(#save_dir);
@@ -181,8 +167,10 @@ void StartDownloading()
if (http.transfer > 0) return;
ResetDownloadSpeed();
pb.back_color = 0xFFFfff;
if (!strncmp(#uEdit,"https://",8)) {
miniprintf(#get_url, "%s%s", #proxy_address, #uEdit);
if (!strncmp(#uEdit,"https:",6)) {
//miniprintf(#get_url, "http://gate.aspero.pro/?site=%s", #uEdit);
notify("'HTTPS for download temporary is not supported,\ntrying to download the file via HTTP' -W");
miniprintf(#uEdit, "http://%s", #uEdit+8);
}
strcpy(#get_url, #uEdit);

View File

@@ -1,9 +0,0 @@
_ini ini;
void LoadIniConfig()
{
ini.path = GetIni(#settings_file, "app.ini");
ini.section = "WebView";
ini.GetString("proxy", #proxy_address, sizeof(proxy_address), NULL);
}

View File

@@ -112,6 +112,7 @@ struct _http
dword _http::get(dword _url)
{
cur_url = _url;
if (streqrp(cur_url, "http://gate.aspero.pro/?site=")) cur_url += 29;
http_get stdcall (_url, 0, 0, #accept_language);
transfer = EAX;
return EAX;
@@ -137,7 +138,7 @@ bool _http::stop()
transfer=0;
*/
hfree();
return true;
return true;
}
return false;
}

View File

@@ -100,10 +100,6 @@ lib_init: ;//////////////////////////////////////////////////////////////////;;
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
cmp [dll.load], edx
je .ok
mov [dll.load], edx
invoke dll.load, @IMPORT
@@ -119,7 +115,6 @@ lib_init: ;//////////////////////////////////////////////////////////////////;;
invoke ini.get_str, inifile, sec_proxy, key_password, proxyPassword, 256, proxyPassword
popa
.ok:
DEBUGF 1, "HTTP library: init OK\n"
xor eax, eax
ret

View File

@@ -78,10 +78,6 @@ proc lib_init ;///////////////////////////////////////////////////////////////;;
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
cmp [dll.load], edx
je .ok
mov [dll.load], edx
or edx, edx

View File

@@ -34,25 +34,21 @@ proc libini._.init ;////////////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< eax = 1 (fail) / 0 (ok) (library initialization result) ;;
;;================================================================================================;;
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
mov [dll.load], edx
cmp [dll.load], edx
je .ok
invoke dll.load, @IMPORT
or eax, eax
jz .ok
mov [dll.load], edx
xor eax, eax
inc eax
ret
invoke dll.load, @IMPORT
or eax, eax
jz .ok
xor eax, eax
inc eax
ret
.ok: xor eax,eax
ret
.ok: xor eax,eax
ret
endp
;;================================================================================================;;
@@ -64,16 +60,16 @@ proc libini._.unget_char _f ;///////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push eax ecx
mov ecx, [_f]
inc [ecx + IniFile.cnt]
dec esi
mov eax, [ecx + IniFile.bsize]
cmp [ecx + IniFile.cnt], eax
jle @f
stdcall libini._.unload_block, [_f]
@@: pop ecx eax
ret
push eax ecx
mov ecx, [_f]
inc [ecx + IniFile.cnt]
dec esi
mov eax, [ecx + IniFile.bsize]
cmp [ecx + IniFile.cnt], eax
jle @f
stdcall libini._.unload_block, [_f]
@@: pop ecx eax
ret
endp
;;================================================================================================;;
@@ -85,13 +81,13 @@ proc libini._.get_char _f ;/////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
mov ecx, [_f]
dec [ecx + IniFile.cnt]
jns @f
stdcall libini._.preload_block, [_f]
dec [ecx + IniFile.cnt]
mov ecx, [_f]
dec [ecx + IniFile.cnt]
jns @f
stdcall libini._.preload_block, [_f]
dec [ecx + IniFile.cnt]
@@: lodsb
ret
ret
endp
;;================================================================================================;;
@@ -103,22 +99,22 @@ proc libini._.skip_nonblanks _f ;///////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
mov ecx, [_f]
mov ecx, [_f]
@@: stdcall libini._.get_char, [_f]
cmp al, 32
je @b
cmp al, 13
je @b
cmp al, 10
je @b
cmp al, 9
je @b
cmp al, ini.COMMENT_CHAR
jne @f
stdcall libini._.skip_line, [_f]
jmp @b
cmp al, 32
je @b
cmp al, 13
je @b
cmp al, 10
je @b
cmp al, 9
je @b
cmp al, ini.COMMENT_CHAR
jne @f
stdcall libini._.skip_line, [_f]
jmp @b
@@: stdcall libini._.unget_char, [_f]
ret
ret
endp
;;================================================================================================;;
@@ -130,14 +126,14 @@ proc libini._.skip_spaces _f ;//////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
mov ecx, [_f]
mov ecx, [_f]
@@: stdcall libini._.get_char, [_f]
cmp al, 32
je @b
cmp al, 9
je @b
cmp al, 32
je @b
cmp al, 9
je @b
@@: stdcall libini._.unget_char, [_f]
ret
ret
endp
;;================================================================================================;;
@@ -149,16 +145,16 @@ proc libini._.skip_line _f ;////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
mov ecx, [_f]
mov ecx, [_f]
@@: stdcall libini._.get_char, [_f]
or al, al
jz @f
cmp al, 13
je @f
cmp al, 10
jne @b
or al, al
jz @f
cmp al, 13
je @f
cmp al, 10
jne @b
@@: stdcall libini._.unget_char, [_f]
ret
ret
endp
;;================================================================================================;;
@@ -170,16 +166,16 @@ proc libini._.unload_block _f ;/////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push eax ebx ecx
mov ebx, [_f]
mov eax, [ebx + IniFile.pos]
add eax, -ini.BLOCK_SIZE
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
stdcall libini._.preload_block, ebx
add esi, eax
mov [ebx + IniFile.cnt], 0
pop ecx ebx eax
ret
push eax ebx ecx
mov ebx, [_f]
mov eax, [ebx + IniFile.pos]
add eax, -ini.BLOCK_SIZE
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
stdcall libini._.preload_block, ebx
add esi, eax
mov [ebx + IniFile.cnt], 0
pop ecx ebx eax
ret
endp
;;================================================================================================;;
@@ -191,25 +187,25 @@ proc libini._.preload_block _f ;////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push eax ebx ecx
mov ebx, [_f]
@@: mov esi, [ebx + IniFile.buf]
push edi
mov edi, esi
mov ecx, ini.BLOCK_SIZE / 4
xor eax, eax
rep stosd
pop edi
invoke file.tell, [ebx + IniFile.fh]
mov [ebx + IniFile.pos], eax
invoke file.read, [ebx + IniFile.fh], esi, ini.BLOCK_SIZE
mov esi,[ebx + IniFile.buf]
cmp eax,ini.BLOCK_SIZE
jl @f
@@: mov [ebx + IniFile.cnt], eax
mov [ebx + IniFile.bsize], eax
pop ecx ebx eax
ret
push eax ebx ecx
mov ebx, [_f]
@@: mov esi, [ebx + IniFile.buf]
push edi
mov edi, esi
mov ecx, ini.BLOCK_SIZE / 4
xor eax, eax
rep stosd
pop edi
invoke file.tell, [ebx + IniFile.fh]
mov [ebx + IniFile.pos], eax
invoke file.read, [ebx + IniFile.fh], esi, ini.BLOCK_SIZE
mov esi,[ebx + IniFile.buf]
cmp eax,ini.BLOCK_SIZE
jl @f
@@: mov [ebx + IniFile.cnt], eax
mov [ebx + IniFile.bsize], eax
pop ecx ebx eax
ret
endp
;;================================================================================================;;
@@ -221,18 +217,18 @@ proc libini._.reload_block _f ;/////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push eax ebx ecx
mov ebx, [_f]
push [ebx + IniFile.bsize]
push esi [ebx + IniFile.cnt]
invoke file.seek, [ebx + IniFile.fh], [ebx + IniFile.pos], SEEK_SET
stdcall libini._.preload_block, ebx
pop [ebx + IniFile.cnt] esi
pop eax
sub eax,[ebx + IniFile.bsize]
sub [ebx + IniFile.cnt], eax
pop ecx ebx eax
ret
push eax ebx ecx
mov ebx, [_f]
push [ebx + IniFile.bsize]
push esi [ebx + IniFile.cnt]
invoke file.seek, [ebx + IniFile.fh], [ebx + IniFile.pos], SEEK_SET
stdcall libini._.preload_block, ebx
pop [ebx + IniFile.cnt] esi
pop eax
sub eax,[ebx + IniFile.bsize]
sub [ebx + IniFile.cnt], eax
pop ecx ebx eax
ret
endp
; f_info - contains current file block number
@@ -253,91 +249,91 @@ locals
buf dd ?
endl
xor eax, eax
cmp [_delta], 0
je .skip
xor eax, eax
cmp [_delta], 0
je .skip
push ebx ecx
invoke mem.alloc, ini.BLOCK_SIZE
or eax, eax
jz .fail
mov [buf], eax
push ebx ecx
invoke mem.alloc, ini.BLOCK_SIZE
or eax, eax
jz .fail
mov [buf], eax
cmp [_delta], 0
jl .down
cmp [_delta], 0
jl .down
mov ebx, [_f]
mov ecx, [ebx + IniFile.cnt]
mov ebx, [ebx + IniFile.fh]
invoke file.tell, ebx
sub eax, ecx
invoke file.seek, ebx, eax, SEEK_SET
@@: invoke file.seek, ebx, [_delta], SEEK_CUR
invoke file.eof?, ebx
or eax, eax
jnz .done
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
mov ecx, eax
mov eax, [_delta]
neg eax
sub eax, ecx
invoke file.seek, ebx, eax, SEEK_CUR
push ecx
invoke file.write, ebx, [buf], ecx
pop ecx
cmp eax, ecx
jz @b
mov ebx, [_f]
mov ecx, [ebx + IniFile.cnt]
mov ebx, [ebx + IniFile.fh]
invoke file.tell, ebx
sub eax, ecx
invoke file.seek, ebx, eax, SEEK_SET
@@: invoke file.seek, ebx, [_delta], SEEK_CUR
invoke file.eof?, ebx
or eax, eax
jnz .done
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
mov ecx, eax
mov eax, [_delta]
neg eax
sub eax, ecx
invoke file.seek, ebx, eax, SEEK_CUR
push ecx
invoke file.write, ebx, [buf], ecx
pop ecx
cmp eax, ecx
jz @b
.fail:
or eax, -1
pop ecx ebx
ret
or eax, -1
pop ecx ebx
ret
.done:
mov eax, [_delta]
neg eax
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.seteof, ebx
stdcall libini._.reload_block, [_f]
invoke mem.free, [buf]
pop ecx ebx
mov eax, [_delta]
neg eax
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.seteof, ebx
stdcall libini._.reload_block, [_f]
invoke mem.free, [buf]
pop ecx ebx
.skip:
ret
ret
.down:
neg [_delta]
neg [_delta]
mov ebx, [_f]
mov ecx, [ebx + IniFile.cnt]
mov ebx, [ebx + IniFile.fh]
invoke file.tell, ebx
sub eax, ecx
lea edx, [eax - 1]
push edx
@@: invoke file.seek, ebx, edx, SEEK_SET
invoke file.eof?, ebx
or eax, eax
jnz @f
add edx, ini.BLOCK_SIZE
jmp @b
@@: cmp edx, [esp]
je .skip.2
add edx, -ini.BLOCK_SIZE
cmp edx, [esp]
jl @f
invoke file.seek, ebx, edx, SEEK_SET
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
mov ecx, eax
mov eax, [_delta]
sub eax, ecx
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.write, ebx, [buf], ecx
jmp @b
mov ebx, [_f]
mov ecx, [ebx + IniFile.cnt]
mov ebx, [ebx + IniFile.fh]
invoke file.tell, ebx
sub eax, ecx
lea edx, [eax - 1]
push edx
@@: invoke file.seek, ebx, edx, SEEK_SET
invoke file.eof?, ebx
or eax, eax
jnz @f
add edx, ini.BLOCK_SIZE
jmp @b
@@: cmp edx, [esp]
je .skip.2
add edx, -ini.BLOCK_SIZE
cmp edx, [esp]
jl @f
invoke file.seek, ebx, edx, SEEK_SET
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
mov ecx, eax
mov eax, [_delta]
sub eax, ecx
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.write, ebx, [buf], ecx
jmp @b
@@:
.skip.2:
add esp, 4
stdcall libini._.reload_block, [_f]
invoke mem.free, [buf]
pop ecx ebx
ret
add esp, 4
stdcall libini._.reload_block, [_f]
invoke mem.free, [buf]
pop ecx ebx
ret
endp
;;================================================================================================;;
@@ -349,25 +345,25 @@ proc libini._.get_value_length _f ;/////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ebx ecx edx eax
mov ebx, [_f]
invoke file.tell, [ebx + IniFile.fh]
push esi [ebx + IniFile.cnt] [ebx + IniFile.pos]
sub eax, [ebx + IniFile.cnt]
mov edx, eax
push ebx ecx edx eax
mov ebx, [_f]
invoke file.tell, [ebx + IniFile.fh]
push esi [ebx + IniFile.cnt] [ebx + IniFile.pos]
sub eax, [ebx + IniFile.cnt]
mov edx, eax
stdcall libini._.skip_line, [_f]
invoke file.tell, [ebx + IniFile.fh]
sub eax, [ebx + IniFile.cnt]
sub eax, edx
mov [esp + 4 * 3], eax
stdcall libini._.skip_line, [_f]
invoke file.tell, [ebx + IniFile.fh]
sub eax, [ebx + IniFile.cnt]
sub eax, edx
mov [esp + 4 * 3], eax
pop eax
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
stdcall libini._.preload_block, [_f]
pop [ebx + IniFile.cnt] esi
pop eax edx ecx ebx
ret
pop eax
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
stdcall libini._.preload_block, [_f]
pop [ebx + IniFile.cnt] esi
pop eax edx ecx ebx
ret
endp
;;================================================================================================;;
@@ -380,10 +376,10 @@ proc libini._.string_copy ;/////////////////////////////////////////////////////
;< --- TBD --- ;;
;;================================================================================================;;
@@: lodsb
or al, al
jz @f
stosb
jmp @b
or al, al
jz @f
stosb
jmp @b
@@: ret
endp
@@ -396,26 +392,26 @@ proc libini._.find_next_section _f ;////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ebx edi
push ebx edi
@@: stdcall libini._.skip_nonblanks, [_f]
cmp al, '['
je @f
or al, al
jz .exit_error
stdcall libini._.skip_line, [_f]
or al, al
jz .exit_error
jmp @b
cmp al, '['
je @f
or al, al
jz .exit_error
stdcall libini._.skip_line, [_f]
or al, al
jz .exit_error
jmp @b
@@:
pop edi ebx
xor eax, eax
ret
pop edi ebx
xor eax, eax
ret
.exit_error:
pop edi ebx
or eax, -1
ret
pop edi ebx
or eax, -1
ret
endp
;;================================================================================================;;
@@ -429,50 +425,50 @@ proc libini._.find_section _f, _sec_name ;//////////////////////////////////////
;< eax = -1 (fail) / 0 (ok) ;;
;< [_f.pos] = new cursor position (right after ']' char if eax = 0, at the end of file otherwise) ;;
;;================================================================================================;;
push ebx edi
push ebx edi
mov ecx, [_f]
invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET
stdcall libini._.preload_block, [_f]
mov ecx, [_f]
invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET
stdcall libini._.preload_block, [_f]
.next_section:
stdcall libini._.find_next_section, [_f]
or eax, eax
jnz .exit_error
stdcall libini._.find_next_section, [_f]
or eax, eax
jnz .exit_error
stdcall libini._.get_char, [_f]
stdcall libini._.skip_spaces, [_f]
mov edi, [_sec_name]
stdcall libini._.get_char, [_f]
stdcall libini._.skip_spaces, [_f]
mov edi, [_sec_name]
@@: stdcall libini._.get_char, [_f]
cmp al, ']'
je @f
or al, al
jz .exit_error
cmp al, 13
je .next_section
cmp al, 10
je .next_section
scasb
je @b
cmp byte[edi - 1], 0
jne .next_section
dec edi
stdcall libini._.unget_char, [_f]
stdcall libini._.skip_spaces, [_f]
stdcall libini._.get_char, [_f]
cmp al, ']'
jne .next_section
cmp al, ']'
je @f
or al, al
jz .exit_error
cmp al, 13
je .next_section
cmp al, 10
je .next_section
scasb
je @b
cmp byte[edi - 1], 0
jne .next_section
dec edi
stdcall libini._.unget_char, [_f]
stdcall libini._.skip_spaces, [_f]
stdcall libini._.get_char, [_f]
cmp al, ']'
jne .next_section
@@:
cmp byte[edi], 0
jne .next_section
pop edi ebx
xor eax, eax
ret
cmp byte[edi], 0
jne .next_section
pop edi ebx
xor eax, eax
ret
.exit_error:
pop edi ebx
or eax, -1
ret
pop edi ebx
or eax, -1
ret
endp
;;================================================================================================;;
@@ -487,44 +483,44 @@ proc libini._.find_key _f, _key_name ;//////////////////////////////////////////
;< [_f.pos] = new cursor position (right after '=' char if eax = 0, at the end of file or right ;;
;< before '[' char otherwise) ;;
;;================================================================================================;;
push ebx edi
push ebx edi
.next_value:
mov edi, [_key_name]
stdcall libini._.skip_line, [_f]
stdcall libini._.skip_nonblanks, [_f]
or al, al
jz .exit_error
cmp al, '['
je .exit_error
mov edi, [_key_name]
stdcall libini._.skip_line, [_f]
stdcall libini._.skip_nonblanks, [_f]
or al, al
jz .exit_error
cmp al, '['
je .exit_error
@@: stdcall libini._.get_char, [_f]
or al, al
jz .exit_error
cmp al, '='
je @f
scasb
je @b
cmp byte[edi - 1], 0
jne .next_value
dec edi
stdcall libini._.unget_char, [_f]
stdcall libini._.skip_spaces, [_f]
stdcall libini._.get_char, [_f]
cmp al, '='
je @f
jmp .next_value
or al, al
jz .exit_error
cmp al, '='
je @f
scasb
je @b
cmp byte[edi - 1], 0
jne .next_value
dec edi
stdcall libini._.unget_char, [_f]
stdcall libini._.skip_spaces, [_f]
stdcall libini._.get_char, [_f]
cmp al, '='
je @f
jmp .next_value
@@:
cmp byte[edi], 0
jne .next_value
cmp byte[edi], 0
jne .next_value
pop edi ebx
xor eax, eax
ret
pop edi ebx
xor eax, eax
ret
.exit_error:
pop edi ebx
or eax, -1
ret
pop edi ebx
or eax, -1
ret
endp
;;================================================================================================;;
@@ -536,31 +532,31 @@ proc libini._.low.read_value _f_addr, _buffer, _buf_len ;///////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push edi eax
mov edi, [_buffer]
stdcall libini._.skip_spaces, [_f_addr]
@@: dec [_buf_len]
jz @f
stdcall libini._.get_char, [_f_addr]
cmp al, 13
je @f
cmp al, 10
je @f
stosb
or al, al
jnz @b
push edi eax
mov edi, [_buffer]
stdcall libini._.skip_spaces, [_f_addr]
@@: dec [_buf_len]
jz @f
stdcall libini._.get_char, [_f_addr]
cmp al, 13
je @f
cmp al, 10
je @f
stosb
or al, al
jnz @b
@@: stdcall libini._.unget_char, [_f_addr]
mov byte[edi], 0
dec edi
@@: cmp edi, [_buffer]
jb @f
cmp byte[edi], 32
ja @f
mov byte[edi], 0
dec edi
jmp @b
@@: pop eax edi
ret
mov byte[edi], 0
dec edi
@@: cmp edi, [_buffer]
jb @f
cmp byte[edi], 32
ja @f
mov byte[edi], 0
dec edi
jmp @b
@@: pop eax edi
ret
endp
;;================================================================================================;;
@@ -572,25 +568,25 @@ proc libini._.str_to_int ;//////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< eax = binary number representation (no overflow checks made) ;;
;;================================================================================================;;
push edx
push edx
xor eax, eax
xor edx, edx
xor eax, eax
xor edx, edx
@@: lodsb
cmp al, '0'
jb @f
cmp al, '9'
ja @f
add eax, -'0'
imul edx, 10
add edx, eax
jmp @b
cmp al, '0'
jb @f
cmp al, '9'
ja @f
add eax, -'0'
imul edx, 10
add edx, eax
jmp @b
@@: dec esi
mov eax, edx
pop edx
ret
@@: dec esi
mov eax, edx
pop edx
ret
endp
;;================================================================================================;;
@@ -604,29 +600,29 @@ proc libini._.int_to_str ;//////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ecx edx
push ecx edx
or eax, eax
jns @f
mov byte[edi], '-'
inc edi
@@: call .recurse
pop edx ecx
ret
or eax, eax
jns @f
mov byte[edi], '-'
inc edi
@@: call .recurse
pop edx ecx
ret
.recurse:
cmp eax,ecx
jb @f
xor edx,edx
div ecx
push edx
call .recurse
pop eax
@@: cmp al,10
sbb al,0x69
das
stosb
retn
cmp eax,ecx
jb @f
xor edx,edx
div ecx
push edx
call .recurse
pop eax
@@: cmp al,10
sbb al,0x69
das
stosb
retn
endp
;;================================================================================================;;
@@ -639,50 +635,50 @@ proc libini._.ascii_to_scan ;_ascii_code ;//////////////////////////////////////
;< eax = 0 (error) / scancode (success) ;;
;;================================================================================================;;
; /sys/keymap.key
sub esp, 256
mov eax, esp
push ebx
push 'key'
push 'map.'
push '/key'
push '/sys'
push eax ; buffer in the stack
push 0x100 ; read 0x100 bytes
push 0
push 0 ; from position zero
push 0 ; subfunction: read
mov ebx, esp
push 70
pop eax
mcall
add esp, 36
pop ebx
test eax, eax
jnz .die
mov al, [esp+256+4] ; get ASCII code
push edi
sub esp, 256
mov eax, esp
push ebx
push 'key'
push 'map.'
push '/key'
push '/sys'
push eax ; buffer in the stack
push 0x100 ; read 0x100 bytes
push 0
push 0 ; from position zero
push 0 ; subfunction: read
mov ebx, esp
push 70
pop eax
mcall
add esp, 36
pop ebx
test eax, eax
jnz .die
mov al, [esp+256+4] ; get ASCII code
push edi
; first keytable - no modifiers pressed
; check scancodes from 1 to 36h (inclusive)
lea edi, [esp+4+1]
mov edx, edi
mov ecx, 36h
repnz scasb
jz .found
lea edi, [esp+4+1]
mov edx, edi
mov ecx, 36h
repnz scasb
jz .found
; second keytable - Shift pressed
lea edi, [esp+4+128+1]
mov edx, edi
mov ecx, 36h
repnz scasb
jz .found
pop edi
lea edi, [esp+4+128+1]
mov edx, edi
mov ecx, 36h
repnz scasb
jz .found
pop edi
.die:
xor eax, eax
jmp .ret
xor eax, eax
jmp .ret
.found:
mov eax, edi
sub eax, edx
pop edi
mov eax, edi
sub eax, edx
pop edi
.ret:
add esp, 256
ret 4
add esp, 256
ret 4
endp

View File

@@ -33,39 +33,38 @@ use_ColorDialog
;--------------------------------------------------
align 16
lib_init:
xor eax, eax
ret
ret
;--------------------------------------------------
align 16
EXPORTS:
dd sz_init, lib_init
dd sz_version, 0x00000001
dd sz_init, lib_init
dd sz_version, 0x00000001
dd sz_OpenDialog_init, OpenDialog.init
dd sz_OpenDialog_start, OpenDialog.start
dd sz_OpenDialog_set_file_name, OpenDialog.set_file_name
dd sz_OpenDialog_set_file_ext, OpenDialog.set_file_ext
dd szVersion_OpenDialog, 0x00010001
dd sz_OpenDialog_init, OpenDialog.init
dd sz_OpenDialog_start, OpenDialog.start
dd sz_OpenDialog_set_file_name, OpenDialog.set_file_name
dd sz_OpenDialog_set_file_ext, OpenDialog.set_file_ext
dd szVersion_OpenDialog, 0x00010001
dd sz_ColorDialog_init, ColorDialog.init
dd sz_ColorDialog_start, ColorDialog.start
dd szVersion_ColorDialog, 0x00010001
dd sz_ColorDialog_init, ColorDialog.init
dd sz_ColorDialog_start, ColorDialog.start
dd szVersion_ColorDialog, 0x00010001
dd 0,0
dd 0,0
;-----------------------------------------------------------------------------
sz_init db 'lib_init',0
sz_version db 'version',0
sz_init db 'lib_init',0
sz_version db 'version',0
sz_OpenDialog_init db 'OpenDialog_init',0
sz_OpenDialog_start db 'OpenDialog_start',0
sz_OpenDialog_set_file_name db 'OpenDialog_set_file_name',0
sz_OpenDialog_set_file_ext db 'OpenDialog_set_file_ext',0
szVersion_OpenDialog db 'Version_OpenDialog',0
sz_OpenDialog_init db 'OpenDialog_init',0
sz_OpenDialog_start db 'OpenDialog_start',0
sz_OpenDialog_set_file_name db 'OpenDialog_set_file_name',0
sz_OpenDialog_set_file_ext db 'OpenDialog_set_file_ext',0
szVersion_OpenDialog db 'Version_OpenDialog',0
sz_ColorDialog_init db 'ColorDialog_init',0
sz_ColorDialog_start db 'ColorDialog_start',0
szVersion_ColorDialog db 'Version_ColorDialog',0
sz_ColorDialog_init db 'ColorDialog_init',0
sz_ColorDialog_start db 'ColorDialog_start',0
szVersion_ColorDialog db 'Version_ColorDialog',0
;-----------------------------------------------------------------------------

View File

@@ -1,6 +0,0 @@
# SPDX-FileCopyrightText: 2025 iyzsong@envs.net
#
# SPDX-License-Identifier: MPL-2.0
zig-out
.zig-cache

View File

@@ -1,17 +0,0 @@
// SPDX-FileCopyrightText: 2025 iyzsong@envs.net
//
// SPDX-License-Identifier: MPL-2.0
Uxn/Varvara emulator for Kolibri OS
Based on https://github.com/chmod222/zuxn
compile: zig build --release=fast
result: zig-out/bin/uxn
run: uxn SOME.rom
control:
Up/Down/Left/Right
Ctrl/Shift/Alt/Home
F1: change scale (1x, 2x, 3x)
TODO: file/directory stat, audio latency, open dialog?

View File

@@ -1,36 +0,0 @@
// SPDX-FileCopyrightText: 2025 iyzsong@envs.net
//
// SPDX-License-Identifier: MPL-2.0
const std = @import("std");
pub fn build(b: *std.Build) void {
const target_query = std.Target.Query{
.cpu_arch = std.Target.Cpu.Arch.x86,
.os_tag = std.Target.Os.Tag.freestanding,
.abi = std.Target.Abi.none,
.cpu_model = std.Target.Query.CpuModel{ .explicit = &std.Target.x86.cpu.i586 },
};
const target = b.resolveTargetQuery(target_query);
const optimize = b.standardOptimizeOption(.{});
const zuxn = b.dependency("zuxn", .{
.target = target,
.optimize = optimize,
});
const elf = b.addExecutable(.{
.name = "uxn.elf",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.unwind_tables = .none,
});
elf.root_module.addImport("uxn-core", zuxn.module("uxn-core"));
elf.root_module.addImport("uxn-varvara", zuxn.module("uxn-varvara"));
elf.setLinkerScript(b.path("src/linker.ld"));
const bin = elf.addObjCopy(.{
.format = .bin,
});
const install_bin = b.addInstallBinFile(bin.getOutput(), "uxn");
b.getInstallStep().dependOn(&install_bin.step);
b.installArtifact(elf);
}

View File

@@ -1,21 +0,0 @@
// SPDX-FileCopyrightText: 2025 iyzsong@envs.net
//
// SPDX-License-Identifier: MPL-2.0
.{
.name = .uxn_kolibrios,
.version = "0.0.0",
.fingerprint = 0x3aef20f25c0a0218,
.minimum_zig_version = "0.14.0",
.dependencies = .{
.zuxn = .{
.url = "git+https://github.com/chmod222/zuxn.git#fc3a76724fa87dd08039438b56fc326ac3d51e4d",
.hash = "zuxn-0.0.1-XnoOpbqsAgD-fU6rv_AoLffA1utIzXuae2cmnHj6SzE6",
},
},
.paths = .{
"build.zig",
"build.zig.zon",
"src",
},
}

View File

@@ -1,604 +0,0 @@
// SPDX-FileCopyrightText: 2025 iyzsong@envs.net
//
// SPDX-License-Identifier: MPL-2.0
const std = @import("std");
pub const SYS = enum(i32) {
terminate_process = -1,
create_window = 0,
put_pixel = 1,
get_key = 2,
get_sys_time = 3,
draw_text = 4,
sleep = 5,
put_image = 7,
define_button = 8,
thread_info = 9,
wait_event = 10,
check_event = 11,
redraw = 12,
draw_rect = 13,
get_screen_size = 14,
get_button = 17,
system = 18,
screen_put_image = 25,
system_get = 26,
get_sys_date = 29,
mouse_get = 37,
set_events_mask = 40,
style_settings = 48,
create_thread = 51,
board = 63,
keyboard = 66,
change_window = 67,
sys_misc = 68,
file = 70,
blitter = 73,
};
pub const Event = enum(u32) {
none = 0,
redraw = 1,
key = 2,
button = 3,
background = 5,
mouse = 6,
ipc = 7,
};
pub inline fn syscall0(number: SYS) u32 {
return asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (@intFromEnum(number)),
);
}
pub inline fn syscall1(number: SYS, arg1: u32) u32 {
return asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (@intFromEnum(number)),
[arg1] "{ebx}" (arg1),
);
}
pub inline fn syscall2(number: SYS, arg1: u32, arg2: u32) u32 {
return asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (@intFromEnum(number)),
[arg1] "{ebx}" (arg1),
[arg2] "{ecx}" (arg2),
);
}
pub inline fn syscall3(number: SYS, arg1: u32, arg2: u32, arg3: u32) u32 {
return asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (@intFromEnum(number)),
[arg1] "{ebx}" (arg1),
[arg2] "{ecx}" (arg2),
[arg3] "{edx}" (arg3),
);
}
pub inline fn syscall4(number: SYS, arg1: u32, arg2: u32, arg3: u32, arg4: u32) u32 {
return asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (@intFromEnum(number)),
[arg1] "{ebx}" (arg1),
[arg2] "{ecx}" (arg2),
[arg3] "{edx}" (arg3),
[arg4] "{esi}" (arg4),
);
}
pub inline fn syscall5(number: SYS, arg1: u32, arg2: u32, arg3: u32, arg4: u32, arg5: u32) u32 {
return asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (@intFromEnum(number)),
[arg1] "{ebx}" (arg1),
[arg2] "{ecx}" (arg2),
[arg3] "{edx}" (arg3),
[arg4] "{esi}" (arg4),
[arg5] "{edi}" (arg5),
);
}
pub fn terminateProcess() noreturn {
_ = syscall0(SYS.terminate_process);
unreachable;
}
pub const WindowFlags = struct {
skinned: bool = true,
fixed: bool = true,
no_title: bool = false,
relative_coordinates: bool = false,
no_fill: bool = false,
unmovable: bool = false,
};
pub fn createWindow(x: u16, y: u16, width: u16, height: u16, bgcolor: u24, flags: WindowFlags, title: [*:0]const u8) void {
var f1: u32 = 0x00000000;
if (flags.no_fill)
f1 |= 0x40000000;
if (flags.relative_coordinates)
f1 |= 0x20000000;
if (!flags.no_title)
f1 |= 0x10000000;
if (flags.skinned) {
if (flags.fixed) {
f1 |= 0x04000000;
} else {
f1 |= 0x03000000;
}
} else {
f1 |= 0x01000000;
}
var f2: u32 = 0x00000000;
if (flags.unmovable)
f2 = 0x01000000;
_ = syscall5(SYS.create_window, @as(u32, x) * 0x10000 + width, @as(u32, y) * 0x10000 + height, f1 | @as(u32, bgcolor), f2 | @as(u32, bgcolor), @intFromPtr(title));
}
pub fn putPixel(x: u16, y: u16, color: u24) void {
_ = syscall3(SYS.put_pixel, x, y, color);
}
pub fn invertPixel(x: u16, y: u16) void {
_ = syscall3(SYS.put_pixel, x, y, 0x01000000);
}
pub const Key = packed struct(u32) {
_unused: u8 = 0,
key: u8 = 0,
scancode: u8 = 0,
empty: u8 = 1,
pub fn pressed(self: *const Key) bool {
return self.key & 0x80 > 0;
}
};
pub fn getKey() Key {
return @bitCast(syscall0(SYS.get_key));
}
pub fn getSysTime() u24 {
return @intCast(syscall0(SYS.get_sys_time));
}
pub fn getButton() u32 {
return syscall0(SYS.get_button);
}
pub fn terminateThreadId(id: u32) void {
_ = syscall2(SYS.system, 18, id);
}
pub fn drawText(x: u16, y: u16, color: u24, text: [*:0]const u8) void {
_ = syscall5(SYS.draw_text, @as(u32, x) * 0x10000 + y, 0x80000000 | @as(u32, color), @intFromPtr(text), 0, 0);
}
pub fn sleep(centisecond: u32) void {
_ = syscall1(SYS.sleep, centisecond);
}
pub fn beginDraw() void {
_ = syscall1(SYS.redraw, 1);
}
pub fn endDraw() void {
_ = syscall1(SYS.redraw, 2);
}
pub fn putImage(image: [*]const u8, width: u16, height: u16, x: u16, y: u16) void {
_ = syscall3(SYS.put_image, @intFromPtr(image), @as(u32, width) * 0x10000 + height, @as(u32, x) * 0x10000 + y);
}
pub fn drawRect(x: u16, y: u16, width: u16, height: u16, color: u24) void {
_ = syscall3(SYS.draw_rect, @as(u32, x) * 0x10000 + width, @as(u32, y) * 0x10000 + height, color);
}
pub fn getScreenSize() packed struct(u32) { height: u16, width: u16 } {
return @bitCast(syscall0(SYS.get_screen_size));
}
pub fn waitEvent() Event {
return @enumFromInt(syscall0(SYS.wait_event));
}
pub fn checkEvent() Event {
return @enumFromInt(syscall0(SYS.check_event));
}
pub fn createThread(entry: *const fn () void, stack: []u8) u32 {
return syscall3(SYS.create_thread, 1, @intFromPtr(entry), @intFromPtr(stack.ptr) + stack.len);
}
pub fn debugWrite(byte: u8) void {
_ = syscall2(SYS.board, 1, byte);
}
pub fn debugWriteText(bytes: []const u8) void {
for (bytes) |byte| {
debugWrite(byte);
}
}
pub const EventsMask = packed struct(u32) {
redraw: bool = true, // 0
key: bool = true,
button: bool = true,
_reserved: bool = false,
background: bool = false,
mouse: bool = false,
ipc: bool = false,
network: bool = false,
debug: bool = false,
_unused: u23 = 0,
};
pub fn setEventsMask(mask: EventsMask) EventsMask {
return @bitCast(syscall1(SYS.set_events_mask, @bitCast(mask)));
}
pub fn getSkinHeight() u16 {
return @intCast(syscall1(SYS.style_settings, 4));
}
pub fn screenPutImage(image: [*]const u32, width: u16, height: u16, x: u16, y: u16) void {
_ = syscall3(SYS.screen_put_image, @intFromPtr(image), @as(u32, width) * 0x10000 + height, @as(u32, x) * 0x10000 + y);
}
pub fn systemGetTimeCount() u32 {
return syscall1(SYS.system_get, 9);
}
pub fn getSysDate() u24 {
return @intCast(syscall0(SYS.get_sys_date));
}
pub fn mouseGetScreenPosition() packed struct(u32) { y: u16, x: u16 } {
return @bitCast(syscall1(SYS.mouse_get, 0));
}
pub fn mouseGetWindowPosition() packed struct(u32) { y: u16, x: u16 } {
return @bitCast(syscall1(SYS.mouse_get, 1));
}
pub fn loadCursorIndirect(image: *const [32 * 32]u32, spotx: u5, spoty: u5) u32 {
return syscall3(SYS.mouse_get, 4, @intFromPtr(image), 0x0002 | (@as(u32, spotx) << 24) | (@as(u32, spoty) << 16));
}
pub fn setCursor(cursor: u32) u32 {
return syscall2(SYS.mouse_get, 5, cursor);
}
pub const MouseEvents = packed struct(u32) {
left_hold: bool = false,
right_hold: bool = false,
middle_hold: bool = false,
button4_hold: bool = false,
button5_hold: bool = false,
_unused0: u3 = 0,
left_pressed: bool = false,
right_pressed: bool = false,
middle_pressed: bool = false,
_unused1: u4 = 0,
vertical_scroll: bool = false,
left_released: bool = false,
right_released: bool = false,
middle_released: bool = false,
_unused2: u4 = 0,
horizontal_scroll: bool = false,
left_double_clicked: bool = false,
_unused3: u7 = 0,
};
pub fn mouseGetEvents() MouseEvents {
return @bitCast(syscall1(SYS.mouse_get, 3));
}
pub fn heapInit() u32 {
return syscall1(SYS.sys_misc, 11);
}
pub fn memAlloc(size: u32) *anyopaque {
return @ptrFromInt(syscall2(SYS.sys_misc, 12, size));
}
pub fn memFree(ptr: *anyopaque) void {
_ = syscall2(SYS.sys_misc, 13, @intFromPtr(ptr));
}
pub fn memRealloc(size: u32, ptr: *anyopaque) *anyopaque {
return @ptrFromInt(syscall3(SYS.sys_misc, 20, size, @intFromPtr(ptr)));
}
fn alloc(ctx: *anyopaque, len: usize, alignment: std.mem.Alignment, ret_addr: usize) ?[*]u8 {
_ = ctx;
_ = alignment;
_ = ret_addr;
return @ptrCast(memAlloc(len));
}
fn free(ctx: *anyopaque, memory: []u8, alignment: std.mem.Alignment, ret_addr: usize) void {
_ = ctx;
_ = alignment;
_ = ret_addr;
memFree(@ptrCast(memory.ptr));
}
fn resize(ctx: *anyopaque, memory: []u8, alignment: std.mem.Alignment, new_len: usize, ret_addr: usize) bool {
_ = ctx;
_ = alignment;
_ = ret_addr;
_ = memRealloc(new_len, @ptrCast(memory.ptr));
return true;
}
fn remap(ctx: *anyopaque, memory: []u8, alignment: std.mem.Alignment, new_len: usize, ret_addr: usize) ?[*]u8 {
_ = ctx;
_ = memory;
_ = alignment;
_ = new_len;
_ = ret_addr;
return null;
}
pub const allocator: std.mem.Allocator = .{
.ptr = undefined,
.vtable = &.{
.alloc = alloc,
.free = free,
.resize = resize,
.remap = remap,
},
};
pub fn loadDriver(name: [*:0]const u8) u32 {
return syscall2(SYS.sys_misc, 16, @intFromPtr(name));
}
pub fn controlDriver(drv: u32, func: u32, in: ?[]const u32, out: ?[]const *anyopaque) u32 {
const ioctl: packed struct(u192) {
drv: u32,
func: u32,
inptr: u32,
insize: u32,
outptr: u32,
outsize: u32,
} = .{
.drv = drv,
.func = func,
.inptr = if (in) |v| @intFromPtr(v.ptr) else 0,
.insize = if (in) |v| v.len * 4 else 0,
.outptr = if (out) |v| @intFromPtr(v.ptr) else 0,
.outsize = if (out) |v| v.len * 4 else 0,
};
return syscall2(SYS.sys_misc, 17, @intFromPtr(&ioctl));
}
pub const Signal = packed struct(u192) {
kind: u32,
data0: u32,
data1: u32,
data2: u32,
data3: u32,
data4: u32,
};
pub fn waitSignal(sig: *Signal) void {
_ = syscall2(SYS.sys_misc, 14, @intFromPtr(sig));
}
pub const Sound = struct {
drv: u32,
pub const Buffer = struct {
drv: u32,
handle: u32,
pub fn play(self: *const Buffer, flags: u32) void {
_ = controlDriver(self.drv, 10, &.{ self.handle, flags }, null);
}
pub fn set(self: *const Buffer, src: []u8, offset: u32) void {
_ = controlDriver(self.drv, 8, &.{ self.handle, @intFromPtr(src.ptr), offset, src.len }, null);
}
};
pub fn init() Sound {
return .{
.drv = loadDriver("INFINITY"),
};
}
pub fn createBuffer(self: *const Sound, format: u32, size: u32) Buffer {
var ret: u32 = 0;
_ = controlDriver(self.drv, 1, &.{ format, size }, &.{&ret});
return .{
.drv = self.drv,
.handle = ret,
};
}
};
pub const InputMode = enum(u32) {
normal = 0,
scancodes = 1,
};
pub fn setInputMode(mode: InputMode) void {
_ = syscall2(SYS.keyboard, 1, @intFromEnum(mode));
}
pub fn changeWindow(x: u32, y: u32, width: u32, height: u32) void {
_ = syscall4(SYS.change_window, x, y, width, height);
}
pub const ControlKeys = packed struct(u32) {
left_shift: bool,
right_shift: bool,
left_ctrl: bool,
right_ctrl: bool,
left_alt: bool,
right_alt: bool,
caps_lock: bool,
num_lock: bool,
scroll_lock: bool,
left_win: bool,
right_win: bool,
_unused: u21,
};
pub fn getControlKeys() ControlKeys {
return @bitCast(syscall1(SYS.keyboard, 3));
}
const FileInfo = packed struct(u200) {
subfn: u32,
offset: u64,
size: u32,
buffer: u32,
path0: u8 = 0,
pathptr: *const u8,
};
pub fn readFile(pathname: [*:0]const u8, offset: u64, buffer: []u8) !u32 {
const info: FileInfo = .{
.subfn = 0,
.offset = offset,
.size = buffer.len,
.buffer = @intFromPtr(buffer.ptr),
.pathptr = @ptrCast(pathname),
};
const err = asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (SYS.file),
[info] "{ebx}" (&info),
);
const size = asm volatile (""
: [ret] "={ebx}" (-> u32),
);
return switch (err) {
0 => size,
10 => error.AccessDenied,
6 => size,
else => error.Unexpected,
};
}
pub fn createFile(pathname: [*:0]const u8, buffer: []u8) !u32 {
const info: FileInfo = .{
.subfn = 2,
.offset = 0,
.size = buffer.len,
.buffer = @intFromPtr(buffer.ptr),
.pathptr = @ptrCast(pathname),
};
const err = asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (SYS.file),
[info] "{ebx}" (&info),
);
const size = asm volatile (""
: [ret] "={ebx}" (-> u32),
);
return switch (err) {
0 => size,
10 => error.AccessDenied,
8 => size,
else => error.Unexpected,
};
}
pub fn writeFile(pathname: [*:0]const u8, offset: u64, buffer: []u8) !u32 {
const info: FileInfo = .{
.subfn = 3,
.offset = offset,
.size = buffer.len,
.buffer = @intFromPtr(buffer.ptr),
.pathptr = @ptrCast(pathname),
};
const err = asm volatile ("int $0x40"
: [ret] "={eax}" (-> u32),
: [number] "{eax}" (SYS.file),
[info] "{ebx}" (&info),
);
const size = asm volatile (""
: [ret] "={ebx}" (-> u32),
);
return switch (err) {
0 => size,
10 => error.AccessDenied,
5 => error.FileNotFound,
else => error.Unexpected,
};
}
pub fn fileGetSize(pathname: [*:0]const u8) !u64 {
var ret: [10]u32 = undefined;
const info: FileInfo = .{
.subfn = 5,
.offset = 0,
.size = 0,
.buffer = @intFromPtr(&ret),
.pathptr = @ptrCast(pathname),
};
if (syscall1(SYS.file, @intFromPtr(&info)) != 0)
return error.Unexpected;
return ret[8] | (@as(u64, ret[9]) << 32);
}
pub fn deleteFile(pathname: [*:0]const u8) !void {
const info: FileInfo = .{
.subfn = 8,
.offset = 0,
.size = 0,
.buffer = 0,
.pathptr = @ptrCast(pathname),
};
const err = syscall1(SYS.file, @intFromPtr(&info));
if (err != 0)
return error.Unexpected;
}
pub const File = struct {
pathname: [*:0]const u8,
offset: u64 = 0,
pub fn reader(file: *File) std.io.GenericReader(*File, anyerror, struct {
fn read(context: *File, buffer: []u8) !usize {
const size = try readFile(context.pathname, context.offset, buffer);
context.offset += size;
return size;
}
}.read) {
return .{ .context = file };
}
};
pub const BlitterFlags = packed struct(u32) {
rop: u4 = 0,
background: bool = false,
transparent: bool = false,
reserved1: u23 = 0,
client_relative: bool = true,
reserved2: u2 = 0,
};
pub fn blitter(dstx: u32, dsty: u32, dstw: u32, dsth: u32, srcx: u32, srcy: u32, srcw: u32, srch: u32, src: *const u8, pitch: u32, flags: BlitterFlags) void {
_ = syscall2(SYS.blitter, @bitCast(flags), @intFromPtr(&[_]u32{ dstx, dsty, dstw, dsth, srcx, srcy, srcw, srch, @intFromPtr(src), pitch }));
}
pub const DebugWriter = std.io.GenericWriter(void, anyerror, struct {
fn write(context: void, bytes: []const u8) !usize {
_ = context;
debugWriteText(bytes);
return bytes.len;
}
}.write);
pub const debug_writer: DebugWriter = .{ .context = {} };

View File

@@ -1,42 +0,0 @@
/*
* SPDX-FileCopyrightText: 2025 iyzsong@envs.net
*
* SPDX-License-Identifier: MPL-2.0
*/
SECTIONS
{
.text 0x00000000 :
{
/* MENUET01 header */
LONG(0x554e454d);
LONG(0x31305445);
LONG(1);
LONG(_start);
LONG(_image_end);
LONG(_memory_end);
LONG(_stack_top);
LONG(_cmdline);
LONG(0);
*(.text)
*(.text.*)
}
.rodata : ALIGN(8)
{
*(.rodata)
*(.rodata.*)
}
.data : ALIGN(8)
{
*(.data)
}
_image_end = .;
.bss : ALIGN(8)
{
*(.bss)
. = . + 4K;
_stack_top = .;
}
_memory_end = .;
}

View File

@@ -1,418 +0,0 @@
// SPDX-FileCopyrightText: 2025 iyzsong@envs.net
//
// SPDX-License-Identifier: MPL-2.0
const std = @import("std");
const kos = @import("kolibri.zig");
const uxn = @import("uxn-core");
const varvara = @import("uxn-varvara");
const allocator = kos.allocator;
export var _cmdline: [1024]u8 = undefined;
pub const std_options: std.Options = .{
.log_level = .info,
.logFn = struct {
fn log(comptime level: std.log.Level, comptime scope: @Type(.enum_literal), comptime format: []const u8, args: anytype) void {
_ = level;
_ = scope;
kos.debug_writer.print(format, args) catch return;
}
}.log,
};
const VarvaraDefault = varvara.VarvaraSystem(kos.DebugWriter, kos.DebugWriter);
const emu = struct {
var cpu: uxn.Cpu = undefined;
var sys: VarvaraDefault = undefined;
var rom: *[0x10000]u8 = undefined;
var pixels: []u8 = undefined;
var screen_width: u32 = undefined;
var screen_height: u32 = undefined;
var null_cursor: u32 = undefined;
var hide_cursor: bool = false;
var audio_thread: ?u32 = null;
var scale: u4 = 1;
fn init(rompath: [*:0]const u8) !void {
const screen = &emu.sys.screen_device;
var rom_file = kos.File{ .pathname = rompath };
emu.rom = try uxn.loadRom(allocator, rom_file.reader());
emu.cpu = uxn.Cpu.init(emu.rom);
emu.sys = try VarvaraDefault.init(allocator, kos.debug_writer, kos.debug_writer);
emu.cpu.device_intercept = struct {
var file_offsets: [2]u64 = .{ 0, 0 };
fn bcd8(x: u8) u8 {
return (x & 0xf) + 10 * ((x & 0xf0) >> 4);
}
fn getFilePortSlice(dev: *varvara.file.File, comptime port: comptime_int) []u8 {
const ports = varvara.file.ports;
const ptr: usize = dev.loadPort(u16, &cpu, port);
return if (port == ports.name)
std.mem.sliceTo(cpu.mem[ptr..], 0x00)
else
return cpu.mem[ptr..ptr +| dev.loadPort(u16, &cpu, ports.length)];
}
pub fn intercept(self: *uxn.Cpu, addr: u8, kind: uxn.Cpu.InterceptKind, data: ?*anyopaque) !void {
_ = data;
const port: u4 = @truncate(addr & 0x0f);
if (audio_thread == null and addr >= 0x30 and addr < 0x70) {
audio_thread = kos.createThread(&audio, allocator.alloc(u8, 32 * 1024) catch unreachable);
}
switch (addr >> 4) {
0xa, 0xb => {
if (kind != .output)
return;
const idx = (addr >> 4) - 0xa;
const dev = &sys.file_devices[idx];
const ports = varvara.file.ports;
switch (port) {
ports.stat + 1 => {
// TODO: file/directory stat
dev.storePort(u16, &cpu, ports.success, 0);
},
ports.delete => {
const name_slice = getFilePortSlice(dev, ports.name);
_ = kos.deleteFile(@ptrCast(name_slice)) catch {};
dev.storePort(u16, &cpu, ports.success, 0);
},
ports.name + 1 => {
file_offsets[idx] = 0;
dev.storePort(u16, &cpu, ports.success, 1);
},
ports.read + 1 => {
const name_slice = getFilePortSlice(dev, ports.name);
const data_slice = getFilePortSlice(dev, ports.read);
const ret: u32 = kos.readFile(@ptrCast(name_slice), file_offsets[idx], data_slice) catch 0;
file_offsets[idx] += ret;
dev.storePort(u16, &cpu, ports.success, @intCast(ret));
},
ports.write + 1 => {
const append = dev.loadPort(u8, &cpu, ports.append) == 0x01;
const pathname: [*:0]const u8 = @ptrCast(getFilePortSlice(dev, ports.name));
const buffer = getFilePortSlice(dev, ports.write);
var ret: u32 = 0;
if (append) {
const offset: u32 = @intCast(kos.fileGetSize(pathname) catch 0);
ret = kos.writeFile(pathname, offset, buffer) catch |err| blk: {
if (err == error.FileNotFound) {
break :blk kos.createFile(pathname, buffer) catch 0;
} else {
break :blk 0;
}
};
} else {
ret = kos.createFile(pathname, buffer) catch 0;
}
dev.storePort(u16, &cpu, ports.success, @intCast(ret));
},
else => {},
}
},
0xc => {
if (kind != .input)
return;
const dev = &sys.datetime_device;
const date = kos.getSysDate();
const time = kos.getSysTime();
switch (port) {
0x0, 0x1 => {
const year: u8 = bcd8(@truncate(date & 0xff));
dev.storePort(u16, &cpu, 0x0, @as(u16, 2000) + bcd8(year));
},
0x02 => {
const month: u8 = bcd8(@truncate((date & 0xff00) >> 8));
dev.storePort(u8, &cpu, port, month);
},
0x03 => {
const day: u8 = bcd8(@truncate((date & 0xff0000) >> 16));
dev.storePort(u8, &cpu, port, day);
},
0x04 => {
const hour: u8 = bcd8(@truncate(time & 0xff));
dev.storePort(u8, &cpu, port, hour);
},
0x05 => {
const minute: u8 = bcd8(@truncate((time & 0xff00) >> 8));
dev.storePort(u8, &cpu, port, minute);
},
0x06 => {
const second: u8 = bcd8(@truncate((time & 0xff0000) >> 16));
dev.storePort(u8, &cpu, port, second);
},
else => {},
}
},
else => try emu.sys.intercept(self, addr, kind),
}
}
}.intercept;
emu.cpu.output_intercepts = varvara.full_intercepts.output;
emu.cpu.input_intercepts = varvara.full_intercepts.input;
try emu.cpu.evaluateVector(0x0100);
screen_width = screen.width * emu.scale;
screen_height = screen.height * emu.scale;
emu.pixels = try allocator.alloc(u8, @as(usize, 4) * screen_width * screen_height);
}
fn exit() void {
if (audio_thread) |tid| {
kos.terminateThreadId(tid);
}
kos.terminateProcess();
}
fn audio() void {
var samples: [8192]i16 = undefined;
var sig: kos.Signal = undefined;
const buf = kos.Sound.init().createBuffer(3 | 0x10000000, 0);
buf.play(0);
while (true) {
kos.waitSignal(&sig);
if (sig.kind != 0xFF000001) continue;
@memset(&samples, 0);
for (0..samples.len / 512) |i| {
const w = samples[i * 512 .. (i + 1) * 512];
for (&sys.audio_devices) |*poly| {
if (poly.duration <= 0) {
poly.evaluateFinishVector(&cpu) catch unreachable;
}
poly.updateDuration();
poly.renderAudio(w);
}
}
for (0..samples.len) |i| {
samples[i] <<= 6;
}
buf.set(@ptrCast(&samples), sig.data2);
}
}
fn update() !void {
const screen = &sys.screen_device;
const colors = &sys.system_device.colors;
if (sys.system_device.exit_code) |_| {
exit();
}
if (screen_width != screen.width * scale or screen_height != screen.height * scale) {
const skin_height = kos.getSkinHeight();
allocator.free(emu.pixels);
screen_width = screen.width * scale;
screen_height = screen.height * scale;
emu.pixels = try allocator.alloc(u8, @as(usize, 4) * screen_width * screen_height);
kos.changeWindow(100, 100, screen_width + 9, screen_height + skin_height + 4);
}
try screen.evaluateFrame(&cpu);
if (screen.dirty_region) |region| {
for (region.y0..region.y1) |y| {
for (region.x0..region.x1) |x| {
const idx = y * screen.width + x;
const pal = (@as(u4, screen.foreground[idx]) << 2) | screen.background[idx];
const color = colors[if ((pal >> 2) > 0) (pal >> 2) else (pal & 0x3)];
for (0..scale) |sy| {
for (0..scale) |sx| {
pixels[4 * ((y * scale + sy) * screen.width * scale + (x * scale + sx)) + 2] = color.r;
pixels[4 * ((y * scale + sy) * screen.width * scale + (x * scale + sx)) + 1] = color.g;
pixels[4 * ((y * scale + sy) * screen.width * scale + (x * scale + sx)) + 0] = color.b;
}
}
}
}
const ix = region.x0 * scale;
const iy = region.y0 * scale;
const iw = (region.x1 - region.x0) * scale;
const ih = (region.y1 - region.y0) * scale;
kos.blitter(ix, iy, iw, ih, ix, iy, iw, ih, @ptrCast(emu.pixels.ptr), screen.width * scale * 4, .{});
screen.dirty_region = null;
}
}
fn changeScale() void {
const screen = &sys.screen_device;
scale = switch (scale) {
1 => 2,
2 => 3,
3 => 1,
else => 1,
};
screen.forceRedraw();
}
};
export fn _start() noreturn {
const cursor: [32 * 32]u32 = .{0} ** (32 * 32);
var counter: u32 = 0;
var last_tick = kos.systemGetTimeCount();
_ = kos.heapInit();
_ = kos.setEventsMask(.{ .mouse = true });
kos.setInputMode(.scancodes);
emu.null_cursor = kos.loadCursorIndirect(&cursor, 0, 0);
emu.init(@ptrCast(&_cmdline)) catch unreachable;
const screen = &emu.sys.screen_device;
const controller = &emu.sys.controller_device;
const callbacks = struct {
fn redraw() void {
const skin_height = kos.getSkinHeight();
kos.beginDraw();
kos.createWindow(300, 300, screen.width * emu.scale + 9, screen.height * emu.scale + skin_height + 4, 0x000000, .{ .skinned = true, .no_fill = true, .relative_coordinates = true }, "UXN");
kos.endDraw();
}
fn key() void {
const symtab: [0x80]u8 = .{
// 0x0*
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 8, '\t',
// 0x1*
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\r', 0, 'a', 's',
// 0x2*
'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', 'x', 'c', 'v',
// 0x3*
'b', 'n', 'm', ',', '.', '/', 0, 0, 0, ' ', 0, 0, 0, 0, 0, 0,
// 0x00* + SHIFT
0, 27, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 8, '\t',
// 0x10* + SHIFT
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\r', 0, 'A', 'S',
// 0x20* + SHIFT
'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', 0, '|', 'Z', 'X', 'C', 'V',
// 0x30* + SHIFT,
'B', 'N', 'M', '<', '>', '?', 0, 0, 0, ' ', 0, 0, 0, 0, 0, 0,
};
const scancode1 = kos.getKey().key;
const input: ?union(enum) {
button: struct {
flags: varvara.controller.ButtonFlags,
pressed: bool,
},
key: u8,
} = switch (scancode1) {
0xe0 => blk: {
const scancode2 = kos.getKey().key;
break :blk switch (scancode2) {
0x1d => .{ .button = .{ .flags = .{ .ctrl = true }, .pressed = true } },
0x9d => .{ .button = .{ .flags = .{ .ctrl = true }, .pressed = false } },
0x38 => .{ .button = .{ .flags = .{ .alt = true }, .pressed = true } },
0xb8 => .{ .button = .{ .flags = .{ .alt = true }, .pressed = false } },
0x47 => .{ .button = .{ .flags = .{ .start = true }, .pressed = true } },
0xc7 => .{ .button = .{ .flags = .{ .start = true }, .pressed = false } },
0x48 => .{ .button = .{ .flags = .{ .up = true }, .pressed = true } },
0xc8 => .{ .button = .{ .flags = .{ .up = true }, .pressed = false } },
0x50 => .{ .button = .{ .flags = .{ .down = true }, .pressed = true } },
0xd0 => .{ .button = .{ .flags = .{ .down = true }, .pressed = false } },
0x4b => .{ .button = .{ .flags = .{ .left = true }, .pressed = true } },
0xcb => .{ .button = .{ .flags = .{ .left = true }, .pressed = false } },
0x4d => .{ .button = .{ .flags = .{ .right = true }, .pressed = true } },
0xcd => .{ .button = .{ .flags = .{ .right = true }, .pressed = false } },
else => null,
};
},
0x3b => blk: {
emu.changeScale();
break :blk null;
},
0x1d => .{ .button = .{ .flags = .{ .ctrl = true }, .pressed = true } },
0x9d => .{ .button = .{ .flags = .{ .ctrl = true }, .pressed = false } },
0x38 => .{ .button = .{ .flags = .{ .alt = true }, .pressed = true } },
0xb8 => .{ .button = .{ .flags = .{ .alt = true }, .pressed = false } },
0x2a, 0x36 => .{ .button = .{ .flags = .{ .shift = true }, .pressed = true } },
0xaa, 0xb6 => .{ .button = .{ .flags = .{ .shift = true }, .pressed = false } },
else => blk: {
if (scancode1 > 0x40) {
break :blk null;
}
const ctrls = kos.getControlKeys();
const k = if (ctrls.left_shift or ctrls.right_shift) symtab[scancode1 + 0x40] else symtab[scancode1];
break :blk if (k > 0) .{ .key = k } else null;
},
};
if (input) |v| {
switch (v) {
.button => {
if (v.button.pressed) {
controller.pressButtons(&emu.cpu, v.button.flags, 0) catch unreachable;
} else {
controller.releaseButtons(&emu.cpu, v.button.flags, 0) catch unreachable;
}
},
.key => {
controller.pressKey(&emu.cpu, v.key) catch unreachable;
},
}
}
}
fn button() void {
const btn = kos.getButton();
if (btn >> 8 == 1)
emu.exit();
}
fn mouse() void {
const dev = &emu.sys.mouse_device;
const pos = kos.mouseGetWindowPosition();
const events = kos.mouseGetEvents();
const mouse_pressed: varvara.mouse.ButtonFlags = .{
.left = events.left_pressed,
.middle = events.middle_pressed,
.right = events.right_pressed,
._unused = 0,
};
const mouse_released: varvara.mouse.ButtonFlags = .{
.left = events.left_released,
.middle = events.middle_released,
.right = events.right_released,
._unused = 0,
};
if (emu.hide_cursor and pos.y > emu.screen_height) {
_ = kos.setCursor(0);
emu.hide_cursor = false;
}
if (!emu.hide_cursor and pos.y < emu.screen_height) {
_ = kos.setCursor(emu.null_cursor);
emu.hide_cursor = true;
}
dev.updatePosition(&emu.cpu, pos.x / emu.scale, pos.y / emu.scale) catch unreachable;
if (@as(u8, @bitCast(mouse_pressed)) > 0) {
dev.pressButtons(&emu.cpu, mouse_pressed) catch unreachable;
}
if (@as(u8, @bitCast(mouse_released)) > 0) {
dev.releaseButtons(&emu.cpu, mouse_released) catch unreachable;
}
}
};
callbacks.redraw();
while (true) {
while (true) {
const event = kos.checkEvent();
switch (event) {
.none => break,
.redraw => callbacks.redraw(),
.key => callbacks.key(),
.button => callbacks.button(),
.mouse => callbacks.mouse(),
else => {},
}
}
const tick = kos.systemGetTimeCount();
counter += (tick - last_tick) * 3;
last_tick = tick;
if (counter > 5) {
counter -= 5;
emu.update() catch unreachable;
} else {
kos.sleep(1);
}
}
}

Binary file not shown.

View File

@@ -1,4 +1,4 @@
// Èñõîäíèê èãðû "Êòî õî÷åò áûòü ìèëëèîíåðîì?" äëÿ ÊîëèáðèÎÑ
// Èñõîäíèê èãðû "Êòî õî÷åò áûòü ìèëëèîíåðîì?" äëÿ Êîëèáðè ÎÑ
// by Àíäðåé Ìèõàéëîâè÷ (Dron2004)
#include <kosSyst.h>
@@ -83,7 +83,7 @@ void getFilePathName(){
for (tmpcnt=0; tmpcnt<strlen(ourfilename); tmpcnt++){
filepathname[tmpcnt+lastslashindex+1]=ourfilename[tmpcnt];
}
}
void prepareFileData() { //Ïðåäâàðèòåëüíûå ïîäñ÷¸òû
@@ -105,22 +105,22 @@ void loadquestion(){
int qcodee;
int skipsleft;
regenerate:
qcodee=(rtlRand()%questioncount)+1;
qcodee=(rtlRand()%questioncount)+1;
Byte inputbyte[1]={0x00};
//Ïåðâûé ïðîõîä - ïðîâåðÿåì ñëîæíîñòü è ñ÷èòàåì äëèíû ñòðîê
tempquestionlength = 0;
tempanswerAlength = 0;
tempanswerBlength = 0;
tempanswerClength = 0;
tempanswerDlength = 0;
skipsleft=qcodee;
CKosFile basefile(filepathname);
skipsleft=qcodee;
CKosFile basefile(filepathname);
//Íàéä¸ì òî ìåñòî, îòêóäà íà÷èíàåòñÿ íàø âîïðîñ
while (skipsleft>0){
basefile.Read (inputbyte,1);
@@ -132,7 +132,7 @@ regenerate:
//Ïðîâåðèì ñëîæíîñòü
basefile.Read (inputbyte,1);
// Íàì íóæíî, ÷òîáû ñëîæíîñòü çàäàâàåìîãî âîïðîñà ñîîòâåòñòâîâàëà íîìåðó çàäàâàåìîãî
// â èãðå âîïðîñà (íà êàêóþ ñóììó ìû èãðàåì; âîïðîñ íà 1000000 äîëæåí áûòü ïîñëîæíåå,
// ÷åì âîïðîñ íà 100 ðóáëåé :-)))
@@ -155,7 +155,7 @@ regenerate:
goto regenerate;
}
}
for (int counter=0; counter <currentquestion; counter++){
if (askedquestions[counter]==qcodee){goto regenerate;}
@@ -163,7 +163,7 @@ regenerate:
askedquestions[currentquestion-1]=qcodee;
inputbyte[0]=0x00;
//Ñ÷èòàåì, ñêîëüêî ñèìâîëîâ â âîïðîñå
@@ -210,12 +210,12 @@ regenerate:
tempanswerD = new char[tempanswerDlength+1];
// ÂÒÎÐÎÉ ÏÐÎÕÎÄ: ÔÎÐÌÈÐÓÅÌ Â ÏÀÌßÒÈ ÂÎÏÐÎÑ È ÂÀÐÈÀÍÒÛ ÎÒÂÅÒÀ
CKosFile basefile2(filepathname);
inputbyte[0]=0x00;
skipsleft=qcodee;
skipsleft=qcodee;
//Íàéä¸ì òî ìåñòî, îòêóäà íà÷èíàåòñÿ íàø âîïðîñ
while (skipsleft>0){
basefile2.Read (inputbyte,1);
@@ -224,11 +224,11 @@ regenerate:
}
inputbyte[0]=0x00;
}
basefile2.Read (inputbyte,1); // Ýòî - ñëîæíîñòü âîïðîñà. Ìû å¸ óæå ïðîâåðèëè.
//×èòàåì âîïðîñ
int currentbyte=0;
int currentbyte=0;
while (inputbyte[0]!=0x01){
basefile2.Read (inputbyte,1);
if (inputbyte[0]!=0x01){tempquestion[currentbyte]=inputbyte[0];}
@@ -237,7 +237,7 @@ regenerate:
tempquestion[currentbyte]='\n';
//×èòàåì îòâåò A
currentbyte=0;
currentbyte=0;
while (inputbyte[0]!=0x02){
basefile2.Read (inputbyte,1);
if (inputbyte[0]!=0x02){tempanswerA[currentbyte]=inputbyte[0];}
@@ -246,7 +246,7 @@ regenerate:
tempanswerA[currentbyte]='\n';
//×èòàåì îòâåò B
currentbyte=0;
currentbyte=0;
while (inputbyte[0]!=0x03){
basefile2.Read (inputbyte,1);
if (inputbyte[0]!=0x03){tempanswerB[currentbyte]=inputbyte[0];}
@@ -255,7 +255,7 @@ regenerate:
tempanswerB[currentbyte]='\n';
//×èòàåì îòâåò C
currentbyte=0;
currentbyte=0;
while (inputbyte[0]!=0x04){
basefile2.Read (inputbyte,1);
if (inputbyte[0]!=0x04){tempanswerC[currentbyte]=inputbyte[0];}
@@ -264,7 +264,7 @@ regenerate:
tempanswerC[currentbyte]='\n';
//×èòàåì îòâåò D
currentbyte=0;
currentbyte=0;
while (inputbyte[0]!=0x08){
basefile2.Read (inputbyte,1);
if (inputbyte[0]!=0x08){tempanswerD[currentbyte]=inputbyte[0];}
@@ -275,7 +275,7 @@ regenerate:
basefile2.Read (inputbyte,1); // Ýòî-ïðàâèëüíûé îòâåò
tempcorrectanswer=inputbyte[0];
// ÂѨ!!!!!! ÃÎÒÎÂÎ!!!! ÓÐÀ!
//Ñ÷èòàëè. Òåïåðü íàäî ïåðåòàñîâàòü âîïðîñû.
questionlength = 0;
answerAlength = 0;
@@ -297,7 +297,7 @@ regenerate:
bool answerDfree = true;
int tmpvalue=0;
//Ïåðâûé âîïðîñ
regenA:
tmpvalue = (rtlRand() % 4) +1;
@@ -306,7 +306,7 @@ regenA:
answerAfree=false;
answerAlength=tempanswerAlength;
answerA= new char [answerAlength];
for (int c=0; c<answerAlength; c++){
answerA[c]=tempanswerA[c];
}
@@ -322,7 +322,7 @@ regenA:
answerBfree=false;
answerBlength=tempanswerAlength;
answerB= new char [answerBlength];
for (int c=0; c<answerBlength; c++){
answerB[c]=tempanswerA[c];
}
@@ -338,7 +338,7 @@ regenA:
answerCfree=false;
answerClength=tempanswerAlength;
answerC= new char [answerClength];
for (int c=0; c<answerClength; c++){
answerC[c]=tempanswerA[c];
}
@@ -354,7 +354,7 @@ regenA:
answerDfree=false;
answerDlength=tempanswerAlength;
answerD= new char [answerDlength];
for (int c=0; c<answerDlength; c++){
answerD[c]=tempanswerA[c];
}
@@ -374,7 +374,7 @@ regenB:
answerAfree=false;
answerAlength=tempanswerBlength;
answerA= new char [answerAlength];
for (int c=0; c<answerAlength; c++){
answerA[c]=tempanswerB[c];
}
@@ -390,7 +390,7 @@ regenB:
answerBfree=false;
answerBlength=tempanswerBlength;
answerB= new char [answerBlength];
for (int c=0; c<answerBlength; c++){
answerB[c]=tempanswerB[c];
}
@@ -406,7 +406,7 @@ regenB:
answerCfree=false;
answerClength=tempanswerBlength;
answerC= new char [answerClength];
for (int c=0; c<answerClength; c++){
answerC[c]=tempanswerB[c];
}
@@ -422,7 +422,7 @@ regenB:
answerDfree=false;
answerDlength=tempanswerBlength;
answerD= new char [answerDlength];
for (int c=0; c<answerDlength; c++){
answerD[c]=tempanswerB[c];
}
@@ -442,7 +442,7 @@ regenC:
answerAfree=false;
answerAlength=tempanswerClength;
answerA= new char [answerAlength];
for (int c=0; c<answerAlength; c++){
answerA[c]=tempanswerC[c];
}
@@ -458,7 +458,7 @@ regenC:
answerBfree=false;
answerBlength=tempanswerClength;
answerB= new char [answerBlength];
for (int c=0; c<answerBlength; c++){
answerB[c]=tempanswerC[c];
}
@@ -474,7 +474,7 @@ regenC:
answerCfree=false;
answerClength=tempanswerClength;
answerC= new char [answerClength];
for (int c=0; c<answerClength; c++){
answerC[c]=tempanswerC[c];
}
@@ -490,7 +490,7 @@ regenC:
answerDfree=false;
answerDlength=tempanswerClength;
answerD= new char [answerDlength];
for (int c=0; c<answerDlength; c++){
answerD[c]=tempanswerC[c];
}
@@ -510,7 +510,7 @@ regenD:
answerAfree=false;
answerAlength=tempanswerDlength;
answerA= new char [answerAlength];
for (int c=0; c<answerAlength; c++){
answerA[c]=tempanswerD[c];
}
@@ -526,7 +526,7 @@ regenD:
answerBfree=false;
answerBlength=tempanswerDlength;
answerB= new char [answerBlength];
for (int c=0; c<answerBlength; c++){
answerB[c]=tempanswerD[c];
}
@@ -542,7 +542,7 @@ regenD:
answerCfree=false;
answerClength=tempanswerDlength;
answerC= new char [answerClength];
for (int c=0; c<answerClength; c++){
answerC[c]=tempanswerD[c];
}
@@ -558,7 +558,7 @@ regenD:
answerDfree=false;
answerDlength=tempanswerDlength;
answerD= new char [answerDlength];
for (int c=0; c<answerDlength; c++){
answerD[c]=tempanswerD[c];
}
@@ -585,7 +585,7 @@ void draw_window(void){ //
kos_WindowRedrawStatus(1);
kos_DefineAndDrawWindow(10,10,619,179+kos_GetSkinHeight(),0x74, 0xDDDDFF, 0,0, (Dword)header);
kos_WindowRedrawStatus(2);
kos_ProcessInfo( &sPI );
if (sPI.rawData[70]&0x04) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê
@@ -593,9 +593,9 @@ void draw_window(void){ //
if (status==0){ //Ìåíþ
kos_DrawBar(0,0,610,175,0xFFFFBB);
kos_WriteTextToWindow (10,10,0x80,0x000000, "Šâ® å®ç¥â ¡ëâì ¬¨««¨®­¥à®¬?", 3);
kos_WriteTextToWindow (10,25,0x80,0x000000, sVersion, 3);
kos_WriteTextToWindow (10,70,0x80,0x770000, "<ENTER> - ­ ç âì ¨£àã", 0);
kos_WriteTextToWindow (10,85,0x80,0x770000, "<ESC> - ¢ë室", 0);
@@ -607,7 +607,7 @@ void draw_window(void){ //
kos_DrawBar(0,0,610,175,0xEEEEFF);
kos_WriteTextToWindow (10,10,0x0,0x000000, question, questionlength-1);
if (drawA==true){
kos_WriteTextToWindow (10,40,0x80,0x000000, "A. ", 0);
kos_WriteTextToWindow (30,40,0x0,0x000000, answerA, answerAlength-1);
@@ -637,12 +637,12 @@ void draw_window(void){ //
kos_WriteTextToWindow (500,150,0x80,0x000000, summs[currentquestion-1], 0);
}
if (status==2){ //Îêíî "Ýòî - ïðàâèëüíûé îòâåò"
kos_DrawBar(0,0,610,175,0xDDFFDD);
kos_WriteTextToWindow (10,10,0x80,0x000000, "„ , íâ® ¯à ¢¨«ì­ë© ®â¢¥â!", 0);
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - ¯à®¤®«¦¨âì", 0);
}
if (status==3){ //Âû âûèãðàëè ìèëëèîí, îäíàêî æ!!!
@@ -683,7 +683,7 @@ void draw_window(void){ //
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - ¯à®¤®«¦¨âì", 0);
}
@@ -696,7 +696,7 @@ void draw_window(void){ //
if (status==-1){ //Âû îøèáëèñü :-(
kos_DrawBar(0,0,610,175,0xFF8888);
kos_WriteTextToWindow (10,10,0x80,0x000000, "Š á®¦ «¥­¨î, ¢ë ®è¨¡«¨áì... <20>à ¢¨«ì­ë© ®â¢¥â -", 0);
switch (correctanswer){
case 0x01:
kos_WriteTextToWindow (10,25,0x80,0x000000, "A. ", 0);
@@ -716,7 +716,7 @@ void draw_window(void){ //
break;
}
kos_WriteTextToWindow (10,50,0x80,0x000000, " १ã«ìâ â¥ ¢ë ¢ë¨£à «¨:", 0);
if (currentquestion<6) {kos_WriteTextToWindow (220,50,0x80,0x000000,summs[0], 0);}
if ((currentquestion>5)&&(currentquestion<11)) {kos_WriteTextToWindow (220,50,0x80,0x000000,summs[5], 0);}
if (currentquestion>10) {kos_WriteTextToWindow (220,50,0x80,0x000000,summs[10], 0);}
@@ -733,9 +733,9 @@ void draw_window(void){ //
void call_friend(){
int tmpcodee;
recode5:
tmpcodee =(rtlRand()%10)+1;
tmpcodee =(rtlRand()%10)+1;
int tmpbyte;
if (currentquestion < 6 ){
@@ -747,7 +747,7 @@ void call_friend(){
}
else //Äðóã ãîâîðèò íàóãàä
{
int tmpbyte2=0;
recode51:
int tmpcodee2=(rtlRand()%4)+1;
@@ -779,7 +779,7 @@ void call_friend(){
}
else //Äðóã ãîâîðèò íàóãàä
{
int tmpbyte2=0;
recode52:
int tmpcodee2=(rtlRand()%4)+1;
@@ -917,7 +917,7 @@ void call_zal(){ //
zalA=100-zalD;
}
}
if ((drawB==true)&&(drawC==true)){
if (correctanswer==0x02){
zalB=maxpercent;
@@ -940,7 +940,7 @@ void call_zal(){ //
zalB=100-zalD;
}
}
if ((drawC==true)&&(drawD==true)){
if (correctanswer==0x03){
zalC=maxpercent;
@@ -1005,7 +1005,7 @@ void kos_Main(){
drawB = true;
drawC = true;
drawD = true;
draw_window();
}
}
@@ -1023,8 +1023,8 @@ void kos_Main(){
drawB = true;
drawC = true;
drawD = true;
draw_window();
draw_window();
}
}
if (drawC==true){
@@ -1040,8 +1040,8 @@ void kos_Main(){
drawB = true;
drawC = true;
drawD = true;
draw_window();
draw_window();
}
}
if (drawD==true){
@@ -1057,11 +1057,11 @@ void kos_Main(){
drawB = true;
drawC = true;
drawD = true;
draw_window();
}
}
if (callfriendavailable==true){ //Ðåàëèçàöèÿ ïîäñêàçêè "Çâîíîê äðóãó"
if (keyCode==56){
callfriendavailable=false;
@@ -1082,17 +1082,17 @@ void kos_Main(){
if (na50available==true){ //Ðåàëèçàöèÿ ïîäñêàçêè "50 íà 50"
if (keyCode==55){
if (correctanswer==0x01){
drawA=true;
int tmpcodee;
recode1:
tmpcodee =(rtlRand()%3)+1;
tmpcodee =(rtlRand()%3)+1;
int tmpbyte;
switch(tmpcodee){
case 1:
drawB=true;
@@ -1107,19 +1107,19 @@ void kos_Main(){
drawB=false;
drawC=false;
drawD=true;
}
}
if (correctanswer==0x02){
drawB=true;
int tmpcodee;
recode2:
tmpcodee =(rtlRand()%3)+1;
tmpcodee =(rtlRand()%3)+1;
int tmpbyte;
switch(tmpcodee){
case 1:
@@ -1135,18 +1135,18 @@ void kos_Main(){
drawA=false;
drawC=false;
drawD=true;
}
}
if (correctanswer==0x03){
drawC=true;
int tmpcodee;
recode3:
tmpcodee =(rtlRand()%3)+1;
tmpcodee =(rtlRand()%3)+1;
int tmpbyte;
switch(tmpcodee){
case 1:
@@ -1162,19 +1162,19 @@ void kos_Main(){
drawB=false;
drawA=false;
drawD=true;
}
}
if (correctanswer==0x04){
drawA=true;
int tmpcodee;
recode4:
tmpcodee =(rtlRand()%3)+1;
tmpcodee =(rtlRand()%3)+1;
int tmpbyte;
switch(tmpcodee){
case 1:
@@ -1190,7 +1190,7 @@ void kos_Main(){
drawB=false;
drawC=false;
drawA=true;
}
}
na50available=false;

View File

@@ -1,12 +1,12 @@
Автор: Mario79
xx.01.2006 - набор статьи
20.03.2006 - публикация статьи
Автор: Mario79
xx.01.2006 - набор статьи
20.03.2006 - публикация статьи
23.03.2006 - исправление и дополнение статьи
26.02.2007 - переработано и дополнено в связи с изменившимися реалиями
Загрузка КолибриОС с USB Flash Drive
На сегодняшний день КолибриОС не имеет поддержки USB устройств на уровне самой системы, по этой причине для запуска с USB Flash накопителей приходится идти на определенные хитрости.
Существует 2 известных способа запустить КолибриОС с «флешки».
Загрузка ОС Колибри с USB Flash Drive
На сегодняшний день ОС Колибри не имеет поддержки USB устройств на уровне самой системы, по этой причине для запуска с USB Flash накопителей приходится идти на определенные хитрости.
Существует 2 известных способа запустить ОС Колибри с «флешки».
1) Эмуляция флоппи диска в BIOS.
Метод прост до тупости на «флешку» записывается IMG образ, с полной эмуляцией, то есть 0 сектор IMG образа становится 0 сектором «флешки», и так далее пока все сектора образа не будут скопированы на накопитель. Из недостатков этого способа сразу можно заметить потерю рабочего пространства выше 1,44 Мб. Особенно обидным это является для накопителей, емкость которых намного превышает этот размер.
@@ -23,7 +23,7 @@ xx.01.2006 -
Поскольку на данный момент Колибри не является полностью самостоятельной ОС, то повсеместно она применяется параллельно с другими ОС. Эта ситуация привела к тому, что собственного независимого загрузчика (если не считать флоппи диски) у Колибри фактически нет.
На сегодняшний день остались актуальными только 2 загрузчика: meosload.com и mtldr.
Оба могут запускаться из среды DOS.
Установка КолибриОС на флешку в моем варианте начинается с установки DOS на флешку, как первичной системой, из-под которой будут запущены загрузчики КолибриОС. Конечно, в этом случае с точки зрения лицензии лучше использовать полные аналоги DOS, которые имеют свободную лицензию на использование, но не в этом суть, так что не будем отвлекаться на мелочи.
Установка Колибри на флешку в моем варианте начинается с установки DOS на флешку, как первичной системой, из-под которой будут запущены загрузчики Колибри. Конечно, в этом случае с точки зрения лицензии лучше использовать полные аналоги DOS, которые имеют свободную лицензию на использование, но не в этом суть, так что не будем отвлекаться на мелочи.
Установить DOS на «флешку» можно несколькими способами:
а) ОС Windows при форматировании флешки выбрать пункт скопировать системные файлы, в общем, то же самое что и для флоппи дискеты. К сожалению, этот метод подходит только для линейки 9х, на 2К не проверял, но в ХР этот пункт недоступен.
@@ -54,4 +54,4 @@ xx.01.2006 -
P.S.
1) Хочу выразить большую признательность за помощь в подготовке материала Андрею (NoName), Эдуарду (DoomEdArchangel) и Сергею (Serge).
2) В архиве с этим файлом содержаться упомянутые в тексте enable.exe и meosload.com и их исходные коды.
2) В архиве с этим файлом содержаться упомянутые в тексте enable.exe и meosload.com и их исходные коды.

View File

@@ -1,12 +1,12 @@
€¢â®à: Mario79
xx.01.2006 - ­ ¡®à áâ âì¨
20.03.2006 - ¯ã¡«¨ª æ¨ï áâ âì¨
€¢â®à: Mario79
xx.01.2006 - ­ ¡®à áâ âì¨
20.03.2006 - ¯ã¡«¨ª æ¨ï áâ âì¨
23.03.2006 - ¨á¯à ¢«¥­¨¥ ¨ ¤®¯®«­¥­¨¥ áâ âì¨
26.02.2007 - ¯¥à¥à ¡®â ­® ¨ ¤®¯®«­¥­® ¢ á¢ï§¨ á ¨§¬¥­¨¢è¨¬¨áï ॠ«¨ï¬¨
‡ £à㧪  Š®«¨¡à¨Ž‘ á USB Flash Drive
<EFBFBD>  ᥣ®¤­ïè­¨© ¤¥­ì Š®«¨¡à¨Ž‘ ­¥ ¨¬¥¥â ¯®¤¤¥à¦ª¨ USB ãáâனá⢠­  ã஢­¥ á ¬®© á¨á⥬ë, ¯® í⮩ ¯à¨ç¨­¥ ¤«ï § ¯ã᪠ á USB Flash ­ ª®¯¨â¥«¥© ¯à¨å®¤¨âáï ¨¤â¨ ­  ®¯à¥¤¥«¥­­ë¥ å¨âà®áâ¨.
‘ãé¥áâ¢ã¥â 2 ¨§¢¥áâ­ëå ᯮᮡ  § ¯ãáâ¨âì Š®«¨¡à¨Ž‘ á «ä«¥èª¨».
‡ £à㧪  Ž‘ Š®«¨¡à¨ á USB Flash Drive
<EFBFBD>  ᥣ®¤­ïè­¨© ¤¥­ì Ž‘ Š®«¨¡à¨ ­¥ ¨¬¥¥â ¯®¤¤¥à¦ª¨ USB ãáâனá⢠­  ã஢­¥ á ¬®© á¨á⥬ë, ¯® í⮩ ¯à¨ç¨­¥ ¤«ï § ¯ã᪠ á USB Flash ­ ª®¯¨â¥«¥© ¯à¨å®¤¨âáï ¨¤â¨ ­  ®¯à¥¤¥«¥­­ë¥ å¨âà®áâ¨.
‘ãé¥áâ¢ã¥â 2 ¨§¢¥áâ­ëå ᯮᮡ  § ¯ãáâ¨âì Ž‘ Š®«¨¡à¨ á «ä«¥èª¨».
1) <20>¬ã«ïæ¨ï ä«®¯¯¨ ¤¨áª  ¢ BIOS.
Œ¥â®¤ ¯à®áâ ¤® â㯮á⨠­  «ä«¥èªã» § ¯¨á뢠¥âáï IMG ®¡à §, á ¯®«­®© í¬ã«ï樥©, â® ¥áâì 0 ᥪâ®à IMG ®¡à §  áâ ­®¢¨âáï 0 ᥪâ®à®¬ «ä«¥èª¨», ¨ â ª ¤ «¥¥ ¯®ª  ¢á¥ ᥪâ®à  ®¡à §  ­¥ ¡ã¤ãâ ᪮¯¨à®¢ ­ë ­  ­ ª®¯¨â¥«ì. ˆ§ ­¥¤®áâ âª®¢ í⮣® ᯮᮡ  áà §ã ¬®¦­® § ¬¥â¨âì ¯®â¥àî à ¡®ç¥£® ¯à®áâà ­á⢠ ¢ëè¥ 1,44 Œ¡. Žá®¡¥­­® ®¡¨¤­ë¬ í⮠ï¥âáï ¤«ï ­ ª®¯¨â¥«¥©, ¥¬ª®áâì ª®â®àëå ­ ¬­®£® ¯à¥¢ëè ¥â íâ®â à §¬¥à.
@@ -23,7 +23,7 @@ xx.01.2006 -
<EFBFBD>®áª®«ìªã ­  ¤ ­­ë© ¬®¬¥­â Š®«¨¡à¨ ­¥ ï¥âáï ¯®«­®áâìî á ¬®áâ®ï⥫쭮© Ž‘, â® ¯®¢á¥¬¥áâ­® ®­  ¯à¨¬¥­ï¥âáï ¯ à ««¥«ì­® á ¤à㣨¬¨ Ž‘. <20>â  á¨âã æ¨ï ¯à¨¢¥«  ª ⮬ã, ç⮠ᮡá⢥­­®£® ­¥§ ¢¨á¨¬®£® § £àã§ç¨ª  (¥á«¨ ­¥ áç¨â âì ä«®¯¯¨ ¤¨áª¨) ã Š®«¨¡à¨ ä ªâ¨ç¥áª¨ ­¥â.
<EFBFBD>  ᥣ®¤­ïè­¨© ¤¥­ì ®áâ «¨áì  ªâã «ì­ë¬¨ ⮫쪮 2 § £àã§ç¨ª : meosload.com ¨ mtldr.
Ž¡  ¬®£ãâ § ¯ã᪠âìáï ¨§ á।ë DOS.
“áâ ­®¢ª  Š®«¨¡à¨Ž‘ ­  ä«¥èªã ¢ ¬®¥¬ ¢ à¨ ­â¥ ­ ç¨­ ¥âáï á ãáâ ­®¢ª¨ DOS ­  ä«¥èªã, ª ª ¯¥à¢¨ç­®© á¨á⥬®©, ¨§-¯®¤ ª®â®à®© ¡ã¤ãâ § ¯ãé¥­ë § £àã§ç¨ª¨ Š®«¨¡à¨Ž‘. Š®­¥ç­®, ¢ í⮬ á«ãç ¥ á â®çª¨ §à¥­¨ï «¨æ¥­§¨¨ «ãçè¥ ¨á¯®«ì§®¢ âì ¯®«­ë¥  ­ «®£¨ DOS, ª®â®àë¥ ¨¬¥îâ ᢮¡®¤­ãî «¨æ¥­§¨î ­  ¨á¯®«ì§®¢ ­¨¥, ­® ­¥ ¢ í⮬ áãâì, â ª çâ® ­¥ ¡ã¤¥¬ ®â¢«¥ª âìáï ­  ¬¥«®ç¨.
“áâ ­®¢ª  Š®«¨¡à¨ ­  ä«¥èªã ¢ ¬®¥¬ ¢ à¨ ­â¥ ­ ç¨­ ¥âáï á ãáâ ­®¢ª¨ DOS ­  ä«¥èªã, ª ª ¯¥à¢¨ç­®© á¨á⥬®©, ¨§-¯®¤ ª®â®à®© ¡ã¤ãâ § ¯ãé¥­ë § £àã§ç¨ª¨ Š®«¨¡à¨. Š®­¥ç­®, ¢ í⮬ á«ãç ¥ á â®çª¨ §à¥­¨ï «¨æ¥­§¨¨ «ãçè¥ ¨á¯®«ì§®¢ âì ¯®«­ë¥  ­ «®£¨ DOS, ª®â®àë¥ ¨¬¥îâ ᢮¡®¤­ãî «¨æ¥­§¨î ­  ¨á¯®«ì§®¢ ­¨¥, ­® ­¥ ¢ í⮬ áãâì, â ª çâ® ­¥ ¡ã¤¥¬ ®â¢«¥ª âìáï ­  ¬¥«®ç¨.
“áâ ­®¢¨âì DOS ­  «ä«¥èªã» ¬®¦­® ­¥áª®«ìª¨¬¨ ᯮᮡ ¬¨:
 ) Ž‘ Windows ¯à¨ ä®à¬ â¨à®¢ ­¨¨ 䫥誨 ¢ë¡à âì ¯ã­ªâ ᪮¯¨à®¢ âì á¨á⥬­ë¥ ä ©«ë, ¢ ®¡é¥¬, â® ¦¥ á ¬®¥ çâ® ¨ ¤«ï ä«®¯¯¨ ¤¨áª¥âë. Š á®¦ «¥­¨î, íâ®â ¬¥â®¤ ¯®¤å®¤¨â ⮫쪮 ¤«ï «¨­¥©ª¨ 9å, ­  2Š ­¥ ¯à®¢¥àï«, ­® ¢ •<> íâ®â ¯ã­ªâ ­¥¤®áâ㯥­.
@@ -54,4 +54,4 @@ xx.01.2006 -
P.S.
1) •®çã ¢ëà §¨âì ¡®«ìèãî ¯à¨§­ â¥«ì­®áâì §  ¯®¬®éì ¢ ¯®¤£®â®¢ª¥ ¬ â¥à¨ «  €­¤à¥î (NoName), <20>¤ã à¤ã (DoomEdArchangel) ¨ ‘¥à£¥î (Serge).
2)  à娢¥ á í⨬ ä ©«®¬ ᮤ¥à¦ âìáï 㯮¬ï­ãâë¥ ¢ ⥪á⥠enable.exe ¨ meosload.com ¨ ¨å ¨á室­ë¥ ª®¤ë.
2)  à娢¥ á í⨬ ä ©«®¬ ᮤ¥à¦ âìáï 㯮¬ï­ãâë¥ ¢ ⥪á⥠enable.exe ¨ meosload.com ¨ ¨å ¨á室­ë¥ ª®¤ë.

View File

@@ -1,5 +1,7 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
tup.rule("keymap.asm", FASM .. " %f %o", "piano.map")
tup.rule("piano.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")
add_include(tup.getvariantdir())
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
tup.rule({"piano.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "piano")

View File

@@ -0,0 +1,4 @@
@echo lang fix en_US >lang.inc
@fasm piano.asm piano
@erase lang.inc
@pause

View File

@@ -1,79 +0,0 @@
; SPDX-License-Identifier: GPL-2.0-only
;
; Piano - Default Keymap (256 bytes)
; Copyright (C) 2025 KolibriOS team
;
; Contributor Burer - Main code
; Contributor Doczom - Idea
; ====================================================================
format binary as ""
org 0
; ====================================================================
BAD_NOTE = 0xFF
; ====================================================================
keymap:
db BAD_NOTE ; 0x00
db BAD_NOTE ; 0x01
db 0x21 ; 0x02 '1' -> note 0x31
db 0x22 ; 0x03 '2' -> note 0x32
db 0x23 ; 0x04 '3' -> note 0x33
db 0x24 ; 0x05 '4' -> note 0x34
db 0x25 ; 0x06 '5' -> note 0x35
db 0x26 ; 0x07 '6' -> note 0x36
db 0x27 ; 0x08 '7' -> note 0x37
db 0x28 ; 0x09 '8' -> note 0x38
db 0x29 ; 0x0A '9' -> note 0x39
db 0x2A ; 0x0B '0' -> note 0x3A
db 0x2B ; 0x0C '-' -> note 0x3B
db 0x2C ; 0x0D '=' -> note 0x3C
db 0x1C ; 0x0E Backspace -> note 0x2C
db BAD_NOTE ; 0x0F
db 0x31 ; 0x10 'q' -> note 0x41
db 0x32 ; 0x11 'w' -> note 0x42
db 0x33 ; 0x12 'e' -> note 0x43
db 0x34 ; 0x13 'r' -> note 0x44
db 0x35 ; 0x14 't' -> note 0x45
db 0x36 ; 0x15 'y' -> note 0x46
db 0x37 ; 0x16 'u' -> note 0x47
db 0x38 ; 0x17 'i' -> note 0x48
db 0x39 ; 0x18 'o' -> note 0x49
db 0x3A ; 0x19 'p' -> note 0x4A
db 0x3B ; 0x1A '[' -> note 0x4B
db 0x3C ; 0x1B ']' -> note 0x4C
db 0x0C ; 0x1C Enter -> note 0x1C
db BAD_NOTE ; 0x1D
db 0x01 ; 0x1E 'a' -> note 0x11
db 0x02 ; 0x1F 's' -> note 0x12
db 0x03 ; 0x20 'd' -> note 0x13
db 0x04 ; 0x21 'f' -> note 0x14
db 0x05 ; 0x22 'g' -> note 0x15
db 0x06 ; 0x23 'h' -> note 0x16
db 0x07 ; 0x24 'j' -> note 0x17
db 0x08 ; 0x25 'k' -> note 0x18
db 0x09 ; 0x26 'l' -> note 0x19
db 0x0A ; 0x27 ';' -> note 0x1A
db 0x0B ; 0x28 ''' -> note 0x1B
db BAD_NOTE ; 0x29
db BAD_NOTE ; 0x2A
db 0x1B ; 0x2B '\' -> note 0x2B
db 0x11 ; 0x2C 'z' -> note 0x21
db 0x12 ; 0x2D 'x' -> note 0x22
db 0x13 ; 0x2E 'c' -> note 0x23
db 0x14 ; 0x2F 'v' -> note 0x24
db 0x15 ; 0x30 'b' -> note 0x25
db 0x16 ; 0x31 'n' -> note 0x26
db 0x17 ; 0x32 'm' -> note 0x27
db 0x18 ; 0x33 ',' -> note 0x28
db 0x19 ; 0x34 '.' -> note 0x29
db 0x1A ; 0x35 '/' -> note 0x2A
times 256-($-keymap) db BAD_NOTE

File diff suppressed because it is too large Load Diff

View File

@@ -30,7 +30,7 @@ format binary as "" ; Binary file format without extension
use32 ; Tell compiler to use 32 bit instructions
org 0 ; the base address of code, always 0x0
; ‡àãîëîâîê èñïîëíÿåìîãî ôàéëà ÊîëèáðèÎÑ
; ‡àãîëîâîê èñïîëíÿåìîãî ôàéëà Êîëèáðè ÎÑ
db 'MENUET01'
dd 1
dd START
@@ -1662,7 +1662,7 @@ but_open_dlg:
.end_open:
popad
ret
;äàííûå äëß äèàëîãà îòêðûòèß ôàéëîâ
align 4
OpenDialog_data:
@@ -1684,12 +1684,12 @@ OpenDialog_data:
.y:
.y_size dw 320 ;+52 ; Window y size
.y_start dw 10 ;+54 ; Window Y position
default_dir db '/sys',0 ;äèðåêòîðèß ïî óìîë÷àíèþ
communication_area_name: db 'FFFFFFFF_open_dialog',0
open_dialog_name: db 'opendial',0
communication_area_default_path: db '/sys/File managers/',0
Filter:
dd Filter.end - Filter.1
.1: