Free your creativity - IOMBCC (Development MSX Forum)MSX Resource Center MRC MEGA Challenge - Develop an MSX2 game and win!              
              
English Nederlands Español Português Russian         
 News
   Frontpage
  News archive
  News topics

 Resources
   MSX Forum
  Articles
  Reviews
  Fair reports
  Photo shoots
  Fairs and meetings
  Polls
  Links
  Search

 Software
   Downloads
  Webshop

 MRC
   Who we are
  Join our team
  Donate
  Policies
  Contact us
  Link to Us
  Statistics

 Search
 
  

  

 Login
 

Username

Password




Don't you have an account yet? Become an MSX-friend and register an account now!.


 Statistics
 

There are 146 guests and 3 MSX friends online

You are an anonymous user.
 

MSX Forum


MSX Forum

Development - Free your creativity - IOMBCC

Goto page ( Previous Page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 Next Page )
Author

Free your creativity - IOMBCC

NYYRIKKI
msx master
Posts: 1474
Posted: November 07 2007, 04:34   
That's it! We can make better sounds!

How do you like this: (Not optimized idea test version)
1 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEONERRORGOTO1:DEFINTA-Y:COLOR15,5,1:KEYOFF:SCREEN2,3,0:U=255:V=32:FORX=-1TO1:FORY=0TO31:M=16-Y\2:LINE(M-X*((SIN(Y^.8/6)-(Y<16))*6-M-2)+(X<1),V+X*V+Y)-STEP(Y+1,0)
2 P(Y\4)=50-15*(Y\12AND1):NEXTY,X:N=14336:FORI=0TO383:VPOKEN+I,VPEEK((IAND7)+(IAND8)*V+(IAND48)\2+(IAND448)*8):NEXT:S$="3##B#C#c$B'r$B&s3#%##C#3%S';%S&s;##2#3#B#R#B#<=c'##c'#@C#)#2#,s##&wfw:w3w4w$w3w#w4w,DD0CDDDS0CDSDK0CDKDC0CDC":SOUND3,14
3 SCREEN1:FORO=0TO53:Y=0:FORM=MTOM+1:Y=Y*96+(ASC(MID$(S$,M))-35):NEXT:FORK=KTOK+Y\256:VPOKEK+N+I+8335*(O>V),YANDU:NEXTK,O:FORI=UTO1023:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:FORI=ITO1279:O=IANDV:VPOKE6432+(IAND63),228+8*(IAND3)-O
4 W=2^(IAND7):J=O*U\W\64:VPOKEI+512,JAND-W:VPOKEI+768,JOR-WANDU:J=8-O\8:VPOKEI,(JANDI)*U\J:NEXT:R=N\2:VPOKE8192,14:VPOKE1209,U:PLAY"","","v15o5arararo6aa":FORW=8TO9:PUTSPRITEW,(80+64*W,159),14,W-2:SOUNDW,14:N=N+9
5 NEXT:TIME=0:FORT=2TOR:-:PUTSPRITE0,(X+80,156),1,12:SOUND1,83
6 G=G+F*S\2:LOCATE1,1:D=96-(NAND127):Y=D>0(:D=D*D\96:PRINTUSING"SPEED:##0kmh  !  RANK:###";S;CHR$(76-L*4);N\128-82(:FORW=8216TO8219:G=G+8AND31:VPOKEW,86+(GAND16):VPOKE4+W,85+G\24:NEXT:Q=O:O=PEEK(-1043):T=T+S-1(:F=B:IFC<TTHENC=9+T+TMOD99
7 B=(R-T>99)*(1-CMOD3):L=(QANDO+Q)+LAND1:S=S+(0=(OAND64))-(0=(OANDV))*(2-((S>9)=-L)):S=(S>14+L*6)*(L+2)-(S>0)*(S-1):FORW=3TO4:PUTSPRITEW+1,(F*10+W*V,95),14,4*B+W+1:PUTSPRITE3+W,(W*V,127),14,4*F+3+W:NEXT
8 PUTSPRITE1,(115-(D<34)*((24-D)*B+F*10)+(E-64)*D\225,-Y*(98+D)-31),-6*(T<R),15-D\25:M=(X>72)-(X<0):E=NAND128:N=N+9-S:-:S=S*((X-15-E\3)\15<>0ORD<73)*(M=0):SOUND0,U-S*9:X=X+5*(M-(0=(OAND128))+(0=(OAND16)))-S*B\4(:FORW=0TO0:W=PLAY(0):NEXTW,T
9 S=15:Z$=SPACE$(S)+"Race Over  Time ="+STR$((TIME\(6-PEEK(43)\128))/10)+"s":FORN=0TOU:D=88-3*N:LOCATE6,4:PUTSPRITE0,(116-(36-X)*D\126,68+D),-(D>0),S-D\24:-:PRINTMID$(Z$+Z$,NMOD38+1,S):SOUND9ANDNOR8,-(D>0)*D\6:NEXT:SCREEN0


NYYRIKKI
msx master
Posts: 1474
Posted: November 07 2007, 05:16   
Actually I already squeezed it to size limits... I hope that I didn't brake anything as I needed to make some quite radical changes.
1 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEONERRORGOTO1:DEFINTA-Y:COLOR15,5,1:KEYOFF:SCREEN2,3,0:U=255:V=32:FORX=-1TO1:FORY=0TO31:M=16-Y\2:LINE(M-X*((SIN(Y^.8/6)-(Y<16))*6-M-2)+(X<1),V+X*V+Y)-STEP(Y+1,0)
2 P(Y\4)=50-15*(Y\12AND1):NEXTY,X:N=14336:FORI=0TO383:VPOKEN+I,VPEEK((IAND7)+(IAND8)*V+(IAND48)\2+(IAND448)*8):NEXT:S$="3##B#C#c$B'r$B&s3#%##C#3%S';%S&s;##2#3#B#R#B#<=c'##c'#@C#)#2#,s##&wfw:w3w4w$w3w#w4w,DD0CDDDS0CDSDK0CDKDC0CDC":SOUND3,14
3 SCREEN1:FORO=0TO53:Y=0:FORM=MTOM+1:Y=Y*96+(ASC(MID$(S$,M))-35):NEXT:FORK=KTOK+Y\256:VPOKEK+N+I+8335*(O>V),YANDU:NEXTK,O:FORI=UTO1023:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:FORI=ITO1279:O=IANDV:VPOKE6432+(IAND63),228+8*(IAND3)-O
4 W=2^(IAND7):J=O*U\W\64:VPOKEI+512,JAND-W:VPOKEI+768,JOR-WANDU:J=8-O\8:VPOKEI,(JANDI)*U\J:NEXT:R=N\2:VPOKE8192,14:VPOKE1209,U:PLAY"v15o5arararo6aa":FORW=9TO10:PUTSPRITEW,(16+64*W,159),14,W-3:SOUNDW,14:N=N+9:NEXT:TIME=0:SOUND5,83:FORT=2TOR
5 -:PUTSPRITE0,(X+80,156),1,12:G=G+F*S\2:LOCATE1,1:D=96-(NAND127):Y=D>0(:D=D*D\96:PRINTUSING"SPEED:##0kmh  !  RANK:###";S;CHR$(76-L*4);N\128-82(:FORW=8216TO8219:G=G+8AND31:VPOKEW,86+(GAND16):VPOKE4+W,85+G\24:NEXT:IFC<TTHENC=9+T+TMOD99
6 Q=O:O=PEEK(-1043):T=T+S-1(:F=B:B=(R-T>99)*(1-CMOD3):L=(QANDO+Q)+LAND1:S=S+(0=(OAND64))-(0=(OANDV))*(2-((S>9)=-L)):S=(S>14+L*6)*(L+2)-(S>0)*(S-1):FORW=3TO4:PUTSPRITEW+1,(F*10+W*V,95),14,4*B+W+1:PUTSPRITE3+W,(W*V,127),14,4*F+3+W:NEXT
7 PUTSPRITE1,(115-(D<34)*((24-D)*B+F*10)+(E-64)*D\225,-Y*(98+D)-31),-6*(T<R),15-D\25:M=(X>72)-(X<0):E=NAND128:N=N+9-S:-:S=S*((X-15-E\3)\15<>0ORD<73)*(M=0):SOUND4,U-S*9:X=X+5*(M-(0=(OAND128))+(0=(OAND16)))-S*B\4(:FORW=0TO0:W=PLAY(0):NEXTW,T
8 S=15:Z$=SPACE$(S)+"Race Over  Time ="+STR$((TIME\(6-PEEK(43)\128))/10)+"s":FORN=0TOU:D=88-3*N:LOCATE6,4:PUTSPRITE0,(116-(36-X)*D\126,68+D),-(D>0),S-D\24:-:PRINTMID$(Z$+Z$,NMOD38+1,S):SOUND(1ANDN)+9,-(D>0)*D\6:NEXT:SCREEN0


@Dvik can you check, do we have enough "errors" and that they are in correct locations? Can we now call this ready?

NYYRIKKI
msx master
Posts: 1474
Posted: November 07 2007, 06:00   
Ah... little cleanup for end demo (No more transparent cars on track) and error handler reset.

1 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEONERRORGOTO1:DEFINTA-Y:COLOR15,5,1:KEYOFF:SCREEN2,3,0:U=255:V=32:FORX=-1TO1:FORY=0TO31:M=16-Y\2:LINE(M-X*((SIN(Y^.8/6)-(Y<16))*6-M-2)+(X<1),V+X*V+Y)-STEP(Y+1,0)
2 P(Y\4)=50-15*(Y\12AND1):NEXTY,X:N=14336:FORI=0TO383:VPOKEN+I,VPEEK((IAND7)+(IAND8)*V+(IAND48)\2+(IAND448)*8):NEXT:S$="3##B#C#c$B'r$B&s3#%##C#3%S';%S&s;##2#3#B#R#B#<=c'##c'#@C#)#2#,s##&wfw:w3w4w$w3w#w4w,DD0CDDDS0CDSDK0CDKDC0CDC":SOUND3,14
3 SCREEN1:FORO=0TO53:Y=0:FORM=MTOM+1:Y=Y*96+(ASC(MID$(S$,M))-35):NEXT:FORK=KTOK+Y\256:VPOKEK+N+I+8335*(O>V),YANDU:NEXTK,O:FORI=UTO1023:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:FORI=ITO1279:O=IANDV:VPOKE6432+(IAND63),228+8*(IAND3)-O
4 W=2^(IAND7):J=O*U\W\64:VPOKEI+512,JAND-W:VPOKEI+768,JOR-WANDU:J=8-O\8:VPOKEI,(JANDI)*U\J:NEXT:R=N\2:VPOKE8192,14:VPOKE1209,U:PLAY"v15o5arararo6aa":FORW=9TO10:PUTSPRITEW,(16+64*W,159),14,W-3:SOUNDW,14:N=N+9:NEXT:TIME=0:SOUND5,83:FORT=2TOR
5 -:PUTSPRITE0,(X+80,156),1,12:G=G+F*S\2:LOCATE1,1:D=96-(NAND127):Y=D>0(:D=D*D\96:PRINTUSING"SPEED:##0kmh  !  RANK:###";S;CHR$(76-L*4);N\128-82(:FORW=8216TO8219:G=G+8AND31:VPOKEW,86+(GAND16):VPOKE4+W,85+G\24:NEXT:IFC<TTHENC=9+T+TMOD99
6 Q=O:O=PEEK(-1043):T=T+S-1(:F=B:B=(R-T>99)*(1-CMOD3):L=(QANDO+Q)+LAND1:S=S+(0=(OAND64))-(0=(OANDV))*(2-((S>9)=-L)):S=(S>14+L*6)*(L+2)-(S>0)*(S-1):FORW=3TO4:PUTSPRITEW+1,(F*10+W*V,95),14,4*B+W+1:PUTSPRITE3+W,(W*V,127),14,4*F+3+W:NEXT
7 PUTSPRITE1,(115-(D<34)*((24-D)*B+F*10)+(E-64)*D\225,-Y*(98+D)-31),6,15-D\25-(T>R)*9:M=(X>72)-(X<0):E=NAND128(:N=N+9-S:S=S*((X-15-E\3)\15<>0ORD<73)*(M=0):SOUND4,U-S*9:X=X+5*(M-(0=(OAND128))+(0=(OAND16)))-S*B\4(:FORW=0TO0:W=PLAY(0):NEXTW,T
8 S=15:Z$=SPACE$(S)+"Race Over  Time ="+STR$((TIME\(6-PEEK(43)\128))/10)+"s":FORN=0TOU:D=88-3*N:LOCATE6,4:PUTSPRITE0,(116-(36-X)*D\126,(68+D)-(D<0)*128),1,S-D\24:-:PRINTMID$(Z$+Z$,NMOD38+1,S):SOUND(1ANDN)+9,-(D>0)*D\6:NEXT:SCREEN0:CLEAR


dvik
msx master
Posts: 1298
Posted: November 07 2007, 06:30   
Very nice improvments. I like the sounds

Quote:


@Dvik can you check, do we have enough "errors" and that they are in correct locations? Can we now call this ready?



I compared with the last version before your updates and that one has a smoother scroll. First I thought it was
because of more features but then I realized that its just that the errors aren't at the correct locations. I think
we can wait to move the errors until we're done because if we decide to add more features we need to move
them again.

But as you said, I think we can say we're done now so if we do, I can try to move those errors to make the scroll
even. What do you say?


NYYRIKKI
msx master
Posts: 1474
Posted: November 07 2007, 08:19   
I think we are done. There may be some characters that can be saved, but I don't think
we can get enough space to make any major improvements anymore.

If you have time, please correct the errors to "correct" places and let's call it final version.
If you still manage to find some space, it can be used for CTRL+STOP disable or something
similar that does not affect speed.

By accident this source is now divided to "clear" parts:
Init routine is on lines 1-4
Game engine is on lines 5-7 (These are lines with errors to be adjusted)
and end demo is on line 8

NYYRIKKI
msx master
Posts: 1474
Posted: November 07 2007, 08:35   
List of improvements since first version of XRALLY:

- Opponent cars
- Position counter
- Opponent hit detection
- Car physics, that change depending of speed
- Gas pedal
- Brake pedal
- Hi/Lo gear
- Motor sounds
- Custom fonts
- Speed meter
- Scrolling mountains
- Start race "demo" with opponent & sounds
- End demo "Drive to sunset"
- Text scroller
- sound fadeout
- "the little line in the horizon"
- Time support for NTSC & PAL

Not bad
jltursan
msx professional
Posts: 772
Posted: November 07 2007, 18:41   
Impressive!; but can you explain some code highlights like "FORW=0TO0:W=PLAY(0):NEXTW", I guess that it's role must be to keep the music playing; but I'm not totally sure...
NYYRIKKI
msx master
Posts: 1474
Posted: November 07 2007, 18:46   
That routine is used to wait untill it's time to start the race.
manuel
msx guru
Posts: 3299
Posted: November 07 2007, 23:15   
It's really reallly really amazing... I wonder what would have happened if someone put this for publication in a paper MSX magazine in 1984 or 1985... E.g. in MSX Computer Magazine, "Kort & Krachtig" (short and powerful).

And why didn't they make this in those days? I think nothing prevented them from doing so...
wolf_

msx legend
Posts: 4555
Posted: November 07 2007, 23:18   
How old is the concept of obfuscated code anyway? I mean deliberately making things messy, not code that looks alien by itself.
AuroraMSX

msx master
Posts: 1216
Posted: November 07 2007, 23:34   
Quote:

It's really reallly really amazing... I wonder what would have happened if someone put this for publication in a paper MSX magazine in 1984 or 1985... E.g. in MSX Computer Magazine, "Kort & Krachtig" (short and powerful).

Well, you just need to find a properly rigged deLorean and off you go
Quote:

And why didn't they make this in those days? I think nothing prevented them from doing so...

because no one was crazy enough to put effort in a listing like this I guess
NYYRIKKI
msx master
Posts: 1474
Posted: November 08 2007, 01:10   
Quote:

It's really reallly really amazing... I wonder what would have happened if someone put this for publication in a paper MSX magazine in 1984 or 1985... E.g. in MSX Computer Magazine, "Kort & Krachtig" (short and powerful).

And why didn't they make this in those days? I think nothing prevented them from doing so...


Now that I think about it... 20 years ago I was proud if I was able to consentrate enough to make 5 lines long BASIC program... At that time each line had one command.

Now 20 years later it takes two persons to write 8 lines of BASIC... what can I say. Actually IIRC our first common BASIC project with Dvik was "Dorkanoid" for MSX1 that was extremely simple "Arcanoid clone" done in one line of BASIC... this was already 10 years ago.

Too bad I've not heard about new ASCII MSX-Magazines coming out. I remember that some years ago they were searching little BASIC programs to be printed to magazine for "educational purposes"... how ever I'm not really sure how educational program this is.

@wolf: Obfuscation is not the main point in this program anymore. This is just well space optimized that is at least in theory a different thing. How ever this optimization causes obfuscated code.
dvik
msx master
Posts: 1298
Posted: November 08 2007, 04:07   
The 1st International Obfuscated C Code Contest was held in 1984. I think that was the first contest for obfuscated code.
wolf_

msx legend
Posts: 4555
Posted: November 08 2007, 12:07   
hmm may I suggest to skip the idea to make this game an obfuscation entry, and just expand it with more -similar- lines? Imagine the possibilities with 20 lines for a moment...
NYYRIKKI
msx master
Posts: 1474
Posted: November 08 2007, 13:38   
@wolf With 20 lines we should be able to use rendered graphics. No, using 20 lines is really not such a good idea. As you may have already noticed size optimized code is not same as speed optimized code. This is already getting quite slow. With different way of coding speed could be improved much. Also we have only 2 one letter variables anymore, so adding new features would take more space than before because of longer variables.

 
Goto page ( Previous Page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 Next Page )
 







(c) 1994 - 2008 MSX Resource Center Foundation. MSX is a trademark of MSX Licensing Corporation.