I'm on my other PC at the moment, but yeah, it waits for a keypress then peeks 162 (jiffy clock) to seed the LFSR with what I hope is something random. Not sure if this is the wisest or most idiomatic approach but it seemed to work.
JavaJack
Creator of
Recent community posts
It seems like the act of reading a const array either mangles the array or subsequent reads are reading the wrong thing. This is a regression from 1.2.
@OPTION SYSTEM vic20.orig ' 1 ' 2631 ' 84268421 const PIPS(5) as u8 = % .X...... ..X....X .X..XX.. ..X.XX.X .XX.XX.X ..XXXXXX END% print PIPS[2]; " "; PIPS[2] & 1 > 0 print PIPS[2]; " "; PIPS[2] & 2 > 0 print PIPS[2]; " "; PIPS[2] & 4 > 0 print PIPS[2]; " "; PIPS[2] & 8 > 0 print PIPS[2]; " "; PIPS[2] & 16 > 0 print PIPS[2]; " "; PIPS[2] & 32 > 0 print PIPS[2]; " "; PIPS[2] & 64 > 0 print PIPS[2]; " "; PIPS[2] & 128 > 0
Output (I would expect to see 76s all the way down the first column):
**** cbm basic v2 **** 3583 bytes free ready. load"pips",8,1 searching for pips loading ready. run: 76 1 255 1 255 1 255 1 255 1 255 1 255 1 255 1 ready.
(BTW thanks for improving arrays in procs and lfsr_range in 1.3.)
VIC-20: Should the compiled program be RUN'able more than once?
I'm not sure if this is a VICE emulator thing or a Crustybasic thing.
The first load/run was initiated by drag/dropping the .prg onto the emulator window. (It's just testing my array shuffle routine.)
The second run was me just typing 'run' and hitting enter (the program does not run a second time.)
**** cbm basic v2 **** 3583 bytes free ready. load"ninja",8,1 searching for ninja loading ready. run: 1 1 1 1 2 2 2 3 3 4 4 1 3 1 2 2 1 3 4 1 4 2 ready. run ready.
I have a 1D array of u8 and I want to write a "shuffle" proc to shuffle it like a deck of cards. As a stepping stone to this I tried something simpler:
proc shuffleArr(arr as addr of u8) arr[2] = 99 'just to see if I can do ANYTHING with the passed array endprocThis doesn't compile:
'arr' is a scalar variable, not an array or STRING; remove the index
Almost certainly user error on my part, but not clear how to proceed.
I'm no 6502 guru. Does adding u8 and i8 really need 16 bit ops?
0000 0011 ($03 = +3) + 1111 1111 ($FF = -1)
Expected result +2
Or maybe there's some way to do INC and DEC (x++ isn't very BASIC-esque, though.)
BTW another nice-to-have would be expression-based consts.
const TILE_COLUMNS_LESS_1 = TILE_COLUMNS - 1 '21
VIC-20, yeah. It's just TILE_PLOT() in an infinite while loop with x,y,dx,dy where dx & dy alternate between 1 and -1. I couldn't really tell if I was "doing it right". It was a crapton of trial and error. I also got warnings about adding u8 and i8... but I didn't know how to do it otherwise. Also in hindsight maybe this is better done with CELL_PUTC()?
Unrelated to the bouncing letter program, I got really weird results with INKEY_CODE() and RAWKEY_CODE() under the Vice VIC-20 emulator. Holding down a key like tilde in the emulator would generate a stream of 3 different numbers for some reason.
BTW you can join my Discord if you want to kibitz on my various Godot WIP projects. https://discord.gg/dDurKPZz
A ton of content for the short amount of time offered by the jam!
Seems like if you're sufficiently patient you can complete everything using the first three buildings, making all the other buildings unimportant. I guess speedrunners could better take advantage of them, but there's no built-in timer to track your run duration.




