From 6c4852f7894de298cdaf44d10b2836f1ff249c11 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Mon, 11 Nov 2019 00:18:22 +0100 Subject: [PATCH] [Position independence] False positives in master.lib GRCG function calls Yup, function parameters that can clearly be identified as coordinates are by far the fastest way to raise the calculated position independence percentage. Kinda makes it sound like useless work, which I'm only doing because it's dictated by some counting algorithm on a website, but decompilation will want to un-hex all of these values anyway. We're merely doing that right now, across all games. Part of P0058, funded by -Tom-. --- libs/sprite16/sprite16.h | 2 + libs/sprite16/sprite16.inc | 2 + th02/playfld.h | 17 +++ th02/playfld.inc | 2 + th02_main.asm | 212 ++++++++++++------------------------- th02_maine.asm | 14 +-- th03_main.asm | 207 ++++++++++++------------------------ th03_mainl.asm | 52 +++------ th03_op.asm | 16 +-- th04_main.asm | 73 ++++--------- th04_maine.asm | 4 +- th04_op.asm | 78 ++++++-------- th05_main.asm | 128 +++++++--------------- th05_maine.asm | 57 ++++------ th05_op.asm | 44 ++++---- 15 files changed, 316 insertions(+), 592 deletions(-) create mode 100644 th02/playfld.h diff --git a/libs/sprite16/sprite16.h b/libs/sprite16/sprite16.h index b5bdf658..8ce65203 100644 --- a/libs/sprite16/sprite16.h +++ b/libs/sprite16/sprite16.h @@ -33,3 +33,5 @@ typedef enum { OVERLAP_CLEAR = 1, OVERLAP_OR = 0 } sprite16_overlap_t; + +#define SPRITE16_RES_Y 200 diff --git a/libs/sprite16/sprite16.inc b/libs/sprite16/sprite16.inc index d4283c7a..a99978e5 100644 --- a/libs/sprite16/sprite16.inc +++ b/libs/sprite16/sprite16.inc @@ -12,3 +12,5 @@ SPRITE16_SET_MASK = 8 OVERLAP_CLEAR = 1 OVERLAP_OR = 0 + +SPRITE16_RES_Y = 200 diff --git a/th02/playfld.h b/th02/playfld.h new file mode 100644 index 00000000..1a14c072 --- /dev/null +++ b/th02/playfld.h @@ -0,0 +1,17 @@ +#define PLAYFIELD_X (32) +#define PLAYFIELD_Y (16) +#define PLAYFIELD_W (384) +#define PLAYFIELD_H (368) + +#define PLAYFIELD_LEFT (PLAYFIELD_X) +#define PLAYFIELD_TOP (PLAYFIELD_Y) +#define PLAYFIELD_RIGHT (PLAYFIELD_X + PLAYFIELD_W) +#define PLAYFIELD_BOTTOM (PLAYFIELD_Y + PLAYFIELD_H) + +#define PLAYFIELD_VRAM_X (PLAYFIELD_X / 8) +#define PLAYFIELD_VRAM_W (PLAYFIELD_W / 8) +#define PLAYFIELD_VRAM_RIGHT (PLAYFIELD_RIGHT / 8) + +#define PLAYFIELD_TRAM_X (PLAYFIELD_X / 8) +#define PLAYFIELD_TRAM_W (PLAYFIELD_W / 8) +#define PLAYFIELD_TRAM_RIGHT (PLAYFIELD_RIGHT / 8) diff --git a/th02/playfld.inc b/th02/playfld.inc index 440b1861..f1dc4457 100644 --- a/th02/playfld.inc +++ b/th02/playfld.inc @@ -10,6 +10,8 @@ PLAYFIELD_BOTTOM = PLAYFIELD_Y + PLAYFIELD_H PLAYFIELD_VRAM_X = PLAYFIELD_X / 8 PLAYFIELD_VRAM_W = PLAYFIELD_W / 8 +PLAYFIELD_VRAM_RIGHT = PLAYFIELD_RIGHT / 8 PLAYFIELD_TRAM_X = PLAYFIELD_X / 8 PLAYFIELD_TRAM_W = PLAYFIELD_W / 8 +PLAYFIELD_TRAM_RIGHT = PLAYFIELD_RIGHT / 8 diff --git a/th02_main.asm b/th02_main.asm index 01ef42e3..f259fea1 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -1672,10 +1672,10 @@ loc_47E6: push GC_RMW push 0 nopcall grcg_setcolor - push 4 - push 10h - push 34h ; '4' - push 180h + push PLAYFIELD_VRAM_X + push PLAYFIELD_Y + push PLAYFIELD_VRAM_RIGHT + push PLAYFIELD_BOTTOM nopcall grcg_byteboxfill_x nopcall grcg_off @@ -2416,18 +2416,12 @@ loc_B8B5: add sp, 4 loc_B922: - pushd 0 - push 27F018Fh - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (RES_Y - 1) call grcg_setcolor pascal, (GC_RMW shl 16) + 11 graph_accesspage 0 - push 1A00000h - push 23F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_RIGHT shl 16) or 0, (575 shl 16) or (RES_Y - 1) graph_accesspage 1 - push 1A00000h - push 23F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_RIGHT shl 16) or 0, (575 shl 16) or (RES_Y - 1) call grcg_off mov _page_front, 1 mov al, _page_front @@ -7870,9 +7864,7 @@ loc_E680: mov al, byte_2287E mov byte_21A4C, al mov byte_2287E, 2 - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) jmp loc_E892 ; --------------------------------------------------------------------------- @@ -7884,9 +7876,7 @@ loc_E6CC: call grcg_setcolor pascal, (GC_RMW shl 16) + 11 loc_E6E8: - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) call grcg_off cmp word_218B6, 40h jg short loc_E74D @@ -8073,9 +8063,7 @@ loc_E8C9: mov al, byte_2287E mov byte_21A53, al mov byte_2287E, 2 - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) mov [bp+var_4], 0 jmp short loc_E902 ; --------------------------------------------------------------------------- @@ -8096,9 +8084,7 @@ loc_E902: loc_E915: cmp word_218B6, 64h ; 'd' jge loc_E9A6 - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) cmp word_218B6, 50h ; 'P' jl short loc_E94C mov ax, word_218B6 @@ -8165,9 +8151,7 @@ loc_E9DB: loc_E9F3: call grcg_setcolor pascal, (GC_RMW shl 16) + 15 - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) jmp short loc_EA60 ; --------------------------------------------------------------------------- @@ -8308,9 +8292,7 @@ loc_EB07: mov al, byte_2287E mov byte_21A54, al mov byte_2287E, 2 - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) jmp loc_ECA2 ; --------------------------------------------------------------------------- @@ -8339,9 +8321,7 @@ loc_EB5D: mov word_218B6, 84h loc_EB7C: - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) call grcg_setcolor pascal, (GC_RMW shl 16) + 4 call sub_E512 jmp loc_ECA2 @@ -8350,9 +8330,7 @@ loc_EB7C: loc_EB9E: cmp word_218B6, 0A4h jge loc_EC56 - push 200000h - push 19F018Fh - call grcg_boxfill + call grcg_boxfill pascal, (PLAYFIELD_X shl 16) or 0, ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) mov byte_2066D, 2 cmp byte_2066C, 0 jz short loc_EBCC @@ -10000,19 +9978,11 @@ sub_FF91 proc near mov bp, sp call grcg_setcolor pascal, (GC_RMW shl 16) + 0 graph_accesspage _page_front - push 20000h - push 3018Fh - call grcg_byteboxfill_x - push 340000h - push 35018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, (( 16 / 8) shl 16) or 0, (( 24 / 8) shl 16) or (RES_Y - 1) + call grcg_byteboxfill_x pascal, ((416 / 8) shl 16) or 0, ((424 / 8) shl 16) or (RES_Y - 1) graph_accesspage _page_back - push 20000h - push 3018Fh - call grcg_byteboxfill_x - push 340000h - push 35018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, (( 16 / 8) shl 16) or 0, (( 24 / 8) shl 16) or (RES_Y - 1) + call grcg_byteboxfill_x pascal, ((416 / 8) shl 16) or 0, ((424 / 8) shl 16) or (RES_Y - 1) call grcg_off pop bp retn @@ -15947,10 +15917,10 @@ loc_12F6E: cmp di, 0FFh jnz short loc_12F94 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 28h ; '(' + push 40 push si - push 57h ; 'W' - lea ax, [si+2Fh] + push 87 + lea ax, [si+47] push ax call grcg_boxfill call grcg_off @@ -17003,9 +16973,7 @@ var_2 = byte ptr -2 cmp [bp+var_4], 80h ja short loc_13732 mov word_1ED94, 3E8h - push 200000h - push 1A0018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or 0, (PLAYFIELD_RIGHT shl 16) or (RES_Y - 1) mov Palettes+42, 0E0h mov Palettes+43, 0C0h mov Palettes+44, 0B0h ; '°' @@ -18089,9 +18057,7 @@ sub_140AE proc far mov bp, sp cmp byte_1EDA6, 0 jz short loc_140D4 - push 200000h - push 1A0018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or 0, (PLAYFIELD_RIGHT shl 16) or (RES_Y - 1) mov byte_1EDA6, 0 mov word_1EB0A, 0FFFFh @@ -20885,10 +20851,7 @@ loc_15849: jnz short loc_158CD call grcg_setcolor pascal, (GC_RMW shl 16) + 15 les bx, [bp+var_4] - push word ptr es:[bx+2] - push word ptr es:[bx+4] - push word ptr es:[bx+6] - call grcg_circlefill + call grcg_circlefill pascal, word ptr es:[bx+2], word ptr es:[bx+4], word ptr es:[bx+6] call grcg_off call grcg_setcolor pascal, (GC_RMW shl 16) + 0 les bx, [bp+var_4] @@ -21064,9 +21027,7 @@ var_2 = word ptr -2 mov [bx], ax call egc_off call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 40010h - push 33017Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, (PLAYFIELD_VRAM_X shl 16) or PLAYFIELD_Y, ((PLAYFIELD_VRAM_RIGHT - 1) shl 16) or PLAYFIELD_BOTTOM - 1 call grcg_off call sub_15645 leave @@ -21106,12 +21067,12 @@ loc_15A54: jnz short loc_15A8A call grcg_setcolor pascal, (GC_RMW shl 16) + 15 mov ax, word_254E6 - add ax, 40h + add ax, 64 push ax mov ax, word_254E8 - add ax, 40h + add ax, 64 push ax - push 18h + push 24 call grcg_circlefill call grcg_off @@ -21122,10 +21083,8 @@ loc_15A8A: jz short loc_15ABA call grcg_setcolor pascal, (GC_RMW shl 16) + 15 mov ax, word_254E6 - add ax, 40h - push ax - push 10017Fh - call grcg_vline + add ax, 64 + call grcg_vline pascal, ax, (PLAYFIELD_Y shl 16) or PLAYFIELD_BOTTOM - 1 call grcg_off loc_15ABA: @@ -21158,7 +21117,7 @@ loc_15AD0: cwd idiv bx push ax - push 17Fh + push PLAYFIELD_BOTTOM - 1 call grcg_byteboxfill_x call grcg_off mov al, byte_2558E @@ -21240,7 +21199,7 @@ loc_15BC2: mov al, byte_25590 mov ah, 0 push ax - push 17Fh + push PLAYFIELD_BOTTOM - 1 call grcg_byteboxfill_x call grcg_off call sub_158DC @@ -21273,7 +21232,7 @@ loc_15C25: mov al, byte_25590 mov ah, 0 push ax - push 17Fh + push PLAYFIELD_BOTTOM - 1 call grcg_byteboxfill_x call grcg_off mov ax, word_20650 @@ -21331,7 +21290,7 @@ loc_15CBC: mov al, byte_25590 mov ah, 0 push ax - push 17Fh + push PLAYFIELD_BOTTOM - 1 call grcg_byteboxfill_x call grcg_off mov al, _page_front @@ -21363,7 +21322,7 @@ loc_15D1C: mov al, byte_25590 mov ah, 0 push ax - push 17Fh + push PLAYFIELD_BOTTOM - 1 call grcg_byteboxfill_x call grcg_off jmp short loc_15D51 @@ -21759,10 +21718,7 @@ loc_1601A: loc_1602E: call grcg_setcolor - push word_2559A - push word_2559C - push 70h ; 'p' - call grcg_circle + call grcg_circle pascal, word_2559A, word_2559C, 112 loc_16042: call grcg_off @@ -21775,10 +21731,7 @@ loc_1604A: cmp _page_back, 0 jnz short loc_1607A call grcg_setcolor pascal, (GC_RMW shl 16) + 15 - push word_2559A - push word_2559C - push 70h ; 'p' - call grcg_circle + call grcg_circle pascal, word_2559A, word_2559C, 112 call grcg_off loc_1607A: @@ -21859,10 +21812,7 @@ loc_16146: cmp _page_back, 0 jnz short loc_16172 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push word_2559A - push word_2559C - push 70h ; 'p' - call grcg_circle + call grcg_circle pascal, word_2559A, word_2559C, 112 call grcg_off mov word_20650, 0 @@ -22794,9 +22744,7 @@ evileye_init proc far push ds push offset aStage5b2_bft ; "stage5b2.bft" call super_entry_bfnt - push 200000h - push 1A0018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or 0, (PLAYFIELD_RIGHT shl 16) or (RES_Y - 1) call sub_134A0 mov word_20652, 0A0h mov word_20654, 0A0h @@ -24855,7 +24803,7 @@ loc_17B24: mov ah, 0 push ax call grcg_setcolor - push 0E000C8h + push (224 shl 16) or 200 mov al, byte_26CC2 mov ah, 0 push ax @@ -24916,9 +24864,7 @@ var_1 = byte ptr -1 mov [bx], ax call egc_off call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 40010h - push 33017Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, (PLAYFIELD_VRAM_X shl 16) or PLAYFIELD_Y, ((PLAYFIELD_VRAM_RIGHT - 1) shl 16) or PLAYFIELD_BOTTOM - 1 mov al, byte_2066C mov ah, 0 mov dx, ax @@ -25658,7 +25604,7 @@ loc_18246: add ax, ax mov bx, ax movsx eax, _CosTable8[bx] - imul eax, 190h + imul eax, 400 sar eax, 8 add ax, word_26C58 mov di, ax @@ -25667,15 +25613,11 @@ loc_18246: add ax, ax mov bx, ax movsx eax, _SinTable8[bx] - imul eax, 190h + imul eax, 400 sar eax, 8 add ax, word_26C60 mov [bp+var_4], ax - push word_26C58 - push word_26C60 - push di - push ax - call grcg_line + call grcg_line pascal, word_26C58, word_26C60, di, ax mov al, [bp+var_2] add [bp+var_1], al inc si @@ -25722,11 +25664,7 @@ loc_182DD: add ax, [bx] add ax, 8 mov di, ax - push ax - push 10h - push ax - push 17Fh - call grcg_line + call grcg_line pascal, ax, PLAYFIELD_Y, ax, PLAYFIELD_BOTTOM - 1 call grcg_off mov bx, word_2065C mov ax, [bx] @@ -28178,9 +28116,7 @@ mima_init proc far call sub_13337 push 1 call palette_white_out - push 200000h - push 1A0018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or 0, (PLAYFIELD_RIGHT shl 16) or (RES_Y - 1) call grcg_setcolor pascal, (GC_RMW shl 16) + 0 call grcg_fill call grcg_off @@ -28288,17 +28224,13 @@ mima_init proc far graph_accesspage _page_back call graph_clear call grcg_setcolor pascal, (GC_RMW shl 16) + 11 - push 1A00000h - push 27F018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_RIGHT shl 16) or 0, ((RES_X - 1) shl 16) or (RES_Y - 1) graph_accesspage _page_front call grcg_fill graph_accesspage _page_back call grcg_fill call grcg_off - push 200000h - push 1A0018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or 0, (PLAYFIELD_RIGHT shl 16) or (RES_Y - 1) mov word_26C6A, 0 xor si, si jmp short loc_19C0D @@ -29377,9 +29309,7 @@ sub_1A529 proc near push bp mov bp, sp push si - push 200010h - push 1A00140h - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or PLAYFIELD_Y, (PLAYFIELD_RIGHT shl 16) or 320 call _snd_se_play c, 9 mov si, 96h jmp loc_1A613 @@ -29387,22 +29317,20 @@ sub_1A529 proc near loc_1A54E: call grcg_setcolor pascal, (GC_RMW shl 16) + 10 - push 0E00090h - push si - call grcg_circlefill + call grcg_circlefill pascal, (224 shl 16) or 144, si call grcg_setcolor pascal, (GC_RMW shl 16) + 13 - push 0E00090h + push (224 shl 16) or 144 mov ax, si - mov bx, 32h ; '2' + mov bx, 50 cwd idiv bx shl dx, 2 push dx call grcg_circle call grcg_setcolor pascal, (GC_RMW shl 16) + 15 - push 0E00090h + push (224 shl 16) or 144 mov ax, si - mov bx, 1Eh + mov bx, 30 cwd idiv bx imul dx, 7 @@ -29411,20 +29339,18 @@ loc_1A54E: push 1 call frame_delay call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 0E00090h - push si - call grcg_circlefill - push 0E00090h + call grcg_circlefill pascal, (224 shl 16) or 144, si + push (224 shl 16) or 144 mov ax, si - mov bx, 32h ; '2' + mov bx, 50 cwd idiv bx shl dx, 2 push dx call grcg_circle - push 0E00090h + push (224 shl 16) or 144 mov ax, si - mov bx, 1Eh + mov bx, 30 cwd idiv bx imul dx, 7 @@ -29436,7 +29362,7 @@ loc_1A54E: cwd idiv bx add ax, ax - add ax, 64h ; 'd' + add ax, 100 mov PaletteTone, ax call far ptr palette_show call _snd_se_update @@ -29646,9 +29572,7 @@ marisa_init proc far call grcg_setcolor pascal, (GC_RMW shl 16) + 0 call grcg_fill call grcg_off - push 200000h - push 1A0018Fh - call grc_setclip + call grc_setclip pascal, (PLAYFIELD_X shl 16) or 0, (PLAYFIELD_RIGHT shl 16) or (RES_Y - 1) push word_26D76 push word_26D78 push word_2064E @@ -30498,25 +30422,25 @@ loc_1B06F: shl bx, 2 les bx, [bx-6D1Ah] mov ax, es:[bx] - add ax, 10h + add ax, 16 push ax mov bx, [bp+var_C] shl bx, 2 les bx, [bx-6D0Ah] mov ax, es:[bx] - add ax, 10h + add ax, 16 push ax mov bx, [bp+var_E] shl bx, 2 les bx, [bx-6D1Ah] mov ax, es:[bx] - add ax, 10h + add ax, 16 push ax mov bx, [bp+var_E] shl bx, 2 les bx, [bx-6D0Ah] mov ax, es:[bx] - add ax, 10h + add ax, 16 push ax call grcg_line inc si @@ -32470,9 +32394,7 @@ marisa_bg_render proc far mov word_2065E, ax call egc_off call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 40010h - push 33017Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, (PLAYFIELD_VRAM_X shl 16) or PLAYFIELD_Y, ((PLAYFIELD_VRAM_RIGHT - 1) shl 16) or PLAYFIELD_BOTTOM - 1 call sub_3EF4 mov al, _page_front mov ah, 0 diff --git a/th02_maine.asm b/th02_maine.asm index 1c4433cd..19c3edf3 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -929,12 +929,12 @@ loc_9B1B: push 12B0004h call egc_shift_left call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - lea ax, [si+138h] + lea ax, [si+312] push ax - push 64h ; 'd' - lea ax, [si+13Fh] + push 100 + lea ax, [si+319] push ax - push 12Bh + push 299 call grcg_boxfill call grcg_off push 1 @@ -2314,11 +2314,11 @@ loc_A920: loc_A947: call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 210h + push 528 lea ax, [si+4] push ax - push 24Fh - lea ax, [si+13h] + push 591 + lea ax, [si+19] push ax call grcg_boxfill call grcg_off diff --git a/th03_main.asm b/th03_main.asm index 2c17df88..7702763f 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -959,9 +959,7 @@ loc_9E24: call snd_se_reset nopcall sub_B8F7 nopcall sub_BAE0 - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) kajacall KAJA_SONG_PLAY pop di pop si @@ -1337,9 +1335,7 @@ sub_A21F proc near push bp mov bp, sp call grcg_setcolor pascal, (GC_RMW shl 16) + 2 - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) graph_accesspage 1 call grcg_fill graph_accesspage 0 @@ -2575,9 +2571,7 @@ sub_B4A8 proc near mov word_1FBD2, 10h loc_B4E3: - push 80000h - push 26F00BFh - call grc_setclip + call grc_setclip pascal, (8 shl 16) or 0, (623 shl 16) or 191 sub word_1FBC4, 12h sub word_1FBCA, 17h add word_1FBCC, 12h @@ -2589,12 +2583,12 @@ loc_B4E3: ; --------------------------------------------------------------------------- loc_B51D: - lea ax, [si+12Fh] + lea ax, [si+303] push ax push 8 - lea ax, [si+12Fh] + lea ax, [si+303] push ax - push 0BFh + push 191 mov ax, word_1FBC4 add ax, si push ax @@ -2604,12 +2598,12 @@ loc_B51D: sar ax, 1 push ax call grcg_triangle - lea ax, [si+10h] + lea ax, [si+16] push ax push 8 - lea ax, [si+10h] + lea ax, [si+16] push ax - push 0BFh + push 191 mov ax, word_1FBCC add ax, si push ax @@ -2630,12 +2624,12 @@ loc_B565: ; --------------------------------------------------------------------------- loc_B575: - lea ax, [si+10h] + lea ax, [si+16] push ax - push 0BFh - lea ax, [si+12Fh] + push 191 + lea ax, [si+303] push ax - push 0BFh + push 191 mov ax, word_1FBC8 add ax, si push ax @@ -2645,10 +2639,10 @@ loc_B575: sar ax, 1 push ax call grcg_triangle - lea ax, [si+10h] + lea ax, [si+16] push ax push 8 - lea ax, [si+12Fh] + lea ax, [si+303] push ax push 8 mov ax, word_1FBD0 @@ -2679,9 +2673,7 @@ loc_B5BD: loc_B5EE: mov trapezoid_hmask, 0FFFFh call grcg_off - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) pop si pop bp retn @@ -2708,9 +2700,7 @@ sub_B60A proc near mov word_1FBD2, 10h loc_B645: - push 100000h - push 26F00BFh - call grc_setclip + call grc_setclip pascal, (16 shl 16) or 0, (623 shl 16) or 191 add word_1FBC6, 17h sub word_1FBC8, 12h sub word_1FBCE, 17h @@ -2721,12 +2711,12 @@ loc_B645: ; --------------------------------------------------------------------------- loc_B67A: - lea ax, [si+10h] + lea ax, [si+16] push ax - push 0BFh - lea ax, [si+12Fh] + push 191 + lea ax, [si+303] push ax - push 0BFh + push 191 mov ax, word_1FBC4 add ax, si push ax @@ -2736,12 +2726,12 @@ loc_B67A: sar ax, 1 push ax call grcg_triangle - lea ax, [si+10h] + lea ax, [si+16] push ax push 8 - lea ax, [si+10h] + lea ax, [si+16] push ax - push 0BFh + push 191 mov ax, word_1FBC8 add ax, si push ax @@ -2751,10 +2741,10 @@ loc_B67A: sar ax, 1 push ax call grcg_triangle - lea ax, [si+10h] + lea ax, [si+16] push ax push 8 - lea ax, [si+12Fh] + lea ax, [si+303] push ax push 8 mov ax, word_1FBCC @@ -2766,12 +2756,12 @@ loc_B67A: sar ax, 1 push ax call grcg_triangle - lea ax, [si+12Fh] + lea ax, [si+303] push ax push 8 - lea ax, [si+12Fh] + lea ax, [si+303] push ax - push 0BFh + push 191 mov ax, word_1FBD0 add ax, si push ax @@ -2794,9 +2784,7 @@ loc_B706: loc_B724: call grcg_off - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) pop si pop bp retn @@ -5951,17 +5939,17 @@ loc_CEFC: jz loc_D00D cmp word ptr [si+2], 140h jge short loc_CF15 - push 100008h - push 12Fh + push (16 shl 16) or 8 + push 303 jmp short loc_CF1E ; --------------------------------------------------------------------------- loc_CF15: - push 1500008h - push 26Fh + push (336 shl 16) or 8 + push 623 loc_CF1E: - push 0BFh + push 191 call grc_setclip cmp byte ptr [si], 1 jnz short loc_CF42 @@ -6042,26 +6030,10 @@ loc_CFC1: mov [bp+var_13], al cmp di, 4 jl short loc_CF62 - push [bp+var_A] - push [bp+var_12] - push [bp+var_8] - push [bp+var_10] - call grcg_line - push [bp+var_8] - push [bp+var_10] - push [bp+var_6] - push [bp+var_E] - call grcg_line - push [bp+var_6] - push [bp+var_E] - push [bp+var_4] - push [bp+var_C] - call grcg_line - push [bp+var_4] - push [bp+var_C] - push [bp+var_A] - push [bp+var_12] - call grcg_line + call grcg_line pascal, [bp+var_A], [bp+var_12], [bp+var_8], [bp+var_10] + call grcg_line pascal, [bp+var_8], [bp+var_10], [bp+var_6], [bp+var_E] + call grcg_line pascal, [bp+var_6], [bp+var_E], [bp+var_4], [bp+var_C] + call grcg_line pascal, [bp+var_4], [bp+var_C], [bp+var_A], [bp+var_12] loc_D00D: inc [bp+var_2] @@ -6071,9 +6043,7 @@ loc_D013: cmp [bp+var_2], 0Ch jl loc_CEFC GRCG_OFF_VIA_XOR ax - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) pop di pop si leave @@ -12550,10 +12520,7 @@ loc_1098A: mov di, ax cmp byte_1F354, 0 jnz short loc_109D2 - push si - push ax - push word_1F356 - call grcg_circle + call grcg_circle pascal, si, ax, word_1F356 jmp short loc_109FB ; --------------------------------------------------------------------------- @@ -12568,18 +12535,12 @@ loc_109D2: sar ax, 5 add ax, 8 mov [bp+var_6], ax - push si - push di - push [bp+var_4] - push ax - call grcg_line + call grcg_line pascal, si, di, [bp+var_4], ax loc_109FB: call grcg_off call egc_on - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) loc_10A13: pop di @@ -22194,17 +22155,13 @@ loc_15A53: call grcg_setcolor cmp byte ptr word_1FE88, 0 jnz short loc_15A77 - push 100008h - push 12F00BFh - call grc_setclip + call grc_setclip pascal, ( 16 shl 16) or 8, (303 shl 16) or 191 mov [bp+var_2], 10h jmp short loc_15A8D ; --------------------------------------------------------------------------- loc_15A77: - push 1500008h - push 26F00BFh - call grc_setclip + call grc_setclip pascal, (336 shl 16) or 8, (623 shl 16) or 191 mov [bp+var_2], 150h loc_15A8D: @@ -22250,13 +22207,7 @@ loc_15A91: loc_15AE6: cmp si, 3 jl short loc_15A91 - push [bp+var_8] - push [bp+var_E] - push [bp+var_6] - push [bp+var_C] - push [bp+var_4] - push [bp+var_A] - call grcg_triangle + call grcg_triangle pascal, [bp+var_8], [bp+var_E], [bp+var_6], [bp+var_C], [bp+var_4], [bp+var_A] cmp [bp+var_F], 20h ; ' ' jbe loc_15B9A mov al, [bp+var_F] @@ -22308,18 +22259,10 @@ loc_15B29: loc_15B7E: cmp si, 6 jl short loc_15B29 - push [bp+var_8] - push [bp+var_E] - push [bp+var_6] - push [bp+var_C] - push [bp+var_4] - push [bp+var_A] - call grcg_triangle + call grcg_triangle pascal, [bp+var_8], [bp+var_E], [bp+var_6], [bp+var_C], [bp+var_4], [bp+var_A] loc_15B9A: - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) call grcg_off mov al, [bp+var_F] shl al, 2 @@ -28524,9 +28467,7 @@ loc_18E7C: push ax call sub_A2D0 mov si, ax - push ax - push 800C0h - call grcg_vline + call grcg_vline pascal, ax, (8 shl 16) or 192 mov ax, word_220EC add ax, 900h push ax @@ -28535,9 +28476,7 @@ loc_18E7C: push ax call sub_A2D0 mov si, ax - push ax - push 800C0h - call grcg_vline + call grcg_vline pascal, ax, (8 shl 16) or 192 mov ax, word_220EC add ax, ax mov dx, 900h @@ -28548,9 +28487,7 @@ loc_18E7C: push ax call sub_A2D0 mov si, ax - push ax - push 800C0h - call grcg_vline + call grcg_vline pascal, ax, (8 shl 16) or 192 mov ax, word_220EC add ax, ax add ax, 900h @@ -28560,9 +28497,7 @@ loc_18E7C: push ax call sub_A2D0 mov si, ax - push ax - push 800C0h - call grcg_vline + call grcg_vline pascal, ax, (8 shl 16) or 192 add word_220EC, 41h ; 'A' cmp word_220EC, 480h jl short loc_18F38 @@ -28786,14 +28721,14 @@ loc_190CF: call grcg_setcolor pascal, (GC_RMW shl 16) + 9 push 8 mov ax, [bp+var_4] - add ax, 0FFFAh + add ax, -6 push ax mov ax, [bp+var_4] add ax, 6 push ax - push 0C0h + push 192 mov ax, [bp+var_8] - add ax, 0FFFAh + add ax, -6 push ax mov ax, [bp+var_8] add ax, 6 @@ -28802,14 +28737,14 @@ loc_190CF: call grcg_setcolor pascal, (GC_RMW shl 16) + 10 push 8 mov ax, [bp+var_4] - add ax, 0FFFDh + add ax, -3 push ax mov ax, [bp+var_4] add ax, 3 push ax - push 0C0h + push 192 mov ax, [bp+var_8] - add ax, 0FFFDh + add ax, -3 push ax mov ax, [bp+var_8] add ax, 3 @@ -28823,7 +28758,7 @@ loc_190CF: mov ax, [bp+var_4] inc ax push ax - push 0C0h + push 192 mov ax, [bp+var_8] dec ax push ax @@ -28857,7 +28792,7 @@ loc_19179: mov ax, [bp+var_4] add ax, di push ax - push 0C0h + push 192 mov ax, [bp+var_8] sub ax, di push ax @@ -28878,7 +28813,7 @@ loc_19179: mov ax, [bp+var_4] add ax, di push ax - push 0C0h + push 192 mov ax, [bp+var_8] sub ax, di push ax @@ -28889,11 +28824,7 @@ loc_19179: loc_191E4: call grcg_setcolor pascal, (GC_RMW shl 16) + 15 - push [bp+var_4] - push 8 - push [bp+var_8] - push 0C0h - call grcg_line + call grcg_line pascal, [bp+var_4], 8, [bp+var_8], 192 loc_191FF: call grcg_off @@ -32243,17 +32174,17 @@ loc_1A9FF: jnz loc_1AE09 cmp byte ptr word_1FE88, 1 jnz short loc_1AA1B - push 100008h - push 12Fh + push (16 shl 16) or 8 + push 303 jmp short loc_1AA24 ; --------------------------------------------------------------------------- loc_1AA1B: - push 1500008h - push 26Fh + push (336 shl 16) or 8 + push 623 loc_1AA24: - push 0BFh + push 191 call grc_setclip mov bx, [bp+var_A] cmp byte ptr [bx+1], 10h @@ -32565,9 +32496,7 @@ loc_1ACCF: call grcg_vline call grcg_off call egc_on - pushd 0 - push 27F00C7h - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (SPRITE16_RES_Y - 1) sub di, 10h mov _sprite16_put_w, (32 / 16) mov _sprite16_put_h, 8 diff --git a/th03_mainl.asm b/th03_mainl.asm index 0cc28a21..3581a8fc 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -1162,7 +1162,7 @@ loc_9FC8: les bx, [bp+var_6] add al, es:[bx] mov es:[bx], al - push 2400173h + push (576 shl 16) or 371 push 2Fh ; '/' push word ptr [bp+var_6+2] push bx @@ -1212,15 +1212,13 @@ loc_A069: cmp si, 1 jnz short loc_A0C5 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 2400173h - push 2500183h - call grcg_boxfill + call grcg_boxfill pascal, (576 shl 16) or 371, (592 shl 16) or 387 call grcg_off les bx, _yumeconfig dec byte ptr es:[bx+36h] les bx, [bp+var_6] dec byte ptr es:[bx] - push 2400173h + push (576 shl 16) or 371 push 2Fh ; '/' push word ptr [bp+var_6+2] push bx @@ -2373,9 +2371,7 @@ loc_AAA3: loc_AAD5: call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 140040h - push 3B0107h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((160 / 8) shl 16) or 64, ((472 / 8) shl 16) or 263 call grcg_off jmp short loc_AB54 ; --------------------------------------------------------------------------- @@ -4852,9 +4848,7 @@ loc_BF3B: loc_BF57: call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off loc_BF78: @@ -4974,15 +4968,11 @@ loc_C032: or ax, ax jz short loc_C032 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off call sub_BCD5 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off call sub_BCD5 pop si @@ -5095,9 +5085,7 @@ loc_C155: loc_C173: call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off loc_C194: @@ -5112,15 +5100,11 @@ loc_C199: or ax, ax jz loc_C114 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off call sub_BCD5 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off call sub_BCD5 pop di @@ -5456,22 +5440,14 @@ loc_C4D8: call far ptr palette_show call grcg_setcolor pascal, (GC_RMW shl 16) + 8 graph_accesspage 1 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) graph_accesspage 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) call grcg_setcolor pascal, (GC_RMW shl 16) + 0 graph_accesspage 1 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) graph_accesspage 0 - push 10008h - push 4E0187h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((8 / 8) shl 16) or 8, (((RES_X - 1 - 8) / 8) shl 16) or (RES_Y - 1 - 8) call grcg_off graph_showpage 1 call cdg_load_single_noalpha pascal, 0, ds, offset aStf1_cdg, 0 diff --git a/th03_op.asm b/th03_op.asm index c5ce7929..73c6ba0a 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -3287,7 +3287,7 @@ loc_B5AF: lea ax, [si+8] push ax mov ax, [bp+var_4] - add ax, 0Fh + add ax, 15 push ax call grcg_boxfill dec di @@ -3317,7 +3317,7 @@ loc_B5F0: lea ax, [si+8] push ax mov ax, [bp+var_4] - add ax, 0Fh + add ax, 15 push ax call grcg_boxfill dec di @@ -4032,9 +4032,7 @@ loc_BBD0: mov byte_FC5C, al graph_showpage al call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) call grcg_off inc word_FC62 les bx, _yumeconfig @@ -4181,9 +4179,7 @@ loc_BD42: mov byte_FC5C, al graph_showpage al call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) call grcg_off inc word_FC62 les bx, _yumeconfig @@ -4292,9 +4288,7 @@ loc_BE68: mov byte_FC5C, al graph_showpage al call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) call grcg_off inc word_FC62 les bx, _yumeconfig diff --git a/th04_main.asm b/th04_main.asm index a4a3f644..c359ae01 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -6255,10 +6255,7 @@ loc_E2D6: add ax, 10h mov [bp+var_6], ax call grcg_setcolor pascal, (GC_RMW shl 16) + 15 - push [bp+var_4] - push [bp+var_6] - push 17Fh - call grcg_vline + call grcg_vline pascal, [bp+var_4], [bp+var_6], PLAYFIELD_BOTTOM -1 jmp loc_E449 ; --------------------------------------------------------------------------- @@ -6299,10 +6296,7 @@ loc_E356: mov ah, 0 push ax call grcg_setcolor - push [bp+var_4] - push [bp+var_6] - push word ptr [si+14h] - call grcg_circlefill + call grcg_circlefill pascal, [bp+var_4], [bp+var_6], word ptr [si+14h] push [bp+var_8] push [bp+var_6] mov ax, di @@ -6311,7 +6305,7 @@ loc_E356: sar ax, 1 add ax, [bp+var_8] push ax - push 17Fh + push (PLAYFIELD_BOTTOM - 1) call grcg_boxfill mov ax, di cwd @@ -6322,7 +6316,7 @@ loc_E356: push dx push [bp+var_6] push [bp+var_A] - push 17Fh + push (PLAYFIELD_BOTTOM - 1) call grcg_boxfill loc_E3B1: @@ -6354,7 +6348,7 @@ loc_E3B1: mov ax, [bp+var_8] add ax, di push ax - push 17Fh + push (PLAYFIELD_BOTTOM - 1) call grcg_boxfill mov ax, [bp+var_A] sub ax, di @@ -6367,7 +6361,7 @@ loc_E3B1: mov dx, [bp+var_A] sub dx, ax push dx - push 17Fh + push (PLAYFIELD_BOTTOM - 1) call grcg_boxfill loc_E416: @@ -6380,11 +6374,7 @@ loc_E416: sub ax, di push ax call grcg_circlefill - push [bp+var_8] - push [bp+var_6] - push [bp+var_A] - push 17Fh - call grcg_boxfill + call grcg_boxfill pascal, [bp+var_8], [bp+var_6], [bp+var_A], (PLAYFIELD_BOTTOM - 1) loc_E449: inc [bp+var_2] @@ -7024,9 +7014,9 @@ loc_E98E: mov dx, 80 sub dx, ax mov [bp+var_2], dx - lea ax, [si+20h] + lea ax, [si+32] push ax - lea ax, [di+20h] + lea ax, [di+32] push ax push dx call grcg_circlefill @@ -7052,10 +7042,7 @@ loc_E9DD: call main_01:grcg_setmode_rmw_1 mov ah, 0Fh call main_01:grcg_setcolor_direct_noint_1 - push si - push di - push 10h - call grcg_circlefill + call grcg_circlefill pascal, si, di, 16 jmp short loc_EA55 ; --------------------------------------------------------------------------- @@ -7076,9 +7063,9 @@ loc_EA0D: shl ax, 3 add ax, 16 mov [bp+var_2], ax - lea ax, [si+20h] + lea ax, [si+32] push ax - lea ax, [di+20h] + lea ax, [di+32] push ax push [bp+var_2] call grcg_circlefill @@ -12022,10 +12009,7 @@ var_2 = word ptr -2 call main_01:grcg_setmode_rmw_1 mov ah, GC_I call main_01:grcg_setcolor_direct_noint_1 - push si - push di - push [bp+var_2] - call grcg_circle + call grcg_circle pascal, si, di, [bp+var_2] mov ah, GC_BI call main_01:grcg_setcolor_direct_noint_1 push si @@ -12037,7 +12021,7 @@ var_2 = word ptr -2 push si push di mov ax, [bp+var_2] - add ax, 0Ch + add ax, 12 push ax call grcg_circle GRCG_OFF_CLOBBERING dx @@ -12139,11 +12123,7 @@ loc_118D2: idiv bx add ax, 10h mov [bp+var_8], ax - push si - push di - push [bp+var_6] - push ax - call grcg_line + call grcg_line pascal, si, di, [bp+var_6], ax loc_1192B: inc [bp+var_4] @@ -12227,15 +12207,12 @@ var_2 = word ptr -2 sub ax, _boss_phase_frame add ax, ax mov [bp+var_2], ax - add si, 18h + add si, 24 add di, 8 call main_01:grcg_setmode_rmw_1 mov ah, 0Fh call main_01:grcg_setcolor_direct_noint_1 - push si - push di - push [bp+var_2] - call grcg_circle + call grcg_circle pascal, si, di, [bp+var_2] mov ah, GC_RG call main_01:grcg_setcolor_direct_noint_1 push si @@ -12247,7 +12224,7 @@ var_2 = word ptr -2 push si push di mov ax, [bp+var_2] - add ax, 0Ch + add ax, 12 push ax call grcg_circle GRCG_OFF_CLOBBERING dx @@ -12482,10 +12459,7 @@ loc_11BD1: call main_01:grcg_setmode_rmw_1 mov ah, GC_BGI call main_01:grcg_setcolor_direct_noint_1 - push word ptr [si+2] - push word ptr [si+4] - push word ptr [si+10h] - call grcg_circlefill + 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] @@ -15138,15 +15112,12 @@ loc_130B8: loc_130C4: mov bx, [bp+var_2] mov ax, [bx+2] - mov bx, 10h + mov bx, 16 cwd idiv bx - add ax, 20h ; ' ' + add ax, 32 mov di, ax - push ax - push bx - push 17Fh - call grcg_vline + call grcg_vline pascal, ax, bx, PLAYFIELD_BOTTOM - 1 inc si add [bp+var_2], 1Ah diff --git a/th04_maine.asm b/th04_maine.asm index 83e9f371..8dee4aa1 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -1516,9 +1516,7 @@ loc_AC3F: loc_AC70: call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 140040h - push 3B0107h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((160 / 8) shl 16) or 64, ((472 / 8) shl 16) or 263 GRCG_OFF_CLOBBERING dx jmp short loc_ACF0 ; --------------------------------------------------------------------------- diff --git a/th04_op.asm b/th04_op.asm index c138d327..a73240e5 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -3966,9 +3966,7 @@ var_2 = word ptr -2 call far ptr palette_show graph_accesspage 1 call grcg_setcolor pascal, (GC_RMW shl 16) + 15 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) GRCG_OFF_CLOBBERING dx push 0 call graph_copy_page @@ -4645,32 +4643,32 @@ arg_0 = word ptr 4 ; --------------------------------------------------------------------------- loc_D34B: - mov si, 50h ; 'P' + mov si, 80 jmp short loc_D353 ; --------------------------------------------------------------------------- loc_D350: - mov si, 170h + mov si, 368 loc_D353: - mov di, 138h + mov di, 312 call grcg_setcolor pascal, (GC_RMW shl 16) + 1 lea ax, [si+8] push ax lea ax, [di+8] push ax - lea ax, [si+0C8h] + lea ax, [si+200] push ax - lea ax, [di+48h] + lea ax, [di+72] push ax push 8 call grcg_round_boxfill call grcg_setcolor pascal, (GC_RMW shl 16) + 2 push si push di - lea ax, [si+0C0h] + lea ax, [si+192] push ax - lea ax, [di+40h] + lea ax, [di+64] push ax push 8 call grcg_round_boxfill @@ -4702,12 +4700,8 @@ sub_D3A2 proc near push 1 call sub_D20A call grcg_setcolor pascal, (GC_RMW shl 16) + 1 - push 250034h - push 25011Fh - call grcg_byteboxfill_x - push 60120h - push 250127h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((296 / 8) shl 16) or 52, ((296 / 8) shl 16) or 287 + call grcg_byteboxfill_x pascal, (( 48 / 8) shl 16) or 288, ((296 / 8) shl 16) or 295 GRCG_OFF_CLOBBERING dx push 0 jmp short loc_D460 @@ -4725,12 +4719,8 @@ loc_D407: push 0 call sub_D20A call grcg_setcolor pascal, (GC_RMW shl 16) + 1 - push 490034h - push 49011Fh - call grcg_byteboxfill_x - push 2A0120h - push 490127h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((584 / 8) shl 16) or 52, ((584 / 8) shl 16) or 287 + call grcg_byteboxfill_x pascal, ((336 / 8) shl 16) or 288, ((584 / 8) shl 16) or 295 GRCG_OFF_CLOBBERING dx push 1 @@ -4899,59 +4889,59 @@ sub_D595 proc near mov bp, sp push si push di - mov si, 138h - mov di, 140h + mov si, 312 + mov di, 320 call grcg_setcolor pascal, (GC_RMW shl 16) + 1 lea ax, [di+8] push ax lea ax, [si+8] push ax - lea ax, [di+0C7h] + lea ax, [di+199] push ax - lea ax, [si+1Fh] + lea ax, [si+31] push ax push 8 call grcg_round_boxfill lea ax, [di+8] push ax - lea ax, [si+20h] + lea ax, [si+32] push ax - lea ax, [di+0C7h] + lea ax, [di+199] push ax - lea ax, [si+37h] + lea ax, [si+55] push ax push 8 call grcg_round_boxfill - push 88h + push 136 lea ax, [si+8] push ax - push 147h - lea ax, [si+1Fh] + push 327 + lea ax, [si+31] push ax push 8 call grcg_round_boxfill call grcg_setcolor pascal, (GC_RMW shl 16) + 2 push di push si - lea ax, [di+0C0h] + lea ax, [di+192] push ax - lea ax, [si+17h] + lea ax, [si+23] push ax push 8 call grcg_round_boxfill push di - lea ax, [si+18h] + lea ax, [si+24] push ax - lea ax, [di+0C0h] + lea ax, [di+192] push ax - lea ax, [si+2Fh] + lea ax, [si+47] push ax push 8 call grcg_round_boxfill - push 80h + push 128 push si - push 13Fh - lea ax, [si+17h] + push 319 + lea ax, [si+23] push ax push 8 call grcg_round_boxfill @@ -4991,12 +4981,8 @@ loc_D664: loc_D66C: call cdg_put_noalpha call grcg_setcolor pascal, (GC_RMW shl 16) + 1 - push 370034h - push 37011Fh - call grcg_byteboxfill_x - push 180120h - push 370127h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((440 / 8) shl 16) or 52, ((440 / 8) shl 16) or 287 + call grcg_byteboxfill_x pascal, ((192 / 8) shl 16) or 288, ((440 / 8) shl 16) or 295 GRCG_OFF_CLOBBERING dx call sub_D595 mov al, byte_132B9 diff --git a/th05_main.asm b/th05_main.asm index ce2bbaf5..a8904659 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -3154,10 +3154,7 @@ loc_C8E4: push ax push [bp+var_4] call grcg_boxfill - push [bp+var_2] - push [bp+var_4] - push word ptr [si+6] - call grcg_circlefill + call grcg_circlefill pascal, [bp+var_2], [bp+var_4], word ptr [si+6] dec word ptr [si+6] cmp word ptr [si+6], 4 jge short loc_C989 @@ -3340,7 +3337,7 @@ loc_CAE7: cmp word ptr [si], 0FC19h jz short loc_CB23 push si - push 0E00075h + push (224 shl 16) or 117 push word ptr [si+6] mov al, [si+8] mov ah, 0 @@ -3386,51 +3383,33 @@ sub_CB30 proc near call cdg_put_noalpha call sub_CF50 call grcg_setcolor pascal, (GC_RMW shl 16) + 7 - push 0D10010h - push 3Fh ; '?' - call grcg_vline - push 0D10150h - push 17Fh - call grcg_vline - push 0EE0010h - push 3Fh ; '?' - call grcg_vline - push 0EE0150h - push 17Fh - call grcg_vline + call grcg_vline pascal, (209 shl 16) or PLAYFIELD_Y, PLAYFIELD_Y + 47 + call grcg_vline pascal, (209 shl 16) or 336, PLAYFIELD_BOTTOM - 1 + 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 - push 0D00010h - push 3Fh ; '?' - call grcg_vline - push 0D00150h - push 17Fh - call grcg_vline - push 0EF0010h - push 3Fh ; '?' - call grcg_vline - push 0EF0150h - push 17Fh - call grcg_vline - mov ah, 0Fh + 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 sub_CA7B mov al, byte_2429B mov ah, 0 - mov dx, 0E0h + mov dx, 224 sub dx, ax mov si, dx or si, si jle short loc_CBE4 - push 0E00075h - push dx - call grcg_circle + call grcg_circle pascal, (224 shl 16) or 117, dx loc_CBE4: GRCG_OFF_CLOBBERING dx mov al, byte_2429B mov ah, 0 - add ax, 64h ; 'd' + add ax, 100 mov PaletteTone, ax mov _palette_changed, 1 pop si @@ -4693,11 +4672,7 @@ arg_2 = word ptr 6 sar ax, 4 add ax, 16 mov [bp+var_8], ax - push [bp+var_2] - push [bp+var_4] - push [bp+var_6] - push ax - call grcg_line + call grcg_line pascal, [bp+var_2], [bp+var_4], [bp+var_6], ax pop di pop si leave @@ -5493,7 +5468,7 @@ arg_2 = word ptr 6 push di mov di, [bp+arg_2] mov si, [bp+arg_0] - push 0E000C8h + push (224 shl 16) or 200 mov ax, di sar ax, 4 push ax @@ -5503,21 +5478,17 @@ arg_2 = word ptr 6 ; --------------------------------------------------------------------------- loc_DB58: - push offset _drawpoint - push 0E000C80h - push di - push si - call vector2_at + call vector2_at pascal, offset _drawpoint, ((224 shl 4) shl 16) or (200 shl 4), di, si push 3AB0h - push 0E000C80h + push ((224 shl 4) shl 16) or (200 shl 4) push di - lea ax, [si+55h] + lea ax, [si+85] push ax call vector2_at push 3AB4h - push 0E000C80h + push ((224 shl 4) shl 16) or (200 shl 4) push di - lea ax, [si-55h] + lea ax, [si-85] push ax call vector2_at sar _drawpoint.x, 4 @@ -5526,21 +5497,9 @@ loc_DB58: sar word_24492, 4 sar word_24494, 4 sar word_24496, 4 - push _drawpoint.x - push _drawpoint.y - push word_24490 - push word_24492 - call grcg_line - push word_24490 - push word_24492 - push word_24494 - push word_24496 - call grcg_line - push _drawpoint.x - push _drawpoint.y - push word_24494 - push word_24496 - call grcg_line + call grcg_line pascal, _drawpoint.x, _drawpoint.y, word_24490, word_24492 + call grcg_line pascal, word_24490, word_24492, word_24494, word_24496 + call grcg_line pascal, _drawpoint.x, _drawpoint.y, word_24494, word_24496 inc [bp+var_2] add si, 2Ah ; '*' @@ -10233,11 +10192,8 @@ loc_10BC7: jz short loc_10C25 call grcg_setcolor pascal, (GC_RMW shl 16) + 15 mov ax, [bp+var_4] - add ax, 10h - push ax - push di - push word ptr [si+10h] - call grcg_circle + add ax, 16 + call grcg_circle pascal, ax, di, word ptr [si+10h] jmp short loc_10C1F ; --------------------------------------------------------------------------- @@ -10246,11 +10202,8 @@ loc_10BFD: jnz short loc_10C25 call grcg_setcolor pascal, (GC_RMW shl 16) + 15 mov ax, [bp+var_4] - add ax, 10h - push ax - push di - push word ptr [si+10h] - call grcg_circlefill + add ax, 16 + call grcg_circlefill pascal, ax, di, word ptr [si+10h] loc_10C1F: GRCG_OFF_CLOBBERING dx @@ -10274,10 +10227,7 @@ loc_10C3E: cmp byte_2D07F, 2 jnz short loc_10C6C call grcg_setcolor pascal, (GC_RMW shl 16) + 9 - push [bp+var_A] - push [bp+var_8] - push di - call grcg_hline + call grcg_hline pascal, [bp+var_A], [bp+var_8], di GRCG_OFF_CLOBBERING dx jmp short loc_10C96 ; --------------------------------------------------------------------------- @@ -10897,14 +10847,14 @@ loc_11080: call grcg_setcolor_direct_noint_1 mov ax, [si+2] sar ax, 4 - add ax, 20h ; ' ' + add ax, PLAYFIELD_X push ax mov ax, [si+4] sar ax, 4 - add ax, 10h + add ax, PLAYFIELD_Y push ax mov ax, [si+10h] - mov bx, 10h + mov bx, 16 cwd idiv bx push ax @@ -11668,7 +11618,7 @@ loc_116A6: ; --------------------------------------------------------------------------- loc_116CE: - cmp si, 180h + cmp si, PLAYFIELD_Y + PLAYFIELD_H jge loc_1179F push 0 push word ptr [di+4] @@ -11684,7 +11634,7 @@ loc_116CE: ; --------------------------------------------------------------------------- loc_116F8: - mov ax, 1A0h + mov ax, PLAYFIELD_RIGHT sub ax, [bp+var_6] mov [bp+var_6], ax @@ -11702,7 +11652,7 @@ loc_11701: cwd idiv bx push ax - lea ax, [si+0Fh] + lea ax, [si+15] push ax call grcg_byteboxfill_x @@ -11725,8 +11675,8 @@ loc_11727: ; --------------------------------------------------------------------------- loc_11749: - add [bp+var_6], 10h - cmp [bp+var_6], 1A0h + add [bp+var_6], 16 + cmp [bp+var_6], PLAYFIELD_RIGHT jge short loc_1176A mov ax, [bp+var_6] mov bx, 8 @@ -11734,8 +11684,8 @@ loc_11749: idiv bx push ax push si - push 33h ; '3' - lea ax, [si+0Fh] + push PLAYFIELD_VRAM_RIGHT - 1 + lea ax, [si+15] push ax call grcg_byteboxfill_x diff --git a/th05_maine.asm b/th05_maine.asm index c3554839..97e88276 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -1257,9 +1257,7 @@ loc_AD9A: loc_ADE3: call grcg_setcolor pascal, (GC_RMW shl 16) + 0 - push 140040h - push 3B0107h - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, ((160 / 8) shl 16) or 64, ((472 / 8) shl 16) or 263 GRCG_OFF_CLOBBERING dx jmp short loc_AE64 ; --------------------------------------------------------------------------- @@ -1789,13 +1787,9 @@ arg_2 = word ptr 6 call palette_black_out call grcg_setcolor pascal, (GC_RMW shl 16) + 0Eh graph_accesspage 1 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) graph_accesspage 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) call sub_B37C GRCG_OFF_CLOBBERING dx mov PaletteTone, 64h ; 'd' @@ -1919,13 +1913,9 @@ sub_B3CB proc near call far ptr palette_show call grcg_setcolor pascal, (GC_RMW shl 16) + 14 graph_accesspage 1 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) graph_accesspage 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) GRCG_OFF_CLOBBERING dx mov allcast_screen_plus_one, 0 push 0 @@ -2932,37 +2922,37 @@ loc_BB00: mov ah, 0 shl ax, 4 add ax, si - add ax, 10h + add ax, 16 push ax - lea ax, [di+0Fh] + lea ax, [di+15] push ax call grcg_hline lea ax, [si-2] push ax lea ax, [di-1] push ax - lea ax, [di+10h] + lea ax, [di+16] push ax call grcg_vline - lea ax, [si+132h] + lea ax, [si+306] push ax lea ax, [di-1] push ax - lea ax, [di+10h] + lea ax, [di+16] push ax call grcg_vline lea ax, [si-2] push ax - lea ax, [si+132h] + lea ax, [si+306] push ax lea ax, [di-1] push ax call grcg_hline lea ax, [si-2] push ax - lea ax, [si+132h] + lea ax, [si+306] push ax - lea ax, [di+10h] + lea ax, [di+16] push ax call grcg_hline GRCG_OFF_CLOBBERING dx @@ -7393,10 +7383,7 @@ loc_E0A6: inc [bp+var_6] push ax call grcg_setcolor - push [bp+var_2] - push [bp+var_4] - push 10h - call grcg_circlefill + call grcg_circlefill pascal, [bp+var_2], [bp+var_4], 16 GRCG_OFF_CLOBBERING dx loc_E0F6: @@ -7786,21 +7773,15 @@ var_2 = word ptr -2 call far ptr palette_show call grcg_setcolor pascal, (GC_RMW shl 16) + 1 graph_accesspage 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) GRCG_OFF_CLOBBERING dx call sub_D21D push 3700h call sub_E39F call grcg_setcolor pascal, (GC_RMW shl 16) + 1 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) graph_accesspage 1 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) GRCG_OFF_CLOBBERING dx call snd_load pascal, ds, offset aStaff, SND_LOAD_SONG kajacall KAJA_SONG_PLAY @@ -8110,9 +8091,7 @@ loc_E7CC: jg short loc_E7CC call cdg_freeall call super_free - pushd 0 - push 27F018Fh - call grc_setclip + call grc_setclip pascal, large 0, ((RES_X - 1) shl 16) or (RES_Y - 1) pop di pop si leave diff --git a/th05_op.asm b/th05_op.asm index b39d390a..381df98a 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -2776,13 +2776,9 @@ sub_BC8D proc near graph_showpage al call grcg_setcolor pascal, (GC_RMW shl 16) + 1 graph_accesspage 1 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) graph_accesspage 0 - pushd 0 - push 4F018Fh - call grcg_byteboxfill_x + call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) GRCG_OFF_CLOBBERING dx push 1 call graph_copy_page @@ -2923,29 +2919,29 @@ arg_2 = byte ptr 6 mov si, ax or si, si jl loc_BF48 - cmp si, 0C0h + cmp si, 192 jge loc_BF48 cmp [bp+arg_0], 0 jz short loc_BEF4 call grcg_setcolor pascal, (GC_RMW shl 16) + 5 - push 0C012Ch - lea ax, [si+60h] + push (12 shl 16) or 300 + lea ax, [si+96] push ax call grcg_hline - push 0C012Ch - lea ax, [si+6Fh] + push (12 shl 16) or 300 + lea ax, [si+111] push ax call grcg_hline - push 0Ch - lea ax, [si+60h] + push 12 + lea ax, [si+96] push ax - lea ax, [si+6Fh] + lea ax, [si+111] push ax call grcg_vline - push 12Ch - lea ax, [si+60h] + push 300 + lea ax, [si+96] push ax - lea ax, [si+6Fh] + lea ax, [si+111] push ax call grcg_vline GRCG_OFF_CLOBBERING dx @@ -2954,7 +2950,7 @@ arg_2 = byte ptr 6 loc_BEF4: push 0 - lea ax, [si+60h] + lea ax, [si+96] push ax push 1400010h call sub_DB3C @@ -4643,17 +4639,17 @@ loc_CF82: loc_CF8C: call cdg_put_noalpha call grcg_setcolor pascal, (GC_RMW shl 16) + 1 - lea ax, [si+0D8h] + lea ax, [si+216] mov bx, 8 cwd idiv bx push ax push di - lea ax, [si+0DFh] + lea ax, [si+223] cwd idiv bx push ax - lea ax, [di+97h] + lea ax, [di+151] push ax call grcg_byteboxfill_x mov ax, si @@ -4661,13 +4657,13 @@ loc_CF8C: cwd idiv bx push ax - lea ax, [di+98h] + lea ax, [di+152] push ax - lea ax, [si+0DFh] + lea ax, [si+223] cwd idiv bx push ax - lea ax, [di+9Fh] + lea ax, [di+159] push ax call grcg_byteboxfill_x GRCG_OFF_CLOBBERING dx