Hello 6502 people.
While I've read a lot, this is my first post here.
I've been working on adding routines I'm creating for another project to EhBasic for a little while now and I thought I'd let the folks around here know in case it is of interest to anyone.
Thanks to this video from visrealm:
http://forum.6502.org/viewtopic.php?f=5&t=7459And lots of older posts around here and from Lee himself I've been able to add commands to EhBasic to support graphics and sound on my Ben Eater 6502 + Worlds Worst Video card kits.
Here is the code for that:
https://github.com/Fifty1Ford/BeEhBasicI made several GFX commands to blit image data onto the bitmapped screen including with transparency and with a self erasing outline with the color of your choice. A plot, and a horizontal line etc.
I made a few hardware changes also.
I've added the BEEP command using PB7 on the VIA hooked to a speaker per one of the posts here.
http://forum.6502.org/viewtopic.php?f=2&t=562adding a speaker with a capacitor and resistor.
Added capacitors and extra power wires so I can clock faster.
I also hooked a jumper up from the VGA V-sync to the CPU NMI. Some hack-y code that probably ruins the EhBasic
interrupt handler gives me a countdown timer on that v-sync interrupt now.
And lastly 3 more 74 series gates so I could turn some unmapped RAM into a hardware double buffer for the Worlds Worst Video Card kit.
Commands added:
PAUSE - timer does not use via, adjust for CPU speed
PEN - sets plot color 0-256, colors repeat every 64
PLOT - Plots to screen x/y 0-99 width, 0-63 height. No bounds checking. Draws off screen can cause issues.
CLS - Clears the screen (fill black) also stops any BEEP
GFXH - Horizontal line from location of last PLOT. length
GFXV - Vertical line from location of last PLOT. length
GSET - sets size of adjustable size sprite Width, Height/2
GFX - Fixed size sprite routine. x/y location
GFXA- Adjustable size draw/sprite routine. Background color boarder for 0 color. x/y location
GFXS- Simple adjustable sprite. x/y location
GFXT - Adjustable Transparent sprite. Color 0 is transparent. x/y location
COLOR - Fills screen a single color and also sets the BackColor in zero page.
MOVE - Self erasing pixel. Will remember last color when moved and redraw. x/y
BEEP - Square wave on PB7 VIA. 0 to 255 for tone.
BSET - Turns double buffer on/off. 1 on 0 off.
BUFF - Swaps buffer. (toggles PB0 on and off on VIA)
BUFV - Swaps buffer but waits for a V-sync NMI first.
I'm open to any suggestions of resources for what else to add or where I can find some useful code examples.