Game of Life

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
User avatar
Yggi
Posts: 29
Joined: Wed Dec 22, 2010 9:14 am
Location: Germany

Game of Life

Post by Yggi »

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.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

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.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Post by thefox »

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.
User avatar
Yggi
Posts: 29
Joined: Wed Dec 22, 2010 9:14 am
Location: Germany

Post by Yggi »

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: Select all

  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
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

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.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Post by thefox »

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
User avatar
Yggi
Posts: 29
Joined: Wed Dec 22, 2010 9:14 am
Location: Germany

Post by Yggi »

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
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

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.
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.
User avatar
RLError
Posts: 48
Joined: Sat Jul 25, 2009 8:45 am

Post by RLError »

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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

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.
User avatar
RLError
Posts: 48
Joined: Sat Jul 25, 2009 8:45 am

Post by RLError »

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.
Post Reply