DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

Enabling Tab-T (viewing walls, sprites, sounds)
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 13 Sep 2018

Topics: 55
Posts: 2139
Location: Canada
blank.gif

PostPosted: Fri Feb 26, 2010 9:49 pm
   Subject: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

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. Laughing


Last edited by Chris on Sun Feb 28, 2010 8:20 am; edited 1 time in total
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 5:21 ago.

Topics: 163
Posts: 8194
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Feb 27, 2010 6:04 pm
   Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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


Joined: 11 Mar 2003
Last Visit: 13 Sep 2018

Topics: 55
Posts: 2139
Location: Canada
blank.gif

PostPosted: Sun Feb 28, 2010 11:30 am
   Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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? Smile
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 5:21 ago.

Topics: 163
Posts: 8194
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Feb 28, 2010 5:42 pm
   Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Chris wrote:
Also, has anyone noticed that you can switch between page sections in Tab-T by pressing W, S, D, and I?
Yep. Smile But what got me real puzzled was the "L" command in the DOS version. This appears to put a "Last Hit" mark on everything in the VSWAP. That feature had me confused for the longest time. Smile
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Nov 21, 2010 7:26 pm
   Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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 >_>

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

Topics: 49
Posts: 903
Location: Seattle
usa.gif

PostPosted: Mon Nov 22, 2010 11:40 am
   Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Mon Nov 22, 2010 2:29 pm
   Subject: Re: Enabling Tab-T (viewing walls, sprites, sounds)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Dugtrio17 wrote:
I believe the cheat they're talking about reimplementing is the one that let you browse through every wall/sprite in the VSWAP.


Ah ok. I never really paid much attention to the debug codes =/ Thanks Smile
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Announcement: Wolf3d & Spear of Destiny Shareware SDL Downloads
Author: BrotherTank
10 15113 Tue Aug 24, 2010 10:18 am
dcbasic View latest post
No new posts Sticky: [Tutorial] Compiling Wolf4SDL with Code::Blocks
Author: dcbasic
90 24559 Wed May 24, 2017 7:53 pm
Falcon*93 View latest post
No new posts [HELP] OUCH sounds?
Author: Raziel
3 1112 Mon Jul 21, 2008 4:26 pm
Raziel View latest post
No new posts [SDL-Help] Wall patches fix
Author: insurrectionman
0 1178 Tue Jul 15, 2008 11:12 am
insurrectionman View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 4478 Sun Apr 27, 2008 2:30 am
AlumiuN View latest post
 
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