little assembler game challenge
Chris Micro
Posts: 160
Hello together,
would it be possible to write a little game in assembler on the propeller which fits in only one cog?
There are these demo-challenges where the people try to fit a program in minimal space.
cheers,
chris
would it be possible to write a little game in assembler on the propeller which fits in only one cog?
There are these demo-challenges where the people try to fit a program in minimal space.
cheers,
chris
Comments
Whatever processor you have, you can design a game that fits into it.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Now add sound effects for realism...
That's about the sophistication of games we used to make for old microprocessor development kits with tiny amounts of memory and I/O.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I love this comment, and it's often true.
Don't forget the value added, downloadable SUPER DUCK that's shown on the box, but only appears after you look in your wallet again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Value Added Super-Duck Wallet Drainer
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
thank you for your comments.
OK, it is clear: to connect some leds and switches to the Propeller would enable the chip to be a kind of game console.
I was thinking of connection VGA and a Keypoard or Mouse to the propeller. One could use the drivers in the object library.
The challenge would be to write game code in one COG ( the cogs used for VGA and Keyboard do not count ).
I think it is an excellent method of learning efficient assembler programming.
chris
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Ducks can now move in 2d space as well.
It must be possible to get a Pong game in PASM in COG this way. Who knows where this challenge leads.
Embellish until COG is full. Then learn to do it in LMM and start using HUB for program space.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
the reason why I wanted to have a one cog game is that I could run it on my COG-emulator. It runs on linux and writing hub-memory address 0 will output a char to the console. I made the console commands compatible to the vga_text.spin object, so you can set the color and cursor position. In my opinion this is a very good base for running a propeller asm based game on a pc.
For me this game would be a good test to see if I implemented the propeller instruction set correctly.
chris
Does it support rd/wrlong/word/byte from HUB memory? If so I can see me wasting endless hours getting ZiCog to run under cogEmu under Linux!
Which might get me into a lot of trouble[noparse]:)[/noparse]
Edit: Sorry just read your post again. You can at least write to HUB 0000.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
yes, the hub-memory commands are available. If it would be useful to print the output by accessing other memory locations than 0x0000 I could do that.
Sorry, if I let you to wasting endless hours running your ZiCog on the Emulator
( btw I would appreciate seeing the emulator running on the PC ) Is one COG sufficient?
chris
One COG is sufficient for the actual CPU emulator PASM. Then another COG takes care simulating disk and console I/O which is Spin code. Then whatever COGS are required for console serial coms and SD card access etc.
I was thinking to just getting the basic CPU emulation working in the virtual COG for now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Hi heater,
I'm very curious how it works ...
If you need a second cog, you will find attached the "2 cog version". If you want to use a second cog, just take a look at the example file test.spin ( coginit is only working as in the example at the moment )
Have fun,
chris
I'm thinking that initially its best to skip all the Spin stuff and just try and run the emulator PASM. That I/O stuff can be picked up by the COG emulation C code and console I/O simulated there. Perhaps even the disk hardware emulation could be done in C at some point.
The way I mostly run CP/M in ZiCog is to have the OS code loaded into HUB and the start the emulation. This way we can run CP/M up to it's command prompt without any disk I/O being required.
A couple of questions.
Have you taken care that self-modifying PASM code is simulated correctly? That is re: timing and the need for at least one instruction between a modified instruction and the instruction that does the modifying.
Have you tried to run the Props Spin interpreter? The code for it is posted here somewhere.
Still no time to play with this today though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Later on we could think about reserving a special io location in the emulator for some disk access. The pc would have enough space
>A couple of questions.
>Have you taken care that self-modifying PASM code is simulated correctly? That is re: timing and the need for at least one instruction between a modified instruction and the instruction that does the modifying
Hmm, no, is it essential? The timing of the emulator is slightly different. It simply takes the instruction and executes it. So there is no need of the nop instruction.
>Have you tried to run the Props Spin interpreter? The code for it is posted here somewhere.
I was thinking about that. I saw the interpreter code. Probably someone wants to try it. With the sphinx-project there would be an open source spin interpreter for the pc.
In the attachment there is the 4 COG version. I'm not sure if I should make an 8 COG emulator. On my 1.6GHz Atom the 4 Cog emulation runs with about 3MIPS/COG.
then 0 will be added to "something" when run on the Propeller but if your COG emulator does not include the pipeline delays then it will add the 3.
This may not matter in 99% of code as people tend to include the NOPs (or put some other useful instruction there) but it will trip up eventually somewhere.
I think the solution maybe as simple as reading the next instruction just before writing out the result of the current one. Unless I'm missing some other Prop subtleties.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I could introduce a delay in the emulator, but it is time consuming in the emulation.
We have to face the fact self modifying code like this is an essential concept in the Propeller and that if the emulator produces a different result than a real COG then the emulator is just wrong.
Anyway things are not so bad. Surely it cannot be so hard to include (not that I have looked at your code yet). There is no need to add a time consuming delay into the emulation. As I said I think it would suffice to just read the next instruction just prior to writing out the result of the current one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.