Video Poker

Basic and Machine Language

Moderator: Moderators

User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

After bragging about my ML abilities 8) I was thinking further on this topic and it sudenly struck my mind that I never made any sound in my ML routines for the VIC. So converting Anders' sounds would be the most challenging part, at least for me... Otoh it's only a question of timing, isn't it?

Björg
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Yes, some loops in one way or another. I suppose the amount of text output is too large to make it a 1K game. Perhaps 2K w/ crunching if a such category is made.
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

What are the categoried? 1K, 2K, 4K?

There are no restrictions that there has to be only one author?

Btw, The austro compiler can only compile 8K+ programs, and they turn out to be 20 blocks or more, so that's not an option...

I was thinking just to enter the 4K category as it is, or maybe if it's possible to crunch it down to the next category. It's only 13 blocks as it is now so maybe that would work...

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

The 2006 compo hasn't been announced yet, but the idea was to have several categories with separate deadlines; i.e. first a 1K compo running for one month, then a 2K compo in two months, then a 4K compo in four months and so on. The idea is that a 1K game could be "upgraded" as the year runs on.

We'll see if that happens. The classic categories since 2003 have been 1K (~4 blocks) and 4K (~16 blocks).

Speaking about Basic compilers, there is another one called Vic Compiler too. Is that one more limited than Austro? Would it be possible to tweak either the compiler itself or the executable so if possible, it runs on an unexpanded machine? Maybe there are Basic cross-compilers e.g. for the C64 which could be customized?
Anders Carlsson

Image Image Image Image Image
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

By the way, if this had been a C64 forum (like CSDb), someone would have released a cracked version of your co-op effort several weeks ago, and had a hard time to keep up with all the updates you've been doing! :P
Anders Carlsson

Image Image Image Image Image
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

:lol: Maybe faster updates would have been the solution to all the piracy problems!

Slightly off-topic, but I started to do some routines in ML, initializing of the deck and shuffling, showing empty cards... Not sure if I'm interested enough to finish this, but programming in assembler is what I really like to do. I fear if all the interesting parts are done, the rest like 'GUI' etc. will not motivate me anymore :?

Björg
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Is memory expansion allowed? Then maybe we could put some more into it instead to get up to 4K....
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Sure, both Martin last year and Ghislain two years ago (IIRC) submitted 4K games which required 8K expansion to run. After a bit of arguing back and forth*, nobody complains.

Schlowski, it is a good point in trying to find which routines can be faster or smaller by converting into ML, and keep those parts which just as well could remain in Basic. Hybrid programs are cool.

(*) Mostly from the Atari 2600 camp, who want to use Supercharger and similar expansions in order to make more advanced games.
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I don't think anything in this program needs to be faster. You could just change the sound effects a bit (in basic) if you like it to be faster... But I think there should be delays in a card game to make it at least a little bit realistic.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Mostly I would agree to Boray. Shuffling and sorting could be a bit faster, which it is in fact in my assembler version right now. And printing the cards is faster too, looks good, but never annoyed me in the basic version.

As far as I can see now, there will be not so much of space savings. I'm now up to 1965 Bytes without sound, without winning calculation and without marking the winning lines. So putting the rest in will at least lead to 3k, I think...

If time permits I will continue my work tonight :-)

Björg

Edit: Everything beside sound in the assembler version is ready: size of highly un-optimized code :wink: is now 2736 bytes...
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

To learn how the sound effects are built up, you could insert one extra delay into them so they go really slowly, and then just listen.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Maybe we should transfer the discussion over to ML programs section?
I will open a new Videopoker topic over there:-)

Björg
wimoos
Vic 20 Afficionado
Posts: 345
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Post by wimoos »

I have been doing some optimization on videopoker, especially the winning calculation and I came up with the following:

Code: Select all

100 for i=1 to 5:k(i)=h(i) and 15:next
110 v=0:for i=1 to 4:a=k(i):if a=-1 then 160
120 p=0:for j=i+1 to 5:if k(j)=a then p=p+1:k(j)=-1
130 next:if p=0 then 160
140 if p>v then w=a:x=v:v=p:goto 160
150 x=p
160 next:on v goto 200,210,220
170 for i=1 to 4:for j=i+1 to 5:if k(i)>k(j) then t=k(i):k(i)=k(j):k(j)=t
180 next:next:f=2:a=h(1) and 48:for i=2 to 5:f=f and a=(h(i) and 48):next
190 a=k(1):on f-(k(5)-a=4) goto 230,240,250:w=0:return
200 w=2*x-(w>8)*(1-x):return
210 w=3+3*x:return
220 w=7:return
230 w=4:return
240 w=5:return
250 w=8-(a=8):return
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Re: Video Poker

Post by hawk »

I recently came across this game while surfing through Boray's website and became quite addicted to it. It's easy to just sit and play.

Anyway, I came across what I think is a bug. I like how the game shows you where you have been winning hands and I noticed I hadn't won with a straight very often so I started trying for them more often. Then this happened. I got a 5ive-high straight but it didn't pay out. (I want my money back!) :wink:

See attachment.

I wasn't sure whether the Ace could be low as well as high so I did some Googling and sure enough it can be. Not sure if anyone still cares about this game but I do.
Attachments
five-high straight.png
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Re: Video Poker

Post by Schlowski »

Mmh, definitely a bug. It seems like I made a mistake with the lower value of an ace. I try to look into this, but momentarily my spare time is very limited. So for now don't go for a wheel (A-2-3-4-5) :?

Edit: I think I sort the cards by value for checking for streets. Unfortunately the ace can have two values - one or 14 and I'm relatively sure that I opted for 14. For this street I must re-calculate with the one value , but I'm not sure if I have enough free space (that is in the standard version, I think in the WimBASIC version there is more free space.) But this is all out of my memories and it is a long time since I wrote this piece of software...
Post Reply