Search found 347 matches

by wimoos
Mon Nov 02, 2020 9:34 am
Forum: Programming
Topic: Power of WimBasic
Replies: 8
Views: 721

Re: Power of WimBasic

When you program in Basic on a VIC20, often speed and/or memory can be a issue. One trick to save memory and improve speed is to put as many statements as possible, separated by colons, on one Basic line. Each Basic line has an overhead of 4 bytes, so each line you save is 4 bytes you save. When per...
by wimoos
Mon Nov 02, 2020 2:13 am
Forum: Programming
Topic: Power of WimBasic
Replies: 8
Views: 721

Re: Power of WimBasic

Copying memory blocks this way may also be used to manipulate arrays. - Swapping the contents of two arrays (using a string as the intermediate buffer). - (Re-)Initializing an array (e.g. with the contents of a string of 0's (STRING$(sizeof(array),0)). When the arraysize is 255 bytes or less, this c...
by wimoos
Fri Oct 23, 2020 1:59 am
Forum: Programming
Topic: BIT #imm using the VIC-20 BASIC ROM
Replies: 15
Views: 1068

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

Another thing to note is that BIT# in 65C02 does not modify N or V, but only Z.
Where in 6502 the BIT instructions do set N and V corresponding B7 and B6 of the memory location

Regards,

Wim.
by wimoos
Fri Oct 23, 2020 1:31 am
Forum: Programming
Topic: BIT #imm using the VIC-20 BASIC ROM
Replies: 15
Views: 1068

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

The most interesting values are probably the powers of 2, they're given here: $01 $C390 $02 $C39B $04 $C3E7 $08 $C3B9 $10 $C338 $20 $C1A1 $40 $CB5A $80 $C018 In character ROM, at location $8268 is a list of powers of two in descending order, and at $8270 in ascending order. These lists make it also...
by wimoos
Wed Oct 07, 2020 1:43 am
Forum: Programming
Topic: message "division by zero error"
Replies: 21
Views: 1243

Re: message "division by zero error"

change line 260 to

Code: Select all


260 FOR I=4536 TO 4579 : POKE I,32 : NEXT I

by wimoos
Wed Oct 07, 2020 1:03 am
Forum: Programming
Topic: message "division by zero error"
Replies: 21
Views: 1243

Re: message "division by zero error"

Armando. What memory configuration are you using ? Line 260 is assuming you have 3.5k or maybe 6.5k, but not +8k or +16k. What I think happens is that the POKEs in line 260 overwrite the memory space for simple variables, and subsequently Z cannot be found anymore, resulting in Z=0. In line 270 a A(...
by wimoos
Tue Oct 06, 2020 4:45 am
Forum: Programming
Topic: message "division by zero error"
Replies: 21
Views: 1243

Re: message "division by zero error"

Hello Armando,

Can you make that program available to us ?

Regards,

Wim.
by wimoos
Wed Sep 16, 2020 2:34 am
Forum: Games
Topic: BASIC 'Hearts' game
Replies: 13
Views: 1389

Re: BASIC 'Hearts' game

Here is the WimBasic version. Brought it down to 1912 bytes, 37 lines.
It autostarts in VICE.

Regards,

Wim.
hearts.zip
(9.42 KiB) Downloaded 50 times
by wimoos
Mon Sep 14, 2020 2:09 am
Forum: Games
Topic: BASIC 'Hearts' game
Replies: 13
Views: 1389

Re: BASIC 'Hearts' game

Hi Victragic, I suggest to make the sorting routine a bit faster / obsolete: Replace 73 t=0:n=1 74 ifd%(n,p)<d%(n-1,p)thent=d%(n-1,p):d%(n-1,p)=d%(n,p):d%(n,p)=t:ifn>1thenn=n-1:goto74 75 n=n+1:ifn<13then74 76 return with 73 n=i 74 ifn<12-rthend%(n,p)=d%(n+1,p):n=n+1:goto74 75 d%(n,p)=99 76 return an...
by wimoos
Wed Sep 02, 2020 1:00 am
Forum: Programming
Topic: Auto-run on Load?
Replies: 10
Views: 1149

Re: Auto-run on Load?

Hello Robbie,

On a VIC with no further extensions, the key combination SHIFT-RUN/STOP does this. Only from tape, though.
On VICE, there is an 'Autostart' feature that loads and runs a program from disk #8.


Regards,

Wim
by wimoos
Wed Aug 26, 2020 11:26 am
Forum: Emulation and Cross Development
Topic: Integrate with the host platforms filesystem (Linux)
Replies: 4
Views: 332

Re: Integrate with the host platforms filesystem (Linux)

Hello srowe

Thanks to strace , I now see that VICE opens files with the syscall openat() and does not use the O_ASYNC flag that is needed when addressing a pipe.

Regards,

Wim.
by wimoos
Wed Aug 26, 2020 8:43 am
Forum: Emulation and Cross Development
Topic: Integrate with the host platforms filesystem (Linux)
Replies: 4
Views: 332

Integrate with the host platforms filesystem (Linux)

All, Has anyone ever tried to integrate VIC with the host platform through the filesystem ? That is, in linux do: ln -s /dev/urandom rnd xvic and then in VICE 10 OPEN1,8,0,"RND" 20 GET#1,A$:IFA$=""THENA$=CHR$(0) 30 PRINTASC(A$) 40 IFST=0THEN20 50 CLOSE1 This works. Also the /proc...
by wimoos
Thu Aug 06, 2020 7:13 am
Forum: Games
Topic: In search of...
Replies: 38
Views: 15129

Re: In search of...

This is the WimBasic version of the Sokoban game that Mike developed. I have added a rudimentary timer and counters for moves and pushes. Run BOOT to load and run WimBasic, that subsequently reconfigures the VIC and starts the game. The following WimBasic features were used: HIMEM INPUTLINE# (the sc...
by wimoos
Sun Aug 02, 2020 5:46 am
Forum: Games
Topic: In search of...
Replies: 38
Views: 15129

Re: In search of...

I can follow the "state-analyze-move" approach and honor it, next to my pragmatic approach. Still a PEEK is done that is possibly "out-of-bounds". And because the screen memory, conveniently, doesn't start at 0, this doesn't lead to an ILLQUANT error. During the analysis it is di...
by wimoos
Sat Aug 01, 2020 11:39 am
Forum: Games
Topic: In search of...
Replies: 38
Views: 15129

Re: In search of...

Yes. Well. The setup of the Sokoban game, with its bitmasks to signify the contents of a location is a great find. But, in the algorithm: What is the use of trying to get information on a second-adjacent location if you're not even sure you're going to impact it ? Because, maybe the first-adjacent l...