Author Topic: Reduced Res - Not entered.  (Read 3835 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Reduced Res - Not entered.
« on: September 04, 2008 »
Please do use this for reference only, I am not really proud of it which is why I put it in the bin :D

It was my first attempt for the reduced res comp.

Code: [Select]
'
' Reduced Resolution Competition!
' By Shockwave
'-------------------------------------------------------------------------------

'   INCLUDES;

    #INCLUDE "TINYPTC_EXT.BI"
    #INCLUDE "WINDOWS.BI"
   
    OPTION STATIC
    OPTION EXPLICIT

'   RESOLUTION VARIABLES;

    DIM SHARED AS UINTEGER BXRES,BYRES,PIXSIZE,XRES,YRES,PIXSIZY,MDS,MDF
   
'   COLOUR PALETTE HERE;

    DIM SHARED C_PALETTE(3) AS UINTEGER=> {&H000000,&H335577,&H77AACC,&HDDFFFF}

'   RESOLUTION SETTINGS;
    MDS=0
    XRES=640
    YRES=480

    BXRES=160
    BYRES=120
   
    PIXSIZE=4
    PIXSIZY=4

'   SUBROUTINES;
   
    DECLARE SUB UPDATE_SCREEN()
    DECLARE SUB VERTICAL_BARS()
    DECLARE SUB DRAW_VBAR(BYVAL XP AS INTEGER , BYVAL YP AS INTEGER)
    DECLARE SUB PLASMA()
   
    DIM SHARED AS UINTEGER FRBUFFER ( BXRES * BYRES )
    DIM SHARED AS UINTEGER BUFFER      ( XRES  * YRES  )
   
    PTC_ALLOWCLOSE(0)
    PTC_SETDIALOG(1,"Reduced Resolution"+CHR$(13)+"FULL SCREEN?",0,0)               
    IF (PTC_OPEN("Reduced Res",XRES,YRES)=0) THEN
    END-1
    END IF
   
'-------------------------------------------------------------------------------   

WHILE(GETASYNCKEYSTATE(VK_ESCAPE)<> -32767 AND PTC_GETLEFTBUTTON = FALSE)
    PLASMA()
    VERTICAL_BARS()
    UPDATE_SCREEN()
    PTC_UPDATE@BUFFER(0) 
   
WEND
END

'-------------------------------------------------------------------------------

SUB PLASMA()
DIM AS INTEGER X,Y,C

FOR Y=0 TO BYRES-1
    FOR X=0 TO BXRES-1
        C=2+2*SIN(((X XOR Y)+TIMER*65)/15)-1
    FRBUFFER(X+(Y*BXRES))=C
    NEXT
NEXT

END SUB


SUB VERTICAL_BARS()
DIM L AS INTEGER

    FOR L= 50 TO 120 STEP 2
        DRAW_VBAR(70+(30*SIN((L+TIMER*34)/13))-(30*COS((L+TIMER*14)/13)),L)
        DRAW_VBAR(70+(30*COS((L+TIMER*43)/23))-(30*SIN((L+TIMER*23)/13)),L+1)
       
    NEXT

END SUB

SUB DRAW_VBAR(BYVAL XP AS INTEGER , BYVAL YP AS INTEGER)
DIM AS INTEGER X,Y,C,XXP,MD,CUNT

FOR X=0 TO 10       
   
    SELECT CASE X
    CASE 0,10
        C=0
        CUNT=1
    CASE 1,9       
        C=0
        CUNT=0
    CASE 2,8
        C=1
        CUNT=1
    CASE 3,7       
        C=2
        CUNT=0       
    CASE 4,6       
        C=2
        CUNT=1               
    CASE ELSE
        CUNT=0
        MDS=0
        C=3
    END SELECT
    XXP=X+XP
    MD=MDS
    FOR Y=YP TO BYRES-1     
            IF CUNT=1 THEN
            MD=MD+1   
            IF MD>1 THEN MD=0
            END IF
       
            FRBUFFER((Y*BXRES)+XXP)=C+MD
    NEXT
   
NEXT

END SUB


'-------------------------------------------------------------------------------
' EXPAND SCREEN DISPLAY AND ERASE FRAMEBUFFER
'-------------------------------------------------------------------------------

SUB UPDATE_SCREEN()
DIM AS INTEGER XL,YL,I,TC,SLICE
DIM PP1 AS UINTEGER PTR
DIM PP2 AS UINTEGER PTR

FOR YL=0 TO BYRES-1
   
    FOR I=0 TO PIXSIZY-1
       
        pp1=@BUFFER(((YL*PIXSIZY)+I)*XRES)
        PP2=@FRBUFFER(YL*BXRES)
       
        FOR XL=0 TO BXRES-1
   
        TC=C_PALETTE(*PP2)       
        SLICE=PIXSIZE
       
            asm
                mov eax,dword ptr[TC]
                mov ecx, [slice]
                mov edi, [PP1]
                rep stosd
            end asm   
       

        PP1+=4
        PP2+=1
    NEXT
     
    NEXT

NEXT
FOR YL=0 TO BYRES-1
    PP1=@FRBUFFER(YL*BXRES)
    FOR XL=0 TO BXRES-1
        *PP1=0
        PP1+=1
    NEXT
NEXT
END SUB
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Reduced Res - Not entered.
« Reply #1 on: September 04, 2008 »
I like the colour choice, but it doesn't seem to flow very smoothly.  I think it's the background that throws it out for me.
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Reduced Res - Not entered.
« Reply #2 on: September 04, 2008 »
In hind sight as im an oldskool & C64 fan, its pretty good stuff mate, I like your vertical rasters.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Reduced Res - Not entered.
« Reply #3 on: September 04, 2008 »
Thanks guys, it didn't really light my fire though so in the bin it went :) Along with most of the other stuff I start ;)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Reduced Res - Not entered.
« Reply #4 on: September 04, 2008 »
I had a fair few of those, bright lights of inspiration that never really worked for me and got binned.
Challenge Trophies Won:

Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Reduced Res - Not entered.
« Reply #5 on: September 04, 2008 »
I love your variable names!!! LOL!

I love the vertical bars - that effect is fantastic - I agree with Xalthorn though the background . . . not sure about that?

Thanks for the code though Shockwave! :)

DrewPee
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Offline Wombat

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Reduced Res - Not entered.
« Reply #6 on: September 04, 2008 »
Code: [Select]
CASE ELSE
        CUNT=0

Interesting choice of variable name  :2funny:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Reduced Res - Not entered.
« Reply #7 on: September 04, 2008 »
 :-[

Really fucking sorry for the variable names ;) What can I say?

I may have been drinking when I wrote it.  :diablo:
Shockwave ^ Codigos
Challenge Trophies Won: