├── ABalls3.bin ├── ABalls3.png ├── BE6502DR.PLD ├── BE6502DR.abs ├── BE6502DR.doc ├── BE6502DR.jed ├── BE6502DR.pdf ├── BE6502DR.sim ├── BLANK0.bin ├── BallSprites.jpg ├── BasicBallss.gif ├── BasicShapes.bas ├── BeepApple.bas ├── BeepBasic.bin ├── BenEaterFastLoad.asm ├── BenEaterFastLoad500.txt ├── ColorDemo3.asm ├── Docs └── Documents.txt ├── DoubleBufferScroll.gif ├── EhBasicBeepPause.bin ├── Forest.bin ├── ForeverASCII300.txt ├── FullSpin.bas ├── Girl2.bin ├── L ├── MANDELBROT PLOT 64 COLOR RND ZOOM.gif ├── Makefile ├── PB7Speaker.jpg ├── PlasmaDemo.bas ├── PlasmaDemo.bin ├── PlasmaDemo.gif ├── Program2000.bin ├── RandomScreen.asm ├── Readme.md ├── RunningMan.gif ├── SmallMerge.bin ├── Source ├── BallDemo │ ├── ABalls3.bin │ ├── ABalls3.png │ ├── BallSprites.jpg │ ├── BasicShapes.bas │ ├── FullSpin.bas │ ├── MANDELBROT PLOT 64 COLOR RND ZOOM.gif │ ├── Makefile │ ├── Readme.md │ ├── Readme.txt │ ├── WozCall.asm │ ├── basic.asm │ ├── basic.bin │ ├── basic.cfg │ ├── basicWorkingBallSprite.bin │ ├── bk.bin │ ├── bkmove.bin │ └── min_mon.asm └── Readme.txt ├── SpritesAndBackground.bin ├── TransparentSprites.gif ├── Trebuchet.BAS ├── VGA Double Buffer Fifty1Ford.png ├── VGADoubleBufferFifty1Ford.png ├── WozCall.asm ├── WozFinch.txt ├── bFastfinch.bin ├── bFlower.bin ├── bNewBird.bin ├── basic.asm ├── basic.bin ├── basic.cfg ├── basicTransparentSprites.bin ├── basicWorkingBallSprite.bin ├── bchess.bin ├── bk.asm ├── bk.bin ├── bkmove.bin ├── min_mon.asm └── min_mon.o /ABalls3.bin: -------------------------------------------------------------------------------- 1 | ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????::??:::??*????????????????????????????????::::::::?*????????????????????????????????:::5:::::*???????????????????????????????055:????5055:*%???????????????????????????0:55:????:55:*%?????????????????????????????:505:???:5:**???????????????????????????:555?????500005?***????????????????????????:505:????:00000***:????????????????????????:5005?????:000%%*:???????????????????????:55:?????500000:?***%%:????????????????????:555??????500000****%??????????????????????:5555??????5000 %***????????????????????:???:00555:::5000:?***% %:????????????????:5????5555:::500000****%%:????????????????:55?????55:::?:0000 %***%:?????????????????::??:00050:?????:::?**** %*??????????????:5????5050005???::55***** %*??????????????:55?????:000000:::50 ****%*???????????????::???555555???????:05**** %*????????????:5????:555555:??????:*****% %*????????????:50:????:5555005????:*%****%%*?????????????::???555555:???????500 %*% %**??????????:5:????555555:???????: %*** %*???????????50:?????5555550:?????**%**** %*???????????*5???:55555:????????500 **% %*?????????*5:????:555555:???????: %% %?????????*505?????:5555555??????** %*% %????????????:5::::::55:???????:00 ****%*??????????5::::::55555????????% %**%*???????????::::??55555555?????*** %%*???????????500???????:???????:00 ******????????:0055??????::???????:% ****??????:???55555????::55:?????*** %**?????????:005???????:555:::?50 *****%????????5055:???????:5:::???* ***%??????:??:5555:???????:::???**** %*%?????????500:??????::5555555::% ******??????:0055????????555555::* ****????:???05555:????????555::**** **???????:005???????::5555555?****% ******??????:005:???????:5555500 ***% ***%????:??:05555????????:5500 %*% *%???????500:??????::5555555:?************??????0005:???????:5555500 ******% ***????:??50555:????????55500 ***% *?????:5::5:??????:55555555:******** %%**???:5::505????????5555550 %********%**????5::50555:????????5550 *****%%%??????:???5::????555555555********* ????5:???::??????:555555 %******** ????50:??::5????????:555 %*******?????::???0555:::55555555:********% *??:0????:55::???:555550 ********* *??:50:?????::??????:550 %********????::??:005555:?::55550*********% *??:0????:555555::55550 ********% *??:00?????:5555:::?550 *******%*????5:??:000555??????::%*********% %??55????5055555:???::% ********% %??:00?????:55555555::% ********????5:??:000005???????**%******** %??55????0000555:????****%********% %??:05?????50555555:?****%% %********????::??500000:?????**** %%*** *??::????0000000:??******* %%***** *??:55?????50000000*********%*******?????::?500000:????****% %%%*????:??:0000005??*******% %%%*??:?:????:0000000%*********% %%%*?????:00:50000:??******% ***?????00::0000005********* %?????:0::?:00000 %********* ??????:00:?::50:******** %***????500:::500 ********** *???::0005:500 ********** *?????*00:???:********** %*????*5005??:**%*********% ????*:5000::**% *********% ??????:% ****** %*****% %*????:* %******%******** *????:*% *******%*********% *??????:% ****** %%*% %*????:* %******% %%**** *????:** ********%%******* *???????%%%***** %**%% *??????*% %****** %%% %??????** %******* %%**% %????????:*%***** %*****%%*??????:*% ****** ***%%*??????:%% %******% %%*?????????******* ********????????********* %****%????????%**%%******% %*%???????????** %** %*****??????????***%**** %**??????????%*********% ?????????????*% %%% %*****??????????:** %%% %**??????????:***%%%*** *?????????????*% ***%% %***????????????**% %*%% %*????????????***% %%% *???????????????*% %****%*??????????????** %***%*??????????????**% %*%*?????????????????*%*????????????????*%*????????????????***???????????????????:%%???????????????????:%%???????????????????:%%???????????????????????**??????????????????????**??????????????????????**???????????????????????????%%???????????????????????????%%???????????????????????????**???????????????????????????????**%%***????????????????????????????????**%%***????????????????????????????????**%%***???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????::5::::: ???????????????????????????????????:5:::: ????????????????????????????????:???:::?? ???????????????????????????????:??:5005:?:::**???????????????????????????0???:50005:::**???????????????????????????0::???:5005::*%???????????????????????????????50005?????:0%%%:??????????????????????::???:00005?????%%*:??????????????????????:5:????500005???***:??????????????????????????:55005??????:0 %**????????????????????5:???:00005??????% %*????????????????????55:????500000:???** %%:????????????????????555:?????:::????50 ***:??????????????????5505????:::??????% **:???????????????????:0005??:::55????** *:??????????????????:00:?????:00005::50 %****????????????????:005???????505:::?% %***?????????????????:0005???????::::?**% %**????????????????:00:??????5500000:?:*% %***%*??????????????:005:??????:0000005*% ****???????????????:0555:???????50005**% %**??????????????:505??????:5550000:??********%*????????????:005:???????50000005****%%**%*?????????????:05555???????:00000 **% %***???????????*?500:??????55555005???****%%**%%?????????*??0055???????:5500000:********%%?????????*???55555:???????:00000 ****%**%???????????5???:::????:5555550:??*****% %%%????????5:???::???????55550000******* %%%????????:55??::::????????50000 *****%%%?????????::???:5555::?::55550:??*****% *??????:5:????:55:::?:55550000*******% *???????50:?????::::????:50000 %****** *????????5:???5555::?????::55:?******% %??????50?????55::::5??::5500 *******% %??????:00??????::::555::5500 %****** %???????:5???:555:::????????:::****** *????:5:????:5::::::??????::%*******% *?????505?????:::::5555???::% %****** *??????::???5555:::????????:0 %**** %????:0?????555:::::???????**%******% *????:50:?????:::::555:????*********** *??????5???:55555:?????????:0 %%% ????55????:555:::5????????** %%**% ????:00??????5:::5555:????****%%%**** ???????::?:55555:?????????5 %**%% ?????::???:555555:???????**% %%% ???:?::?????:55555555????*****% %%* ??????:005?::555:????????: %****?????:005::555555:??????*** **??????:05::?:5555555:???****** ??????:005?????::????????: ******????5000:???::55:??????*** %***??:??:00555?::55555:???****** *?????:00:??????55:::????% ******????5000:??????:::????**** %***??:??50005:????::55:??******* *?????500:??????555555::*% *****????0000:??????:555::****% %*%??:??50000:???????:::*******% %?????500:?????:5555550 %**%% %*****????0000???????:5550 %**% %*%??:??00000:???????:0 %*****% %????:500:?????:00000 ******%% %****??::0005???????:00 %**%% %*??::?00000????????* %%% *????:::5:?????:0000 *********%%%*??:5:505???????50 ******%%%*??:5:50005???????*% %**%%%*?????:??::????500 %********* ????5??::??????: ********%????55?:505?????*** ******?????::??505:::0 %********% *??:5:??:5::??** %*********???50???:::??***** %******?????*:?50000%*% *********% ????%:??:000%*** %*******????%0:???:0%****** %****??????:**% %****% ********* *????:**** **% ********????: ***** %**% *****??????:*** %*******%********%*????:%*** *****%% %*******????:%***** **%% %****???????*** %******** %%*****%??????**** ********%*****%??????*%**** %*****%% %***????????:%* %*******% %%*???????%**% ********% %%*???????***** %********%%*?????????% %% %******* %????????*%%% %******** *????????*%%** ********% *???????????%%**%%******* ??????????% %*% %*******% ??????????*% %% ********????????????:%****%*****% *??????????:% ***%%*******% :???????????% **%% ********?????????????*%*** %%**% *????????????*%%****%%****%*????????????*% %****%******???????????????*%**% %*??????????????*%%*** %*??????????????*% ****% %*?????????????????***????????????????*%:????????????????*%*???????????????????:%%???????????????????:**???????????????????:%*???????????????????????**??????????????????????**??????????????????????**???????????????????????????**???????????????????????????**???????????????????????????%%???????????????????????????????**%%***????????????????????????????????**%%***????????????????????????????????**%%***??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????::??:::??*???????????????????????????????????????????????????????????????????????????????????????????????????????????????????055:????5055:*%???????????????????????????????????????????????????????????????????????????????????????????????????????????????:55:????:50000:?***????????????????????????????????????????????????????????????????????????????????????????????????????????????:55:?????500000:?***%%:???????????????????????????????????????????????????????????????????????????????????????????????????????:???:0055:?::5005??***% %:?????????????????????????????????????????????????????????????????????????????????????????????????????:???:00050:?????:::?**** %*???????????????????????????????????????????????????????????????????????????????????????????????????::??:55555:???????:05**** **?????????????????????????????????????????????????????????????????????????????????????????????????::???555555????????500 %%% %**???????????????????????????????????????????????????????????????????????????????????????????????*:???:55555:???????:000 **% %*????????????????????????????????????????????????????????????????????????????????????????????????:5::::::55????????:00 ****%*???????????????????????????????????????????????????????????????????????????????????????????????005???????:???????500 ******?????????????????????????????????????????????????????????????????????????????????????????????:00:??????::555:::?50 *****%?????????????????????????????????????????????????????????????????????????????????????????????000???????::555555:::% %******???????????????????????????????????????????????????????????????????????????????????????????:005???????::555555:?****% %******???????????????????????????????????????????????????????????????????????????????????????????500:??????::5555555:?************?????????????????????????????????????????????????????????????????????????????????????????::::5???????555555555?******** %%**??????????????????????????????????????????????????????????????????????????????????????????:???5::???:55555555:********% ?????????????????????????????????????????????????????????????????????????????????????????::??:0555:::55555555:********% *????????????????????????????????????????????????????????????????????????????????????????::??:005555??::55555*********% *????????????????????????????????????????????????????????????????????????????????????????5:??:000555?????:::%********* %????????????????????????????????????????????????????????????????????????????????????????5:??500000:???????**%******** %????????????????????????????????????????????????????????????????????????????????????????::??500000:?????***% %%**% *?????????????????????????????????????????????????????????????????????????????????????????5:?500000:????**** %%%*?????????????????????????????????????????????????????????????????????????????????????????500:50000:??****** %***??????????????????????????????????????????????????????????????????????????????????????????:00:?::55?******** %***?????????????????????????????????????????????????????????????????????????????????????????*00:???:*********% %*??????????????????????????????????????????????????????????????????????????????????????????:% ****** %***** %**???????????????????????????????????????????????????????????????????????????????????????????% ****** %%*% %*???????????????????????????????????????????????????????????????????????????????????????????%%%***** ***%% *????????????????????????????????????????????????????????????????????????????????????????????:*%***** ******%%*?????????????????????????????????????????????????????????????????????????????????????????????**%**** %********???????????????????????????????????????????????????????????????????????????????????????????????** %** %*****?????????????????????????????????????????????????????????????????????????????????????????????????*% %%% %*****?????????????????????????????????????????????????????????????????????????????????????????????????*% %***%% %***???????????????????????????????????????????????????????????????????????????????????????????????????*% *****%*?????????????????????????????????????????????????????????????????????????????????????????????????????*%*???????????????????????????????????????????????????????????????????????????????????????????????????????:%%???????????????????????????????????????????????????????????????????????????????????????????????????????????**???????????????????????????????????????????????????????????????????????????????????????????????????????????????%%???????????????????????????????????????????????????????????????????????????????????????????????????????????????????**%%***???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? -------------------------------------------------------------------------------- /ABalls3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/ABalls3.png -------------------------------------------------------------------------------- /BE6502DR.PLD: -------------------------------------------------------------------------------- 1 | Name BE6502DR; /* - NormalLuser 6502 Double Buffer 32k Ram 32k ROM 2x1 bit Registers and 6 I/O ATF22V10 PLD Address Decoder */ 2 | PartNo 01 ; /* This is a 1 chip PLD solution to provide access to all 32K of RAM and all 32k of ROM while still */ 3 | Date 5/04/2024 ; /* allowing 4 IO Devices as well as Hardware Double Buffered Video and a Phi qualified R/W. */ 4 | Revision 03 ; /* I/O devices at Stock $4000, $6000, and 4 more at IE $4010, $4020, $4040 $4080. */ 5 | Designer NormalLuser ;/* * Hidden bytes'under' the IO of could RAM accessed via the double buffer bank system if mapped to $7fxx */ 6 | Company NormalL ; /* I.E. With the Double Buffer enabled access last 240 bytes via $3F10 - $3FFF while in bank 1. */ 7 | Assembly One ; /* - This project made possible by the hard work of Dawid Buchwald shown here: - */ 8 | Location ; /* - https://hackaday.io/project/174128-db6502/log/183434-address-decoding-and-how-to-get-it-right - */ 9 | Device g22V10 ; /* Inputs: 65C02, Clock, DMA, VIA output for Double Buffer enable and Buffer Bank swap for ATF22V10C */ 10 | Pin 1 = CLK; /* Phi 2 in */ 11 | Pin 2 = RW; /* Read/Write */ 12 | Pin 3 = DMA; /* DMA from Worlds Worst Video Card */ 13 | Pin 4 = A15; /* Upper 12 CPU Address lines, lower 4 bits not decoded */ 14 | Pin 5 = A14; /* I/O 1 $4000 Ben Eater ACIA Serial Port */ 15 | Pin 6 = A13; /* I/O 2 $6000 Ben Eater VIA dual interface port */ 16 | Pin 7 = A12; 17 | Pin 8 = A11; 18 | Pin 9 = A10; 19 | Pin 10 = A9; 20 | Pin 11 = A8; /* Address lines 4 - 7 used as I/O select */ 21 | Pin 13 = A7; /* I/O 6 $xx80 */ 22 | Pin 14 = A6; /* I/O 5 $xx40 */ 23 | Pin 15 = A5; /* I/O 4 $xx20 */ 24 | Pin 16 = A4; /* I/O 3 $xx10 */ 25 | /* Register Pins: */ 26 | Pin 17 = BANKSELECT; /* Pin used as 1 Bit Register. No connect or status LED. Replaces Video Buffer Bank select from VIA output pin.*/ 27 | Pin 18 = SINGLEBUFFER; /* Pin used as 1 Bit Register. No connect or status LED. Replaces Single Buffer Bank select from VIA output pin.*/ 28 | /* Outputs: * Outputs: */ 29 | Pin 23 = RAM_B14; /* to RAM Address 14 */ 30 | Pin 22 = ROM_CS; /* to ROM /CS pin */ 31 | Pin 21 = PWRITE; /* to Ph2 qualified R /W pin */ 32 | Pin 20 = IO_CS; /* to IO /CS pins */ 33 | Pin 19 = RAM_CS; /* to RAM /CS pin */ 34 | FIELD Address = [A15..A4]; /* Address setup for below logic from Dawid Buchwald link above. THANKS! Made this whole thing easy! */ 35 | RAM = Address:[0000..7FFF];/* Lower 32 KB $0-$7FFF. Buffer Shadow is $6000-7FFF. I/O shadow RAM starting at $6000 fully accessable in Buffer mode at $3F10 */ 36 | VIDEO = Address:[2000..3FFF];/* Worlds Worst Video Card maps to $2000 to $3FFF (100 on screen bytes, and 28 off screen bytes per line) */ 37 | IO_ALT = Address:[4000]; /* Ben Eater compatable Mapping for new IO 4 16 bytes */ 38 | IO_1 = Address:[5000]; /* Ben Eater Mapping for ACIA 16 bytes. If you move the IO to $6000 through $7FFF you can use the double buffer for access */ 39 | IO_2 = Address:[6000]; /* Ben Eater Mapping for VIA 16 bytes. the shadow RAM under the IO mapping. IE $6000-$7FFF swaps with $2000-$3FFF */ 40 | IO_3 = Address:[5010]; /* Mapping for new IO 3 16 bytes Currently the registers also writes to RAM but they do not have to */ 41 | IO_4 = Address:[5020]; /* Mapping for new IO 4 16 bytes */ 42 | IO_5 = Address:[5040]; /* Mapping for new IO 4 16 bytes */ 43 | IO_6 = Address:[5080]; /* Mapping for new IO 4 16 bytes */ 44 | ROM = Address:[8000..FFFF];/* Upper 32 KB $8000-$FFFF */ 45 | /* Register Addresses: */ 46 | BANK_ON = Address:[4010]; /* On for 1 Bit Register 16 bytes */ 47 | BANK_OFF = Address:[4020]; /* Off for 1 Bit Register 16 bytes */ 48 | SINGLE_ON = Address:[4030]; /* On for 1 Bit Register 16 bytes */ 49 | SINGLE_OFF= Address:[4040]; /* Off for 1 Bit Register 16 bytes */ 50 | /* Register Logic: */ 51 | BANKSELECT.ar = 'b'0; /* No Reset */ 52 | BANKSELECT.sp = CLK; /* Clock data in with CLK */ 53 | BANK_CHANGED = BANK_ON # BANK_OFF; /* If 1 of our register Address get selected 1 else 0 */ 54 | BANK_VALUE = BANK_CHANGED & BANK_ON; /* If changed and ON register address 1 else 0 */ 55 | BANKSELECT.d = (!RW & (BANK_CHANGED & BANK_VALUE)) # (!BANK_CHANGED & BANKSELECT); /* If it is a write and changed set to new data, else use old data. */ 56 | SINGLEBUFFER.ar = 'b'0; /* No Reset */ 57 | SINGLEBUFFER.sp = CLK; /* Clock data in with CLK */ 58 | SINGLE_CHANGED = SINGLE_ON # SINGLE_OFF; /* If 1 of our register Address get selected 1 else 0 */ 59 | SINGLE_VALUE = SINGLE_CHANGED & SINGLE_ON;/* If changed and ON register address 1 else 0 */ 60 | SINGLEBUFFER.d = (!RW & (SINGLE_CHANGED & SINGLE_VALUE)) # (!SINGLE_CHANGED & SINGLEBUFFER); /* If it is a write and changed set to new data, else use old data. */ 61 | /* Double Buffer/Bank Logic: $Xor #Or &AND !NOT */ 62 | BANK_RESULT = DMA $ BANKSELECT; /* DMA _Xor_ Bank Select */ 63 | BANK_OVERRIDE = !(BANK_RESULT # SINGLEBUFFER);/* !NOT ( Bank Result _Or_ Single Buffer Override ) I invert this so that the RAM is mapped normal in single buffer mode */ 64 | BANK_SELECT = VIDEO & BANK_OVERRIDE; /* In Video Address Range _And_ Bank with Override */ 65 | IO_SHADOW = IO_1 # IO_2 # IO_ALT # IO_3 # IO_4 # IO_5; /* # IO_6; */ 66 | /* Pin Out * * Pin Out */ 67 | RAM_B14 = A14 # BANK_SELECT; /* Address 14 $4000+ _OR_ $2000+ With Bank Select */ 68 | !RAM_CS = RAM & !IO_SHADOW ; /* All of the NON ROM or IO address space is RAM IE 32k - 64 bytes */ 69 | !ROM_CS = ROM; /*& RW; /* All of the ROM address range upper 32k. Should I disable output on write? */ 70 | !IO_CS = IO_SHADOW; /* Got fancy, only 64 bytes used for 4 I/O devices and a Ben compatable mem map to boot! */ 71 | !PWRITE = (CLK &!RW) & !BANK_CHANGED & !SINGLE_CHANGED; /* Clock qualified Write, don't write to RAM on Register writes so it can overlay double buffer at $6000-$7FFF */ 72 | /* NormalLuser Ben Eater 6502 Double Buffer 32k Ram 32k ROM 6 I/O ATF22V10 PLD Address Decoder */ 73 | -------------------------------------------------------------------------------- /BE6502DR.abs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/BE6502DR.abs -------------------------------------------------------------------------------- /BE6502DR.doc: -------------------------------------------------------------------------------- 1 | 2 | ******************************************************************************* 3 | BE6502DR 4 | ******************************************************************************* 5 | 6 | CUPL(WM) 5.0a Serial# 60008009 7 | Device g22v10 Library DLIB-h-40-1 8 | Created Sun May 12 20:07:45 2024 9 | Name BE6502DR 10 | Partno 01 11 | Revision 03 12 | Date 5/04/2024 13 | Designer NormalLuser 14 | Company NormalL 15 | Assembly One 16 | Location 17 | 18 | =============================================================================== 19 | Expanded Product Terms 20 | =============================================================================== 21 | 22 | Address => 23 | A15 , A14 , A13 , A12 , A11 , A10 , A9 , A8 , A7 , A6 , A5 , A4 24 | 25 | BANKSELECT.d => 26 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 & 27 | !RW 28 | # A15 & BANKSELECT 29 | # !A14 & BANKSELECT 30 | # A13 & BANKSELECT 31 | # A12 & BANKSELECT 32 | # A11 & BANKSELECT 33 | # A10 & BANKSELECT 34 | # A9 & BANKSELECT 35 | # A8 & BANKSELECT 36 | # A7 & BANKSELECT 37 | # A6 & BANKSELECT 38 | # A4 & A5 & BANKSELECT 39 | # !A4 & !A5 & BANKSELECT 40 | 41 | BANKSELECT.ar => 42 | 0 43 | 44 | BANKSELECT.sp => 45 | CLK 46 | 47 | BANK_CHANGED => 48 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 49 | # !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 50 | 51 | BANK_OFF => 52 | !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 53 | 54 | BANK_ON => 55 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 56 | 57 | BANK_OVERRIDE => 58 | !BANKSELECT & !DMA & !SINGLEBUFFER 59 | # BANKSELECT & DMA & !SINGLEBUFFER 60 | 61 | BANK_RESULT => 62 | !BANKSELECT & DMA 63 | # BANKSELECT & !DMA 64 | 65 | BANK_SELECT => 66 | A13 & !A14 & !A15 & BANKSELECT & DMA & !SINGLEBUFFER 67 | # A13 & !A14 & !A15 & !BANKSELECT & !DMA & !SINGLEBUFFER 68 | 69 | BANK_VALUE => 70 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 71 | 72 | IO_1 => 73 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 74 | 75 | IO_2 => 76 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & A13 & A14 & !A15 77 | 78 | IO_3 => 79 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 80 | 81 | IO_4 => 82 | !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 83 | 84 | IO_5 => 85 | !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 86 | 87 | IO_6 => 88 | !A4 & !A5 & !A6 & A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 89 | 90 | IO_ALT => 91 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 92 | 93 | !IO_CS => 94 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A13 & A14 & !A15 95 | # !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & A13 & A14 & !A15 96 | # A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 97 | # !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 98 | # !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 99 | 100 | IO_SHADOW => 101 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A13 & A14 & !A15 102 | # !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & A13 & A14 & !A15 103 | # A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 104 | # !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 105 | # !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 106 | 107 | !PWRITE => 108 | A15 & CLK & !RW 109 | # !A14 & CLK & !RW 110 | # A13 & CLK & !RW 111 | # A12 & CLK & !RW 112 | # A11 & CLK & !RW 113 | # A10 & CLK & !RW 114 | # A9 & CLK & !RW 115 | # A8 & CLK & !RW 116 | # A7 & CLK & !RW 117 | # !A4 & !A5 & !A6 & CLK & !RW 118 | # A4 & A6 & CLK & !RW 119 | # A5 & A6 & CLK & !RW 120 | 121 | RAM => 122 | !A15 123 | 124 | RAM_B14 => 125 | A14 126 | # A13 & !A14 & !A15 & BANKSELECT & DMA & !SINGLEBUFFER 127 | # A13 & !A14 & !A15 & !BANKSELECT & !DMA & !SINGLEBUFFER 128 | 129 | !RAM_CS => 130 | !A14 & !A15 131 | # A12 & A13 & !A15 132 | # A6 & A13 & !A15 133 | # A5 & A13 & !A15 134 | # A4 & A13 & !A15 135 | # A6 & !A12 & !A15 136 | # A5 & !A12 & !A15 137 | # A4 & !A12 & !A15 138 | # A11 & !A15 139 | # A10 & !A15 140 | # A9 & !A15 141 | # A8 & !A15 142 | # A7 & !A15 143 | # A5 & A6 & !A15 144 | # A4 & A6 & !A15 145 | # A4 & A5 & !A15 146 | 147 | ROM => 148 | A15 149 | 150 | !ROM_CS => 151 | A15 152 | 153 | SINGLEBUFFER.d => 154 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 & 155 | !RW 156 | # A15 & SINGLEBUFFER 157 | # !A14 & SINGLEBUFFER 158 | # A13 & SINGLEBUFFER 159 | # A12 & SINGLEBUFFER 160 | # A11 & SINGLEBUFFER 161 | # A10 & SINGLEBUFFER 162 | # A9 & SINGLEBUFFER 163 | # A8 & SINGLEBUFFER 164 | # A7 & SINGLEBUFFER 165 | # !A5 & !A6 & SINGLEBUFFER 166 | # !A4 & !A6 & SINGLEBUFFER 167 | # A5 & A6 & SINGLEBUFFER 168 | # !A4 & A5 & SINGLEBUFFER 169 | # A4 & !A5 & SINGLEBUFFER 170 | # A4 & A6 & SINGLEBUFFER 171 | 172 | SINGLEBUFFER.ar => 173 | 0 174 | 175 | SINGLEBUFFER.sp => 176 | CLK 177 | 178 | SINGLE_CHANGED => 179 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 180 | # !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 181 | 182 | SINGLE_OFF => 183 | !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 184 | 185 | SINGLE_ON => 186 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 187 | 188 | SINGLE_VALUE => 189 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 190 | 191 | VIDEO => 192 | A13 & !A14 & !A15 193 | 194 | A4.oe => 195 | 0 196 | 197 | A5.oe => 198 | 0 199 | 200 | A6.oe => 201 | 0 202 | 203 | BANKSELECT.oe => 204 | 1 205 | 206 | IO_CS.oe => 207 | 1 208 | 209 | PWRITE.oe => 210 | 1 211 | 212 | RAM_B14.oe => 213 | 1 214 | 215 | RAM_CS.oe => 216 | 1 217 | 218 | ROM_CS.oe => 219 | 1 220 | 221 | SINGLEBUFFER.oe => 222 | 1 223 | 224 | 225 | =============================================================================== 226 | Symbol Table 227 | =============================================================================== 228 | 229 | Pin Variable Pterms Max Min 230 | Pol Name Ext Pin Type Used Pterms Level 231 | --- -------- --- --- ---- ------ ------ ----- 232 | 233 | A4 16 V - - - 234 | A5 15 V - - - 235 | A6 14 V - - - 236 | A7 13 V - - - 237 | A8 11 V - - - 238 | A9 10 V - - - 239 | A10 9 V - - - 240 | A11 8 V - - - 241 | A12 7 V - - - 242 | A13 6 V - - - 243 | A14 5 V - - - 244 | A15 4 V - - - 245 | Address 0 F - - - 246 | BANKSELECT 17 V - - - 247 | BANKSELECT d 17 X 13 14 1 248 | BANKSELECT ar 17 X 1 1 1 249 | BANKSELECT sp 17 X 1 1 1 250 | BANK_CHANGED 0 I 2 - - 251 | BANK_OFF 0 I 1 - - 252 | BANK_ON 0 I 1 - - 253 | BANK_OVERRIDE 0 I 2 - - 254 | BANK_RESULT 0 I 2 - - 255 | BANK_SELECT 0 I 2 - - 256 | BANK_VALUE 0 I 1 - - 257 | CLK 1 V - - - 258 | DMA 3 V - - - 259 | IO_1 0 I 1 - - 260 | IO_2 0 I 1 - - 261 | IO_3 0 I 1 - - 262 | IO_4 0 I 1 - - 263 | IO_5 0 I 1 - - 264 | IO_6 0 I 1 - - 265 | IO_ALT 0 I 1 - - 266 | IO_CS 20 V 5 14 1 267 | IO_SHADOW 0 I 5 - - 268 | PWRITE 21 V 12 12 1 269 | RAM 0 I 1 - - 270 | RAM_B14 23 V 3 8 1 271 | RAM_CS 19 V 16 16 1 272 | ROM 0 I 1 - - 273 | ROM_CS 22 V 1 10 1 274 | RW 2 V - - - 275 | SINGLEBUFFER 18 V - - - 276 | SINGLEBUFFER d 18 X 16 16 1 277 | SINGLEBUFFER ar 18 X 1 1 1 278 | SINGLEBUFFER sp 18 X 1 1 1 279 | SINGLE_CHANGED 0 I 2 - - 280 | SINGLE_OFF 0 I 1 - - 281 | SINGLE_ON 0 I 1 - - 282 | SINGLE_VALUE 0 I 1 - - 283 | VIDEO 0 I 1 - - 284 | A4 oe 16 D 1 1 0 285 | A5 oe 15 D 1 1 0 286 | A6 oe 14 D 1 1 0 287 | BANKSELECT oe 17 D 1 1 0 288 | IO_CS oe 20 D 1 1 0 289 | PWRITE oe 21 D 1 1 0 290 | RAM_B14 oe 23 D 1 1 0 291 | RAM_CS oe 19 D 1 1 0 292 | ROM_CS oe 22 D 1 1 0 293 | SINGLEBUFFER oe 18 D 1 1 0 294 | 295 | 296 | LEGEND D : default variable F : field G : group 297 | I : intermediate variable N : node M : extended node 298 | U : undefined V : variable X : extended variable 299 | T : function 300 | 301 | 302 | =============================================================================== 303 | Fuse Plot 304 | =============================================================================== 305 | 306 | SP 307 | 05764 x------------------------------------------- 308 | 309 | AR 310 | 00000 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 311 | 312 | Pin #23 05808 Mode -- 313 | 00044 -------------------------------------------- 314 | 00088 ----------------x--------------------------- 315 | 00132 --------x----x---x--x-x----x---------------- 316 | 00176 ---------x---x---x--x-x---x----------------- 317 | 00220 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 318 | 00264 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 319 | 00308 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 320 | 00352 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 321 | 00396 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 322 | Pin #22 05810 Mode x- 323 | 00440 -------------------------------------------- 324 | 00484 ------------x------------------------------- 325 | 00528 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 326 | 00572 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 327 | 00616 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 328 | 00660 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 329 | 00704 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 330 | 00748 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 331 | 00792 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 332 | 00836 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 333 | 00880 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 334 | Pin #21 05812 Mode x- 335 | 00924 -------------------------------------------- 336 | 00968 x----x------x------------------------------- 337 | 01012 x----x-----------x-------------------------- 338 | 01056 x----x--------------x----------------------- 339 | 01100 x----x------------------x------------------- 340 | 01144 x----x----------------------x--------------- 341 | 01188 x----x--------------------------x----------- 342 | 01232 x----x------------------------------x------- 343 | 01276 x----x----------------------------------x--- 344 | 01320 x----x------------------------------------x- 345 | 01364 x----x-------------------------x---x---x---- 346 | 01408 x----x------------------------x-------x----- 347 | 01452 x----x----------------------------x---x----- 348 | Pin #20 05814 Mode x- 349 | 01496 -------------------------------------------- 350 | 01540 -------------x--x----x-------x-x-x-x-x-x-x-x 351 | 01584 -------------x--x---x----x---x-x-x-x-x-x-x-x 352 | 01628 -------------x--x----x--x----xx--x-x-x-x-x-x 353 | 01672 -------------x--x----x--x----x-x-xx--x-x-x-x 354 | 01716 -------------x--x----x--x----x-x-x-x-xx--x-x 355 | 01760 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 356 | 01804 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 357 | 01848 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 358 | 01892 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 359 | 01936 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 360 | 01980 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 361 | 02024 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 362 | 02068 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 363 | 02112 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 364 | Pin #19 05816 Mode x- 365 | 02156 -------------------------------------------- 366 | 02200 -------------x---x-------------------------- 367 | 02244 -------------x------x---x------------------- 368 | 02288 -------------x------x-----------------x----- 369 | 02332 -------------x------x-------------x--------- 370 | 02376 -------------x------x---------x------------- 371 | 02420 -------------x-----------x------------x----- 372 | 02464 -------------x-----------x--------x--------- 373 | 02508 -------------x-----------x----x------------- 374 | 02552 -------------x--------------x--------------- 375 | 02596 -------------x------------------x----------- 376 | 02640 -------------x----------------------x------- 377 | 02684 -------------x--------------------------x--- 378 | 02728 -------------x----------------------------x- 379 | 02772 -------------x--------------------x---x----- 380 | 02816 -------------x----------------x-------x----- 381 | 02860 -------------x----------------x---x--------- 382 | Pin #18 05818 Mode -x 383 | 02904 -------------------------------------------- 384 | 02948 -----x-------x--x----x---x---xx--xx--x-x-x-x 385 | 02992 ------------x----------x-------------------- 386 | 03036 -----------------x-----x-------------------- 387 | 03080 --------------------x--x-------------------- 388 | 03124 -----------------------xx------------------- 389 | 03168 -----------------------x----x--------------- 390 | 03212 -----------------------x--------x----------- 391 | 03256 -----------------------x------------x------- 392 | 03300 -----------------------x----------------x--- 393 | 03344 -----------------------x------------------x- 394 | 03388 -----------------------x-----------x---x---- 395 | 03432 -----------------------x-------x-------x---- 396 | 03476 -----------------------x----------x---x----- 397 | 03520 -----------------------x-------x--x--------- 398 | 03564 -----------------------x------x----x-------- 399 | 03608 -----------------------x------x-------x----- 400 | Pin #17 05820 Mode -x 401 | 03652 -------------------------------------------- 402 | 03696 -----x-------x--x----x---x---xx--x-x-x-x-x-x 403 | 03740 ------------x--------------x---------------- 404 | 03784 -----------------x---------x---------------- 405 | 03828 --------------------x------x---------------- 406 | 03872 ------------------------x--x---------------- 407 | 03916 ---------------------------xx--------------- 408 | 03960 ---------------------------x----x----------- 409 | 04004 ---------------------------x--------x------- 410 | 04048 ---------------------------x------------x--- 411 | 04092 ---------------------------x--------------x- 412 | 04136 ---------------------------x----------x----- 413 | 04180 ---------------------------x--x---x--------- 414 | 04224 ---------------------------x---x---x-------- 415 | 04268 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 416 | Pin #16 05822 Mode x- 417 | 04312 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 418 | 04356 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 419 | 04400 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 420 | 04444 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 421 | 04488 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 422 | 04532 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 423 | 04576 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 424 | 04620 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 425 | 04664 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 426 | 04708 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 427 | 04752 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 428 | 04796 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 429 | 04840 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 430 | Pin #15 05824 Mode x- 431 | 04884 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 432 | 04928 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 433 | 04972 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 434 | 05016 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 435 | 05060 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 436 | 05104 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 437 | 05148 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 438 | 05192 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 439 | 05236 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 440 | 05280 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 441 | 05324 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 442 | Pin #14 05826 Mode x- 443 | 05368 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 444 | 05412 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 445 | 05456 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 446 | 05500 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 447 | 05544 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 448 | 05588 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 449 | 05632 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 450 | 05676 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 451 | 05720 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 452 | 453 | 454 | LEGEND X : fuse not blown 455 | - : fuse blown 456 | 457 | =============================================================================== 458 | Chip Diagram 459 | =============================================================================== 460 | 461 | ______________ 462 | | BE6502DR | 463 | CLK x---|1 24|---x Vcc 464 | RW x---|2 23|---x RAM_B14 465 | DMA x---|3 22|---x ROM_CS 466 | A15 x---|4 21|---x PWRITE 467 | A14 x---|5 20|---x IO_CS 468 | A13 x---|6 19|---x RAM_CS 469 | A12 x---|7 18|---x SINGLEBUFFER 470 | A11 x---|8 17|---x BANKSELECT 471 | A10 x---|9 16|---x A4 472 | A9 x---|10 15|---x A5 473 | A8 x---|11 14|---x A6 474 | GND x---|12 13|---x A7 475 | |______________| 476 | 477 | -------------------------------------------------------------------------------- /BE6502DR.jed: -------------------------------------------------------------------------------- 1 |  2 | CUPL(WM) 5.0a Serial# 60008009 3 | Device g22v10 Library DLIB-h-40-1 4 | Created Sun May 12 20:07:45 2024 5 | Name BE6502DR 6 | Partno 01 7 | Revision 03 8 | Date 5/04/2024 9 | Designer NormalLuser 10 | Company NormalL 11 | Assembly One 12 | Location 13 | *QP24 14 | *QF5892 15 | *G0 16 | *F0 17 | *L00032 00000000000011111111111111111111 18 | *L00064 11111111111111111111111111111111 19 | *L00096 11111111011111111111111111111111 20 | *L00128 11111111111101111011101101011110 21 | *L00160 11111111111111111111111110111011 22 | *L00192 10110101110111111111111111110000 23 | *L00416 00000000000000000000000011111111 24 | *L00448 11111111111111111111111111111111 25 | *L00480 11111111111111110111111111111111 26 | *L00512 11111111111111110000000000000000 27 | *L00896 00000000000000000000000000001111 28 | *L00928 11111111111111111111111111111111 29 | *L00960 11111111011110111111011111111111 30 | *L00992 11111111111111111111011110111111 31 | *L01024 11111011111111111111111111111111 32 | *L01056 01111011111111111111011111111111 33 | *L01088 11111111111101111011111111111111 34 | *L01120 11110111111111111111111101111011 35 | *L01152 11111111111111111111011111111111 36 | *L01184 11110111101111111111111111111111 37 | *L01216 11110111111111110111101111111111 38 | *L01248 11111111111111111111011111110111 39 | *L01280 10111111111111111111111111111111 40 | *L01312 11110111011110111111111111111111 41 | *L01344 11111111111111111101011110111111 42 | *L01376 11111111111111111110111011101111 43 | *L01408 01111011111111111111111111111101 44 | *L01440 11111101111101111011111111111111 45 | *L01472 11111111111111011101111111111111 46 | *L01504 11111111111111111111111111111111 47 | *L01536 11111111111111111011011110111111 48 | *L01568 10101010101010101111111111111011 49 | *L01600 01110111101110101010101010101111 50 | *L01632 11111111101101111011011110011010 51 | *L01664 10101010111111111111101101111011 52 | *L01696 01111010100110101010111111111111 53 | *L01728 10110111101101111010101010011010 54 | *L02144 00000000000011111111111111111111 55 | *L02176 11111111111111111111111111111111 56 | *L02208 11111011101111111111111111111111 57 | *L02240 11111111111111111011111101110111 58 | *L02272 11111111111111111111111111111011 59 | *L02304 11110111111111111111110111111111 60 | *L02336 11111111101111110111111111111101 61 | *L02368 11111111111111111111101111110111 62 | *L02400 11111101111111111111111111111111 63 | *L02432 10111111111110111111111111011111 64 | *L02464 11111111111110111111111110111111 65 | *L02496 11011111111111111111111110111111 66 | *L02528 11111011110111111111111111111111 67 | *L02560 11111011111111111111011111111111 68 | *L02592 11111111111111111011111111111111 69 | *L02624 11110111111111111111111111111011 70 | *L02656 11111111111111111111011111111111 71 | *L02688 11111111101111111111111111111111 72 | *L02720 11110111111111111111101111111111 73 | *L02752 11111111111111111101111111111111 74 | *L02784 10111111111111111111110111011111 75 | *L02816 11111111111110111111111111111101 76 | *L02848 11111101111111111111111110111111 77 | *L02880 11111111110111011111111111111111 78 | *L02912 11111111111111111111111111111111 79 | *L02944 11111111101111111011011110111011 80 | *L02976 10011001101010101111111111110111 81 | *L03008 11111110111111111111111111111111 82 | *L03040 11111111111110111110111111111111 83 | *L03072 11111111111111111111111111110110 84 | *L03104 11111111111111111111111111111111 85 | *L03136 11111111111001111111111111111111 86 | *L03168 11111111111111111111111011110111 87 | *L03200 11111111111111111111111111111111 88 | *L03232 11101111111101111111111111111111 89 | *L03264 11111111111111101111111111110111 90 | *L03296 11111111111111111111111111101111 91 | *L03328 11111111111101111111111111111111 92 | *L03360 11111110111111111111111111011111 93 | *L03392 11111111111111111110111111111110 94 | *L03424 11101111111111111111111111111110 95 | *L03456 11111110111111101111111111111111 96 | *L03488 11111111111011111111110111011111 97 | *L03520 11111111111111111111111011111110 98 | *L03552 11011111111111111111111111111111 99 | *L03584 11101111110111101111111111111111 100 | *L03616 11111111111111101111110111111101 101 | *L03648 11111111111111111111111111111111 102 | *L03680 11111111111111111111101111111011 103 | *L03712 01111011101110011010101010101111 104 | *L03744 11111111011111111111111011111111 105 | *L03776 11111111111111111111111110111111 106 | *L03808 11101111111111111111111111111111 107 | *L03840 11111111011111101111111111111111 108 | *L03872 11111111111111111111111101101111 109 | *L03904 11111111111111111111111111111111 110 | *L03936 11111110011111111111111111111111 111 | *L03968 11111111111111111110111101111111 112 | *L04000 11111111111111111111111111111110 113 | *L04032 11111111011111111111111111111111 114 | *L04064 11111111111011111111111101111111 115 | *L04096 11111111111111111111111011111111 116 | *L04128 11111101111111111111111111111111 117 | *L04160 11101111111111011111111111111111 118 | *L04192 11111111111111101101110111111111 119 | *L04224 11111111111111111111111111101110 120 | *L04256 11101111111100000000000000000000 121 | *L05760 00000111111111111111111111111111 122 | *L05792 11111111111111111101010101101001 123 | *L05824 01010011000000110001001000000000 124 | *C7A99 125 | *9166 -------------------------------------------------------------------------------- /BE6502DR.pdf: -------------------------------------------------------------------------------- 1 | {COMPONENT C:\WINCUPL\EXAMPLES\BE6502DR.SYM 2 | 3 | {ENVIRONMENT 4 | {PDIFvrev 3.00} 5 | {Program "CUPL(WM) Version 5.0a"} 6 | {DBtype "Schematic"} 7 | {DBvrev 1.01} 8 | {DBtime "Sun May 12 20:07:45 2024 "} 9 | {DBunit "MIL"} 10 | {DBgrid 10} 11 | {Lyrstr "WIRES" 1 "BUS" 1 "GATE" 2 "IEEE" 2 "PINFUN" 3 "PINNUM" 1 12 | "PINNAM" 6 "PINCON" 4 "REFDES" 2 "ATTR" 6 "SDOT" 1 13 | "DEVICE" 5 "OUTLIN" 5 "ATTR2" 6 "NOTES" 6 "NETNAM" 4 14 | "CMPNAM" 5 "BORDER" 5} 15 | } 16 | 17 | {USER 18 | {VIEW 19 | {Mode SYMB} 20 | {Nlst OPEN} 21 | {Vw 0 0 2} 22 | {Lv 12 2 2 2 0 0 2 2 2 2 0 0 2 1 2 0 0 0 0} 23 | {Gs 10 10} 24 | } 25 | } 26 | 27 | {DISPLAY 28 | [Ly "PINNUM"] 29 | [Ls "SOLID"][Wd 0] 30 | [Ts 15][Tj "LC"][Tr 0][Tm "N"] 31 | } 32 | 33 | {SYMBOL 34 | {PIN_DEF 35 | [Ly "PINCON"] 36 | {P CLK {Pt "INPUT"}{Lq 0}{Ploc 100 320}} 37 | {P RW {Pt "INPUT"}{Lq 0}{Ploc 100 280}} 38 | {P DMA {Pt "INPUT"}{Lq 0}{Ploc 100 260}} 39 | {P A15 {Pt "INPUT"}{Lq 0}{Ploc 100 240}} 40 | {P A14 {Pt "INPUT"}{Lq 0}{Ploc 100 220}} 41 | {P A13 {Pt "INPUT"}{Lq 0}{Ploc 100 200}} 42 | {P A12 {Pt "INPUT"}{Lq 0}{Ploc 100 180}} 43 | {P A11 {Pt "INPUT"}{Lq 0}{Ploc 100 160}} 44 | {P A10 {Pt "INPUT"}{Lq 0}{Ploc 100 140}} 45 | {P A9 {Pt "INPUT"}{Lq 0}{Ploc 100 120}} 46 | {P A8 {Pt "INPUT"}{Lq 0}{Ploc 100 100}} 47 | {P A7 {Pt "INPUT"}{Lq 0}{Ploc 100 80}} 48 | {P A6 {Pt "INPUT"}{Lq 0}{Ploc 100 60}} 49 | {P A5 {Pt "INPUT"}{Lq 0}{Ploc 100 40}} 50 | {P A4 {Pt "INPUT"}{Lq 0}{Ploc 100 20}} 51 | {P RAM_CS {Pt "I/O"}{Lq 0}{Ploc 310 20}} 52 | {P IO_CS {Pt "I/O"}{Lq 0}{Ploc 310 40}} 53 | {P PWRITE {Pt "I/O"}{Lq 0}{Ploc 310 60}} 54 | {P ROM_CS {Pt "I/O"}{Lq 0}{Ploc 310 80}} 55 | {P RAM_B14 {Pt "I/O"}{Lq 0}{Ploc 310 100}} 56 | {P BANKSELE {Pt "OUTPUT"}{Lq 0}{Ploc 310 120}} 57 | {P SINGLEBU {Pt "OUTPUT"}{Lq 0}{Ploc 310 140}} 58 | } 59 | 60 | {PKG 61 | [Ly "REFDES"] 62 | [Ts 25][Tj "CB"][Tr 0][Tm "N"] 63 | {Rdl 205 350} 64 | 65 | [Ly "PINNUM"] 66 | [Ts 15][Tj "RC"] 67 | {Pnl 120 330} 68 | [Ts 15][Tj "RC"] 69 | {Pnl 120 290} 70 | {Pnl 120 270} 71 | {Pnl 120 250} 72 | {Pnl 120 230} 73 | {Pnl 120 210} 74 | {Pnl 120 190} 75 | {Pnl 120 170} 76 | {Pnl 120 150} 77 | {Pnl 120 130} 78 | {Pnl 120 110} 79 | {Pnl 120 90} 80 | {Pnl 120 70} 81 | {Pnl 120 50} 82 | {Pnl 120 30} 83 | [Ts 15][Tj "LC"] 84 | {Pnl 290 30} 85 | {Pnl 290 50} 86 | {Pnl 290 70} 87 | {Pnl 290 90} 88 | {Pnl 290 110} 89 | {Pnl 290 130} 90 | {Pnl 290 150} 91 | 92 | {Sd A 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 19 20 21 22 23 17 18} 93 | } 94 | 95 | {PIC 96 | [Ly "GATE"] 97 | [Ts 15][Tj "LC"][Tr 0][Tm "N"] 98 | {R 130 340 280 0} 99 | {L 130 320 100 320} 100 | {L 130 330 140 320 130 310} 101 | {L 130 280 100 280} 102 | {L 130 260 100 260} 103 | {L 130 240 100 240} 104 | {L 130 220 100 220} 105 | {L 130 200 100 200} 106 | {L 130 180 100 180} 107 | {L 130 160 100 160} 108 | {L 130 140 100 140} 109 | {L 130 120 100 120} 110 | {L 130 100 100 100} 111 | {L 130 80 100 80} 112 | {L 130 60 100 60} 113 | {L 130 40 100 40} 114 | {L 130 20 100 20} 115 | {L 280 20 310 20} 116 | {L 280 40 310 40} 117 | {L 280 60 310 60} 118 | {L 280 80 310 80} 119 | {L 280 100 310 100} 120 | {L 280 120 310 120} 121 | {L 280 140 310 140} 122 | [Ly "PINNAM"] 123 | [Tj "LC"] 124 | {T "CLK" 140 320} 125 | {T "RW" 140 280} 126 | {T "DMA" 140 260} 127 | {T "A15" 140 240} 128 | {T "A14" 140 220} 129 | {T "A13" 140 200} 130 | {T "A12" 140 180} 131 | {T "A11" 140 160} 132 | {T "A10" 140 140} 133 | {T "A9" 140 120} 134 | {T "A8" 140 100} 135 | {T "A7" 140 80} 136 | {T "A6" 140 60} 137 | {T "A5" 140 40} 138 | {T "A4" 140 20} 139 | [Tj "RC"] 140 | {T "RAM_CS" 270 20} 141 | {T "IO_CS" 270 40} 142 | {T "PWRITE" 270 60} 143 | {T "ROM_CS" 270 80} 144 | {T "RAM_B14" 270 100} 145 | {T "BANKSELE" 270 120} 146 | {T "SINGLEBU" 270 140} 147 | [Ly "DEVICE"] 148 | [Tj "CT"] 149 | {T "G22V10" 205 -10} 150 | } 151 | 152 | {ATR 153 | {IN 154 | {Org 100 20} 155 | {Ty 255} 156 | } 157 | {EX 158 | [Ly "ATTR2"] 159 | [Ts 12][Tj "CT"][Tr 0][Tm "N"] 160 | {At PLD C:\WINCUPL\EXAMPLES\BE6502DR 205 340} 161 | } 162 | } 163 | } 164 | 165 | {DETAIL 166 | {ANNOTATE 167 | } 168 | 169 | {NET_DEF 170 | {N CLK 171 | } 172 | {N RW 173 | } 174 | {N DMA 175 | } 176 | {N A15 177 | } 178 | {N A14 179 | } 180 | {N A13 181 | } 182 | {N A12 183 | } 184 | {N A11 185 | } 186 | {N A10 187 | } 188 | {N A9 189 | } 190 | {N A8 191 | } 192 | {N A7 193 | } 194 | {N A6 195 | } 196 | {N A5 197 | } 198 | {N A4 199 | } 200 | {N RAM_CS 201 | } 202 | {N IO_CS 203 | } 204 | {N PWRITE 205 | } 206 | {N ROM_CS 207 | } 208 | {N RAM_B14 209 | } 210 | {N BANKSELE 211 | } 212 | {N SINGLEBU 213 | } 214 | } 215 | 216 | {SUBCOMP 217 | } 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /BE6502DR.sim: -------------------------------------------------------------------------------- 1 | %SIGNAL 2 | PIN 16 = A4 3 | PIN 15 = A5 4 | PIN 14 = A6 5 | PIN 13 = A7 6 | PIN 11 = A8 7 | PIN 10 = A9 8 | PIN 9 = A10 9 | PIN 8 = A11 10 | PIN 7 = A12 11 | PIN 6 = A13 12 | PIN 5 = A14 13 | PIN 4 = A15 14 | PIN 17 = BANKSELECT 15 | PIN 1 = CLK 16 | PIN 3 = DMA 17 | PIN 20 = IO_CS 18 | PIN 21 = PWRITE 19 | PIN 23 = RAM_B14 20 | PIN 19 = RAM_CS 21 | PIN 22 = ROM_CS 22 | PIN 2 = RW 23 | PIN 18 = SINGLEBUFFER 24 | %END 25 | 26 | %FIELD 27 | FIELD Address = A15,A14,A13,A12,A11,A10,A9,A8,A7,A6,A5,A4 28 | %END 29 | 30 | %EQUATION 31 | BANKSELECT.d => 32 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 & !RW 33 | # A15 & !BANKSELECT 34 | # !A14 & !BANKSELECT 35 | # A13 & !BANKSELECT 36 | # A12 & !BANKSELECT 37 | # A11 & !BANKSELECT 38 | # A10 & !BANKSELECT 39 | # A9 & !BANKSELECT 40 | # A8 & !BANKSELECT 41 | # A7 & !BANKSELECT 42 | # A6 & !BANKSELECT 43 | # A4 & A5 & !BANKSELECT 44 | # !A4 & !A5 & !BANKSELECT 45 | 46 | BANKSELECT.ar SINGLEBUFFER.ar => 47 | 0 48 | 49 | BANKSELECT.sp SINGLEBUFFER.sp => 50 | CLK 51 | 52 | BANK_CHANGED => 53 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 54 | # !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 55 | 56 | BANK_OFF => 57 | !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 58 | 59 | BANK_ON => 60 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 61 | 62 | BANK_OVERRIDE => 63 | !BANKSELECT & !DMA & !SINGLEBUFFER 64 | # BANKSELECT & DMA & !SINGLEBUFFER 65 | 66 | BANK_RESULT => 67 | !BANKSELECT & DMA 68 | # BANKSELECT & !DMA 69 | 70 | BANK_SELECT => 71 | A13 & !A14 & !A15 & BANKSELECT & DMA & !SINGLEBUFFER 72 | # A13 & !A14 & !A15 & !BANKSELECT & !DMA & !SINGLEBUFFER 73 | 74 | BANK_VALUE => 75 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 76 | 77 | IO_1 => 78 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 79 | 80 | IO_2 => 81 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & A13 & A14 & !A15 82 | 83 | IO_3 => 84 | A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 85 | 86 | IO_4 => 87 | !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 88 | 89 | IO_5 => 90 | !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 91 | 92 | IO_6 => 93 | !A4 & !A5 & !A6 & A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 94 | 95 | IO_ALT => 96 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 97 | 98 | !IO_CS => 99 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A13 & A14 & !A15 100 | # !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & A13 & A14 & !A15 101 | # A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 102 | # !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 103 | # !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 104 | 105 | IO_SHADOW => 106 | !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A13 & A14 & !A15 107 | # !A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & A13 & A14 & !A15 108 | # A4 & !A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 109 | # !A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 110 | # !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & A12 & !A13 & A14 & !A15 111 | 112 | !PWRITE => 113 | A15 & CLK & !RW 114 | # !A14 & CLK & !RW 115 | # A13 & CLK & !RW 116 | # A12 & CLK & !RW 117 | # A11 & CLK & !RW 118 | # A10 & CLK & !RW 119 | # A9 & CLK & !RW 120 | # A8 & CLK & !RW 121 | # A7 & CLK & !RW 122 | # !A4 & !A5 & !A6 & CLK & !RW 123 | # A4 & A6 & CLK & !RW 124 | # A5 & A6 & CLK & !RW 125 | 126 | RAM => 127 | !A15 128 | 129 | RAM_B14 => 130 | A14 131 | # A13 & !A14 & !A15 & !BANKSELECT & DMA & SINGLEBUFFER 132 | # A13 & !A14 & !A15 & BANKSELECT & !DMA & SINGLEBUFFER 133 | 134 | !RAM_CS => 135 | !A14 & !A15 136 | # A12 & A13 & !A15 137 | # A6 & A13 & !A15 138 | # A5 & A13 & !A15 139 | # A4 & A13 & !A15 140 | # A6 & !A12 & !A15 141 | # A5 & !A12 & !A15 142 | # A4 & !A12 & !A15 143 | # A11 & !A15 144 | # A10 & !A15 145 | # A9 & !A15 146 | # A8 & !A15 147 | # A7 & !A15 148 | # A5 & A6 & !A15 149 | # A4 & A6 & !A15 150 | # A4 & A5 & !A15 151 | 152 | ROM => 153 | A15 154 | 155 | !ROM_CS => 156 | A15 157 | 158 | SINGLEBUFFER.d => 159 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 & !RW 160 | # A15 & !SINGLEBUFFER 161 | # !A14 & !SINGLEBUFFER 162 | # A13 & !SINGLEBUFFER 163 | # A12 & !SINGLEBUFFER 164 | # A11 & !SINGLEBUFFER 165 | # A10 & !SINGLEBUFFER 166 | # A9 & !SINGLEBUFFER 167 | # A8 & !SINGLEBUFFER 168 | # A7 & !SINGLEBUFFER 169 | # !A5 & !A6 & !SINGLEBUFFER 170 | # !A4 & !A6 & !SINGLEBUFFER 171 | # A5 & A6 & !SINGLEBUFFER 172 | # !A4 & A5 & !SINGLEBUFFER 173 | # A4 & !A5 & !SINGLEBUFFER 174 | # A4 & A6 & !SINGLEBUFFER 175 | 176 | SINGLEBUFFER.ar => 177 | 178 | SINGLEBUFFER.sp => 179 | 180 | SINGLE_CHANGED => 181 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 182 | # !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 183 | 184 | SINGLE_OFF => 185 | !A4 & !A5 & A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 186 | 187 | SINGLE_ON => 188 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 189 | 190 | SINGLE_VALUE => 191 | A4 & A5 & !A6 & !A7 & !A8 & !A9 & !A10 & !A11 & !A12 & !A13 & A14 & !A15 192 | 193 | VIDEO => 194 | A13 & !A14 & !A15 195 | 196 | A4.oe => 197 | 0 198 | 199 | A5.oe => 200 | 0 201 | 202 | A6.oe => 203 | 0 204 | 205 | BANKSELECT.oe => 206 | 1 207 | 208 | IO_CS.oe => 209 | 1 210 | 211 | PWRITE.oe => 212 | 1 213 | 214 | RAM_B14.oe => 215 | 1 216 | 217 | RAM_CS.oe => 218 | 1 219 | 220 | ROM_CS.oe => 221 | 1 222 | 223 | SINGLEBUFFER.oe => 224 | 1 225 | 226 | %END 227 | -------------------------------------------------------------------------------- /BLANK0.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BallSprites.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/BallSprites.jpg -------------------------------------------------------------------------------- /BasicBallss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/BasicBallss.gif -------------------------------------------------------------------------------- /BasicShapes.bas: -------------------------------------------------------------------------------- 1 | 9 ? "SETUP ASM SCREEN CLEAR" 2 | 10 RESTORE 1000 3 | 20 READ by 4 | 30 DO 5 | 40 cSCREEN$ = cSCREEN$+CHR$(by) 6 | 50 READ by 7 | 60 LOOP UNTIL by=-1 8 | 9 | 61 ? "CLEAR SCREEN" 10 | 70 CALL(SADD(cSCREEN$)) 11 | 12 | 13 | 109 ? "DRAW H LINE WITH POKE" 14 | 110 FOR X = 0 TO 15 15 | 120 POKE (8455+X),255 16 | 130 NEXT 17 | 18 | 131 ? "DRAW SQUARES" 19 | 134 Y = 9482 20 | 135 Z = 4 21 | 136 GOSUB 2139 22 | 23 | 137 Y = 10428 24 | 138 Z = 60 25 | 139 GOSUB 2139 26 | 27 | 28 | 209 ? "DRAW H LINE WITH POKE" 29 | 210 FOR X = 0 TO 15 30 | 220 POKE (13362+X),90 31 | 230 NEXT 32 | 33 | 34 | 339 ? "DRAW V LINE WITH POKE" 35 | 340 FOR X = 0 TO 7 36 | 350 POKE (11520+30+(X*128)),48 37 | 360 NEXT 38 | 39 | 399 ? "DRAW D LINE WITH POKE" 40 | 400 Y=1 41 | 410 FOR X = 2 TO 57 42 | 420 POKE (8476+Y),X 43 | 421 POKE (8477+Y),X 44 | 422 Y=Y+129 45 | 430 NEXT 46 | 47 | 499 ? "DRAW -D LINE WITH POKE" 48 | 500 Y=1 49 | 510 FOR X = 2 TO 56 50 | 520 POKE (15872-Y),X 51 | 521 POKE (15873-Y),X 52 | 522 Y=Y+126 53 | 530 NEXT 54 | 55 | 56 | 599 ? "END PROGRAM" 57 | 600 GOTO 9060 58 | 59 | 60 | 61 | 1000 DATA $08,$a2,$20,$a9,$00,$85,$fb,$a9 62 | 1010 DATA $85,$85,$fc,$a9,$00,$85,$fd,$a9 63 | 1020 DATA $20,$85,$fe,$a0,$00,$a9,$00,$91 64 | 1030 DATA $fd,$c8,$d0,$fb,$e6,$fe,$ca,$d0 65 | 1040 DATA $f6,$ea,$28,$60, -1 66 | 1050 REM DATA -1 67 | 68 | 69 | 2139 ? "DRAW SQUARE" 70 | 2140 FOR X = 0 TO 7 71 | 2150 POKE (Y+X),Z 72 | 2151 POKE (Y+128+X),Z 73 | 2152 POKE (Y+256+X),Z 74 | 2153 POKE (Y+384+X),Z 75 | 2154 POKE (Y+512+X),Z 76 | 2155 POKE (Y+640+X),Z 77 | 2156 POKE (Y+768+X),Z 78 | 2157 POKE (Y+896+X),Z 79 | 2160 NEXT 80 | 2170 RETURN 81 | 82 | 9060 ? "It Ran!" 83 | 9070 END -------------------------------------------------------------------------------- /BeepApple.bas: -------------------------------------------------------------------------------- 1 | 2 | 0 PAUSE100:?"Beep Apple, Fifty1Ford" 3 | 1 W=4:CALL$FA00 4 | 2 BEEP 123:PAUSEW 5 | 3 BEEP 114:PAUSEW 6 | 4 BEEP 101:PAUSEW 7 | 5 BEEP 93:PAUSEW 8 | 6 BEEP 83:PAUSEW*2 9 | 7 BEEP 123:PAUSEW 10 | 8 BEEP 69:PAUSEW 11 | 10 BEEP 83:PAUSEW*2 12 | 11 BEEP 123:PAUSEW*2 13 | 12 BEEP 83:PAUSEW 14 | 13 BEEP 93:PAUSEW 15 | 14 BEEP 101:PAUSEW 16 | 15 BEEP 114:PAUSEW 17 | 16 BEEP 123:PAUSEW 18 | 20 BEEP 114:PAUSEW 19 | 21 BEEP 101:PAUSEW 20 | 22 BEEP 93:PAUSEW 21 | 23 BEEP 83:PAUSEW*2 22 | 24 BEEP 93:PAUSEW 23 | 25 BEEP 101:PAUSEW 24 | 26 BEEP 114:PAUSEW 25 | 27 BEEP 166:PAUSEW 26 | 30 BEEP 114:PAUSEW 27 | 31 BEEP 101:PAUSEW 28 | 32 BEEP 114:PAUSEW 29 | 33 BEEP 123:PAUSEW 30 | 34 BEEP 131:PAUSEW 31 | 35 BEEP 114:PAUSEW 32 | 40 BEEP 123:PAUSEW 33 | 41 BEEP 114:PAUSEW 34 | 42 BEEP 101:PAUSEW 35 | 43 BEEP 93:PAUSEW 36 | 44 BEEP 83:PAUSEW*2 37 | 45 BEEP 61:PAUSEW 38 | 46 BEEP 69:PAUSEW 39 | 47 BEEP 83:PAUSEW*2 40 | 48 BEEP 123:PAUSEW*2 41 | 49 BEEP 83:PAUSEW 42 | 50 BEEP 93:PAUSEW 43 | 51 BEEP 101:PAUSEW 44 | 52 BEEP 114:PAUSE1 45 | 100 GOTO 1 -------------------------------------------------------------------------------- /BeepBasic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/BeepBasic.bin -------------------------------------------------------------------------------- /BenEaterFastLoad.asm: -------------------------------------------------------------------------------- 1 | ; NormalLuser Ben Eater Fast Load 2 | ; Future Wozmon intergration planned for 'L' Load command. 3 | ACIA = $4000 4 | ACIA_CTRL = ACIA+3 5 | ACIA_CMD = ACIA+2 6 | ACIA_SR = ACIA+1 7 | ACIA_DAT = ACIA 8 | ;'From' in Woz 9 | STL = $50;$26 10 | STH = $51;$27 11 | YSAV = $52;Not in Woz 12 | FROML = $53 13 | FROMH = $54 14 | ;'To' in Woz 15 | L = $60;$28 16 | H = $61;$29 17 | TOL = $62 18 | TOH = $63 19 | 20 | MSGL = $72 21 | MSGH = $73 22 | 23 | 24 | 25 | .org $500 26 | ;LDA #$1A ; 8-N-1, 2400 baud 27 | ;LDA #$1C ; 8-N-1, 4800 baud 28 | ;LDA #$1E ; 8-N-1, 9600 baud 29 | ;LDA #$1F ; 8-N-1, 19200 baud 30 | SEI ; Turn off IRQ's, don't want/need. 31 | LDA #$1F ;* Init ACIA to 19200 Baud. 32 | STA ACIA_CTRL 33 | LDA #$0B ;* No Parity. No IRQ 34 | STA ACIA_CMD 35 | LOADBINARY 36 | ; NormalLuser Binary load 37 | ; Load a program/data in Binary Format. 38 | LDA #MSG1 40 | JSR SHWMSG ;Hello Message. 41 | JSR NewLine 42 | LDA #MSG2 44 | JSR SHWMSG ;Ask for Start Address. 45 | JSR NewLine 46 | LDA #'$' 47 | JSR ECHO 48 | 49 | JSR GETHEX ; Store the Storage address 50 | STA FROMH ;STH 51 | JSR GETHEX 52 | STZ FROML ;STL ; Zero here because low byte in Y 53 | STA YSAV;TAY ;Y + start address 0 54 | 55 | LDA #MSG3 57 | JSR SHWMSG ;Ask for End Address. 58 | jsr NewLine 59 | LDA #'$' 60 | JSR ECHO 61 | 62 | JSR GETHEX 63 | STA TOH ;H 64 | JSR GETHEX 65 | STA TOL ;L 66 | 67 | LDA #MSG4 69 | JSR SHWMSG ;Ask for Data 70 | JSR NewLine 71 | LOOPMEMORY: 72 | LDA FROMH 73 | STA STH 74 | STZ STL 75 | LDY YSAV ; Low byte in Y 76 | LDA TOH 77 | STA H 78 | LDA TOL 79 | STA L 80 | 81 | BINARY_LOOP ;Could copy GETCHAR here to save cycles. 82 | JSR GETCHAR ; Grab Byte from ACIA 83 | STA (STL),Y ; Store it at our memory location 84 | ;Comment out everything down to the to INY if you don't want status 85 | ;IF YOU WANT JUST STATUS: 86 | ;LDA #'X' 87 | ;STA ACIA_DAT ;DON'T CARE IF IT GETS DROPPED JUST SEND 88 | ;JSR PRHEX ;Too slow for AWDC ACIA 89 | ;This translates to HEX for a nice ASCII output 90 | ;PRHEX ;Move inline and just send 91 | AND #$0F ;Mask LSD for hex print. 92 | ORA #$B0 ;Add "0". 93 | CMP #$BA ;Digit? 94 | BCC HECHO ;Yes, output it. 95 | ADC #$06 ;Add offset for letter. 96 | HECHO 97 | AND #$7F ;*Change to "standard ASCII" 98 | STA ACIA_DAT ; Output character. 99 | ;Check memory pointer for max and INC 100 | LDX STH ; Load our high byte 101 | CPX H ; Does it match our max? 102 | BNE NO_HMATCH ; Nope, just normal inc 103 | CPY L ; Does the low byte match our max? 104 | BNE NO_HMATCH ; Nope, just normal inc 105 | JMP BINARY_DONE ; MATCH! We are done! 106 | NO_HMATCH 107 | INY ;Inc low byte 108 | BNE BINARY_LOOP ;jump if not a roll-over 109 | INC STH ;Roll-over. Inc the high byte. 110 | JMP BINARY_LOOP 111 | 112 | BINARY_DONE ; Data transfer Done 113 | JSR NewLine ;New line. 114 | LDA #MSG5 116 | JSR SHWMSG ;Show Finished msg 117 | 118 | BINARYEXTRA ; Care about garbage data at end? 119 | ; *For Streaming Test,jmp back to top 120 | ;JMP LOOPMEMORY 121 | ;Could RTS here, but we could overwrite data. 122 | JSR GETCHAR 123 | LDA #'X' 124 | JSR ECHO 125 | JMP BINARYEXTRA 126 | ;RTS 127 | 128 | ;From Woz 129 | GETHEX ;LDA IN,Y ; Get first char. 130 | JSR GETCHAR 131 | JSR ECHO 132 | EOR #$30 133 | CMP #$0A 134 | BCC DONEFIRST 135 | ADC #$08 136 | DONEFIRST ASL 137 | ASL 138 | ASL 139 | ASL 140 | STA L 141 | INY 142 | ;LDA IN,Y ; Get next char. 143 | JSR GETCHAR 144 | JSR ECHO 145 | EOR #$30 146 | CMP #$0A 147 | BCC DONESECOND 148 | ADC #$08 149 | DONESECOND AND #$0F 150 | ORA L 151 | INY 152 | RTS 153 | 154 | 155 | GETCHAR 156 | .NEXTBYTE: 157 | LDA ACIA_SR ;*See if we got an incoming byte 158 | AND #$08 ;*Test bit 3 159 | BEQ .NEXTBYTE ;*Wait for byte 160 | LDA ACIA_DAT ;*Load byte 161 | RTS 162 | 163 | ; Moved this because we can't check WDC ACIA. IE it is too slow to use the normal ECHO 164 | ; PRHEX AND #$0F ;Mask LSD for hex print. 165 | ; ORA #$B0 ;Add "0". 166 | ; CMP #$BA ;Digit? 167 | ; BCC ECHO ;Yes, output it. 168 | ; ADC #$06 ;Add offset for letter. 169 | ; WDC ACIA ECHO Wait loop due to transmit bug 170 | ECHO: 171 | PHA ; Save A. 172 | PHY 173 | AND #$7F ;*Change to "standard ASCII" 174 | STA ACIA_DAT ; Output character. 175 | LDA #$FF ; Initialize delay loop. 176 | LDY #$02 ; Extra Delay just in case 177 | TXDELAY: DEC ; Decrement A. 178 | BNE TXDELAY ; Until A gets to 0. 179 | DEY 180 | BNE TXDELAY ; Extra Delay time 181 | PLY 182 | PLA ; Restore A. 183 | RTS ; Return. 184 | ; Rockwell/non bugged ACIA routine, 185 | ; ECHO PHA ;*Save A 186 | ; .WAIT LDA ACIA_SR ;*Load status register for ACIA, onlye for non WDC ACIA 187 | ; AND #$10 ;*Mask bit 4. 188 | ; BEQ .WAIT ;*ACIA not done from last send, wait. 189 | ; PLA ;*Last send done. Restore A 190 | ; PHA ;*Save A again 191 | ; AND #$7F ;*Change to "standard ASCII" 192 | ; STA ACIA_DAT ;*Send it. 193 | ; PLA ;*Restore A again 194 | ; RTS ;*Done, over and out... 195 | 196 | ; This version of SHWMSG modified. Need to change for Wozmon. 197 | SHWMSG ;Changed msg routine to save some bytes 198 | ;LDA #MSG2 201 | STX MSGH 202 | ;PHA ;I only msg when A and Y are unused. 203 | ;PHY 204 | jsr NewLine 205 | LDY #$0 206 | .PRINT LDA (MSGL),Y 207 | BEQ .DONE 208 | JSR ECHO 209 | INY 210 | BNE .PRINT 211 | .DONE ;PLY 212 | ;PLA 213 | RTS 214 | 215 | NewLine 216 | PHA 217 | LDA #$0D 218 | JSR ECHO ;* New line. 219 | LDA #$0A 220 | JSR ECHO 221 | PLA 222 | RTS 223 | 224 | MSG1 .byte " -NormalLuser Fast File Load- ",0 225 | MSG2 .byte " Binary Start Address in Hex: ",0 226 | MSG3 .byte " Binary -End- Address in Hex: ",0 227 | MSG4 .byte " -Start Binary File Transfer- ",0 228 | MSG5 .byte " All Bytes Imported -Reset- ",0 229 | ; Want to save some bytes on the messages? 230 | ; MSG1 .byte "Load",0 231 | ; MSG2 .byte "Start:",0 232 | ; MSG3 .byte "End:",0 233 | ; MSG4 .byte "File",0 234 | ; MSG5 .byte "Done",0 235 | -------------------------------------------------------------------------------- /BenEaterFastLoad500.txt: -------------------------------------------------------------------------------- 1 | 500: 78 A9 1F 8D 03 40 A9 0B 508: 8D 02 40 A9 0A A2 06 20 510: E9 05 20 FD 05 A9 29 A2 518: 06 20 E9 05 20 FD 05 A9 520: 24 20 D5 05 20 A1 05 85 528: 54 20 A1 05 64 53 85 52 530: A9 48 A2 06 20 E9 05 20 538: FD 05 A9 24 20 D5 05 20 540: A1 05 85 63 20 A1 05 85 548: 62 A9 67 A2 06 20 E9 05 550: 20 FD 05 A5 54 85 51 64 558: 50 A4 52 A5 63 85 61 A5 560: 62 85 60 20 CA 05 91 50 568: 29 0F 09 B0 C9 BA 90 02 570: 69 06 29 7F 8D 00 40 A6 578: 51 E4 61 D0 07 C4 60 D0 580: 03 4C 8C 05 C8 D0 DC E6 588: 51 4C 63 05 20 FD 05 A9 590: 86 A2 06 20 E9 05 20 CA 598: 05 A9 58 20 D5 05 4C 96 5A0: 05 20 CA 05 20 D5 05 49 5A8: 30 C9 0A 90 02 69 08 0A 5B0: 0A 0A 0A 85 60 C8 20 CA 5B8: 05 20 D5 05 49 30 C9 0A 5C0: 90 02 69 08 29 0F 05 60 5C8: C8 60 AD 01 40 29 08 F0 5D0: F9 AD 00 40 60 48 5A 29 5D8: 7F 8D 00 40 A9 FF A0 02 5E0: 3A D0 FD 88 D0 FA 7A 68 5E8: 60 85 72 86 73 20 FD 05 5F0: A0 00 B1 72 F0 06 20 D5 5F8: 05 C8 D0 F6 60 48 A9 0D 600: 20 D5 05 A9 0A 20 D5 05 608: 68 60 20 2D 4E 6F 72 6D 610: 61 6C 4C 75 73 65 72 20 618: 46 61 73 74 20 46 69 6C 620: 65 20 4C 6F 61 64 2D 20 628: 00 20 42 69 6E 61 72 79 630: 20 53 74 61 72 74 20 41 638: 64 64 72 65 73 73 20 69 640: 6E 20 48 65 78 3A 20 00 648: 20 42 69 6E 61 72 79 20 650: 2D 45 6E 64 2D 20 41 64 658: 64 72 65 73 73 20 69 6E 660: 20 48 65 78 3A 20 00 20 668: 2D 53 74 61 72 74 20 42 670: 69 6E 61 72 79 20 46 69 678: 6C 65 20 54 72 61 6E 73 680: 66 65 72 2D 20 00 20 41 688: 6C 6C 20 42 79 74 65 73 690: 20 49 6D 70 6F 72 74 65 698: 64 20 20 20 2D 52 65 73 6A0: 65 74 2D 20 00 -------------------------------------------------------------------------------- /ColorDemo3.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; 0 REM "Apple II Kaleidoscope EhBasic NormalLuser Edit" 3 | ; 1 CLS 4 | ; 2 z=63:ws=3:we=50:t=30:o=1:n=0:p=3:d=12 5 | ; 3 FORW=wsTOwe:IW=0:FORI=oTOt:IW=IW+W:X=IW/12+r:I40=z-I:FORJ=nTOt:K=I+J 6 | ; 4 K40=z-K:PENJ*p/(I+p)+X:PLOTI,K:PLOTK,I:PLOTI40,K40:PLOTK40,I40 7 | ; 5 PLOTK,I40:PLOTI40,K:PLOTI,K40:PLOTK40,I:NEXTJ,I:r=r+7:IFr>64THENr=0 8 | ; 6 NEXTW 9 | ; 7 GOTO 3 10 | 11 | 12 | ; ASM version from: 13 | ;https://llx.com/Neil/a2/kal2.html 14 | START = $1D00 ;$400 15 | 16 | A1L = $E3 17 | A1H = $E4 18 | K40 = $E5 19 | I40 = $E6 20 | IWL = $E7 21 | IWH = $E8 22 | I = $E9 23 | W = $EA 24 | J = $DD ; CAN'T USE EHBASIC BEEP 25 | K = $DE ; CAN'T USE EHBASIC BEEP 26 | 27 | VGAClock = $E2 ; IF NMI hooked up to vsync this will DEC. 28 | ;PlotColor = $EC ; Color for plot function 29 | Screen = $20 ; GFX screen location 30 | ScreenH = $21 ; to draw TO 31 | 32 | 33 | .ORG START 34 | jsr CLS 35 | LDA #3 ;FOR W=3 TO 50 36 | STA W 37 | WLP: 38 | LDA #0 ;IW=0 39 | STA IWL 40 | STA IWH 41 | LDA #63 ;I40=40 ;Size 42 | STA I40 43 | LDA #1 ;FOR I=1 TO 19 44 | STA I 45 | ILP: 46 | LDA W ;IW=IW+W 47 | CLC 48 | ADC IWL 49 | STA IWL 50 | BCC ILP1 51 | INC IWH 52 | ILP1: 53 | STA A1L ;X=IW/12 54 | LDA IWH 55 | STA A1H 56 | LDY #16 ;(inline 16/8 division) 57 | LDA #0 58 | DIV1LP: 59 | ASL A1L 60 | ROL A1H 61 | ROL 62 | CMP #12 63 | BCC DIV1A 64 | SBC #12 65 | INC A1L 66 | DIV1A: 67 | DEY 68 | BNE DIV1LP 69 | LDX A1L 70 | DEC I40 ;I40=I40-1 71 | LDA I40 ;K40=I40 72 | STA K40 73 | LDA #0 ;FOR J=0 TO 19 74 | STA J 75 | JLP: 76 | CLC ;K=I+J 77 | ADC I 78 | STA K 79 | ;LDA KBD ;IF PEEK(KBD)>127 THEN DONE 80 | ;BPL NOKEY 81 | ;STA KBDSTRB 82 | ;JMP DONE 83 | 84 | NOKEY: 85 | LDA J ;COLOR=J*3/(I+3)+X 86 | ASL 87 | ADC J 88 | STA A1L 89 | LDA I 90 | ADC #3 91 | STA A1H 92 | LDA #0 ;(inline 8/8 division) 93 | LDY #8 94 | DIV2LP: 95 | ASL A1L 96 | ROL 97 | CMP A1H 98 | BCC DIV2A 99 | SBC A1H 100 | INC A1L 101 | DIV2A: 102 | DEY 103 | BNE DIV2LP 104 | TXA 105 | CLC 106 | ADC A1L 107 | 108 | ;JSR SETCOL 109 | TAX ;Set Color 110 | LDY I ;PLOT I,K: etc... 111 | LDA K 112 | JSR PLOT 113 | LDY K 114 | LDA I 115 | JSR PLOT 116 | LDY I40 117 | LDA K40 118 | JSR PLOT 119 | LDY K40 120 | LDA I40 121 | JSR PLOT 122 | LDY K 123 | LDA I40 124 | JSR PLOT 125 | LDY I40 126 | LDA K 127 | JSR PLOT 128 | LDY I 129 | LDA K40 130 | JSR PLOT 131 | LDY K40 132 | LDA I 133 | JSR PLOT 134 | DEC K40 ;K40=K40-1 135 | INC J ;NEXT J 136 | LDA J 137 | CMP #31;#20 ;size/2 138 | BNE JLP 139 | INC I ;NEXT I 140 | LDA I 141 | CMP #31;#20 ;size/2 142 | BEQ NOILP 143 | 144 | ;LDA #1 145 | ;JSR Delay ;to slow it down 146 | 147 | JMP ILP 148 | NOILP: 149 | INC W ;NEXT W 150 | LDA W 151 | ;CMP #51 152 | ;BEQ DONE 153 | JMP WLP 154 | DONE: 155 | RTS 156 | 157 | 158 | PLOT:;Fifty1Ford/NormalLuser 159 | ;Maybe I should add bounds checks?? 160 | ;It is faster without 161 | ;TXA ; A IS ROW 0-63 162 | ;LDY Itempl ; Y IS COLUMN 0-99 163 | ;LDX PlotColor ; X IS COLOR 164 | ASL ;Double the row count. Array is entries of 2 bytes (16 bit) each. 165 | PHX ;Put X in stack 166 | TAX ;Move doubled row count to A 167 | LDA HLINES,X ; 168 | STA Screen 169 | INX 170 | LDA HLINES,X 171 | STA ScreenH 172 | PLX ;PULL X FROM STACK, REPLACE WITH PLA AND REMOVE BELOW? 173 | TXA ;MOVE COLOR FROM X TO A 174 | STA (Screen),Y ;STORE COLOR INTO LINE OFFSET BY ROW COUNT IN Y 175 | RTS 176 | 177 | Delay: 178 | BEQ NoDelay ; 0, No delay 179 | STA VGAClock ; Store the number of cycles we want to wait. 180 | DelayTop: 181 | LDA VGAClock ; See if the Vsync NMI has counted down to 0. 182 | BNE DelayTop ; Keep waiting until 0. 183 | NoDelay: 184 | RTS 185 | 186 | CLS: 187 | LDA #0 188 | BRA FillScreen 189 | COLOR: 190 | 191 | FillScreen: 192 | STZ Screen ; Ben Eater's Worlds Worst Video card 193 | LDY #$20 ; uses the upper 8Kb of system RAM 194 | STY ScreenH; This starts at location $2000 195 | LDY #0 196 | .MemLoop 197 | STA (Screen),Y 198 | INY 199 | BNE .MemLoop 200 | INC ScreenH 201 | LDX ScreenH 202 | CPX #$40 ;Top of screen memory is $3F-FF, 203 | BNE .MemLoop; Do until $40-00 204 | STZ Screen ; Ben Eater's Worlds Worst Video card 205 | LDA #$20 ; uses the upper 8Kb of system RAM 206 | STA ScreenH; This starts at location $2000 207 | RTS 208 | 209 | .org START +$200 210 | HLINES: ;These are the line start locations for the VGA frame buffer, Adjusted to the right for better centering. 211 | .WORD $200F,$208F,$210F,$218F,$220F,$228F,$230F,$238F,$240F,$248F,$250F,$258F,$260F,$268F,$270F,$278F 212 | .WORD $280F,$288F,$290F,$298F,$2A0F,$2A8F,$2B0F,$2B8F,$2C0F,$2C8F,$2D0F,$2D8F,$2E0F,$2E8F,$2F0F,$2F8F 213 | .WORD $300F,$308F,$310F,$318F,$320F,$328F,$330F,$338F,$340F,$348F,$350F,$358F,$360F,$368F,$370F,$378F 214 | .WORD $380F,$388F,$390F,$398F,$3A0F,$3A8F,$3B0F,$3B8F,$3C0F,$3C8F,$3D0F,$3D8F,$3E0F,$3E8F,$3F0F,$3F8F 215 | ; HLINES: ;These are the line start locations for the VGA frame buffer. 216 | ; .WORD $2000,$2080,$2100,$2180,$2200,$2280,$2300,$2380,$2400,$2480,$2500,$2580,$2600,$2680,$2700,$2780 217 | ; .WORD $2800,$2880,$2900,$2980,$2A00,$2A80,$2B00,$2B80,$2C00,$2C80,$2D00,$2D80,$2E00,$2E80,$2F00,$2F80 218 | ; .WORD $3000,$3080,$3100,$3180,$3200,$3280,$3300,$3380,$3400,$3480,$3500,$3580,$3600,$3680,$3700,$3780 219 | ; .WORD $3800,$3880,$3900,$3980,$3A00,$3A80,$3B00,$3B80,$3C00,$3C80,$3D00,$3D80,$3E00,$3E80,$3F00,$3F80 -------------------------------------------------------------------------------- /Docs/Documents.txt: -------------------------------------------------------------------------------- 1 | Document folder 2 | -------------------------------------------------------------------------------- /DoubleBufferScroll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/DoubleBufferScroll.gif -------------------------------------------------------------------------------- /EhBasicBeepPause.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/EhBasicBeepPause.bin -------------------------------------------------------------------------------- /Forest.bin: -------------------------------------------------------------------------------- 1 | @@@@@@@@@@@@@@@@$44$@@@@44$@@@@@444444@@@$444$@@@@44444444@@@@4**4$@@@@$44444444$@>>>>@$4**4$@@@44444**444@@>>?>>>@@44444@@@@@@@@@@@@@@@@@$44444**444$@>>>>>>:@$$*44$@@@@@@@@@44444444444$@>>?>):@$$$$$$@@@@$$44444444@@@@@$44444444444$@>>::@*$$$$@@@$44444444444$$@@@@444*44444444$$@@::)@@**))@@@@$44444444444444$$@@@$44***4444444$$@>>:))@@@@@@@$44**4444444**44$$$@@@@4444*44444*44$$$@@>>>>>)))@@@)@@@$44****444444**44$$$@@@$4444444444444$$$@@$44$>>)@)@@@444****4444444444$$@@@@@$4444444444444$$$$@@$4444$@)@@@$4444**44444444444$@@@$$444444444444$$$$$$$@@44*444@@@@@@@$4444444444444444$$@@@@$$$$44444444444$$$$$$@$4***44$@@$$44444444444*4444$@@$$$$$$444444444$$$$$$@444*4444@@$$$444444444***44$$@@@$$))$$$$44444$$$$$$@$44444*4$:$44$@$$$$$444*44444*44$$$@@$$))$$$$$$$$$$$$$@$$$44444$$):$4444$@$$$$$$$444444444$$$$@@$$$$$$$$$$$$$$$$@$$)$$$$$$::44*444@$$$)$$$$$$$$$$$$$$$$$@@@$$$$$$$$$$$$$$$@@$$$$$$$$$::)$4***44$@$$$$$$$$$$$$$$$$$$$$@@$$$$$$$)$$$$$$$$@@$$$$)$$:))444*4444@@$$$$$$$))$$$$$$$$$$$$@@@@$$$$$$$$$$$$$$$$@@)))$44444*4$@@$$$$$))$$$$$$$$$$$$@@@@@@$$$$$$$$$$$$$$@@@@)$$$44444$$@@@@@@@@@@@@@@@@@@@$$)$$$$$$@@@@@@@@@@@@@@@@))$$$$$$$$$@@))@@@@))@@))$$$$)$$@@)**)@@@@))))@@))@)****)@@@))))@))@))****))@@@)****)@))))@))****))@@@)****)@@))**@@@))****))@@@@@@)****)@@**@@@@@@@@@@@@@@@@@@@?99999999???5???+???+???+5?5%+?++?++?+%%5?5%+?++?++?+5??5%%+??++??++??+5???555+???++++???++++???+++5????%555????%55+????+++????++5????55????5+????++????+5????%5????%+????+????55555%55555%++++++++++%555%%555%%555%+++%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /ForeverASCII300.txt: -------------------------------------------------------------------------------- 1 | 300: D8 58 A9 1F 8D 03 40 A9 308: 0B 8D 02 40 A9 0D 64 ED 310: A9 20 85 EE A9 23 8D 00 318: 40 A0 00 AD 01 40 29 08 320: F0 F9 AD 00 40 91 ED 20 328: 41 03 C8 D0 EE E6 EE A6 330: EE E0 40 D0 E6 64 ED A9 338: 20 8D 00 40 85 EE 4C 0E 340: 03 29 0F 09 B0 C9 BA 90 348: 02 69 06 48 29 7F 8D 00 350: 40 68 60 -------------------------------------------------------------------------------- /FullSpin.bas: -------------------------------------------------------------------------------- 1 | 0 ?"Full Spin by Fifty1Ford for the BE6502+VGA+Serial Ctrl-C exit" 2 | 1 S=0:DIM D(20) 3 | 2 DATA 175,1,175,43,175,85,198,1,198,43,198,85 4 | 3 FOR X=0 TO 11:READ D(X):NEXT X 5 | 4 COLOR 63:X=30:Y=2:Z=1:P=20:U=10:OX=0:R=0:S=0 6 | 6 POKE$E6,D(S):INCS:POKE$E5,D(S):INCS 7 | 7 GFX X,Y:INC R:IF R=100 THEN 14 8 | 8 IF S>11 THEN S=0 9 | 9 GOTO6 10 | 11 | 14 Z=1:OX=0:R=0:S=0 12 | 15 POKE$E6,D(S):INCS:POKE$E5,D(S):INCS 13 | 16 GFX X,Y:X=X+Z 14 | 17 IFX<2ORX>82THENZ=-Z:INCR:IFR=4THEN24 15 | 18 IF S>11 THEN S=0 16 | 19 GOTO15 17 | 18 | 24 Z=1:OX=0:P=20:R=0 19 | 25 POKE$E6,D(S):INCS:POKE$E5,D(S):INCS 20 | 26 GFX X,Y:GFX X+42,P:X=X+Z 21 | 27 IFX<2ORX>82THENZ=-Z:INCR:IFR=4THEN34 22 | 28 IF S>11 THEN S=0 23 | 29 GOTO25 24 | 25 | 34 U=10:R=0 26 | 35 POKE$E6,D(S):INCS:POKE$E5,D(S):INCS 27 | 36 GFX X,Y:GFX X+42,P:GFX X+85,U:X=X+Z 28 | 37 IFX<2ORX>40THENZ=-Z:INCR:IFR=5THEN40 29 | 38 IF S>11 THEN S=0 30 | 39 GOTO35 31 | 32 | 40 X=1:Y=1:DX=1:DY=1:R=0:S=0:COLOR 63 33 | 44 POKE $E6,D(S):INCS:POKE$E5,D(S):INCS 34 | 45 GFX X,Y:X=X+DX:Y=Y+DY 35 | 46 IF X<=1ORX>=59THEN DX=-DX:INCR:IFR=8THEN50 36 | 47 IF Y <= 0 OR Y>=22 THEN DY=-DY 37 | 48 IF S>11 THEN S=0 38 | 49 GOTO44 39 | 40 | 50 S=0:COLOR 63:DX=1:DY=1:R=0 41 | 54 POKE$E6,D(S):INCS:POKE$E5,D(S):INCS 42 | 55 GFX X,Y:GFX X+42,22-Y:X=X+DX:Y=Y+DY 43 | 56 IF X<=1ORX>=58THEN DX=-DX:INCR:IFR=8THEN60 44 | 57 IF Y <= 1 OR Y>=21 THEN DY=-DY 45 | 58 IF S>11 THEN S=0 46 | 59 GOTO54 47 | 48 | 60 COLOR 63:S=0:DX=1:DY=1:R=0 49 | 63 X=30:Y=2:Z=1:P=20:U=10:OX=0 50 | 64 POKE$E6,D(S):INCS:POKE$E5,D(S):INCS 51 | 65 GFX X,Y:GFX X+42,22-Y:GFX X+84,22-Y:X=X+DX:Y=Y+DY 52 | 66 IF X<=2ORX>=40THEN DX=-DX:INCR:IFR=8THEN4 53 | 67 IF Y<=2ORY>=20 THEN DY=-DY 54 | 68 IF S>11 THEN S=0 55 | 69 GOTO64 56 | 57 | RUN 58 | 59 | -------------------------------------------------------------------------------- /Girl2.bin: -------------------------------------------------------------------------------- 1 | ?????6666666;//&&&:6;&&*??6%&&6:66&&66:&&66666:6&6:6:6&&??;:;:::?&&&&&6&&/?????66;6666*//&66!&&!66:::;&&?6666&&66&&6:6666:6&&&666&&&&:?:;:?&&&&&&&&*???*666:666*/// 2 | 66;&&&66;:;%&&?:6:&&&6:6&6666666&&&:6&&&&;:;:??&&&&/?????6666666+//!;&&&:6666&&&&&:???*&&&666&&;6:66666&&666?&&&;:???&&&&&&&&!6:66:66:/&6&%&&&&&666666&&&6:*:&&:?:;*&&!&6?:?:;:&:::::&&&:??*&&!&&*66666666+ 3 | /%666&&&&6:6:6%&&&&&6;::&&&?::?&&&6???:*:&%;:;:&&&??*&&&&&&&&*666:666666666%&&&&&&&&&&&%66666&&&&&6666&&&&;?:&&&&::;:;:;6&66666&&&&&&&&&/6666&?:*:?:6&&&&66;66&&&&&&&:666%&&;6:&!&&&&:;:6:66%&6:666&&&&&&&&&+6:66??????6+ 4 | &&%66:666&&&&66:6&&&66666&&&666666;&&66&6&&&&&&&&&&*6??????????/ 5 | //&66666;%&&&!&&6666&&66:6:6&&&&&6;666666&&%6666&&&&&&&&&&&&!*???***????/ 6 |  7 | &&6:666!&&&%&:!&&6:6%&66666&&&!66:6;66&&&:66%&&&&&&&&/????*????//&&6666:6&&&!::&&&&66&6%&66:6&&&&&666666;%&&&66666&&&&%&&&&&&???66% 8 | &666:6&&&&&&6:5:&&6:6&6&&&66666&&&&&%666666&&&&&6%6&&&&&&&%???;66&:666&&&&%6:::&&&66&6%6:6:6&&&&;66:666&&&66&&&&&&&&&???;66666666; 9 | 666666&&&&&6::?::%&66;::6&66666:6&&:666666&&&&&6%6&&&&&&/*??:!:?*??6:6666:&&&&&&&!5:????:%&%66%5::&&&:66666&&&6:66:6!6&&&&&!&&&&???;%*????6*%6:666&&&%6::????::66;:::&&666:6:&&&66666;6&&&&&&&/????????????/;666&&&%6::?:??:%6:6:5:::&&&66666%&&&&6:6666666&&&&&&&&&&*!*???*??*+&!66:&&&%!&!*????::&&!;%*:::%&&&66;66&&&66:66;6:6%&&&+6??**??*6:666&&&66%6&?:??:%&&6?::::&&&&:6666:&&&&&6666666666&&&&&&&*66&666??:666&&&&&&!6%66::::%?????:&&6??5:::&&&6:6666;&&&&&&:66;6:666;66;&"&&&*666&%;66*???&6&&66%:5::::%%*??::&6&&*::::&%&%66&&&6&!&6&&&6&%&!&&*666:66666+??*&&&!!:::::5::::&???5%&66?:5:%&66&&&&&&&&&&?????6????*&6&!6:::::????:%*?:&&&6?%:&&&&&:&6&&&&&?????:*???**6;%&%%%%%**:??::??::&6&*?::&&&&&6&%&%&&&&&&/???????????!%66&::???????::&&&?::::::&&&66;;&&&&&&&&&&&&&&&&&*6???????*!*66%:??:???:%&&?::?:::&&&&&&&&!6!6&&&&&&&&&&&+6?*****?6;/!&6%%???:??::&&&**?????:%&&&&&&&6&6&&&&&&&&&&&*6;!&66*!6&%6????????5%&???????:&&&&&&&&6666&&&&&&&:6&&&&&*666&%&6&!&%66;66!%:%::??:????:6&*????::::%&&&&&&&:66!&&&66:&&&&*6:66666;66666*6:%?:%:????:??*:&*?:?:%%::%&&&&&&6666;&%&666&&&&&*66;66:666;666;/66!:?*????????::&??:::&&&&&&66:&:66&&&&*666:666:66:66*/ 66%%:?*??:????:::::%&&&&&&&&&6%&&&%6&&&&/6666666666666+%&6!:??????????:%:%&&&&&&&66:66&&*666:66;66:666:&!6&!:???:?:??????:&&&&&&&&&&&&&&&*666666%666666+!6%;%?+??????????:%%+%&&&&&&&&&*6;6:6&&:66:6*/&6%:???%??>:?:?:??!:6*?66&&&&&&&&&&&&&&&&&&*666;!6666+!6!::*?-??????????!6:  ?:%:%&*666%&666:&!6!:%**(?????????*?:%?% %?:::&&6;!//%66+%6&6:???:?:??:????::? ::???:%&6666666&&&666:6:&&&*66:!;&%%:??****%%:?????>????:?:??** 10 |  11 | *???::&6:6;6&&&666666&&*6// 12 | !*!6&&!:???????:::?:?????:????????? *????:%&&666:6!&!;6:66&&&/!6&%::???????::???:?????:??????*)- =:????::%&!;666&&!666666&&///%6&&!:??:???::::?????:????::%??**%::?:???&!6:66&&&&6:6;%&&///&6&&%::?????:6???>?:??????::*??=:*?????*&&&666:&&66666&&&&//////%&&!::???:!:?????????:????????%:??????::&6:666&&:66:66&&&&&//!&&&%:?????::??:??:??>?????????*&**::??:???:&666&&&&6666&%&&&&///// 13 | !!6&!::?:?????????????:??:??:?????????????:??&&&6:6&&&&6:66&&&&&//%66&%*?????:??:??:?:?????????:????????????*&&&666&&!6666&&&&&&&&//////%!&:??:?????>??????:??:?:????:??:??:?***&&6%6&&6:6;!&&&&///&&&&!%:???????:??????????????????????>?*&&&666&&&6666&&&&&&&///////!6&&!%????%!???>?:??>:???:??:??:???*&&66%6&&&66:&&&&&&& 14 |  /!!&&?:??**:?*???:????????????***&6666&%&&666&&&&&&/&%::????!:??????????:??:???&&&&&&&&&&&&&&&&&&%&%&&!::???::!*??>????:%%&:&&&&&&&&:::!&%:????*!?*??:??:::::&&&&&&&&&?::%&&&%:????:!6!6:::%??????????????:::::&&&&&&??:%!&%::???::6%::!%*???:??:??????::%6%&*%%&&&&&&???::!&&::????6!::%*??:??????:???:::%6%:::6//&&&&&&&????*:!%!%:???&!!!???????:????:::%66!66::66&&&%&&&&:???:::*%*%:%???:&*%??:???>??::*%%6%!!!:6::5::%//&&&&&&&&5:????:::?  !???!///*???????????:????:%!!!6:6!6!::::::&&&&&&&&%:???::!&???   %????%///%????????????:%&%&!%6%66!6%::5:5:5:!&/&&&&&&&&&&&%%?:?:::** &!:???*%/*:??:??:****:%!%6666%6566:::::::::!/&&&&&&&&& -------------------------------------------------------------------------------- /MANDELBROT PLOT 64 COLOR RND ZOOM.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/MANDELBROT PLOT 64 COLOR RND ZOOM.gif -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CA65=ca65 2 | LD65=ld65 3 | 4 | basic.bin: min_mon.o 5 | $(LD65) -Ln L -o basic.bin \ 6 | -C basic.cfg \ 7 | min_mon.o 8 | 9 | min_mon.o: min_mon.asm basic.asm 10 | $(CA65) -g --cpu 65C02 --debug-info --feature labels_without_colons min_mon.asm 11 | 12 | clean: 13 | rm -f min_mon.o basic.bin 14 | 15 | -------------------------------------------------------------------------------- /PB7Speaker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/PB7Speaker.jpg -------------------------------------------------------------------------------- /PlasmaDemo.bas: -------------------------------------------------------------------------------- 1 | 0 PRINT"PLASMA DEMO" 2 | 1 BSET1:GSET99,32:S=0:L=0 3 | 2 DO:S=S+13:INCL:POKE$E6,$AF+L:POKE$E5,S 4 | 3 IF L>19THENL=0 5 | 4 GFXS0,0:BUFV:IFS>110THENS=0 6 | 5 LOOP 7 | 8 | -------------------------------------------------------------------------------- /PlasmaDemo.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/PlasmaDemo.bin -------------------------------------------------------------------------------- /PlasmaDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/PlasmaDemo.gif -------------------------------------------------------------------------------- /Program2000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Program2000.bin -------------------------------------------------------------------------------- /RandomScreen.asm: -------------------------------------------------------------------------------- 1 | ;NormalLuser Random Screen fill for the Ben Eater Worlds Worst Video Card+6502 2 | ;This is a 6502 ASM version of this code: 3 | ;NormalLuser Basic program to Clear Screen and then Random Fill: 4 | ;Ben Eater MS Basic version : 5 | ;1 FOR R = 8192 TO 16381 6 | ;2 POKE R,0 7 | ;3 NEXT R 8 | ;10 B=RND(1)*8192 9 | ;20 B=B+8192 10 | ;30 C=RND(1)*64 11 | ;40 POKE B,C 12 | ;50 GOTO 10 13 | ; BeEhBasic fast version : 14 | ;0 S=8192:E=16381:F=64:Z=0 15 | ;1 FORR=STOE:POKER,Z:NEXT 16 | ;2 DO:POKES+RND(Z)*S,RND(Z)*F:LOOP 17 | 18 | ACIA = $5000 ;Modified to match Ben Eater mapping was $4000 19 | ACIA_RX = ACIA ;$5000 20 | ACIA_TX = ACIA ;$5000 21 | ACIA_STATUS = ACIA+1;$5001 22 | ACIA_COMMAND = ACIA+2;$5002 23 | ACIA_CONTROL = ACIA+3;$5003 24 | ;Added Ben Eater Mapping. 25 | VIA = $6000 26 | VIA_PORTB = VIA 27 | VIA_PORTA = VIA+1;$6001 28 | VIA_DDRB = VIA+2;$6002 29 | VIA_DDRA = VIA+3;$6003 30 | VIA_T1CL = VIA+4;$6004 ;Can be used for rnd seed start 31 | VIA_T1CH = VIA+5;$6005 32 | VIA_T1LL = VIA+6;$6006 33 | VIA_T1LH = VIA+7;$6007 34 | VIA_T2CL = VIA+8;$6008 35 | VIA_T2CH = VIA+9;$6009 36 | VIA_SHIFT = VIA+10;$600A 37 | VIA_AUX = VIA+11;$600B ;Set to 0 to stop BEEP ALSO ACR 38 | VIA_PCR = VIA+12;$600C 39 | VIA_IFR = VIA+13;$600F 40 | VIA_IER = VIA+14;$600E 41 | VIA_IORA = VIA+15;$600F 42 | 43 | Display = $2000 ;Start of memory mapped display. 100x64 mapped to 128x64 44 | Screen = $ED ; GFX screen location 45 | ScreenH = $EE ; to draw TO 46 | 47 | seed2 = $7 48 | seed = $E2;$8 ; Lets use the VGAClock location as the seed location! 49 | ; That way 60 times a second one is DEC'd from the seed 50 | ; Will it make it more 'random'? 51 | ; Yep, works great! The seed number is 'randomly' DEC'd 52 | ; so there are 8 chances for it to change. 53 | VGAClock = $E2;***** IF NMI hooked up to vsync this will DEC ***** 54 | 55 | 56 | ProgramStart = $1D00 ;$500 57 | 58 | 59 | 60 | 61 | 62 | .org ProgramStart 63 | 64 | LDA #7 ;VGAClock;If no VGA clock use a number, 7 works 65 | STA seed 66 | LDA #77 67 | ;ORA VGAClock; If no VGA clock use a number, 77 works 68 | sta seed2 69 | jsr FillScreen ;clear screen 70 | 71 | .org ProgramStart+$10 72 | NewSeed: 73 | ;JSR GetRND 74 | Top: 75 | ;lda VGAClock 76 | ;BNE NewSeed 77 | ;JSR GetRND 78 | ;sta PixelPointer 79 | ;JSR GetRND ;Unroll now that I'm down to one RND call 80 | GetRND: ;Routine from: 81 | ; https://github.com/bbbradsmith/prng_6502/tree/master 82 | ; Random number generators for 6502 / NES. 83 | ; 84 | ; overlapped version, computes all 8 iterations in an overlapping fashion 85 | ; 69 cycles for RND; 35 bytes 86 | ; 76 cycles a pixel drawn*, 18,421 pixels a second, 307 pixels a frame at 60fps VGA 87 | ; 88 | ; * If Vsync is connected to the NMI, and a DEC is done in the NMI routine 89 | ; on the same zp location as the seed value that adds a few cycles 60 times a second. 90 | ; so 76.04 cycles a pixel or something like that if you assume 15 cycles for the NMI. 91 | ; This adds to the 'randomness' and the NMI routine already exists on my ROM. Win/Win. 92 | ; The JMP for the loop takes 6 cycles, or 110,526 a second. 93 | ;If I unroll 4 times that means I save: 94 | ; 82,895 cycles, using just 27,631 cycles a second on the jmp. 95 | ; 1,085 more pixels a second for a toatl of 19,506 pixels a second. 96 | ; 97 | galois16o: ;I get 63 cycles for the RND routine .Seems to work well. 98 | 99 | lda seed2 100 | tay ; store copy of high byte 101 | ; compute seed+1 ($39>>1 = %11100) 102 | lsr ; shift to consume zeroes on left... 103 | lsr 104 | lsr 105 | sta seed2 ; now recreate the remaining bits in reverse order... %111 106 | lsr 107 | eor seed2 108 | lsr 109 | eor seed2 110 | eor seed ; recombine with original low byte 111 | sta seed2 112 | ; compute seed+0 ($39 = %111001) 113 | tya ; original high byte 114 | sta seed 115 | asl 116 | eor seed 117 | asl 118 | eor seed 119 | asl 120 | asl 121 | asl 122 | eor seed 123 | sta seed 124 | 125 | 126 | LDY seed2;PixelPointer ;Speed up more by using other byte? 127 | STA (Screen),y; Go ahead and draw off screen for now. 128 | ;jsr GetRND ; Skip this for speed, use last color for row lookup instead 129 | ;tax ; I could just INX and allow my 'random' lookup array take care of it 130 | ;lda Array1,x ; But this adds extra 'random' without any extra cycles? 131 | ; The math to do 'between $20 and $3F' is more I'd think? 132 | ora #$20 ; Nope! Only 4 cycles vrs 6 to do the ORA and AND. Is it as 'random' though? 133 | and #$3F ; Seems 'random' enough to me. And it is fast! 134 | sta ScreenH 135 | 136 | jmp Top 137 | 138 | .org ProgramStart+$50 ;Random noise version 139 | nTop: 140 | 141 | lda seed2 142 | tay ; store copy of high byte 143 | ; compute seed+1 ($39>>1 = %11100) 144 | lsr ; shift to consume zeroes on left... 145 | lsr 146 | lsr 147 | sta seed2 ; now recreate the remaining bits in reverse order... %111 148 | lsr 149 | eor seed2 150 | lsr 151 | eor seed2 152 | eor seed ; recombine with original low byte 153 | sta seed2 154 | ; compute seed+0 ($39 = %111001) 155 | tya ; original high byte 156 | sta seed 157 | asl 158 | eor seed 159 | asl 160 | eor seed 161 | asl 162 | asl 163 | asl 164 | eor seed 165 | sta seed 166 | ;jsr LAB_BEEP 167 | 168 | tax 169 | LDA VIA_DDRB;$6002 170 | ORA #$80 ;%1000-0000 171 | STA VIA_DDRB;$6002 ; Set the high bit in DDRB, to make PB7 an output. 172 | 173 | ;WAIT, I don't think I need this LDA/ORA stuff for this register? 174 | ;Look into just doing a STA #$C0 175 | LDA VIA_AUX;$600b 176 | ;Using only 1100-0000 instead of 1111-0000 177 | ;because it is a lower duty cycle and sounds fine. 178 | ;This would be a retangle wave instead of a square wave, but no real matter. 179 | ;This lower duty cycle is better if you have a speaker hooked 180 | ;right up to the VIA to keep it from drawing too much power. 181 | 182 | ; Set the two high bits in the ACR to get the 183 | ORA #$C0 ;1100-0000; square-wave/RECTANGLE output on PB7. (Don't enable the 184 | STA VIA_AUX;$600b ; T1 interrupt in the IER though.) 185 | 186 | LDA #255 ; Set the T1 timeout period. 187 | ;LOWER THIS TO SOMETHING LIKE 77 FOR 1MHZ CPU CLOCK 188 | STA VIA_T1CL;$6004;;USE 255 if the Φ2 rate is 5MHz. To get it going, write to 189 | ;VIA_T1CH 190 | TXA ;BEEP IN A 191 | STA VIA_T1CH;$6005; 192 | 193 | 194 | LDY seed2;PixelPointer ;Speed up more by using other byte? 195 | 196 | 197 | STA (Screen),y; Go ahead and draw off screen for now. 198 | ora #$20 ; Nope! Only 4 cycles vrs 6 to do the ORA and AND. Is it as 'random' though? 199 | and #$3F ; Seems 'random' enough to me. And it is fast! 200 | sta ScreenH 201 | 202 | jmp nTop 203 | 204 | 205 | .org ProgramStart+$100 206 | FillScreen: ; Setup Screen pointer 207 | STZ Screen ; Ben Eater's Worlds Worst Video card 208 | LDA #$20 ; uses the upper 8Kb of system RAM 209 | STA ScreenH; This starts at location $2000 210 | LDY #0 ; Zero out Y for loop, we'll clear off screen area as well. 211 | LDA #0 ; Always use 0 for color with this routine. Cold load a memory location instead 212 | .MemLoop 213 | STA (Screen),Y 214 | INY 215 | BNE .MemLoop 216 | INC ScreenH 217 | LDX ScreenH 218 | CPX #$40 ;Top of screen memory is $3F-FF, 219 | BNE .MemLoop;Do until $40-00 220 | ; Reset it all 221 | STZ Screen ; Ben Eater's Worlds Worst Video card 222 | LDA #$20 ; uses the upper 8Kb of system RAM 223 | STA ScreenH; This starts at location $2000 224 | rts 225 | 226 | 227 | ; LAB_BEEP:;Fifty1Ford 228 | ; ;JSR LAB_GTBY ;get byte In x 229 | ; ;PHA 230 | ; TXA ;TRANSFER X TO A 231 | ; BEQ BEEP_Off ;if note 0 turn off beep; 232 | 233 | ; LDA VIA_DDRB;$6002 234 | ; ORA #$80 ;%1000-0000 235 | ; STA VIA_DDRB;$6002 ; Set the high bit in DDRB, to make PB7 an output. 236 | 237 | ; ;WAIT, I don't think I need this LDA/ORA stuff for this register? 238 | ; ;Look into just doing a STA #$C0 239 | ; LDA VIA_AUX;$600b 240 | ; ;Using only 1100-0000 instead of 1111-0000 241 | ; ;because it is a lower duty cycle and sounds fine. 242 | ; ;This would be a retangle wave instead of a square wave, but no real matter. 243 | ; ;This lower duty cycle is better if you have a speaker hooked 244 | ; ;right up to the VIA to keep it from drawing too much power. 245 | 246 | ; ; Set the two high bits in the ACR to get the 247 | ; ORA #$C0 ;1100-0000; square-wave/RECTANGLE output on PB7. (Don't enable the 248 | ; STA VIA_AUX;$600b ; T1 interrupt in the IER though.) 249 | 250 | ; LDA #255 ; Set the T1 timeout period. 251 | ; ;LOWER THIS TO SOMETHING LIKE 77 FOR 1MHZ CPU CLOCK 252 | ; STA VIA_T1CL;$6004;;USE 255 if the Φ2 rate is 5MHz. To get it going, write to 253 | ; ;VIA_T1CH 254 | ; TXA ;BEEP IN A 255 | ; STA VIA_T1CH;$6005; 256 | 257 | ; RTS 258 | ; BEEP_Off: 259 | ; STZ VIA_AUX;$600b;VIA_ACR <<< I THINK I ONLY NEED THIS??? 260 | ; ;Timer is still going but nothing is output? 261 | ; TXA 262 | ; RTS 263 | 264 | 265 | ; Works well, but not needed: 266 | ; This is all the high bytes of the Screen pointer in random order, non repeating within each 267 | ; 32 entry line x 8 lines for 256 random but evenly distributed values $20 to $3F to match the VGA display map. 268 | ; This seems like a fast way to take care of the upper screen byte and it introduces some randomness. 269 | ; .org $600 ;Page align for speed 270 | ; Array1: ;https://www.calculatorsoup.com/calculators/statistics/random-number-generator.php 271 | ; .byte 50,42,46,54,57,52,43,53,39,63,35,38,62,36,48,55,56,33,49,45,44,34,60,40,61,32,37,47,59,51,41,58 272 | ; .byte 37,59,52,62,34,38,60,35,47,42,51,49,39,44,63,43,40,58,41,50,45,54,32,48,36,57,56,33,55,61,46,53 273 | ; .byte 52,55,53,33,42,47,34,40,62,61,32,58,41,50,45,51,57,60,54,59,63,36,49,37,46,39,35,43,44,38,48,56 274 | ; .byte 41,43,40,55,57,39,38,59,63,44,33,53,62,48,42,60,49,52,32,37,46,58,34,54,36,35,45,56,47,61,51,50 275 | ; .byte 61,34,32,62,51,56,33,39,50,38,57,54,46,43,36,59,58,47,42,49,45,44,40,52,55,41,48,53,35,63,37,60 276 | ; .byte 53,46,55,63,62,40,34,32,48,49,38,44,52,33,51,57,54,60,37,43,41,58,56,42,35,36,59,61,47,39,45,50 277 | ; .byte 62,32,37,57,49,43,47,35,63,59,54,33,58,56,34,45,42,46,61,48,39,36,55,52,51,38,44,40,53,41,50,60 278 | ; .byte 57,56,40,55,53,43,54,47,44,35,61,49,46,33,51,42,60,45,63,39,32,38,37,52,34,62,50,59,48,36,41,58 279 | 280 | 281 | 282 | ;Other routines: 283 | ; galois16: ;133 cycles 284 | ; ldy #8 285 | ; lda seed+0 286 | ; lb1: 287 | ; asl ; shift the register 288 | ; rol seed+1 289 | ; bcc lb2 290 | ; eor #$39 ; apply XOR feedback whenever a 1 bit is shifted out 291 | ; lb2: 292 | ; dey 293 | ; bne lb1 294 | ; sta seed+0 295 | ; cmp #0 ; reload flags 296 | ; rts 297 | ; galois16u: ;98 clock cycles 298 | ; lda seed+0 299 | ; ; .repeat 8 300 | ; asl 301 | ; rol seed+1 302 | ; bcc lb3 303 | ; EOR #$39 304 | ; lb3: 305 | ; asl 306 | ; rol seed+1 307 | ; bcc lb4 308 | ; eor #$39 309 | ; lb4: 310 | ; asl 311 | ; rol seed+1 312 | ; bcc lb5 313 | ; eor #$39 314 | ; lb5: 315 | ; asl 316 | ; rol seed+1 317 | ; bcc lb6 318 | ; eor #$39 319 | ; lb6: 320 | ; asl 321 | ; rol seed+1 322 | ; bcc lb7 323 | ; eor #$39 324 | ; lb7: 325 | ; asl 326 | ; rol seed+1 327 | ; bcc lb8 328 | ; eor #$39 329 | ; lb8: 330 | ; asl 331 | ; rol seed+1 332 | ; bcc lb9 333 | ; eor #$39 334 | ; lb9 335 | ; asl 336 | ; rol seed+1 337 | ; bcc lb10 338 | ; eor #$39 339 | ; lb10: 340 | 341 | ; ; ;.endrepeat: 342 | ; lb11: 343 | ; sta seed+0 344 | ; cmp #0 345 | ; rts 346 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | **BeEhBasic.** 2 | **EhBasic for your Ben Eater 6502 Breadboard Computer.** 3 | 4 | This is my version of EhBASIC. EhBASIC is an Enhanced version of the same kind of BASIC used in apple and C64 and other 6502 computers of the time. 5 | 6 | A person named Lee Davison spent a lot of time working on it during his life. 7 | 8 | For a manual and example code you can look here for a mirror of Lee's site: 9 | 10 | http://retro.hansotten.nl/6502-sbc/lee-davison-web-site/enhanced-6502-basic/ 11 | 12 | This version is inteneded for use with the Ben Eeater 6502 computer with serial port. 13 | This is a breadboard computer that can be built as a kit or by following the plans. 14 | https://eater.net/ 15 | 16 | I have been adding routines to my version of EhBASIC like PLOT and COLOR for the Worlds Worst 17 | Video Card: 18 | https://eater.net/vga 19 | 20 | I've also added Beep using the VIA, and PAUSE. 21 | The Video Card or speaker is not required to use this version of BASIC. Only the BE6502 and serial port are needed. 22 | 23 | It is the intent that all versions work with the 'Stock' Ben Eater 6502 setup unless otherwise noted. 24 | 25 | 26 | **Update!** 7/19/2023 27 | ![Plasma Demo](https://raw.githubusercontent.com/Fifty1Ford/BeEhBasic/main/PlasmaDemo.gif) 28 | 29 | 30 | My version of this demo: "Plasmegg" [2002 | repack 2010 by cpcrulez] 31 | Info found here: http://norecess.cpcscene.net/the-elders-scrollers.html 32 | 33 | This demo uses my new BUFV command to do a V-blank sync buffer swap. 34 | If you are using the stock system without the v-blank connedted to the NMI you should change this 35 | to the normal BUFF routine. You may want to add a PAUSE0 to slow down the animation a bit. 36 | 37 | Not used in this demo but also added was a PEN routine. Now instead of POKE'ing $EC to set 38 | the Pen color you can use the PEN command to set it. 39 | See PlasmaDemo.bas for the basic. 40 | The current uploaded files should MAKE the right version of BASIC. 41 | There is a compiled BIN file called PlasmaDemo.bin. This has the correct 42 | image file loaded in it. 43 | 44 | 45 | 46 | 8/29/2023 47 | 48 | ![Double Buffer Demo](https://raw.githubusercontent.com/Fifty1Ford/BeEhBasic/main/DoubleBufferScroll.gif) 49 | 50 | ![Double Buffer Logic](https://raw.githubusercontent.com/Fifty1Ford/BeEhBasic/main/VGADoubleBufferFifty1Ford.png) 51 | 52 | 53 | 54 | 55 | 56 | With 3 added 74 series chips, and one unused gate you already have from the VGA kit, you can have a hardware double buffer! 57 | This takes advantage of the unused 16K of SRAM that is not mapped due to the simple address decoding of the orginal Ben Eater 6502 setup. 58 | If you have the VGA kit with your 6502 the first thing you want to do is clock your cpu at 5Mhz. (See Note on bottom) 59 | But the next modification you should make hardware wise is the double buffer. It makes a huge improvement in what can be done and makes draw routines easier since you get to write off screen without worrying about flickers and garbage as you draw to a live video output. 60 | 61 | The running sprite program below uses 8 frames of animation stored in a raw bitmap on the ROM in the unused space between EhBasic and Woz Monitor .My program simply fills the screen with a random color on my new hardware screen buffer, then it draws the line using the last color used for the background color. Then I add the tick-marks, 62 | 63 | Next I set the address in memory to copy from (one of the frames of animation) and then use the GFXA sprite routine I added to basic to draw the animation frame. 64 | 65 | Then I use the 'BUFF' routine I added to BASIC to swap the two buffers. 66 | 67 | I'm still amazed at how much you can do with such simple hardware and software. 68 | 69 | This could be done without the double buffer with a self erasing sprite, but as the screens get more complex it gets harder and harder to add things without visible flickering. 70 | 71 | I also added some BEEP commands so that there is a foot-fall sound if you have the speaker hooked up (see below). 72 | 73 | ![Llife](https://raw.githubusercontent.com/NormalL-Life/blob/main/NormalLlife.gif) 74 | 75 | 76 | This 10 lines of code gets me quite a lot: 77 | 78 | 0 PRINT "RUNNING MAN PROGRAM NormalLuser ART Zegley" 79 | 80 | 1 DATA 55552,55582,55614,55645,59648,59676,59710,59737,0 81 | 82 | 2 BSET1:GSET30,16:C=1:POKE$EC,0:Z=100:FORX=0TO7:READD(X):NEXTX 83 | 84 | 3 X=10:Y=2:Z=1:P=20:U=10:OX=0:R=0:S=0 85 | 86 | 4 DOKE$E5,D(S):INCS:MY=Y+31:COLOR C:MOVE0,MY:GFXH100 87 | 88 | 5 BEEP0:ZZ=Z+50:PLOTZZ,MY:PLOTZZ,MY+1:PLOTZZ,MY+2 89 | 90 | 6 PLOTZ,MY:PLOTZ,MY+1:PLOTZ,MY+2:DECZ,Z,Z,Z,Z:IFZ=0THENZ=100 91 | 92 | 7 GFXA X,Y:BUFF:INCR:IFS>7THEN S=0:BEEP200 93 | 94 | 8 IFR>58THEN10ELSEIFS=3THENBEEP200 95 | 96 | 9 MOVE0,33:GFXH 99:INCX,X:GOTO4 97 | 98 | 10 POKE$EC,C:C=RND(0)*63:R=0:Y=RND(0)*30:X=0:GOTO4 99 | 100 | 101 | 102 | Added EhBasicRun.bin 103 | 104 | This update adds: 105 | 106 | BSET (1 or 0) this turns on and off hardware double buffer. 107 | 108 | When 0 the system is in normal single framebuffer mode. 109 | 110 | When 1 the VGA displays one frame buffer while the CPU controls the other. 111 | 112 | BUFF This command swaps the two buffers so that the 'back buffer' 113 | is now the displayed buffer 114 | 115 | GSET this allows you to set the sprite size without using peek and poke. 116 | 117 | 118 | 119 | 120 | 121 | 122 | 7/13/2023 123 | 124 | Added EhBasicBeepPause.bin, BeepApple.bas, and updated basic.asm source. 125 | This update adds a PAUSE command to ehbasic. This command does NOT use a timer. 126 | You will need to adjust based on your clock speed. This is needed to allow BEEP 127 | to work correctly. 128 | 129 | 130 | ![Speaker](https://raw.githubusercontent.com/Fifty1Ford/BeEhBasic/main/PB7Speaker.jpg) 131 | 132 | Connect PB7, pin 17 on the 6522 to the positive side of a 47uF electrolytic capacitor connect the - side of the capacitor to a 100Ω resistor, then to the positive speaker wire . The other speaker wire goes to ground near the 6522. 133 | 134 | In this case I'm using a 8 Ohm 1 Watt 3 inch Adafruit speaker. 135 | 136 | https://www.amazon.com/dp/B00XW2NPTG?psc=1&ref=ppx_yo2ov_dt_b_product_details 137 | 138 | 139 | 6/29/2023 140 | Added BEEP command as well as first pass at a Horizontal Line routine GFXH. 141 | 142 | BEEP 0 is off, BEEP 1 is a high tone, BEEP 255 is a low tone. 143 | 144 | I also changed CLS so that it also stops any BEEP. 145 | 146 | Here is a demo: 147 | 148 | 1 DO:GETT:IFT>0THENBEEPT:POKE$EC,T:MOVET/1.5,T/2 149 | 150 | 2 LOOP 151 | 152 | ** NOTE ** 153 | BEEP is set for a 5Mhz system. 154 | For a slower system you will need to edit the BEEP routine. 155 | See comments in source, or just overclock to 5Mhz!!! 156 | 157 | GFXH 5 will draw a line 5 pixels long starting at the last MOVE position. 158 | 159 | It uses the color stored in $EC, you can use POKE $EC,48 to set the color. 160 | 161 | Here is a demo: 162 | 163 | 1 DO:X=RND(0)*99:Y=RND(0)*62:C=RND(0)*64:MOVE X,Y:GFXHRND(0)*50 164 | 165 | 2 POKE$EC,C:LOOP 166 | 167 | 168 | 169 | Older Updates: 170 | 171 | Now with Transparent Sprite command GFXT 172 | 173 | ![Sprites](https://raw.githubusercontent.com/Fifty1Ford/BeEhBasic/main/TransparentSprites.gif) 174 | 175 | 176 | Here is a little demo of what it can do: 177 | 178 | 0 C=RND(0)*63:POKE$EB,C:R=0:COLOR C 179 | 180 | 1 ?"7 Transparent Sprites":X=1:Y=1:DX=1:DY=1:R=0:S=0 181 | 182 | 2 DO:DOKE$E5,$AE00:GFXTX,Y:GFXTX+18,30-Y:DOKE$E5,$AE11 183 | 184 | 3 GFXT59-X,46-Y:GFXT59-X,Y:DOKE$E5,$AE51:GFXTX,42 185 | 186 | 4 DOKE$E5,$B700:GFXT84,Y/2+35:GFXT84,16-Y/2:Y=Y+DY:X=X+DX 187 | 188 | 5 IFX<=1ORX>=50THENDX=-DX:INCR 189 | 190 | 6 IFY<=0ORY>=16THENDY=-DY 191 | 192 | 7 IFR=2THENR=0:C=RND(0)*63:POKE$EB,C:COLOR C 193 | 194 | 8 LOOP 195 | 196 | 197 | **NOW WITH GFX COMMANDS!** 198 | 199 | There is now a command called GFX that will plot a 42x42 image to the screen. 200 | This can be used like a sprite. 201 | 202 | ![Sprites](https://raw.githubusercontent.com/Fifty1Ford/BeEhBasic/main/BasicBallss.gif) 203 | 204 |
205 |
206 |
207 | 208 | This version of EhBasic has been modified to include some graphics commands for the Ben Eater 6502 + Worlds Worst Video Card kit. 209 | Remember, all commands must be in CAPS 210 | New non-standard commands: 211 | 212 | CLS -Clears screen to black
213 | COLOR X -Colors screen chosen color IE COLOR 48
214 | PLOT X,Y -Plots a pixel with x/y coordinate system.
215 | Currently to change the plot color you would POKE the value to $EC.
216 |
217 | POKE $EC, 3 218 |
219 | You can use the below one line format example to set the color and plot the pixel 220 | 221 | **10 POKE $EC,3 : PLOT 1,1** 222 | 223 | NOTE: 224 | There is no bounds checking on the PLOT command. Using X values other than 0-99 and Y other than 0-63 will lead to strange and unwanted results. 225 | 226 | **GFX X,Y -** Plots a 42x42 image into the screen. 227 | 228 | There is no bounds checking on the PLOT command. Using X values other than 0-99 and Y other than 0-22 will lead to strange and unwanted results. 229 | Currently to change the image copied you would POKE the value to $E5 and $E6. It must have a $00 low byte starting location, IE $AF00. It must be 128 byte aligned in the file, IE a new row every 128 bytes like the Ben Eater images. Going $AF00, then $AF80 for the next line, etc. 230 | You can use the below example to show a spinning ball with the included files. It updates with pokes the address for the image to copy. 231 |
232 | **1 S=0:DIM D(20):COLOR 63** 233 |
234 | **2 DATA 175,1,175,43,175,85,198,1,198,43,198,85** 235 |
236 | **3 FOR X=0 TO 11:READ D(X):NEXT X** 237 |
238 | **4 DO:POKE$E6,D(S):INCS:POKE$E5,D(S):INCS:GFX30,10** 239 |
240 | **6 IFS>11THENS=0** 241 |
242 | **7 LOOP** 243 |
244 | 245 | See this for a more impressive demo of the GFX command: 246 | [FullSpin.bas](https://github.com/Fifty1Ford/BeEhBasic/blob/main/FullSpin.bas) 247 | 248 | **NOTE:** 249 | The Graphics commands use a lot of cycles. I highly recommend running your 6502 at 5Mhz with the VGA kit. 250 | If you use the VGA kit, disconnect your 6502 clock wire from the 1Mhz crystal and use a jumper wire to connect your 6502 to the first counter of the VGA setup. IE a 5mhz clock. You may need to add additional bypass capacitors to your power rails and run additional wires directly to power and ground rails on the breadboards to make it stable, but the stock parts should work fine at 5mhz. 251 | 252 | Since the Ben Eater VGA setup halts the CPU while drawing you only get to process 26% of the time if you run during Hsync or 8% of the time if you don't. 253 | This is pretty bad with a 1mhz CPU for doing graphics. 254 | 0.26Mhz or 0.08Mhz effective speed.. 255 | Pretty bad! 256 | But with a 5mhz clock speed you get a whole 1.3mhz or 0.4mhz effective! 257 | That is pretty usable actually! 258 | The 5mhz speed also makes the left side noise shrink down to one single lost pixel on the left side. This makes running during Hsync viable. 259 | 260 | Previous Update: 261 | Ben Eater has come out with a ACIA serial kit for the 6502! 262 | If you don't have a ACIA chip and such laying around go ahead and get it! 263 | https://eater.net/shop 264 | It's got what you need and the price of the kit is less than the parts individually since you'd have to buy multi-packs of the passives. 265 | My current hardware setup works for both address $4000 and $5000. 266 | I should look to see what the exact difference is between my decoding and Ben’s. 267 | But I now will use address $5000 for the ACIA to insure this software works with anyone with Ben’s Serial kit or who otherwise follows along with Ben’s videos. 268 | 269 |
270 | -------------------------------------------------------------------------------- /RunningMan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/RunningMan.gif -------------------------------------------------------------------------------- /Source/BallDemo/ABalls3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/ABalls3.bin -------------------------------------------------------------------------------- /Source/BallDemo/ABalls3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/ABalls3.png -------------------------------------------------------------------------------- /Source/BallDemo/BallSprites.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/BallSprites.jpg -------------------------------------------------------------------------------- /Source/BallDemo/BasicShapes.bas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/BasicShapes.bas -------------------------------------------------------------------------------- /Source/BallDemo/FullSpin.bas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/FullSpin.bas -------------------------------------------------------------------------------- /Source/BallDemo/MANDELBROT PLOT 64 COLOR RND ZOOM.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/MANDELBROT PLOT 64 COLOR RND ZOOM.gif -------------------------------------------------------------------------------- /Source/BallDemo/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/Makefile -------------------------------------------------------------------------------- /Source/BallDemo/Readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/Readme.md -------------------------------------------------------------------------------- /Source/BallDemo/Readme.txt: -------------------------------------------------------------------------------- 1 | Bouncing ball version of EhBasic. 2 | This build will have a version with Ball Sprites and a 3 | GFX command for moving and animating sprites. 4 | -------------------------------------------------------------------------------- /Source/BallDemo/WozCall.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/WozCall.asm -------------------------------------------------------------------------------- /Source/BallDemo/basic.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/basic.asm -------------------------------------------------------------------------------- /Source/BallDemo/basic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/basic.bin -------------------------------------------------------------------------------- /Source/BallDemo/basic.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/basic.cfg -------------------------------------------------------------------------------- /Source/BallDemo/basicWorkingBallSprite.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/basicWorkingBallSprite.bin -------------------------------------------------------------------------------- /Source/BallDemo/bk.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/bk.bin -------------------------------------------------------------------------------- /Source/BallDemo/bkmove.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/bkmove.bin -------------------------------------------------------------------------------- /Source/BallDemo/min_mon.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/Source/BallDemo/min_mon.asm -------------------------------------------------------------------------------- /Source/Readme.txt: -------------------------------------------------------------------------------- 1 | Source files for BeEhBasic 2 | -------------------------------------------------------------------------------- /TransparentSprites.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/TransparentSprites.gif -------------------------------------------------------------------------------- /Trebuchet.BAS: -------------------------------------------------------------------------------- 1 | 2 | 0 ?"SCORE AND LEVELS":LEVEL=0:M=63 3 | 10 SCR=0:DIM X2(40):DIM Y2(40):DIM C2(40) 4 | 100 TRY=1 5 | 101 COLOR 5 6 | 200 ?:?"Choose Projectile's Initial Speed and Direction:":? 7 | 201 ?"-- SETUP PLAYFIELD --":? 8 | 203 GOSUB 8000 9 | 1000 REM Trebuchet 10 | 1010 REM Quite BASIC Game Project 11 | 1011 REM Fifty1Ford added score, sun, and changed to BE6502 EhBasic 12 | 2010 ? "A trebuchet is a type of medieval weapon that " 13 | 2011 ? " was used to throw projectiles into an enemy" 14 | 2012 ? " fortification. " 15 | 2013 ? "In this game your job is to throw a projectile" 16 | 2014 ? " from the GREEN base to hit the RED target. " 17 | 2015 ? "You control the flight by selecting the initial " 18 | 2016 ? " speed and angle." 19 | 2017 ? "--The speed must be between 1 and 10--" 20 | 2018 ? "--The angle must be between 90 (straight up)-- " 21 | 2019 ? "--and 0 (straight to the right)--" 22 | 2000 REM 23 | 2030 A=RND(0)*25+0.5 24 | 2040 B=RND(0)*25+0.5:POKE $EC,0 25 | 2060 FOR I=0 TO 24:FOR J=0 TO M 26 | 2070 IF J <=A THEN PLOT I,M-J 27 | 2071 NEXT J:NEXT I 28 | 2090 FOR I=25 TO 49:FOR J=0 TO M 29 | 2100 IF J<=B THEN PLOT I,M-J 30 | 2101 NEXT J:NEXT I 31 | 2120 IF A>B THEN S=-1 ELSE S=1 32 | 2130 FOR I=A TO B+6 STEP S:POKE $EC,36:PLOT 25,M-I:NEXT I 33 | 2170 POKE $EC,12:PLOT 10,M-A:POKE $EC,48:PLOT 39,M-B 34 | 2200 PLOT 40, M-B:PLOT 41,M-B 35 | 2230 FOR I=B+1 TO B+3 36 | 2240 POKE $EC,21:PLOT 39,M-I:PLOT 40,M-I 37 | 2260 PLOT 41,M-I:PLOT 38,M-I-2:PLOT 42,M-I-1:PLOT 40,M-I-3 38 | 2300 NEXT I 39 | 3010 X=10:Y=A+1 40 | 3040 INPUT "Speed (1-10)?";P:SPEED=P 41 | 3050 IF P>=1 AND P<=10 THEN GOTO 3080 42 | 3060 ? "Speed must be between 1 and 10" 43 | 3070 GOTO 3040 44 | 3080 INPUT "Angle (0 - 90)?";F 45 | 3090 IF F>=0 AND F<=90 THEN GOTO 3150 46 | 3100 ? "The angle must be between 0 and 90" 47 | 3120 GOTO 3080 48 | 3150 U=P/5*COS(F/180*PI) 49 | 3170 V=P/5*SIN(F/180*PI) 50 | 3175 POKE $EC,5:IF M-Y>=0 THEN PLOT X, M-Y 51 | 3210 X=X+U:Y=Y+V 52 | 3240 IF X<25 AND Y99 THEN 4000 54 | 3260 IF X>25 AND Y79 AND X<90 AND Y>45 AND Y<57 THEN 7000 56 | 3275 POKE $EC,60 57 | 3280 IF Y2 THEN GOTO 4000 60 | 3515 ? 61 | 3516 ?"SCR=","1+SPEED","-TRY":? 62 | 3517 ?SCR,"1+";SPEED,TRY:? 63 | 3520 OSCR=SCR:SCR=1+SPEED:SCR=SCR-TRY 64 | 3521 ?:?"Hit! You win! TRY: "; TRY;" LEVEL: ";LEVEL;" ";OSCR 65 | 3522 SCR=(1+LEVEL)*SCR:IF SCR<1 THEN SCR=1 66 | 3523 ?" **** LEVEL SCORE : ";SCR;" ****":? 67 | 3524 SCR=OSCR+SCR 68 | 3525 ?" **** TOTAL SCORE : ";SCR;" ****":? 69 | 3526 ?:?"OSCR","SCR","SPEED","TRY" 70 | 3527 ? OSCR, SCR, SPEED, TRY 71 | 3530 GOSUB 6000 72 | 3780 INC LEVEL:GOTO 100 73 | 3790 IF Y2(I)0.8 THEN C2(I)=48 96 | 6680 IF RND(0)>0.8 THEN C2(I)=52 97 | 6690 IF RND(0)>0.8 THEN C2(I)=60 98 | 6700 IF RND(0)>0.3 AND Y2(I)MSG1 50 | STA MSGH 51 | JSR SHWMSG ;* Show Welcome. 52 | LDA #$0A 53 | JSR ECHO ;* New line. 54 | LDA #MSG5 57 | STA MSGH 58 | JSR SHWMSG ;* Show Welcome. 59 | LDA #$0D 60 | JSR ECHO ;* New line. 61 | LDA #$0A 62 | JSR ECHO 63 | SOFTRESET LDA #$9B ;* Auto escape. 64 | NOTCR CMP #$88 ;"<-"? * Note this was chaged to $88 which is the back space key. 65 | BEQ BACKSPACE ;Yes. 66 | CMP #$9B ;ESC? 67 | BEQ ESCAPE ;Yes. 68 | INY ;Advance text index. 69 | BPL NEXTCHAR ;Auto ESC if >127. 70 | ESCAPE LDA #$DC ;"\" 71 | JSR ECHO ;Output it. 72 | GETLINE LDA #$8D ;CR. 73 | JSR ECHO ;Output it. 74 | LDA #$0A 75 | JSR ECHO 76 | LDY #$01 ;Initiallize text index. 77 | BACKSPACE DEY ;Backup text index. 78 | BMI GETLINE ;Beyond start of line, reinitialize. 79 | LDA #$A0 ;*Space, overwrite the backspaced char. 80 | JSR ECHO 81 | LDA #$88 ;*Backspace again to get to correct pos. 82 | JSR ECHO 83 | NEXTCHAR LDA ACIA_SR ;*See if we got an incoming char 84 | AND #$08 ;*Test bit 3 85 | BEQ NEXTCHAR ;*Wait for character 86 | LDA ACIA_DAT ;*Load char 87 | CMP #$60 ;*Is it Lower case 88 | BMI CONVERT ;*Nope, just convert it 89 | AND #$5F ;*If lower case, convert to Upper case 90 | CONVERT ORA #$80 ;*Convert it to "ASCII Keyboard" Input 91 | STA IN,Y ;Add to text buffer. 92 | JSR ECHO ;Display character. 93 | CMP #$8D ;CR? 94 | BNE NOTCR ;No. 95 | LDY #$FF ;Reset text index. 96 | LDA #$00 ;For XAM mode. 97 | TAX ;0->X. 98 | SETSTOR ASL ;Leaves $7B if setting STOR mode. 99 | SETMODE STA MODE ;$00 = XAM, $7B = STOR, $AE = BLOK XAM. 100 | BLSKIP INY ;Advance text index. 101 | NEXTITEM LDA IN,Y ;Get character. 102 | CMP #$8D ;CR? 103 | BEQ GETLINE ;Yes, done this line. 104 | CMP #$AE ;"."? 105 | BCC BLSKIP ;Skip delimiter. 106 | BEQ SETMODE ;Set BLOCK XAM mode. 107 | CMP #$BA ;":"? 108 | BEQ SETSTOR ;Yes, set STOR mode. 109 | CMP #$D2 ;"R"? 110 | BEQ RUN ;Yes, run user program. 111 | CMP #$CC ;* "L"? 112 | BEQ LOADINT ;* Yes, Load Intel Code. 113 | STX L ;$00->L. 114 | STX H ; and H. 115 | STY YSAV ;Save Y for comparison. 116 | NEXTHEX LDA IN,Y ;Get character for hex test. 117 | EOR #$B0 ;Map digits to $0-9. 118 | CMP #$0A ;Digit? 119 | BCC DIG ;Yes. 120 | ADC #$88 ;Map letter "A"-"F" to $FA-FF. 121 | CMP #$FA ;Hex letter? 122 | BCC NOTHEX ;No, character not hex. 123 | DIG ASL 124 | ASL ;Hex digit to MSD of A. 125 | ASL 126 | ASL 127 | LDX #$04 ;Shift count. 128 | HEXSHIFT ASL ;Hex digit left MSB to carry. 129 | ROL L ;Rotate into LSD. 130 | ROL H ;Rotate into MSD's. 131 | DEX ;Done 4 shifts? 132 | BNE HEXSHIFT ;No, loop. 133 | INY ;Advance text index. 134 | BNE NEXTHEX ;Always taken. Check next character for hex. 135 | NOTHEX CPY YSAV ;Check if L, H empty (no hex digits). 136 | BNE NOESCAPE ;* Branch out of range, had to improvise... 137 | JMP ESCAPE ;Yes, generate ESC sequence. 138 | RUN JSR ACTRUN ;* JSR to the Address we want to run. 139 | JMP SOFTRESET ;* When returned for the program, reset EWOZ. 140 | ACTRUN ;JPM 141 | PHA 142 | PHP 143 | PHX 144 | PHY 145 | 146 | 147 | JMP (XAML) ;Run at current XAM index. 148 | 149 | LOADINT JSR LOADINTEL ;* Load the Intel code. 150 | JMP SOFTRESET ;* When returned from the program, reset EWOZ. 151 | 152 | NOESCAPE BIT MODE ;Test MODE byte. 153 | BVC NOTSTOR ;B6=0 for STOR, 1 for XAM and BLOCK XAM 154 | LDA L ;LSD's of hex data. 155 | STA (STL, X) ;Store at current "store index". 156 | INC STL ;Increment store index. 157 | BNE NEXTITEM ;Get next item. (no carry). 158 | INC STH ;Add carry to 'store index' high order. 159 | TONEXTITEM JMP NEXTITEM ;Get next command item. 160 | NOTSTOR BMI XAMNEXT ;B7=0 for XAM, 1 for BLOCK XAM. 161 | LDX #$02 ;Byte count. 162 | SETADR LDA L-1,X ;Copy hex data to 163 | STA STL-1,X ;"store index". 164 | STA XAML-1,X ;And to "XAM index'. 165 | DEX ;Next of 2 bytes. 166 | BNE SETADR ;Loop unless X = 0. 167 | NXTPRNT BNE PRDATA ;NE means no address to print. 168 | LDA #$8D ;CR. 169 | JSR ECHO ;Output it. 170 | LDA #$0A 171 | JSR ECHO 172 | LDA XAMH ;'Examine index' high-order byte. 173 | JSR PRBYTE ;Output it in hex format. 174 | LDA XAML ;Low-order "examine index" byte. 175 | JSR PRBYTE ;Output it in hex format. 176 | LDA #$BA ;":". 177 | JSR ECHO ;Output it. 178 | PRDATA LDA #$A0 ;Blank. 179 | JSR ECHO ;Output it. 180 | LDA (XAML,X) ;Get data byte at 'examine index". 181 | JSR PRBYTE ;Output it in hex format. 182 | XAMNEXT STX MODE ;0-> MODE (XAM mode). 183 | LDA XAML 184 | CMP L ;Compare 'examine index" to hex data. 185 | LDA XAMH 186 | SBC H 187 | BCS TONEXTITEM ;Not less, so no more data to output. 188 | INC XAML 189 | BNE MOD8CHK ;Increment 'examine index". 190 | INC XAMH 191 | MOD8CHK LDA XAML ;Check low-order 'exainine index' byte 192 | AND #$0F ;For MOD 8=0 ** changed to $0F to get 16 values per row ** 193 | BPL NXTPRNT ;Always taken. 194 | PRBYTE PHA ;Save A for LSD. 195 | LSR 196 | LSR 197 | LSR ;MSD to LSD position. 198 | LSR 199 | JSR PRHEX ;Output hex digit. 200 | PLA ;Restore A. 201 | PRHEX AND #$0F ;Mask LSD for hex print. 202 | ORA #$B0 ;Add "0". 203 | CMP #$BA ;Digit? 204 | BCC ECHO ;Yes, output it. 205 | ADC #$06 ;Add offset for letter. 206 | ECHO PHA ;*Save A 207 | AND #$7F ;*Change to "standard ASCII" 208 | STA ACIA_DAT ;*Send it. 209 | pWAIT LDA ACIA_SR ;*Load status register for ACIA 210 | AND #$10 ;*Mask bit 4. 211 | BEQ pWAIT ;*ACIA not done yet, wait. 212 | PLA ;*Restore A 213 | RTS ;*Done, over and out... 214 | 215 | SHWMSG LDY #$0 216 | pPRINT LDA (MSGL),Y 217 | BEQ pDONE 218 | JSR ECHO 219 | INY 220 | BNE pPRINT 221 | pDONE RTS 222 | 223 | 224 | ; Load an program in Intel Hex Format. 225 | LOADINTEL LDA #$0D 226 | JSR ECHO ;New line. 227 | LDA #MSG2 230 | STA MSGH 231 | JSR SHWMSG ;Show Start Transfer. 232 | LDA #$0D 233 | JSR ECHO ;New line. 234 | LDY #$00 235 | STY CRCCHECK ;If CRCCHECK=0, all is good. 236 | INTELLINE JSR GETCHAR ;Get char 237 | STA IN,Y ;Store it 238 | INY ;Next 239 | CMP #$1B ;Escape ? 240 | BEQ INTELDONE ;Yes, abort. 241 | CMP #$0D ;Did we find a new line ? 242 | BNE INTELLINE ;Nope, continue to scan line. 243 | LDY #$FF ;Find (:) 244 | FINDCOL INY 245 | LDA IN,Y 246 | CMP #$3A ; Is it Colon ? 247 | BNE FINDCOL ; Nope, try next. 248 | INY ; Skip colon 249 | LDX #$00 ; Zero in X 250 | STX CRC ; Zero Check sum 251 | JSR GETHEX ; Get Number of bytes. 252 | STA COUNTER ; Number of bytes in Counter. 253 | CLC ; Clear carry 254 | ADC CRC ; Add CRC 255 | STA CRC ; Store it 256 | JSR GETHEX ; Get Hi byte 257 | STA STH ; Store it 258 | CLC ; Clear carry 259 | ADC CRC ; Add CRC 260 | STA CRC ; Store it 261 | JSR GETHEX ; Get Lo byte 262 | STA STL ; Store it 263 | CLC ; Clear carry 264 | ADC CRC ; Add CRC 265 | STA CRC ; Store it 266 | LDA #$2E ; Load "." 267 | JSR ECHO ; Print it to indicate activity. 268 | NODOT JSR GETHEX ; Get Control byte. 269 | CMP #$01 ; Is it a Termination record ? 270 | BEQ INTELDONE ; Yes, we are done. 271 | CLC ; Clear carry 272 | ADC CRC ; Add CRC 273 | STA CRC ; Store it 274 | INTELSTORE JSR GETHEX ; Get Data Byte 275 | STA (STL,X) ; Store it 276 | CLC ; Clear carry 277 | ADC CRC ; Add CRC 278 | STA CRC ; Store it 279 | INC STL ; Next Address 280 | BNE TESTCOUNT ; Test to see if Hi byte needs INC 281 | INC STH ; If so, INC it. 282 | TESTCOUNT DEC COUNTER ; Count down. 283 | BNE INTELSTORE ; Next byte 284 | JSR GETHEX ; Get Checksum 285 | LDY #$00 ; Zero Y 286 | CLC ; Clear carry 287 | ADC CRC ; Add CRC 288 | BEQ INTELLINE ; Checksum OK. 289 | LDA #$01 ; Flag CRC error. 290 | STA CRCCHECK ; Store it 291 | JMP INTELLINE ; Process next line. 292 | 293 | INTELDONE LDA CRCCHECK ; Test if everything is OK. 294 | BEQ OKMESS ; Show OK message. 295 | LDA #$0D 296 | JSR ECHO ; New line. 297 | LDA #MSG4 300 | STA MSGH 301 | JSR SHWMSG ; Show Error. 302 | LDA #$0D 303 | JSR ECHO ; New line. 304 | RTS 305 | 306 | OKMESS LDA #$0D 307 | JSR ECHO ; New line. 308 | LDA #MSG3 311 | STA MSGH 312 | JSR SHWMSG ; Show Done. 313 | LDA #$0D 314 | JSR ECHO ; New line. 315 | RTS 316 | 317 | GETHEX LDA IN,Y ; Get first char. 318 | EOR #$30 319 | CMP #$0A 320 | BCC DONEFIRST 321 | ADC #$08 322 | DONEFIRST ASL 323 | ASL 324 | ASL 325 | ASL 326 | STA L 327 | INY 328 | LDA IN,Y ; Get next char. 329 | EOR #$30 330 | CMP #$0A 331 | BCC DONESECOND 332 | ADC #$08 333 | DONESECOND AND #$0F 334 | ORA L 335 | INY 336 | RTS 337 | 338 | GETCHAR LDA ACIA_SR ; See if we got an incoming char 339 | AND #$08 ; Test bit 3 340 | BEQ GETCHAR ; Wait for character 341 | LDA ACIA_DAT ; Load char 342 | RTS 343 | 344 | 345 | MSG1 .byte "Be-EWOZ 0.3",0 346 | MSG2 .byte "Start Intel Hex code Transfer.",0 347 | MSG3 .byte "Intel Hex Imported OK.",0 348 | MSG4 .byte "Intel Hex Imported with checksum error.",0 349 | MSG5 .byte "Enter 8000 R to return to Basic",0 350 | MSG6 .byte "Hello World! Fifty1Ford did this!",0 351 | BRK 352 | 353 | -------------------------------------------------------------------------------- /bFastfinch.bin: -------------------------------------------------------------------------------- 1 | %%$%%%%%%%%%$%%$$%%%%%$$$%$$$%%$%%%%%%%%%%$%%%%%%%%%%$$%%%%%%%%%%%%%%$%%$%%)$%$%%%%%%$%%%%%$%%*848$%%%%%%$$$$)/4444$%%%%%%%%%$()<-  4444%%%%%%)<,((( ! 444%%%%$%,<(((( $ 49&%%%$%<<(((  0 5?*%%%$8((()  *?>%%%),((   %???%%%))))  % %%:??*%))))%   %*$$ 49% *)))  :*$%))))))  .))))  $%))() 0$$ *)())%-)))))!')))))"'')))))''))'')-)*'&)).*&&)))))*>?+)&--))*.>>>:*)%&)-)*>:)*+)(%*.*:.:>:>9>*%4%*.)).>>>===9>=8(&.*))*):>:99)99=>>88.)%))>=>>>9(99=8<8*)())==:999988=888<$)))9=9=9=)8(8888<<4*)=>9==<8<8<888<88(/*(9===9<<<888<8888<8%*%)-99=<888<8<888888()*(9====<8<<<8<8888888$(*)$(<<<888<8<88888888888($%(%(,<888<<8<888888888888((()))<888<<8<88888888888888$$ 2 |  3 | )(8(<88888<888888888(88%    ))<<8888888888888(8848)     )*<888(8(888(8888(4($8    >>98(888888(88(8$884((  >.:*-8<8(8((88(88(8(($ 4 | **:*-9)(8(8(8((8((8$$$$*%)*)*9)8(8(($(4($8$($(%)%))))))((($($($($(($%)%))%%$$$$$$$($$%$$($$%%$) %%%$%)$5*) ):59$$$!)%%%:%&***********+*+**+***$$%)5:&%**)******;*:**:;;??????????????????????&)*&*&%%***%):*:/:>??????????????????????????????:+>?????????????*****+*??+????::+?:*+****&*&****%*:::*****::>???????????????????:??????>;?:????:>*??:??????????????:???:*:+?/:*+***%%**))****::*>******?????:>???????????:?*:?:????????????;?+***>*:*::?;*?*?;*:*>>;?**+******&**%*%*%&):***/:**:>:>;>?*;:??:?>?::>?:::::??>???::::?:??>???????;??*:***?*?:/??&*:?+?*?;>?***&))%*%****:*:*::?*:;*:*:?.:*?>;:>?;:>*>*?>:::*:>+>+:*:**:*:*:>::?::*? -------------------------------------------------------------------------------- /bFlower.bin: -------------------------------------------------------------------------------- 1 | *++++++++*******++++++++++****''+++++**++++++++++++++++++*''++++**+++++++++++'&&''++++&+++++***+++++++++&'++++++***+*++++++'&&++++++******+*++++''''+++++******+**++++'&'++++***********++++''"'++++*************++''"+++++**************+'&&+++++*+&&'+++++****************'&&&+'''++++++&''+++*****************'&&&''''++++++++++++'&&''&****************+&&&''+''''++++++++++++++++++++&"'&&*****************+&''''+++++++++++++++++++**+++++++++++''&&""&&&******************&+++++++++++++++*+********+++++++++++++++++++++'&&&******************&&&&'++++++++++++******++*******++++++++++++++++++++++++''"&&****************&&&&'+**++++++++++++++++++++++++*+++++*******++++++++++++++++++'&&******************&&******+**++++++++++++++++++++++++++++++++***********+++++++++*''&&&************************+*++++''''&'&+++++++++*+++++++++++++++*******+*++**+**+**+&&&&*************&********+*++'''"&"&++++++**++++++++++++++++++**************+*&*&&&&***********)**&********+++'''&++++*++++++++++++++++++++++***************&&&******)************++''&&+++*+++++&'&'&'''''++++++++*************************************&&+++++++'&""""'''''++++*********************************&*))***&&++++++&&''***************************)**)**&*))&++++++&&***********************)**)*&%))*&*++&'&&*************)***%&++&&&&&*****************&*&&'&'&++&&&****************+++++'&&*************++++++++'&***&*********+++++++++''&+++*******&&&+*+++++****++++++++''"&'++++++****+*******&''+++++++***++++++++''"''+++++++*++++''&&''+++++++***++++++++'&&'+++++*++++++''"''+++++++***+++++++'''&+++++++++++++''''''+++++******+++++'''+++++++++++++'''""''++++++***+++++'''''++++++++++++++''"&''+++++**+++++++'&"'++++++++++++++++'&&'''++++**++++++'"'++++++++++++++++'&&&'+++++++**&*&'++++++++++++++++'"'&+++*****'&&'++++**++++++++++'&&*++++**&*****+++++++++++++&&'+++****+++++++*+)*%%%**%%* -------------------------------------------------------------------------------- /bNewBird.bin: -------------------------------------------------------------------------------- 1 | %>>>==>>))9>>>9==>>==>>>>>>>>>>:%))>>>>>>>>>>%%%%9====9====>=========>>>>>>>>>>>>>>>>>>>=>>>>>>>%55999==9999==============>>>>>>>>>==>>>>>>>==>>>>>>>>>>=444454884899999=998=======>>>>>===>>>>>====>>>>>=========>%5500000444499999999899999==========>>>=========>>======999999)%00000000444999984455948899=89=====<<======99======99=======>>>>>)000000004444884999995489999899====<<=======9======99===>>>>>>>>>?*0000 00000055549::;??:::99988889==========8888889=99==9>>>>>>>>>>>) 00 0 %::::::??????:::99999=====9===9888=9888999===>>>>>>>==>>>>9))):% 0 %:;;??*);???????::9999==99====88899884444444499>>>=89====>)-)))*??? !?????**%????????::9999999==98899988488889999999=99889====>)))????:% :;??????;??::???>:9===999==99988889===99=>====98889999====???????: %;;;?????;???????>:99==99999999899999=======944499999999999%:)???????*::;?????????????>=9999999999888999999===944444999899499===???:???????**???????????????999999999===9988999999844444999989999999>>??>:>:*)*).???????**???????????????999999999====99999994444444444499999999:>>>>>?>9:).>>?????&%??????????????:99999999===999999444488444444899999999>>>>?>?>>=>9999>>:;??:*?????????????>>:99999999994999945999994444899945559:?????9:>=99499>>>9)?::>:&?????????????>>>99999999544499999999994449994445599:?????999500999>>>>9$:::>:%$?????????????>>>999999944444449999999944459944555555:????959400995>>>?9):::*% 0 *????????::?>>>99995554444444444449994445994455595405>????:954054499>::%)::* *????????:999999444445444445449994004454045%%95505:>>???:5405555999::>9*%%*;::::9999999544445554444449540000044459)*::55999>>???9 05005999>)9>5%%&*:55555599544445544000044400 455:59:::9999999???::945555599995:9%995555!  5555445955444440400000044 %%99999999955999>>>9994415:99::$9949):999544  55455545554000000500000044 459999455999545559999555005655599$954$:>>999595000555 4550454444440000004000004400 044544994444454044459994440005599999:$59>>>>99994555554550 055455554550 0440 004004400004455045444444004444459550 555455599449%>99599>5555045554455    54450 000 0 054040000444454000000000044444455950 04545955944=)>>:::>:944455  55 55  00 0 0 0 0400 0000440 000000000044455555555045540459%%:$ 59%:5540055 %55  0 4 00000000444444455545500 544459:%5::0055005$ 595     000444404444444445540050%%54449595:>:04550 $ $555   0044444444444444444440054$554 499):::9 59555$ 050$     000004444440444444444444440 %9:&:: 59555555555       0004000000444440444444404444404 %*54 555545495400 0    000000004400044400044444400004444 $+5$5555555545540 054    00000000000000000004444440 04440 +5$59995455044044 444     00000000000044000044444440 000  %559550 00 445   0000000000444000044444000000  )*55$$ 00044$$   000 000000000440000444440000000 ++$ 00450 $   000 0 000000000000000044440 54400 0 +% 4554 $$$   0 00 00000 0000000000000000000 55540 04 +%554 5594$$$$4    000 00000000000 0000000000000000000 4444400 +%%550 0454 $$$$$$  000 0000000000000000000000000000000000000 004455000 $$4540500 04$  000 0000000000000000000000000000000000000 004444000 %444 551 04$    04 00000000000000000000 0000000000000000 0044444400 544 45550 44$  0000 00000000000000000000000000000000000000 0045444040554$ 50004445$$ 00000 00000000000000000000000000 000000000000 004000044%%955%% 440454444 $$ 000000400000000000000000000000000000000000 0000 0 0004445&5959$ 040005544$ $$ 0000000000000000000000000000000 00 000 0000000 00000455 4555$54500 $55$$$$ 000000000000000000000000000000000 00 000000 0000 0000044559555 59544 %%%)$$$$ 0000000000000000000000000000000 0000 000   400444)44 $49554$%%%))$$$ 0000000000000000000000000000000 0000  0  444$)0 5% 554999%%%)))$$$ 00000000000000400 0000000000 000  0 $$$%%544554999$%%%)9$$$ 000000000000000000 0000000000 000000  00 5:44455445$%$%%%))$$$$ 000000000000000000 0000000 00000  000 %%54544444$%%%%%%))$$ 00000000000000 000000000 000  0 :555540445$%%%%%%9( 00000000 0000 000000000 00000000000 9$5544404$$%%%%%%)) 0 00000000 00000000000000000000 44054544$$%%%%%%))$ 0000000000  00000000000000000000 40454 $$$$%%%%%%%)$ 000000000  000000000000000000  $54 $))%%))%) 0 00000 %****& 0 %%$444$))))))%) 0 00 ***++**: -------------------------------------------------------------------------------- /basic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/basic.bin -------------------------------------------------------------------------------- /basic.cfg: -------------------------------------------------------------------------------- 1 | # Configuration for BASIC ROM 2 | MEMORY { 3 | ZP: start = $00, size = $0100, type = rw, file = ""; 4 | #RAM: start = $0100, size = $7e00, type = rw, file = ""; 5 | RAM: start = $0100, size = $1F40, type = rw, file = ""; 6 | #PRG: start = $8000, size = $8000, type = ro, file = %O, fill = yes, fillval = $00; 7 | PRG: start=$8000, size=$8000, type=ro, define=yes, fill=yes, fillval=$00, file=%O; 8 | # IMG: start = $B000, size = $3000, type = ro, file = %O, fill = yes, fillval = $00; 9 | # VCT: start = $FFFA, size = $06, type = ro, file = %O, fill = yes, fillval = $00; 10 | } 11 | 12 | SEGMENTS { 13 | ZEROPAGE: load = ZP, type = zp; 14 | BSS: load = RAM, type = bss; 15 | CODE: load = PRG, type = ro, start = $8000; 16 | #sImage: load = PRG, type = ro, start = $A980; 17 | #VGAImageClear: load = PRG, type = ro, start = $E000; 18 | #VGAImageProgram:load = PRG, type = ro, start = $E100; 19 | #VGAColorMove: load = PRG, type = ro, start = $E980; 20 | # SLoad: load = PRG, type = ro, start = $A000; 21 | #OImage: load = PRG, type = ro, start = $ADD0; 22 | #SImage: load = PRG, type = ro, start = $AD00; 23 | Image: load = PRG, type = ro, start = $AF00; 24 | BkLoad: load = PRG, type = ro, start = $FA00; 25 | WozCall: load = PRG, type = ro, start = $FC00; 26 | VECTORS: load = PRG, type = ro, start = $FFFA; 27 | 28 | 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /basicTransparentSprites.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/basicTransparentSprites.bin -------------------------------------------------------------------------------- /basicWorkingBallSprite.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/basicWorkingBallSprite.bin -------------------------------------------------------------------------------- /bchess.bin: -------------------------------------------------------------------------------- 1 | ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? -------------------------------------------------------------------------------- /bk.asm: -------------------------------------------------------------------------------- 1 | ;.segment "BkLoad" 2 | ;.org $1000 3 | 4 | vidpage = $ED ; unused 5 | image = $FB 6 | 7 | PHP 8 | LDX #32 ;32 'lines' as each line is 255 IE 2 lines each 9 | ;set our source memory address to copy from 10 | ;change to $AD00 ;$ADD0 11 | ;lda #$D0 12 | lda #$00 13 | sta image + 1 ;$FB 14 | lda #$AD 15 | sta image ; $FC 16 | 17 | lda #$00 ;set our destination memory to copy to, $2000, WRAM 18 | sta vidpage +1 ;$FD 19 | lda #$20 20 | sta vidpage ;$FE 21 | ldy #$00 ;reset x and y for our loop 22 | ;ldx #$00 23 | LoopI: ;Image loop 24 | lda ($FB),Y ;indirect index source memory address, starting at $00 25 | sta ($FD),Y ;indirect index dest memory address, starting at $00 26 | INY 27 | bne LoopI ;loop until our dest goes over 255 28 | inc $FC ;increment high order source memory address, starting at $80 29 | inc $FE ;increment high order dest memory address, starting at $60 30 | lda $FE ;load high order mem address into a 31 | ;copy 68 lines 32 | DEX 33 | bne LoopI ;if we're not there yet, loop 34 | NOP 35 | PLP 36 | RTS 37 | 38 | -------------------------------------------------------------------------------- /bk.bin: -------------------------------------------------------------------------------- 1 | @@@@@@@@@@@@@@@@@@@@??????????????????@00@@@!!!@@@@@@!!!@@?????@@@@????????????????@050@@@@@@@@!77!****@!!****!!****!77!**@@??*?*????@@@???????????????@0550@@@0@@@@!777!@@@@@@!7!**!7!!777!****@???*?*?555??@@???????????????@05550@@00@@@!7777!@@!@@!77!*??*!77!!!7777!*!**!*@?????????????@@?????????????@00000000@@!!!!!!@@!!@@@!777!*??*!777!!!!!!!!!*!!**!!*@@**************@??????????????@**********@@@***********@@!777!*??*!777!***************@*********@????????????@*******@@**?????***@!!!!!*??*!!!!!**?????***??**@***********@???????????@*******@@**?????***@**??****?????*!!!!!*??*!!!!!@***********@??????????@**********@@@***********@@***************!777!*??*!777!@*********@???????????@00000000@@!!!!!!@@!!@@*!!**!!*!!!!!!!!!777!*??*!777!@@*************@???????????@05550@@00@@@!7777!@@!@@*!**!*!!7777!!77!*??*!77!@@@??????????@0550@@@0@@@@!777!@@@@@@****!777!!7!**!7!@**000@@???????????@050@@@@@@@@!77!****@******!77!!!****!!@@**@@@???????????????@00@@@!!!@@@@@@@@@@@@????????????????@@@@@@@@@@@@!!!!!@@@@@@@@@@@@@@@@@????????????????@@@@@@@@@@!7777"%*@@????????@@?????????????4?@@@@@ 2 | *"777&%***@@**??**????@@????????????4??@@@*****%"7&%******%!!*@@****????????@@??????4?????4??@@@@*??***!%*?**%****&!%"!@********?????@ ????44 ?@@@**??**%*???*%"!***"77!@**@@@@@@????@ 3 | **????44444444444@**@ **?**!!*???*%&7!%***%!777!@*@@*???@*????4444444?@***@ ****!&**?*%&77!!%**?*%&77!@**@@*?*?@*???????4??4???@**@ ****%***%!777!!!*???*%&7!@**@@*?*?@*??????4??4???@***@ *******&77!*%*???*%"!@*@@*???@*????????44?44??@****@ ********%!%""*!%*?**%@@@@@@@@**??@*???????????@**@ *******%!!*%*%&7&%****@********?@*??????????????????@@@ 4 | *****%"777&%**@@****@@**??????????????????@@@@@***"7777"%@@****@@ ????????????????????@@@*!!!!!@@@@*???????????????????@@@@@@@@@@@@@@@??????????????????@@@@@@@@@????????????????????*!!!!!??????????????????????((*%"7777"???????????????????????????? <*******%*!!%****%&777"%**?*????????????????????????????******<<*******""%!%********%&7&%***?*????????????????????????????  (!77&***%**?*%!*******????????????????????????????******!777!%***%!"%*???*%******((((*****????????????????????????????*******!77&%*?**&!!7&%*???*!!***??*((<(*??***????????????????????????????***********!7&%*???*!!!77&%*?**%!*****((((*****????????????????????????????***********!"%*???*%*!777!%***%**((((**????????????????????????????*******%**?*%!*!77"*****????????????????????????????**********%&7"%*!"%!&******?*????????????????????????????  ((**%&777"*!!%****?*????????????????????????????*********<<*******%"7777!******????????????????????????????***<<*******!!!!!*****????????????????????????????((????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*?????????&????????????????????? ????? +????(( ????(<<<<( *???(<<>>>><<((<<( ???(<>>>>>>>><((<<>><<((( )??<>>>>>>>>>><(<>>>>>><((<<<<( ??(<>>>>>>>>>><(<>>>>>>>><(<>>>><((<<( ??<>>>>>>>>>>>><(<>>>>>>>><(<>>>>>><(<>><((( .?(<>>>>>>>>>>>><(<>>>>>>>>>><(<>>>>>><(<>>>><(<<( *?(<>>>>>>>>>>>><(<>>>>>>>>>><(<>>>>>><(<>>>><(<<( ?<>>>>>>>>>>>><(<>>>>>>>><(<>>>>>><(<>><((( ?(<>>>>>>>>>><(<>>>>>>>><(<>>>><((<<( ?<>>>>>>>>>><(<>>>>>><((<<<<( ?(<>>>>>>>><((<<>><<((( ?(<<>>>><<((<<( ?(<<<<( +?(( *????? -------------------------------------------------------------------------------- /bkmove.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/bkmove.bin -------------------------------------------------------------------------------- /min_mon.asm: -------------------------------------------------------------------------------- 1 | ACIA = $5000 ;Modified to match Ben Eater mapping was $4000 2 | ACIA_RX = ACIA ;$5000 3 | ACIA_TX = ACIA ;$5000 4 | ACIA_STATUS = ACIA+1;$5001 5 | ACIA_COMMAND = ACIA+2;$5002 6 | ACIA_CONTROL = ACIA+3;$5003 7 | ;Added Ben Eater Mapping. 8 | VIA = $6000 9 | VIA_PORTB = VIA 10 | VIA_PORTA = VIA+1;$6001 11 | VIA_DDRB = VIA+2;$6002 12 | VIA_DDRA = VIA+3;$6003 13 | VIA_T1CL = VIA+4;$6004 14 | VIA_T1CH = VIA+5;$6005 15 | VIA_T1LL = VIA+6;$6006 16 | VIA_T1LH = VIA+7;$6007 17 | VIA_T2CL = VIA+8;$6008 18 | VIA_T2CH = VIA+9;$6009 19 | VIA_SHIFT = VIA+10;$600A 20 | VIA_AUX = VIA+11;$600B ;Set to 0 to stop BEEP ALSO ACR 21 | VIA_PCR = VIA+12;$600C 22 | VIA_IFR = VIA+13;$600F 23 | VIA_IER = VIA+14;$600E 24 | VIA_IORA = VIA+15;$600F 25 | 26 | VGA_SCREENH = $20 ;VGA Screen area starts at $2000 27 | VGA_SCREENL = $00 28 | 29 | 30 | ;.org $8000 31 | ; minimal monitor for EhBASIC and 6502 simulator V1.05 32 | ; tabs converted to space, tabwidth=6 33 | 34 | 35 | ; Polled 65c51 I/O routines adapted to EhBASIC. Delay routine from 36 | ; http://forum.6502.org/viewtopic.php?f=4&t=2543&start=30#p29795 37 | 38 | .include "basic.asm" 39 | 40 | ; put the IRQ and MNI code in RAM so that it can be changed 41 | ; Fifty1Ford.... Umm, I broke this I think... 42 | IRQ_vec = VEC_SV+2 ; IRQ code vector 43 | ;NMI_vec = IRQ_vec+$0A ; NMI code vector 44 | 45 | ; now the code. all this does is set up the vectors and interrupt code 46 | ; and wait for the user to select [C]old or [W]arm start. nothing else 47 | ; fits in less than 128 bytes 48 | 49 | .segment "CODE" ; pretend this is in a 1/8K ROM 50 | 51 | ; reset vector points here 52 | 53 | RES_vec 54 | CLD ; clear decimal mode 55 | LDX #$FF ; empty stack 56 | TXS ; set the stack 57 | JSR ACIAsetup 58 | 59 | ; set up vectors and interrupt code, copy them to page 2 60 | 61 | LDY #END_CODE-LAB_vec ; set index/count 62 | LAB_stlp 63 | LDA LAB_vec-1,Y ; get byte from interrupt code 64 | STA VEC_IN-1,Y ; save to RAM 65 | DEY ; decrement index/count 66 | BNE LAB_stlp ; loop if more to do 67 | 68 | ; now do the signon message, Y = $00 here 69 | 70 | LAB_signon 71 | LDA LAB_mess,Y ; get byte from sign on message 72 | BEQ LAB_nokey ; exit loop if done 73 | 74 | JSR V_OUTP ; output character 75 | INY ; increment index 76 | BNE LAB_signon ; loop, branch always 77 | 78 | LAB_nokey 79 | JSR V_INPT ; call scan input device 80 | BCC LAB_nokey ; loop if no key 81 | 82 | AND #$DF ; mask xx0x xxxx, ensure upper case 83 | CMP #'W' ; compare with [W]arm start 84 | BEQ LAB_dowarm ; branch if [W]arm start 85 | 86 | CMP #'C' ; compare with [C]old start 87 | BNE RES_vec ; loop if not [C]old start 88 | 89 | JMP LAB_COLD ; do EhBASIC cold start 90 | 91 | LAB_dowarm 92 | JMP LAB_WARM ; do EhBASIC warm start 93 | 94 | 95 | 96 | 97 | 98 | ACIAsetup 99 | LDA #$00 ; write anything to status register for program reset 100 | STA ACIA_STATUS 101 | LDA #$0B ; %0000 1011 = Receiver odd parity check 102 | ; Parity mode disabled 103 | ; Receiver normal mode 104 | ; RTSB Low, trans int disabled 105 | ; IRQB disabled 106 | ; Data terminal ready (DTRB low) 107 | STA ACIA_COMMAND ; set command register 108 | LDA #$1F ; %0001 1111 = 19200 Baud 109 | ; External receiver 110 | ; 8 bit words 111 | ; 1 stop bit 112 | STA ACIA_CONTROL ; set control register 113 | RTS 114 | 115 | ACIAout 116 | PHA ; save A 117 | LDA ACIA_STATUS ; Read (and ignore) ACIA status register 118 | PLA ; restore A 119 | STA ACIA_TX ; write byte 120 | JSR ACIAdelay ; delay because of bug 121 | RTS 122 | 123 | ACIAdelay 124 | PHY ; Save Y Reg 125 | PHX ; Save X Reg 126 | DELAY_LOOP 127 | LDY #6 ; Get delay value (clock rate in MHz 2 clock cycles) 128 | MINIDLY 129 | LDX #$68 ; Seed X reg 130 | DELAY_1 131 | DEX ; Decrement low index 132 | BNE DELAY_1 ; Loop back until done 133 | DEY ; Decrease by one 134 | BNE MINIDLY ; Loop until done 135 | PLX ; Restore X Reg 136 | PLY ; Restore Y Reg 137 | DELAY_DONE 138 | RTS ; Delay done, return 139 | 140 | ACIAin 141 | ;Fifty1Ford Hrmmm.. Can we get keys from the keyboard? 142 | LDA ACIA_STATUS ; get ACIA status 143 | AND #$08 ; mask rx buffer status flag 144 | BEQ LAB_nobyw ; branch if no byte waiting 145 | LDA ACIA_RX ; get byte from ACIA data port 146 | SEC ; flag byte received 147 | RTS 148 | LAB_nobyw 149 | CLC ; flag no byte received 150 | no_load ; empty load vector for EhBASIC 151 | no_save ; empty save vector for EhBASIC 152 | RTS 153 | 154 | ; vector tables 155 | 156 | LAB_vec 157 | .word ACIAin ; byte in from simulated ACIA 158 | .word ACIAout ; byte out to simulated ACIA 159 | .word no_load ; null load vector for EhBASIC 160 | .word no_save ; null save vector for EhBASIC 161 | 162 | ; EhBASIC IRQ support 163 | 164 | IRQ_CODE 165 | PHA ; save A 166 | LDA IrqBase ; get the IRQ flag byte 167 | LSR ; shift the set b7 to b6, and on down ... 168 | ORA IrqBase ; OR the original back in 169 | STA IrqBase ; save the new IRQ flag byte 170 | PLA ; restore A 171 | RTI 172 | 173 | ; EhBASIC NMI support 174 | 175 | NMI_CODE 176 | PHA ; save A 177 | ; ;FIFTY 178 | ; PHP ;SAVE PROCESS FLAGS 179 | ; LDA #1 180 | ; ADC $E2 181 | ; STA $E2 182 | ; STA $2626 183 | 184 | LDA NmiBase ; get the NMI flag byte 185 | LSR ; shift the set b7 to b6, and on down ... 186 | ORA NmiBase ; OR the original back in 187 | STA NmiBase ; save the new NMI flag byte 188 | 189 | ; PLP ;FIFTY RESTORE PROCESS FLAGS 190 | 191 | PLA ; restore A 192 | RTI 193 | 194 | END_CODE 195 | 196 | NMI_vec 197 | ; NMI:; 198 | 199 | PHP ;Push that CPU flag 200 | DEC $E2 ;Lets dec 201 | PLP ;Pull that flag! 202 | RTI 203 | 204 | ;Attempt at vga 'clock' and test 205 | ;TRY THIS ONE OUT -YEP ALL YOU NEED FOR CLOCK 206 | ;INC $E2 ;VGAClock 207 | ; DEC $E2 ;Lets dec instead, that way we can reset to 208 | ;wanted count and look at the count down for 0. 209 | ;May use for beep/music timer 210 | ;OK, this can mess with the carry flag. 211 | ;causes random screw ups. 212 | ;Be sure to push and pull the processor status flags! 213 | 214 | ;LDA $E2 ;SHOW BLINKIN' PIXEL 215 | ;STA $2626 ;FOR TEST 216 | 217 | 218 | ; ;draw routine here. 219 | ; ;one routine per NMI, then return. 220 | ; ;If we add more than one NMI draw we will need to 221 | ; ;figure out a good way to give up some time 222 | ; ;to basic.. or maybe just do sprites and give 223 | ; ;basic any scraps.....? 224 | 225 | 226 | ;LDA SpriteMove 227 | ;BEQ NoMove 228 | ;JSR DrawSprite 229 | ;NoMove: 230 | 231 | ; ;check for a clear from CLS 232 | 233 | 234 | ; ;Check for sprite from GFX 235 | 236 | ; ;Check for pixel from MOVE 237 | 238 | 239 | ; PLY 240 | ; PLX 241 | ;PLP ;Pull that flag! 242 | ; PLA 243 | ;RTI 244 | 245 | 246 | 247 | 248 | LAB_mess 249 | .byte $0D,$0A,"6502BeEhBASIC 3.1 [C]old/[W]arm?",$00 250 | ; sign on string 251 | ; .org $FE06 252 | ; .include "bk.asm" 253 | 254 | .org $ADD0 255 | .include "bk.asm" 256 | 257 | ; .org $ADD0 258 | .segment "Image" 259 | .incbin "C:\Projects\6502\BeEhBasic\bk.bin" 260 | ; .org $FE06 261 | .segment "BkLoad" 262 | .incbin "bkmove.bin" 263 | ; 264 | 265 | .org $FC00 266 | .include "WozCall.asm" 267 | 268 | .org $fffa 269 | .segment "VECTORS" 270 | 271 | .word NMI_vec ; NMI vector 272 | ;.word NMI ; NMI vector 273 | .word RES_vec ; RESET vector 274 | .word IRQ_vec ; IRQ vector 275 | 276 | .end RES_vec ; set start at reset vector 277 | 278 | 279 | 280 | -------------------------------------------------------------------------------- /min_mon.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormalLuser/BeEhBasic/f10e8232148fe6e25d39a85324be4b3020c5b8fe/min_mon.o --------------------------------------------------------------------------------