You are not logged in.
Lost Password?

All Posts (VirtualChris)




#1
Re: Random numbers
Posted on: 6/10 12:53
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
Anyone? I'd really like to finish this Virtual Boy casino thing. I came so close.
Top

Topic | Forum


#2
Random numbers
Posted on: 5/10 22:23
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
So I was looking through DogP's modlibgccvb.h file and found, beginning at line 812, some code for possibly getting a random number. I tried and tried various things but could not get it to display a random number. Can I even use this to begin with, and if so, how do I return a random number between 1 and 52?

Attach file:


h modlibgccvb.h Size: 49.41 KB; Hits: 61
Top

Topic | Forum


#3
Re: Casino game for VB
Posted on: 4/1 12:33
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
Can someone please help me with how to use this?
Top

Topic | Forum


#4
Re: Casino game for VB
Posted on: 3/5 22:40
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I would, but I don't know how.
Top

Topic | Forum


#5
Re: Casino game for VB
Posted on: 3/4 2:55
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I poked around modlibgccvb.h and found this:

int randseed
()
/* When run at startup gets a random number based on the changing CTA */
{
    
int random 1;
    
int rand;
    
int prevnum 0;
    
int count 1;
    
    while (
count 30000)    //repeat through many times to make more random and to allow the CTA value to change multiple times
    
{
        
rand = (*(BYTE*)(0x0005F830));    //CTA
        
if (random == 0)        //prevent % by zero
            
random 1;
            
        
random += ((rand*count) + (count%random));    //just randomly doing stuff to the number
    
        
if (rand == prevnum)        //if the CTA value doesnt change then count up
            
count++;
        else
            
count 0;        //if the number does change then restart the counter
        
prevnum rand;            //keep track of the last number
    
}
    return 
random;        //returns the random seed
}

int randnum(int seedint randnums)
/* Returns a random number in the requested range from the random seed */
{
    return (
seed%randnums);    //returns the random number
}

Can I use this to get a "random" number between 1-52? If so, how?
Top

Topic | Forum


#6
Re: Casino game for VB
Posted on: 3/3 20:31
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
First I need a random number generator that returns a number between 1-52 in C. I'm getting tons of 2-pairs. Googling turned up nothing.
Top

Topic | Forum


#7
Re: Casino game for VB
Posted on: 2/26 18:45
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
How does this look?

Attach file:



png  casino-0037.png (8.88 KB)
768_5c757b28cb470.png 384X224 px
Top

Topic | Forum


#8
Re: Casino game for VB
Posted on: 2/26 16:57
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
It's pretty much done. All I have left to do is change the title screen picture to something prettier.
Top

Topic | Forum


#9
Re: Casino game for VB
Posted on: 2018/11/3 4:37
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I can get out of Video Poker. Maybe the reason you couldn't get out is because you were in the middle of a hand? I made it so you couldn't get out of Video Poker in the middle of a hand.
Top

Topic | Forum


#10
Re: Casino game for VB
Posted on: 2018/11/2 23:54
PVB Elite
Joined 2008/4/26
USA
933 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (11 Years) PVBCC 2010 EntryPVBCC 2013 Entry
Could someone test the game for me? I have a feeling it may be done for the most part. I do plan to make a new title screen image if this is the case. You can get the latest rom here: http://www.atari2600land.com/casino/
Top

Topic | Forum