diff --git a/libs/master.lib/macros.inc b/libs/master.lib/macros.inc index cbc8f7c4..b315b1e8 100644 --- a/libs/master.lib/macros.inc +++ b/libs/master.lib/macros.inc @@ -120,19 +120,7 @@ endm ; GRCG color setting macros ; ------------------------- -; In contrast to master.lib's own grcg_setcolor(), these keep the current -; GRCG mode. -GRCG_SETCOLOR_DIRECT_CLOBBERING macro port_reg:req, col_reg:req - mov port_reg, 7Eh - rept 4 - shr ah, 1 - sbb al, al - out dx, al - endm -endm - -; Yup, regular GRCG_SETCOLOR_DIRECT is an exported function, so... -GRCG_SETCOLOR_DIRECT_INLINED macro col_reg:req +GRCG_SETCOLOR_DIRECT macro col_reg:req rept 4 shr col_reg, 1 sbb al, al diff --git a/th04/formats/z_super_roll_put_tiny.asm b/th04/formats/z_super_roll_put_tiny.asm index bf97aade..2c050a30 100644 --- a/th04/formats/z_super_roll_put_tiny.asm +++ b/th04/formats/z_super_roll_put_tiny.asm @@ -106,7 +106,7 @@ z_super_roll_put_tiny_32x32_raw proc near jnz short @@ODD_COLOR_LOOP @@EVEN_COLOR_LOOP: - call grcg_setcolor_direct + call @@grcg_setcolor mov @@rows_left, @@PATTERN_HEIGHT mov di, cs:srpt32x32_vram_topleft cmp di, (RES_Y - @@PATTERN_HEIGHT + 1) * ROW_SIZE @@ -131,7 +131,7 @@ z_super_roll_put_tiny_32x32_raw proc near ; --------------------------------------------------------------------------- @@ODD_COLOR_LOOP: - call grcg_setcolor_direct + call @@grcg_setcolor mov @@rows_left, @@PATTERN_HEIGHT mov di, cs:srpt32x32_vram_topleft cmp di, (RES_Y - @@PATTERN_HEIGHT + 1) * ROW_SIZE @@ -153,9 +153,9 @@ z_super_roll_put_tiny_32x32_raw proc near MRETURN ; --------------------------------------------------------------------------- -; void __usercall near grcg_setcolor_direct(uint4_t col); -grcg_setcolor_direct: - GRCG_SETCOLOR_DIRECT_INLINED ah +; void __usercall near @@grcg_setcolor(uint4_t col); +@@grcg_setcolor: + GRCG_SETCOLOR_DIRECT ah ret even diff --git a/th04/hardware/grcg.h b/th04/hardware/grcg.h new file mode 100644 index 00000000..a399a6d7 --- /dev/null +++ b/th04/hardware/grcg.h @@ -0,0 +1,15 @@ +// Redefined versions of master.lib's grcg_setmode() and grcg_setcolor(). +void near grcg_setmode_rmw_seg1(void); +void near grcg_setmode_tdw(void); + +// In contrast to master.lib's own grcg_setcolor(), these keep the current +// GRCG mode, and reenable interrupts before returning. +#define grcg_setcolor_direct_seg1(col) \ + _AH = col; \ + grcg_setcolor_direct_seg1_raw(); +void near grcg_setcolor_direct_seg1_raw(void); + +#define grcg_setcolor_direct_seg3(col) \ + _AH = col; \ + grcg_setcolor_direct_seg3_raw(); +void near grcg_setcolor_direct_seg3_raw(void); diff --git a/th04/hardware/grcg.inc b/th04/hardware/grcg.inc index f79568e9..5f17d4a5 100644 --- a/th04/hardware/grcg.inc +++ b/th04/hardware/grcg.inc @@ -1,26 +1,25 @@ -; Redefined versions of master.lib's grcg_setmode() and grcg_setcolor(). - -GRCG_SETMODE_RMW_DEF macro instance - ; void pascal near grcg_setmode_rmw(void); - public GRCG_SETMODE_RMW_&instance - grcg_setmode_rmw_&instance proc near +GRCG_SETMODE_RMW_DEF macro sgm + public _grcg_setmode_rmw_seg&sgm + _grcg_setmode_rmw_seg&sgm proc near GRCG_SETMODE_VIA_MOV al, GC_RMW ret - grcg_setmode_rmw_&instance endp + _grcg_setmode_rmw_seg&sgm endp nop endm -GRCG_SETCOLOR_DIRECT_NOINT_DEF macro instance - ; Takes the GC_* color parameter in AH. - - ; void pascal near grcg_setcolor_direct_noint(void); - public GRCG_SETCOLOR_DIRECT_NOINT_&instance - grcg_setcolor_direct_noint_&instance proc near +GRCG_SETCOLOR_DIRECT_DEF macro sgm + public _grcg_setcolor_direct_seg&sgm&_raw + _grcg_setcolor_direct_seg&sgm&_raw proc near cli - GRCG_SETCOLOR_DIRECT_CLOBBERING dx, ah + mov dx, 7Eh + rept 4 + shr ah, 1 + sbb al, al + out dx, al + endm sti ret - grcg_setcolor_direct_noint_&instance endp + _grcg_setcolor_direct_seg&sgm&_raw endp endm ; Convenience macro to prepare ES:DI. diff --git a/th04/hardware/grcg_modecol.asm b/th04/hardware/grcg_modecol.asm index dad44198..7b1217c9 100644 --- a/th04/hardware/grcg_modecol.asm +++ b/th04/hardware/grcg_modecol.asm @@ -1,6 +1,5 @@ GRCG_SETMODE_RMW_DEF 1 -; void pascal near grcg_setmode_tdw(void); public GRCG_SETMODE_TDW grcg_setmode_tdw proc near GRCG_SETMODE_VIA_MOV al, GC_TDW @@ -8,4 +7,4 @@ grcg_setmode_tdw proc near grcg_setmode_tdw endp even -GRCG_SETCOLOR_DIRECT_NOINT_DEF 1 +GRCG_SETCOLOR_DIRECT_DEF 1 diff --git a/th04/hardware/grppsafx.asm b/th04/hardware/grppsafx.asm index 84b365a1..354f1e90 100644 --- a/th04/hardware/grppsafx.asm +++ b/th04/hardware/grppsafx.asm @@ -13,7 +13,7 @@ graph_putsa_fx proc far push ds mov dx, [bp+@@color] GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW - GRCG_SETCOLOR_DIRECT_INLINED dx + GRCG_SETCOLOR_DIRECT dx mov ax, GRAM_400 mov es, ax assume es:nothing diff --git a/th04/main/boss/backdrop.asm b/th04/main/boss/backdrop.asm index c2547666..d052103f 100644 --- a/th04/main/boss/backdrop.asm +++ b/th04/main/boss/backdrop.asm @@ -14,7 +14,7 @@ boss_backdrop_render proc near call cdg_put_noalpha pascal, [bp+@@x], [bp+@@y], 16 call grcg_setmode_tdw mov ah, [bp+@@color] - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call _boss_backdrop_colorfill GRCG_OFF_CLOBBERING dx pop bp diff --git a/th04/main/boss/explosions_small.asm b/th04/main/boss/explosions_small.asm index 25df5d09..b647bfb4 100644 --- a/th04/main/boss/explosions_small.asm +++ b/th04/main/boss/explosions_small.asm @@ -12,7 +12,7 @@ explosions_small_update_and_render proc near mov ax, GRAM_400 mov es, ax assume es:nothing - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov si, offset _explosions_small mov [bp+@@i], 0 jmp @@more_explosions? diff --git a/th04/main/circles.asm b/th04/main/circles.asm index 66760019..45cd4c57 100644 --- a/th04/main/circles.asm +++ b/th04/main/circles.asm @@ -144,7 +144,7 @@ circles_render proc near push si push di mov ah, _circles_color - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov si, offset _circles xor di, di jmp short @@more? diff --git a/th04/main/gather_render.asm b/th04/main/gather_render.asm index 37a227e7..511d18e6 100644 --- a/th04/main/gather_render.asm +++ b/th04/main/gather_render.asm @@ -50,7 +50,7 @@ gather_render proc far jz short @@same_color mov [bp+@@col], al mov ah, [bp+@@col] - call grcg_setcolor_direct_noint_2 + call _grcg_setcolor_direct_seg3_raw @@same_color: xor di, di diff --git a/th04/main/item/splashes_render.asm b/th04/main/item/splashes_render.asm index 80dbe082..0bca53de 100644 --- a/th04/main/item/splashes_render.asm +++ b/th04/main/item/splashes_render.asm @@ -8,7 +8,7 @@ item_splashes_render proc near push si push di mov ah, 15 - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov si, offset _item_splashes mov [bp+@@i], 0 jmp short @@more? diff --git a/th04/main/player/render.asm b/th04/main/player/render.asm index 832e8547..bd55432c 100644 --- a/th04/main/player/render.asm +++ b/th04/main/player/render.asm @@ -53,7 +53,7 @@ player_render proc near @@got_options?: cmp _shot_level, 2 jb @@ret - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ax, _player_option_pos_cur.x sar ax, 4 ; Technically, DI = AX + PLAYFIELD_X - PLAYER_OPTION_DISTANCE - (PLAYER_OPTION_W / 2) diff --git a/th04/main/sparks.asm b/th04/main/sparks.asm index 213737ef..057ae0b0 100644 --- a/th04/main/sparks.asm +++ b/th04/main/sparks.asm @@ -52,7 +52,7 @@ sparks_render proc near push si push di mov ah, GC_BR - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, GRAM_400 mov es, ax assume es:nothing diff --git a/th04_main.asm b/th04_main.asm index 7c69b891..85baaa20 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -393,7 +393,7 @@ loc_ABD8: call main_01:enemies_render call main_01:shots_render call main_01:player_render - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 call gather_render call main_01:sparks_render call main_01:items_render @@ -5119,7 +5119,7 @@ loc_E276: mov al, _stage_frame_mod2 add al, 8 mov ah, al - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov si, word ptr dword_2560C+2 call main_01:scroll_subpixel_y_to_vram_seg1 pascal, (16 shl 4) mov dx, ax @@ -5933,9 +5933,9 @@ loc_E98E: sar ax, 4 add ax, -16 mov di, ax - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, _boss_phase_frame add ax, ax mov dx, 80 @@ -5963,9 +5963,9 @@ loc_E9DD: sar ax, 4 add ax, 16 mov di, ax - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call grcg_circlefill pascal, si, di, 16 jmp short loc_EA55 ; --------------------------------------------------------------------------- @@ -5980,9 +5980,9 @@ loc_EA0D: sar ax, 4 add ax, -16 mov di, ax - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, _boss_phase_frame shl ax, 3 add ax, 16 @@ -6328,9 +6328,9 @@ var_2 = word ptr -2 enter 4, 0 push si push di - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_RG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov di, 1 jmp short loc_ECC7 ; --------------------------------------------------------------------------- @@ -8871,7 +8871,7 @@ var_1 = byte ptr -1 enter 2, 0 call main_01:grcg_setmode_tdw mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fillm_0_40_384_274 GRCG_OFF_CLOBBERING dx push (32 shl 16) or 56 @@ -8923,9 +8923,9 @@ loc_10096: call snd_se_play pascal, 9 loc_100FE: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_B - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 0 call main_01:sub_1030D GRCG_OFF_CLOBBERING dx @@ -8946,7 +8946,7 @@ var_2 = word ptr -2 push si call main_01:grcg_setmode_tdw mov ah, GC_RGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fillm_0_40_384_274 GRCG_OFF_CLOBBERING dx push (32 shl 16) or 56 @@ -9027,9 +9027,9 @@ loc_101D7: call snd_se_play pascal, 9 loc_101F4: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_BRG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 1 call main_01:sub_1030D GRCG_OFF_CLOBBERING dx @@ -9490,7 +9490,7 @@ shots_render proc near push di mov ax, GRAM_400 mov es, ax - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 cmp word_25608, 20h ; ' ' jbe short loc_10569 call main_01:sub_E1F4 @@ -10208,9 +10208,9 @@ loc_10F5E: ; --------------------------------------------------------------------------- loc_10F80: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp stage_id, 5 jnb short loc_10F99 push 150A80h @@ -10230,7 +10230,7 @@ loc_10FA1: push 16800002h call main_01:sub_10EA5 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _stage_bgm_title_len push ax @@ -10347,9 +10347,9 @@ loc_110A1: call text_putsa loc_11107: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp stage_id, 5 jnb short loc_11120 push 150A80h @@ -10369,7 +10369,7 @@ loc_11128: push 16800002h call main_01:sub_10EA5 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _stage_bgm_title_len push ax @@ -10436,16 +10436,16 @@ loc_111BB: ; --------------------------------------------------------------------------- loc_111D8: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 30h ; '0' sub ax, _boss_bgm_title_len push ax push 16800002h call main_01:sub_10EA5 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _boss_bgm_title_len push ax @@ -10488,16 +10488,16 @@ loc_11237: call text_putsa loc_1127E: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 30h ; '0' sub ax, _boss_bgm_title_len push ax push 16800002h call main_01:sub_10EA5 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _boss_bgm_title_len push ax @@ -10696,12 +10696,12 @@ var_2 = word ptr -2 mov [bp+var_2], ax add si, 20h ; ' ' add di, 18h - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_I - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call grcg_circle pascal, si, di, [bp+var_2] mov ah, GC_BI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push si push di mov ax, [bp+var_2] @@ -10770,9 +10770,9 @@ loc_118AE: call super_put_1plane pascal, si, di, [bp+var_2], large PLANE_PUT or GC_BRGI loc_118BE: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_RG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov [bp+var_A], 0B204h mov [bp+var_4], 0 jmp short loc_11932 @@ -10893,12 +10893,12 @@ var_2 = word ptr -2 mov [bp+var_2], ax add si, 24 add di, 8 - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call grcg_circle pascal, si, di, [bp+var_2] mov ah, GC_RG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push si push di mov ax, [bp+var_2] @@ -11137,14 +11137,14 @@ loc_11BD1: jl loc_11B52 cmp byte ptr [si], 0 jz short loc_11C16 - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_BGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call grcg_circlefill pascal, word ptr [si+2], word ptr [si+4], word ptr [si+10h] cmp byte ptr [si], 1 jz short loc_11C16 mov ah, [si+18h] - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push word ptr [si+2] push word ptr [si+4] mov ax, [si+12h] @@ -11965,7 +11965,7 @@ loc_122EB: loc_12309: call main_01:grcg_setmode_tdw mov ah, GC_RGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fillm_64_56_256_256 GRCG_OFF_CLOBBERING dx push (96 shl 16) or 72 @@ -12043,7 +12043,7 @@ loc_12378: loc_12396: call main_01:grcg_setmode_tdw mov ah, GC_BRGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fillm_96_112_288_256 GRCG_OFF_CLOBBERING dx push (128 shl 16) or 128 @@ -12200,7 +12200,7 @@ loc_1248C: mov fp_2CF2C, offset sub_123F1 loc_12492: - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 cmp byte_2CDD1, 80h jnb short loc_124A1 mov al, byte_2CDD1 @@ -12216,7 +12216,7 @@ loc_124A7: cmp byte_2CDD0, 10h jnb short loc_124D7 mov ah, GC_BRG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw test byte_2CDD0, 1 jz short loc_124C5 mov al, [bp+var_9] @@ -12239,7 +12239,7 @@ loc_124D2: loc_124D7: mov ah, GC_RG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp byte_23242, 0 jnz short loc_12508 mov Palettes, 0 @@ -12711,7 +12711,7 @@ var_1 = byte ptr -1 cmp _boss_phase, 0 jnz short loc_12921 mov ah, GC_RGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fill GRCG_OFF_CLOBBERING dx cmp _boss_phase_frame, 2 @@ -12752,7 +12752,7 @@ loc_12921: idiv bx mov [bp+var_1], al mov ah, GC_RGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp [bp+var_1], 8 jnb short loc_12944 call main_01:playfield_fill @@ -12781,7 +12781,7 @@ loc_12958: loc_12964: mov ah, GC_RGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fill GRCG_OFF_CLOBBERING dx @@ -12834,7 +12834,7 @@ loc_12996: loc_129B4: call main_01:grcg_setmode_tdw mov ah, GC_RGI - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:playfield_fillm_0_0_384_192 GRCG_OFF_CLOBBERING dx push (32 shl 16) or 16 @@ -13268,10 +13268,10 @@ loc_12D6D: cmp _bullet_clear_time, 0 jnz short loc_12DBE mov ah, 0Fh - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:_pellets_render_top mov ah, GC_RG - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call main_01:_pellets_render_bottom jmp short @@ret ; --------------------------------------------------------------------------- @@ -13612,7 +13612,7 @@ loc_13083: jl short loc_130E9 cmp _boss_phase_frame, 96 jge short loc_130E9 - call main_01:grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 cmp _stage_frame_mod2, 0 jz short loc_130B6 mov ah, GC_RG @@ -13623,7 +13623,7 @@ loc_130B6: mov ah, 0Fh loc_130B8: - call main_01:grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov [bp+var_2], 0B204h xor si, si jmp short loc_130E4 @@ -13920,8 +13920,8 @@ include th04/main/pointnum/add.asm include th04/math/vector2_near.asm nop include th04/main/sparks_add.asm -GRCG_SETCOLOR_DIRECT_NOINT_DEF 2 -GRCG_SETMODE_RMW_DEF 2 +GRCG_SETCOLOR_DIRECT_DEF 3 +GRCG_SETMODE_RMW_DEF 3 include th04/main/item/splashes_update.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th05/main/bullet/b6balls_render.asm b/th05/main/bullet/b6balls_render.asm index a307fb90..dce0fb40 100644 --- a/th05/main/bullet/b6balls_render.asm +++ b/th05/main/bullet/b6balls_render.asm @@ -15,7 +15,7 @@ b6balls_render proc near cmp [si+b6ball_t.flag], 1 jnz short @@no_cloud mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, [si+b6ball_t.pos.cur.x] sar ax, 4 add ax, PLAYFIELD_X diff --git a/th05/main/bullet/curvebullets_render.asm b/th05/main/bullet/curvebullets_render.asm index 552e7ff5..73408f86 100644 --- a/th05/main/bullet/curvebullets_render.asm +++ b/th05/main/bullet/curvebullets_render.asm @@ -50,7 +50,7 @@ endm cmp [di+curvebullet_trail_t.flag], 0 jz @@bullet_next mov ah, [di+curvebullet_trail_t.CBT_col] - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov si, (CURVEBULLET_TRAIL_NODE_COUNT - 1) jmp short @@nodes_more? ; --------------------------------------------------------------------------- diff --git a/th05/main/lasers_update_render.asm b/th05/main/lasers_update_render.asm index 2d7fbd5e..49f7e649 100644 --- a/th05/main/lasers_update_render.asm +++ b/th05/main/lasers_update_render.asm @@ -224,7 +224,7 @@ lasers_render proc near cmp [si+laser_t.coords.LASER_width], 3 jb short @@draw_inner_circle? mov ah, [si+laser_t.LASER_color] - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp [si+laser_t.coords.starts_at_distance], (16 shl 4) jg short @@draw_outer_ray? push [bp+@@draw_x] @@ -265,7 +265,7 @@ lasers_render proc near @@draw_inner_circle?: mov ah, 15 - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp [si+laser_t.coords.starts_at_distance], (16 shl 4) jg short @@draw_inner_ray_or_line? push [bp+@@draw_x] @@ -329,7 +329,7 @@ lasers_render proc near @@decay: mov ah, 15 - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw shl [bp+@@radius], 3 push offset _drawpoint push [si+laser_t.coords.origin.x] diff --git a/th05/music/piano.asm b/th05/music/piano.asm index f4c1f949..dbf61784 100644 --- a/th05/music/piano.asm +++ b/th05/music/piano.asm @@ -19,7 +19,7 @@ _piano_setup proc far mov di, (PIANO_Y + (5 * PIANO_H_PADDED)) * ROW_SIZE call piano_draw_part_keys mov ah, GC_RI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw piano_label_puts 0, pl_F, pl_M, pl_1 piano_label_puts 1, pl_F, pl_M, pl_2 piano_label_puts 2, pl_F, pl_M, pl_3 @@ -73,7 +73,7 @@ _piano_render proc far mov si, offset piano_notes_t.fm[4] call piano_part_render mov ah, GC_RI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov di, (PIANO_Y + (5 * PIANO_H_PADDED)) * ROW_SIZE add bx, 4 ; SSGPart[0] call piano_get_note @@ -111,7 +111,7 @@ piano_part_render proc near mov _piano_notes_cur.fm[si], al call piano_draw_part_keys mov ah, GC_RI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov al, _piano_notes_cur.fm[si] call piano_draw_pressed_key @@ -155,7 +155,7 @@ piano_draw_part_keys proc near push di push si mov ah, GC_GI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw add di, PIANO_VRAM_X mov ax, PIANO_KEYS_WHITE mov dl, PIANO_H @@ -167,7 +167,7 @@ piano_draw_part_keys proc near dec dl jnz short @@white_key_loop mov ah, GC_RGI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov si, offset _PIANO_KEYS_BLACK sub di, ROW_SIZE * PIANO_H mov dl, PIANO_BLACK_H diff --git a/th05_main.asm b/th05_main.asm index 2b0016cb..ec49ed5a 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -441,7 +441,7 @@ loc_AF2D: call enemies_render call shots_render call player_render - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 call _boss_custombullets_render call lasers_render call gather_render @@ -2529,7 +2529,7 @@ loc_C8CE: loc_C8D4: call far ptr palette_show - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov si, 38C2h xor di, di jmp loc_C98D @@ -2550,7 +2550,7 @@ loc_C8E4: add ax, 10h mov [bp+var_4], ax mov ah, GC_BRG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, [si+6] cwd sub ax, dx @@ -2566,7 +2566,7 @@ loc_C8E4: push [bp+var_4] call grcg_boxfill mov ah, GC_RG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw dec [bp+var_6] mov ax, [bp+var_2] sub ax, [bp+var_6] @@ -2578,7 +2578,7 @@ loc_C8E4: push [bp+var_4] call grcg_boxfill mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw dec [bp+var_6] mov ax, [bp+var_2] sub ax, [bp+var_6] @@ -2823,13 +2823,13 @@ sub_CB30 proc near call grcg_vline pascal, (238 shl 16) or PLAYFIELD_Y, PLAYFIELD_Y + 47 call grcg_vline pascal, (238 shl 16) or 336, PLAYFIELD_BOTTOM - 1 mov ah, GC_BI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call grcg_vline pascal, (208 shl 16) or PLAYFIELD_Y, PLAYFIELD_Y + 47 call grcg_vline pascal, (208 shl 16) or 336, PLAYFIELD_BOTTOM - 1 call grcg_vline pascal, (239 shl 16) or PLAYFIELD_Y, PLAYFIELD_Y + 47 call grcg_vline pascal, (239 shl 16) or 336, PLAYFIELD_BOTTOM - 1 mov ah, 15 - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call sub_CA7B mov al, byte_2429B mov ah, 0 @@ -3526,7 +3526,7 @@ loc_D108: loc_D124: call grcg_setmode_tdw mov ah, GC_RGI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call playfield_fillm_0_0_384_192__1 GRCG_OFF_CLOBBERING dx push (32 shl 16) or 16 @@ -3603,7 +3603,7 @@ loc_D194: loc_D1B0: call grcg_setmode_tdw mov ah, GC_RGI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call playfield_fillm_0_205_384_163 GRCG_OFF_CLOBBERING dx push (32 shl 16) or 221 @@ -3681,7 +3681,7 @@ loc_D220: loc_D23E: call grcg_setmode_tdw mov ah, GC_RGI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call playfield_fillm_64_56_256_256 GRCG_OFF_CLOBBERING dx push (96 shl 16) or 72 @@ -3755,7 +3755,7 @@ var_1 = byte ptr -1 loc_D2C7: call grcg_setmode_tdw mov ah, GC_RGI - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call playfield_fillm_0_0_384_192__2 GRCG_OFF_CLOBBERING dx push (32 shl 16) or 16 @@ -4208,9 +4208,9 @@ loc_D62B: loc_D630: cmp di, 2 jl short loc_D5F1 - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_BRG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call sub_D327 push 3AC0h push 12h @@ -4225,7 +4225,7 @@ loc_D630: push 0Ch call sub_D4F8 mov ah, GC_RG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 3AC0h push 6 call sub_D4F8 @@ -4233,7 +4233,7 @@ loc_D630: push 6 call sub_D4F8 mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 3AC0h push 0 call sub_D4F8 @@ -4472,9 +4472,9 @@ loc_D829: jl short loc_D808 loc_D82E: - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_BRG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call sub_D327 push 3AC0h push 12h @@ -4489,7 +4489,7 @@ loc_D82E: push 0Ch call sub_D4F8 mov ah, GC_RG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 3AC0h push 6 call sub_D4F8 @@ -4497,7 +4497,7 @@ loc_D82E: push 6 call sub_D4F8 mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 3AC0h push 0 call sub_D4F8 @@ -4698,9 +4698,9 @@ loc_D9C1: jl short loc_D9A0 loc_D9C6: - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_BRG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call sub_D327 push 3AC0h push 12h @@ -4715,7 +4715,7 @@ loc_D9C6: push 0Ch call sub_D4F8 mov ah, GC_RG - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 3AC0h push 6 call sub_D4F8 @@ -4723,7 +4723,7 @@ loc_D9C6: push 6 call sub_D4F8 mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw push 3AC0h push 0 call sub_D4F8 @@ -7415,10 +7415,10 @@ loc_101BD: or ax, ax jnz short loc_1018A mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call _pellets_render_top mov ah, byte ptr _pellet_bottom_col - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw call _pellets_render_bottom jmp short @@ret ; --------------------------------------------------------------------------- @@ -10337,9 +10337,9 @@ loc_11AD6: ; --------------------------------------------------------------------------- loc_11AF8: - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp stage_id, 5 jnb short loc_11B11 push 150A80h @@ -10359,7 +10359,7 @@ loc_11B19: push 16800002h call sub_11A1D mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _stage_bgm_title_len push ax @@ -10437,9 +10437,9 @@ loc_11BDB: call text_putsa pascal, ax, 23, _stage_bgm_title, TX_WHITE loc_11C2D: - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw cmp stage_id, 5 jnb short loc_11C46 push 150A80h @@ -10459,7 +10459,7 @@ loc_11C4E: push 16800002h call sub_11A1D mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _stage_bgm_title_len push ax @@ -10526,16 +10526,16 @@ loc_11CE1: ; --------------------------------------------------------------------------- loc_11CFE: - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 30h ; '0' sub ax, _boss_bgm_title_len push ax push 16800002h call sub_11A1D mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _boss_bgm_title_len push ax @@ -10566,16 +10566,16 @@ loc_11D53: call text_putsa pascal, ax, 23, _boss_bgm_title, TX_WHITE loc_11D90: - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov ah, GC_G - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 30h ; '0' sub ax, _boss_bgm_title_len push ax push 16800002h call sub_11A1D mov ah, 0Fh - call grcg_setcolor_direct_noint_1 + call _grcg_setcolor_direct_seg1_raw mov ax, 33h ; '3' sub ax, _boss_bgm_title_len push ax @@ -11132,7 +11132,7 @@ shots_render proc near mov ax, GRAM_400 mov es, ax assume es:nothing - call grcg_setmode_rmw_1 + call _grcg_setmode_rmw_seg1 mov di, offset _shots_alive mov [bp+@@i], 0 jmp short @@shots_more? @@ -12365,8 +12365,8 @@ include th04/math/vector2_near.asm include th04/main/sparks_add.asm include th05/main/bullet/patnum_for_angle.asm -GRCG_SETCOLOR_DIRECT_NOINT_DEF 2 -GRCG_SETMODE_RMW_DEF 2 +GRCG_SETCOLOR_DIRECT_DEF 3 +GRCG_SETMODE_RMW_DEF 3 include th05/main/player/angle.asm include th05/main/playperf_adjust_speed.asm diff --git a/th05_maine.asm b/th05_maine.asm index 51ccf529..6defa654 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -170,7 +170,7 @@ arg_4 = word ptr 0Ah nop loc_2E02: - GRCG_SETCOLOR_DIRECT_INLINED ah + GRCG_SETCOLOR_DIRECT ah mov ch, dl loc_2E1C: diff --git a/th05_op.asm b/th05_op.asm index bc97f0e4..c463c8bf 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -3505,7 +3505,7 @@ include th02/exit.asm include th04/math/vector1_at.asm include th04/math/vector2_at.asm include th05/music/piano.asm -GRCG_SETCOLOR_DIRECT_NOINT_DEF 1 +GRCG_SETCOLOR_DIRECT_DEF 1 db 0 include th04/bgimage_put_rect.asm include th05/snd/load.asm