Skip to content

Commit

Permalink
[Decompilation] [th03] .CDG: Loading and freeing
Browse files Browse the repository at this point in the history
Completes P0132, funded by [Anonymous].
  • Loading branch information
nmlgc committed Jan 5, 2021
1 parent c12f9ea commit 045450c
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 290 deletions.
4 changes: 2 additions & 2 deletions Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ bin\th03\res_yume.com: th03\res_yume.cpp
$**
| masters.lib

bin\th03\op.exe: th03\op_01.cpp bin\th03\op.obj bin\th03\grppsafx.obj bin\th03\pi_load.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj bin\frmdely2.obj
bin\th03\op.exe: th03\op_01.cpp bin\th03\op.obj bin\th03\cdg_load.obj bin\th03\grppsafx.obj bin\th03\pi_load.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj bin\frmdely2.obj
$(CC) $(CFLAGS) -ml -3 -Z -DGAME=3 -nbin\th03\ -eOP.EXE @&&|
$**
|
Expand All @@ -111,7 +111,7 @@ bin\th03\main.exe: bin\th03\main.obj th03\main_01.cpp bin\th03\pi_load.obj bin\t
$**
|

bin\th03\mainl.exe: bin\th03\mainl.obj th03\exitmain.cpp bin\th03\grppsafx.obj bin\th03\snd_dlym.obj bin\th03\inp_wait.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj
bin\th03\mainl.exe: bin\th03\mainl.obj bin\th03\cdg_load.obj th03\exitmain.cpp bin\th03\grppsafx.obj bin\th03\snd_dlym.obj bin\th03\inp_wait.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj
$(CC) $(CFLAGS) -ml -DGAME=3 -nbin\th03\ -eMAINL.EXE @&&|
$**
|
Expand Down
1 change: 1 addition & 0 deletions th03/cdg_load.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "th03/formats/cdg_load.cpp"
11 changes: 9 additions & 2 deletions th03/formats/cdg.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ typedef struct {
int8_t plane_layout;

// Memory segments of the loaded data. Must be 0 in the file header!
uint16_t seg_alpha;
uint16_t seg_colors;
dots8_t __seg *seg[2];

dots8_t __seg*& seg_alpha() {
return seg[0];
}

dots8_t __seg*& seg_colors() {
return seg[1];
}
} cdg_t;

#if (GAME >= 4)
Expand Down
5 changes: 2 additions & 3 deletions th03/formats/cdg[data].asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
; Won't load the alpha plane of the next CDG file if nonzero.
public cdg_noalpha
cdg_noalpha db ?
public _cdg_noalpha
_cdg_noalpha db ?
align 2
275 changes: 0 additions & 275 deletions th03/formats/cdg_load.asm

This file was deleted.

Loading

0 comments on commit 045450c

Please sign in to comment.