NintendoAge http://nintendoage.com/forum/ -Sqooner Geminim demo http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4592 2007-12-25T23:30:48 -05.00 Sivak 6 Geminim demo http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4592 2007-12-25T21:14:31 -05.00 Sivak 6
Random: 
  ; See "linear-congruential random number generator" for more. 
  ; rand = (rand * 5 + 0x3611) & 0xffff; 
  ; return (rand >> 8) & 0xff; 
  lda   rand_h      ; multiply by 5 
  sta   rand_temp
  lda   rand_l 
  asl   a           ; rand = rand * 4 + rand 
  rol   rand_temp
  asl   a 
  rol   rand_temp
  clc 
  adc   rand_l 
  pha 
  lda   rand_temp
  adc   rand_h 
  sta   rand_h 
  pla               ; rand = rand + 0x3611 
  clc 
  adc   #$11 
  sta   rand_l 
  lda   rand_h 
  adc   #$36 
  sta   rand_h 
  rts               ; return high 8 bits
You need the variables rand_temp, rand_h, and rand_l to be somewhere in ram. The sequence will always be the same with a given seed, so usually games will do something like run a counter and use that as a seed when the player hits the first button. ]]>
Geminim demo http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4592 2007-12-25T21:00:04 -05.00 Sivak 6 Originally posted by: pedro!

what do I need to download to view/use this?

I like FCE Ultra for an emulator myself.

Originally posted by: BootGod

You'll need a NES emulator such as Nestopia. Sounds like your catching on quickly Sivak, have fun!


I now have got a computer AI in that'll always beat you if you make a wrong move.    That was the next big step.  All I really need to do now is add in a random number generator and some music and some credits and we may have a final game. ]]>
Geminim demo http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4592 2007-12-25T20:22:57 -05.00 Sivak 6 Nestopia. Sounds like your catching on quickly Sivak, have fun! ]]> Geminim demo http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4592 2007-12-25T19:23:58 -05.00 Sivak 6 Geminim demo http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4592 2007-12-25T00:01:52 -05.00 Sivak 6
This version is upgraded quite a bit.  It has a working AI to play against and will always beat you if you make a wrong move.  If you make a right move, it's a little obvious right now, but that should change when I get randomization in there.

So what do y'all think?  Go down to message #6 for the attachment.... ]]>