int base = 10;
int alt = 0;
int fwidth = 0;
- int padc = ' ';
+ char padc = ' ';
int sign = 0;
int left_align = 0; /* not implemented yet */
int hex_caps = 0;
slen = strlen(conv_buf);
for(i=slen; i<fwidth; i++) {
- bwrite(BUF(buf), SZ(sz), (char*)&padc, 1);
+ bwrite(BUF(buf), SZ(sz), &padc, 1);
cnum++;
}
slen = strlen(str);
for(i=slen; i<fwidth; i++) {
- bwrite(BUF(buf), SZ(sz), (char*)&padc, 1);
+ bwrite(BUF(buf), SZ(sz), &padc, 1);
cnum++;
}
bwrite(BUF(buf), SZ(sz), str, slen);
#include "serial.h"
#include "mem.h"
#include "amigalib.h"
+#include "debug.h"
int init_mem(void)
{
struct alib_memnode *mem;
+ printf("chip memory top: %lx\n", (unsigned long)execbase->chipmem_top);
+
+ printf("memlist head node:\n");
+ memdump(execbase->memlist.head, sizeof(struct alib_memnode));
+
printf("Memory ranges:\n");
mem = execbase->memlist.head;
while(mem->n_next) {
--- /dev/null
+#include <stdio.h>
+#include <ctype.h>
+#include "debug.h"
+
+void memdump(void *ptr, int len)
+{
+ int i;
+ unsigned char *p = ptr;
+
+ while(len > 0) {
+ printf("%06lx ", (unsigned long)p);
+ for(i=0; i<16; i++) {
+ if(len - i <= 0) {
+ printf(" ");
+ } else {
+ printf(" %02x", (unsigned int)p[i]);
+ }
+ if((i & 7) == 7) putchar(' ');
+ }
+ printf(" |");
+ for(i=0; i<16; i++) {
+ if(len - i <= 0) {
+ putchar(' ');
+ } else {
+ putchar(isprint(p[i]) ? p[i] : '.');
+ }
+ }
+ printf("|\n");
+ len -= 16;
+ p += 16;
+ }
+}
--- /dev/null
+#ifndef DEBUG_H_
+#define DEBUG_H_
+
+void memdump(void *ptr, int len);
+
+#endif /* DEBUG_H_ */
--- /dev/null
+#!/bin/sh
+
+port=`cat fs-uae.conf | grep serial_port | awk '{ print $3; }'`
+if [ -z "$port" ]; then
+ echo "fs-uae.conf doesn't include a serial_port config option"
+ exit 1
+fi
+
+socat pty,raw,echo=0,link=$port -,raw,echo=0