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 June 27th, 2012, 04:10   #421
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
I now have sound - at least in the bounce example, I will have to try others
paul_nicholls is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old June 27th, 2012, 05:58   #422
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
I tried the Water.c16 demo found here:
http://forums.ngemu.com/showpost.php...&postcount=397

in my emulator and it does do sound, but I am not sure if the sound is working correctly.

So I tried the water demo in the RefChip16V1.43 binary, but that crashed - Windows7 (64-Bit) said that it had stopped working, no other errors.

Any ideas?
paul_nicholls is offline   Reply With Quote
Old June 27th, 2012, 06:04   #423
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
hmm...all the programs that uses sound seem to be crashing the RefChip16 emulator!!

EDIT: scratch that...ALL chip16 programs seem to be crashing the emulator
Does it support the latest version of the programs with the header, etc.?

This is what I am trying to run...
paul_nicholls is offline   Reply With Quote
Old June 27th, 2012, 06:21   #424
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Besides the crashing, I realized that I had another issue with the sound in the Water.c16 demo...

sound spec for the sng command:

Code:
0E AD SR VT     SNG AD, VTSR   Sound generator (applies to all sound tones which follow).
                                  A = attack  (0..15)
                                  D = decay   (0..15)
                                  S = sustain (0..15, volume)
                                  R = release (0..15)
                                  V = volume  (0..15)
                                  T = type of sound:
                                     00 = triangle wave
                                     01 = sawtooth wave
                                     02 = pulse wave (is just square for now)
                                     03 = noise
                                     non-valid values default to 0 output
In the Water.s source code, it seems to be setting V (volume) as 0 each time, and indeed I was getting no sound untill I hardcoded a volume as a test instead of what was in the V nibble. See the source code below:

Code:
	sng 0x97, 0x02CA			; boat horn noise
	snp ra, 600
	jmp draw
sfx_wave:
	ldi rd, 0
	ldi ra, note_wave
	sng 0xC9, 0x03FC			; wave noise
	snp ra, 1000
The boat horn noise and wave noise are using $0 for volume!!

Last edited by paul_nicholls; June 27th, 2012 at 08:01..
paul_nicholls is offline   Reply With Quote
Old June 27th, 2012, 09:09   #425
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Its still crashing? Aw man.... I thought I caught them all
__________________

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 June 27th, 2012, 09:18   #426
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Paul, download and install this and everything will be alright: http://www.microsoft.com/en-us/downl...s.aspx?id=8109
i.e. it will fix your RefChip16 crashing problem...
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote
Old June 27th, 2012, 10:07   #427
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by Prads View Post
Paul, download and install this and everything will be alright: http://www.microsoft.com/en-us/downl...s.aspx?id=8109
i.e. it will fix your RefChip16 crashing problem...
Interesting...I just tested RefChip16 here at home under Vista Home Premium (32-bit) and it doesn't crash.
It only crashes on my Win7 (64-bit) work machine.

Not sure I feel comfortable installing the update on my work machine LOL

Thanks anyway Prads
paul_nicholls is offline   Reply With Quote
Old June 27th, 2012, 10:24   #428
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
lol No worries.

I have Win7 64-bit too and before updating the DirectX the emu was crashing. Ref and I were talking about the issue via PM and he said to me he used June 2010 version of the SDK to compile the code. Hence the exe crashes if you don't have the June 2010 version of the DirectX redistributable installed.
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote
Old June 27th, 2012, 10:44   #429
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Ah yes, I shouldn't really tell people they need to update directx
__________________

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 June 27th, 2012, 18:39   #430
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
@Refraction: just spotted a bug in PaletteFlip.c16 and, by extension, your emulator.
You have stored the palette entries in little-endian format and reading them as such, whereas the spec states:
Quote:
Originally Posted by spec
Palettes can be stored in 3-byte, RGB format (bytes in that order).
So basically, treat each color component (byte) as an individual number, rather than read it as an integer.
__________________
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 June 27th, 2012, 20:34   #431
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Hmm, you're right. I bodged it together and didn't really think, not helped the fact I suck at demos ill get it fixed asap
__________________

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 June 28th, 2012, 05:44   #432
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
@tykel: I just tried your tchip16 assembler under Win7 (64-bit) and got an error dialog box about a missing DLL:

paul_nicholls is offline   Reply With Quote
Old June 28th, 2012, 16:32   #433
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Yeh it seems to be missing that one then asks for libstdc++-6.dll, i tried getting mingw and associated dlls but it just crashed xD so i ended up rebuilding it with visual studio.

Attaching my exe so you can use that one for the min
Attached Files
File Type: 7z tchip16.7z (33.5 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/
refraction is offline   Reply With Quote
Old June 28th, 2012, 17:12   #434
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Thanks ref, I have updated the file on the downloads page to one built with VS2010.
__________________
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 June 29th, 2012, 04:15   #435
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 433
Okay, here it is, the "surprise" as Shendo put it

It is called Js16. As the name implies, it is a Javascript Chip16 emulator, which runs in your web browser.
It runs all the roms (except Mandel.c16, unsure why), and implements all of spec 1.1 except sound (tricky in JS). It includes a simple debugger too, for good measure.

It should run full speed. You will need a browser which supports html5 (canvas) and some css3, so basically firefox 4+, chrome 10+, ie 9+.

The code needs improving, but hey, it works. I might add some server-side roms too, if downloading them is a hassle.

Why did I do this? There is no chip16 emulator on linux, and this might make it easier for people to try out chip16 and go for it.

js16.png

Have a go here. Link in sig too. It will eventually get moved to its own PCSX2 page.

Feedback appreciated!
__________________
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 June 29th, 2012, 05:05   #436
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Nice! but it isn't working for me. In log it says "Emuation starting..." and stays that way.
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote
Old June 29th, 2012, 08:56   #437
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Very awesome! Good job!

Prads : what browser?
__________________

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 June 29th, 2012, 09:50   #438
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Quote:
Originally Posted by refraction View Post
Very awesome! Good job!

Prads : what browser?
Firefox 13.0

EDIT: Looking at the firefox error console and it says "b is undefined" in chip16.js
__________________
My Programming Projects: www.pradsprojects.com

Last edited by Prads; June 29th, 2012 at 09:59..
Prads is offline   Reply With Quote
Old June 29th, 2012, 10:10   #439
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
Quote:
Originally Posted by Prads View Post
Firefox 13.0

EDIT: Looking at the firefox error console and it says "b is undefined" in chip16.js
hmm which game are you trying to run? it works here on ninja and pacman.
__________________

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 June 29th, 2012, 10:36   #440
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Oh, yeah it's working. I was trying pikachu.c16 (the compiler demo). It gives "Invalid opcode: 0xf" error.
__________________
My Programming Projects: www.pradsprojects.com
Prads 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 00:24.

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