IO expander programs

master
Astoria 2 years ago
parent da2da87ea3
commit 6e06a2489c

@ -0,0 +1,35 @@
LD = ../bin/ld65
AS = ../bin/ca65
CC = ../bin/cc65
AL = ../bin/align
CINCLUDE = -I../include
CFLAGS = -t none --cpu $(CPU)
LFLAGS = -C ../lib/rpc8e.cfg
LLIBS = ../lib/rpc8e.lib
#gonna leave this here for now
CPU = 65c02
IMAGES = test_iox.img
.PHONY: all
all: $(IMAGES)
%.s: %.c
$(CC) $(CFLAGS) $(CINCLUDE) $<
%.o: %.s
$(AS) $(CFLAGS) $<
%.img: %.o
$(LD) $(LFLAGS) $< $(LLIBS) -o $@
$(AL) $@
clean:
rm *.o *.s
.SUFFIXES:

@ -0,0 +1,30 @@
#include "conio.h"
#include <string.h>
#define redbus 0x0300
int conid = 0x01;
void conprint(char str[], int x, int y, int mode){
con = (Console*)redbus;
rb_map_device(conid);
str_size = strlen(str);
con->cursor_mode = mode;
line = y;
con->line = line;
for (i = 0; i < str_size; i++){
if (((y % 50) + (x + i) / 80) != line) {
line = (y % 50) + (x + i) / 80;
con->line = line;
}
con->display[(int)(x + i) % 80] = str[i];
}
}
void set_conid(int id){
conid = id;
}
int get_conid(){
return conid;
}

@ -0,0 +1,5 @@
int i;
int line;
int str_size;
Console* con;
void conprint(char str[], int x, int y, int mode);

@ -0,0 +1,24 @@
//test_iox.c
#include <redbus.h>
#include <console.h>
#include <iox.h>
#include "test_iox.h"
#include <string.h>
#include "conio.c"
#define redbus 0x0300
#define IOXID 0x03
Iox* expand;
int* output;
void main() {
rb_set_window((void*)redbus);
rb_enable();
expand = (Iox*)redbus;
rb_map_device(IOXID);
expand->out = 0;
output = (int*)expand->in;
conprint("very Nice", 40, 25, 3);
}
Loading…
Cancel
Save