Shop OBEX P1 Docs P2 Docs Learn Events
Prop Chess (for VGA): Human Vs. Propeller — Parallax Forums

Prop Chess (for VGA): Human Vs. Propeller

RaymanRayman Posts: 13,801
edited 2013-05-06 06:46 in Propeller 1
Can you beat your Prop at Chess?

This is by no means complete, but I lost motivation when I started running out of room...

I think it knows all the rules and plays fairly.·

Also demonstrates my tricked out mouse...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

Post Edited (Rayman) : 6/20/2009 3:06:54 PM GMT
«1

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2009-06-20 15:43
    Hi Rayman.

    It is not posible to have .dat files in High half in EEprom on ProtoBoard and load them on demand.
    That can give You more place for program area.
    To load them it is only ned for simple I2C handler

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • RaymanRayman Posts: 13,801
    edited 2009-06-20 23:17
    There are some options... I could do as you say.

    I could use Baggers RLE code code compress the images.

    But, I think the easiest thing for me is to use my PSM module to do it on the LCD and use the PSM's SD card to store true color images...

    That should free up enough space to do a really nice job. But, honestly, I don't forsee having the time to complete this, which is why I posted it now...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 13,801
    edited 2009-06-20 23:20
    PS: Anybody beat their Prop yet? It's not too hard, but it takes a while...

    The main things missing are opening and closing move libraries...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • hover1hover1 Posts: 1,929
    edited 2009-06-20 23:34
    Rayman said...
    PS: Anybody beat their Prop yet? It's not too hard, but it takes a while...

    The main things missing are opening and closing move libraries...

    Played a quick game. Stalemate. But then again I'm stale. . Haven't played a good game in years since my son is grown and gone.

    Thanks for the memories! Next Prop against Prop.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2009-06-21 04:04
    Rayman, looks great.

    However, there appear to be a couple of bugs in your code that does the black castling. Starting with a new game if I move my Kings pawn forward two the prop then moves far left pawn forward one, I then move Queen's Knight forward and right and the prop tries to castle on the Queen's side (sorry for all the wrong move and piece names, I don't know all the proper move notation.) It happened another time as well on the other side but it was further in the game and I can't remember what caused it.

    Nice Mouse too.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2009-06-21 04:17
    Well, I just won a game. But after I won it put up a "Bad move.." on the left side of the screen. When it did the incorrect castle the other pieces (rook and bishop) were still under the other pieces and it also changed a pawn to a king at one stage. Maybe you've run out of stack space?
  • RaymanRayman Posts: 13,801
    edited 2009-06-21 11:49
    Steven: Hmm... I thought I had all those bugs worked out... I'll have to double check that I've posted the latest version...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • LawsonLawson Posts: 870
    edited 2009-06-23 00:01
    Castling is a bit buggy. Black had two queens and no king for a while, then three rooks and no king, then... Not too smart yet, I promoted a pawn mid game. The game didn't go well for the propeller from then on. Still, this is rather cool! I think the graphics are fine quality. If you're hurting for space to make the AI smarter I wouldn't mind cruder graphics even.

    Lawson

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • RaymanRayman Posts: 13,801
    edited 2009-06-23 12:56
    Ok, sounds like there's a definite bug with castling... I'll try to find time to fix that...

    The AI could be dramatically improved with a little more code space. My current inclination is to do this with the help of the onboard LCD and SD card on my PSM module. Other alternative is to wait for Prop2...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • BADHABITBADHABIT Posts: 138
    edited 2009-06-23 15:01
    The Prop2 is just a myth created to keep people put of by P1's limitations interested in Propelerness. It is perpetuated by very smart and well to do individuals because they believe in it as fact because their high priest said it was so.

    Therefore you should fix it up to run on the PSM, then everybody who got one would have a demo to show off all of PSM's featurization.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BH skull.gif
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2009-06-24 09:29
    If nothing else it should be fairly easy to find the code that does the castling and just comment it out right?
  • RaymanRayman Posts: 13,801
    edited 2009-06-24 13:01
    Strangely, a large percentage of the code is there just to handle little things like castling and en passant... I put a lot of effort into adding that and wouldn't want to take it out... Maybe I'll have time on my flight out to CA to look into what's wrong...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-06-25 14:28
    Rayman said...
    PS: Anybody beat their Prop yet? It's not too hard, but it takes a while...
    Sweet! I beat it on the first try! I must be better at chess than I thought.
    Just a suggestion, you could make a Human Vs. Human option too, and put a "Propeller is thinking.."
    on the screen when it is the prop's turn, or just change the cursor to a propeller hat.smilewinkgrin.gif -- ProccessingData...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • RaymanRayman Posts: 13,801
    edited 2009-06-25 17:06
    PD:· I posted human V human last year!:

    http://forums.parallax.com/showthread.php?p=747318



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-02-28 07:07
    Is there a TV version of Chess for a parallax 320x240 pixel TV?
  • RaymanRayman Posts: 13,801
    edited 2011-02-28 08:38
    Wow, that was a long time ago... I think it could work for TV, but seems I never did it...
    I'm trying to remember why not... I think it was because I wanted a nice mouse and couldn't find one for TV...
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-03-05 09:19
    The mouse oddly seems a difficult proposition for the TV. How about a key entry instead of a mouse? We have a standard keyboard driver..
  • ridgerider30ridgerider30 Posts: 1
    edited 2012-04-02 19:03
    cool thats really something
  • User NameUser Name Posts: 1,451
    edited 2012-04-02 19:18
    Sure is! I didn't know anything about it...thanks for dredging it up. Seems like a great idea to use a TV object, or else keep the slick VGA/mouse interface and use a second prop to run the chess engine.
  • RaymanRayman Posts: 13,801
    edited 2012-04-03 03:38
    Haven't thought about this in a long time... Actually, now with my new DVI/HDMI graphics shield, I think I can do a much better job...
    Offloading the graphics and screen buffer to the SSD1963 will free up a ton of space. Maybe I can make work right then...
  • jmgjmg Posts: 15,140
    edited 2012-04-03 04:10
    How about a Prop II ? Where is the bottle neck in this ?
  • RaymanRayman Posts: 13,801
    edited 2012-04-03 06:15
    There was not bottleneck, just not enough memory...
    Prop II will also solve that problem and be faster too...
  • cavelambcavelamb Posts: 720
    edited 2012-04-03 08:49
    Rayman wrote: »
    There was not bottleneck, just not enough memory...
    Prop II will also solve that problem and be faster too...


    If Prop 2 were just a Prop 1 with 2 to 4 times the memory it would be a huge hit...

    32K bytes or ram is a huge sandbox for a micro-controller.
    But this thing really isn't (just) a micro-controller.

    It was intended to do video work, and that takes lots of memory.

    What about it guys?
    Would it be technically possible to cut and paste some more memory on the die?
  • User NameUser Name Posts: 1,451
    edited 2012-04-03 09:15
    cavelamb wrote: »
    If Prop 2 were just a Prop 1 with 2 to 4 times the memory it would be a huge hit...
    Would it be technically possible to cut and paste some more memory on the die?

    I love the idea. But there's enormous work involved in changing the word size; and with the current word size there are only nine bits for the source and destination fields of the RDLONG and WRLONG instructions. So one would have to implement something like a bank select register, as in the fine tradition of the SX. I know PhiPi and others hate segmented memory. But since it's just HUB RAM and not COG RAM, is it really a big deal?

    One other comment: I'd love to see the logic synthesis tools currently being applied to the Prop 2 COG Verilog model get applied to the Prop 1 COG Verilog description. The resulting compilation might be quite tiny in terms of silicon real estate, facilitating more HUB RAM and/or more COGs.
  • cavelambcavelamb Posts: 720
    edited 2012-04-03 15:48
    Uh, ok. You lost me there.

    Doubling memory size just needs one more address line. (and decoding, of course)

    After years of x86 assembly I'd barf on a segment approach too.
    But it's just not necessary.

    I don't see more cogs as necessary either.

    But more memory? Oh yeah....
  • RaymanRayman Posts: 13,801
    edited 2012-04-03 16:41
    Another approach is to use "large" memory model of Catalina to do it arbitrarily big in C with Prop1.
    Would probably actually be faster than my Spin code here...
  • Heater.Heater. Posts: 21,230
    edited 2012-04-03 23:18
    Uersname,

    Increasing the size of HUB RAM is not limited by the 9 bits of the Prop instructions source and destination fields. That only limits COG memory address range.

    Don't forget that RD/WRBYTE/WORD/LONG can use the entire 32 bits of a COG location as the HUB address giving a potential 4GB HUB address range.
  • ericballericball Posts: 774
    edited 2012-04-04 06:16
    @Heater, the 64K HUB address space is dictated by COGINIT which squeezes two 14 bit addresses into the destination register.
  • User NameUser Name Posts: 1,451
    edited 2012-04-04 08:10
    The inner machinations of the Propeller are more of an enigma than I though. Thanks eric & heater for giving me something to research (or recover) this morning.
  • Heater.Heater. Posts: 21,230
    edited 2012-04-05 01:57
    ericball,

    Good point re: the addressing limits of COGINIT. Although if you were wanting a 4GB address space in HUB tweaking the COGINT instruction might me just a minor part of the work.

    Which makes me wonder how COGINIT will work on the Prop II where there is more than 64K RAM.
Sign In or Register to comment.