Path: utzoo!attcan!uunet!van-bc!ubc-cs!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!crackers!m2c!wpi.WPI.EDU!greyelf From: greyelf@wpi.WPI.EDU (Michael J Pender) Newsgroups: comp.sys.apple2 Subject: Hyperc (more questions) Message-ID: <1990Oct22.215103.14790@wpi.WPI.EDU> Date: 22 Oct 90 21:51:03 GMT Sender: greyelf@wpi.WPI.EDU (Michael J Pender) Organization: Worcester Polytechnic Institute Lines: 106 1. I'm working on interfacing graphics routines to Hyper C, but I can't get the machine language routines to pass values back to the calling routine. Can somebody tell me why this doesn't work? It passes back the value of like one of the parameters sent to it instead? If anyone is interested, I have all the other lo-res routines working, and in a library. .nolist sp = 0xf4 sph = sp+1 fp = sp-2 fph = fp+1 pc = fp-2 pch = pc+1 r1 = pc-2 r1h = r1+1 r2 = r1-2 r2h = r2+1 r3 = r2-2 r3h = r3+1 r4 = r3-2 r4h = r4+1 jp = r4-2 jph = jp+1 smask = jp-2 smaskh = smask+1 dsply = smask-32 rp = dsply-2 .list .even .entry _scrn ; char scrn(char x, char y); _scrn: ; Returns the color of the point indicated lda #<2 ; Sets up to pass back an integer (2 bytes) ldy #>2 jsr Alnk ldy #4 ; get x lda [sp],y cmp #40 ; is x value legal? bcs _exitscrn sta r2 ; preserve value ldy #6 ; get y lda [sp],y cmp #48 ; is y value legal? ldy r2 ; retrieve x value jsr 0xf871 sta r1 ; save color byte for return lda #0 sta r1h ; set high byte to zero lda #<-1 tay jsr Asbfpn jsr Alujp _exitscrn: jmp Artn 2. I still have no clue how to call upon the printer for use within a program. I'd love to see a code sample if possible. 3. Any ideas on how to make an independent system file that could run without all the associated files? 4. I also want to use high resolution graphics, but invoking them tends to eat the space the program occupies. I thought perhaps I could use an anchored array in the space from 0x4000 - 0x6000 so that Hyperc wouldn't try to use it for anything, but no luck. Is there a way? If so, where did I go wrong? #include struct graphic_st { unsigned int color : 1; unsigned int pixel : 7; } plane[8192] @0x4000; main(void) { int i; char *j; j = 0xc057; /* HGR on */ i = *j; j = 0xc050; /* TEXT off */ i = *j; j = 0xc055 /* DP2 on */ i = *j; for(i = 0 ; i < 8192; i++) { plane[i].color = 1; plane[i].pixel = (i % 128); } for(i = 1 ; i < 8192; i++) printf("%d ", plane[i]); } Please reply to me personally, I doubt this interests many people anymore. Thanks. Mike. # N3 -- --- Michael J Pender Jr Box 1942 c/o W.P.I. Part of this D- belongs to greyelf@wpi.bitnet 100 Institute Rd. God...