# HG changeset patch # User boisy # Date 1264305539 0 # Node ID 1ac410eb636e69a3d8ea83352c6848f4d70b26fe # Parent b750ec9ed6cf2de0e88ac58010dec96140476eda Level 2 SCF has been backported to Level 1 -- still needs testing but seems to work ok diff -r b750ec9ed6cf -r 1ac410eb636e level1/modules/scf.asm --- a/level1/modules/scf.asm Sun Jan 24 03:51:32 2010 +0000 +++ b/level1/modules/scf.asm Sun Jan 24 03:58:59 2010 +0000 @@ -1,134 +1,335 @@ ******************************************************************** -* SCF - OS-9 Level One V2 SCF file manager +* SCF - NitrOS-9 Level 2 Sequential Character File Manager * * $Id$ * +* This contains an added SetStat call to allow placing prearranged data +* into the keyboard buffer of ANY SCF related device. +* +* Usage: +* +* Entry: X = Pointer to the string +* Y = Length of the string +* A = Path number +* B = SS.Fill ($A0) (syscall SETSTAT function call number) +* NOTE: If high bit of Y is set, no carriage return will be appended to +* the read buffer (used in Shellplus V2.2 history) +* +* This also includes Kevin Darlings SCF Editor patches. +* * Edt/Rev YYYY/MM/DD Modified by * Comment * ------------------------------------------------------------------ -* 10 ????/??/?? -* From Tandy OS-9 Level One VR 02.00.00 +* 1993/04/20 ??? +* V1.09: +* - Speeded up L05CC (write char to device) routine by a few cycles +* - Slightly optimized Insert char. +* - Move branch table so Read & ReadLn are 1 cycle faster each; fixed +* SS.Fill so size is truncated @ 256 bytes. +* - Added NO CR option to SS.Fill (for use with modified Shellplus V2.2 +* command history). +* +* 1993/04/21 ??? +* Slight speedup to some of ReadLn parsing, TFM's in Open/Close. +* - More optimization to read/write driver calls +* - Got rid of branch table @ L05E3 for speed +* +* 1993/05/21 ??? +* V1.10: +* Added Boisy Pitre's patch for non-sharable devices. +* - Saved 4 cycles in routine @ L042B +* - Modified Boisy's routine to not pshs/puls B (saves 2 cycles). +* - Changed buffer prefill of CR's to save 1 byte. +* +* 1993/07/27 ??? +* V1.11: +* Changed a BRA to a LBRA to a straight LBRA in L0322. +* - Optimized path option character routine @ L032C +* +* 1993/08/03 ??? +* Modified vector table @ L033F to save 1 cycle on PD.PSC +* - Sped up uppercase conversion checks for ReadLn & WritLn +* - Changed 2 BRA's to L02F9 to do an LBRA straight to L05F8 (ReadLn loop) +* - Moved L0565 routine so Reprint line, Insert & Delete char (on ReadLn) +* are 1 cycle faster / char printed +* - Changed 2 references to L0420 to go straight to L0565 +* - Sped up ReadLn loop by 2 or 3 cycles per char read +* +* 1993/09/21 ??? +* V1.12: +* Sped up L0435 by 1 or 2 cycles (depending on branch) +* - Changed LDD ,S to TFR X,D (saves 1 cycle) @ L04F1 (Write & WritLn) +* - Modified L04F1 to use W without TFR (+1 byte, -3 cycles) (Write) +* +* 1993/11/09 ??? +* Took LDX #0/LDU PD.BUF,y from L03B5 & merged in @ L028A, L02EF & L0381. +* Also changed BEQ @ L03A5 to skip re-loading X with 0. +* +* 1993/11/10 ??? +* Moved L04B2 routine to allow a couple of BSR's instead of LBSR's In READ. +* - Moved driver call right into READ loop (should save 25 cycles/char read) +* - Moved driver call right into L0565 (should save 12 cycles/char written on echo, +* line editing, etc.) +* +* 1993/11/26 ??? +* Moved L02FE (ReadLn parsing) to end where ReadLn routine is moved L03E2 +* so Read loop would be optimized for it (read char from driver) instead of +* L042B (write filled buffer to caller). +* Changed LDA #C$NULL to CLRA. +* +* 1993/12/01 ??? +* Modified device write call (L056F) to preserve Y as well, to cut down on +* PSHS/PULS. +* - Changed L03E2 & L03DA to exit immediately if PD.DEV or PD.DV2 (depending +* on which routine) is empty (eliminated redundant LEAX ,X). +* +* 1994/05/31 ??? +* Attempted mode to L03F1 to eliminate LDW #D$READ, changed: +* LDX V$DRIV,x +* ADDW M$Exec,x +* JSR w,x +* to: +* LDW V$DRIV,x +* ADDW M$Exec,w +* JSR D$READ,w +* Did same to L05C9 & L056F (should speed up each by 1 cycle) +* +* 1994/06/07 ??? +* Attempted to modify all M$Exec calls to use new V$DRIVEX (REQUIRES NEW IOMAN) +* - L01FA (Get/SetStat), L03F1 (Read), L05C9 (Write), L056F (Write) +* - Changed L046A to use LDB V.BUSY,x...CMPB ,s...TFR B,A * -* 11 2010/01/20 Boisy G. Pitre -* Added support for SHARE. bit +* 1994/06/08 ??? +* Changed TST L033F,pc @ L032C to use < (8 bit) version +* - Modified L02E5 to use D instead of X, allowing TSTA, and faster exit on 0 byte +* just BRAnching to L0453 +* +* 1994/06/09 ??? +* Changed LEAX 1,X to LDB #1/ABX @ L053D, L05F8, L0312, L0351, L03B8 +* - Changed to L0573: All TST's changed to LDB's +* - Changed Open/Create init to use LEAX,PC instead of BSR/PULS X +* - Changed TST PD.CNT,y to LDA PD.CNT,y @ close +* - Eliminated L010D, changed references to it to go to L0129 +* - Eliminated useless LEAX ,X @ L0182, and changed BEQ @ L0182 to go to L012A +* instead of L0129 (speeds CLOSE by 5 or 10 cycles) +* - Moved L06B9 into L012B, eliminate BSR/RTS, plus +* - Changed TST V.TYPE,x to LDB V.TYPE,x +* - Moved L0624 to just before L05F8 to eliminate BRA L05F8 (ReadLn) +* - Changed TST PD.EKO,y @ L0413 to LDB PD.EKO,y +* - Moved L0413-L0423 routines to later in code to allow short branches +* - As result of above, changed 6 LBxx to Bxx +* - Changed TST PD.MIN,y @ L04BB to LDA PD.MIN,y +* - Changed TST PD.RAW,y/TST PD.UPC,y @ L0523 to LDB's +* - Changed TST PD.ALF,y @ L052A to LDB +* - L053D: Moved TST PD.RAW,y to before LDA -1,u to speed up WRITE, changed it to LDB +* +* 1994/06/10 ??? +* Changed TST PD.ALF,y to LDB @ L052A +* - Changed CLR V.WAKE,u to CLRA/STA V.WAKE,u @ L03F1 (Read) +* - Changed CLR V.BUSY,u to CLRA/STA V.BUSY,u @ L045D +* - Changed CLR PD.MIN,y to CLRA/STA PD.MIN,y, moved before LDA P$ID,x @ L04A7 +* - Changed CLR PD.RAW,y @ L04BB to STA PD.RAW, since A already 0 to get there +* - Changed CLR V.PAUS,u to CLRA/STA V.PAUS,u @ L05A2 +* - Changed TST PD.RAW,y to LDA PD.RAW,y @ L05A2 +* - Changed TST PD.ALF,y to LDA PD.ALF,y @ L05A2 +* - Changed CLR V.WAKE,u to CLRB/STB V.WAKE,u @ L05C9 +* - Changed CLR V.WAKE,u to CLRB/STB V.WAKE,u @ L056F +* - Changed TST PD.UPC,y to LDB PD.UPC,y @ L0322 +* - Changed TST PD.DLO,y/TST PD.EKO,y to LDB's @ L03A5 +* +* 1994/06/16 ??? +* Changed TST PD.UPC,y to LDB PD.UPC,y @ L0322 +* - Changed TST PD.BSO,y to LDB PD.BSO,y @ L03BF +* - Changed TST PD.EKO,y to LDB PD.EKO,y @ L03BF * -* 11r1 2010/01/23 Boisy G. Pitre +* 2002/10/11 Boisy G. Pitre +* Merged NitrOS-9 and TuneUp versions for single-source maintenance. Note that +* the 6809 version of TuneUp never seemed to call GrfDrv directly to do fast screen +* writes (see note around g.done label). +* +* 16r2 2002/05/16 Boisy G. Pitre +* Removed pshs/puls of b from sharable code segment for non-NitrOS-9 because it was +* not needed. +* +* 16r3 2002/08/16 Boisy G. Pitre +* Now uses V$DRIVEX. +* +* 16r4 2004/07/12 Boisy G. Pitre +* 6809 version now calls the FAST TEXT entry point of GrfDrv. +* +* 17 2010/01/15 Boisy G. Pitre +* Fix for bug described in Artifact 2932883 on SF +* Also added Level 1 conditionals for eventual backporting + +* +* 17 2010/01/15 Boisy G. Pitre +* Handling of device exclusivity using the SHARE. bit has been rearchitected. +* The '93 patch looked at the mode bytes in the descriptor and driver and +* determined that if both were set, then only one path would be allowed to +* be opened on the device at a time. +* I now believe this is wrong. +* The mode bytes in the device driver and descriptor are capability bytes. +* They advertise what the device is capable of doing (READ, WRITE, etc) so +* the mode bytes alone do not convey action, but merely what is possible. +* When the user calls I$Open on a device, he passes the desired mode byte +* in RegA and IOMan checks to make sure that all bits in that register are +* set in the mode bytes of the driver and descriptor. So once we get into +* the Open call of this file manager, we know that all set bits in RegA are +* also set in the mode bytes of the driver and descriptor. +* +* For SHARE., what we SHOULD be doing is checking the number of open paths +* on the device. If the SHARE. bit is set in RegA, then we check if a path +* is already open and if so, return the E$DevBsy error. +* Likewise, if SHARE. is not set in RegA, we check the path at the head of +* the open path list, and if ITS mode byte has the SHARE. bit set, we exit +* with E$DevBsy too. The idea is that if the SHARE. bit is set on the newly +* opened path or an existing path, then there can "be only one." +* +* 17r1 2010/01/23 Boisy G. Pitre * SCF now returns on carry set after calling SS.Open. Prior to this * change, SS.ComSt would be called right after SS.Open even if SS.Open * failed. This caused misery with the scdwn driver wildcard feature. nam SCF - ttl OS-9 Level One V2 SCF file manager + ttl NitrOS-9 Level 2 Sequential Character File Manager - ifp1 + IFP1 use defsfile use scfdefs - endc + ENDC tylg set FlMgr+Objct atrv set ReEnt+rev -rev set $01 -edition set 11 - - mod eom,name,tylg,atrv,start,size - -size equ . - -name fcs /SCF/ - fcb edition +rev set 1 +edition equ 17 -start lbra Create - lbra Open - lbra MakDir - lbra ChgDir - lbra Delete - lbra Seek - lbra Read - lbra Write - lbra ReadLn - lbra WriteLn - lbra GetStat - lbra PutStat - lbra Term + mod eom,SCFName,tylg,atrv,SCFEnt,0 -L0038 puls y - - -* ChgDir/MakDir entry -ChgDir -MakDir comb - ldb #E$BPNam -L003D rts +SCFName fcs /SCF/ + fcb edition -* Open/Create entry -Open -Create ldx PD.DEV,y get device table entry - stx D.Proc Get current process pointer + ENDC + leax P$Path,x Point to local path table + clra Start path # = 0 (Std In) +L0198 cmpb a,x Same path as one is process' local path list? + beq L01CA Yes, return + inca Move to next path + cmpa #NumPaths Done all paths? + blo L0198 No, keep going + pshs y Preserve path descriptor pointer + + IFNE H6309 + + lda #SS.Relea Release signals SetStat + ldf #D$PSTA Get Setstat offset + + ELSE + + ldd #SS.Relea*256+D$PSTA + + ENDC + + bsr L01FA Execute driver setstat routine + puls y Restore path pointer + IFGT Level-1 + ldx D.Proc Get current process pointer + ENDC + lda P$PID,x Get parent process ID + sta ,s Save it + IFGT Level-1 + os9 F$GProcP Get pointer to parent process descriptor + ELSE + ldx D.Proc Get current process pointer + ENDC + lda R$Y,u Get flag byte for CR/NO CR + pshs a Save it + IFGT Level-1 + lda P$Task,x Get task number + ldb 256, so bump MSB down +L0435 clrb Force to even page + ldu PD.RGS,y Get callers register stack pointer + ldu R$X,u Get ptr to caller's buffer + IFNE H6309 + addr d,u Offset to even page into buffer + clre Clear MSB of count + ldf 1,s LSB of count on even page? + bne L0442 No, go on + ince Make it even 256 +L0442 + IFGT Level-1 + lda D.Proc Get current process + ENDC + lda P$ID,x Get it's process ID + ldx PD.DEV,y Get device table pointer from our path dsc. + bsr L045D Check if it's busy + ldx PD.DV2,y Get output device table pointer +L045D beq L0467 Doesn't exist, exit + ldx V$STAT,x Get static storage pointer for our device + cmpa V.BUSY,x Same process as current process? + bne L0467 No, device busy return + clra + sta V.BUSY,x Yes, mark device as free for use +L0467 rts Return + +L0468 pshs x,a Preserve device table entry pointer & process ID +L046A ldx V$STAT,x Get device static storage address + ldb V.BUSY,x Get active process ID + beq L048A No active process, device not busy go reserve it + cmpb ,s Is it our own process? + beq L049F Yes, return without error + bsr L0453 Go wait for device to no longer be busy + tfr b,a Get process # busy using device + os9 F$IOQu Put our process into the IO Queue + inc PD.MIN,y Mark device as not mine + IFGT Level-1 + ldx D.Proc Get current process + ENDC + ldb P$Signal,x Get signal code + lda ,s Get our process id # again for L046A + beq L046A No signal go try again + coma Set carry + puls x,a,pc Restore device table ptr (eat a) & return + +* Mark device as busy;copy pause/interrupt/quit/xon/xoff chars into static mem +L048A sta V.BUSY,x Make it as process # busy on this device + sta V.LPRC,x Save it as the last process to use device + lda PD.PSC,y Get pause character from path dsc. + sta V.PCHR,x Save copy in static storage (faster later) + ldd PD.INT,y Get keyboard interrupt & quit chars + std V.INTR,x Save copies in static mem + ldd PD.XON,y Get XON/XOFF chars + std V.XON,x Save them in static mem too +L049F clra No error & return + puls pc,x,a Restore A=Process #,X=Dev table entry ptr -L0213 lbsr L0348 - bcs L020A -L0218 tst D.Proc Get current process ID + ENDC + clra + sta PD.MIN,y Flag device is mine + lda P$ID,x Get process ID # + ldx PD.DEV,y Get device table pointer + bsr L0468 Busy? + bcs L04C1 No, return + ldx PD.DV2,y Get output device table pointer + beq L04BB Go on if it doesn't exist + bsr L0468 Busy? + bcs L04C1 No, return +L04BB lda PD.MIN,y Device mine? + bne L04A2 No, go wait for it + sta PD.RAW,y Mark device with editing +L04C1 ldu PD.RGS,y Get register stack pointer + rts Return + +* Hangup process +L04C4 leas 2,s Purge return address +L04C6 ldb #E$HangUp Get hangup error code + cmpa #S$Abort Termination signal (or carrier lost)? + blo L04D3 Yes, increment status flag & return + lda PD.CPR,y Get current process ID # using path + ldb #S$Kill Get kill signal + os9 F$Send Send it to process +L04D3 inc PD.PST,y Set path status + orcc #Carry Set carry + rts Return + +* I$WritLn entry point +writln bsr L04A2 Go wait for device to be ready for us + bra L04E1 Go write + +* I$Write entry point +write bsr L04A2 Go wait for device to be ready for us + inc PD.RAW,y Mark device for raw write +L04E1 ldx R$Y,u Get number of characters to write + lbeq L055A Zero so return + pshs x Save character count + ldx #$0000 Get write data offset + bra L04F1 Go write data + +L04EC tfr u,d Move current position in PD.BUF to D + tstb At 256 (end of PD.BUF)? + bne L0523 No, keep writing from current PD.BUF + +* Get new block of data to write into [PD.BUF] +* Only allows up to 32 bytes at a time, and puts them in the last 32 bytes of +* the 256 byte [PD.BUF] buffer. This way, can use TFR U,D/TSTB to see if fin- +* inshed +L04F1 pshs y,x Save write offset & path descriptor pointer + tfr x,d Move data offset to D + ldu PD.RGS,y Get register stack pointer + ldx R$X,u Get pointer to users's WRITE string + IFNE H6309 + addr d,x Point to where we are in it now + ldw R$Y,u Get # chars of original write + subr d,w Calculate # chars we have left to write + cmpw #64 More than 64? + bls L0508 No, go on + ldw #64 Max size per chunk=64 +L0508 ldd PD.BUF,y Get buffer ptr + inca Point to PD.BUF+256 (1 byte past end + subr w,d Subtract data size + ELSE + leax d,x + ldd R$Y,u + subd ,s + cmpd #$0020 + bls L0508 + ldd #$0020 +L0508 pshs d + ldd PD.BUF,y + inca + subd ,s + ENDC + tfr d,u Move it to U + lda #C$CR Put a carriage return 1 byte before start + sta -1,u of write portion of buffer + IFGT Level-1 + ldy L0298,pcr - subb #$29 - lslb - leax b,x - stx 2,s - puls x - jsr [,s++] - bra L0252 -L0298 bra L0313 - bra L02FD - bra L02AA - bra L02BE - bra L02D9 - bra L02E3 - puls pc - bra L02FD - bra L02FD -L02AA leas 2,s +* Send character to driver +L0565 pshs u,y,x,a Preserve registers + ldx PD.DV2,y Get output device table pointer + beq L0571 Return if none + cmpa #C$CR Carriage return? + beq L05A2 Yes, go process it +L056F ldu V$STAT,x Get device static storage pointer + clrb + stb V.WAKE,u Wake it up + IFGT Level-1 + ldx V$DRIVEX,x Get driver execution pointer + ELSE + pshs d + ldx V$DRIV,x get driver module + ldd M$EXEC,x + leax d,x + puls d + ENDC + jsr D$WRIT,x Execute driver +L0571 puls pc,u,y,x,a Restore & return + +* Check for printable character +L0413 ldb PD.EKO,y Echo turned on? + beq NoEcho No, return +L0418 cmpa #C$SPAC CHR$(32) or higher? + bhs L0565 Yes, go send to driver + cmpa #C$CR Carriage return? + bne L0423 No, change it to a period + bra L0565 Anything else output to driver + +NoEcho rts + +L0423 pshs a Save code + lda #'. Get code for period + bsr L0565 Output it to device + puls pc,a Restore & return + +L0624 bsr L0418 check if it's printable and send it to driver +* Process ReadLn +L05F8 lbsr L03E2 get a character from device + lbcs L0370 return if error + tsta usable character? + lbeq L02FE no, check path descriptor special characters + ldb PD.RPR,y get reprint line code + cmpb #C$RPRT cntrl D? + lbeq L02FE yes, check path descriptor special characters + cmpa PD.RPR,y reprint line? + bne L0629 no, Check line editor keys + cmpx PD.MAX,y character count at maximum? + beq L05F8 yes, go read next character + ldb #1 Bump char count up by 1 + abx + cmpx ,s done? + bhs L0620 yes, exit + lda ,u+ get character read + beq L0624 null, go send it to driver + cmpa PD.EOR,y end of record character? + bne L0624 no, go send it to driver + leau -1,u bump buffer pointer back 1 +L0620 leax -1,x bump character count back 1 + bra L05F8 go read next character + +* Process print rest of line +L0629 cmpa #C$PLINE Print rest of line code? + bne L0647 No, check insert +L062D pshs u Save buffer pointer + lbsr L038B Go print rest of line + lda PD.BSE,y Get backspace echo character +L0634 cmpu ,s Beginning of buffer? + beq L0642 Yes, exit + leau -1,u Bump buffer pointer back 1 + leax -1,x Bump character count back 1 + IFNE H6309 + bsr L0565 Print it + ELSE + lbsr L0565 Print it + ENDC + bra L0634 Keep going +L0642 leas 2,s Purge buffer pointer + bra L05F8 Return + +* Process Insert character (NOTE:Currently destroys W) +L0647 cmpa #C$INSERT Insert character code? + bne L0664 No, check delete + IFNE H6309 + pshs x,y Preserve x&y a moment + tfr u,w Dupe buffer pointer into w + ldf #$fe End of buffer -1 + tfr w,x Source copy address + incw Include char we are on & dest address is+1 + tfr w,y Destination copy address + subr u,w w=w-u (Size of copy) + tfm x-,y- Move buffer up one + puls y,x Get back original y & x + lda #C$SPAC Get code for space + sta ,u Save it there + ELSE + pshs u + tfr u,d + ldb #$FF + tfr d,u +L06DE lda ,-u + sta 1,u + cmpu ,s + bne L06DE + lda #C$SPAC sta ,u - lbsr L0379 - ldu R$Y,y - leax 1,x - stx R$Y,u - bsr L0332 leas 2,s - lbra L0391 -L02BE leas 2,s - leax ,x - lbeq L0208 - bra L0265 + ENDC + bra L062D Go print rest of line + +* Process delete line +L0664 cmpa #C$DELETE Delete character code? + bne L068B No, check end of line + pshs u Save buffer pointer + lda ,u Get character there + cmpa PD.EOR,y End of record? + beq L0687 Yes, don't bother to delete it +L0671 lda 1,u Get character beside it + cmpa PD.EOR,y This an end of record? + beq L067C Yes, delete it + sta ,u+ Bump character back + bra L0671 Go do next character +L067C lda #C$SPAC Get code for space + cmpa ,u Already there? + bne L0685 No, put it in + lda PD.EOR,y Get end of record code +L0685 sta ,u Put it there +L0687 puls u Restore buffer pointer + bra L062D Go print rest of line + +* Delete rest of buffer +L068B cmpa PD.EOR,y End of record code? + bne L02FE No, check for special path dsc. chars + pshs u Save buffer pointer + bra L069F Go erase rest of buffer + +L0696 pshs a Save code + lda #C$SPAC Get code for space + lbsr L0565 Print it + puls a Restore code +L069F cmpa ,u+ End of record? + bne L0696 No, go print a space + puls u Restore buffer pointer -L02C8 pshs b +* Check character read against path descriptor +L02FE tsta Usable character? + beq L030C No, go on + ldb #PD.BSP Get start point in path descriptor +L0303 cmpa b,y Match code in descriptor? + beq L032C Yes, go process it + incb Move to next one + cmpb #PD.QUT Done check? + bls L0303 No, keep going +L030C cmpx PD.MAX,y Past maximum character count? + bls L0312 No, go on + stx PD.MAX,y Update maximum character count +L0312 ldb #1 Add 1 char + abx + cmpx ,s Past requested amount? + blo L0322 No, go on + lda PD.OVF,y Get overflow character + lbsr L0565 Send it to driver + leax -1,x Subtract a character + lbra L05F8 Go try again + +L0322 ldb PD.UPC,y Force uppercase? + beq L0328 No, put char in buffer + lbsr L0403 Make character uppercase +L0328 sta ,u+ Put character in buffer + lbsr L0413 Check for printable + lbra L05F8 Go try again + +* Process path option characters +L032C pshs x,pc Preserve character count & PC + leax WGlobal+G.GrfEnt does GrfDrv have an entry address? + beq no.fast nope, don't bother calling it. + + ldu V$STAT,u and device static storage + tst V.ParmCnt,u are we busy getting more parameters? + bne no.fast yes, don't do buffered writes -L0391 ldx WGlobal+G.GfBusy flag grfdrv busy + IFNE H6309 + lde ,s+ grab old CC off of the stack + lda 1,s get the number of characters to write + ELSE +* ldb ,s+ grab old CC off of the stack + lda 1,s get the number of characters to write + ENDC +* A = number of bytes at $0180 to write out... + bsr do.grf do the call +* ignore errors : none possible from this particular call +call.out puls d,x,y,u,pc and return -* write routine -Write bsr L03E0 - inc PD.RAW,y -L041F ldx R$Y,u - beq L0461 - pshs x - ldx #$0000 - ldu R$X,u -L042A lda ,u+ - tst PD.RAW,y - bne L0444 - lbsr L0369 - cmpa #C$LF - bne L0444 - lda #C$CR - tst WGlobal+G.GrfStk stack pointer for GrfDrv + lds WGlobal+G.GrfEnt get GrfDrv entry address -L046C pshs u,x,a - ldx PD.DV2,y - beq L0478 - cmpa #C$CR - beq L04A9 -L0476 bsr L04D0 -L0478 puls pc,u,x,a + stx R$PC,s save grfdrv entry address as PC on the stack + IFNE H6309 + ste R$CC,s save CC onto CC on the stack + ELSE + stb R$B,s + ldb $017E + stb R$CC,s + ENDC + jmp [>D.Flip1] flip to grfdrv and execute it + ENDC + +* GrfDrv will execute function, and then call [D.Flip0] to return here. It +* will use an RTS to return to the code that called here in the first place +* Only SP, PC & CC are set up - ALL OTHER REGISTERS MAY BE MODIFIED -L047A pshs u,x,a - ldx PD.DEV,y - cmpa #C$CR - bne L0476 - ldu V$STAT,x - tst V.PAUS,u - bne L0497 - tst PD.RAW,y - bne L04A9 - tst $1007 +* lds $1002 +* stb >$017F +* pshs pc,u,y,x,dp,b,a,cc +* ldx >$106E +* stx R$PC,s +* ldb >$107E +* stb ,s +* jmp [>D.Flip1] +* ENDC emod eom equ * end +