
|
|
Author |
Message |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 14 Feb 2019
Topics: 55
Posts: 2169
Location: Canada

|
Posted: Fri Feb 26, 2010 9:49 pm
Subject: Enabling Tab-T (viewing walls, sprites, sounds)
[ IP : Logged ]
|

 
|
|
Just curious, has anyone here tried to get this debug code working in SDL?
I tried doing some random experimenting with it tonight... mostly just for fun...
::: CODE :::
void ShapeTest (void)
{
extern word NumDigi;
static char buf[10];
boolean done;
ScanCode scan;
int i,j,k,x;
longword l;
byte *addr;
soundnames sound;
CenterWindow(20,16);
VW_UpdateScreen();
for (i = 0,done = false; !done;)
{
US_ClearWindow();
sound = (soundnames) -1;
US_Print(" Page #");
US_PrintUnsigned(i);
if (i < PMSpriteStart)
US_Print(" (Wall)");
else if (i < PMSoundStart)
US_Print(" (Sprite)");
else if (i == ChunksInFile - 1)
US_Print(" (Sound Info)");
else
US_Print(" (Sound)");
US_Print("\n Address: ");
addr = (byte *) PM_GetPage(i);
sprintf(buf,"0x%08X",(int32_t) addr);
US_Print(buf);
if (addr)
{
if (i < PMSpriteStart)
{
// Display Walls
uint8_t *start;
start = PM_GetPage(i);
for (int x=0;x<64;x++)
for (int y=0;y<64;y++)
VWB_Plot(x+128,y+60,(int)(*start++));
}
else if (i < PMSoundStart)
{
// Display Sprites (ripped from SimpleScaleShape)
t_compshape *shape;
unsigned starty,endy,lpix;
word *cmdptr;
byte *line, col;
short newstart;
shape = (t_compshape *) PM_GetSprite(i-PMSpriteStart);
cmdptr=shape->dataofs;
for(lpix=shape->leftpix;lpix<=shape->rightpix;lpix++,cmdptr++)
{
line = (byte *)shape + *cmdptr;
while((endy = READWORD(line)) != 0)
{
endy >>= 1;
newstart = READWORD(line);
starty = READWORD(line) >> 1;
for(;starty<endy;starty++)
{
col=((byte *)shape)[newstart+starty];
VWB_Plot(lpix+128,starty+60,col);
}
}
}
l = (int)(PM_GetPage(i+1) - PM_GetPage(i) - 1);
US_Print("\n Size: ");
US_PrintSigned(l);
}
else if (i == ChunksInFile - 1)
{
// Display Sound Info
US_Print("\n\n Number of sounds: ");
US_PrintUnsigned(NumDigi);
k = ChunksInFile - PMSoundStart - 1;
l = addr - PM_GetPage(PMSoundStart);
US_Print("\n Total bytes: ");
US_PrintUnsigned(l);
US_Print("\n Total pages: ");
US_PrintUnsigned(k);
}
else
{
// Display Sounds (no segment # yet)
byte *dp = addr;
l = (int)(PM_GetPage(i+1) - PM_GetPage(i) - 1);
for (j = 0;j < l;j += 32)
{
byte v = dp[j];
int v2 = (unsigned)v;
v2 -= 128;
v2 /= 4;
if (v2 < 0)
VWB_Vlin(WindowY + WindowH - 32 + v2,
WindowY + WindowH - 32,
WindowX + 8 + (j / 32),BLACK);
else
VWB_Vlin(WindowY + WindowH - 32,
WindowY + WindowH - 32 + v2,
WindowX + 8 + (j / 32),BLACK);
}
}
}
VW_UpdateScreen();
IN_Ack();
scan = LastScan;
IN_ClearKey(scan);
switch (scan)
{
case sc_LeftArrow:
if (i)
i--;
break;
case sc_RightArrow:
if (++i >= ChunksInFile)
i--;
break;
case sc_W: // Walls
i = 0;
break;
case sc_S: // Sprites
i = PMSpriteStart;
break;
case sc_D: // Digitized
i = PMSoundStart;
break;
case sc_I: // Digitized info
i = ChunksInFile - 1;
break;
case sc_P:
if (sound != -1)
SD_PlayDigitized(sound,8,8);
break;
case sc_Escape:
done = true;
break;
}
}
SD_StopDigitized();
}
Those changes are extremely cheezy and unorthodox... mind you, but Tab-T lives again!
Anyway, feel free to replace the blue code with something better if you want. I'm going to bed.  |
Last edited by Chris on Sun Feb 28, 2010 8:20 am; edited 1 time in total
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 3:07 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
Posted: Sat Feb 27, 2010 6:04 pm
Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
[ IP : Logged ]
|

  
|
|
Thanks for the post, Chris. All that's left for us to do is get this working in a 128x128 VSWAP.  |
|
|
 |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 14 Feb 2019
