Jump to content

Gilberetsu

New Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Gilberetsu

  • Rank
    Space Invader
  • Birthday 11/25/1997

Profile Information

  • Gender
    Male
  1. Polybios Hey, I took a little bit more than I expected to write this post, sorry, I am a little bit busy with something now. I am not sure if this post is going to be enough, but if you have any questions, comments or ideas on what I could have done differently, please write a post response. To make this console I used VHDL because is the HDL that I am most comfortable working with. To make this project I used 2 Xilinx cores: the memory block and the memory controller, everything else was written by me in VHDL. I created a Micro SD card reader for low capacity cards version 1, I used the SPI mode for communications, at the moment the system reads the first 64 MB of the Micro SD card and puts it on the memory card. I don't use any file system, the reader just receives any information the sd card may have. When the system is turned on the sd card waits for the memory controller to be calibrated then it sends the initialization messages then the message to read a block of data from the micro SD card and when it reads 64 MB the system enables the Video Card and The Processor, and the Micro SD card reader stays in IDLE state. In the future, I am going to add the possibility to read and write from memory in runtime from the processor. It takes the system around 1 minute and 35 seconds to load. The reader and the card have a clock speed of 20MHz because of the limits of the SD card. The processor and the video card have a clock speed of 130 MHz because that's double the clock speed of the VGA connector controller that is 65MHz because that's the speed needed for the output resolution. The Video System The video system has an output resolution of 1024x768, but the image that is displayed has a resolution of 256x192, the images are scaled up so black lines don't appear at the side of the screen or on the bottom or top. The video system uses 2 layers to show the images on the screen, the layers are 272 x 208, as you can imagine the system doesn't show the entire image on the screen and the pixels that don't show on the screen I intend to use them as buffers. One of the layers is on top of the other and to make the two of them visible at the same time the top layer has a transparent color that can be changed via the processor, and when the system is "rendering" the image it takes that into account to make the final image. The Layers can be moved to any direction, and its like you had the layer as a texture of a sphere and when you move the layer is like you rotated the sphere in the X axis, Y axis or both at the same time. This can be changed via the processor too. The entire layer is stored in the memory, the system has 2 line buffers, one for the line of pixels that is been put in the screen and the other is the next line that is going to be shown, it has 2 line buffers for each layer, and the lines that are loaded in the line buffer depends on the positions of the layers and the actual line of pixels that the screen needs. So the system knows where to look for the images there is 1 signal in the video card that says the address for the first pixel of the layer. The Processor After the micro sd card reader finishes reading from the memory card and writing to the RAM, the processor starts reading the first address in memory. The processor can read and write 32 bits of memory at any given time. The processor reads from memory, executes the action, and changes the program counter (if the operation changed the program counter this step is skipped) then repeats. The processor has 31 general purpose registers and 1 register that is always 0 that is in total 32 internal registers. The processor also has a memory block that stores a sprite, that can be 8x8, 8x16, 16x8 and 16x16 pixels this is used to copy sprites from one location in memory to a video layer, it is specific to a video layer because in a video layer the pixels of a sprite arent contiguous unless they are in the same line. Apart from that, the processor can do a lot of things the instruction set is this. The Game The code of the game I showed in the other post (before passing through the compiler). You can see it has labels and a weird operation "IMG" these are not seen by the processor, the compiler gets rid of them before it gets stored on the sd card. LITERALR1 layerA MOV 1 10 SVR 10 0 SSP 10 MOV 10 11 ADDI 11 221 0 SVR 11 1 LITERALR1 stackPointer MOV 1 25 SSP 25 LITERALR1 redraw MOV 1 30 RVALUP 12 0 0 RVALDOWN 12 0 253 RVALUP 13 0 0 RVALDOWN 13 0 62 RVALUP 24 0 0 RVALDOWN 24 0 5 MOV 0 9 MOV 0 8 MOV 0 5 LITERALR1 0 0 10 MOV 1 18 MOV 1 15 LITERALR1 0 0 128 MOV 1 16 MOV 1 19 MOV 0 17 LITERALR1 worldArray MOV 1 6 forLoopBody: ADD 5 6 7 LOAD 7 4 LS 4 10 3 9 8 ADDI 9 0 4 ADDI 5 0 1 GREATER 9 13 0 JUMPI elseA MOV 0 9 ADDI 8 0 16 GREATER 5 12 0 JUMPI forLoopBody GVR 22 9 CALL 30 31 0 JUMPI mainProgram elseA: JUMPI forLoopBody mainProgram: GCA 14 BTF 14 8 0 JUMPI elseBtn1 BSF 17 0 MOV 15 18 ADDI 15 0 1 GVR 22 9 CALL 30 31 0 JUMPI loopRedraw elseBtn1: BTF 14 7 0 JUMPI mainProgram BCF 17 0 MOV 15 18 SUBI 15 0 1 GVR 22 9 CALL 30 31 0 JUMPI loopRedraw loopRedraw: GVR 23 9 SUB 23 22 21 GREATER 21 24 0 JUMPI loopRedraw JUMPI mainProgram redraw: LITERALR1 eraser MOV 1 4 LS 4 11 3 18 19 MOV 19 20 ADDI 20 0 16 LS 4 11 3 18 20 BTF 17 0 0 JUMPI elseredrawA LITERALR1 charUpSideA MOV 1 4 LS 4 11 3 15 16 LITERALR1 charDownSideA MOV 1 4 MOV 16 20 ADDI 20 0 16 LS 4 11 3 15 20 RETURN elseredrawA: LITERALR1 charUpSideB MOV 1 4 LS 4 11 3 15 16 LITERALR1 charDownSideB MOV 1 4 MOV 16 20 ADDI 20 0 16 LS 4 11 3 15 20 RETURN skul: IMG ./images/PPP.jpg 8 cloud1: IMG ./images/cloud1.jpg 16 cloud2: IMG ./images/cloud2.jpg 16 cloud3: IMG ./images/cloud3.jpg 16 cloud4: IMG ./images/cloud4.jpg 16 ground: IMG ./images/ground.jpg 16 underground: IMG ./images/underground.jpg 16 sky: IMG ./images/sky.jpg 16 eraser: IMG ./images/eraser.jpg 16 charUpSideA: IMG ./images/charUpSideA.jpg 16 charDownSideA: IMG ./images/charDownSideA.jpg 16 charUpSideB: IMG ./images/charUpSideB.jpg 16 charDownSideB: IMG ./images/charDownSideB.jpg 16 stackPointer: IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 IMG ./images/eraser.jpg 16 worldArray: DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud3 DB 0 cloud4 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud1 DB 0 cloud2 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud3 DB 0 cloud4 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud1 DB 0 cloud2 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud3 DB 0 cloud4 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud1 DB 0 cloud2 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud3 DB 0 cloud4 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 cloud1 DB 0 cloud2 DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 sky DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 ground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground DB 0 underground layerA: As I said earlier if you have any questions, comments or ideas on what I could have done differently, please write a post response.
  2. Hey, sorry for not updating I thought you all lost interest, I had to focus and I had to stop the development a month ago because of another project. The console turned out fine, its functional. I am going to write a post with more information but for now I am going to show you some images of what I manged to achieve. This is the console and its controller This 2 are images in a simple program that show images on the screen This is an image created by the console This is a video in the console This is a program that moves an image layer in the screen This is a simple "game" running on the system
  3. Yes, I know, just with the read and write latency of the memory controller I get way over that number. I was thinking about doind a dedicated hardware to do that. Well if I have a dedicated video system I could do a frame buffer, not just a single line. If i could update every pixel on the screen in 3ms I thinkg is posible, becase using a 640x480 it is going to take the VGA system 12.3 ms to put every pixel on the screen (without considering the Vsync and Hsync zones), so I have a lot of time left, so the system cold. Yes, I could do that too. Yeah, thats why I was reading the GBA CPU manual and the snes one too, so I at least get an Idea of what I should do. At least in my case, it is not an option, not to do it. yep, I think I found it. Radical Brad does magic with a breadboard WOW Thanks!
  4. I think Free Range VHDL is a good book. I was reading about the MIPS architecture that is described in the book Digital Design and Computer Architecture by David Money Harris and Sarah Harris and the Game Boy CPU Manual for ideas. I am using a development board, the Mimas V2 Spartan 6, and it has an LPDDR memory as the external RAM, so I am stuck with that (for now), to use it I created a Memory Controller core using the MIG of Xilinx, and I can write and read from memory so it's working, the latency depends heavily on the amount of commands I issue and the amount of ports I have, that's why I wanted to create something like a cache, at least for the video controller I am going to use a BRAM to store what is going to be on the screen, I am going to have 2 buffers, 1 is going to be what is currently on the screen and the other is going to be the next frame. I am going to create a post on WordPress (so I don't waste too much time creating a website), I don't have one right now because I didn't think someone would be interested in the project or helping me, so thanks for offering your help. When I get it ready I am going to post the link here. Thanks!
  5. The book that teach me how to describe hardware in VHDL was Free range VHDL. I am going to check the VHDL by example book. I am not a better HDL programmer than you!, or at least I don't think so. I am going to see the 9900 core architecture to see what I can take from it. I am going to see what seems to be the quickest way and then I am going to add complexity. Thanks for the recomendation
  6. I have to use the external memory, I know is slower than the BRAM, but I will think about something like a cache and see if i can manage with that or talk to my professor. I have to create my own CPU, I think that if I can change the memory where the screen data is stored, if I can do arithmetic operations and jump from and instruction tu another I well be fine. But I now creating a good microprocessor is not an easy task, I am learning about it. I have a video system working, so not a big problem. Abou the SD card I am going the quick and dirty way for now. And I am going to work with the audio when I get the microprocessor working. I know VHDL (well, maybe), like 3 months ago a did a video game, but with no processor just a couple of FSMs, a video system and a RS 232 port to connect it to the pc and control it with a keyboard (it was because in the class that i took they told us we had to use the serial port for our final project of that class). I did it in a Spartan 3. Its not finished is just a level and a coin. This is a video showing the game https://drive.google.com/open?id=0B-8jYZQ-zYb3T3Z0Z1IwZW5xU0k Thanks for the suggestions.
  7. Are you sure about that? I think most monitors support 1024x768. yea I could use 240p and scale it to 1280 x 720, so there is no black space.
  8. It's going to be digital output, and I am going to scale ir to 1024x768, it's going to have black spaces or some sort of frame, because I dont want to strech the image. And yes, the SD card reader is the best option, and the one that i am going to implement first.
  9. I agree with you matthew180. But I did the poll just because my final project report requires that I put some sort of "reason" behind my decisions. As you said I wont be able to finish the console if I want to satisfy someone else, I agree with that, but I will try my best to do some of those things, at least in the time I have. But if I see it would take too much time I am going to do it the way I see it can be done. I told my professor that the console wouldn't sell, and he told me that I have to do a poll anyway, so I did it. I have to do a financial plan too, and thats why I asked how much money you are willing to pay for a console you dont know anything about. I am just doing the console because it's interesting and fun. I dont have any plans to sell the console, if the university doesnt want anything to do with the console (for some reason they have the right to do something with it), I am going to put the source code on github.
  10. That is the best response I've seen on the internet Pixelboy, It made me laugh so hard . But it makes sense, I guess XD. That was the best part. And thanks for the tip.
  11. Hey, I am an electronics engineer student and as my final career project I want to create a game console in an FPGA. It is going to be a 2D video game console, the maximun amount of colors is 256 and is going to be developed in a Spartan6. I want to know your thoughts or any question you have. And if you can, please fill in the survey.
×
×
  • Create New...