Skip to content

Commit

Permalink
[Decompilation] [th01] Unused function to snap all dots with hardware…
Browse files Browse the repository at this point in the history
… color #4

That's… pretty specific. The only thing on the main menu with this
color is the "1996 ZUN" text at the bottom… probably part of an
effect that we never got to see. Every other idea would be baseless
speculation, given that the snapped buffer isn't used anywhere else.

Part of P0090, funded by Yanga.
  • Loading branch information
nmlgc committed May 11, 2020
1 parent 90252cc commit 05a0e9b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bin\Pipeline\grzview.com: Pipeline\grzview.cpp th01\formats\grz.cpp
bin\th01\zunsoft.com: th01\zunsoft.c
$(CC) $(CFLAGS) -mt -lt -nbin\th01\ $** masters.lib

bin\th01\op.exe: bin\th01\op.obj th01\op_02.c th01\op_03.c th01\op_04.c th01\op_05.c th01\op_06.cpp th01\op_07.cpp th01\op_08.c th01\op_09.cpp th01\op_10.c th01\op_11.c th01\op_12.cpp
bin\th01\op.exe: bin\th01\op.obj th01\op_01.cpp th01\op_02.c th01\op_03.c th01\op_04.c th01\op_05.c th01\op_06.cpp th01\op_07.cpp th01\op_08.c th01\op_09.cpp th01\op_10.c th01\op_11.c th01\op_12.cpp
$(CC) $(CFLAGS) -ml -3 -DGAME=1 -DBINARY='O' -nbin\th01\ -eOP.EXE @&&|
$**
|
Expand Down
39 changes: 39 additions & 0 deletions th01/op_01.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* ReC98
* -----
* Code segment #1 of TH01's OP.EXE
*/

extern "C" {
#include "ReC98.h"
#include "th01/hardware/graph.h"

// Unused. The only thing on the main menu with this color is the "1996 ZUN"
// text at the bottom... probably part of an effect that we never got to see.
void snap_col_4(void)
{
extern dots8_t* columns[ROW_SIZE];
register int x;
register int y;
int vram_offset;

for(x = 0; x < ROW_SIZE; x++) {
columns[x] = new dots8_t[RES_Y];
}
grcg_setcolor_tdw(4);
graph_accesspage_func(1);

for(x = 0; x < ROW_SIZE; x++) {
y = 0;
vram_offset = x;
while(y < RES_Y) {
columns[x][y] = VRAM_PLANE_B[vram_offset];
y++;
vram_offset += ROW_SIZE;
}
}

grcg_off();
graph_accesspage_func(0);
}

}
78 changes: 11 additions & 67 deletions th01_op.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ include th01/th01.inc
extern _toupper:proc
extern _vsprintf:proc

op_01 group op_01_TEXT, op_01__TEXT

; ===========================================================================

; Segment type: Pure code
Expand Down Expand Up @@ -89,71 +91,12 @@ _TEXT ends

; Segment type: Pure code
op_01_TEXT segment byte public 'CODE' use16
assume cs:op_01_TEXT
op_01_TEXT ends

op_01__TEXT segment byte public 'CODE' use16
assume cs:op_01
;org 4
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
enter 2, 0
push si
push di
xor si, si
jmp short loc_A1E5
; ---------------------------------------------------------------------------

loc_A1CE:
push 190h
call @$bnwa$qui
pop cx
mov bx, si
shl bx, 2
mov [bx+118Eh], dx
mov [bx+118Ch], ax
inc si

loc_A1E5:
cmp si, 50h ; 'P'
jl short loc_A1CE
call _grcg_setcolor_tdw stdcall, 4
push 1
call _graph_accesspage_func
add sp, 4
xor si, si
jmp short loc_A22A
; ---------------------------------------------------------------------------

loc_A1FF:
xor di, di
mov [bp-2], si
jmp short loc_A223
; ---------------------------------------------------------------------------

loc_A206:
les bx, _VRAM_PLANE_B
add bx, [bp-2]
mov al, es:[bx]
mov bx, si
shl bx, 2
les bx, [bx+118Ch]
add bx, di
mov es:[bx], al
inc di
add word ptr [bp-2], 50h ; 'P'

loc_A223:
cmp di, 190h
jl short loc_A206
inc si

loc_A22A:
cmp si, 50h ; 'P'
jl short loc_A1FF
call _grcg_off_func
push 0
call _graph_accesspage_func
pop cx
pop di
pop si
leave
retf

; =============== S U B R O U T I N E =======================================

Expand Down Expand Up @@ -952,9 +895,9 @@ sub_A8AD proc far
les bx, _resident
cmp es:[bx+reiidenconfig_t.stage], 0
jnz short loc_A8E1
mov ax, seg op_01_TEXT
mov ax, seg op_01
mov es, ax
assume es:op_01_TEXT
assume es:op_01

loc_A8E1:
call sub_A79D
Expand Down Expand Up @@ -2040,7 +1983,7 @@ loc_B25D:
leave
retf
_main endp
op_01_TEXT ends
op_01__TEXT ends

; ===========================================================================

Expand Down Expand Up @@ -2460,7 +2403,8 @@ include th01/mdrv2[data].asm

; TODO: Missing clip[bss].asm (16 bytes) somewhere in there...
dword_13418 dd ?
db 320 dup(?)
public _columns
_columns dd ROW_SIZE dup (?)
include th01/hardware/vsync[bss].asm
db 191 dup (?)
word_13627 dw ?
Expand Down

0 comments on commit 05a0e9b

Please sign in to comment.