mirror of https://github.com/nmlgc/ReC98.git
[Decompilation] Add an inline function for VRAM offset calculation
Which actually does inline… in C++, because Turbo C++ doesn't support the `inline` keyword in C mode. So much for the superiority of that language, even in 1994… Part of P0083, funded by Yanga.
This commit is contained in:
parent
2546c5dfcb
commit
df6b636053
7
ReC98.h
7
ReC98.h
|
@ -116,6 +116,13 @@ extern dots8_t *VRAM_PLANE_E;
|
|||
|
||||
#define VRAM_OFFSET(x, y) ((x) >> 3) + (y << 6) + (y << 4)
|
||||
|
||||
#ifdef __cplusplus
|
||||
static inline unsigned int vram_offset_shift(int x, int y)
|
||||
{
|
||||
return VRAM_OFFSET(x, y);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define VRAM_CHUNK(plane, offset, bit_count) \
|
||||
*(dots##bit_count##_t *)(VRAM_PLANE_##plane + offset)
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ void graph_r_vline(int x, int top, int bottom, int col)
|
|||
egc_copy_rect_1_to_0(x, top, sizeof(pattern) * 8, bottom - top);
|
||||
return;
|
||||
}
|
||||
vram_row_offset = VRAM_OFFSET(x, top);
|
||||
vram_row_offset = vram_offset_shift(x, top);
|
||||
pattern = graph_r_pattern >> (x & 7);
|
||||
pattern |= graph_r_pattern << (16 - (x & 7));
|
||||
|
||||
|
@ -611,7 +611,7 @@ void graph_r_line(int left, int top, int right, int bottom, int col)
|
|||
plot_loop(y_cur, h, y_direction, x_cur, w, 1);
|
||||
}
|
||||
restore_last:
|
||||
vram_offset = VRAM_OFFSET(x_cur, y_cur) - 1;
|
||||
vram_offset = vram_offset_shift(x_cur, y_cur) - 1;
|
||||
restore_at(vram_offset);
|
||||
end:
|
||||
if(!graph_r_restore_from_1) {
|
||||
|
|
Loading…
Reference in New Issue