Re: Worlds Worst Videocard BadApple Demo. I want more FPS!
Posted: Wed Nov 22, 2023 12:20 am
gfoot wrote:
Edit: I had a play with this, and this sort of code seems to work - at least I was able to initialise the card this way, I've left the details of the init sequence out though as they're as in your code above:
Code: Select all
; SD card interface test
;
; using bitbanging for NormalLuser
;
; SD_CS = CB2
; SD_SCK = CA2
; SD_MISO = PA0
; SD_MOSI = PB7
SD_BIT_MISO = $1 ; on Port A
SD_BIT_MOSI = $80 ; on Port B
; The low nybble sets CA2 (SD_SCK) in pulse output mode
;
; The high nybble sets CB2 (SD_CS) to output high or low
; CS is active-low, so "on" means low and "off" means high
;
PCR_CS_OFF = $ea ; CB2 low, CA2 pulse output mode
PCR_CS_ON = $ca ; CB2 high, CA2 pulse output mode
...
rts
What a huge help!
Just seeing a working read and write routine with this setup will keep me from a lot of frustration.
Thanks!
I can't wait to try them out! I can't quite use it as-is with my current setup since the CPU halts in this stock(ish) setup I need to use PB7 to do square wave audio.
I think that also means I can't use CB2??
viewtopic.php?f=2&t=562
"Unfortunately, T2CH will have no effect when using T2 for shift register timing. That means you're left with only 256 speeds, range from very, very high notes to ultrasonic. In fact, with a clock speed of about 10MHz or above, they'd all be ultrasonic. Not much good. Instead, use T1 free-running, toggling PB7 "
So, I think since I'm using PB7 for sound, and I am at 5mhz and 'dividing' the timer I can't use CB2?
Maybe not? The VIA is still pretty mysterious to me.
As for treating each bit on it's own....
Thanks! I really do need to be thinking that way!
I need to run the tests on Kowalski to run the cycle counts but I can think of a lot of ways I could use a simple:
Code: Select all
LDA VIAPortA
BEQ Not1
:IsOne I also could load two bits and use BCC and BCS to do a 3 way branch.....
I'm using 2 bit video (black/white/dark grey/light grey) so I need more than 1 bit to store color somehow, but I still can think of many things to do along these lines.
Again, I bet the Python Encoder will actually eat up all my time.....
One issue is that up until this point my encoder/decoder were both perfectly content to encode any arbitrary data and copy it into that 8k region of ram. Color images, program data, etc.
Some of my 'premature optimization' was that I wanted to also be able to encode in color as well as B/W.
I had ideas of a simple way of the encoder updating the lookup table as colors changed to improve performance with changing content without having to do a more complex encoder/decoder....
I am moving a little away from that for the moment because I am focused on getting this Bad Apple demo working properly.
Really appreciate all this help! I can't wait to use it!