diff --git a/Makefile.mak b/Makefile.mak index 6fc5e707..f3a39b46 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -133,7 +133,7 @@ bin\th04\res_huma.com: th04\res_huma.cpp $** | masters.lib -bin\th04\op.exe: bin\th04\op.obj th04\m_char.cpp bin\th01\vplanset.obj bin\frmdely1.obj bin\th03\pi_put.obj bin\th03\pi_load.obj bin\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_kaja.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initop.obj bin\th04\cdg_p_na.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\egcrect.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th04\cdg_load.obj th04\frmdely2.c +bin\th04\op.exe: bin\th04\op.obj th04\m_char.cpp bin\th01\vplanset.obj bin\frmdely1.obj bin\th03\pi_put.obj bin\th03\pi_load.obj bin\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_kaja.obj bin\th04\cdg_p_nc.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initop.obj bin\th04\cdg_p_na.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\egcrect.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th04\cdg_load.obj th04\frmdely2.c $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=4 -DBINARY='O' -3 -Z -d -nbin\th04\ -eOP.EXE @&&| $** | diff --git a/Tupfile b/Tupfile index 1e52605e..f3ac72b2 100644 --- a/Tupfile +++ b/Tupfile @@ -89,6 +89,7 @@ BMP2ARR = bin\\Pipeline\\bmp2arr.exe : th04_memchk.asm |> !as |> bin\\th04\\memchk.obj : th04\\scoreupd.asm |> !as4 |> : th04\\cdg_put.asm |> !as4 |> +: th04\\cdg_p_nc.asm |> !as4 |> : th04\\cdg_p_pr.asm |> !as4 |> : th04\\input_s.asm |> !as4 |> : th04\\cdg_load.asm |> !as4 |> diff --git a/Tupfile.bat b/Tupfile.bat index 239d27bc..4fcbd5c8 100644 --- a/Tupfile.bat +++ b/Tupfile.bat @@ -38,6 +38,7 @@ tasm32 /m /mx /kh32768 /t th04_zuninit.asm bin\th04\zuninit.obj tasm32 /m /mx /kh32768 /t th04_memchk.asm bin\th04\memchk.obj tasm32 /m /mx /kh32768 /t /dGAME=4 th04\scoreupd.asm bin\th04\scoreupd.obj tasm32 /m /mx /kh32768 /t /dGAME=4 th04\cdg_put.asm bin\th04\cdg_put.obj +tasm32 /m /mx /kh32768 /t /dGAME=4 th04\cdg_p_nc.asm bin\th04\cdg_p_nc.obj tasm32 /m /mx /kh32768 /t /dGAME=4 th04\cdg_p_pr.asm bin\th04\cdg_p_pr.obj tasm32 /m /mx /kh32768 /t /dGAME=4 th04\input_s.asm bin\th04\input_s.obj tasm32 /m /mx /kh32768 /t /dGAME=4 th04\cdg_load.asm bin\th04\cdg_load.obj diff --git a/th04/cdg_p_nc.asm b/th04/cdg_p_nc.asm new file mode 100644 index 00000000..0fbe69f9 --- /dev/null +++ b/th04/cdg_p_nc.asm @@ -0,0 +1 @@ +include th04/formats/cdg_p_nc.asm diff --git a/th04/formats/cdg_p_nc.asm b/th04/formats/cdg_p_nc.asm new file mode 100644 index 00000000..f3f1fe24 --- /dev/null +++ b/th04/formats/cdg_p_nc.asm @@ -0,0 +1,60 @@ + .386 + locals + +include pc98.inc +include th03/formats/cdg.inc + + extrn _cdg_slots:cdg_t:CDG_SLOT_COUNT + +SHARED segment word public 'CODE' use16 + assume cs:SHARED + +; Identical to the barely decompilable TH05 version, which doesn't rely on +; self-modifying code for the width. +public CDG_PUT_NOCOLORS_8 +cdg_put_nocolors_8 proc far + ; (PASCAL calling convention, parameter list needs to be reversed here) + arg @@slot:word, @@top:word, @@left:word + @@stride_backwards equ + + push bp + mov bp, sp + push si + push di + + cdg_slot_offset si, @@slot + cdg_dst_offset di, si, @@left + + mov ax, [si+cdg_t.vram_dword_w] + mov @@width, ax + jmp short $+2 + shl ax, 2 + add ax, ROW_SIZE + mov @@stride_backwards, ax + + cdg_dst_segment es, @@top, bx + + push ds + mov ds, [si+cdg_t.seg_alpha] + xor si, si + cld + even + +@@next_row: + @@width = word ptr $+1 + mov cx, 1234h + rep movsd + sub di, @@stride_backwards + jns short @@next_row + + pop ds + pop di + pop si + pop bp + retf 6 +cdg_put_nocolors_8 endp + even + +SHARED ends + + end diff --git a/th04/formats/cdg_put_nocolors.asm b/th04/formats/cdg_put_nocolors.asm deleted file mode 100644 index 65106f44..00000000 --- a/th04/formats/cdg_put_nocolors.asm +++ /dev/null @@ -1,44 +0,0 @@ -; Identical to the barely decompilable TH05 version, which doesn't rely on -; self-modifying code for the width. -public CDG_PUT_NOCOLORS_8 -cdg_put_nocolors_8 proc far - -@@slot = word ptr 6 -@@top = word ptr 8 -@@left = word ptr 10 - - push bp - mov bp, sp - push si - push di - - cdg_slot_offset si, [bp+@@slot] - cdg_dst_offset di, si, [bp+@@left] - - mov ax, [si+cdg_t.vram_dword_w] - mov word ptr cs:@@width+1, ax - jmp short $+2 - shl ax, 2 - add ax, (640 / 8) - mov dx, ax - - cdg_dst_segment es, [bp+@@top], bx - - push ds - mov ds, [si+cdg_t.seg_alpha] - xor si, si - cld - align 2 - -@@width: - mov cx, 1234h - rep movsd - sub di, dx - jns short @@width - pop ds - pop di - pop si - pop bp - retf 6 -cdg_put_nocolors_8 endp - align 2 diff --git a/th04_op.asm b/th04_op.asm index f90b45ff..e83e5e5b 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -2642,13 +2642,13 @@ SHARED segment word public 'CODE' use16 extern _snd_pmd_resident:proc extern _snd_mmd_resident:proc extern SND_KAJA_INTERRUPT:proc + extern CDG_PUT_NOCOLORS_8:proc SHARED ends SHARED_ segment word public 'CODE' use16 assume cs:g_SHARED assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing -include th04/formats/cdg_put_nocolors.asm include th04/snd/detmodes.asm include th03/snd/delaymea.asm include th02/exit_dos.asm