2019-12-01 21:19:23 +00:00
|
|
|
#include "th03/math/subpixel.hpp"
|
|
|
|
|
|
|
|
#define PLAYFIELD_COUNT 2
|
2019-11-21 20:53:24 +00:00
|
|
|
#define PLAYFIELD_W 288
|
2020-01-28 20:50:58 +00:00
|
|
|
#define PLAYFIELD_H 368
|
2019-11-21 20:53:24 +00:00
|
|
|
// For both playfields, in every direction. (CSS style!)
|
[Decompilation] [th03] Sprite display calls
Yes, decompilation, of something that was so obviously originally
written in ASM. We're still left with two un-decompilable instructions
here, but I'm amazed at how nicely I was able to abstract away all of
the gory register details, leading to pretty clear, readable, and dare
I say *portable* code?! Turbo C++ was once again pretty helpful here:
• `static_cast<char>(_BX) = _AL` actually compiles into `MOV BL, AL`,
as you would have intended,
• and no-op assignments like _DI = _DI are optimized away, allowing
us to leave them in for clarity, so that we can have all parameter
assignments for the SPRITE16 display call in a single place.
I love this compiler.
Part of P0060, funded by Touhou Patch Center.
2019-11-22 21:25:41 +00:00
|
|
|
// The clipped SPRITE16 display functions rely on this being at least 16!
|
2019-11-21 20:53:24 +00:00
|
|
|
#define PLAYFIELD_BORDER 16
|
2019-12-01 21:19:23 +00:00
|
|
|
#define PLAYFIELD_X PLAYFIELD_BORDER
|
[Decompilation] [th03] Sprite display calls
Yes, decompilation, of something that was so obviously originally
written in ASM. We're still left with two un-decompilable instructions
here, but I'm amazed at how nicely I was able to abstract away all of
the gory register details, leading to pretty clear, readable, and dare
I say *portable* code?! Turbo C++ was once again pretty helpful here:
• `static_cast<char>(_BX) = _AL` actually compiles into `MOV BL, AL`,
as you would have intended,
• and no-op assignments like _DI = _DI are optimized away, allowing
us to leave them in for clarity, so that we can have all parameter
assignments for the SPRITE16 display call in a single place.
I love this compiler.
Part of P0060, funded by Touhou Patch Center.
2019-11-22 21:25:41 +00:00
|
|
|
#define PLAYFIELD_Y PLAYFIELD_BORDER
|
2019-11-21 20:53:24 +00:00
|
|
|
|
2020-01-28 20:50:58 +00:00
|
|
|
#define PLAYFIELD_VRAM_H (PLAYFIELD_H / 2)
|
|
|
|
|
2019-11-21 20:53:24 +00:00
|
|
|
#define PLAYFIELD_W_BORDERED (PLAYFIELD_BORDER + PLAYFIELD_W + PLAYFIELD_BORDER)
|
|
|
|
#define PLAYFIELD1_CLIP_LEFT 0
|
|
|
|
#define PLAYFIELD1_CLIP_RIGHT (PLAYFIELD1_CLIP_LEFT + PLAYFIELD_W_BORDERED - 1)
|
|
|
|
#define PLAYFIELD2_CLIP_LEFT (PLAYFIELD1_CLIP_RIGHT + 1)
|
|
|
|
#define PLAYFIELD2_CLIP_RIGHT (PLAYFIELD2_CLIP_LEFT + PLAYFIELD_W_BORDERED - 1)
|
2019-12-01 21:19:23 +00:00
|
|
|
|
2020-01-19 14:35:45 +00:00
|
|
|
#define PLAYFIELD_VRAM_W_BORDERED (PLAYFIELD_W_BORDERED / 8)
|
|
|
|
|
2019-12-01 21:19:23 +00:00
|
|
|
extern int playfield_fg_shift_x[PLAYFIELD_COUNT];
|
|
|
|
|
|
|
|
int pascal playfield_fg_x_to_screen(Subpixel x, unsigned int pid);
|