It is currently Tue Dec 18, 2018 6:55 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Game of Life
PostPosted: Fri Jan 06, 2012 7:14 am 
Offline
User avatar

Joined: Wed Dec 22, 2010 9:14 am
Posts: 29
Location: Germany
Hello.
I have implemented the "Game of Life" for the NES as invented by mathematician John Conway in 1970.

See here for more information: http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

Image

iNES ROM:
http://www.mediafire.com/?2i9hcr2oc7iibe4

Here's also the source code, but it is not very well written and not super efficient (I'm still a beginner):
http://www.mediafire.com/?0n0awmaz77pea7o

Controls:

SELECT
--> Switch between menu and cell selection

START
--> Shortcut to start the game

A
--> inside field, fill a cell (make it "alive"), inside menu activate the menu entry

B
--> inside field, empty a cell (make it "dead")


If you have never played Life before, you will probably want to try out some of the templates I prepared for you in the Templates-Section.

I hope you like it!


Last edited by Yggi on Fri Jan 06, 2012 10:53 am, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 7:59 am 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
Nice, but that font is really difficult to read with these brightness jumps.

Also, try to use frame step in an emulator to check the moment when you switch to the templates menu and back.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 9:03 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3141
Location: Tampere, Finland
Shiru wrote:
Nice, but that font is really difficult to read with these brightness jumps.

When using colored fonts it's also especially important to test what it looks like on the real machine. I remember the fonts in Super NeSnake 2 looked really crappy on PAL NES.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 9:48 am 
Offline
User avatar

Joined: Wed Dec 22, 2010 9:14 am
Posts: 29
Location: Germany
Shiru wrote:
Nice, but that font is really difficult to read with these brightness jumps.


Thank you, I've changed the palette a bit, i think it looks good now (at least on my emulators - don't have a powerpak yet).
I was testing the game most of the time in an upscaled modus in FCEUXD SP and i thought it looked ok...

Shiru wrote:
Also, try to use frame step in an emulator to check the moment when you switch to the templates menu and back.


Do you mean the "scrolling glitch" before the menu appears?
No idea what causes this, I'm just doing a "normal" nametable upload.
The same glitch is also appearing when calling the help menu.

What's wrong with that code? Did I miss something?
Tried to fix this since an hour or so :?

Code:
  LDA #$00
  STA $2001   ;disable rendering
  STA $2000   ;and NMI
 
  LDA #<TEMPNAMETABLE       ;setup pointer
  STA Pointer
  LDA #>TEMPNAMETABLE
  STA Pointer+1
 
  LDA $2002    ;reset high/low latch
  LDA #$20     ;setup PPU
  STA $2006
  LDA #$00
  STA $2006

  LDX #$00    ;row position
--
  LDY #$00    ;column position
-
  LDA (Pointer), Y
  STA $2007
  INY
  CPY #$20
  BNE -
  LDA Pointer
  CLC
  ADC #$20
  STA Pointer
  LDA Pointer+1
  ADC #$00
  STA Pointer+1
  INX
  CPX #$1E
  BNE --
 
  ;attribute
  LDX #$00
-
  LDA TEMPATTRIBUTE, X
  STA $2007
  INX
  CPX #$40
  BNE -

  ;setup sprite (and delete the selection sprite)
  LDA #64   ;Y
  STA $0200
  LDA #$01  ;Tile
  STA $0201
  LDA #$01  ;Attribute
  STA $0202
  LDA #24   ;X
  STA $0203
  LDA #$FE  ;delete second selection sprite
  STA $0204
  STA $0205
  STA $0206
  STA $0207

  LDA #%00011110
  STA $2001    ;enable rendering
  LDA #%10001000  ;enable NMI
  STA $2000
 
  LDA #$00
  STA $2005
  STA $2005


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 10:12 am 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
I guess you need to reset PPU_ADDR before enabling rendering, and wait for NMI before disabling rendering,so it will not get disabled in the middle of the frame.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 10:22 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3141
Location: Tampere, Finland
Shiru wrote:
I guess you need to reset PPU_ADDR before enabling rendering, and wait for NMI before disabling rendering,so it will not get disabled in the middle of the frame.

Also wait for vblank before enabling rendering.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 10:54 am 
Offline
User avatar

Joined: Wed Dec 22, 2010 9:14 am
Posts: 29
Location: Germany
thefox wrote:
Shiru wrote:
I guess you need to reset PPU_ADDR before enabling rendering, and wait for NMI before disabling rendering,so it will not get disabled in the middle of the frame.

Also wait for vblank before enabling rendering.


That was it.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 4:36 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20898
Location: NE Indiana, USA (NTSC)
Yggi wrote:
I've changed the palette a bit, i think it looks good now (at least on my emulators - don't have a powerpak yet).

I've found Nestopia's NTSC filter to be reasonably accurate to the TVs that I own.

Quote:
I was testing the game most of the time in an upscaled modus in FCEUXD SP and i thought it looked ok...

I haven't been able to get FCEUX's NTSC filter to look right.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 5:35 pm 
Offline
User avatar

Joined: Sat Jul 25, 2009 8:45 am
Posts: 48
This is a really cool idea. Game of Life has been making the rounds on the internet lately. I wonder why? It's kind of a big thing. Personally, I am interested in the three dimensional varieties.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 6:38 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20898
Location: NE Indiana, USA (NTSC)
NovaYoshi once made a (slow) 32x32 Life simulator. Perhaps I should bug him to release what he has so far.

Of course we're not talking about Life the board game or Life the game show, which airs on a channel that I think nobody knows about except bronies.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2012 9:39 pm 
Offline
User avatar

Joined: Sat Jul 25, 2009 8:45 am
Posts: 48
Yeah there are just tons of cellular automata documents and programs out there. There's this one called Visions of Chaos that has fractals and many other things in both 2D and 3D.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group