mirror of https://github.com/nmlgc/ReC98.git
[Maintenance] Use a distinct name for arc_file_get()'s sizeof() macro
We not only actually still need the (pointer, size) function to fill heap-allocated memory, but we also need to differentiate between near and far pointers, to move those pesky `PUSH DS` instructions to their original places?! Part of P0105, funded by Yanga.
This commit is contained in:
parent
3622eb6298
commit
74b834fd7f
|
@ -20,8 +20,8 @@ void pascal arc_file_load(const char fn[PF_FN_LEN]);
|
||||||
// into [buf], advancing the cursor in the process.
|
// into [buf], advancing the cursor in the process.
|
||||||
void pascal arc_file_get(char *buf, size_t size);
|
void pascal arc_file_get(char *buf, size_t size);
|
||||||
|
|
||||||
#define arc_file_get(struct) \
|
#define arc_file_get_far(var) \
|
||||||
arc_file_get(reinterpret_cast<char *>(&struct), sizeof(struct))
|
arc_file_get(reinterpret_cast<char far *>(&var), sizeof(var))
|
||||||
|
|
||||||
// Sets the file cursor to the given [pos], relative to the start of the file.
|
// Sets the file cursor to the given [pos], relative to the start of the file.
|
||||||
void pascal arc_file_seek(char pos);
|
void pascal arc_file_seek(char pos);
|
||||||
|
|
|
@ -31,7 +31,7 @@ ptn_error_t ptn_load_palette_show(int slot, const char *fn)
|
||||||
ptn_t *ptn;
|
ptn_t *ptn;
|
||||||
|
|
||||||
arc_file_load(fn);
|
arc_file_load(fn);
|
||||||
arc_file_get(h.header);
|
arc_file_get_far(h.header);
|
||||||
|
|
||||||
image_count = h.header.image_count;
|
image_count = h.header.image_count;
|
||||||
// MODDERS:
|
// MODDERS:
|
||||||
|
@ -46,7 +46,7 @@ ptn_error_t ptn_load_palette_show(int slot, const char *fn)
|
||||||
return PE_OUT_OF_MEMORY;
|
return PE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
arc_file_get(h.pal);
|
arc_file_get_far(h.pal);
|
||||||
if(flag_palette_show) {
|
if(flag_palette_show) {
|
||||||
z_palette_set_all_show(h.pal);
|
z_palette_set_all_show(h.pal);
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ ptn_error_t ptn_load_palette_show(int slot, const char *fn)
|
||||||
ptn_image_count[slot] = image_count;
|
ptn_image_count[slot] = image_count;
|
||||||
ptn = ptn_images[slot];
|
ptn = ptn_images[slot];
|
||||||
for(i = 0; i < image_count; i++, ptn++) {
|
for(i = 0; i < image_count; i++, ptn++) {
|
||||||
arc_file_get(ptn->unused_zero);
|
arc_file_get_far(ptn->unused_zero);
|
||||||
arc_file_get(ptn->planes);
|
arc_file_get_far(ptn->planes);
|
||||||
for(y = 0; y < PTN_H; y++) {
|
for(y = 0; y < PTN_H; y++) {
|
||||||
ptn->alpha[y] = ptn_alpha_from(
|
ptn->alpha[y] = ptn_alpha_from(
|
||||||
ptn->planes.B[y],
|
ptn->planes.B[y],
|
||||||
|
|
Loading…
Reference in New Issue