Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reverse-engineering] [th04/th05] Playfield fill-around function names
These are used from quite a few places, so it seems best to just name them after the rect on the playfield they leave out, which is then typically where the background picture goes. …*except* that in doing this, we quickly run up against the symbol length limit of 32 characters. TASM can expand it via the /mv option, but TCC only lets you *reduce* it to even less. (Why?) So, my initial idea of `playfield_fill_around_(x)_(y)_(w)_(h)` wouldn't have worked. But those coordinates are kinda important, I'd say… Well then, let's just go with `fillm` instead of `fill_around` then. "Fill with mask at the given coordinates"… yeah, that would work. Part of P0029, funded by zorg.
- Loading branch information
Showing
3 changed files
with
93 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
; Fills the playfield around the 256×256 pixels starting at (64, 56) with the | ||
; current GRCG tile. | ||
; Assumes that the GRCG is set to TDW mode. | ||
|
||
; void pascal playfield_fillm_64_56_256_256(); | ||
public playfield_fillm_64_56_256_256 | ||
playfield_fillm_64_56_256_256 proc near | ||
push di | ||
mov ax, GRAM_400 + (PLAYFIELD_Y * ROW_SIZE) shr 4 | ||
mov es, ax | ||
assume es:nothing | ||
mov di, (55 * ROW_SIZE) + PLAYFIELD_VRAM_X | ||
nop | ||
|
||
@@rows_next: | ||
mov cx, PLAYFIELD_VRAM_W / 4 | ||
|
||
@@rows_top_and_bottom: | ||
mov es:[di+(312 * ROW_SIZE)], eax | ||
stosd | ||
loop @@rows_top_and_bottom | ||
sub di, ROW_SIZE + PLAYFIELD_VRAM_W | ||
jge short @@rows_next | ||
mov ax, GRAM_400 + ((56 + PLAYFIELD_Y) * ROW_SIZE) shr 4 | ||
mov es, ax | ||
assume es:nothing | ||
mov di, (255 * ROW_SIZE) + PLAYFIELD_VRAM_X | ||
nop | ||
|
||
@@cols: | ||
mov es:[di+(320 / 8)], eax | ||
stosd | ||
mov es:[di+(320 / 8)], eax | ||
stosd | ||
sub di, ROW_SIZE + 8 | ||
jge short @@cols | ||
pop di | ||
retn | ||
playfield_fillm_64_56_256_256 endp | ||
even |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.