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 July 17th, 2012, 14:52   #561
sbeng
Registered User
 
Join Date: Feb 2009
Location: Italy
Posts: 27
Ok done
sbeng is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old July 17th, 2012, 15:26   #562
Leandro Jardim
Registered User
 
Join Date: Jun 2012
Location: Brazil/Paraná
Posts: 4
Hi everyone.

I am going to try some modifications on the Chip8/Chip16 instruction set. I am interested in orthogonality, an uncommon topic perhaps by being a bit theoretic, but I dont know how to do it.

I would like to know, if on the production of an instruction set, the arrangement of the opcodes is needed for the machine which its running (for dispatch optimization, etc). For example, I should order the opcodes in groups by operation (store, load...) or by operands (for example by argument count, to simplify argument decoding).

To make it clear, see this where all opcodes FLIP are grouped by the last byte:

Code:
08 00 00 00	FLIP 0, 0		Set flip orientation for sprites. horizontal flip = false; vertical flip = false
08 00 00 01	FLIP 0, 1		Set flip orientation for sprites. horizontal flip = false; vertical flip = true
08 00 00 02	FLIP 1, 0		Set flip orientation for sprites. horizontal flip = true;  vertical flip = false
08 00 00 03	FLIP 1, 1		Set flip orientation for sprites. horizontal flip = true;  vertical flip = true
Well, this is not the case, but would make sense for a machine to separate the opcodes by opcode similarity and argument count?

I hope this is not a uninteresting question...

Last edited by Leandro Jardim; July 17th, 2012 at 19:44..
Leandro Jardim is offline   Reply With Quote
Old July 23rd, 2012, 11:22   #563
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Hi all!

There are final version of my little chip16 intro: sinedots
  • no more flicked (i am using sprite 320x240 for frame buffer);
  • intro size is less then 4Kb (i am replaced font and string draw procedures by static sprite);
  • nice "coder's" colors -))

Enjoy!
Attached Images
File Type: png dots2.png (37.8 KB, 17 views)
Attached Files
File Type: zip sdots_final.zip (4.3 KB, 1 views)
__________________

Last edited by tronix286; July 26th, 2012 at 09:10..
tronix286 is offline   Reply With Quote
Old July 23rd, 2012, 14:12   #564
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by tronix286 View Post
Hi all!

There are final version of my little chip16 intro: sinedots
  • no more flicked (i am using sprite 320x240 for frame buffer);
  • intro size is less then 4Kb (i am replaced font and string draw procedures by static sprite);
  • nice "coder's" colors -))

Enjoy!
Nicely done mate!
paul_nicholls is offline   Reply With Quote
Old July 23rd, 2012, 15:18   #565
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Nice one tronix! Now I'm back from my honeymoon I might work on finishing my crappy fighting game 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 July 23rd, 2012, 19:57   #566
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Thanks refraction, paul_nicholls!
Yet another sine-table demo caled sine flag -)) For best viewing enable "Recompiler" and disable "Vertical sync" options in Refchip emulator. Otherwise demo speed is very slow (many math calculations).
Attached Images
File Type: png sineflag.png (20.1 KB, 13 views)
Attached Files
File Type: zip sineflag.zip (2.3 KB, 12 views)
__________________

Last edited by tronix286; July 26th, 2012 at 09:11..
tronix286 is offline   Reply With Quote
Old July 24th, 2012, 08:33   #567
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Quote:
Originally Posted by tronix286 View Post
For best viewing enable "Recompiler" and disable "Vertical sync" options in Refchip emulator. Otherwise demo speed is very slow (many math calculations).
Disable vertical sync?? THAT'S CHEATING!!

Haha kidding, very nice as usual
__________________
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 July 26th, 2012, 11:02   #568
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by tykel View Post
Haha kidding, very nice as usual
Thanks tykel! BTW i found bug in your javascript emu. You shold declare registers array as unsigned int 16, not signed:

Code:
    r = new Uint16Array(reg),
If you fix it your emu can run mandel.c16, dots2.c16 and sineflag.c16 normaly.
__________________
tronix286 is offline   Reply With Quote
Old July 26th, 2012, 12:34   #569
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Quote:
Originally Posted by tronix286 View Post
Thanks tykel! BTW i found bug in your javascript emu. You shold declare registers array as unsigned int 16, not signed:

Code:
    r = new Uint16Array(reg),
If you fix it your emu can run mandel.c16, dots2.c16 and sineflag.c16 normaly.
Thank you, this works.

May I ask why though? The spec does say registers are supposed to be signed no?
__________________
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 July 26th, 2012, 13:22   #570
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by tykel View Post
May I ask why though? The spec does say registers are supposed to be signed no?
int16 has minimum value −32,768 and maximum value +32,767 so what happens if i multiple 160 by 320? I expect to receive 51200, right? But i get an overflow and wrong result.

Our chip16 processor uses Sign-and-magnitude method and we don't need control signed or unsigned numbers curently used. For example, at current emulator cycle we need addiction r0 and r1:
r0 = 1001 (binary)
r1 = 0001 (binary)

1001 add 0001 = 1010
What is 1010 (decimal) ? It's -2 or +10? At "hardware" level we don't know. It's controlled by application programmer, how interpreted this value.
__________________

