diff --git a/platform.h b/platform.h index a4fe8523..94425e30 100644 --- a/platform.h +++ b/platform.h @@ -8,7 +8,7 @@ // __TURBOC__ is #define'd on both "Borland" and "Turbo" editions, unlike // __BORLANDC__, which is only #define'd on the former. #if defined(__TURBOC__) && defined(__MSDOS__) -typedef char bool; +typedef unsigned char bool; typedef int bool16; # define false 0 # define true 1 diff --git a/th01/formats/grp.cpp b/th01/formats/grp.cpp index 580aed09..f556c009 100644 --- a/th01/formats/grp.cpp +++ b/th01/formats/grp.cpp @@ -17,7 +17,7 @@ extern "C" { extern int8_t* grp_buf; extern int flag_palette_show; // = true extern int flag_grp_put; // = true -extern unsigned char flag_grp_colorkey; // = false +extern bool flag_grp_colorkey; // = false int grp_palette_load_show_sane(const char *fn) { diff --git a/th01/hardware/input.hpp b/th01/hardware/input.hpp index 9054d5e8..04a5fc3e 100644 --- a/th01/hardware/input.hpp +++ b/th01/hardware/input.hpp @@ -1,5 +1,5 @@ /// Shared input macros -extern unsigned char input_shot; +extern bool input_shot; extern bool input_ok; #define input_func_bool(var) { var = true; } else { var = false; } @@ -11,13 +11,13 @@ extern bool input_ok; #define INPUT_RIGHT 0x01 #define INPUT_LEFT 0x02 -extern unsigned char input_up; -extern unsigned char input_down; -extern unsigned char input_lr; -extern unsigned char input_strike; +extern bool input_up; +extern bool input_down; +extern bool input_lr; +extern bool input_strike; extern bool input_mem_enter; extern bool input_mem_leave; -extern unsigned char paused; +extern bool paused; extern bool done; extern bool input_bomb; diff --git a/th01/main/bullet/pellet.hpp b/th01/main/bullet/pellet.hpp index 2c5d7cbb..5704aa5a 100644 --- a/th01/main/bullet/pellet.hpp +++ b/th01/main/bullet/pellet.hpp @@ -129,7 +129,7 @@ protected: } public: - unsigned char moving; + bool moving; unsigned char motion_type; // Automatically calculated every frame for PM_SPIN diff --git a/th01/main/hud/hud.cpp b/th01/main/hud/hud.cpp index 677539f0..44a43a3e 100644 --- a/th01/main/hud/hud.cpp +++ b/th01/main/hud/hud.cpp @@ -59,7 +59,7 @@ static const pixel_t SCORE_AND_CARDCOMBO_W = (CARDCOMBO_RIGHT - SCORE_LEFT); /// ------- // Forces re-rendering of all full-width numbers on the HUD, even if they // haven't changed since the last render call. -extern unsigned char fwnum_force_rerender; +extern bool fwnum_force_rerender; // extern uint8_t *hud_bg; extern uint8_t hud_bg_rle_run_byte; @@ -87,7 +87,7 @@ inline screen_x_t col_left(screen_x_t first_left, int col) { #define digit_changed(var, var_prev, divisor) \ ((var_prev / divisor) % 10) != ((var / divisor) % 10) || \ - (fwnum_force_rerender == 1) + (fwnum_force_rerender == true) // Copies the (⌊[w]/16⌋*16)×[ROW_H] pixels starting at (⌊left/8⌋*8, top) from // VRAM page 0 to VRAM page 1. diff --git a/th01/main/player/player.hpp b/th01/main/player/player.hpp index bd22cf78..405c3fa0 100644 --- a/th01/main/player/player.hpp +++ b/th01/main/player/player.hpp @@ -24,8 +24,8 @@ inline screen_y_t player_anim_forward_top(void) { void player_move_and_clamp(int delta); void invincibility_sprites_update_and_render(bool16 invincible); -extern unsigned char player_deflecting; -extern unsigned char player_sliding; +extern bool player_deflecting; +extern bool player_sliding; extern bool16 player_invincible; extern int lives; diff --git a/th01/main/player/shots.hpp b/th01/main/player/shots.hpp index e98b3f32..95b1683a 100644 --- a/th01/main/player/shots.hpp +++ b/th01/main/player/shots.hpp @@ -11,7 +11,7 @@ struct CShots { int unknown[SHOT_COUNT]; // A shot slot can be considered "alive" if either of these are nonzero. - unsigned char moving[SHOT_COUNT]; + bool moving[SHOT_COUNT]; unsigned char decay_frame[SHOT_COUNT]; void add(screen_x_t new_left, screen_y_t new_top); diff --git a/th01/main/vars.hpp b/th01/main/vars.hpp index 6cbf70ce..584f778f 100644 --- a/th01/main/vars.hpp +++ b/th01/main/vars.hpp @@ -7,6 +7,6 @@ extern char credit_bombs; extern char lives_extra; extern char stage_num; -extern unsigned char first_stage_in_scene; +extern bool first_stage_in_scene; extern unsigned long score; diff --git a/th02/op_06.cpp b/th02/op_06.cpp index b333c2cb..f922b8fe 100644 --- a/th02/op_06.cpp +++ b/th02/op_06.cpp @@ -64,13 +64,13 @@ char angle[MUSIC_POLYGONS]; char rot_speed[MUSIC_POLYGONS]; unsigned char music_sel; -unsigned char music_page; +page_t music_page; dots8_t *screen_back_B; dots8_t *cmt_back[PL_COUNT]; void pascal near draw_track(unsigned char sel, unsigned char color) { - unsigned char other_page = 1 - music_page; + page_t other_page = (1 - music_page); graph_accesspage(other_page); graph_putsa_fx( 16, ((sel + 6) * GLYPH_H), (color | FX_WEIGHT_BOLD), MUSIC_TITLES[sel] @@ -320,7 +320,7 @@ controls: } if(key_det & INPUT_SHOT || key_det & INPUT_OK) { if(music_sel != SEL_QUIT) { - char midi_active = snd_midi_active; + bool midi_active = snd_midi_active; snd_midi_active = snd_midi_possible; snd_load(MUSIC_FILES[music_sel], SND_LOAD_SONG); diff --git a/th02/snd/data.c b/th02/snd/data.c index 6c2222a1..86eb08e0 100644 --- a/th02/snd/data.c +++ b/th02/snd/data.c @@ -1,2 +1,2 @@ -char snd_active = 0; +bool snd_active = 0; char snd_unused = 0; diff --git a/th02/snd/snd.h b/th02/snd/snd.h index e809c8e6..5764f186 100644 --- a/th02/snd/snd.h +++ b/th02/snd/snd.h @@ -1,7 +1,7 @@ #include "defconv.h" extern char snd_interrupt_if_midi; -extern char snd_midi_possible; +extern bool snd_midi_possible; #if GAME <= 3 typedef enum { SND_BGM_OFF, @@ -9,9 +9,9 @@ extern char snd_midi_possible; SND_BGM_MIDI } snd_bgm_mode_t; - extern char snd_active; - extern unsigned char snd_midi_active; - extern char snd_fm_possible; + extern bool snd_active; + extern bool snd_midi_active; + extern bool snd_fm_possible; #endif int snd_pmd_resident(void); diff --git a/th02/th02.h b/th02/th02.h index 7e8dd82b..0e37f449 100644 --- a/th02/th02.h +++ b/th02/th02.h @@ -100,7 +100,7 @@ typedef struct { int unused_1; char unused_2; unsigned char op_main_retval; - unsigned char perf; + bool perf; char unused_3; char shottype; char demo_num; diff --git a/th03_main.asm b/th03_main.asm index 962ea666..e9a50b1e 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -8904,7 +8904,7 @@ include th02/formats/pi_load.asm extern @MRS_LOAD$QINXC:proc extern @MRS_FREE$QI:proc extern @MRS_PUT_8$QIUII:proc - extern @MRS_PUT_NOALPHA_8$QIUIIC:proc + extern @MRS_PUT_NOALPHA_8$QIUIIUC:proc extern @MRS_HFLIP$QI:proc SPRITE16_SPRITES_COMMIT procdesc pascal far SPRITE16_PUT procdesc pascal far \ @@ -18944,7 +18944,7 @@ loc_14967: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc mov al, [bp+@@frame] mov ah, 0 mov bx, 8 @@ -20079,7 +20079,7 @@ loc_152D7: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc jmp short loc_15323 ; --------------------------------------------------------------------------- @@ -21159,7 +21159,7 @@ loc_15C32: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc jmp short loc_15CB0 ; --------------------------------------------------------------------------- @@ -23892,7 +23892,7 @@ loc_172FF: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc jmp short loc_1737D ; --------------------------------------------------------------------------- @@ -26162,7 +26162,7 @@ loc_18526: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc jmp short loc_185A3 ; --------------------------------------------------------------------------- @@ -26551,7 +26551,7 @@ loc_188B2: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc mov al, [bp+@@frame] mov ah, 0 mov bx, 4 @@ -26797,7 +26797,7 @@ loc_18B3D: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc call egc_on jmp short @@ret ; --------------------------------------------------------------------------- @@ -27017,7 +27017,7 @@ loc_18D42: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc jmp short loc_18DBF ; --------------------------------------------------------------------------- @@ -27154,7 +27154,7 @@ loc_18E7C: mov al, _pid_current mov ah, 0 push ax ; altered_colors - call @mrs_put_noalpha_8$qiuiic + call @mrs_put_noalpha_8$qiuiiuc call grcg_setcolor pascal, (GC_RMW shl 16) + 15 mov ax, 900h sub ax, word_220EC diff --git a/th04/resident.hpp b/th04/resident.hpp index b0fb6e30..a842d009 100644 --- a/th04/resident.hpp +++ b/th04/resident.hpp @@ -51,7 +51,7 @@ typedef struct { unsigned long slow_frames; unsigned long frames; // (including bosses, see th04/frames.h) bool zunsoft_shown; - unsigned char turbo_mode; + bool turbo_mode; int8_t unused_5[182]; } resident_t; diff --git a/th05/resident.hpp b/th05/resident.hpp index e1ede30b..a33886df 100644 --- a/th05/resident.hpp +++ b/th05/resident.hpp @@ -13,7 +13,7 @@ typedef struct { unsigned char stage; unsigned char playchar; unsigned char se_mode; - unsigned char turbo_mode; + bool turbo_mode; bool debug; unsigned char debug_stage; unsigned char debug_power;