dbpprint.c 471 Bytes
#include <os.h>
#include <bbdebug.h>
#include <rdb.h>

void
__osBbPPutter(void* str, const char* buf, size_t n) {
    int i = 0;

    /* write 1 character at a time */
    while(n > 0) {
	IDE_WRITE(IDE_RDB_DATA_REG+0x400, ((RDB_TYPE_GtoH_PRINT << 2)|1) << 8 | buf[i++]);
	IDE_WRITE(IDE_RDB_CTRL_REG, IDE_RDB_CTRL_SET_BB_REQ);
	while((IDE_READ(IDE_RDB_STATUS_REG) & IDE_RDB_STATUS_HOST_ACK) == 0)
		;
	IDE_WRITE(IDE_RDB_CTRL_REG, IDE_RDB_CTRL_CLR_HOST_ACK);
	n--;
    }
}