diff --git a/Makefile b/Makefile index 10ee95e97..4f3ba2489 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,7 @@ OBJS = \ d_mapinfo.o \ sh2_fixed.o \ sh2_draw.o \ + sh2_drawlow.o \ sh2_mixer.o \ r_cache.o \ m_fire.o \ @@ -117,7 +118,7 @@ m68k.bin: $(TARGET).32x: $(TARGET).elf $(OBJC) -O binary $< temp2.bin - $(DD) if=temp2.bin of=temp.bin bs=198K conv=sync + $(DD) if=temp2.bin of=temp.bin bs=200K conv=sync rm -f temp3.bin cat temp.bin $(WAD) >>temp3.bin $(DD) if=temp3.bin of=$@ bs=512K conv=sync diff --git a/marsdraw.c b/marsdraw.c index 5b9a9ad29..cbceb7339 100644 --- a/marsdraw.c +++ b/marsdraw.c @@ -523,7 +523,7 @@ void I_DrawSpanPotatoLow(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_x { pixel_t* dest, pix; unsigned count; - short* dc_colormap; + int8_t *dc_colormap; #ifdef RANGECHECK if (ds_x2 < ds_x1 || ds_x1<0 || ds_x2 >= viewportWidth || ds_y>viewportHeight) @@ -536,8 +536,9 @@ void I_DrawSpanPotatoLow(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_x count = ds_x2 - ds_x1 + 1; dest = viewportbuffer + ds_y * 320 / 2 + ds_x1; - dc_colormap = (int16_t *)dc_colormaps + light; - pix = dc_colormap[(int8_t)ds_source[513]]; + dc_colormap = (int8_t *)dc_colormaps + light; + pix = (uint8_t)dc_colormap[(int8_t)ds_source[513]]; + pix = ((uint8_t)pix << 8) | pix; do { *dest++ = pix; diff --git a/marsnew.c b/marsnew.c index dbf4b7ab1..96670acbd 100644 --- a/marsnew.c +++ b/marsnew.c @@ -713,13 +713,14 @@ pixel_t* I_OverwriteBuffer(void) int I_ViewportYPos(void) { const int fbh = I_FrameBufferHeight(); + int width = viewportWidth * (lowres ? 2 : 1); if (splitscreen) return (fbh - viewportHeight) / 2; - if (viewportWidth < 160) + if (width < 160) return (fbh - jo_stbar_height - viewportHeight) / 2; - if (viewportWidth == 320) + if (width == 320) return (fbh - jo_stbar_height - viewportHeight); return (fbh - jo_stbar_height - viewportHeight) / 2; } @@ -728,14 +729,15 @@ pixel_t *I_ViewportBuffer (void) { int x = 0; pixel_t *vb = (pixel_t * )framebuffer; - + int width = viewportWidth * (lowres ? 2 : 1); + if (splitscreen) { x = vd->displayplayer ? 160 : 0; } else { - x = (320 - viewportWidth) / 2; + x = (320 - width) / 2; } vb += I_ViewportYPos() * 320 / 2 + x / 2; diff --git a/marssave.c b/marssave.c index 311108d64..dab15bf0d 100644 --- a/marssave.c +++ b/marssave.c @@ -65,6 +65,7 @@ typedef struct __attribute((packed)) int8_t yabcdpad; int8_t sfxdriver; char spcmDir[9]; + int8_t lowres; } saveopts_t; static char saveslotguard[SRAM_SLOTSIZE - sizeof(savegame_t)] __attribute__((unused)); @@ -192,6 +193,7 @@ static void SaveOptions(void) so.yabcdpad = yabcdpad; so.magic1 = SRAM_MAGIC1; so.magic2 = SRAM_MAGIC2; + so.lowres = lowres; D_snprintf(so.spcmDir, sizeof(so.spcmDir), "%s", spcmDir); Mars_WriteSRAM((void*)&so, optslotoffset, sizeof(saveopts_t)); @@ -247,6 +249,7 @@ static void ReadOptions(void) anamorphicview = so.anamorphic; sfxdriver = so.sfxdriver; yabcdpad = so.yabcdpad; + lowres = so.lowres; so.spcmDir[sizeof(so.spcmDir)-1] = '\0'; D_snprintf(spcmDir, sizeof(spcmDir), "%s", so.spcmDir); @@ -274,6 +277,7 @@ void ReadEEProm(void) anamorphicview = 0; sfxdriver = 0; detailmode = detmode_normal; + lowres = false; ReadOptions(); } diff --git a/o_main.c b/o_main.c index 6fa757632..7a6e335f6 100644 --- a/o_main.c +++ b/o_main.c @@ -39,6 +39,7 @@ typedef enum mi_resolution, mi_anamorphic, mi_detailmode, + mi_lowres, mi_controltype, mi_yabcdpad, @@ -247,6 +248,10 @@ void O_Init (void) menuitem[mi_detailmode].x = ITEMX; menuitem[mi_detailmode].y = STARTY + ITEMSPACE * 3; + D_memcpy(menuitem[mi_lowres].name, "Low detail", 11); + menuitem[mi_lowres].x = ITEMX; + menuitem[mi_lowres].y = STARTY + ITEMSPACE * 4; + D_memcpy(menuitem[mi_controltype].name, "Gamepad", 8); menuitem[mi_controltype].x = ITEMX; menuitem[mi_controltype].y = STARTY; @@ -293,7 +298,7 @@ void O_Init (void) D_memcpy(menuscreen[ms_video].name, "Video", 6); menuscreen[ms_video].firstitem = mi_resolution; - menuscreen[ms_video].numitems = mi_detailmode - mi_resolution + 1; + menuscreen[ms_video].numitems = mi_lowres - mi_resolution + 1; D_memcpy(menuscreen[ms_controls].name, "Controls", 9); menuscreen[ms_controls].firstitem = mi_controltype; @@ -724,6 +729,13 @@ void O_Control (player_t *player) if (detailmode != detmode_potato) detailmode = detmode_potato; break; + case mi_lowres: + if (!lowres) + { + lowres = true; + R_SetViewportSize(viewportNum); + } + break; } } @@ -738,6 +750,13 @@ void O_Control (player_t *player) if (detailmode != detmode_normal) detailmode = detmode_normal; break; + case mi_lowres: + if (lowres) + { + lowres = false; + R_SetViewportSize(viewportNum); + } + break; } } @@ -908,6 +927,15 @@ void O_Drawer (void) print(menuitem[mi_detailmode].x + 160, menuitem[mi_detailmode].y, "off"); break; } + + switch (lowres) { + case true: + print(menuitem[mi_lowres].x + 160, menuitem[mi_lowres].y, "on"); + break; + default: + print(menuitem[mi_lowres].x + 160, menuitem[mi_lowres].y, "off"); + break; + } } if (screenpos == ms_help) diff --git a/p_tick.c b/p_tick.c index 38058e7d7..f82e195ca 100644 --- a/p_tick.c +++ b/p_tick.c @@ -540,9 +540,11 @@ void P_Drawer (void) clearscreen = 2; if (clearscreen > 0) { + int width = viewportWidth * (lowres ? 2 : 1); + I_ResetLineTable(); - if (viewportWidth == 320) + if (width == 320) I_ClearFrameBuffer(); else DrawTiledBackground(); diff --git a/r_local.h b/r_local.h index d500eb2ab..fa4ed81c9 100644 --- a/r_local.h +++ b/r_local.h @@ -12,6 +12,7 @@ extern fixed_t stretch; extern fixed_t stretchX; extern VINT weaponYpos; extern fixed_t weaponXScale; +extern boolean lowres; #define PROJECTION centerXFrac diff --git a/r_main.c b/r_main.c index e33236dfd..4378f83f8 100644 --- a/r_main.c +++ b/r_main.c @@ -14,6 +14,7 @@ fixed_t stretch; fixed_t stretchX; VINT weaponYpos; fixed_t weaponXScale; +boolean lowres = false; VINT detailmode; @@ -260,6 +261,8 @@ void R_SetViewportSize(int num) width = viewports[num][splitscreen][0]; height = viewports[num][splitscreen][1]; + if (lowres) + width /= 2; viewportNum = num; viewportWidth = width; @@ -281,7 +284,7 @@ void R_SetViewportSize(int num) //stretch = (fixed_t)((160.0f / width) * ((float)height / 180.0f) * 2.2f * FRACUNIT); stretch = ((FRACUNIT * 16 * height) / 180 * 22) / width; } - weaponXScale = FRACUNIT; + weaponXScale = FRACUNIT / (lowres ? 2 : 1); stretchX = stretch * centerX; weaponYpos = 180; @@ -319,11 +322,22 @@ void R_SetDrawFuncs(void) if (detailmode < detmode_potato || detailmode >= MAXDETAILMODES) detailmode = detmode_normal; - drawcol = I_DrawColumn; - drawcolnpo2 = I_DrawColumnNPo2; - drawfuzzcol = I_DrawFuzzColumn; - drawspan = detailmode == detmode_potato ? I_DrawSpanPotato : I_DrawSpan; + if (lowres) + { + drawcol = I_DrawColumnLow; + drawcolnpo2 = I_DrawColumnNPo2Low; + drawfuzzcol = I_DrawFuzzColumnLow; + drawspan = detailmode == detmode_potato ? I_DrawSpanPotatoLow : I_DrawSpanLow; + } + else + { + drawcol = I_DrawColumn; + drawcolnpo2 = I_DrawColumnNPo2; + drawfuzzcol = I_DrawFuzzColumn; + drawspan = detailmode == detmode_potato ? I_DrawSpanPotato : I_DrawSpan; + } + Mars_ClearCache(); #ifdef MARS Mars_CommSlaveClearCache(); #endif diff --git a/r_phase3.c b/r_phase3.c index 20b1b6f4e..1d9f26beb 100644 --- a/r_phase3.c +++ b/r_phase3.c @@ -217,7 +217,7 @@ static void R_PrepPSprite(pspdef_t *psp) return; xscale = weaponXScale; - center = centerXFrac - 160 * weaponXScale; + center = centerXFrac - (lowres ? 320 - viewportWidth : 160) * weaponXScale; tx = psp->sx + center; topoffset = (((fixed_t)BIGSHORT(patch->topoffset) - weaponYpos) << FRACBITS) - psp->sy; diff --git a/sh2_drawlow.s b/sh2_drawlow.s index 2f6dc9231..bef103666 100644 --- a/sh2_drawlow.s +++ b/sh2_drawlow.s @@ -7,16 +7,14 @@ ! Draw a vertical column of pixels from a projected wall texture. ! Source is the top of the column to scale. -! Low detail (doubl-wide pixels) mode. ! -!void I_DrawColumnLow(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, +!void I_DrawColumn(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, ! fixed_t fracstep, inpixel_t *dc_source, int dc_texheight) - - .align 4 + .align 2 .global _I_DrawColumnLowA _I_DrawColumnLowA: - add #1,r6 + add #1,r6 0: cmp/ge r6,r5 bf/s 1f @@ -28,70 +26,74 @@ _I_DrawColumnLowA: 1: mov.l r8,@-r15 mov.l r9,@-r15 + mov.l r10,@-r15 mov.l @(DOOMTLS_COLORMAP, gbr),r0 - add r7,r7 add r0,r7 /* dc_colormap = colormap + light */ mov.l draw_fb,r8 mov.l @r8,r8 /* frame buffer start */ - add r4,r8 - add r4,r8 /* fb += dc_x*2 */ + add r4,r8 /* fb += dc_x */ + add r4,r8 /* fb += dc_x */ shll8 r5 add r5,r8 shlr2 r5 add r5,r8 /* fb += (dc_yl*256 + dc_yl*64) */ - mov.l @(8,r15),r2 /* frac */ - mov.l @(12,r15),r3 /* fracstep */ - mov.l @(16,r15),r5 /* dc_source */ - mov.l @(20,r15),r4 + mov.l @(12,r15),r2 /* frac */ + mov.l @(16,r15),r3 /* fracstep */ + mov.l @(20,r15),r5 /* dc_source */ + mov.l @(24,r15),r4 mov.l draw_width,r1 add #-1,r4 /* heightmask = texheight - 1 */ + swap.w r2,r0 /* (frac >> 16) */ and r4,r0 /* (frac >> 16) & heightmask */ /* test if count & 1 */ shlr r6 movt r9 /* 1 if count was odd */ - bt/s do_col_loop_low_1px + bt/s do_col_loop_1px add r9,r6 .p2alignw 2, 0x0009 -do_col_loop_low: +do_col_loop: mov.b @(r0,r5),r0 /* pix = dc_source[(frac >> 16) & heightmask] */ - add r0,r0 - mov.w @(r0,r7),r9 /* dpix = dc_colormap[pix] */ add r3,r2 /* frac += fracstep */ + mov.b @(r0,r7),r9 /* dpix = dc_colormap[pix] */ swap.w r2,r0 /* (frac >> 16) */ - and r4,r0 /* (frac >> 16) & heightmask */ + extu.b r9,r9 + swap.b r9,r10 + or r10,r9 mov.w r9,@r8 /* *fb = dpix */ add r1,r8 /* fb += SCREENWIDTH */ -do_col_loop_low_1px: - mov.b @(r0,r5),r0 /* pix = dc_source[(frac >> 16) & heightmask] */ - add r0,r0 - mov.w @(r0,r7),r9 /* dpix = dc_colormap[pix] */ + and r4,r0 /* (frac >> 16) & heightmask */ +do_col_loop_1px: add r3,r2 /* frac += fracstep */ + mov.b @(r0,r5),r0 /* pix = dc_source[(frac >> 16) & heightmask] */ dt r6 /* count-- */ + mov.b @(r0,r7),r9 /* dpix = dc_colormap[pix] */ swap.w r2,r0 /* (frac >> 16) */ - mov.w r9,@r8 /* *fb = dpix */ and r4,r0 /* (frac >> 16) & heightmask */ - bf/s do_col_loop_low + extu.b r9,r9 + swap.b r9,r10 + or r10,r9 + mov.w r9,@r8 /* *fb = dpix */ + bf/s do_col_loop add r1,r8 /* fb += SCREENWIDTH */ + mov.l @r15+,r10 mov.l @r15+,r9 rts mov.l @r15+,r8 ! Draw a vertical column of pixels from a projected wall texture. ! Non-power of 2 texture height. -! Low detail (doubl-wide pixels) mode. ! -!void I_DrawColumnNPO2Low(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, +!void I_DrawColumnNPO2(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, ! fixed_t fracstep, inpixel_t *dc_source, int dc_texheight) - - .align 4 + .align 2 .global _I_DrawColumnNPo2LowA _I_DrawColumnNPo2LowA: - add #1,r6 + add #1,r6 0: cmp/ge r6,r5 bf/s 1f @@ -102,21 +104,21 @@ _I_DrawColumnNPo2LowA: nop 1: mov.l r8,@-r15 + mov.l r9,@-r15 mov.l @(DOOMTLS_COLORMAP, gbr),r0 - add r7,r7 add r0,r7 /* dc_colormap = colormap + light */ mov.l draw_fb,r8 mov.l @r8,r8 /* frame buffer start */ - add r4,r8 - add r4,r8 /* fb += dc_x*2 */ + add r4,r8 /* fb += dc_x */ + add r4,r8 /* fb += dc_x */ shll8 r5 add r5,r8 shlr2 r5 add r5,r8 /* fb += (dc_yl*256 + dc_yl*64) */ - mov.l @(4,r15),r2 /* frac */ - mov.l @(8,r15),r3 /* fracstep */ - mov.l @(12,r15),r5 /* dc_source */ - mov.l @(16,r15),r4 + mov.l @(8,r15),r2 /* frac */ + mov.l @(12,r15),r3 /* fracstep */ + mov.l @(16,r15),r5 /* dc_source */ + mov.l @(20,r15),r4 shll16 r4 /* heightmask = texheight << FRACBITS */ mov #0,r0 @@ -138,26 +140,28 @@ _I_DrawColumnNPo2LowA: bt 4b 5: mov.l draw_width,r1 - sub r1,r8 /* fb -= SCREENWIDTH */ .p2alignw 2, 0x0009 -do_cnp_loop_low: +do_cnp_loop: mov r2,r0 shlr16 r0 /* frac >> 16 */ mov.b @(r0,r5),r0 /* pix = dc_source[frac >> 16] */ - add r1,r8 /* fb += SCREENWIDTH */ - add r3,r2 /* frac += fracstep */ cmp/ge r4,r2 - add r0,r0 + mov.b @(r0,r7),r0 /* dpix = dc_colormap[pix] */ bf/s 1f - mov.w @(r0,r7),r0 /* dpix = dc_colormap[pix] */ + add r3,r2 /* frac += fracstep */ /* if (frac >= heightmask) */ sub r4,r2 /* frac -= heightmask */ 1: dt r6 /* count-- */ - bf/s do_cnp_loop_low + extu.b r0,r0 + swap.b r0,r9 + or r9,r0 mov.w r0,@r8 /* *fb = dpix */ + bf/s do_cnp_loop + add r1,r8 /* fb += SCREENWIDTH */ + mov.l @r15+,r9 rts mov.l @r15+,r8 @@ -165,12 +169,12 @@ do_cnp_loop_low: ! Source is the top of the column to scale. ! Low detail (doubl-wide pixels) mode. ! -!void I_DrawFuzzColumnLow(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, +!void I_DrawFuzzColumn(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, ! fixed_t fracstep, inpixel_t *dc_source, int dc_texheight) - - .align 4 + .align 2 .global _I_DrawFuzzColumnLowA _I_DrawFuzzColumnLowA: + mov #0,r0 cmp/eq r0,r5 bf 0f @@ -195,12 +199,12 @@ _I_DrawFuzzColumnLowA: 3: mov.l @(DOOMTLS_COLORMAP, gbr),r0 mov.l r8,@-r15 - add r7,r7 + mov.l r9,@-r15 add r0,r7 /* dc_colormap = colormap + light */ mov.l draw_fb,r8 mov.l @r8,r8 /* frame buffer start */ - add r4,r8 - add r4,r8 /* fb += dc_x*2 */ + add r4,r8 /* fb += dc_x */ + add r4,r8 /* fb += dc_x */ shll8 r5 add r5,r8 shlr2 r5 @@ -213,37 +217,38 @@ _I_DrawFuzzColumnLowA: and #126,r0 /* fuzzpos &= FUZZMASK */ .p2alignw 2, 0x0009 -do_fuzz_col_loop_low: +do_fuzz_col_loop: mov.w @(r0,r5),r0 /* pix = fuzztable[fuzzpos] */ - dt r6 /* count-- */ - mov.b @(r0,r8),r0 /* pix = dest[pix] */ - add r0,r0 - mov.w @(r0,r7),r4 /* dpix = dc_colormap[pix] */ add #2,r3 + mov.b @(r0,r8),r0 /* pix = dest[pix] */ + dt r6 /* count-- */ + mov.b @(r0,r7),r4 /* dpix = dc_colormap[pix] */ mov r3,r0 and #126,r0 /* fuzzpos &= FUZZMASK */ - mov.w r4,@r8 /* *fb = dpix */ - bf/s do_fuzz_col_loop_low + extu.b r4,r4 + swap.b r4,r9 + or r9,r4 + mov.b r4,@r8 /* *fb = dpix */ + bf/s do_fuzz_col_loop add r1,r8 /* fb += SCREENWIDTH */ shlr r3 mov r3,r0 mov.l r0,@(DOOMTLS_FUZZPOS, gbr) + mov.l @r15+,r9 rts mov.l @r15+,r8 ! Draw a horizontal row of pixels from a projected flat (floor/ceiling) texture. -! Low detail (doubl-wide pixels) mode. ! -!void I_DrawSpanLow(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, +!void I_DrawSpan(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, ! fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, ! inpixel_t *ds_source, int ds_height) - - .align 4 + .align 2 .global _I_DrawSpanLowA _I_DrawSpanLowA: - add #1,r6 + add #1,r6 0: cmp/ge r6,r5 bf/s 1f @@ -252,80 +257,100 @@ _I_DrawSpanLowA: /* dc_yl >= dc_yh, exit */ rts nop + 1: mov.l r8,@-r15 mov.l r9,@-r15 mov.l r10,@-r15 mov.l r11,@-r15 mov.l r12,@-r15 + mov.l r13,@-r15 mov.l @(DOOMTLS_COLORMAP, gbr),r0 - add r7,r7 add r0,r7 /* ds_colormap = colormap + light */ mov.l draw_fb,r8 + mov.l @r8,r8 /* frame buffer start */ add r5,r8 - add r5,r8 /* fb += ds_x1*2 */ + add r5,r8 + add r6,r8 + add r6,r8 shll8 r4 add r4,r8 shlr2 r4 add r4,r8 /* fb += (ds_y*256 + ds_y*64) */ - mov.l @(20,r15),r2 /* xfrac */ - mov.l @(24,r15),r4 /* yfrac */ - mov.l @(28,r15),r3 /* xstep */ - mov.l @(32,r15),r5 /* ystep */ - mov.l @(36,r15),r9 /* ds_source */ - mov.l @(40,r15),r12 /* ds_height */ - - mov r12,r11 - dt r11 - mulu.w r12,r11 /* (ds_height-1) * ds_height */ + + mov.l @(40,r15),r9 /* ds_source */ + mov.l @(44,r15),r11 /* ds_height */ + + mov r11,r12 dt r12 /* (ds_height-1) */ + mulu.w r12,r11 /* (ds_height-1) * ds_height */ + + mov.l @(24,r15),r2 /* xfrac */ + mov.l @(32,r15),r3 /* xstep */ + sts macl,r11 /* draw_flat_ymask */ - swap.w r4,r1 /* (yfrac >> 16) */ - and r11,r1 /* (yfrac >> 16) & 63*64 */ + dmuls.l r3,r6 + + mov.l @(28,r15),r4 /* yfrac */ + mov.l @(36,r15),r5 /* ystep */ + + sts macl,r10 + add r10,r2 /* xfrac += xstep * count */ + + dmuls.l r5,r6 + swap.w r2,r0 /* (xfrac >> 16) */ and r12,r0 /* (xfrac >> 16) & 63 */ + + sts macl,r10 + add r10,r4 /* yfrac += ystep * count */ + + swap.w r4,r1 /* (yfrac >> 16) */ + and r11,r1 /* (yfrac >> 16) & 63*64 */ + or r1,r0 /* spot = ((yfrac >> 16) & *64) | ((xfrac >> 16) & 63) */ /* test if count & 1 */ shlr r6 movt r1 /* 1 if count was odd */ - bt/s do_span_low_loop_1px + bt/s do_span_loop_1px add r1,r6 .p2alignw 2, 0x0009 -do_span_low_loop: +do_span_loop: mov.b @(r0,r9),r0 /* pix = ds_source[spot] */ - add r3,r2 /* xfrac += xstep */ - add r5,r4 /* yfrac += ystep */ - add r0,r0 - mov.w @(r0,r7),r10 /* dpix = ds_colormap[pix] */ + sub r3,r2 /* xfrac -= xstep */ + sub r5,r4 /* yfrac -= ystep */ swap.w r4,r1 /* (yfrac >> 16) */ - and r11,r1 /* (yfrac >> 16) & 63*64 */ + mov.b @(r0,r7),r10 /* dpix = ds_colormap[pix] */ swap.w r2,r0 /* (xfrac >> 16) */ and r12,r0 /* (xfrac >> 16) & 63 */ + extu.b r10,r10 + swap.b r10,r13 + or r13,r10 + mov.w r10,@-r8 /* *--fb = dpix */ + and r11,r1 /* (yfrac >> 16) & 63*64 */ or r1,r0 /* spot = ((yfrac >> 16) & *64) | ((xfrac >> 16) & 63) */ - mov.w r10,@r8 /* *fb = dpix */ - add #2,r8 /* fb++ */ - -do_span_low_loop_1px: +do_span_loop_1px: + dt r6 /* count-- */ mov.b @(r0,r9),r0 /* pix = ds_source[spot] */ - add r3,r2 /* xfrac += xstep */ - add r5,r4 /* yfrac += ystep */ - add r0,r0 - mov.w @(r0,r7),r10 /* dpix = ds_colormap[pix] */ + sub r3,r2 /* xfrac -= xstep */ + sub r5,r4 /* yfrac -= ystep */ swap.w r4,r1 /* (yfrac >> 16) */ - and r11,r1 /* (yfrac >> 16) & 63*64 */ + mov.b @(r0,r7),r10 /* dpix = ds_colormap[pix] */ swap.w r2,r0 /* (xfrac >> 16) */ and r12,r0 /* (xfrac >> 16) & 63 */ + extu.b r10,r10 + swap.b r10,r13 + or r13,r10 + mov.w r10,@-r8 /* *--fb = dpix */ + and r11,r1 /* (yfrac >> 16) & 63*64 */ + bf/s do_span_loop or r1,r0 /* spot = ((yfrac >> 16) & *64) | ((xfrac >> 16) & 63) */ - mov.w r10,@r8 /* *fb = dpix */ - - dt r6 /* count-- */ - bf/s do_span_low_loop - add #2,r8 /* fb++ */ + mov.l @r15+,r13 mov.l @r15+,r12 mov.l @r15+,r11 mov.l @r15+,r10 @@ -340,7 +365,5 @@ draw_width: .long 320 draw_height: .long _viewportHeight -draw_flat_ymask: - .long 4032 draw_fuzzoffset: .long _fuzzoffset diff --git a/wadbase.s b/wadbase.s index 6c3e29e19..a13583202 100644 --- a/wadbase.s +++ b/wadbase.s @@ -4,5 +4,5 @@ .global _wadBase _wadBase: - .long 0x2031800 + .long 0x2032000