Commit afdd4dc8 authored by Scott Duensing's avatar Scott Duensing

Fixed vector images and other misc stuff.

parent 750c0733
......@@ -25,10 +25,6 @@
SHRShad gequ $012000
;savedDBR data ; Storage for Data Bank Register
; ds 2 ; 16 bits
; end ; Used by jIIgs.macro
ScanTable data
ds 400 ; 400 bytes for scanline offsets
end
......
......@@ -68,8 +68,6 @@
; === START OF OUR MODIFICATION ===
phb ; Push Data Bank Register
phb ; Push Data Bank Register
; pla ; Pull Accumulator
; sta >savedDBR ; Store Accumulator in savedDBR (Data Bank Register)
phk ; Push K (Program Bank Register)
plb ; Pull Data Bank Register
; === END OF OUR MODIFICATION ===
......@@ -82,9 +80,6 @@
&lab anop
; === START OF OUR MODIFICATION ===
; using savedDBR
; lda >savedDBR ; Load our saved Data Bank Register
; pha ; Push the C Accumulator
plb ; Pull Data Bank Register
plb ; Pull Data Bank Register
; === END OF OUR MODIFICATION ===
......
......@@ -45,9 +45,6 @@
#define COMMAND_FBOX 9 // S (Solid Box)
#define COMMAND_FILLTO 10 // T (FillTo)
#define VEC_SCALE_DOWN 0.8 // 256/320
#define VEC_SCALE_UP 1.25 // 320/256
typedef struct {
jint16 StartX;
......@@ -63,8 +60,7 @@ typedef struct {
byte _jlDrawColor = 15; // Color in lower nibble only
byte _jlDrawColorNibbles = (15 << 4) + 15; // Color in both nibbles
byte _jlBorderColor = 0;
char *_jlAppName = NULL;
char _jlTempString[1024];
char _jlTempString[1024]; // Used internally for pathname operations
static jlColorT _jlDefaultPalette[16];
......@@ -657,8 +653,9 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_PLOT:
count = vec->data[p++];
for (i=0; i<count; i += 2) {
x1 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
for (i=0; i<count; i++) {
x1 = ox + vec->data[p++];
x1 = x1 + (jint16)(vec->data[p++] << 8);
y1 = oy + vec->data[p++];
jlDrawPoint(x1, y1);
}
......@@ -666,10 +663,12 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_LINE:
count = vec->data[p++];
x1 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
x1 = ox + vec->data[p++];
x1 = x1 + (jint16)(vec->data[p++] << 8);
y1 = oy + vec->data[p++];
for (i=2; i<count; i += 2) {
x2 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
for (i=1; i<count; i++) {
x2 = ox + vec->data[p++];
x2 = x2 + (jint16)(vec->data[p++] << 8);
y2 = oy + vec->data[p++];
jlDrawLine(x1, y1, x2, y2);
x1 = x2;
......@@ -679,8 +678,9 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_FILL:
count = vec->data[p++];
for (i=0; i<count; i += 2) {
x1 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
for (i=0; i<count; i++) {
x1 = ox + vec->data[p++];
x1 = x1 + (jint16)(vec->data[p++] << 8);
y1 = oy + vec->data[p++];
jlDrawFill(x1, y1);
}
......@@ -688,7 +688,7 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_PALETTE:
count = vec->data[p++];
for (i=0; i<count; i += 4) {
for (i=0; i<count; i++) {
x1 = vec->data[p++];
y1 = vec->data[p++];
x2 = vec->data[p++];
......@@ -703,10 +703,12 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_HBOX:
count = vec->data[p++];
for (i=0; i<count; i += 4) {
x1 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
for (i=0; i<count; i++) {
x1 = ox + vec->data[p++];
x1 = x1 + (jint16)(vec->data[p++] << 8);
y1 = oy + vec->data[p++];
x2 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
x2 = ox + vec->data[p++];
x2 = x2 + (jint16)(vec->data[p++] << 8);
y2 = oy + vec->data[p++];
jlDrawBox(x1, y1, x2, y2);
}
......@@ -714,10 +716,12 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_FBOX:
count = vec->data[p++];
for (i=0; i<count; i += 4) {
x1 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
for (i=0; i<count; i++) {
x1 = ox + vec->data[p++];
x1 = x1 + (jint16)(vec->data[p++] << 8);
y1 = oy + vec->data[p++];
x2 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
x2 = ox + vec->data[p++];
x2 = x2 + (jint16)(vec->data[p++] << 8);
y2 = oy + vec->data[p++];
jlDrawBoxFilled(x1, y1, x2, y2);
}
......@@ -725,8 +729,9 @@ void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
case COMMAND_FILLTO:
count = vec->data[p++];
for (i=0; i<count; i += 2) {
x1 = ox + (jint16)(vec->data[p++] * VEC_SCALE_UP);
for (i=0; i<count; i++) {
x1 = ox + vec->data[p++];
x1 = x1 + (jint16)(vec->data[p++] << 8);
y1 = oy + vec->data[p++];
x2 =vec->data[p++];
jlDrawFillTo(x1, y1, (byte)x2);
......
......@@ -58,10 +58,16 @@ int main(void) {
jlStaT *kanga = NULL;
jlStaT *font = NULL;
jlVecT *vec = NULL;
jint16 y;
jlUtilStartup("JoeyLib Test");
jlVecLoad(vec, "nowhere");
jlVecDisplay(vec, 0, 0);
jlDisplayPresent();
jlKeyWaitForAny();
jlStaLoad(kanga, "kanga");
jlStaLoad(font, "font");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment