Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет nancygold ([info]nancygold)
@ 2024-06-25 22:38:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Настроение: amused
Entry tags:computing

Going further...
During the initialization stage, the game calls function 1600h of the `int 2fh`.

//virtual dos machine interface 0x2F:0x1600 interrupt results
#define VDM_NONE      0
#define VDM_OTHER_VM  0x01
#define VDM_SYSTEM_VM 0xFF
#define VDM_HIMEM_SYS 0x80
#define NO_VDM(r) ((r)==VDM_NONE || (r) == VDM_HIMEM_SYS)
uint8_t vdm_query() {
  asm {
    mov ax, 0x1600
    int 0x2f
    xor ah, ah
  }
  return _AL;
}



That interrupt is very special, and the function 1600h is even more special.
Basically the game checks for the presence of Windows 3.1, and configures the PC Speaker accordingly
https://www.geoffchappell.com/notes/dos/interrupts/2Fh/16h/00h.htm

Here is another gem...
//again, crufty code with '}' repeating two times...
//BTW, Borland C++ 3.0 ctype.h had isprint(c)
byte is_printable(char *buf, char c) {
  UNUSED(buf);
  return isalnum(c) || c == ':' || c == '.' || c == '\\' || c == '}' || c == '!'
    || c == '@' || c == '#' || c == '$' || c == '%' || c == '^' || c == '&'
    || c == '(' || c == ')' || c == '-' || c == '_' || c == '{' || c == '}'
    || c == '~' || c == '`';
}


(Добавить комментарий)


(Анонимно)
2024-06-26 19:30 (ссылка)
Do you have autism spectrum disorder?

(Ответить) (Ветвь дискуссии)


[info]nancygold
2024-06-26 23:22 (ссылка)
Dutch doctors said I'm completely healthy.

(Ответить) (Уровень выше) (Ветвь дискуссии)


(Анонимно)
2024-06-27 16:58 (ссылка)
Oh, they must be right then

(Ответить) (Уровень выше)