Topics: 55
Posts: 2169
Location: Canada

|
Posted: Sun Feb 28, 2010 11:30 am
Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
[ IP : Logged ]
|

  
|
|
Thanks. The hi-res sprites should show up ok, but you could adjust their position like this...
::: CODE :::
// Display Sprites (ripped from SimpleScaleShape)
...
for(;starty<endy;starty++)
{
col=((byte *)shape)[newstart+starty];
#ifdef USE_HIRES
VWB_Plot(lpix+96,starty+16,col);
#else
VWB_Plot(lpix+128,starty+60,col);
#endif
}
...
Or scale them smaller (maybe to one dot per pixel on higher resolutions) if you wanted.
I tried this for 128x128 walls, as an example... if your viewscreen is set to 640 or above...
::: CODE :::
// Display Walls
uint8_t *start;
start = PM_GetPage(i);
#ifdef USE_HIRES
extern unsigned screenWidth;
extern unsigned screenHeight;
if (screenWidth < 640)
{
// 320x200 compatible (show page number on side) example
US_ClearWindow();
for (int x=0;x<128;x++)
for (int y=0;y<128;y++)
VWB_Plot(x+96,y+16,(int)(*start++));
US_PrintUnsigned(i);
}
else
{
// Scaled to game resolution (640x400+) example
int ratio= screenHeight/300;
int offx = screenWidth/2-64*ratio;
int offy = screenHeight/2-screenHeight/20-64*ratio;
for (int x=0;x<128;x++)
for (int y=0;y<128;y++)
{
for (int x2=0;x2<ratio;x2++)
for (int y2=0;y2<ratio;y2++)
VW_Plot(x*ratio+x2+offx,y*ratio+y2+offy,(int)(*start));
*start++;
}
}
#else
for (int x=0;x<64;x++)
for (int y=0;y<64;y++)
VWB_Plot(x+128,y+60,(int)(*start++));
#endif
}
Just run a hi-res vswap with "--res 320 200", "--res 640 400", and "--res 960 600" to see the differences.
Also, has anyone noticed that you can switch between page sections in Tab-T by pressing W, S, D, and I?  |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 3:07 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
|
 |
Zombie_Plan
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 3:45 ago.
Topics: 103
Posts: 1636
Location: A hole in the wall

|
Posted: Sun Nov 21, 2010 7:26 pm
Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
[ IP : Logged ]
|

  
|
|
I'm sorry for resurrecting this, but what does it actually do? It looks like you're talking about a working automap, but I'm not sure >_> |
_________________ WolfSource - Your news source since the beginning of time (2019)
|
|
 |
Dugtrio17
Code Master

Joined: 11 Mar 2003
Last Visit: 03 Oct 2013
Topics: 49
Posts: 903
Location: Seattle

|
Posted: Mon Nov 22, 2010 11:40 am
Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
[ IP : Logged ]
|

  
|
|
I believe the cheat they're talking about reimplementing is the one that let you browse through every wall/sprite in the VSWAP. |
_________________
|
|
 |
Zombie_Plan
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 3:45 ago.
Topics: 103
Posts: 1636
Location: A hole in the wall

|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum
|
|
You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group
|