Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

WON'T YOU JOIN US?
You are not a registered member and
are viewing this site as a guest.
Registration is simple and FREE.
Join this CrowdGather community today.
Registration offers the following perks:

» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging

join

Reply
 
Thread Tools Display Modes
Old March 22nd, 2012, 12:06   #321
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Quote:
Originally Posted by paul_nicholls View Post
haha! neat
So what high-level language is it compiling? C/C++? Or something else?
Custom syntax. Pretty much like C but little changes.
This is experimental project and we weren't sure if we would be able to complete it when we started it but last couple of days we are getting some great results and compiler is already able to compile some syntax into chip16 binary.
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old March 22nd, 2012, 12:13   #322
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Nice! So can you parse expressions yet and produce code from them? They can be 'fun' to get working correctly
paul_nicholls is offline   Reply With Quote
Old March 22nd, 2012, 12:31   #323
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Quote:
Originally Posted by paul_nicholls View Post
Nice! So can you parse expressions yet and produce code from them? They can be 'fun' to get working correctly
Yes it can. I compiled this code:

Code:
void main() {
	var a;
	a = 20;
	if (a > 30) {
		SetBackground(5);
	}
	if (a < 30) {
		SetBackground(10);
	}
}
and it was able to compile it. I will attach the binary it compiled.
Here's the source code repo for the compiler: http://code.google.com/p/chip16-dev-kit/

EDIT: Oh and the binary it compiles to is spec 1.0. That is the one without the header...
Attached Files
File Type: 7z test.7z (264 Bytes, 5 views)
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote
Old March 22nd, 2012, 12:36   #324
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Hi,
another my small chip16 intro: sinedots. Very flicked, but we haven't free memory for double buffer.
Attached Files
File Type: rar new_sine.rar (5.1 KB, 21 views)
tronix286 is offline   Reply With Quote
Old March 22nd, 2012, 12:46   #325
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by Prads View Post
Yes it can. I compiled this code:

Code:
void main() {
	var a;
	a = 20;
	if (a > 30) {
		SetBackground(5);
	}
	if (a < 30) {
		SetBackground(10);
	}
}
and it was able to compile it. I will attach the binary it compiled.
Here's the source code repo for the compiler: http://code.google.com/p/chip16-dev-kit/

EDIT: Oh and the binary it compiles to is spec 1.0. That is the one without the header...
Very cool! I will have to check out the source code (pun intended!) I am into compilers
paul_nicholls is offline   Reply With Quote
Old March 22nd, 2012, 12:47   #326
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by tronix286 View Post
Hi,
another my small chip16 intro: sinedots. Very flicked, but we haven't free memory for double buffer.
Thanks for sharing, I will try it out later on...
paul_nicholls is offline   Reply With Quote
Old March 22nd, 2012, 12:49   #327
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Quote:
Originally Posted by tronix286 View Post
Hi,
another my small chip16 intro: sinedots. Very flicked, but we haven't free memory for double buffer.
Wow, that looks awesome.
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote
Old March 22nd, 2012, 15:02   #328
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Quote:
Originally Posted by tronix286 View Post
Hi,
another my small chip16 intro: sinedots. Very flicked, but we haven't free memory for double buffer.

I'll see if there's room for any optimisation in the code... but THAT's what I call a demo!

@Prads: if you can't be arsed to do the header generation, you can just call my cmd line utility in your IDE if you want.
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote
Old March 22nd, 2012, 15:08   #329
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Thats awesome! looks even more wicked (and less flickery) with vsync off lol
__________________

http://www.pcsx2.net
Intel i7 920 @ 3.4Ghz, POV GTX 570 1.3Gb, 1.8Tb HD space, 6Gb OCZ Reaper PC3-14400 Triple Channel
Dont PM me for help, use the forums, thats what its for!


My Chip16 Emulator RefChip16 http://code.google.com/p/refchip16/
refraction is offline   Reply With Quote
Old March 22nd, 2012, 20:35   #330
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by refraction View Post
thats awesome! Looks even more wicked (and less flickery) with vsync off lol
+100
paul_nicholls is offline   Reply With Quote
Old March 23rd, 2012, 03:14   #331
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
@tykel: I have a question about your tchip16 assembler

Quote:
# IMPORTBIN -- importbin filename offset n label
Allows you to import a binary file, which will be appended verbatim at the end of
the code. They are stored in the order they are imported.
Imported: filename, from address offset to (offset+n), written from address label
in the ROM.
I don't understand what the offset+n and the lable part is used for...

Why the offset and the label? Couldn't one just do this sort of thing?

inport a file at label "MySprite" in the assembly
Code:
MySprite: importbin myfile.bin
paul_nicholls is offline   Reply With Quote
Old March 23rd, 2012, 04:47   #332
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Quote:
Originally Posted by tykel View Post
@Prads: if you can't be arsed to do the header generation, you can just call my cmd line utility in your IDE if you want.
Yeah that sounds like a good idea. Thanks...
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote
Old March 23rd, 2012, 12:03   #333
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Quote:
Originally Posted by paul_nicholls View Post
@tykel: I have a question about your tchip16 assembler



I don't understand what the offset+n and the lable part is used for...

Why the offset and the label? Couldn't one just do this sort of thing?

inport a file at label "MySprite" in the assembly
Code:
MySprite: importbin myfile.bin
The offset is used if you want to import only part of a file (like the 2nd half), or if you want to import it in pieces in different order.
The label simply means, "import all this at label MySprite".

