mirror of https://github.com/nmlgc/ReC98.git
[Decompilation] [th02] Verdict screen: Score rendering
For once, I'm glad that ZUN copy-pasted this one-off function. Otherwise, it probably wouldn't have been that easy to factor out. Part of P0278, funded by Yanga.
This commit is contained in:
parent
962564db49
commit
31411d7743
|
@ -1,8 +1,13 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
#include "pc98.h"
|
||||||
#include "master.hpp"
|
#include "master.hpp"
|
||||||
#include "shiftjis.hpp"
|
#include "shiftjis.hpp"
|
||||||
|
#include "th02/score.h"
|
||||||
|
#include "th02/v_colors.hpp"
|
||||||
#include "th02/formats/end.hpp"
|
#include "th02/formats/end.hpp"
|
||||||
|
#include "th02/gaiji/gaiji.h"
|
||||||
|
#include "th02/gaiji/score_p.hpp"
|
||||||
|
|
||||||
// State
|
// State
|
||||||
// -----
|
// -----
|
||||||
|
@ -21,3 +26,14 @@ void pascal near end_load(const char *fn)
|
||||||
|
|
||||||
file_close();
|
file_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pascal near verdict_value_score_put(
|
||||||
|
screen_x_t left, screen_y_t top, score_t score
|
||||||
|
)
|
||||||
|
{
|
||||||
|
#define on_digit(i, gaiji) { \
|
||||||
|
graph_gaiji_putc((left + (GAIJI_W * i)), top, gaiji, V_WHITE); \
|
||||||
|
}
|
||||||
|
gaiji_score_put(score, on_digit, false);
|
||||||
|
#undef on_digit
|
||||||
|
}
|
||||||
|
|
|
@ -117,6 +117,8 @@ _TEXT ends
|
||||||
END_TEXT segment byte public 'CODE' use16
|
END_TEXT segment byte public 'CODE' use16
|
||||||
@END_LOAD$QNXC procdesc pascal near \
|
@END_LOAD$QNXC procdesc pascal near \
|
||||||
fn_seg:word, fn_off:word
|
fn_seg:word, fn_off:word
|
||||||
|
@VERDICT_VALUE_SCORE_PUT$QIIL procdesc pascal near \
|
||||||
|
left_and_top:dword, score:dword
|
||||||
END_TEXT ends
|
END_TEXT ends
|
||||||
|
|
||||||
; Segment type: Pure code
|
; Segment type: Pure code
|
||||||
|
@ -125,69 +127,6 @@ maine_01_TEXT segment byte public 'CODE' use16
|
||||||
;org 3
|
;org 3
|
||||||
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
|
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
|
||||||
|
|
||||||
; =============== S U B R O U T I N E =======================================
|
|
||||||
|
|
||||||
; Attributes: bp-based frame
|
|
||||||
|
|
||||||
sub_95CB proc near
|
|
||||||
|
|
||||||
var_9 = byte ptr -9
|
|
||||||
var_8 = dword ptr -8
|
|
||||||
var_4 = dword ptr -4
|
|
||||||
arg_0 = dword ptr 4
|
|
||||||
@@y = word ptr 8
|
|
||||||
@@x = word ptr 0Ah
|
|
||||||
|
|
||||||
enter 0Ah, 0
|
|
||||||
push si
|
|
||||||
push di
|
|
||||||
mov di, gb_0_
|
|
||||||
mov [bp+var_4], 10000000
|
|
||||||
mov [bp+var_9], 0
|
|
||||||
xor si, si
|
|
||||||
jmp short loc_9638
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
loc_95E4:
|
|
||||||
mov eax, [bp+arg_0]
|
|
||||||
cdq
|
|
||||||
idiv [bp+var_4]
|
|
||||||
mov ebx, 10
|
|
||||||
cdq
|
|
||||||
idiv ebx
|
|
||||||
mov [bp+var_8], edx
|
|
||||||
mov eax, [bp+var_4]
|
|
||||||
cdq
|
|
||||||
idiv ebx
|
|
||||||
mov [bp+var_4], eax
|
|
||||||
mov ax, word ptr [bp+var_8]
|
|
||||||
add ax, gb_0_
|
|
||||||
mov di, ax
|
|
||||||
cmp [bp+var_8], 0
|
|
||||||
jz short loc_961D
|
|
||||||
mov [bp+var_9], 1
|
|
||||||
|
|
||||||
loc_961D:
|
|
||||||
cmp [bp+var_9], 0
|
|
||||||
jz short loc_9637
|
|
||||||
mov ax, si
|
|
||||||
shl ax, 4
|
|
||||||
add ax, [bp+@@x]
|
|
||||||
call graph_gaiji_putc pascal, ax, [bp+@@y], di, V_WHITE
|
|
||||||
|
|
||||||
loc_9637:
|
|
||||||
inc si
|
|
||||||
|
|
||||||
loc_9638:
|
|
||||||
cmp si, 8
|
|
||||||
jl short loc_95E4
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
leave
|
|
||||||
retn 8
|
|
||||||
sub_95CB endp
|
|
||||||
|
|
||||||
|
|
||||||
; =============== S U B R O U T I N E =======================================
|
; =============== S U B R O U T I N E =======================================
|
||||||
|
|
||||||
; Attributes: bp-based frame
|
; Attributes: bp-based frame
|
||||||
|
@ -2468,9 +2407,7 @@ loc_A992:
|
||||||
push (128 shl 16) or 64
|
push (128 shl 16) or 64
|
||||||
call _graph_putsa_fx
|
call _graph_putsa_fx
|
||||||
add sp, 0Ah
|
add sp, 0Ah
|
||||||
push 0C00080h
|
call @verdict_value_score_put$qiil pascal, (192 shl 16) or 128, large [_score]
|
||||||
pushd [_score]
|
|
||||||
call sub_95CB
|
|
||||||
push 100080h
|
push 100080h
|
||||||
push 40h
|
push 40h
|
||||||
call sub_97F1
|
call sub_97F1
|
||||||
|
|
Loading…
Reference in New Issue