From 57be510056c5c40cb7276ceb8c904a76057cda9a Mon Sep 17 00:00:00 2001 From: nmlgc Date: Thu, 14 May 2020 20:52:40 +0200 Subject: [PATCH] [Decompilation] [th01] High score menu: Initial table rendering With ternary operator expressions straight out of Jigoku. (TL note: Jigoku means hell.) Nice to see that Turbo C++ apparently has no nesting limit on function call inlining in general, though! Part of P0092, funded by Yanga. --- Research/Borland C++ decompilation.md | 23 + th01/fuuin_02.cpp | 6 +- th01/hiscore/alph_p_i.cpp | 98 ---- th01/hiscore/alphabet_initial[data].asm | 18 - th01/hiscore/hiscore[bss].asm | 6 +- th01/hiscore/regist.cpp | 272 +++++++++++ th01/hiscore/regist[data].asm | 46 ++ th01/hiscore/scoredat.hpp | 15 + th01/main_19.cpp | 9 +- th01_fuuin.asm | 604 +----------------------- th01_reiiden.asm | 394 +--------------- 11 files changed, 402 insertions(+), 1089 deletions(-) delete mode 100644 th01/hiscore/alph_p_i.cpp delete mode 100644 th01/hiscore/alphabet_initial[data].asm create mode 100644 th01/hiscore/regist.cpp create mode 100644 th01/hiscore/regist[data].asm diff --git a/Research/Borland C++ decompilation.md b/Research/Borland C++ decompilation.md index c80ff860..a02a14ef 100644 --- a/Research/Borland C++ decompilation.md +++ b/Research/Borland C++ decompilation.md @@ -79,6 +79,29 @@ certain local variables as `word`s when they aren't. ## Flags +### `-3` (80386 Instructions) + `-Z` (Suppress register reloads) + +Bundles two consecutive 16-bit function parameters into a single 32-bit one, +passed via a single 32-bit `PUSH`. Currently confirmed to happen for literals +and structure members whose memory layout matches the parameter list and +calling convention. Signedness doesn't matter. + +```c +// Works for all storage durations +struct { int x, y; } p; +struct { unsigned int x, y; } q; + +void __cdecl foo_s(int x, int y); +void __cdecl foo_u(unsigned int x, unsigned int y); + +foo_s(640, 400); // PUSH LARGE 1900280h +foo_u(640, 400); // PUSH LARGE 1900280h +foo_s(p.x, p.y); // PUSH LARGE [p] +foo_u(p.x, p.y); // PUSH LARGE [p] +foo_s(q.x, q.y); // PUSH LARGE [p] +foo_u(q.x, q.y); // PUSH LARGE [p] +``` + ### `-O` (Optimize jumps) Also merges multiple `ADD SP, imm8` stack-clearing instructions after diff --git a/th01/fuuin_02.cpp b/th01/fuuin_02.cpp index 4374df62..d226f639 100644 --- a/th01/fuuin_02.cpp +++ b/th01/fuuin_02.cpp @@ -82,6 +82,10 @@ extern const char FOPEN_WB[]; ALPHABET_KANJI_FMT_##fmt_instance, kanji >> 8, kanji & 0xFF \ ) -#include "th01/hiscore/alph_p_i.cpp" +#define regist_route_put(left, top, fx, char_1, char_2) \ + extern const char REGIST_ROUTE_FMT[]; \ + graph_printf_fx(left, top, fx, REGIST_ROUTE_FMT, char_1, char_2); + +#include "th01/hiscore/regist.cpp" } diff --git a/th01/hiscore/alph_p_i.cpp b/th01/hiscore/alph_p_i.cpp deleted file mode 100644 index 5cea62eb..00000000 --- a/th01/hiscore/alph_p_i.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#define COL_SELECTED 3 -#define COL_REGULAR 7 - -#define ALPHABET_TOP 240 -#define MARGIN_W 32 -#define KANJI_PADDING_X 16 -#define KANJI_PADDING_Y 8 - -#define KANJI_PADDED_W (GLYPH_FULL_W + KANJI_PADDING_X) -#define KANJI_PADDED_H (GLYPH_H + KANJI_PADDING_Y) - -#define KANJI_PER_ROW \ - ((RES_X - (MARGIN_W * 2)) / KANJI_PADDED_W) - -#define relative_top(row) \ - ((row) * KANJI_PADDED_H) - -inline int relative_top_for(int kanji_id) -{ - return relative_top(kanji_id / KANJI_PER_ROW); -} - -inline int row_ceil(int count) -{ - return ((count + (KANJI_PER_ROW - 1)) / KANJI_PER_ROW); -} - -inline int left_for(int kanji_id) -{ - return (((kanji_id % KANJI_PER_ROW) * KANJI_PADDED_W) + MARGIN_W); -} - -#define alphabet_putca_fx(top_for_0, i, fx, fmt_instance, kanji) \ - graph_putkanji_fx( \ - left_for(i), (top_for_0 + relative_top_for(i)), fx, fmt_instance, kanji \ - ); - -#define alphabet_putsa_fx(top_for_0, i, fx, str) \ - extern const char str[]; \ - graph_printf_fx(left_for(i), (top_for_0 + relative_top_for(i)), fx, str); - -#define A_TO_Z_COUNT 26 -#define NUM_COUNT 10 -// TODO: Should be derived via `sizeof()` once the array is declared here. -#define SYM_COUNT 18 -extern const uint16_t ALPHABET_SYMS[]; - -// Rows -#define LOWER_TOP (ALPHABET_TOP) -#define UPPER_TOP (LOWER_TOP + relative_top(row_ceil(A_TO_Z_COUNT))) -#define SYM_TOP (UPPER_TOP + relative_top(row_ceil(A_TO_Z_COUNT))) -#define NUM_TOP (SYM_TOP + relative_top(row_ceil(SYM_COUNT))) - -inline uint16_t kanji_swap(uint16_t kanji) -{ - return (kanji << 8) | (kanji >> 8); -} - -void alphabet_put_initial() -{ - int fx = FX(COL_REGULAR, 2, 0); - uint16_t kanji; - int i; -#if (BINARY == 'M') - char kanji_str[3]; -#endif - - kanji = kanji_swap('b'); - for(i = 1; i < A_TO_Z_COUNT; i++) { - alphabet_putca_fx(LOWER_TOP, i, fx, 0, kanji); - kanji++; - } - extern const char ALPHABET_A[]; - graph_putsa_fx( - MARGIN_W, LOWER_TOP, FX_REVERSE | FX(COL_SELECTED, 2, 0), ALPHABET_A - ); - - kanji = kanji_swap('A'); - for(i = 0; i < A_TO_Z_COUNT; i++) { - alphabet_putca_fx(UPPER_TOP, i, fx, 1, kanji); - kanji++; - } - - for(i = 0; i < SYM_COUNT; i++) { - kanji = ALPHABET_SYMS[i]; - alphabet_putca_fx(SYM_TOP, i, fx, 2, kanji); - } - - kanji = kanji_swap('0'); - for(i = 0; i < NUM_COUNT; i++) { - alphabet_putca_fx(NUM_TOP, i, fx, 3, kanji); - kanji++; - } - alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_SPACE); i = (KANJI_PER_ROW - 3); - alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_LEFT); i++; - alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_RIGHT); i++; - alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_ENTER); i++; -} diff --git a/th01/hiscore/alphabet_initial[data].asm b/th01/hiscore/alphabet_initial[data].asm deleted file mode 100644 index 5d01db4b..00000000 --- a/th01/hiscore/alphabet_initial[data].asm +++ /dev/null @@ -1,18 +0,0 @@ -public _ALPHABET_A -public _ALPHABET_SPACE, _ALPHABET_LEFT, _ALPHABET_RIGHT, _ALPHABET_ENTER - -if BINARY eq 'E' - public _ALPHABET_KANJI_FMT_0, _ALPHABET_KANJI_FMT_1 - public _ALPHABET_KANJI_FMT_2, _ALPHABET_KANJI_FMT_3 - _ALPHABET_KANJI_FMT_0 db '%c%c',0 - _ALPHABET_A db 'a',0 - _ALPHABET_KANJI_FMT_1 db '%c%c',0 - _ALPHABET_KANJI_FMT_2 db '%c%c',0 - _ALPHABET_KANJI_FMT_3 db '%c%c',0 -else - _ALPHABET_A db 'a',0 -endif -_ALPHABET_SPACE db 'SP',0 -_ALPHABET_LEFT db '←',0 -_ALPHABET_RIGHT db '→',0 -_ALPHABET_ENTER db '終',0 diff --git a/th01/hiscore/hiscore[bss].asm b/th01/hiscore/hiscore[bss].asm index 94959cf1..fdcea40d 100644 --- a/th01/hiscore/hiscore[bss].asm +++ b/th01/hiscore/hiscore[bss].asm @@ -25,10 +25,10 @@ scoredat_routes_t struc scoredat_routes_t ends public _scoredat_names, _scoredat_routes, _scoredat_stages, _scoredat_points -public _name_entered_left, _name_entered_top +public _entered_name_left, _entered_name_top _scoredat_names dd ? _scoredat_routes dd ? _scoredat_stages dd ? -_name_entered_left dw ? -_name_entered_top dw ? +_entered_name_left dw ? +_entered_name_top dw ? _scoredat_points dd ? diff --git a/th01/hiscore/regist.cpp b/th01/hiscore/regist.cpp new file mode 100644 index 00000000..b0a1c219 --- /dev/null +++ b/th01/hiscore/regist.cpp @@ -0,0 +1,272 @@ +#define COL_SELECTED 3 +#define COL_REGULAR 7 + +/// Table +/// ----- +#define POINT_DIGITS 7 + +#define TABLE_TOP 48 +#define TABLE_ROW_H GLYPH_H +#define TABLE_BODY_TOP (TABLE_TOP + TABLE_ROW_H) + +#define table_row_top(place) (TABLE_BODY_TOP + (place * TABLE_ROW_H)) + +// Recursively defining column positions \o/ +inline int table_left(int x_kanji) { + return 32 + (x_kanji * GLYPH_FULL_W); +} + +inline int table_place_left(int x_kanji) { + return table_left(x_kanji); +} + +inline int table_name_left(int x_kanji) { + return table_place_left(7 + x_kanji); +} + +inline int table_points_left(int x_kanji) { + return table_name_left(SCOREDAT_NAME_KANJI + 5 + x_kanji); +} + +inline int table_stage_route_left(int x_kanji) { + return table_points_left(POINT_DIGITS + 3 + x_kanji); +} + +inline int table_stage_left(int x_kanji) { + return table_stage_route_left(1 + x_kanji); +} + +// Code generation actually prohibits this from being a Point! +extern int entered_name_left; +extern int entered_name_top; +/// ----- + +/// Alphabet +/// -------- +#define ALPHABET_TOP 240 +#define MARGIN_W 32 +#define KANJI_PADDING_X 16 +#define KANJI_PADDING_Y 8 + +#define KANJI_PADDED_W (GLYPH_FULL_W + KANJI_PADDING_X) +#define KANJI_PADDED_H (GLYPH_H + KANJI_PADDING_Y) + +#define KANJI_PER_ROW \ + ((RES_X - (MARGIN_W * 2)) / KANJI_PADDED_W) + +#define relative_top(row) \ + ((row) * KANJI_PADDED_H) + +inline int relative_top_for(int kanji_id) +{ + return relative_top(kanji_id / KANJI_PER_ROW); +} + +inline int row_ceil(int count) +{ + return ((count + (KANJI_PER_ROW - 1)) / KANJI_PER_ROW); +} + +inline int left_for(int kanji_id) +{ + return (((kanji_id % KANJI_PER_ROW) * KANJI_PADDED_W) + MARGIN_W); +} + +#define alphabet_putca_fx(top_for_0, i, fx, fmt_instance, kanji) \ + graph_putkanji_fx( \ + left_for(i), (top_for_0 + relative_top_for(i)), fx, fmt_instance, kanji \ + ); + +#define alphabet_putsa_fx(top_for_0, i, fx, str) \ + extern const char str[]; \ + graph_printf_fx(left_for(i), (top_for_0 + relative_top_for(i)), fx, str); + +#define A_TO_Z_COUNT 26 +#define NUM_COUNT 10 +// TODO: Should be derived via `sizeof()` once the array is declared here. +#define SYM_COUNT 18 +extern const uint16_t ALPHABET_SYMS[]; + +// Rows +#define LOWER_TOP (ALPHABET_TOP) +#define UPPER_TOP (LOWER_TOP + relative_top(row_ceil(A_TO_Z_COUNT))) +#define SYM_TOP (UPPER_TOP + relative_top(row_ceil(A_TO_Z_COUNT))) +#define NUM_TOP (SYM_TOP + relative_top(row_ceil(SYM_COUNT))) + +inline uint16_t kanji_swap(uint16_t kanji) +{ + return (kanji << 8) | (kanji >> 8); +} +/// -------- + +void alphabet_put_initial() +{ + int fx = FX(COL_REGULAR, 2, 0); + uint16_t kanji; + int i; +#if (BINARY == 'M') + char kanji_str[3]; +#endif + + kanji = kanji_swap('b'); + for(i = 1; i < A_TO_Z_COUNT; i++) { + alphabet_putca_fx(LOWER_TOP, i, fx, 0, kanji); + kanji++; + } + extern const char ALPHABET_A[]; + graph_putsa_fx( + MARGIN_W, LOWER_TOP, FX_REVERSE | FX(COL_SELECTED, 2, 0), ALPHABET_A + ); + + kanji = kanji_swap('A'); + for(i = 0; i < A_TO_Z_COUNT; i++) { + alphabet_putca_fx(UPPER_TOP, i, fx, 1, kanji); + kanji++; + } + + for(i = 0; i < SYM_COUNT; i++) { + kanji = ALPHABET_SYMS[i]; + alphabet_putca_fx(SYM_TOP, i, fx, 2, kanji); + } + + kanji = kanji_swap('0'); + for(i = 0; i < NUM_COUNT; i++) { + alphabet_putca_fx(NUM_TOP, i, fx, 3, kanji); + kanji++; + } + alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_SPACE); i = (KANJI_PER_ROW - 3); + alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_LEFT); i++; + alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_RIGHT); i++; + alphabet_putsa_fx(NUM_TOP, i, fx, ALPHABET_ENTER); i++; +} + +inline void header_cell_put(int left, const char str[]) +{ + graph_putsa_fx(left, TABLE_TOP, FX(COL_SELECTED, 3, 0), str); +} + +#define place_cell_put(top, fx, str) \ + graph_putsa_fx(table_place_left(0), top, fx, str) + +void regist_put_initial( + int entered_place, + long entered_points, + int entered_stage, + const char entered_route[SCOREDAT_ROUTE_LEN + 1], + const scoredat_name_z_t names_z[SCOREDAT_PLACES] +) +{ + struct hack { + unsigned char byte[SCOREDAT_NAME_BYTES + 1]; + }; + extern const hack REGIST_NAME_BLANK; + extern const char REGIST_HEADER_PLACE[]; + extern const char REGIST_HEADER_NAME[]; + extern const char REGIST_HEADER_POINTS[]; + extern const char REGIST_HEADER_STAGE_ROUTE[]; + extern const char REGIST_PLACE_0[]; + extern const char REGIST_PLACE_1[]; + extern const char REGIST_PLACE_2[]; + extern const char REGIST_PLACE_3[]; + extern const char REGIST_PLACE_4[]; + extern const char REGIST_PLACE_5[]; + extern const char REGIST_PLACE_6[]; + extern const char REGIST_PLACE_7[]; + extern const char REGIST_PLACE_8[]; + extern const char REGIST_PLACE_9[]; + extern const char REGIST_STAGE_MAKAI[]; + extern const char REGIST_STAGE_JIGOKU[]; + extern const char REGIST_STAGE_ROUTE_DASH[]; + + hack name = REGIST_NAME_BLANK; + + graph_accesspage_func(0); + + header_cell_put(table_place_left(0), REGIST_HEADER_PLACE); + header_cell_put(table_name_left(0), REGIST_HEADER_NAME); + header_cell_put(table_points_left(0), REGIST_HEADER_POINTS); + header_cell_put(table_stage_route_left(0), REGIST_HEADER_STAGE_ROUTE); + + for(int i = 0; i < SCOREDAT_PLACES; i++) { + #define stage_expr(i, entered_place, expr) \ + (i != entered_place && scoredat_stages[i] expr) || \ + (i == entered_place && entered_stage expr) + + #define fx_text FX(place_col, 2, 0) + + #if (BINARY == 'E') + # define place_col ((i == entered_place) ? COL_SELECTED : COL_REGULAR) + # define top table_row_top(i) + #else + int place_col = (i == entered_place) ? COL_SELECTED : COL_REGULAR; + int top = table_row_top(i); + #endif + + switch(i) { + case 0: place_cell_put(top, fx_text, REGIST_PLACE_0); break; + case 1: place_cell_put(top, fx_text, REGIST_PLACE_1); break; + case 2: place_cell_put(top, fx_text, REGIST_PLACE_2); break; + case 3: place_cell_put(top, fx_text, REGIST_PLACE_3); break; + case 4: place_cell_put(top, fx_text, REGIST_PLACE_4); break; + case 5: place_cell_put(top, fx_text, REGIST_PLACE_5); break; + case 6: place_cell_put(top, fx_text, REGIST_PLACE_6); break; + case 7: place_cell_put(top, fx_text, REGIST_PLACE_7); break; + case 8: place_cell_put(top, fx_text, REGIST_PLACE_8); break; + case 9: place_cell_put(top, fx_text, REGIST_PLACE_9); break; + } + graph_putsa_fx( + table_name_left(0), + top, + fx_text, + (i == entered_place) ? name.byte : names_z[i].byte + ); + graph_putfwnum_fx( + table_points_left(0), + top, + FX(place_col, 3, 0), + POINT_DIGITS, + (entered_place == i) ? entered_points : scoredat_points[i], + 0, + false + ); + if(stage_expr(i, entered_place, < SCOREDAT_CLEARED)) { + graph_putfwnum_fx( + table_stage_left(0), + top, + fx_text, + 2, + (i == entered_place) ? entered_stage : scoredat_stages[i], + 0, + false + ); + } else if(stage_expr(i, entered_place, == SCOREDAT_CLEARED_MAKAI)) { + graph_putsa_fx( + table_stage_left(0), top, fx_text, REGIST_STAGE_MAKAI + ); + } else if(stage_expr(i, entered_place, == SCOREDAT_CLEARED_JIGOKU)) { + graph_putsa_fx( + table_stage_left(0), top, fx_text, REGIST_STAGE_JIGOKU + ); + } + graph_putsa_fx( + table_stage_left(2), top, fx_text, REGIST_STAGE_ROUTE_DASH + ); + regist_route_put( + table_stage_left(3), + top, + fx_text, + (i == entered_place) + ? entered_route[0] : scoredat_routes[i].byte.lo, + (i == entered_place) + ? entered_route[1] : scoredat_route_byte(i, 1) + ); + if(entered_place == i) { + entered_name_left = table_name_left(0); + entered_name_top = table_row_top(i); + } + #undef top + #undef place_col + #undef fx_text + #undef stage_expr + } +} diff --git a/th01/hiscore/regist[data].asm b/th01/hiscore/regist[data].asm new file mode 100644 index 00000000..fd5a5038 --- /dev/null +++ b/th01/hiscore/regist[data].asm @@ -0,0 +1,46 @@ +public _ALPHABET_A +public _ALPHABET_SPACE, _ALPHABET_LEFT, _ALPHABET_RIGHT, _ALPHABET_ENTER + +if BINARY eq 'E' + public _ALPHABET_KANJI_FMT_0, _ALPHABET_KANJI_FMT_1 + public _ALPHABET_KANJI_FMT_2, _ALPHABET_KANJI_FMT_3 + _ALPHABET_KANJI_FMT_0 db '%c%c',0 + _ALPHABET_A db 'a',0 + _ALPHABET_KANJI_FMT_1 db '%c%c',0 + _ALPHABET_KANJI_FMT_2 db '%c%c',0 + _ALPHABET_KANJI_FMT_3 db '%c%c',0 +else + _ALPHABET_A db 'a',0 +endif +_ALPHABET_SPACE db 'SP',0 +_ALPHABET_LEFT db '←',0 +_ALPHABET_RIGHT db '→',0 +_ALPHABET_ENTER db '終',0 + +public _REGIST_HEADER_PLACE, _REGIST_HEADER_NAME +public _REGIST_HEADER_POINTS, _REGIST_HEADER_STAGE_ROUTE +public _REGIST_PLACE_0, _REGIST_PLACE_1, _REGIST_PLACE_2, _REGIST_PLACE_3 +public _REGIST_PLACE_4, _REGIST_PLACE_5, _REGIST_PLACE_6, _REGIST_PLACE_7 +public _REGIST_PLACE_8, _REGIST_PLACE_9 +public _REGIST_STAGE_MAKAI, _REGIST_STAGE_JIGOKU, _REGIST_STAGE_ROUTE_DASH +_REGIST_HEADER_PLACE db ' 霊 位 ',0 +_REGIST_HEADER_NAME db '  名  前  ',0 +_REGIST_HEADER_POINTS db '  得  点  ',0 +_REGIST_HEADER_STAGE_ROUTE db 'ステージ・ルート',0 +_REGIST_PLACE_0 db ' 靈 神 ',0 +_REGIST_PLACE_1 db '太元帥明王',0 +_REGIST_PLACE_2 db ' 天 仙 ',0 +_REGIST_PLACE_3 db ' 神 仙 ',0 +_REGIST_PLACE_4 db ' 地 仙 ',0 +_REGIST_PLACE_5 db ' 人 仙 ',0 +_REGIST_PLACE_6 db ' 仙 女 ',0 +_REGIST_PLACE_7 db '陰 陽 師',0 +_REGIST_PLACE_8 db '靈 媒 師',0 +_REGIST_PLACE_9 db '修 業 者',0 +_REGIST_STAGE_MAKAI db '魔界',0 +_REGIST_STAGE_JIGOKU db '地獄',0 +_REGIST_STAGE_ROUTE_DASH db '−',0 +if BINARY eq 'E' + public _REGIST_ROUTE_FMT + _REGIST_ROUTE_FMT db '%c%c',0 +endif diff --git a/th01/hiscore/scoredat.hpp b/th01/hiscore/scoredat.hpp index 6ae0d861..428a73f1 100644 --- a/th01/hiscore/scoredat.hpp +++ b/th01/hiscore/scoredat.hpp @@ -4,6 +4,7 @@ // Actually creates slightly different assembly compared to sizeof() on a // int8_t array! #define SCOREDAT_NAME_BYTES (SCOREDAT_NAME_KANJI * 2) +#define SCOREDAT_ROUTE_LEN 2 #define SCOREDAT_CLEARED 40 #define SCOREDAT_CLEARED_MAKAI (SCOREDAT_CLEARED + 10) @@ -44,6 +45,20 @@ inline int8_t& scoredat_name_byte(size_t byte) return reinterpret_cast(scoredat_names)[byte]; } +// Byte-wise access to [scoredat_routes]. +inline int8_t& scoredat_route_byte(int place, int byte) +{ + return reinterpret_cast(scoredat_routes)[ + (place * SCOREDAT_ROUTE_LEN) + byte + ]; +} + +// Null-terminated version of scoredat_name_t, used internally. +union scoredat_name_z_t { + int16_t codepoint[SCOREDAT_NAME_KANJI + 1]; + int8_t byte[SCOREDAT_NAME_BYTES + 1]; +}; + // Loads the score file for the current [rank], recreating it if necessary. // Returns 0 on success, 1 on failure. int scoredat_load(); diff --git a/th01/main_19.cpp b/th01/main_19.cpp index 8cf5905e..7614fd39 100644 --- a/th01/main_19.cpp +++ b/th01/main_19.cpp @@ -46,6 +46,13 @@ void pascal near str_from_kanji(char str[3], uint16_t kanji) graph_putsa_fx(left, top, fx, kanji_str); #define graph_printf_fx graph_putsa_fx -#include "th01/hiscore/alph_p_i.cpp" +#define regist_route_put(left, top, fx, char_1, char_2) \ + unsigned char route[sizeof(twobyte_t) + 1]; \ + route[2] = '\0'; \ + route[0] = char_1; \ + route[1] = char_2; \ + graph_putsa_fx(left, top, fx, route); \ + +#include "th01/hiscore/regist.cpp" } diff --git a/th01_fuuin.asm b/th01_fuuin.asm index 5489386c..b26b2040 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -371,13 +371,13 @@ fuuin_01_TEXT ends ; Segment type: Pure code fuuin_02_TEXT segment byte public 'CODE' use16 - extern _graph_putfwnum_fx:proc extern _input_sense:proc extern _input_reset_sense:proc extern _scoredat_name_byte_encode:proc extern _scoredat_load:proc extern _scoredat_name_get:proc extern _alphabet_put_initial:proc + extern _regist_put_initial:proc fuuin_02_TEXT ends fuuin_02__TEXT segment byte public 'CODE' use16 @@ -385,551 +385,6 @@ fuuin_02__TEXT segment byte public 'CODE' use16 ; =============== S U B R O U T I N E ======================================= -; Attributes: bp-based frame -sub_A9FF proc far - -var_12 = byte ptr -12h -arg_0 = word ptr 6 -arg_2 = word ptr 8 -arg_4 = word ptr 0Ah -arg_6 = word ptr 0Ch -arg_8 = dword ptr 0Eh -arg_C = word ptr 12h -arg_E = word ptr 14h - - enter 12h, 0 - push si - push di - mov di, [bp+arg_0] - lea ax, [bp+var_12] - push ss - push ax - push ds - push offset aBqbqbqbqbqbqbq ; "________" - mov cx, 11h - call SCOPY@ - push 0 - call _graph_accesspage_func - pop cx - call _graph_putsa_fx c, 32, 48, 33h, offset aB@cB@iB@, ds ; " 霊 位 " - call _graph_putsa_fx c, 144, 48, 33h, offset aB@b@cB@b@sob@b, ds ; "  名  前  " - call _graph_putsa_fx c, 352, 48, 33h, offset aB@b@uB@b@u_b@b, ds ; "  得  点  " - call _graph_putsa_fx c, 512, 48, 33h, offset aGxgebGwbeglbGg, ds ; "ステージ・ルート" - xor si, si - jmp loc_AD66 -; --------------------------------------------------------------------------- - -loc_AA71: - mov bx, si - cmp bx, 9 - jbe short loc_AA7B - jmp loc_AB4F -; --------------------------------------------------------------------------- - -loc_AA7B: - add bx, bx - jmp cs:off_AD72[bx] - -loc_AA82: - push ds - push offset aB@sB@r_b@ ; " 靈 神 " - cmp si, di - jnz short loc_AA8F - mov ax, 3 - jmp short loc_AA92 -; --------------------------------------------------------------------------- - -loc_AA8F: - mov ax, 7 - -loc_AA92: - jmp loc_AB36 -; --------------------------------------------------------------------------- - -loc_AA95: - push ds - push offset aSMRgcId ; "太元帥明王" - cmp si, di - jnz short loc_AAA2 - mov ax, 3 - jmp short loc_AAA5 -; --------------------------------------------------------------------------- - -loc_AAA2: - mov ax, 7 - -loc_AAA5: - jmp loc_AB36 -; --------------------------------------------------------------------------- - -loc_AAA8: - push ds - push offset aB@uvb@rxb@ ; " 天 仙 " - cmp si, di - jnz short loc_AAB5 - mov ax, 3 - jmp short loc_AAB8 -; --------------------------------------------------------------------------- - -loc_AAB5: - mov ax, 7 - -loc_AAB8: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AABA: - push ds - push offset aB@r_b@rxb@ ; " 神 仙 " - cmp si, di - jnz short loc_AAC7 - mov ax, 3 - jmp short loc_AACA -; --------------------------------------------------------------------------- - -loc_AAC7: - mov ax, 7 - -loc_AACA: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AACC: - push ds - push offset aB@tnb@rxb@ ; " 地 仙 " - cmp si, di - jnz short loc_AAD9 - mov ax, 3 - jmp short loc_AADC -; --------------------------------------------------------------------------- - -loc_AAD9: - mov ax, 7 - -loc_AADC: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AADE: - push ds - push offset aB@rlb@rxb@ ; " 人 仙 " - cmp si, di - jnz short loc_AAEB - mov ax, 3 - jmp short loc_AAEE -; --------------------------------------------------------------------------- - -loc_AAEB: - mov ax, 7 - -loc_AAEE: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AAF0: - push ds - push offset aB@rxb@pcb@ ; " 仙 女 " - cmp si, di - jnz short loc_AAFD - mov ax, 3 - jmp short loc_AB00 -; --------------------------------------------------------------------------- - -loc_AAFD: - mov ax, 7 - -loc_AB00: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AB02: - push ds - push offset aIab@czb@ot ; "陰 陽 師" - cmp si, di - jnz short loc_AB0F - mov ax, 3 - jmp short loc_AB12 -; --------------------------------------------------------------------------- - -loc_AB0F: - mov ax, 7 - -loc_AB12: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AB14: - push ds - push offset aSB@fB@ot ; "靈 媒 師" - cmp si, di - jnz short loc_AB21 - mov ax, 3 - jmp short loc_AB24 -; --------------------------------------------------------------------------- - -loc_AB21: - mov ax, 7 - -loc_AB24: - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AB26: - push ds - push offset aPcb@lB@o ; "修 業 者" - cmp si, di - jnz short loc_AB33 - mov ax, 3 - jmp short loc_AB36 -; --------------------------------------------------------------------------- - -loc_AB33: - mov ax, 7 - -loc_AB36: - or ax, 20h - push ax - mov ax, si - shl ax, 4 - add ax, 64 - push ax - push 32 - call _graph_putsa_fx - add sp, 0Ah - jmp short $+2 - -loc_AB4F: - cmp si, di - jnz short loc_AB5A - mov dx, ss - lea ax, [bp+var_12] - jmp short loc_AB69 -; --------------------------------------------------------------------------- - -loc_AB5A: - mov ax, si - imul ax, 12h - mov dx, [bp+arg_E] - push ax - mov ax, [bp+arg_C] - pop bx - add ax, bx - -loc_AB69: - push dx - push ax - cmp si, di - jnz short loc_AB74 - mov ax, 3 - jmp short loc_AB77 -; --------------------------------------------------------------------------- - -loc_AB74: - mov ax, 7 - -loc_AB77: - or ax, 20h - push ax - mov ax, si - shl ax, 4 - add ax, 64 - push ax - push 144 - call _graph_putsa_fx - add sp, 0Ah - push 0 ; put_leading_zeroes - push 0 ; num_prev (high) - push 0 ; num_prev (low) - cmp di, si - jnz short loc_ABA1 - mov dx, [bp+arg_4] - mov ax, [bp+arg_2] - jmp short loc_ABB3 -; --------------------------------------------------------------------------- - -loc_ABA1: - mov ax, si - shl ax, 2 - les bx, _scoredat_points - add bx, ax - mov dx, es:[bx+2] - mov ax, es:[bx] - -loc_ABB3: - push dx ; num (high) - push ax ; num (low) - push 7 ; digits - cmp si, di - jnz short loc_ABC0 - mov ax, 3 - jmp short loc_ABC3 -; --------------------------------------------------------------------------- - -loc_ABC0: - mov ax, 7 - -loc_ABC3: - or ax, 30h - push ax ; fx - mov ax, si - shl ax, 4 - add ax, 64 - push ax ; top - push 352 ; left - call fuuin_02:_graph_putfwnum_fx - add sp, 12h - cmp si, di - jz short loc_ABEE - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - cmp word ptr es:[bx], SCOREDAT_CLEARED - jl short loc_ABF8 - -loc_ABEE: - cmp si, di - jnz short loc_AC3F - cmp [bp+arg_6], SCOREDAT_CLEARED - jge short loc_AC3F - -loc_ABF8: - push 0 ; put_leading_zeroes - push 0 ; num_prev (high) - push 0 ; num_prev (low) - cmp si, di - jnz short loc_AC07 - mov ax, [bp+arg_6] - jmp short loc_AC14 -; --------------------------------------------------------------------------- - -loc_AC07: - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - mov ax, es:[bx] - -loc_AC14: - cwd - push dx ; num (high) - push ax ; num (low) - push 2 ; digits - cmp si, di - jnz short loc_AC22 - mov ax, 3 - jmp short loc_AC25 -; --------------------------------------------------------------------------- - -loc_AC22: - mov ax, 7 - -loc_AC25: - or ax, 20h - push ax ; fx - mov ax, si - shl ax, 4 - add ax, 64 - push ax ; top - push 528 ; left - call fuuin_02:_graph_putfwnum_fx - add sp, 12h - jmp loc_ACCD -; --------------------------------------------------------------------------- - -loc_AC3F: - cmp si, di - jz short loc_AC53 - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - cmp word ptr es:[bx], SCOREDAT_CLEARED_MAKAI - jz short loc_AC5D - -loc_AC53: - cmp si, di - jnz short loc_AC87 - cmp [bp+arg_6], SCOREDAT_CLEARED_MAKAI - jnz short loc_AC87 - -loc_AC5D: - push ds - push offset aCvke ; "魔界" - cmp si, di - jnz short loc_AC6A - mov ax, 3 - jmp short loc_AC6D -; --------------------------------------------------------------------------- - -loc_AC6A: - mov ax, 7 - -loc_AC6D: - or ax, 20h - push ax - mov ax, si - shl ax, 4 - add ax, 64 - push ax - push 528 - call _graph_putsa_fx - add sp, 0Ah - jmp short loc_ACCD -; --------------------------------------------------------------------------- - -loc_AC87: - cmp si, di - jz short loc_AC9B - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - cmp word ptr es:[bx], SCOREDAT_CLEARED_JIGOKU - jz short loc_ACA5 - -loc_AC9B: - cmp si, di - jnz short loc_ACCD - cmp [bp+arg_6], SCOREDAT_CLEARED_JIGOKU - jnz short loc_ACCD - -loc_ACA5: - push ds - push offset aTnnc ; "地獄" - cmp si, di - jnz short loc_ACB2 - mov ax, 3 - jmp short loc_ACB5 -; --------------------------------------------------------------------------- - -loc_ACB2: - mov ax, 7 - -loc_ACB5: - or ax, 20h - push ax - mov ax, si - shl ax, 4 - add ax, 64 - push ax - push 528 - call _graph_putsa_fx - add sp, 0Ah - -loc_ACCD: - push ds - push offset aB ; "−" - cmp si, di - jnz short loc_ACDA - mov ax, 3 - jmp short loc_ACDD -; --------------------------------------------------------------------------- - -loc_ACDA: - mov ax, 7 - -loc_ACDD: - or ax, 20h - push ax - mov ax, si - shl ax, 4 - add ax, 64 - push ax - push 560 - call _graph_putsa_fx - add sp, 0Ah - cmp si, di - jnz short loc_ACFE - les bx, [bp+arg_8] - jmp short loc_AD0A -; --------------------------------------------------------------------------- - -loc_ACFE: - mov bx, si - add bx, bx - mov es, word ptr _scoredat_routes+2 - add bx, word ptr _scoredat_routes - -loc_AD0A: - mov al, es:[bx+1] - cbw - push ax - cmp si, di - jnz short loc_AD19 - les bx, [bp+arg_8] - jmp short loc_AD23 -; --------------------------------------------------------------------------- - -loc_AD19: - mov ax, si - add ax, ax - les bx, _scoredat_routes - add bx, ax - -loc_AD23: - mov al, es:[bx] - cbw - push ax ; arglist - push ds - push offset aCC_3 ; "%c%c" - cmp si, di - jnz short loc_AD35 - mov ax, 3 - jmp short loc_AD38 -; --------------------------------------------------------------------------- - -loc_AD35: - mov ax, 7 - -loc_AD38: - or ax, 20h - push ax ; int - mov ax, si - shl ax, 4 - add ax, 40h - push ax ; int - push 240h ; int - call _graph_printf_fx - add sp, 0Eh - cmp di, si - jnz short loc_AD65 - mov _name_entered_left, 144 - mov ax, si - shl ax, 4 - add ax, 64 - mov _name_entered_top, ax - -loc_AD65: - inc si - -loc_AD66: - cmp si, SCOREDAT_PLACES - jge short loc_AD6E - jmp loc_AA71 -; --------------------------------------------------------------------------- - -loc_AD6E: - pop di - pop si - leave - retf -sub_A9FF endp - -; --------------------------------------------------------------------------- -off_AD72 dw offset loc_AA82 - dw offset loc_AA95 - dw offset loc_AAA8 - dw offset loc_AABA - dw offset loc_AACC - dw offset loc_AADE - dw offset loc_AAF0 - dw offset loc_AB02 - dw offset loc_AB14 - dw offset loc_AB26 - -; =============== S U B R O U T I N E ======================================= - ; Attributes: bp-based frame sub_AD86 proc far @@ -1298,14 +753,14 @@ loc_B021: inc word ptr es:[bx] loc_B063: - call _egc_copy_rect_1_to_0 c, _name_entered_left, _name_entered_top, 128, 16 + call _egc_copy_rect_1_to_0 c, _entered_name_left, _entered_name_top, 128, 16 push word ptr [bp+0Ch] push word ptr [bp+_arglist] ; arglist push ds push offset aS ; "%s" push 23h ; '#' ; int - push _name_entered_top ; int - push _name_entered_left ; int + push _entered_name_top ; int + push _entered_name_left ; int call _graph_printf_fx add sp, 0Eh les bx, [bp+arg_8] @@ -1326,8 +781,8 @@ loc_B063: push ds push offset aS_0 ; "%s" push 3 ; int - push _name_entered_top ; int - push _name_entered_left ; int + push _entered_name_top ; int + push _entered_name_left ; int call _graph_printf_fx add sp, 0Eh xor ax, ax @@ -1949,8 +1404,7 @@ var_8 = word ptr -8 var_6 = word ptr -6 @@place = word ptr -4 var_2 = word ptr -2 -arg_0 = word ptr 6 -arg_2 = word ptr 8 +@@points = dword ptr 6 arg_4 = word ptr 0Ah @@route = dword ptr 0Ch @@ -2052,10 +1506,10 @@ loc_B6CC: add bx, ax mov dx, es:[bx+2] mov ax, es:[bx] - cmp dx, [bp+arg_2] + cmp dx, word ptr [bp+@@points+2] jg short loc_B6ED jnz short loc_B6EB - cmp ax, [bp+arg_0] + cmp ax, word ptr [bp+@@points] ja short loc_B6ED loc_B6EB: @@ -2207,18 +1661,18 @@ loc_B83D: push word ptr [bp+@@route+2] push word ptr [bp+@@route] push di - push [bp+arg_2] - push [bp+arg_0] + push word ptr [bp+@@points+2] + push word ptr [bp+@@points] push [bp+@@place] - call sub_A9FF + call _regist_put_initial add sp, 10h call _alphabet_put_initial mov ax, [bp+@@place] shl ax, 2 les bx, _scoredat_points add bx, ax - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] + mov dx, word ptr [bp+@@points+2] + mov ax, word ptr [bp+@@points] mov es:[bx+2], dx mov es:[bx], ax mov ax, [bp+@@place] @@ -2255,10 +1709,10 @@ loc_B8BD: push word ptr [bp+@@route+2] push word ptr [bp+@@route] push di - push [bp+arg_2] - push [bp+arg_0] + push word ptr [bp+@@points+2] + push word ptr [bp+@@points] push 1Eh - call sub_A9FF + call _regist_put_initial add sp, 10h mov _input_ok, 1 mov _input_shot, 1 @@ -3992,7 +3446,8 @@ include th01/hardware/input_main_end[data].asm dd 0 include th01/hiscore/alphabet_syms[data].asm include th01/hardware/grppfnfx_ptrs[data].asm -aBqbqbqbqbqbqbq db '________',0 +public _REGIST_NAME_BLANK +_REGIST_NAME_BLANK db '________',0 aB@b@b@b@b@b@b@ db '        ',0 aHiscore_0 db 'HISCORE',0 off_12C1E dd aB@gcbGwbB@ @@ -4002,26 +3457,7 @@ off_12C1E dd aB@gcbGwbB@ dd aGlgigegbgbgn ; "ルナティック" include th01/hardware/grppfnfx[data].asm include th01/hiscore/scorelod[data].asm -include th01/hiscore/alphabet_initial[data].asm -aB@cB@iB@ db ' 霊 位 ',0 -aB@b@cB@b@sob@b db '  名  前  ',0 -aB@b@uB@b@u_b@b db '  得  点  ',0 -aGxgebGwbeglbGg db 'ステージ・ルート',0 -aB@sB@r_b@ db ' 靈 神 ',0 -aSMRgcId db '太元帥明王',0 -aB@uvb@rxb@ db ' 天 仙 ',0 -aB@r_b@rxb@ db ' 神 仙 ',0 -aB@tnb@rxb@ db ' 地 仙 ',0 -aB@rlb@rxb@ db ' 人 仙 ',0 -aB@rxb@pcb@ db ' 仙 女 ',0 -aIab@czb@ot db '陰 陽 師',0 -aSB@fB@ot db '靈 媒 師',0 -aPcb@lB@o db '修 業 者',0 -aCvke db '魔界',0 -aTnnc db '地獄',0 -aB db '−',0 -; char aCC_3[] -aCC_3 db '%c%c',0 +include th01/hiscore/regist[data].asm ; char aSp_0[] aSp_0 db 'SP',0 ; char aBi_1[] diff --git a/th01_reiiden.asm b/th01_reiiden.asm index ee6e897e..8ed68956 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -8424,365 +8424,7 @@ main_19__TEXT segment byte public 'CODE' use16 assume cs:main_19 STR_FROM_KANJI procdesc near extern _alphabet_put_initial:proc - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_13DF5 proc far - -var_18 = byte ptr -18h -var_6 = byte ptr -6 -var_5 = byte ptr -5 -var_4 = byte ptr -4 -@@top = word ptr -2 -arg_0 = word ptr 6 -arg_2 = dword ptr 8 -arg_6 = word ptr 0Ch -arg_8 = dword ptr 0Eh -arg_C = word ptr 12h -arg_E = word ptr 14h - - enter 18h, 0 - push si - push di - lea ax, [bp+var_18] - push ss - push ax - push ds - push offset aBqbqbqbqbqbqbq ; "________" - mov cx, 11h - call SCOPY@ - push 0 - call _graph_accesspage_func - pop cx - call _graph_putsa_fx c, 32, large (33h shl 16) or 48, offset aB@cB@iB@, ds ; " 霊 位 " - call _graph_putsa_fx c, 144, large (33h shl 16) or 48, offset aB@b@cB@b@sob@b, ds ; "  名  前  " - call _graph_putsa_fx c, 352, large (33h shl 16) or 48, offset aB@b@uB@b@u_b@b, ds ; "  得  点  " - call _graph_putsa_fx c, 512, large (33h shl 16) or 48, offset aGxgebGwbeglbGg, ds ; "ステージ・ルート" - xor si, si - jmp loc_14082 -; --------------------------------------------------------------------------- - -loc_13E6C: - cmp si, [bp+arg_0] - jnz short loc_13E76 - mov ax, 3 - jmp short loc_13E79 -; --------------------------------------------------------------------------- - -loc_13E76: - mov ax, 7 - -loc_13E79: - mov di, ax - mov ax, si - shl ax, 4 - add ax, 40h - mov [bp+@@top], ax - mov bx, si - cmp bx, 9 - ja short loc_13EE1 - add bx, bx - jmp cs:off_1408D[bx] - -loc_13E94: - push ds - push offset aB@sB@r_b@ ; " 靈 神 " - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13E9A: - push ds - push offset aSMRgcId ; "太元帥明王" - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EA0: - push ds - push offset aB@uvb@rxb@ ; " 天 仙 " - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EA6: - push ds - push offset aB@r_b@rxb@ ; " 神 仙 " - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EAC: - push ds - push offset aB@tnb@rxb@ ; " 地 仙 " - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EB2: - push ds - push offset aB@rlb@rxb@ ; " 人 仙 " - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EB8: - push ds - push offset aB@rxb@pcb@ ; " 仙 女 " - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EBE: - push ds - push offset aIab@czb@ot ; "陰 陽 師" - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13EC4: - push ds - push offset aSB@fB@ot ; "靈 媒 師" - jmp short loc_13ECE -; --------------------------------------------------------------------------- - -loc_13ECA: - push ds - push offset aPcb@lB@o ; "修 業 者" - -loc_13ECE: - mov ax, di - or ax, 20h - push ax - push [bp+@@top] - push 32 - call _graph_putsa_fx - add sp, 0Ah - -loc_13EE1: - cmp si, [bp+arg_0] - jnz short loc_13EED - mov dx, ss - lea ax, [bp+var_18] - jmp short loc_13EFC -; --------------------------------------------------------------------------- - -loc_13EED: - mov ax, si - imul ax, 12h - mov dx, [bp+arg_E] - push ax - mov ax, [bp+arg_C] - pop bx - add ax, bx - -loc_13EFC: - push dx - push ax - mov ax, di - or ax, 20h - push ax - push [bp+@@top] - push 144 - call _graph_putsa_fx - add sp, 0Ah - push 0 ; put_leading_zeroes - pushd 0 ; num_prev - cmp [bp+arg_0], si - jnz short loc_13F22 - mov eax, [bp+arg_2] - jmp short loc_13F31 -; --------------------------------------------------------------------------- - -loc_13F22: - mov ax, si - shl ax, 2 - les bx, _scoredat_points - add bx, ax - mov eax, es:[bx] - -loc_13F31: - push eax ; num - push 7 ; digits - mov ax, di - or ax, 30h - push ax ; fx - push [bp+@@top] ; top - push 352 ; left - call _graph_putfwnum_fx - add sp, 12h - cmp si, [bp+arg_0] - jz short loc_13F5E - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - cmp word ptr es:[bx], SCOREDAT_CLEARED - jl short loc_13F69 - -loc_13F5E: - cmp si, [bp+arg_0] - jnz short loc_13FA1 - cmp [bp+arg_6], SCOREDAT_CLEARED - jge short loc_13FA1 - -loc_13F69: - push 0 ; put_leading_zeroes - pushd 0 ; num_prev - cmp si, [bp+arg_0] - jnz short loc_13F78 - mov ax, [bp+arg_6] - jmp short loc_13F85 -; --------------------------------------------------------------------------- - -loc_13F78: - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - mov ax, es:[bx] - -loc_13F85: - cwde - push eax ; num - push 2 ; digits - mov ax, di - or ax, 20h - push ax ; fx - push [bp+@@top] ; top - push 528 ; left - call _graph_putfwnum_fx - add sp, 12h - jmp short loc_13FFF -; --------------------------------------------------------------------------- - -loc_13FA1: - cmp si, [bp+arg_0] - jz short loc_13FB6 - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - cmp word ptr es:[bx], SCOREDAT_CLEARED_MAKAI - jz short loc_13FC1 - -loc_13FB6: - cmp si, [bp+arg_0] - jnz short loc_13FC7 - cmp [bp+arg_6], SCOREDAT_CLEARED_MAKAI - jnz short loc_13FC7 - -loc_13FC1: - push ds - push offset aCvke ; "魔界" - jmp short loc_13FEB -; --------------------------------------------------------------------------- - -loc_13FC7: - cmp si, [bp+arg_0] - jz short loc_13FDC - mov ax, si - add ax, ax - les bx, _scoredat_stages - add bx, ax - cmp word ptr es:[bx], SCOREDAT_CLEARED_JIGOKU - jz short loc_13FE7 - -loc_13FDC: - cmp si, [bp+arg_0] - jnz short loc_13FFF - cmp [bp+arg_6], SCOREDAT_CLEARED_JIGOKU - jnz short loc_13FFF - -loc_13FE7: - push ds - push offset aTnnc ; "地獄" - -loc_13FEB: - mov ax, di - or ax, 20h - push ax - push [bp+@@top] - push 528 - call _graph_putsa_fx - add sp, 0Ah - -loc_13FFF: - push ds - push offset aB_0 ; "−" - mov ax, di - or ax, 20h - push ax - push [bp+@@top] - push 560 - call _graph_putsa_fx - add sp, 0Ah - mov [bp+var_4], 0 - cmp si, [bp+arg_0] - jnz short loc_14025 - les bx, [bp+arg_8] - jmp short loc_1402F -; --------------------------------------------------------------------------- - -loc_14025: - mov ax, si - add ax, ax - les bx, _scoredat_routes - add bx, ax - -loc_1402F: - mov al, es:[bx] - mov [bp+var_6], al - cmp si, [bp+arg_0] - jnz short loc_1403F - les bx, [bp+arg_8] - jmp short loc_1404B -; --------------------------------------------------------------------------- - -loc_1403F: - mov bx, si - add bx, bx - mov es, word ptr _scoredat_routes+2 - add bx, word ptr _scoredat_routes - -loc_1404B: - mov al, es:[bx+1] - mov [bp+var_5], al - push ss - lea ax, [bp+var_6] - push ax - mov ax, di - or ax, 20h - push ax - push [bp+@@top] - push 576 - call _graph_putsa_fx - add sp, 0Ah - cmp [bp+arg_0], si - jnz short loc_14081 - mov _name_entered_left, 144 - mov ax, si - shl ax, 4 - add ax, 64 - mov _name_entered_top, ax - -loc_14081: - inc si - -loc_14082: - cmp si, 0Ah - jl loc_13E6C - pop di - pop si - leave - retf -sub_13DF5 endp - -; --------------------------------------------------------------------------- -off_1408D dw offset loc_13E94 - dw offset loc_13E9A - dw offset loc_13EA0 - dw offset loc_13EA6 - dw offset loc_13EAC - dw offset loc_13EB2 - dw offset loc_13EB8 - dw offset loc_13EBE - dw offset loc_13EC4 - dw offset loc_13ECA + extern _regist_put_initial:proc ; =============== S U B R O U T I N E ======================================= @@ -9132,8 +8774,8 @@ loc_14322: inc word ptr es:[bx] loc_1432E: - call _egc_copy_rect_1_to_0 c, _name_entered_left, _name_entered_top, large (16 shl 16) or 128 - call _graph_putsa_fx c, _name_entered_left, _name_entered_top, 23h, large [bp+arg_4] + call _egc_copy_rect_1_to_0 c, _entered_name_left, _entered_name_top, large (16 shl 16) or 128 + call _graph_putsa_fx c, _entered_name_left, _entered_name_top, 23h, large [bp+arg_4] les bx, [bp+arg_8] mov bx, es:[bx] add bx, bx @@ -9150,8 +8792,8 @@ loc_1432E: lea ax, [bp+var_14] push ax push 3 - push _name_entered_top - push _name_entered_left + push _entered_name_top + push _entered_name_left call _graph_putsa_fx add sp, 0Ah xor ax, ax @@ -9946,7 +9588,7 @@ loc_14B04: push di pushd [bp+@@points] push word ptr [bp+@@place] - call sub_13DF5 + call _regist_put_initial add sp, 10h call _alphabet_put_initial mov ax, word ptr [bp+@@place] @@ -9990,7 +9632,7 @@ loc_14B8D: push di pushd [bp+@@points] push 1Eh - call sub_13DF5 + call _regist_put_initial add sp, 10h mov _input_ok, 1 mov _input_shot, 1 @@ -60769,7 +60411,8 @@ aVavnvmvtvrb@vo db ' aVgvivfb@vyb@vj db 'Hit Z Key',0 db 0 include th01/hiscore/alphabet_syms[data].asm -aBqbqbqbqbqbqbq db '________',0 +public _REGIST_NAME_BLANK +_REGIST_NAME_BLANK db '________',0 byte_35889 db 0 aB@b@b@b@b@b@b@ db '        ',0 aHiscore_0 db 'HISCORE',0 @@ -60779,24 +60422,7 @@ off_358A3 dd aB@gcbGwbB@ dd aB@gnbGhb@b@ ; " ハード  " dd aGlgigegbgbgn ; "ルナティック" include th01/hiscore/scorelod[data].asm -include th01/hiscore/alphabet_initial[data].asm -aB@cB@iB@ db ' 霊 位 ',0 -aB@b@cB@b@sob@b db '  名  前  ',0 -aB@b@uB@b@u_b@b db '  得  点  ',0 -aGxgebGwbeglbGg db 'ステージ・ルート',0 -aB@sB@r_b@ db ' 靈 神 ',0 -aSMRgcId db '太元帥明王',0 -aB@uvb@rxb@ db ' 天 仙 ',0 -aB@r_b@rxb@ db ' 神 仙 ',0 -aB@tnb@rxb@ db ' 地 仙 ',0 -aB@rlb@rxb@ db ' 人 仙 ',0 -aB@rxb@pcb@ db ' 仙 女 ',0 -aIab@czb@ot db '陰 陽 師',0 -aSB@fB@ot db '靈 媒 師',0 -aPcb@lB@o db '修 業 者',0 -aCvke db '魔界',0 -aTnnc db '地獄',0 -aB_0 db '−',0 +include th01/hiscore/regist[data].asm aWB db 'wb',0 aB@gcbGwbB@ db ' イージー ',0 aB@gmbGGlb@ db ' ノーマル ',0