dd if=/dev/zero of=$@ bs=512 count=2880
dd if=$< of=$@ conv=notrunc
+pcboot.iso: floppy.img
+ rm -rf cdrom
+ git archive --format=tar --prefix=cdrom/ HEAD | tar xf -
+ cp $< cdrom
+ mkisofs -o $@ -V pcboot -b $< cdrom
+
+
boot.img: bootldr.bin $(bin)
cat bootldr.bin $(bin) >$@
interrupt(IRQ_TO_INTR(irq), intr_handler);
+ write_dsp(CMD_ENABLE_OUTPUT);
sb_set_output_rate(rate);
start_dma_transfer(addr, size);
- write_dsp(CMD_ENABLE_OUTPUT);
}
void sb_pause(void)
dma_out(dma_chan, addr, size, DMA_SINGLE);
/* program the DSP to accept the DMA transfer */
- write_dsp(CMD_START_DMA8 | CMD_FIFO);
+ write_dsp(CMD_START_DMA8);
write_dsp(xfer_mode);
size--;
write_dsp(size & 0xff);
mask(chan);
outb(0, DMA_CLR_FLIPFLOP(chan));
- /* single / block / cascade */
- mode = ((flags & 3) << 6) | MODE_CHAN(chan);
+ /* first 2 bits of flags correspond to the mode bits 6,7 */
+ mode = ((flags & 3) << 6) | dir | MODE_CHAN(chan);
if(flags & DMA_DECR) mode |= MODE_DECR;
if(flags & DMA_AUTO) mode |= MODE_AUTO;
outb(mode, DMA_MODE(chan));
/* set an interrupt handler function for a particular interrupt */
void interrupt(int intr_num, intr_func_t func)
{
+ int iflag = get_intr_flag();
+ disable_intr();
intr_func[intr_num] = func;
+ set_intr_flag(iflag);
}
/* this function is called from all interrupt entry points
if(read_dev_info(&info, busid, dev, 0) == -1) {
return 0;
}
- print_dev_info(&info, busid, dev, 0);
+ /*print_dev_info(&info, busid, dev, 0);*/
count = 1;
if(read_dev_info(&info, busid, dev, i) == -1) {
continue;
}
- print_dev_info(&info, busid, dev, i);
+ /*print_dev_info(&info, busid, dev, i);*/
count++;
}
}
static int click_sound_callback(void *buffer, int size, void *cls)
{
if(click) {
- int i;
- signed char *ptr = buffer;
- signed char *src = snd_click;
- /*
- for(i=0; i<size; i++) {
- if((i / 32) & 1) {
- *ptr++ = -64;
- } else {
- *ptr++ = 64;
- }
- }
- */
- /*memcpy(buffer, snd_click, snd_click_size);*/
-
- for(i=0; i<snd_click_size; i++) {
- *ptr++ = *src++;
- }
-
+ memcpy(buffer, snd_click, snd_click_size);
click = 0;
return snd_click_size;
}