Shop OBEX P1 Docs P2 Docs Learn Events
PROP2 Invaders - 1 Cog (Now with sound effects!) - Page 2 — Parallax Forums

PROP2 Invaders - 1 Cog (Now with sound effects!)

24

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2013-09-01 09:53
    Let's not have that take away from an awesome effort. Seriously. You really did knock it out of the park on this one. :)
  • TubularTubular Posts: 4,702
    edited 2013-09-01 20:18
    All good on the DE2 now OzPropDev. Thanks Potatohead for the buttons. Not sure about what I was doing wrong on Friday other than pressing F10 not F11 in the new Pnut.

    Most fun I've had on the DE2 yet!

    Now what to do with the extra cogs? I wonder how hard it would be to get the cogs synced up so they each paint into a 1/9th of the screen (3x3 invaders, with just a static logo in the middle of the screen)?
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-09-01 22:49
    When the real P2 arrives, it would be interesting to see how may separate Space Invaders could be run simultaneously. Just imagine the whole family all running their own space invaders ;)
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-02 06:01
    I'm just finishing off the latest instalment (Version 1.44) today.
    I have a 8 screen version nearly completed as well.
    I'm short of Cogs, Screens and HANDS to test it though!
    Cheers
    Brian
  • potatoheadpotatohead Posts: 10,261
    edited 2013-09-02 09:59
    You did it! Sweet! :)

    Well, a 5 screen version can be tested on the FPGA... If we get it onto TV, I can test three... :
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-03 22:47
    Hi Guys

    I've been working on version 1.45 the last couple of days and fixed a few things.
    The DEMO mode had a bug or two which are now resolved.
    The cannon and saucer had some video sync issues which are now fixed. (Well spotted Potatohead!)

    I've added a launcher so multiple instances of the game can be started.
    Each game requires a few configuration values to set controller IO pins and video buffer.

    game1			long	@video
    			long	left_button
    			long	right_button
    			long	fire_button
    
    game2			long	@video2
    			long	left_button2
    			long	fire_button2
    			long	right_button2
    etc...
    
    


    Here's where I had a bit of drama.
    In this example I have 4 games setup.
    At the end of the code you will see where I have allocated the video buffers.
    'Video buffers
    
    video			long	$11111111[(cols / 32) * rows]
    video2			long	$22222222[(cols / 32) * rows]
    video3			long	$33333333[(cols / 32) * rows]
    video4			long	$44444444[(cols / 32) * rows]
    
    
    

    These buffers fall well short of the DE0 32k limit. The code fails in this configuration.
    If I reduce the size of "video3" to 400 longs for example, game4 will operate fine.
    Its seems if I cross the $6990 address space weird things happen.

    I'm not sure if I fried my DE0 board or not.
    Here's my BETA version 1.45 anyway.
    Can someone with a DE0 board try it?

    Hmmm....
    Brian


    Update: 5thSeptember 2013 - Problem solved (Brian fade the cause!)
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-09-04 23:32
    Just curious: Anyone have a video clip of this Space Invaders one-cog wonder in action?
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-05 00:33
    Here's a little video. Sorry about the quality and my shaky hand.
    I will try and get a better one later.
    Cheers
    Brian
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-09-05 02:05
    Hey, thanks, Brian! That was fast. Ask and ye shall receive. It looks great and is fluid. Seems faithful to the original. Nice job! --Jim
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-09-05 06:42
    ozpropdev,

    Really nice work ... but you may need to wait for test chips to try more than one display - my understanding is that the DACS needed for video are only implemented for one cog even on the DE2-115
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-05 06:51
    - my understanding is that the DACS needed for video are only implemented for one cog even on the DE2-115

    Bill
    That's right. My new code is setup for the real chips but runs a single instance on the FPGA boards.
    Hopefully we will see some chips soon...
    Cheers
    Brian
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-05 07:44
    Hi Guys

    I just updated to Version 1.46 (See first post)

    This has assorted tweaks and fixes.
    It now includes a multiple game launcher (4 game example).
    For each instance of the game a separate controller and screen will be required.
    Each game requires a few values to define video buffer, i/o settings.
    We'll have to wait for the real chips to test it in this format.
    In theory, 8 cogs = 8 games!
    It still runs both FPGA boards though.
    Enjoy!

    Cheers
    Brian
  • SapiehaSapieha Posts: 2,964
    edited 2013-09-05 07:50
    Hi. ozpropdev

    You can repost Your's video in first post so people without FPGA find it directly to se Your's work.

    NICE one

    ozpropdev wrote: »
    Hi Guys

    I just updated to Version 1.46 (See first post)

    This has assorted tweaks and fixes.
    It now includes a multiple game launcher (4 game example).
    For each instance of the game a separate controller and screen will be required.
    Each game requires a few values to define video buffer, i/o settings.
    We'll have to wait for the real chips to test it in this format.
    In theory, 8 cogs = 8 games!
    It still runs both FPGA boards though.
    Enjoy!

    Cheers
    Brian
  • potatoheadpotatohead Posts: 10,261
    edited 2013-09-05 08:42
    Ah yes. Forgot DACS on COG. Only. So we wait. :)
  • rjo__rjo__ Posts: 2,114
    edited 2013-09-07 19:21
    About your book.

    After your bio...include the human story of how you came to write: reps #16,@:loop ?
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-07 20:18
    rjo__ wrote: »
    About your book.

    After your bio...include the human story of how you came to write: reps #16,@:loop ?

    rio__
    I couldn't remember where I first saw the use of @ in REPS.
    I think Ariba was right , it probably was in Chip's PASM code.
    It all seems a blur at the moment.
    Cheers
    Brian
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-09 06:47
    Hi Guys

    I'm just testing the latest version of Invaders which now has a 10kHz audio streamer for real sound effects!

    It works great!

    It's official, my little DE0 board is maxed out now.

    Stay tuned....
  • TubularTubular Posts: 4,702
    edited 2013-09-09 16:42
    That is completely awesome.

    I've been playing around with some VGA and TV over IP converters.

    Here's your invaders working nicely. I don't have one that does sound, unfortunately.

    I need to order some arcade buttons for the 4 cog version

    Lantronix_SpiderDuo_Prop2_Invaders.png
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-09-09 18:15
    Oooh! I never did get excited with computer games, with one exception - space invaders. Best not try this out as I need to do other things!!!
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-09 18:27
    Tubular wrote: »
    I've been playing around with some VGA and TV over IP converters.

    Here's your invaders working nicely. I don't have one that does sound, unfortunately.

    Very cool, a nice little gadget!

    The new version of Invaders will also have 800x600 instead of 640x480.
    It looks a lot nicer.


    Cheers
    Brian
  • pedwardpedward Posts: 1,642
    edited 2013-09-10 23:36
    This thread sounds like a contest! Get the most out of a 3/8ths speed, 1/8th core Prop2! It's like the demo scene all over again.

    I can imagine some of the really cool demos people could make with a 160Mhz 8 cog chip.
  • Ym2413aYm2413a Posts: 630
    edited 2013-09-11 00:23
    I'm dying for the real chip so I can start some demo scene coding with Graphics and Sound.
    I've only been waiting since the first announcement of the PropII a few years back. : ]
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-12 03:16
    Hi Guys
    Here I go again with a another version of Invaders. I'm emulating iTunes with a new version every week!

    Version 1.50 now has 800x600 VGA instead of 640x480. I cleaned things up a bit as well.
    It now supports real sound effects as well . Audio is streamed at 10kHz into a 4 bit R2R ladder network.
    Four colour schemes are selectable from the diagnostic monitor. (see Readme file)

    Enjoy!

    Cheers
    Brian
  • Ym2413aYm2413a Posts: 630
    edited 2013-09-12 23:06
    Awesome work Ozpropdev. : ]
  • TubularTubular Posts: 4,702
    edited 2013-09-12 23:31
    Nice work Brian. It runs fine on the DE2, though I haven't figured out how to launch multiple games just yet.

    Audio is a brilliant touch. Audio, VGA, monitor, gameplay all in a single cog, with 7 spare. What a remarkable achievement!

    Next week I'll order some sets of arcade buttons, then we can get serious

    regards
    Lachlan
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-13 00:07
    Tubular wrote: »
    ...though I haven't figured out how to launch multiple games just yet.

    Hi Lachlan

    Good to hear it runs Ok on DE2 board.
    Have you tried capturing images with your video gadget?
    Did you try the sound feature?
    The code is ready to go for multiple games, but we all are short of DAC's....we wait....

    Cheers
    Brian
  • TubularTubular Posts: 4,702
    edited 2013-09-13 00:42
    Yes, I had some initial trouble with the sound but it seems my tv monitor is in "mute" mode and the remote control is temporarily lost. I hooked up the scope to verify and then some headphones, 47 ohm and 82 ohm resistors for the R2R, and a big series cap to AC couple. Certainly adds to the whole "invader experience".

    I've had a quick look at your code for the first time. At first glance it appears everything runs through a (256*150=4.8k) mono bitmap for each cog, is that right? Or are you doing some overlay work locally

    The DE2 allows 5 cogs and I was thinking it may be possible to start games in cogs 1..4 based on what you already have (they won't be able to directly drive the DACs but that's ok because...) Then we create a new cog0 that just renders those 4 video buffers quadrant style to the VGA monitor. So for the top scanlines we pick the appropriate fore and background colours then dump out buffers "Video" then "Video2", and halfway down the screen we cut over to Video3 and Video4 for the lower half. I haven't studied your code in great detail yet, but does that have a chance of working? We could use your new background colour feature to give each quadrant some "personality"

    For the i/o I think we have P0..28 free, so 7 i/o per game. How about we split that so
    cog 1 has 3 buttons, 2 monitor (tx/rx), 4 audio into the "left" channel of the stereo
    cog 2 has 3 buttons, 2 monitor (tx/rx), 4 audio into the "right' channel of the stereo
    cog 3 has 3 buttons, 2 monitor (tx/rx) only, no audio
    cog 4 has 3 buttons, 2 monitor (tx/rx) only, no audio
    cog 0 has control of the DACs

    Let me know your thoughts. I don't have a whole lot of time but I do have a DE2 and not doing this feels like a bit of a crime

    I haven't tried the VGA to Ethernet converter box just yet but will do so

    cheers
    Lachlan
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-09-13 01:10
    Hi Lachlan

    Interesting idea...

    With a bit of work I could do the following arrangement.

    COG0 - VGA driver/Diagnostic monitor
    COG1-4 4 x game engines/sound

    This would also allow me to free up threads for multi channel sound and complete effects!
    The DE2 opens up a whole new world to me(128k RAM for starters).

    It's all possible.
    The only problem I have is its a little difficult to test/develop on my DE0 board.
    Got me thinking though....

    I see a few more late nights ahead....

    Cheers
    Brian

    Update: Re-mapped video for 6 x split display test.
    Each instance now has it's own window
    DE2-115 will support 4 x instances

    Stay tuned....
    1024 x 613 - 64K
  • GadgetmanGadgetman Posts: 2,436
    edited 2013-09-13 09:45
    If there's any justice in this world, a Prop2 needs to make its way down under the day Chip declares it fit for use...
  • SapiehaSapieha Posts: 2,964
    edited 2013-09-16 02:10
    Hi ozpropdev

    In Your code You used instruction
    testb - Can You point me to place this instruction is described
Sign In or Register to comment.