1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PacMan running on Mimas V2

Discussion in 'Project Showcase' started by Alexander Lang, Apr 27, 2016.

  1. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    mistery likes this.
  2. mistery

    mistery Member

    Joined:
    May 26, 2015
    Messages:
    66
    Likes Received:
    4
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Zagreb
    Home Page:
    Great blog it is all understandable now, and tnx for credit

    At home I have few coinselector it would be great to use it for this game :)
     
    Alexander Lang likes this.
  3. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Going to open your own amusement arcade hmmm - $$$$ :)
     
    mistery likes this.
  4. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    Hi Alexander, I have a problem with PACMAN game that is running on MIMAS V2. In the link posted on your blog there is a Verilog file named "timing.v". The question is where should i add that code in Xilinx ISE ? I have an issue after i connect the board with a LCD TV via VGA; it shows nothing, the screen is blue and there is a message that says "Unusable Mode". Can you tell me what should I do ? Thank you
     
  5. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Hi Mihail,

    I'm just going to look into this for you now. I'm not sure why you are having issues. For now please can you try this bit file which is the version I used to flash to my Mimas V2. I would be interested to know if that works. I will look at my blog and see if there is an issue with the source code.
     

    Attached Files:

  6. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Hi Mihail,

    It sounds like there is an issue for the way you have downloaded the original pepino source code for pacman. Can you take a screenshot of the main screen in WebISE please.

    This is a picture of all the files needed in the project to make it compile correct after you have made the changes to the source code.

    upload_2016-6-2_21-56-3.png
    The file timing.v is not used in this project so it isn't required. Show me an image of your screen and hopefully I can see something which will point us in the correct direction.
     
  7. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    Here are my screenshots

    upload_2016-6-3_0-36-23.png

    upload_2016-6-3_0-36-37.png
     
  8. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    I saw in your video that the monitor is connected with a GPU and the monitor is rotated to 90 degrees . The GPU is only used like a VGA adaptor ?
     
  9. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Hi Mihail,

    The video monitor I am using is an old laptop screen with a driver PCB. I'm using the VGA input as that is the only one that will work with this version of PACMan. The source code does not take use of HDMI video output. The Original PacMan game used a native resolution of 224 x 288 which is why I have rotated the screen. Hope this helps!

    Alex
     
  10. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    Can I run the game at 0 degrees rotation screen, if you could, give me a hint
     
  11. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Unfortunately not without seriously rewriting the code! It is a common problem with these old arcade games...they used odd screen resolutions. Most people I know find a vesa mount 14 inch monitor and rotate it by 90 degrees.

    Sorry I can't help more....did you at least get it to work?
     
  12. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    Yes, it is work but it's work on a friend's of mine 19'' monitor and the screen is reversed on 90° counterclockwise. I think, if I change in .ucf the pin for hsync with the pin for vsync, the screen will be change at 0°. What do you think ? Please try it. I cannot change now beacause I don't have a smaller monitor
     
  13. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Hi Mikhail,

    There is nothing wrong with the code or your system. The game originally worked with the screen rotated 90 degrees counter clockwise. The only way to currently use it is to either turn your head when playing or physically rotate the monitor connected to the Mimas.

    I have no way of changing this. The only way to do it would be to completely re-write the source code for the game...change the screen resolution...change the background resolution. Re-write the sprite limits and the controls....it's a lot of work.

    At least you got the game working. Well done!
     
  14. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    Do you know for what kind of FPGA was initial developed the game ? And in what resolution is it developed ? I cannot find in the code the resolution
     
  15. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    One more thing, is there a possible to display the score on 7-segment display ?
     
  16. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Hi Mihail,

    PacMan was originally developed with discrete 74LS series TTL logic to drive the display and a great deal of the hardware requirements. The program was stored on a ROM device. The microcontroller used was a Zilog Z80 - The same one used in a Sinclair Spectrum home computer.

    https://en.wikipedia.org/wiki/Namco_Pac-Man

    Basically in order to make the game work in a better resolution you would have to re-write the source code in the ROM file to account for the new resolution. This would be very difficult to achieve.

    Hope this helps

    Alex
     
  17. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Displaying the score on a seven segment display is probably possible but I don't know how you would go about achieving that. The score must be stored in memory somewhere and you would need to locate that and then use the data which will be in hex to then display the result in base ten format on a seven segment display.

    I know this is an FPGA forum but it might be easier to achieve that using a simple microcontroller and a raspberry Pi running Mame with added seven segment display!

    I will take a look at the code later and see if I can locate where the score is passed from the Z80 to the display and then look at how you would drive a seven segment display....No promises though!
     
  18. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    If you have time, can you tell me what does each .vhd file in a few words ?
     
  19. Alexander Lang

    Alexander Lang Member

    Joined:
    May 17, 2015
    Messages:
    81
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Manchester, UK
    Yikes...That is quite the request. I will try but I didn't write the original code so I'm working it out just the same as everyone else:

    The file pacman_top.v is the top module. It was written in verilog. It basically is the instructions for how all the files interact with each other. The inputs and outputs are defined along with their purpose. Google search for Verilog top module for a better description

    The file syncro.v is a verilog file automatically generated by WebISE. The code ensures that the signal async, clock and sync all change state at the same time.

    The file pacman.vhd is the code which simulates the behaviour of the original 74 series logic used to implement pacman. It contains the code which models the behaviour of the joystick, the display driver, the audio driver, the buttons and the LED behaviour.

    The file T80sed.vhd is the code which simulates the behaviour of the Zilog Z80 Microcontroller which was used in the original version of PacMan.

    The file pacman_vram_addr,vhd is the code which simulates the behaviour of the video ram address bus.

    The file pacman_rams.vhd is the code which simulates the RAM memory used in PacMan

    The file rom0.vhd is the code which contains the program for PacMan - It's the contents of the read only memory device used in the original version of PacMan

    The file pacman_video.vhd is the code which simulates the behaviour of the video driver used in the original PacMan

    The file pacman_dblscan.vhd is the code which simulates the behaviour of the video double scan used in the original PacMan - Google search for a double scan for an explanation of what a double scanner is...

    The file pacman_audio.vhd is the code which simulates the behaviour of the audio driver used in the original PacMan.

    The file dac.vhd is the code which models the behaviour of a digital to analogue converter to create the audio output required to make the sound.

    The file pacman_debounce.vhd is the code which ensures that the buttons and switches are debounced - the buttons don't false trigger a response.

    The file pacman.ucf is the user constraints file. This file I wrote! It tells the xilinx software what the pins on the FPGA are going to be connected to externally. The 100 MHz clock is connected to pin V10. The LEDS are connected to P15, U18, T17, T18, The push buttons are connected to C17, C18, D17, D18 etc etc....

    I hope that helps!

    Good luck

    Alex
     
  20. Mihail Doncila

    Mihail Doncila New Member

    Joined:
    Jun 2, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Targoviste, Romania
    Hi Alexander,

    Thank you very much for the explanations from above. I have a question, I want to change the position from horizontal to vertical for the enemies and for some characters in the game. Can you tell me where are they created ? I cannot find them.
     

Share This Page