robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
393 stars 48 forks source link

`PCOPY` has no effect #206

Closed jlaasonen closed 2 years ago

jlaasonen commented 2 years ago

PCOPY does not seem to have any effect.

Problem

I used the program below to test double buffering. A white square should be moving across the screen until ESC is pressed. The program worked with PC-BASIC v1 but in v2 an empty screen is displayed.

Program

10 DIM BG%(16)
20 F=1/30
30 KEY OFF
40 SCREEN 7,,0,1
50 X=1:Y=1
60 GET (X,Y)-(X+6,Y+6),BG%
70 A$=INKEY$
80 WHILE A$=""
90 PUT (X,Y),BG%,PSET
100 X=X+1:Y=Y+1
110 IF X>319-6 THEN X=0
120 IF Y>199-6 THEN Y=0
130 LINE (X,Y)-(X+6,Y+6),15,BF
140 A$=INKEY$
150 PCOPY 0,1
160 T=TIMER:WHILE TIMER<T+F:WEND
170 WEND
180 SCREEN 0:WIDTH 80:KEY ON

Notes

PC-BASIC version: 2.0.5 Operating system version: Windows 10 64bit

robhagemans commented 2 years ago

That's correct, and as in the documentation. PCOPY has no effect, it has none in GW-BASIC either.

Edit: Sorry, I misread as LCOPY, which as no effect, PCOPY should do things.

jlaasonen commented 2 years ago

Looks like this line could be the culprit: https://github.com/robhagemans/pcbasic/blob/cea2af624b4aa390d70dbaef106647867ac5a673/pcbasic/basic/display/display.py#L439

robhagemans commented 2 years ago

Thanks, that does it. Currently it's copying the destination page to itself, which isn't very useful ...

On Thu, 28 Jul 2022, 20:35 Jussi Laasonen, @.***> wrote:

Looks like this line could be the culprit: https://github.com/robhagemans/pcbasic/blob/cea2af624b4aa390d70dbaef106647867ac5a673/pcbasic/basic/display/display.py#L439

— Reply to this email directly, view it on GitHub https://github.com/robhagemans/pcbasic/issues/206#issuecomment-1198553256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB25RESWDPXY7JCSAN4FAXLVWLOI3ANCNFSM546CG3UQ . You are receiving this because you were assigned.Message ID: @.***>

robhagemans commented 2 years ago

Fixed by 461ee521