Now, your syntax also makes sense. The reason I have it the way it is:
- It's simpler to code
- It means all the imports are grouped together at the top of the file, facilitating readability.

However, I guess if you want to import something and have more code afterwards, or some db's, then you currently hit a rock.
I'll probably add it to the next release (next week).
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote
Old March 23rd, 2012, 12:13   #334
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by tykel View Post
The offset is used if you want to import only part of a file (like the 2nd half), or if you want to import it in pieces in different order.
The label simply means, "import all this at label MySprite".

Now, your syntax also makes sense. The reason I have it the way it is:
- It's simpler to code
- It means all the imports are grouped together at the top of the file, facilitating readability.

However, I guess if you want to import something and have more code afterwards, or some db's, then you currently hit a rock.
I'll probably add it to the next release (next week).
Ok, thanks for the explanation tykel...it is clear now
If you could add it whenever, that would be great.

Well, I am going to have a play with the assembler and see what I can come up with (I'm not too familiar with chip16 asm yet! haha)
paul_nicholls is offline   Reply With Quote
Old March 23rd, 2012, 12:31   #335
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Quote:
Originally Posted by paul_nicholls View Post
Ok, thanks for the explanation tykel...it is clear now
If you could add it whenever, that would be great.

Well, I am going to have a play with the assembler and see what I can come up with (I'm not too familiar with chip16 asm yet! haha)
You should probably start by understanding how some of the other demos work then -- all the sources are there, waiting for you

You should start with simple ones, like Maze, Anim, Pong, PaletteFlip, GB16.
Then you can move on to less trivial ones, like AdsrDemo, Herdle, Reflection, or SineDots. Shendo's are well commented.

Most of the assembly syntax should be explained in the README anyway
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote
Old March 23rd, 2012, 13:24   #336
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Yeah, I will have a closer look at the demos
paul_nicholls is offline   Reply With Quote
Old March 23rd, 2012, 20:50   #337
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by Prads View Post
Wow, that looks awesome.
Quote:
Originally Posted by tykel View Post

I'll see if there's room for any optimisation in the code... but THAT's what I call a demo!
Thanks for watching and comments Maybe we should think about addressing more than 64K? For examlple, two video layers - current frame buffer and second "hidden" double buffer... Or, just another 64K for data and switch between them.

So, something like this:
Code:
bnk 0             ; select first mem bank, it's "code" section . By default.
ldm r0, X        ; load X in r0 register

bnk 1             ; select "second" mem bank, it's "data" section
stm r0, #0001 ; store r0 at 64K+#0001;
Now iam working on the effect of a burning flame. BTW, if you are interesting, some demo effects from 1996-2000 written by myself on borland pascal+assembler: http://www.youtube.com/watch?v=RDAeZm3W9kQ

PS: Sorry for my terrible english ((
tronix286 is offline   Reply With Quote
Old March 23rd, 2012, 22:16   #338
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Quote:
Originally Posted by tronix286 View Post
Thanks for watching and comments Maybe we should think about addressing more than 64K? For examlple, two video layers - current frame buffer and second "hidden" double buffer... Or, just another 64K for data and switch between them.

So, something like this:
Code:
bnk 0             ; select first mem bank, it's "code" section . By default.
ldm r0, X        ; load X in r0 register

bnk 1             ; select "second" mem bank, it's "data" section
stm r0, #0001 ; store r0 at 64K+#0001;
Now iam working on the effect of a burning flame. BTW, if you are interesting, some demo effects from 1996-2000 written by myself on borland pascal+assembler: http://www.youtube.com/watch?v=RDAeZm3W9kQ

PS: Sorry for my terrible english ((
Well, there are always more things we can add, and that is one of them, although I have a few others too...

BUT, the priorities right now are: 1) get people emulating spec 1.1, with full support for everything, and 2) make more games/demos which make use of the current instruction set.

So no more instructions for a little while.

BTW, nice demos Tronix, mostly Pascal or Assembler? How difficult to port are they?

EDIT: Actually, a number of things still need to be done:
- Make a Wikipedia page for Chip16
- Possibly a forum with separate threads for emu's, games, ideas and stuff.
I think visibility is still a problem here. I mean, Chip16 was mentioned on a french tutorial website, and that gave us a whole load of hits (including BestCoder I think). We need some page in English that's easy to find.
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64

Last edited by tykel; March 23rd, 2012 at 23:57..
tykel is offline   Reply With Quote
Old March 26th, 2012, 20:33   #339
ShendoXT
Moderator
 
ShendoXT's Avatar
 
Join Date: Feb 2006
Location: Croatia
Posts: 4,547
As everyone said already, amazing demo Tronix286.
I've checked the Youtube video also and I really like it. Would be cool to see those demos on Chip16
__________________
Shendo's software blog

Core i5 2400 3.1 Ghz | ASRock H67M | GTX460 768Mb | 8GB DDR3 1333 | 1500 Gb HDD
Grundig VLC 7121 C (1080p) 32" | Razer DeathAdder | Logitech G110 | Windows 7 x64

Don't PM or ask me about VMP-MCR conversions. I will ignore you if you do.
ShendoXT is offline   Reply With Quote
Old March 26th, 2012, 22:50   #340
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Very nice demo Tronix286!
I know that the spec is fixed, but I think one little thing would make demos/games much easier to program with the Chip16 - being able to access the video buffer as direct memory accessing, and not just sprites.

Just my $0.02
paul_nicholls is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 14:28.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.