diff --git a/ReC98.h b/ReC98.h index a22fa8eb..9bba2954 100644 --- a/ReC98.h +++ b/ReC98.h @@ -11,6 +11,18 @@ #define palette_entry_rgb_show(fn) \ palette_entry_rgb(fn); \ palette_show(); + +// RGB color triple, used for the Palettes structure +typedef union { + struct { + unsigned char r, g, b; + } c; + unsigned char v[3]; +} rgb_t; + +typedef struct { + rgb_t colors[16]; +} palette_t; // --------------------- // Macros diff --git a/ReC98.inc b/ReC98.inc index 7458f163..57eb42c3 100644 --- a/ReC98.inc +++ b/ReC98.inc @@ -65,6 +65,19 @@ twobyte_t ends ; --------------------- ; super_roll_put_1plane() plane_put constants PLANE_PUT = 0FF00h or GC_RMW + +; RGB color triple, used for the Palettes structure +rgb_t struc + r db ? + g db ? + b db ? +rgb_t ends + +PALETTE_COLORS = 16 + +palette_t struc + colors rgb_t PALETTE_COLORS dup() +palette_t ends ; --------------------- RES_X = 640 diff --git a/libs/master.lib/grcg_round_boxfill.asm b/libs/master.lib/grcg_round_boxfill.asm index 05f0e5f0..b4ed45b6 100644 --- a/libs/master.lib/grcg_round_boxfill.asm +++ b/libs/master.lib/grcg_round_boxfill.asm @@ -53,7 +53,6 @@ MRETURN macro y1 = (RETSIZE+4)*2 x2 = (RETSIZE+3)*2 y2 = (RETSIZE+2)*2 - r = (RETSIZE+1)*2 retfunc GC_RBOXF_BOXFILL push word ptr [BP+x1] @@ -71,8 +70,9 @@ func GRCG_ROUND_BOXFILL ; { push DI ; 変数 s = -2 + @@r = (RETSIZE+1)*2 - mov AX,[BP+r] + mov AX,[BP+@@r] mov BX,[BP+x1] mov SI,[BP+x2] diff --git a/th02_main.asm b/th02_main.asm index 50b6efa5..116b40ad 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -7808,7 +7808,7 @@ sub_E5B5 endp sub_E618 proc near -var_2 = word ptr -2 +@@component = word ptr -2 push bp mov bp, sp @@ -7817,24 +7817,24 @@ var_2 = word ptr -2 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 cmp word_218B6, 1 jnz short loc_E668 - mov [bp+var_2], 0 + mov [bp+@@component], 0 jmp short loc_E64E ; --------------------------------------------------------------------------- loc_E638: - mov bx, [bp+var_2] - mov al, [bx+1A98h] - mov [bx+3FDDh], al - mov al, [bx+1AA1h] - mov [bx+3FE0h], al - inc [bp+var_2] + mov bx, [bp+@@component] + mov al, Palettes[0 * size rgb_t][bx] + mov byte ptr rgb_21A4D[bx], al + mov al, Palettes[3 * size rgb_t][bx] + mov byte ptr rgb_21A50[bx], al + inc [bp+@@component] loc_E64E: - cmp [bp+var_2], 3 + cmp [bp+@@component], size rgb_t jl short loc_E638 - mov Palettes+9, 40h - mov Palettes+10, 10h - mov Palettes+11, 40h + mov Palettes[3 * size rgb_t].r, 40h + mov Palettes[3 * size rgb_t].g, 10h + mov Palettes[3 * size rgb_t].b, 40h call far ptr palette_show loc_E668: @@ -7848,11 +7848,11 @@ loc_E668: loc_E680: cmp word_218B6, 20h ; ' ' jnz short loc_E6CC - mov al, byte_21A50 + mov al, rgb_21A50.r mov Palettes+9, al - mov al, byte_21A51 + mov al, rgb_21A50.g mov Palettes+10, al - mov al, byte_21A52 + mov al, rgb_21A50.b mov Palettes+11, al mov Palettes, 80h mov Palettes+1, 0 @@ -7979,11 +7979,11 @@ loc_E80E: loc_E821: cmp word_218B6, 88h jnz short loc_E867 - mov al, byte_21A4D + mov al, rgb_21A4D.r mov Palettes, al - mov al, byte_21A4E + mov al, rgb_21A4D.g mov Palettes+1, al - mov al, byte_21A4F + mov al, rgb_21A4D.b mov Palettes+2, al call far ptr palette_show call _snd_se_play c, 16 @@ -36932,12 +36932,8 @@ fp_219CA dw ? dd ? ; dd ? ; byte_21A4C db ? -byte_21A4D db ? -byte_21A4E db ? -byte_21A4F db ? -byte_21A50 db ? -byte_21A51 db ? -byte_21A52 db ? +rgb_21A4D rgb_t +rgb_21A50 rgb_t byte_21A53 db ? byte_21A54 db ? byte_21A55 db ? diff --git a/th03_main.asm b/th03_main.asm index 029ea093..2a68628d 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -1538,9 +1538,9 @@ sub_A378 proc far mov ax, ds mov es, ax assume es:_DATA - mov di, 1D94h - mov si, 11BAh - mov cx, 0Ch + mov di, offset palette_1F2F4 + mov si, offset Palettes + mov cx, size palette_t / 4 rep movsd pop di pop si @@ -1558,9 +1558,9 @@ sub_A38E proc far push di mov ax, ds mov es, ax - mov di, 11BAh - mov si, 1D94h - mov cx, 0Ch + mov di, offset Palettes + mov si, offset palette_1F2F4 + mov cx, size palette_t / 4 rep movsd call far ptr palette_show pop di @@ -1587,11 +1587,11 @@ arg_0 = byte ptr 6 mov al, [bp+arg_0] or al, al jz short loc_A3BC - mov bl, 3 + mov bl, 1 * size rgb_t loc_A3BC: - lea di, [bx+11BAh] - lea si, [bx+1D94h] + lea di, Palettes[bx] + lea si, palette_1F2F4[bx] movsw movsb mov _palette_changed, 1 @@ -1616,15 +1616,15 @@ arg_2 = byte ptr 8 push bp mov bp, sp push di - mov cx, 3 + mov cx, size rgb_t xor bx, bx mov al, [bp+arg_0] or al, al jz short loc_A3E4 - mov bl, 3 + mov bl, 1 * size rgb_t loc_A3E4: - lea di, [bx+11BAh] + lea di, Palettes[bx] mov al, [bp+arg_2] loc_A3EB: @@ -5574,25 +5574,25 @@ loc_CC4D: jnz short loc_CC89 mov al, byte ptr [bp+var_3] mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BAh], 78h ; 'x' + mov Palettes[bx].r, 78h loc_CC78: mov al, byte ptr [bp+var_3] mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BCh], 78h ; 'x' + mov Palettes[bx].b, 78h jmp short loc_CC98 ; --------------------------------------------------------------------------- loc_CC89: mov al, byte ptr [bp+var_3] mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BAh], 78h ; 'x' + mov Palettes[bx].r, 78h loc_CC98: mov _palette_changed, 1 @@ -5708,7 +5708,7 @@ loc_CD99: mov dh, 0 imul dx, 3 mov bx, dx - mov [bx+11BAh], al + mov Palettes[bx].r, al mov _palette_changed, 1 loc_CDB7: @@ -19634,19 +19634,19 @@ loc_149E8: mov [bp+var_2], dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_14A1C: @@ -20667,27 +20667,27 @@ loc_1522B: loc_1527D: mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_1] shl dl, 2 mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, [bp+var_1] mov ah, 0 imul ax, 3 mov dl, byte ptr word_1FE88 mov dh, 0 - imul dx, 3 + imul dx, size rgb_t mov bx, dx - mov [bx+11BBh], al + mov Palettes[bx].g, al mov al, [bp+var_1] mov ah, 0 imul ax, 3 mov dl, byte ptr word_1FE88 mov dh, 0 - imul dx, 3 + imul dx, size rgb_t mov bx, dx - mov [bx+11BCh], al + mov Palettes[bx].b, al jmp loc_153A6 ; --------------------------------------------------------------------------- @@ -20771,19 +20771,19 @@ loc_15360: mov [bp+var_2], dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl loc_153A6: mov _palette_changed, 1 @@ -21822,20 +21822,20 @@ loc_15C57: loc_15C7E: mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_10] mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_15CB0: @@ -24505,19 +24505,19 @@ loc_17202: mov [bp+var_2], dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 call egc_on call sub_1714F @@ -24532,30 +24532,30 @@ loc_17255: call snd_se_play pascal, 16 mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BAh], 64h ; 'd' + mov Palettes[bx].r, 64h jmp short loc_1728A ; --------------------------------------------------------------------------- loc_1727B: mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BAh], 0 + mov Palettes[bx].r, 0 loc_1728A: mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BBh], 0 + mov Palettes[bx].g, 0 mov al, byte ptr word_1FE88 mov ah, 0 imul ax, 3 mov bx, ax - mov byte ptr [bx+11BCh], 0 + mov Palettes[bx].b, 0 mov _palette_changed, 1 mov al, [bp+var_1] mov ah, 0 @@ -24628,19 +24628,19 @@ loc_17332: mov [bp+var_2], dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_1737D: @@ -26907,21 +26907,21 @@ loc_1853F: mov [bp+var_2], al mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_1] mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_185A3: @@ -27174,22 +27174,22 @@ loc_187AF: mov [bp+var_4], al mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_4] add dl, dl mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_4] mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 mov word_1FB3C, 0 jmp loc_18964 @@ -27203,38 +27203,38 @@ loc_18801: call snd_se_play pascal, 10 mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BAh], 0FFh + mov Palettes[bx].r, 0FFh mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BBh], 80h + mov Palettes[bx].g, 80h mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BCh], 80h + mov Palettes[bx].b, 80h jmp short loc_18872 ; --------------------------------------------------------------------------- loc_18845: mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BAh], 0 + mov Palettes[bx].r, 0 mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BBh], 0 + mov Palettes[bx].g, 0 mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov byte ptr [bx+11BCh], 20h ; ' ' + mov Palettes[bx].b, 20h loc_18872: mov _palette_changed, 1 @@ -27314,22 +27314,22 @@ loc_18911: mov [bp+var_4], dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t add dl, dl and dl, 0FFh mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_4] mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_18964: @@ -27555,21 +27555,21 @@ loc_18B77: mov [bp+var_2], al mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_1] mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_18BB4: @@ -27624,24 +27624,24 @@ loc_18C04: mov [bp+var_2], al mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] add dl, 40h mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] add dl, 20h ; ' ' mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 mov al, [bp+var_1] mov ah, 0 @@ -27774,21 +27774,21 @@ loc_18D5B: mov [bp+var_2], al mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_1] mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_18DBF: @@ -27991,21 +27991,21 @@ loc_18F89: mov [bp+var_2], al mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_2] mov bx, ax - mov [bx+11BAh], dl + mov Palettes[bx].r, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov bx, ax - mov [bx+11BBh], dl + mov Palettes[bx].g, dl mov al, byte ptr word_1FE88 mov ah, 0 - imul ax, 3 + imul ax, size rgb_t mov dl, [bp+var_1] mov bx, ax - mov [bx+11BCh], dl + mov Palettes[bx].b, dl mov _palette_changed, 1 loc_18FE2: @@ -36929,18 +36929,7 @@ word_1F2EC dw ? word_1F2EE dw ? public _yumeconfig _yumeconfig dd ? - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; - dd ? ; +palette_1F2F4 palette_t byte_1F324 db ? db ? word_1F326 dw ? diff --git a/th04/zunsoft.asm b/th04/zunsoft.asm index f1bff740..5d78df95 100644 --- a/th04/zunsoft.asm +++ b/th04/zunsoft.asm @@ -1,7 +1,3 @@ -; Spawns [n] new explosions at [origin]. -; [origin] uses screen pixels, *not* the 1/16th-pixel units of the structure. - -; void pascal zunsoft_pyro_new(Point origin, int n, char patnum_base) _zunsoft_pyro_new proc pascal near local @@pyros_created:word, @@i:word arg @@origin:Point, @@n:word, @@patnum_base:byte @@ -60,7 +56,6 @@ loc_B694: _zunsoft_pyro_new endp -; void pascal zunsoft_update_and_render(void) _zunsoft_update_and_render proc pascal near local @@patnum:word, @@draw_y:word, @@draw_x:word, @@anim_sprite:word @@ -192,7 +187,6 @@ loc_B7B9: _zunsoft_update_and_render endp -; void pascal zunsoft_palette_update_and_show(int tone) _zunsoft_palette_update_and_show proc near arg @@tone:word @@ -209,7 +203,7 @@ loc_B7CE: loc_B7D2: mov bx, si - imul bx, 3 + imul bx, size rgb_t mov al, _zunsoft_palette[bx+di] mov ah, 0 imul @@tone @@ -217,12 +211,12 @@ loc_B7D2: cwd idiv bx mov bx, si - imul bx, 3 + imul bx, size rgb_t mov Palettes[bx+di], al inc di loc_B7F0: - cmp di, 3 + cmp di, size rgb_t jl short loc_B7D2 inc si diff --git a/th04/zunsoft.h b/th04/zunsoft.h new file mode 100644 index 00000000..e9d7eca8 --- /dev/null +++ b/th04/zunsoft.h @@ -0,0 +1,10 @@ +// Copy of the palette used during the logo, to allow non-blocking fades in +// contrast to master.lib's blocking palette_black_in() and palette_black_out() +// functions. (Then again, master.lib has the PaletteTone global for that...) +extern rgb_t zunsoft_palette[16]; + +// Spawns [n] new explosions at the given screen-coordinate [origin] position. +void pascal zunsoft_pyro_new(Point screen_origin, int n, char patnum_base); + +void pascal zunsoft_update_and_render(void); +void pascal zunsoft_palette_update_and_show(int tone); diff --git a/th04/zunsoft[bss].asm b/th04/zunsoft[bss].asm index 746691c1..945d765f 100644 --- a/th04/zunsoft[bss].asm +++ b/th04/zunsoft[bss].asm @@ -1,6 +1,4 @@ -; Copy of the palette used during the logo, to allow non-blocking fades in -; contrast to master.lib's blocking palette_black_in() and palette_black_out() -; functions. (Then again, master.lib has the PaletteTone global for that...) +public _zunsoft_palette _zunsoft_palette db 48 dup(?) ; ZUN Soft logo explosion structure. diff --git a/th04_op.asm b/th04_op.asm index 31b0d856..c4de0f31 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -2354,36 +2354,36 @@ var_2 = byte ptr -2 loc_BCA8: mov bx, si - imul bx, 3 - mov al, [bx+1A96h] + imul bx, size rgb_t + mov al, Palettes[bx].r mov bx, si - imul bx, 3 - mov [bx+2B4Ch], al + imul bx, size rgb_t + mov _zunsoft_palette[bx].r, al mov bx, si - imul bx, 3 - mov al, [bx+1A97h] + imul bx, size rgb_t + mov al, Palettes[bx].g mov bx, si - imul bx, 3 - mov [bx+2B4Dh], al + imul bx, size rgb_t + mov _zunsoft_palette[bx].g, al mov bx, si - imul bx, 3 - mov al, [bx+1A98h] + imul bx, size rgb_t + mov al, Palettes[bx].b mov bx, si - imul bx, 3 - mov [bx+2B4Eh], al + imul bx, size rgb_t + mov _zunsoft_palette[bx].b, al mov bx, si - imul bx, 3 - mov byte ptr [bx+1A96h], 0 + imul bx, size rgb_t + mov Palettes[bx].r, 0 mov bx, si - imul bx, 3 - mov byte ptr [bx+1A97h], 0 + imul bx, size rgb_t + mov Palettes[bx].g, 0 mov bx, si - imul bx, 3 - mov byte ptr [bx+1A98h], 0 + imul bx, size rgb_t + mov Palettes[bx].b, 0 inc si loc_BCFD: - cmp si, 0Fh + cmp si, 15 jl short loc_BCA8 call snd_load pascal, ds, offset aLogo, SND_LOAD_SONG kajacall KAJA_SONG_PLAY @@ -3954,7 +3954,7 @@ sub_CCD2 proc near @@page = byte ptr -4 var_3 = byte ptr -3 -var_2 = word ptr -2 +@@component = word ptr -2 enter 4, 0 push si @@ -4047,18 +4047,18 @@ loc_CE50: loc_CE8B: mov bx, si - imul bx, 3 - mov byte ptr [bx+1A96h], 0FFh + imul bx, size rgb_t + mov Palettes[bx].r, 0FFh mov bx, si - imul bx, 3 - mov byte ptr [bx+1A97h], 0FFh + imul bx, size rgb_t + mov Palettes[bx].g, 0FFh mov bx, si - imul bx, 3 - mov byte ptr [bx+1A98h], 0FFh + imul bx, size rgb_t + mov Palettes[bx].b, 0FFh inc si loc_CEAA: - cmp si, 10h + cmp si, PALETTE_COLORS jl short loc_CE8B call far ptr palette_show mov PaletteTone, 64h ; 'd' @@ -4070,9 +4070,9 @@ loc_CEAA: loc_CEC7: mov al, [bp+var_3] - mov Palettes, al - mov Palettes+1, al - mov Palettes+2, al + mov Palettes[0 * size rgb_t].r, al + mov Palettes[0 * size rgb_t].g, al + mov Palettes[0 * size rgb_t].b, al call far ptr palette_show push 1 call frame_delay @@ -4095,36 +4095,36 @@ loc_CEF5: ; --------------------------------------------------------------------------- loc_CEFA: - mov [bp+var_2], 0 + mov [bp+@@component], 0 jmp short loc_CF2D ; --------------------------------------------------------------------------- loc_CF01: mov bx, di - imul bx, 3 - add bx, [bp+var_2] + imul bx, size rgb_t + add bx, [bp+@@component] mov al, [bx+23A0h] mov bx, di - imul bx, 3 - add bx, [bp+var_2] - cmp al, [bx+1A96h] + imul bx, size rgb_t + add bx, [bp+@@component] + cmp al, Palettes[bx].r jnb short loc_CF2A mov bx, di - imul bx, 3 - add bx, [bp+var_2] + imul bx, size rgb_t + add bx, [bp+@@component] mov al, [bp+var_3] - mov [bx+1A96h], al + mov Palettes[bx].r, al loc_CF2A: - inc [bp+var_2] + inc [bp+@@component] loc_CF2D: - cmp [bp+var_2], 3 + cmp [bp+@@component], size rgb_t jl short loc_CF01 inc di loc_CF34: - cmp di, 10h + cmp di, PALETTE_COLORS jl short loc_CEFA call far ptr palette_show push 1 diff --git a/th05_op.asm b/th05_op.asm index aa2e7698..2fbbe06b 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -2295,32 +2295,32 @@ opening_key_pressed = byte ptr -2 ;fps hack? loc_B872: mov bx, si - imul bx, 3 - mov al, [bx+2E1Eh] + imul bx, size rgb_t + mov al, Palettes[bx].r mov bx, si - imul bx, 3 - mov [bx+3F54h], al + imul bx, size rgb_t + mov _zunsoft_palette[bx].r, al mov bx, si - imul bx, 3 - mov al, [bx+2E1Fh] + imul bx, size rgb_t + mov al, Palettes[bx].g mov bx, si - imul bx, 3 - mov [bx+3F55h], al + imul bx, size rgb_t + mov _zunsoft_palette[bx].g, al mov bx, si - imul bx, 3 - mov al, [bx+2E20h] + imul bx, size rgb_t + mov al, Palettes[bx].b mov bx, si - imul bx, 3 - mov [bx+3F56h], al + imul bx, size rgb_t + mov _zunsoft_palette[bx].b, al mov bx, si - imul bx, 3 - mov byte ptr [bx+2E1Eh], 0 + imul bx, size rgb_t + mov Palettes[bx].r, 0 mov bx, si - imul bx, 3 - mov byte ptr [bx+2E1Fh], 0 + imul bx, size rgb_t + mov Palettes[bx].g, 0 mov bx, si - imul bx, 3 - mov byte ptr [bx+2E20h], 0 + imul bx, size rgb_t + mov Palettes[bx].b, 0 inc si loc_B8C7: