Page 1 of 1

Fix for CoCo Extended BASIC 1.0 PCLEAR bug

Posted: Sun Oct 31, 2010 2:03 pm
by zephyr
The following BASIC program pokes in a position independent machine code routine which gets round the PCLEAR bug in Extended Color BASIC 1.0. Steve Woolham asked if I would post it here as there does not appear to be any other routine available to do this anywhere on the internet. The routine works under all versions of Extended Color BASIC, and can also be used to do the equivalent of a 'PCLEAR 0' from within a CoCo BASIC program.

Regards,
Steve

Code: Select all

10 'COCO PCLEAR FIX V1.0
20 'FOR EXTENDED COLOR BASIC 1.0
30 'BY STEPHEN J WOOLHAM
40 '***************************
50 'BASIC EXAMPLE PROGRAM
60 '***************************
70 ADDR = 474 : MC$="D67686063DDBBC1E895C1F0293193406D31B1F013506D3A6DDA67E96B4"
80 FOR I = 1 TO 58 STEP 2 : H$ = MID$(MC$,I,2) : POKE ADDR,VAL("&H"+H$) : ADDR = ADDR + 1 : NEXT
90 '
100 'LOCATION 118 DETERMINES HOW
110 'MANY PAGES ARE CLEARED
120 '
130 'PCLEAR8 = POKE118,8:EXEC474
140 '
150 POKE118,8:EXEC474

Re: Fix for CoCo Extended BASIC 1.0 PCLEAR bug

Posted: Tue Nov 09, 2010 10:18 pm
by zephyr
Here's an alternative routine. Both of these routines also allow you to PCLEAR more than 8 pages, but is not recommended with the first routine.

Code: Select all

10 'COCO PCLEAR FIX V2.0
20 'FOR EXTENDED COLOR BASIC 1.0
30 'BY STEPHEN J WOOLHAM
40 '***************************
50 'BASIC EXAMPLE PROGRAM #2
60 '***************************
70 MC$="8606D6763DDBBC1E895C1F0293193406D3A6DDA63506D31B1F014C932124037E96B47EB44A"
80 X=1:FOR I=474TO510:POKE I,VAL("&H"+MID$(MC$,X,2)):X=X+2:NEXT
90 '
100 'LOCATION 118 DETERMINES HOW
110 'MANY PAGES ARE CLEARED
120 '
130 'PCLEAR8 = POKE118,8:EXEC474
140 '
150 POKE118,8:EXEC474