> 1. How does the pallet and the pen work? What's the virtual pallet?
MAME internally renders to a 16-bit wide buffer. However, in most cases, it's treated as paletted, with up to 65,534 colors (white and black are reserved by the UI). A "pen" is an individual palette color.
> 2.Input adjust do what?
Don't know what you're talking about here.
> 3.What's the Hold and Assert interrupt?
"Hold" means an interrupt is held until the CPU acks it, and then it's automatically lowered. "Assert" means the interrupt is asserted until the driver de-asserts it.
> 4.Input and interrupt process is in vblank callback,so it's not real time
MAME reads the inputs once per frame (during emulated vblank). Interrupts can occur at any time during the emulated frame for e.g. raster effects on NeoGeo.
> 5.Can you tell me the detail of the pallet process(includes adjust pallet, dirty
> pen etc) and gfx process?Here is too complex.
This seems like a duplicate of your question above.
> BTW:Who's the author of drawgfx.c?It includes itself several times to generate
> diffierent functions. But it's the best way?I think there should be better way
> and write the more readable code.:)
It's not intended to be readable, and in fact you don't have to know a thing about the internals of drawgfx to successfully write a driver.
> 6. How does the sounds work? Can you give me a sample?
You need to understand basic digital audio terminology before we can start on this and I'm not sure you do.
Again, you'll get better/faster answers on the MAME.net messageboards and your same login from here works there.