Next Generation Emulation banner
1 - 20 of 233 Posts

·
PCSX2 Coder
Joined
·
10,122 Posts
Wow that was unexpected! Big shame he doesn't want to continue :( thanks for all your work shendo, hopefully those of us who contribute will make you proud :)

Congrats on your new position tykel :)
 

·
PCSX2 Coder
Joined
·
10,122 Posts
As this is supposed to be somebodies first emulator (a bit more in depth than chip8 anyway) so we dont want anything too complex for sound. A simple tone with pitch/length control is more than enough imo.
 

·
PCSX2 Coder
Joined
·
10,122 Posts
The biggest issue is all existing ops will need rewriting if we don't keep the existing ones.

how many roms use SND0? If none, we can just replace that one, keep the others for compatibility
 

·
PCSX2 Coder
Joined
·
10,122 Posts
The intention was so you have more choice of tones for movement, death noses or maybe a short ditty. Not expecting any maestros here. And sound wave tone is fine imo :)
 

·
PCSX2 Coder
Joined
·
10,122 Posts
Maze is best to show this, I did something like

V =(rand()%HHLL+1)-1

If you don't do the minus 1 it can go out of range requested

Update:

This is what i do exactly

randval = rand() % ((unsigned short)IMMEDIATE+1); //Apparently if IMMEDIATE is 1, it always generates 0 o_O
//Need to make sure result isnt 0 and is in range.
if(randval > IMMEDIATE) randval -= 1;
REG_X = randval;
 

·
PCSX2 Coder
Joined
·
10,122 Posts
Hey all,
I am thinking of trying to make my own emulator, and I am unsure as how to do 'correct' timing in the CPU. The spec says that the CPU is 1MHz, which is 1uS per CPU update.

First, this seems much quicker than I might get a software timer to give me a time between updates, so I am unsure how I am going to get an 'accurate' count (ignoring Windows not being a true multi-tasking OS).
I've kinda done it a cheaty way in my emulator, but it works.

Every cycle i add 1 to "cycles" variable, but i also have another variable called "nextvsync" and every time cycles == nextvsync i add (1000000 / 60) on to nextvsync. It seems to work ok :p

Then to stop it going to fast, im actually using Direct3D, so i have told it to enable vertical syncing.

This would be ok on most systems as many use 60hz for their screen these days, but of course once you get someone whos got a 120hz monitor, id be screwed xD so in the end ill probably have to resort to QueryPerformanceCounter()
 

·
PCSX2 Coder
Joined
·
10,122 Posts
As I think I've said previously, if you need custom wait times you can write a number to a register and do a sub then compare zero cond, hell you could even do other stuff then like

Compare test reg
Inst
Inst
Inst
Sub 5 from test reg
Compare test reg

It's handy knowing each Inst is 1 cycle :p
 

·
PCSX2 Coder
Joined
·
10,122 Posts
Very true but if you are doing background music or sound, the game will have to pause while the sound plays, which could be a little annoying if its a long sound :p tho I guess you don't have to use it
 

·
PCSX2 Coder
Joined
·
10,122 Posts
The beginnings of something:
View attachment 216554
Straightforward tilemapping for now, in a hacked CottonCx to use Chris's palette.
A single screen takes 300B just for tiles, so for a full-fledged game some form of compression is necessary, which I have kind of worked out, so hopefully we should have a little game when I'm less busy :)
what if you cheated and ran the game in a smaller window? so it took up say, half the screen (like old spectrum games used to do :p)
 

·
PCSX2 Coder
Joined
·
10,122 Posts
What about sprite rotation? To me, it seems like it would not be hard to implement within the interpreter. It would also allow ROM developers to create cool stuff easier.
Flip instructions are already there :)
 

·
PCSX2 Coder
Joined
·
10,122 Posts
quick question at the fear of looking like an idiot,

does this mean we will only load in to memory the data from the start of the binary? or should the default start address actually be 0020h or 0010h (depending on the 16bit or 32bit header)?
 

·
PCSX2 Coder
Joined
·
10,122 Posts
Sorry I hadn't updated my emulator yet, I wasn't touching it till there was a sound demo available for testing :p. But I can make a start on implementing them if you like?
 

·
PCSX2 Coder
Joined
·
10,122 Posts
Yeah, the more the merrier! :D


Cool, now i have to swat up on audio generation and adsr dsp control, any cool docs/links would be appreciated :p

Edit: nevermind, sounds easy enough and have a Microsoft link on sound generation :)
 

·
PCSX2 Coder
Joined
·
10,122 Posts
Hi refraction, If you hadn't seen it previously, I had posted a demo sound program (including source code) that does ADSR sound generation and was made to test sounds for the new Chip-16 sound specs :)

cheers,
Paul
Hi Paul, i did see, then forgot, but thank you for that! I will be sure to use it in my tests :) i will be using your ADSR settings that you have used here http://forums.ngemu.com/showpost.php?p=2011490&postcount=84 , we should probably include these in the spec.

Edit: Oh talking about the spec not changing, SPU (overview) is in there twice, one with t he new spec, one with the old, should probably remove the old one ;p

Edit 2:

Can you also update the link to my emulator to this post? http://forums.ngemu.com/showpost.php?p=2008479&postcount=50

That one has a dynarec in too, so people can see how to make one of them ;p
 

·
PCSX2 Coder
Joined
·
10,122 Posts
No no I mean the spec has

SPU:
-----
Two options are available:
- Playing one of 3 fixed tones (500 Hz, 1000 Hz, 1500 Hz) for a given number of milliseconds, OR
- Using sound generation options (SNG instruction), play a tone from memory for a given number of milliseconds.

Sound generator options are detailed in the SNG opcode description.

-----------------------Colour stuff in here---------------------------

SPU:
-----
500Hz, 1000Hz and 1500Hz sine wave tone generator.
:p. Nearly done on my sound processing, just adding the pal opcodes and header support then ill need to write some tests..
 
1 - 20 of 233 Posts
Top