Page 2 of 3

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Sun May 27, 2012 12:16 pm
by takao21203
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

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Sun May 27, 2012 12:36 pm
by Brian Griffin
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. :)

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Sun May 27, 2012 1:05 pm
by takao21203
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.

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Sun May 27, 2012 2:02 pm
by Brian Griffin
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. :)

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Mon May 28, 2012 9:07 am
by robosang
Brian, great work! Superb! 8-)

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Mon May 28, 2012 11:21 am
by takao21203
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.

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Mon May 28, 2012 1:55 pm
by ABSF
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

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Mon May 28, 2012 1:57 pm
by Brian Griffin
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. :)

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Mon May 28, 2012 2:16 pm
by robosang
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 :)

Re: SKPIC32-based Experimental Mini-Game using VGA

PostPosted: Mon May 28, 2012 3:18 pm
by takao21203
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 :)