Last edited by tronix286; July 26th, 2012 at 13:28..
tronix286 is offline   Reply With Quote
Old July 26th, 2012, 16:01   #571
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
right guys im going on a refchip16 fixing spree tonight, so if you know of any bugs, let me know now and ill get them sorted.

I know about not drawing the top line or the line down the left hand side, that's already fixed in the repo (altho im going to modify it again as its technically able to overflow the array atm).

If you know of any others i will get them sorted
__________________

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 July 27th, 2012, 07:46   #572
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by refraction View Post
right guys im going on a refchip16 fixing spree tonight, so if you know of any bugs, let me know now and ill get them sorted.

I know about not drawing the top line or the line down the left hand side, that's already fixed in the repo (altho im going to modify it again as its technically able to overflow the array atm).

If you know of any others i will get them sorted
Here's a bug: when I ran my Boing demo in refchip16 with the re-compiler activated, I get no graphics only a grey screen...
paul_nicholls is offline   Reply With Quote
Old July 27th, 2012, 07:55   #573
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by refraction View Post
right guys im going on a refchip16 fixing spree tonight, so if you know of any bugs, let me know now and ill get them sorted.

If you know of any others i will get them sorted
Quote:
Originally Posted by paul_nicholls View Post
Here's a bug: when I ran my Boing demo in refchip16 with the re-compiler activated, I get no graphics only a grey screen...
refraction: my tip: please control SP pointer overflow (if SP => 0xFFFF then show SP overbound error message).
__________________
tronix286 is offline   Reply With Quote
Old July 27th, 2012, 08:50   #574
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Cool cheers Guys ill do them

Tronix: what I might do for that is add a developer output mode which has a console window displaying problems. Not sure what else to add at the moment but I don't really want popups as it might get annoying

Edit: the "Boing" bug might already be fixed in the latest revision, but havent done a release yet (as i have these other little bits to do)

also im going to write a small sprite flipping test which you can move a square around, i need to test sprites going off the edges of the screen, i dont think my code is working quite correctly.
__________________

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/

Last edited by refraction; July 27th, 2012 at 13:36..
refraction is offline   Reply With Quote
Old July 27th, 2012, 14:34   #575
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by refraction View Post
Tronix: what I might do for that is add a developer output mode which has a console window displaying problems. Not sure what else to add at the moment but I don't really want popups as it might get annoying
Yes, you're right. Debug console window is optimal way.

2all : new oldschool demo named twisting bar or simply twister ready. Still have speed issues. For best viewing enable "Recompiler" and disable "Vertical sync" options in Refchip emulator. Enjoy!
Attached Images
File Type: png twister2.png (4.1 KB, 11 views)
Attached Files
File Type: zip twister.zip (7.6 KB, 4 views)
__________________
tronix286 is offline   Reply With Quote
Old July 27th, 2012, 17:13   #576
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
@tronix: Very nice as always I particularly like the palette shifting on the text!

I might as well post something I made a little while ago, hoping I could optimise it further (didn't!).
It's a classic oldschool plasma effect, and uses a lookup table for obvious reasons. Performance is acceptable at stock speed, but obviousdly looks better derestricted!

plasma.png

On that note, let's try to keep our demos running smoothly at 1 Mhz... there's a challenge :P
Attached Files
File Type: zip Plasma.zip (14.1 KB, 3 views)
__________________
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 July 27th, 2012, 17:18   #577
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
These demos are very cool, but I'd like to see some more games come out

Edit as to not double post:

I've written a little test ROM which allows you to flip a sprite and move it around the screen, good for testing sprites going off the edge of the screen and again when they are flipped, i had a few bugs with this which is why i made it (one of them being i had unsigned GPR registers so X and Y co-ordinates were never less than zero)

usual keys, A and B to flip (tells you onscreen) and d pad to move about

refchip16 1.46 coming soon with all the fixes in, will let you know when.
Attached Images
File Type: jpg flipscreentest.jpg (45.4 KB, 14 views)
Attached Files
File Type: 7z flipoffscreen_test.7z (3.0 KB, 2 views)
__________________

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/

Last edited by refraction; July 28th, 2012 at 13:51..
refraction is offline   Reply With Quote
Old July 28th, 2012, 13:52   #578
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
RefChip16 has been upgraded to 1.46!

Should fix all known bugs plus a few i had issues with ;p

tronix286: I haven't made a new developer window, truth be told i such at WinAPI but what i have done is made it so it logs it, also logging is enabled/disabled via the settings menu now so no need to recompile the emu at all.

Grab from the usual googlecode place, enjoy ;p

(sorry for double post but it was more important this didn't get lost in my wall of text! )
__________________

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 July 29th, 2012, 10:06   #579
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
RefChip16 1.46 had gotten rid of the recompiler bug with my demo...yay!
paul_nicholls is offline   Reply With Quote
Old July 29th, 2012, 12:03   #580
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Quote:
Originally Posted by paul_nicholls View Post
RefChip16 1.46 had gotten rid of the recompiler bug with my demo...yay!
Indeed I did and your demo is very impressive! You have physics and everything xD
__________________

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
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 11:44.

© 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.