SKPIC32-based Experimental Mini-Game using VGA

Works done? Proud of it? Show off here! Let's see what you've built can help inspire others.

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby takao21203 » Sun May 27, 2012 12:16 pm

I have downloaded the source and browsed it.
In the VGA functions, you repeatedly use complex expressions.

Are they fast enough?

PIC32 has hardware multiplier, however since there is so much RAM,
you can get faster code by calculating the expressions just once, then store in RAM.

Vframe[(x / 16) + (y + sprite_row_count)]

For instance this is repeatedly calculated inside the loop.
but only sprite_row_count will change.

So, vframebase=((x/16)+y)*27)

in the loop: Vframe[(vframebase+sprite_row_count)*27)]

Or maybe it is not require to make this code faster :D
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby Brian Griffin » Sun May 27, 2012 12:36 pm

takao21203 WROTE:I have downloaded the source and browsed it.
In the VGA functions, you repeatedly use complex expressions.

Are they fast enough?

PIC32 has hardware multiplier, however since there is so much RAM,
you can get faster code by calculating the expressions just once, then store in RAM.

Vframe[(x / 16) + (y + sprite_row_count)]

For instance this is repeatedly calculated inside the loop.
but only sprite_row_count will change.

So, vframebase=((x/16)+y)*27)

in the loop: Vframe[(vframebase+sprite_row_count)*27)]

Or maybe it is not require to make this code faster :D


You can freely modify or optimize the code - I didn't know that some of my earlier codes can run pretty well within the 16.67ms timeframe despite being very messy. :)

My codes are just proof-of-concept - it is not optimized. If you need a very optimized one look at the original code of the game: http://computerarcheology.com/spaceinvaders/spaceinvaders.txt.html. :)
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby takao21203 » Sun May 27, 2012 1:05 pm

Hmm I hope to write some game applications on my 68000 system later this year.

PIC32 I want to use for my large LED matrix but only 32x24 pixels.

Maybe I should get one of these monochrome television sets again, I disposed it together with my two SEGA consoles.
And composite video output!

But I have other projects on schedule currently.

I wrote some small games using 8086 assembler many years ago and the way to output data to VGA card was obscure.
All DirectX/Windows now...

In order to use PIC32 on the 68000 PCI system, I would have to use 3.3V 68SEC000, only have two samples here, most 68K chips = 5V only. Maybe I should abandon the 5V chips but I have many of these here. Not easy to decide.
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby Brian Griffin » Sun May 27, 2012 2:02 pm

takao21203 WROTE:Hmm I hope to write some game applications on my 68000 system later this year.

PIC32 I want to use for my large LED matrix but only 32x24 pixels.

Maybe I should get one of these monochrome television sets again, I disposed it together with my two SEGA consoles.
And composite video output!

But I have other projects on schedule currently.

I wrote some small games using 8086 assembler many years ago and the way to output data to VGA card was obscure.
All DirectX/Windows now...

In order to use PIC32 on the 68000 PCI system, I would have to use 3.3V 68SEC000, only have two samples here, most 68K chips = 5V only. Maybe I should abandon the 5V chips but I have many of these here. Not easy to decide.


Where did you get the 68K chips? They are pretty rare nowadays. Most of these are used in some old videogame consoles or the more advanced Apple systems back then. :)
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby robosang » Mon May 28, 2012 9:07 am

Brian, great work! Superb! 8-)
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby takao21203 » Mon May 28, 2012 11:21 am

Brian Griffin WROTE:Where did you get the 68K chips? They are pretty rare nowadays. Most of these are used in some old videogame consoles or the more advanced Apple systems back then. :)


Not difficult to buy: Unicorn Electronics has them as well Futurlec.
I bought some on eBay, old CERDIP chips from 1985, still have 20 or 30 of them, PLCC in a bag 10pcs or 20pcs, Hitachi 2mm pitch chips, and some 68ec020 still on PCB pieces.

As well two 68SEC000 here, these are still being made. 3.3 volts, 15mA only, same 8 bit mode like 68008 also available.
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby ABSF » Mon May 28, 2012 1:55 pm

takao21203 WROTE:Not difficult to buy: Unicorn Electronics has them as well Futurlec.
I bought some on eBay, old CERDIP chips from 1985, still have 20 or 30 of them, PLCC in a bag 10pcs or 20pcs, Hitachi 2mm pitch chips, and some 68ec020 still on PCB pieces.

As well two 68SEC000 here, these are still being made. 3.3 volts, 15mA only, same 8 bit mode like 68008 also available.


I still have 2 in hand. One was from a Canon Laser printer and the other one from an equipment board used in my office. The board has a few 28 pin eprom and eeprom and static ram in sockets. There was also 2x 65C22A parallel interface chips plaus a lot of HCTTL chips. I have not yet thought of any use for the chips. These MPU are hugh, I manage to get the sockets for them in KL.

The website in Thailand also has an SBC design on 68K chip here..
http://www.kmitl.ac.th/~kswichit/68k/68k.html

And recently someone in AAC was also discuuing the interfacing of ADC to 68K chip too.
http://forum.allaboutcircuits.com/showthread.php?t=70190

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby Brian Griffin » Mon May 28, 2012 1:57 pm

robosang WROTE:Brian, great work! Superb! 8-)


Thanks for the compliment! :D

takao21203 WROTE:Not difficult to buy: Unicorn Electronics has them as well Futurlec.
I bought some on eBay, old CERDIP chips from 1985, still have 20 or 30 of them, PLCC in a bag 10pcs or 20pcs, Hitachi 2mm pitch chips, and some 68ec020 still on PCB pieces.

As well two 68SEC000 here, these are still being made. 3.3 volts, 15mA only, same 8 bit mode like 68008 also available.


I'll try Futurlec since they have a company in Thailand, which is nearby Malaysia.

I love to try those chips but I haven't got all the time yet. Plus, the PIC32 and ARM I'm having is already doing a lot of good stuff to me. :)

Maybe I'll do some emulation. It'll take some time, but I'll get to do 6502 once I have time. :)
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby robosang » Mon May 28, 2012 2:16 pm

Did learn 68000 during university, but now I forgot all the topics :twisted: I need to apologize to the lecturer .....

Anyway is a great 8-bit microprocessor at that time :)
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: SKPIC32-based Experimental Mini-Game using VGA

Postby takao21203 » Mon May 28, 2012 3:18 pm

I started a different thread for this subject, also related (single board computer to run games, having television interface + PIC), but the thread is about project showcase, PIC32 VGA game.

I have mainly been reading the user manual many times, and my design is different from most that can be seen on internet.
Using the PCI backplane, I can make one card with 18F PIC, another with PIC32..., and even another trying to get a composite video interface working.

Main purpose for me = same as original thread subject, running games on the single board computer.
68000 was used for Mitsubishi PLC but not anymore. Not enough MHz :)
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

PreviousNext

Return to Project Showcase

Who is online

Users browsing this forum: No registered users and 7 guests

cron