Search found 350 matches

by wimoos
Thu Jan 27, 2022 5:47 am
Forum: Programming
Topic: Screen values vs PETSCII
Replies: 11
Views: 882

Re: Screen values vs PETSCII

This does the trick:

Code: Select all

	BIT exit
	BEQ ctrlchr
	CMP #$FF
	BEQ ispi
	AND #$BF
	BPL exit
	EOR #$C0
	.BYTE $2C
ispi	LDA #$5E
exit	RTS
by wimoos
Mon Jan 17, 2022 6:27 am
Forum: Programming
Topic: 9-color Block Graphics BASIC Extension for Unexpanded VIC 20
Replies: 9
Views: 998

Re: 9-color Block Graphics BASIC Extension for Unexpanded VIC 20

WimBasic is still at your disposal. Next to SET, RESET and POINT it already supported, I have also added TOGGLE.

For the use of the '9-th color' there is the command AUXCOL to set this color in 36878. The CURSOR command sets the color in 646.

Regards,

Wim.
by wimoos
Mon Dec 20, 2021 10:43 am
Forum: Programming
Topic: DUMP
Replies: 7
Views: 572

Re: DUMP

Hello Jeff, Here is the source for DUMP in WimBasic that you can use as a headstart. Note that DEFined functions are also registered between the regular variables. My routine filters them out. Regards, Wim ; ; Main entry point for DUMP ; LAF29 BNE LAF95 ; LDA $2D LDY $2E LAF2F CPY $30 BNE LAF39 CMP ...
by wimoos
Mon Sep 06, 2021 5:59 am
Forum: Programming
Topic: out of memory
Replies: 9
Views: 647

Re: out of memory

In order to set up a FOR/NEXT loop, a check is done if there is still 18 (decimal) bytes free on stack. For a GOSUB/RETURN a check for 6 bytes is done. Knowing that the stack of the 6502 processor is only 256 bytes, and there is some amount reserved, this gives room for some 40 levels of GOSUBs deep...
by wimoos
Mon Sep 06, 2021 2:14 am
Forum: Programming
Topic: out of memory
Replies: 9
Views: 647

Re: out of memory

FOR/NEXT loops eat stack as well. And a combination of nested FORs and GOSUBs is disastrous. The following example throws an OUT OF MEMORY in no time, leaving unclosed FOR/NEXTs and GOSUBs on the stack. 10 FOR I=1 TO 100 20 GOSUB 100 30 NEXT 40 END 100 FOR I=1 TO 100 110 GOSUB 200 120 NEXT 130 RETUR...
by wimoos
Fri Aug 20, 2021 2:37 am
Forum: Programming
Topic: Directory Reading (aka, EOF detection)
Replies: 18
Views: 1194

Re: Directory Reading (aka, EOF detection)

In WimBasic I have a 'directory' implementation that even supports redirection of the directory listing to a file, look here:

viewtopic.php?f=2&t=9782#p109534

The only Basic interpreter routine it uses is $DDCD (print unsigned integer) :-)
by wimoos
Wed Jun 23, 2021 2:07 am
Forum: Programming
Topic: illegal function call when evaluating this formula
Replies: 9
Views: 727

Re: illegal function call when evaluating this formula

Recently I saw an interesting video about this subject (negative base, fractional power) which made me think again about this forum entry: (-8)^(-2/3) which was calculated to be 1/4. The interesting part of this is that they halved the power and squared the base (leading to a positive base), so: 64^...
by wimoos
Fri Mar 19, 2021 7:13 am
Forum: Programming
Topic: BIT #imm using the VIC-20 BASIC ROM
Replies: 15
Views: 1116

Re: BIT #imm using the VIC-20 BASIC ROM

Copying N/V from the constant(!) immediate operand would not constitute a bit *test* at all, in the sense there are no 'surprises' to expect in the outcome. Hmm, thinking about this: loading a register with an immediate value DOES set N and Z (many BEQ/BNE or BMI/BPL depend on this). Or, setting(cl...
by wimoos
Fri Jan 22, 2021 3:11 am
Forum: Programming
Topic: Custom char issue in 6502
Replies: 20
Views: 1552

Re: Custom char issue in 6502

In the kernal, the following code is used. Why not use that ? ;***********************************************************************************; ; ; calculate pointers to screen lines colour RAM LAB_EA6E JSR LAB_EAB2 ; calculate pointer to current screen line colour RAM LDA LAB_AC ; get next scre...
by wimoos
Fri Dec 18, 2020 7:39 am
Forum: Programming
Topic: Screen values vs PETSCII
Replies: 11
Views: 882

Re: Screen values vs PETSCII

From screenvalue to PETSCII input in X Y = X AND 63 IF (X AND 32) = 0 THEN Y = Y OR 64 IF (X AND 64) THEN Y = Y OR 128 result in Y (if X>127 then char is reverse) From PETSCII to screenvalue input in X IF (X AND 96) = 0 THEN REM it is a control code X = X AND 191 IF X > 127 THEN X = X AND 127 : X = ...
by wimoos
Tue Dec 15, 2020 2:09 am
Forum: Programming
Topic: Fastloaders?
Replies: 17
Views: 946

Re: Fastloaders?

No duplication tests done, so I wouldn't know about reliability. WimBasic holds the loader. Being 8K in size, it is a pretty heavy solution to load WimBasic from tape first, in order to benefit from fast loading your program. Only if your program is written in WimBasic, then this scenario could be u...
by wimoos
Mon Dec 14, 2020 8:36 am
Forum: Programming
Topic: Fastloaders?
Replies: 17
Views: 946

Re: Fastloaders?

WimBasic saves a program of 27904 bytes to tape in 1'54''.

Regards
by wimoos
Mon Dec 14, 2020 3:32 am
Forum: Programming
Topic: Fastloaders?
Replies: 17
Views: 946

Re: Fastloaders?

WimBasic offers a Turbo-load/save/verify/merge feature for datasette. See http://wimbasic.webs.com

Regards,

Wim.
by wimoos
Fri Nov 27, 2020 2:06 am
Forum: Games
Topic: Sargon II Chess
Replies: 92
Views: 15747

Re: Sargon II Chess

Did you know about the 'ADAPTED BY ANDY FINKEL' easter-egg that shows up when you press Shift-C=-CTRL at the startscreen ?
by wimoos
Wed Nov 18, 2020 6:19 am
Forum: Programming
Topic: Just Learning 650x ML & VICMON
Replies: 4
Views: 504

Re: Just Learning 650x ML & VICMON

I used to have an EPROM with Vicmon at $6000, Progaid at $7000 and an EPROM with my own utilities at $A000 (with UNNEW amongst others).

To cleanly switch from Vicmon to Basic I did a G FD22, and at the READY., I did a SYS40960 to recover my Basic program.

Regards,