Do you know any good doc on z80, I saw some things in your code which I thought cannot be done on z80 that way.
In the 2ch mixing, of course i do it at each sample, you need to do it since your sample can be located in different bank...
I've a very nice Z80 document, i used it a lot to code my CZ80 core, specially to implement undocumented opcodes and flags.
I guess you're talking about the XH and YH use in my code ? i think i'm using an unofficial opcode but they are supported on all Z80 type CPU so no problems
Last edited by Stef on Fri Feb 16, 2007 8:38 am, edited 1 time in total.
TmEE co.(TM) wrote:I knew about XH, XL... but I saw LD DE, (ASDFGH) (<-reg maybe incorrect), I thought that you can only use A or HL (and X, Y) for memory stuff
I know AS assembler is sometime taking shorter in mnemonic.
For instance it accept LD BC, DE even if that's not a valid mnemonic (internally it does LD B, D and LD C, E).
but about LD DE, (var)
actually this is a valid instruction (taking 20 cycles where LD HL, (var) takes only 16 cycles)
TmEE co.(TM) wrote:OK, now I see, I prefer to use faster stuff
This code is used at init time, just to keep the sample address in DE register
By the way, you can freely modify the source for your needs. All improvements are welcome also
I think I'm going to use some things, you know more advanced stuff than I. I looked at your code, and I think, I could not make it faster.
Is usage of X and Y slower than HL ?
TmEE co.(TM) wrote:I think I'm going to use some things, you know more advanced stuff than I. I looked at your code, and I think, I could not make it faster.
Is usage of X and Y slower than HL ?
I think there is always way to improve it, not necessary on speed, but maybe on feature as loop playing :p
Using X and Y permit me to avoid a memory access so i gain some cycles here yeah
I finally rewrote my 2 samples player z80 driver. I improved it : we can now stop a sample currently played :p Unfortunatly i definitly can't touch 16 Khz playback, i'm stuck at something close to ~14 Khz.
Pascal wrote:kick ass !!! thanks !!! can i use the driver only in my game project ?
You can use anything as you want of course I put it in the mini devkit because it's common to have it here but you can use freely all part as you want (and then include some part of source in your project).