Search found 563 matches

by tlr
Thu Sep 16, 2021 12:25 pm
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

The VIC-20 User Port is connected to Port B, whose control lines, CB1 and CB2, lack the latching feature (they make up for it by being able to control the shift register instead). When I send data out, I use the Handshake Output Mode, which sets CB2 low on a write to the port. This is how my Arduin...
by tlr
Thu Sep 16, 2021 10:36 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

What you are doing is in some ways similar to IEEE-488 so maybe things like bus turn-around may be borrowed from there? Sure. I just learned how the pins were mapped to the User Port, and how the control lines work, and then made something up. I'm still pretty new at it, and could definitely benefi...
by tlr
Thu Sep 16, 2021 3:29 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

As you suggest, I might be able to stretch it further. Maybe the bottleneck is the Arduino (but probably not). I'd rather spend my time on Bluetooth next, after the MIDI project is done. If I can sling files from Mac to VIC without even needing to physically hook them up...? That's the stuff! Bluet...
by tlr
Wed Sep 15, 2021 10:57 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

Hmm... to me this looks like you get all 8 bits at a time each interrupt and store them somewhere, no? Yep, exactly. The location is based on the first two bytes in PRG mode, or the address can be overridden by providing a hex address. Reading the port clears the interrupt so I'm ready for the next...
by tlr
Wed Sep 15, 2021 10:11 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

I'm not using parallel bits, or the shift register, or hardware handshaking. I'm just grabbing port data on CB2 NMI interrupt. 57600 is reliable, and if it remains reliable across at least 8KB files, I'll be good with that. This is sort of a dress rehearsal for MIDI In code, and that just needs to ...
by tlr
Wed Sep 15, 2021 9:49 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

I'm not using parallel bits, or the shift register, or hardware handshaking. I'm just grabbing port data on CB2 NMI interrupt. 57600 is reliable, and if it remains reliable across at least 8KB files, I'll be good with that. This is sort of a dress rehearsal for MIDI In code, and that just needs to ...
by tlr
Wed Sep 15, 2021 9:01 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

Woah! I didn't push wAxfer that far because I thought there was no way in hell it would work. But damn, it works at 38400! It took about two seconds to transfer Dungeon of Dance ! This changes everything. Thanks for the tip! The VIA really is quite snappy. Note: It also works reliably at 57600. At ...
by tlr
Wed Sep 15, 2021 12:17 am
Forum: Hardware and Tech
Topic: wAxfer
Replies: 26
Views: 1656

Re: wAxfer

I didn't read everything through here, but if you just want reliable .prg transfers over serial port you might want to have a look at tinyrs. It does 38k4. I've been using this a lot for my own development.

If you want USB it should be just a matter of adding a 5V FTDI-cable to the user port.
by tlr
Fri Aug 27, 2021 10:31 am
Forum: Hardware and Tech
Topic: Cv/gate/midi
Replies: 28
Views: 1252

Re: Cv/gate/midi

This will sort of depend on what you're interfacing with, but ideally you'd want to support either 10V for unipolar CV or +/- 5V bi-polar CV. This is the range common in Eurorack. And it'll typically be volt-per-octave. Hz-per-volt is mostly restricted to Korg stuff, and the math is harder (12th ro...
by tlr
Fri Aug 27, 2021 10:21 am
Forum: Hardware and Tech
Topic: Cv/gate/midi
Replies: 28
Views: 1252

Re: Cv/gate/midi

(This digital interface could also be an IEC thing, so then we could use KERNAL routines like CHRIN and CHROUT to send and receive CV and MIDI. This might actually be an awesome approach.) There are a few drawbacks with this. The bit rate of the IEC isn't very high and the kernal routines aren't re...
by tlr
Thu Aug 19, 2021 10:17 am
Forum: Programming
Topic: 16-Bit Decimal Printing
Replies: 6
Views: 572

Re: 16-Bit Decimal Printing

My take: clone_bdcd: stx dividend_zp sta dividend_zp+1 ldy #0 cb_lp1: ; setup remainder lda #0 ldx #16+1 clc ; bcc div_skp1 ; fall thru ; divide loop div_lp1: rol ; does it fit? cmp #10 bcc div_skp1 ;no... shift in ; C = 1 ; yes... subtract sbc #10 ; C = 1 div_skp1: rol dividend_zp rol dividend_zp+1...
by tlr
Wed Aug 11, 2021 7:44 am
Forum: Programming
Topic: Standardized 'libraries' for Assembly?
Replies: 13
Views: 884

Re: Standardized 'libraries' for Assembly?

In general, size-coding and the concept of (soft loaded) libraries does not go well together. It's possible to write things that require specific optimizations in macros instead, if the assembler allows it. These can check for specific conditions like "only one column" or "no data&qu...
by tlr
Sat Aug 07, 2021 2:26 pm
Forum: Programming
Topic: Standardized 'libraries' for Assembly?
Replies: 13
Views: 884

Re: Standardized 'libraries' for Assembly?

In general, size-coding and the concept of (soft loaded) libraries does not go well together. For example you'll lose a lot of boundary optimization opportunities. For size-coding you'll want to keep any abstraction strictly in the source, perhaps just as comments, not to compromize the optimized bi...
by tlr
Tue Aug 03, 2021 10:45 am
Forum: Programming
Topic: Using XOR to invert only 1 bit?
Replies: 5
Views: 362

Re: Using XOR to invert only 1 bit?

Yeah, I did it the long way in this case, so the XOR should work. I just test for the sign bit and have separate increment and decrement routines depending on the velocity. No wonder I'm running out of space on such a simple game. My pathetic 6502 skills definitely need some help, which is why I'm ...
by tlr
Fri Jul 30, 2021 9:04 am
Forum: Programming
Topic: Testing for zero after DEC
Replies: 9
Views: 582

Re: Testing for zero after DEC

I found many other instances where I'm testing to set a flag that has already been set by another opcode. My 6502 gears haven't turned in 35+ yrs, so this is definitely a good workout. In any case, keeping track of the flags should become second nature when writing 65xx machine code. It's like seei...