├── DOCUMENTS ├── 74LVC245APW.pdf ├── Neo6502-1.jpg ├── Neo6502-a.jpg ├── Neo6502-b.jpg ├── Neo6502-c.jpg ├── Neo6502-user-manual.odt ├── Neo6502-user-manual.pdf └── w65c02s-NEW.pdf ├── HARDWARE ├── 3D printed Case │ ├── Neo6502_Rev_B v10-bottom.3mf │ ├── Neo6502_Rev_B v10-bottom.stl │ └── Neo6502_Rev_B v10-top-MMU.3mf ├── Neo6502-rev-B │ ├── 3d │ │ ├── Audio_Jack-3.5mm---CUI_SJ1-3515-SMT-TR.step │ │ ├── C_0402_1005Metric.wrl │ │ ├── C_0603_1608Metric.wrl │ │ ├── GBH254SMT-10(B-V-10-LF)(IDC-Header_2x05_P2.54mm_Vertical_SMD).step │ │ ├── GBH254SMT-40(B-V-40-LF)(IDC-Header_2x20_P2.54mm_Vertical_SMD).step │ │ ├── HDMI_19POS_SMD_Wurth_Electronic-685119134923.stp │ │ ├── L-CD32_shielded.step │ │ ├── LED_0603_R.wrl │ │ ├── QFN56_0_4.step │ │ ├── QSG5032.step │ │ ├── R_0402_1005Metric.wrl │ │ ├── R_1206_3216Metric.wrl │ │ ├── R_Array_Convex_4x0603.wrl │ │ ├── SMD075F.step │ │ ├── SO-8_208mil---SOIC8_Wide_5mmx5mm.step │ │ ├── SOD123.step │ │ ├── SOT-23-5.step │ │ ├── SOT-23.step │ │ ├── Speaker_QMB-09B-03(KSTG931APL-H2).STEP │ │ ├── TQFP-44-10x10x1mm_Step-0.80mm.STEP │ │ ├── TSSOP-20_4.4x6.5mm_P0.65mm.wrl │ │ ├── USB-A-SMT-6.3H_HOST_Female(87583-2010RLF).STEP │ │ ├── USB-A-SMT-6.3H_HOST_Female(USB1046-GF-0190-L-B-A).STEP │ │ ├── USB4105-GF-A.stp │ │ ├── YTS-A016-X(SKRPABE010).stp │ │ └── dshp04ts-s.stp │ ├── Gerbers │ │ ├── Neo6502_Rev_B-B_Cu.gbr │ │ ├── Neo6502_Rev_B-B_Mask.gbr │ │ ├── Neo6502_Rev_B-B_Paste.gbr │ │ ├── Neo6502_Rev_B-B_SilkS.gbr │ │ ├── Neo6502_Rev_B-Edge_Cuts.gbr │ │ ├── Neo6502_Rev_B-F_Cu.gbr │ │ ├── Neo6502_Rev_B-F_Mask.gbr │ │ ├── Neo6502_Rev_B-F_Paste.gbr │ │ ├── Neo6502_Rev_B-F_SilkS.gbr │ │ ├── Neo6502_Rev_B-NPTH.drl │ │ └── Neo6502_Rev_B-PTH.drl │ ├── Neo6502_Rev_B-BOM.ods │ ├── Neo6502_Rev_B-BOM.pdf │ ├── Neo6502_Rev_B-cache.lib │ ├── Neo6502_Rev_B.kicad_pcb │ ├── Neo6502_Rev_B.kicad_prl │ ├── Neo6502_Rev_B.kicad_pro │ ├── Neo6502_Rev_B.lib │ ├── Neo6502_Rev_B.net │ ├── Neo6502_Rev_B.pdf │ ├── Neo6502_Rev_B.pro │ ├── Neo6502_Rev_B.sch │ ├── fp-info-cache │ └── sym-lib-table ├── Neo6502-rev-B1 │ ├── 3d │ │ ├── Audio_Jack-3.5mm---CUI_SJ1-3515-SMT-TR.step │ │ ├── C_0402_1005Metric.wrl │ │ ├── C_0603_1608Metric.wrl │ │ ├── GBH254SMT-10(B-V-10-LF)(IDC-Header_2x05_P2.54mm_Vertical_SMD).step │ │ ├── GBH254SMT-40(B-V-40-LF)(IDC-Header_2x20_P2.54mm_Vertical_SMD).step │ │ ├── HDMI_19POS_SMD_Wurth_Electronic-685119134923.stp │ │ ├── L-CD32_shielded.step │ │ ├── LED_0603_R.wrl │ │ ├── QFN56_0_4.step │ │ ├── QSG5032.step │ │ ├── R_0402_1005Metric.wrl │ │ ├── R_1206_3216Metric.wrl │ │ ├── R_Array_Convex_4x0603.wrl │ │ ├── SMD075F.step │ │ ├── SO-8_208mil---SOIC8_Wide_5mmx5mm.step │ │ ├── SOD123.step │ │ ├── SOT-23-5.step │ │ ├── SOT-23.step │ │ ├── Speaker_QMB-09B-03(KSTG931APL-H2).STEP │ │ ├── TQFP-44-10x10x1mm_Step-0.80mm.STEP │ │ ├── TSSOP-20_4.4x6.5mm_P0.65mm.wrl │ │ ├── USB-A-SMT-6.3H_HOST_Female(87583-2010RLF).STEP │ │ ├── USB-A-SMT-6.3H_HOST_Female(USB1046-GF-0190-L-B-A).STEP │ │ ├── USB4105-GF-A.stp │ │ ├── YTS-A016-X(SKRPABE010).stp │ │ └── dshp04ts-s.stp │ ├── Gerbers │ │ ├── Neo6502_Rev_B-B_Cu.gbr │ │ ├── Neo6502_Rev_B-B_Mask.gbr │ │ ├── Neo6502_Rev_B-B_Paste.gbr │ │ ├── Neo6502_Rev_B-B_SilkS.gbr │ │ ├── Neo6502_Rev_B-Edge_Cuts.gbr │ │ ├── Neo6502_Rev_B-F_Cu.gbr │ │ ├── Neo6502_Rev_B-F_Mask.gbr │ │ ├── Neo6502_Rev_B-F_Paste.gbr │ │ ├── Neo6502_Rev_B-F_SilkS.gbr │ │ ├── Neo6502_Rev_B-NPTH.drl │ │ └── Neo6502_Rev_B-PTH.drl │ ├── Neo6502_Rev_B1-BOM.ods │ ├── Neo6502_Rev_B1-BOM.pdf │ ├── Neo6502_Rev_B1-cache.lib │ ├── Neo6502_Rev_B1-rescue.lib │ ├── Neo6502_Rev_B1.kicad_pcb │ ├── Neo6502_Rev_B1.lib │ ├── Neo6502_Rev_B1.net │ ├── Neo6502_Rev_B1.pdf │ ├── Neo6502_Rev_B1.pro │ ├── Neo6502_Rev_B1.sch │ ├── Neo6502_Rev_B1_BOM.csv │ ├── fp-info-cache │ └── sym-lib-table ├── New6502-Rev-A │ ├── Neo6502_Rev_A-backups │ │ ├── Neo6502_Rev_A-2023-06-26_160604.zip │ │ └── Neo6502_Rev_A-2023-06-27_105856.zip │ ├── Neo6502_Rev_A-cache.lib │ ├── Neo6502_Rev_A-rescue.kicad_sym │ ├── Neo6502_Rev_A.kicad_pcb │ ├── Neo6502_Rev_A.kicad_prl │ ├── Neo6502_Rev_A.kicad_pro │ ├── Neo6502_Rev_A.net │ ├── Neo6502_Rev_A.pdf │ ├── Neo6502_Rev_A.pro │ ├── Neo6502_Rev_A.sch │ ├── fp-info-cache │ └── sym-lib-table └── README.md ├── README.md └── SOFTWARE ├── Apple][ ├── apple2_800x600_400MHz.uf2 ├── apple2_neo6502_karateka.uf2 ├── apple2_neo6502_lode_runner.uf2 ├── apple2_neo6502_moon_patrol.uf2 ├── apple2_neo6502_neptune.uf2 └── oric_960x540_372MHz.uf2 ├── Audio ├── audio.py ├── buz.py └── buzpwm.py ├── Memory Emulator ├── NEO6502 v0.01.uf2 ├── NEO6502 v0.01 │ ├── Pico 6502 V3.ino │ ├── ewoz.cpp │ ├── ewoz.h │ ├── m6821.cpp │ ├── m6821.h │ ├── memory.cpp │ ├── memory.h │ ├── mon_ext.cpp │ ├── mon_ext.h │ ├── mos65C02.cpp │ ├── mos65C02.h │ ├── msbasic.cpp │ ├── msbasic.h │ └── pins.h ├── ewoz_v2 │ ├── Makefile │ ├── ewoz.mon │ ├── ewoz.s │ └── getaddress ├── msbasic │ ├── Makefile │ └── msbasic │ │ ├── CFFA1_API.s │ │ ├── README.txt │ │ ├── TODO.txt │ │ ├── array.s │ │ ├── chrget.s │ │ ├── defines.s │ │ ├── defines_osi.s │ │ ├── error.s │ │ ├── eval.s │ │ ├── extra.s │ │ ├── float.s │ │ ├── flow1.s │ │ ├── flow2.s │ │ ├── getaddress │ │ ├── header.s │ │ ├── init.s │ │ ├── inline.s │ │ ├── input.s │ │ ├── iscntc.s │ │ ├── loadsave.s │ │ ├── macros.s │ │ ├── make.sh │ │ ├── memory.s │ │ ├── message.s │ │ ├── misc1.s │ │ ├── misc2.s │ │ ├── misc3.s │ │ ├── msbasic.s │ │ ├── osi.cfg │ │ ├── osi_extra.s │ │ ├── osi_iscntc.s │ │ ├── poke.s │ │ ├── print.s │ │ ├── program.s │ │ ├── regress.sh │ │ ├── rnd.s │ │ ├── string.s │ │ ├── token.s │ │ ├── trig.s │ │ ├── var.s │ │ └── zeropage.s └── readme.md ├── PicoDVI └── common_dvi_pin_configs.h ├── UEXT └── uext.py ├── ps2pico └── ps2pico.c └── readme.md /DOCUMENTS/74LVC245APW.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/74LVC245APW.pdf -------------------------------------------------------------------------------- /DOCUMENTS/Neo6502-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/Neo6502-1.jpg -------------------------------------------------------------------------------- /DOCUMENTS/Neo6502-a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/Neo6502-a.jpg -------------------------------------------------------------------------------- /DOCUMENTS/Neo6502-b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/Neo6502-b.jpg -------------------------------------------------------------------------------- /DOCUMENTS/Neo6502-c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/Neo6502-c.jpg -------------------------------------------------------------------------------- /DOCUMENTS/Neo6502-user-manual.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/Neo6502-user-manual.odt -------------------------------------------------------------------------------- /DOCUMENTS/Neo6502-user-manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/Neo6502-user-manual.pdf -------------------------------------------------------------------------------- /DOCUMENTS/w65c02s-NEW.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/DOCUMENTS/w65c02s-NEW.pdf -------------------------------------------------------------------------------- /HARDWARE/3D printed Case/Neo6502_Rev_B v10-bottom.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/3D printed Case/Neo6502_Rev_B v10-bottom.3mf -------------------------------------------------------------------------------- /HARDWARE/3D printed Case/Neo6502_Rev_B v10-bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/3D printed Case/Neo6502_Rev_B v10-bottom.stl -------------------------------------------------------------------------------- /HARDWARE/3D printed Case/Neo6502_Rev_B v10-top-MMU.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/3D printed Case/Neo6502_Rev_B v10-top-MMU.3mf -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Gerbers/Neo6502_Rev_B-B_Mask.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2023-08-29T11:39:43+03:00* 3 | G04 #@! TF.ProjectId,Neo6502_Rev_B,4e656f36-3530-4325-9f52-65765f422e6b,B* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Soldermask,Bot* 6 | G04 #@! TF.FilePolarity,Negative* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1) date 2023-08-29 11:39:43* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | %ADD10O,1.301600X2.301600*% 14 | %ADD11C,0.701600*% 15 | %ADD12O,1.401600X2.101600*% 16 | %ADD13O,1.901600X2.901600*% 17 | %ADD14O,1.401600X2.401600*% 18 | %ADD15O,1.401600X2.801600*% 19 | %ADD16C,1.301600*% 20 | %ADD17C,1.801600*% 21 | %ADD18C,1.254000*% 22 | %ADD19C,3.401601*% 23 | %ADD20R,1.879600X1.879600*% 24 | %ADD21C,1.879600*% 25 | %ADD22C,1.101600*% 26 | %ADD23C,1.901600*% 27 | %ADD24R,2.101600X2.101600*% 28 | %ADD25C,2.101600*% 29 | G04 APERTURE END LIST* 30 | D10* 31 | X176320000Y-71030000D03* 32 | D11* 33 | X174890000Y-70530000D03* 34 | D12* 35 | X176320000Y-66850000D03* 36 | X167680000Y-66850000D03* 37 | D10* 38 | X167680000Y-71030000D03* 39 | D11* 40 | X169110000Y-70530000D03* 41 | D13* 42 | X130600000Y-70850000D03* 43 | X143400000Y-70850000D03* 44 | D14* 45 | X119300000Y-66800000D03* 46 | X104700000Y-66800000D03* 47 | D15* 48 | X104700000Y-72850000D03* 49 | X119300000Y-72850000D03* 50 | D16* 51 | X117140000Y-114000000D03* 52 | X162860000Y-114000000D03* 53 | X106000000Y-98810000D03* 54 | X106000000Y-91190000D03* 55 | D17* 56 | X156000000Y-74000000D03* 57 | X156000000Y-68000000D03* 58 | D18* 59 | X101500000Y-66500000D03* 60 | X178500000Y-118500000D03* 61 | D19* 62 | X104000000Y-116000000D03* 63 | X176000000Y-116000000D03* 64 | X176000000Y-79000000D03* 65 | X104000000Y-79000000D03* 66 | D20* 67 | X109000000Y-112460000D03* 68 | D21* 69 | X109000000Y-115000000D03* 70 | X109000000Y-117540000D03* 71 | D22* 72 | X125660000Y-96826000D03* 73 | X123260000Y-96826000D03* 74 | D23* 75 | X124460000Y-95626000D03* 76 | D22* 77 | X125660000Y-94356000D03* 78 | X123260000Y-94426000D03* 79 | D24* 80 | X156000000Y-80500000D03* 81 | D25* 82 | X156000000Y-84500000D03* 83 | D18* 84 | X101500000Y-118500000D03* 85 | M02* 86 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Gerbers/Neo6502_Rev_B-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2023-08-29T11:39:43+03:00* 3 | G04 #@! TF.ProjectId,Neo6502_Rev_B,4e656f36-3530-4325-9f52-65765f422e6b,B* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Paste,Bot* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1) date 2023-08-29 11:39:43* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | G04 APERTURE END LIST* 14 | M02* 15 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Gerbers/Neo6502_Rev_B-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2023-08-29T11:39:43+03:00* 3 | G04 #@! TF.ProjectId,Neo6502_Rev_B,4e656f36-3530-4325-9f52-65765f422e6b,B* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Profile,NP* 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1) date 2023-08-29 11:39:43* 9 | %MOMM*% 10 | %LPD*% 11 | G04 APERTURE LIST* 12 | %ADD10C,0.254000*% 13 | G04 APERTURE END LIST* 14 | D10* 15 | X100000000Y-65000000D02* 16 | X100000000Y-120000000D01* 17 | X180000000Y-65000000D02* 18 | X100000000Y-65000000D01* 19 | X180000000Y-120000000D02* 20 | X100000000Y-120000000D01* 21 | X180000000Y-65000000D02* 22 | X180000000Y-120000000D01* 23 | M02* 24 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Gerbers/Neo6502_Rev_B-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1} date 29.08.2023 (вт) 11:39:45 EEST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2023-08-29T11:39:45+03:00* 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1 6 | ; #@! TF.FileFunction,NonPlated,1,2,NPTH 7 | FMAT,2 8 | INCH 9 | T1C0.0236 10 | T2C0.0472 11 | T3C0.0669 12 | T4C0.1299 13 | % 14 | G90 15 | G05 16 | T1 17 | X6.6579Y-2.7768 18 | X6.8854Y-2.7768 19 | T2 20 | X4.6118Y-4.4882 21 | X6.4118Y-4.4882 22 | X4.1732Y-3.5902 23 | X4.1732Y-3.8902 24 | T3 25 | X6.1417Y-2.6772 26 | X6.1417Y-2.9134 27 | T4 28 | X4.0945Y-4.5669 29 | X6.9291Y-3.1102 30 | X6.9291Y-4.5669 31 | X4.0945Y-3.1102 32 | T0 33 | M30 34 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Gerbers/Neo6502_Rev_B-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1} date 29.08.2023 (вт) 11:39:45 EEST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2023-08-29T11:39:45+03:00* 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1 6 | ; #@! TF.FileFunction,Plated,1,2,PTH 7 | FMAT,2 8 | INCH 9 | T1C0.0157 10 | T2C0.0236 11 | T3C0.0315 12 | T4C0.0394 13 | T5C0.0472 14 | % 15 | G90 16 | G05 17 | T1 18 | X4.225Y-3.22 19 | X4.34Y-3.185 20 | X4.34Y-3.285 21 | X4.34Y-3.3262 22 | X4.34Y-3.3738 23 | X4.355Y-3.59 24 | X4.355Y-4.255 25 | X4.39Y-4.035 26 | X4.39Y-4.09 27 | X4.395Y-3.69 28 | X4.425Y-3.64 29 | X4.425Y-3.98 30 | X4.45Y-3.185 31 | X4.45Y-3.285 32 | X4.45Y-3.3262 33 | X4.45Y-3.3738 34 | X4.45Y-3.84 35 | X4.45Y-3.915 36 | X4.465Y-3.98 37 | X4.495Y-3.705 38 | X4.54Y-3.395 39 | X4.56Y-4.485 40 | X4.58Y-4.095 41 | X4.5827Y-3.3618 42 | X4.5849Y-3.4001 43 | X4.585Y-3.185 44 | X4.59Y-3.535 45 | X4.59Y-3.71 46 | X4.59Y-3.77 47 | X4.59Y-3.8294 48 | X4.59Y-3.96 49 | X4.6Y-4.365 50 | X4.635Y-4.095 51 | X4.635Y-4.19 52 | X4.655Y-3.36 53 | X4.665Y-3.48 54 | X4.68Y-3.98 55 | X4.6992Y-4.215 56 | X4.7Y-4.485 57 | X4.705Y-3.455 58 | X4.705Y-3.955 59 | X4.73Y-3.93 60 | X4.735Y-3.195 61 | X4.7358Y-4.215 62 | X4.755Y-3.905 63 | X4.765Y-4.485 64 | X4.8Y-4.185 65 | X4.8Y-4.365 66 | X4.815Y-3.365 67 | X4.825Y-3.675 68 | X4.825Y-3.765 69 | X4.825Y-3.85 70 | X4.8275Y-4.12 71 | X4.85Y-4.235 72 | X4.86Y-4.485 73 | X4.895Y-3.495 74 | X4.9Y-3.675 75 | X4.9Y-3.85 76 | X4.9Y-4.335 77 | X4.915Y-4.455 78 | X4.935Y-4.215 79 | X4.955Y-3.505 80 | X4.975Y-3.675 81 | X4.975Y-3.765 82 | X4.975Y-3.85 83 | X4.98Y-3.48 84 | X5.005Y-3.455 85 | X5.005Y-4.31 86 | X5.01Y-4.445 87 | X5.04Y-3.905 88 | X5.05Y-3.62 89 | X5.075Y-3.5975 90 | X5.075Y-4.235 91 | X5.09Y-4.045 92 | X5.09Y-4.105 93 | X5.105Y-4.315 94 | X5.11Y-4.43 95 | X5.12Y-4.25 96 | X5.125Y-3.25 97 | X5.13Y-4.045 98 | X5.13Y-4.1375 99 | X5.135Y-3.975 100 | X5.15Y-3.275 101 | X5.18Y-3.425 102 | X5.18Y-3.475 103 | X5.185Y-3.975 104 | X5.185Y-4.025 105 | X5.195Y-3.765 106 | X5.21Y-4.295 107 | X5.21Y-4.415 108 | X5.225Y-3.425 109 | X5.2849Y-3.1583 110 | X5.29Y-3.425 111 | X5.29Y-3.5984 112 | X5.31Y-4.335 113 | X5.315Y-4.4 114 | X5.32Y-3.13 115 | X5.32Y-3.1583 116 | X5.325Y-4.025 117 | X5.325Y-4.075 118 | X5.3325Y-3.4275 119 | X5.345Y-3.66 120 | X5.345Y-3.765 121 | X5.365Y-3.69 122 | X5.375Y-3.725 123 | X5.375Y-3.9 124 | X5.375Y-4.025 125 | X5.3754Y-2.7978 126 | X5.3828Y-3.4179 127 | X5.39Y-3.595 128 | X5.3901Y-3.4712 129 | X5.395Y-4.31 130 | X5.41Y-4.365 131 | X5.412Y-2.7978 132 | X5.425Y-3.9 133 | X5.4275Y-3.4625 134 | X5.4283Y-3.8587 135 | X5.443Y-3.423 136 | X5.4457Y-3.3877 137 | X5.455Y-4.06 138 | X5.485Y-3.41 139 | X5.485Y-3.555 140 | X5.485Y-3.895 141 | X5.515Y-4.3 142 | X5.515Y-4.355 143 | X5.525Y-3.555 144 | X5.525Y-3.895 145 | X5.5611Y-3.7111 146 | X5.5617Y-3.39 147 | X5.5619Y-3.7644 148 | X5.575Y-3.9 149 | X5.61Y-3.87 150 | X5.6522Y-3.7378 151 | X5.665Y-3.395 152 | X5.665Y-3.44 153 | X5.665Y-3.48 154 | X5.675Y-3.575 155 | X5.705Y-3.325 156 | X5.705Y-3.365 157 | X5.705Y-4.325 158 | X5.715Y-3.575 159 | X5.715Y-3.615 160 | X5.72Y-4.365 161 | X5.73Y-3.48 162 | X5.765Y-3.03 163 | X5.795Y-3.06 164 | X5.82Y-4.205 165 | X5.825Y-3.03 166 | X5.865Y-4.213 167 | X5.8869Y-3.6757 168 | X5.8901Y-3.711 169 | X5.895Y-3.495 170 | X5.895Y-3.815 171 | X5.895Y-4.1385 172 | X5.8988Y-4.1033 173 | X5.9Y-3.955 174 | X5.92Y-4.365 175 | X5.926Y-3.5337 176 | X5.9314Y-4.0894 177 | X5.935Y-3.385 178 | X5.935Y-3.445 179 | X5.9591Y-3.8125 180 | X5.96Y-4.06 181 | X5.9633Y-3.3552 182 | X5.9633Y-3.4719 183 | X5.965Y-4.21 184 | X5.9656Y-3.56 185 | X5.9867Y-3.7882 186 | X5.9892Y-4.0292 187 | X5.995Y-3.29 188 | X5.995Y-3.3317 189 | X5.995Y-3.59 190 | X5.9952Y-3.5 191 | X6.005Y-4.185 192 | X6.0083Y-3.7601 193 | X6.02Y-3.845 194 | X6.02Y-3.9 195 | X6.025Y-3.62 196 | X6.03Y-4.15 197 | X6.065Y-3.865 198 | X6.069Y-4.133 199 | X6.07Y-3.77 200 | X6.0732Y-3.6468 201 | X6.11Y-3.96 202 | X6.1289Y-4.1834 203 | X6.145Y-3.855 204 | X6.15Y-3.985 205 | X6.1509Y-4.1555 206 | X6.16Y-3.905 207 | X6.195Y-3.97 208 | X6.205Y-3.5275 209 | X6.245Y-3.5275 210 | X6.275Y-3.845 211 | X6.315Y-4.63 212 | X6.355Y-3.84 213 | X6.36Y-3.72 214 | X6.36Y-3.79 215 | X6.365Y-4.2 216 | X6.38Y-4.12 217 | X6.391Y-3.7439 218 | X6.405Y-4.63 219 | X6.41Y-4.2 220 | X6.4207Y-3.7245 221 | X6.429Y-3.636 222 | X6.45Y-3.7 223 | X6.4726Y-3.6024 224 | X6.475Y-3.665 225 | X6.52Y-3.61 226 | X6.54Y-4.175 227 | X6.57Y-3.57 228 | X6.57Y-3.615 229 | X6.575Y-4.02 230 | X6.58Y-4.16 231 | X6.605Y-3.57 232 | X6.605Y-3.605 233 | X6.605Y-3.645 234 | X6.605Y-3.68 235 | X6.66Y-3.92 236 | X6.735Y-2.88 237 | X6.7495Y-3.5045 238 | X6.75Y-3.585 239 | X6.753Y-3.662 240 | X6.7725Y-2.91 241 | X6.7755Y-3.8195 242 | X6.78Y-3.47 243 | X6.785Y-4.2 244 | X6.7931Y-3.699 245 | X6.81Y-3.54 246 | X6.8138Y-3.7576 247 | X6.88Y-3.295 248 | X6.885Y-3.91 249 | X6.89Y-4.215 250 | X6.93Y-4.15 251 | X6.935Y-4.195 252 | T2 253 | X3.975Y-2.7 254 | X3.975Y-2.8 255 | X3.975Y-2.9 256 | X3.975Y-3.0 257 | X3.975Y-3.225 258 | X3.975Y-3.3 259 | X3.975Y-3.375 260 | X3.975Y-3.59 261 | X3.975Y-3.69 262 | X3.975Y-3.79 263 | X3.975Y-3.89 264 | X3.975Y-4.0 265 | X3.975Y-4.1 266 | X3.975Y-4.2 267 | X3.975Y-4.3 268 | X3.975Y-4.375 269 | X3.975Y-4.45 270 | X4.05Y-2.7 271 | X4.05Y-3.3 272 | X4.05Y-3.375 273 | X4.05Y-3.465 274 | X4.12Y-3.5 275 | X4.125Y-3.3 276 | X4.175Y-2.6 277 | X4.175Y-2.8 278 | X4.175Y-3.4 279 | X4.175Y-3.465 280 | X4.19Y-2.69 281 | X4.2Y-4.6905 282 | X4.23Y-3.5 283 | X4.23Y-4.34 284 | X4.235Y-3.995 285 | X4.235Y-4.185 286 | X4.275Y-2.6 287 | X4.275Y-2.69 288 | X4.275Y-2.8 289 | X4.285Y-3.48 290 | X4.3Y-4.6905 291 | X4.36Y-4.69 292 | X4.375Y-2.6 293 | X4.375Y-2.69 294 | X4.375Y-2.8 295 | X4.39Y-4.16 296 | X4.395Y-4.35 297 | X4.4Y-4.425 298 | X4.425Y-4.6905 299 | X4.455Y-2.8 300 | X4.475Y-2.6 301 | X4.475Y-2.69 302 | X4.485Y-4.055 303 | X4.5Y-4.6905 304 | X4.51Y-4.29 305 | X4.525Y-4.015 306 | X4.55Y-2.69 307 | X4.575Y-2.6 308 | X4.6125Y-4.6905 309 | X4.7125Y-4.6905 310 | X4.8Y-2.65 311 | X4.8125Y-4.6905 312 | X4.85Y-2.6 313 | X4.85Y-3.0 314 | X4.85Y-3.19 315 | X4.9Y-3.05 316 | X4.9125Y-4.6905 317 | X4.95Y-2.6 318 | X4.95Y-2.69 319 | X4.95Y-2.8 320 | X4.95Y-2.9 321 | X4.95Y-3.0 322 | X5.0Y-2.64 323 | X5.0125Y-4.6905 324 | X5.05Y-2.6 325 | X5.05Y-2.9 326 | X5.05Y-3.0 327 | X5.1Y-2.64 328 | X5.1Y-2.95 329 | X5.1125Y-4.6905 330 | X5.15Y-2.6 331 | X5.15Y-2.9 332 | X5.155Y-3.19 333 | X5.2Y-2.64 334 | X5.2Y-2.95 335 | X5.2125Y-4.6905 336 | X5.25Y-2.6 337 | X5.25Y-2.75 338 | X5.3Y-2.64 339 | X5.3Y-2.95 340 | X5.3125Y-4.6905 341 | X5.35Y-2.6 342 | X5.35Y-2.75 343 | X5.4Y-2.65 344 | X5.4Y-2.95 345 | X5.4125Y-4.6905 346 | X5.415Y-3.25 347 | X5.45Y-2.6 348 | X5.45Y-2.7 349 | X5.475Y-2.95 350 | X5.495Y-4.09 351 | X5.5Y-2.65 352 | X5.5Y-2.75 353 | X5.5125Y-4.6905 354 | X5.53Y-3.04 355 | X5.53Y-3.16 356 | X5.545Y-4.02 357 | X5.545Y-4.07 358 | X5.55Y-2.6 359 | X5.55Y-2.7 360 | X5.585Y-3.24 361 | X5.6Y-2.95 362 | X5.6125Y-4.6905 363 | X5.645Y-3.03 364 | X5.645Y-3.16 365 | X5.65Y-2.6 366 | X5.65Y-2.7 367 | X5.65Y-2.9 368 | X5.7Y-2.95 369 | X5.7125Y-4.6905 370 | X5.75Y-2.6 371 | X5.75Y-2.7 372 | X5.8Y-2.775 373 | X5.8Y-2.95 374 | X5.8125Y-4.6905 375 | X5.85Y-2.6 376 | X5.85Y-2.69 377 | X5.9125Y-4.6905 378 | X5.95Y-2.6 379 | X6.0125Y-4.6905 380 | X6.015Y-3.09 381 | X6.045Y-2.89 382 | X6.05Y-2.69 383 | X6.0643Y-2.5957 384 | X6.1125Y-4.6905 385 | X6.15Y-2.6 386 | X6.205Y-3.09 387 | X6.21Y-3.925 388 | X6.2125Y-4.6905 389 | X6.245Y-2.895 390 | X6.25Y-2.6 391 | X6.25Y-2.69 392 | X6.26Y-3.23 393 | X6.285Y-3.89 394 | X6.3125Y-4.6905 395 | X6.315Y-3.23 396 | X6.35Y-2.6 397 | X6.37Y-3.23 398 | X6.4125Y-4.69 399 | X6.45Y-2.6 400 | X6.46Y-2.89 401 | X6.465Y-2.79 402 | X6.49Y-2.67 403 | X6.49Y-4.49 404 | X6.505Y-4.685 405 | X6.52Y-3.02 406 | X6.52Y-3.385 407 | X6.525Y-2.6 408 | X6.595Y-3.295 409 | X6.6Y-4.685 410 | X6.63Y-3.34 411 | X6.635Y-2.96 412 | X6.65Y-2.6 413 | X6.675Y-3.385 414 | X6.675Y-3.43 415 | X6.69Y-3.02 416 | X6.7Y-4.575 417 | X6.7Y-4.685 418 | X6.715Y-2.685 419 | X6.7357Y-2.5957 420 | X6.765Y-3.18 421 | X6.765Y-3.36 422 | X6.775Y-4.495 423 | X6.8Y-4.685 424 | X6.8057Y-2.5957 425 | X6.815Y-4.1 426 | X6.845Y-2.685 427 | X6.875Y-4.12 428 | X6.9Y-2.6 429 | X6.925Y-4.35 430 | X6.945Y-3.51 431 | X6.945Y-3.575 432 | X6.945Y-3.64 433 | X6.945Y-3.82 434 | X6.945Y-3.88 435 | X6.945Y-3.94 436 | X6.995Y-3.41 437 | X6.995Y-4.065 438 | X7.045Y-2.6 439 | X7.045Y-2.675 440 | X7.045Y-2.775 441 | X7.045Y-2.875 442 | X7.045Y-2.975 443 | X7.045Y-3.25 444 | X7.045Y-3.35 445 | X7.045Y-3.45 446 | X7.045Y-3.55 447 | X7.045Y-3.65 448 | X7.045Y-3.76 449 | X7.045Y-3.85 450 | X7.045Y-3.95 451 | X7.045Y-4.0 452 | X7.045Y-4.05 453 | X7.045Y-4.35 454 | X7.045Y-4.45 455 | X7.05Y-4.15 456 | X7.05Y-4.27 457 | X4.8528Y-3.7176 458 | X4.8528Y-3.812 459 | X4.9472Y-3.7148 460 | X4.9472Y-3.812 461 | T4 462 | X6.1417Y-3.1693 463 | X6.1417Y-3.3268 464 | X4.2913Y-4.4276 465 | X4.2913Y-4.5276 466 | X4.2913Y-4.6276 467 | T5 468 | X4.9Y-3.7648 469 | T3 470 | G00X4.122Y-2.6102 471 | M15 472 | G01X4.122Y-2.6496 473 | M16 474 | G05 475 | G00X4.122Y-2.8406 476 | M15 477 | G01X4.122Y-2.8957 478 | M16 479 | G05 480 | G00X4.6969Y-2.6102 481 | M15 482 | G01X4.6969Y-2.6496 483 | M16 484 | G05 485 | G00X4.6969Y-2.8406 486 | M15 487 | G01X4.6969Y-2.8957 488 | M16 489 | G05 490 | G00X6.6016Y-2.6437 491 | M15 492 | G01X6.6016Y-2.6201 493 | M16 494 | G05 495 | G00X6.6016Y-2.8142 496 | M15 497 | G01X6.6016Y-2.7787 498 | M16 499 | G05 500 | G00X6.9417Y-2.6437 501 | M15 502 | G01X6.9417Y-2.6201 503 | M16 504 | G05 505 | G00X6.9417Y-2.8142 506 | M15 507 | G01X6.9417Y-2.7787 508 | M16 509 | G05 510 | G00X5.1417Y-2.8091 511 | M15 512 | G01X5.1417Y-2.7697 513 | M16 514 | G05 515 | G00X5.6457Y-2.8091 516 | M15 517 | G01X5.6457Y-2.7697 518 | M16 519 | G05 520 | T0 521 | M30 522 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Neo6502_Rev_B-BOM.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/Neo6502-rev-B/Neo6502_Rev_B-BOM.ods -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Neo6502_Rev_B-BOM.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/Neo6502-rev-B/Neo6502_Rev_B-BOM.pdf -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Neo6502_Rev_B.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "tracks": 1.0, 14 | "vias": 1.0, 15 | "zones": 0.6 16 | }, 17 | "selection_filter": { 18 | "dimensions": true, 19 | "footprints": true, 20 | "graphics": true, 21 | "keepouts": true, 22 | "lockedItems": false, 23 | "otherItems": true, 24 | "pads": true, 25 | "text": true, 26 | "tracks": true, 27 | "vias": true, 28 | "zones": true 29 | }, 30 | "visible_items": [ 31 | 0, 32 | 1, 33 | 2, 34 | 3, 35 | 4, 36 | 5, 37 | 6, 38 | 9, 39 | 10, 40 | 11, 41 | 12, 42 | 13, 43 | 14, 44 | 15, 45 | 16, 46 | 18, 47 | 19, 48 | 20, 49 | 21, 50 | 22, 51 | 23, 52 | 24, 53 | 25, 54 | 26, 55 | 27, 56 | 28, 57 | 29, 58 | 30, 59 | 32, 60 | 33, 61 | 34, 62 | 35, 63 | 36, 64 | 39, 65 | 40 66 | ], 67 | "visible_layers": "0001030_00000000", 68 | "zone_display_mode": 0 69 | }, 70 | "meta": { 71 | "filename": "Neo6502_Rev_B.kicad_prl", 72 | "version": 3 73 | }, 74 | "project": { 75 | "files": [] 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Neo6502_Rev_B.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/Neo6502-rev-B/Neo6502_Rev_B.pdf -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/Neo6502_Rev_B.pro: -------------------------------------------------------------------------------- 1 | update=29.08.2023 (вт) 10:33:50 EEST 2 | version=1 3 | last_client=kicad 4 | [cvpcb] 5 | version=1 6 | NetIExt=net 7 | [general] 8 | version=1 9 | [eeschema] 10 | version=1 11 | LibDir= 12 | [schematic_editor] 13 | version=1 14 | PageLayoutDescrFile=/home/penko/SVN_Checkout/important_DOCs/KiCad-New_Page_Layouts/A4-Landscape-2.kicad_wks 15 | PlotDirectoryName= 16 | SubpartIdSeparator=0 17 | SubpartFirstId=65 18 | NetFmtName=Pcbnew 19 | SpiceAjustPassiveValues=0 20 | LabSize=50 21 | ERC_TestSimilarLabels=1 22 | [pcbnew] 23 | version=1 24 | PageLayoutDescrFile=/home/penko/SVN_Checkout/important_DOCs/KiCad-New_Page_Layouts/A4-Landscape-2.kicad_wks 25 | LastNetListRead=Neo6502_Rev_B.net 26 | CopperLayerCount=2 27 | BoardThickness=1.6 28 | AllowMicroVias=0 29 | AllowBlindVias=0 30 | RequireCourtyardDefinitions=0 31 | ProhibitOverlappingCourtyards=1 32 | MinTrackWidth=0.2 33 | MinViaDiameter=0.7 34 | MinViaDrill=0.4 35 | MinMicroViaDiameter=0.7 36 | MinMicroViaDrill=0.4 37 | MinHoleToHole=0.3048 38 | TrackWidth1=0.254 39 | TrackWidth2=0.2 40 | TrackWidth3=0.254 41 | TrackWidth4=0.3048 42 | TrackWidth5=0.3556 43 | TrackWidth6=0.4064 44 | TrackWidth7=0.508 45 | TrackWidth8=0.762 46 | TrackWidth9=1.016 47 | TrackWidth10=1.27 48 | TrackWidth11=1.524 49 | TrackWidth12=1.778 50 | TrackWidth13=2.032 51 | TrackWidth14=2.286 52 | TrackWidth15=2.54 53 | ViaDiameter1=0.7 54 | ViaDrill1=0.4 55 | ViaDiameter2=1 56 | ViaDrill2=0.6 57 | dPairWidth1=0.2 58 | dPairGap1=0.508 59 | dPairViaGap1=0.25 60 | SilkLineWidth=0.254 61 | SilkTextSizeV=1.27 62 | SilkTextSizeH=1.27 63 | SilkTextSizeThickness=0.254 64 | SilkTextItalic=0 65 | SilkTextUpright=0 66 | CopperLineWidth=0.254 67 | CopperTextSizeV=1.27 68 | CopperTextSizeH=1.27 69 | CopperTextThickness=0.254 70 | CopperTextItalic=0 71 | CopperTextUpright=0 72 | EdgeCutLineWidth=0.254 73 | CourtyardLineWidth=0.05 74 | OthersLineWidth=0.254 75 | OthersTextSizeV=1.27 76 | OthersTextSizeH=1.27 77 | OthersTextSizeThickness=0.254 78 | OthersTextItalic=0 79 | OthersTextUpright=1 80 | SolderMaskClearance=0.0508 81 | SolderMaskMinWidth=0 82 | SolderPasteClearance=0 83 | SolderPasteRatio=-0 84 | [pcbnew/Netclasses] 85 | [pcbnew/Netclasses/1] 86 | Name=Zdiff=100R 87 | Clearance=0.2 88 | TrackWidth=0.2 89 | ViaDiameter=0.7 90 | ViaDrill=0.4 91 | uViaDiameter=0.7 92 | uViaDrill=0.4 93 | dPairWidth=0.2 94 | dPairGap=0.508 95 | dPairViaGap=0.25 96 | [pcbnew/Netclasses/2] 97 | Name=Zdiff=90R 98 | Clearance=0.2 99 | TrackWidth=0.2 100 | ViaDiameter=0.7 101 | ViaDrill=0.4 102 | uViaDiameter=0.7 103 | uViaDrill=0.4 104 | dPairWidth=0.2 105 | dPairGap=0.2286 106 | dPairViaGap=0.25 107 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/fp-info-cache: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name Neo6502_Rev_B)(type Legacy)(uri ${KIPRJMOD}/Neo6502_Rev_B.lib)(options "")(descr "")) 3 | ) -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Gerbers/Neo6502_Rev_B-B_Mask.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2023-08-29T11:39:43+03:00* 3 | G04 #@! TF.ProjectId,Neo6502_Rev_B,4e656f36-3530-4325-9f52-65765f422e6b,B* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Soldermask,Bot* 6 | G04 #@! TF.FilePolarity,Negative* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1) date 2023-08-29 11:39:43* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | %ADD10O,1.301600X2.301600*% 14 | %ADD11C,0.701600*% 15 | %ADD12O,1.401600X2.101600*% 16 | %ADD13O,1.901600X2.901600*% 17 | %ADD14O,1.401600X2.401600*% 18 | %ADD15O,1.401600X2.801600*% 19 | %ADD16C,1.301600*% 20 | %ADD17C,1.801600*% 21 | %ADD18C,1.254000*% 22 | %ADD19C,3.401601*% 23 | %ADD20R,1.879600X1.879600*% 24 | %ADD21C,1.879600*% 25 | %ADD22C,1.101600*% 26 | %ADD23C,1.901600*% 27 | %ADD24R,2.101600X2.101600*% 28 | %ADD25C,2.101600*% 29 | G04 APERTURE END LIST* 30 | D10* 31 | X176320000Y-71030000D03* 32 | D11* 33 | X174890000Y-70530000D03* 34 | D12* 35 | X176320000Y-66850000D03* 36 | X167680000Y-66850000D03* 37 | D10* 38 | X167680000Y-71030000D03* 39 | D11* 40 | X169110000Y-70530000D03* 41 | D13* 42 | X130600000Y-70850000D03* 43 | X143400000Y-70850000D03* 44 | D14* 45 | X119300000Y-66800000D03* 46 | X104700000Y-66800000D03* 47 | D15* 48 | X104700000Y-72850000D03* 49 | X119300000Y-72850000D03* 50 | D16* 51 | X117140000Y-114000000D03* 52 | X162860000Y-114000000D03* 53 | X106000000Y-98810000D03* 54 | X106000000Y-91190000D03* 55 | D17* 56 | X156000000Y-74000000D03* 57 | X156000000Y-68000000D03* 58 | D18* 59 | X101500000Y-66500000D03* 60 | X178500000Y-118500000D03* 61 | D19* 62 | X104000000Y-116000000D03* 63 | X176000000Y-116000000D03* 64 | X176000000Y-79000000D03* 65 | X104000000Y-79000000D03* 66 | D20* 67 | X109000000Y-112460000D03* 68 | D21* 69 | X109000000Y-115000000D03* 70 | X109000000Y-117540000D03* 71 | D22* 72 | X125660000Y-96826000D03* 73 | X123260000Y-96826000D03* 74 | D23* 75 | X124460000Y-95626000D03* 76 | D22* 77 | X125660000Y-94356000D03* 78 | X123260000Y-94426000D03* 79 | D24* 80 | X156000000Y-80500000D03* 81 | D25* 82 | X156000000Y-84500000D03* 83 | D18* 84 | X101500000Y-118500000D03* 85 | M02* 86 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Gerbers/Neo6502_Rev_B-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2023-08-29T11:39:43+03:00* 3 | G04 #@! TF.ProjectId,Neo6502_Rev_B,4e656f36-3530-4325-9f52-65765f422e6b,B* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Paste,Bot* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1) date 2023-08-29 11:39:43* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | G04 APERTURE END LIST* 14 | M02* 15 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Gerbers/Neo6502_Rev_B-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2023-08-29T11:39:43+03:00* 3 | G04 #@! TF.ProjectId,Neo6502_Rev_B,4e656f36-3530-4325-9f52-65765f422e6b,B* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Profile,NP* 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1) date 2023-08-29 11:39:43* 9 | %MOMM*% 10 | %LPD*% 11 | G04 APERTURE LIST* 12 | %ADD10C,0.254000*% 13 | G04 APERTURE END LIST* 14 | D10* 15 | X100000000Y-65000000D02* 16 | X100000000Y-120000000D01* 17 | X180000000Y-65000000D02* 18 | X100000000Y-65000000D01* 19 | X180000000Y-120000000D02* 20 | X100000000Y-120000000D01* 21 | X180000000Y-65000000D02* 22 | X180000000Y-120000000D01* 23 | M02* 24 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Gerbers/Neo6502_Rev_B-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1} date 29.08.2023 (вт) 11:39:45 EEST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2023-08-29T11:39:45+03:00* 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1 6 | ; #@! TF.FileFunction,NonPlated,1,2,NPTH 7 | FMAT,2 8 | INCH 9 | T1C0.0236 10 | T2C0.0472 11 | T3C0.0669 12 | T4C0.1299 13 | % 14 | G90 15 | G05 16 | T1 17 | X6.6579Y-2.7768 18 | X6.8854Y-2.7768 19 | T2 20 | X4.6118Y-4.4882 21 | X6.4118Y-4.4882 22 | X4.1732Y-3.5902 23 | X4.1732Y-3.8902 24 | T3 25 | X6.1417Y-2.6772 26 | X6.1417Y-2.9134 27 | T4 28 | X4.0945Y-4.5669 29 | X6.9291Y-3.1102 30 | X6.9291Y-4.5669 31 | X4.0945Y-3.1102 32 | T0 33 | M30 34 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Gerbers/Neo6502_Rev_B-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1} date 29.08.2023 (вт) 11:39:45 EEST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2023-08-29T11:39:45+03:00* 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.0-rc2-unknown-036be7d~80~ubuntu16.04.1 6 | ; #@! TF.FileFunction,Plated,1,2,PTH 7 | FMAT,2 8 | INCH 9 | T1C0.0157 10 | T2C0.0236 11 | T3C0.0315 12 | T4C0.0394 13 | T5C0.0472 14 | % 15 | G90 16 | G05 17 | T1 18 | X4.225Y-3.22 19 | X4.34Y-3.185 20 | X4.34Y-3.285 21 | X4.34Y-3.3262 22 | X4.34Y-3.3738 23 | X4.355Y-3.59 24 | X4.355Y-4.255 25 | X4.39Y-4.035 26 | X4.39Y-4.09 27 | X4.395Y-3.69 28 | X4.425Y-3.64 29 | X4.425Y-3.98 30 | X4.45Y-3.185 31 | X4.45Y-3.285 32 | X4.45Y-3.3262 33 | X4.45Y-3.3738 34 | X4.45Y-3.84 35 | X4.45Y-3.915 36 | X4.465Y-3.98 37 | X4.495Y-3.705 38 | X4.54Y-3.395 39 | X4.56Y-4.485 40 | X4.58Y-4.095 41 | X4.5827Y-3.3618 42 | X4.5849Y-3.4001 43 | X4.585Y-3.185 44 | X4.59Y-3.535 45 | X4.59Y-3.71 46 | X4.59Y-3.77 47 | X4.59Y-3.8294 48 | X4.59Y-3.96 49 | X4.6Y-4.365 50 | X4.635Y-4.095 51 | X4.635Y-4.19 52 | X4.655Y-3.36 53 | X4.665Y-3.48 54 | X4.68Y-3.98 55 | X4.6992Y-4.215 56 | X4.7Y-4.485 57 | X4.705Y-3.455 58 | X4.705Y-3.955 59 | X4.73Y-3.93 60 | X4.735Y-3.195 61 | X4.7358Y-4.215 62 | X4.755Y-3.905 63 | X4.765Y-4.485 64 | X4.8Y-4.185 65 | X4.8Y-4.365 66 | X4.815Y-3.365 67 | X4.825Y-3.675 68 | X4.825Y-3.765 69 | X4.825Y-3.85 70 | X4.8275Y-4.12 71 | X4.85Y-4.235 72 | X4.86Y-4.485 73 | X4.895Y-3.495 74 | X4.9Y-3.675 75 | X4.9Y-3.85 76 | X4.9Y-4.335 77 | X4.915Y-4.455 78 | X4.935Y-4.215 79 | X4.955Y-3.505 80 | X4.975Y-3.675 81 | X4.975Y-3.765 82 | X4.975Y-3.85 83 | X4.98Y-3.48 84 | X5.005Y-3.455 85 | X5.005Y-4.31 86 | X5.01Y-4.445 87 | X5.04Y-3.905 88 | X5.05Y-3.62 89 | X5.075Y-3.5975 90 | X5.075Y-4.235 91 | X5.09Y-4.045 92 | X5.09Y-4.105 93 | X5.105Y-4.315 94 | X5.11Y-4.43 95 | X5.12Y-4.25 96 | X5.125Y-3.25 97 | X5.13Y-4.045 98 | X5.13Y-4.1375 99 | X5.135Y-3.975 100 | X5.15Y-3.275 101 | X5.18Y-3.425 102 | X5.18Y-3.475 103 | X5.185Y-3.975 104 | X5.185Y-4.025 105 | X5.195Y-3.765 106 | X5.21Y-4.295 107 | X5.21Y-4.415 108 | X5.225Y-3.425 109 | X5.2849Y-3.1583 110 | X5.29Y-3.425 111 | X5.29Y-3.5984 112 | X5.31Y-4.335 113 | X5.315Y-4.4 114 | X5.32Y-3.13 115 | X5.32Y-3.1583 116 | X5.325Y-4.025 117 | X5.325Y-4.075 118 | X5.3325Y-3.4275 119 | X5.345Y-3.66 120 | X5.345Y-3.765 121 | X5.365Y-3.69 122 | X5.375Y-3.725 123 | X5.375Y-3.9 124 | X5.375Y-4.025 125 | X5.3754Y-2.7978 126 | X5.3828Y-3.4179 127 | X5.39Y-3.595 128 | X5.3901Y-3.4712 129 | X5.395Y-4.31 130 | X5.41Y-4.365 131 | X5.412Y-2.7978 132 | X5.425Y-3.9 133 | X5.4275Y-3.4625 134 | X5.4283Y-3.8587 135 | X5.443Y-3.423 136 | X5.4457Y-3.3877 137 | X5.455Y-4.06 138 | X5.485Y-3.41 139 | X5.485Y-3.555 140 | X5.485Y-3.895 141 | X5.515Y-4.3 142 | X5.515Y-4.355 143 | X5.525Y-3.555 144 | X5.525Y-3.895 145 | X5.5611Y-3.7111 146 | X5.5617Y-3.39 147 | X5.5619Y-3.7644 148 | X5.575Y-3.9 149 | X5.61Y-3.87 150 | X5.6522Y-3.7378 151 | X5.665Y-3.395 152 | X5.665Y-3.44 153 | X5.665Y-3.48 154 | X5.675Y-3.575 155 | X5.705Y-3.325 156 | X5.705Y-3.365 157 | X5.705Y-4.325 158 | X5.715Y-3.575 159 | X5.715Y-3.615 160 | X5.72Y-4.365 161 | X5.73Y-3.48 162 | X5.765Y-3.03 163 | X5.795Y-3.06 164 | X5.82Y-4.205 165 | X5.825Y-3.03 166 | X5.865Y-4.213 167 | X5.8869Y-3.6757 168 | X5.8901Y-3.711 169 | X5.895Y-3.495 170 | X5.895Y-3.815 171 | X5.895Y-4.1385 172 | X5.8988Y-4.1033 173 | X5.9Y-3.955 174 | X5.92Y-4.365 175 | X5.926Y-3.5337 176 | X5.9314Y-4.0894 177 | X5.935Y-3.385 178 | X5.935Y-3.445 179 | X5.9591Y-3.8125 180 | X5.96Y-4.06 181 | X5.9633Y-3.3552 182 | X5.9633Y-3.4719 183 | X5.965Y-4.21 184 | X5.9656Y-3.56 185 | X5.9867Y-3.7882 186 | X5.9892Y-4.0292 187 | X5.995Y-3.29 188 | X5.995Y-3.3317 189 | X5.995Y-3.59 190 | X5.9952Y-3.5 191 | X6.005Y-4.185 192 | X6.0083Y-3.7601 193 | X6.02Y-3.845 194 | X6.02Y-3.9 195 | X6.025Y-3.62 196 | X6.03Y-4.15 197 | X6.065Y-3.865 198 | X6.069Y-4.133 199 | X6.07Y-3.77 200 | X6.0732Y-3.6468 201 | X6.11Y-3.96 202 | X6.1289Y-4.1834 203 | X6.145Y-3.855 204 | X6.15Y-3.985 205 | X6.1509Y-4.1555 206 | X6.16Y-3.905 207 | X6.195Y-3.97 208 | X6.205Y-3.5275 209 | X6.245Y-3.5275 210 | X6.275Y-3.845 211 | X6.315Y-4.63 212 | X6.355Y-3.84 213 | X6.36Y-3.72 214 | X6.36Y-3.79 215 | X6.365Y-4.2 216 | X6.38Y-4.12 217 | X6.391Y-3.7439 218 | X6.405Y-4.63 219 | X6.41Y-4.2 220 | X6.4207Y-3.7245 221 | X6.429Y-3.636 222 | X6.45Y-3.7 223 | X6.4726Y-3.6024 224 | X6.475Y-3.665 225 | X6.52Y-3.61 226 | X6.54Y-4.175 227 | X6.57Y-3.57 228 | X6.57Y-3.615 229 | X6.575Y-4.02 230 | X6.58Y-4.16 231 | X6.605Y-3.57 232 | X6.605Y-3.605 233 | X6.605Y-3.645 234 | X6.605Y-3.68 235 | X6.66Y-3.92 236 | X6.735Y-2.88 237 | X6.7495Y-3.5045 238 | X6.75Y-3.585 239 | X6.753Y-3.662 240 | X6.7725Y-2.91 241 | X6.7755Y-3.8195 242 | X6.78Y-3.47 243 | X6.785Y-4.2 244 | X6.7931Y-3.699 245 | X6.81Y-3.54 246 | X6.8138Y-3.7576 247 | X6.88Y-3.295 248 | X6.885Y-3.91 249 | X6.89Y-4.215 250 | X6.93Y-4.15 251 | X6.935Y-4.195 252 | T2 253 | X3.975Y-2.7 254 | X3.975Y-2.8 255 | X3.975Y-2.9 256 | X3.975Y-3.0 257 | X3.975Y-3.225 258 | X3.975Y-3.3 259 | X3.975Y-3.375 260 | X3.975Y-3.59 261 | X3.975Y-3.69 262 | X3.975Y-3.79 263 | X3.975Y-3.89 264 | X3.975Y-4.0 265 | X3.975Y-4.1 266 | X3.975Y-4.2 267 | X3.975Y-4.3 268 | X3.975Y-4.375 269 | X3.975Y-4.45 270 | X4.05Y-2.7 271 | X4.05Y-3.3 272 | X4.05Y-3.375 273 | X4.05Y-3.465 274 | X4.12Y-3.5 275 | X4.125Y-3.3 276 | X4.175Y-2.6 277 | X4.175Y-2.8 278 | X4.175Y-3.4 279 | X4.175Y-3.465 280 | X4.19Y-2.69 281 | X4.2Y-4.6905 282 | X4.23Y-3.5 283 | X4.23Y-4.34 284 | X4.235Y-3.995 285 | X4.235Y-4.185 286 | X4.275Y-2.6 287 | X4.275Y-2.69 288 | X4.275Y-2.8 289 | X4.285Y-3.48 290 | X4.3Y-4.6905 291 | X4.36Y-4.69 292 | X4.375Y-2.6 293 | X4.375Y-2.69 294 | X4.375Y-2.8 295 | X4.39Y-4.16 296 | X4.395Y-4.35 297 | X4.4Y-4.425 298 | X4.425Y-4.6905 299 | X4.455Y-2.8 300 | X4.475Y-2.6 301 | X4.475Y-2.69 302 | X4.485Y-4.055 303 | X4.5Y-4.6905 304 | X4.51Y-4.29 305 | X4.525Y-4.015 306 | X4.55Y-2.69 307 | X4.575Y-2.6 308 | X4.6125Y-4.6905 309 | X4.7125Y-4.6905 310 | X4.8Y-2.65 311 | X4.8125Y-4.6905 312 | X4.85Y-2.6 313 | X4.85Y-3.0 314 | X4.85Y-3.19 315 | X4.9Y-3.05 316 | X4.9125Y-4.6905 317 | X4.95Y-2.6 318 | X4.95Y-2.69 319 | X4.95Y-2.8 320 | X4.95Y-2.9 321 | X4.95Y-3.0 322 | X5.0Y-2.64 323 | X5.0125Y-4.6905 324 | X5.05Y-2.6 325 | X5.05Y-2.9 326 | X5.05Y-3.0 327 | X5.1Y-2.64 328 | X5.1Y-2.95 329 | X5.1125Y-4.6905 330 | X5.15Y-2.6 331 | X5.15Y-2.9 332 | X5.155Y-3.19 333 | X5.2Y-2.64 334 | X5.2Y-2.95 335 | X5.2125Y-4.6905 336 | X5.25Y-2.6 337 | X5.25Y-2.75 338 | X5.3Y-2.64 339 | X5.3Y-2.95 340 | X5.3125Y-4.6905 341 | X5.35Y-2.6 342 | X5.35Y-2.75 343 | X5.4Y-2.65 344 | X5.4Y-2.95 345 | X5.4125Y-4.6905 346 | X5.415Y-3.25 347 | X5.45Y-2.6 348 | X5.45Y-2.7 349 | X5.475Y-2.95 350 | X5.495Y-4.09 351 | X5.5Y-2.65 352 | X5.5Y-2.75 353 | X5.5125Y-4.6905 354 | X5.53Y-3.04 355 | X5.53Y-3.16 356 | X5.545Y-4.02 357 | X5.545Y-4.07 358 | X5.55Y-2.6 359 | X5.55Y-2.7 360 | X5.585Y-3.24 361 | X5.6Y-2.95 362 | X5.6125Y-4.6905 363 | X5.645Y-3.03 364 | X5.645Y-3.16 365 | X5.65Y-2.6 366 | X5.65Y-2.7 367 | X5.65Y-2.9 368 | X5.7Y-2.95 369 | X5.7125Y-4.6905 370 | X5.75Y-2.6 371 | X5.75Y-2.7 372 | X5.8Y-2.775 373 | X5.8Y-2.95 374 | X5.8125Y-4.6905 375 | X5.85Y-2.6 376 | X5.85Y-2.69 377 | X5.9125Y-4.6905 378 | X5.95Y-2.6 379 | X6.0125Y-4.6905 380 | X6.015Y-3.09 381 | X6.045Y-2.89 382 | X6.05Y-2.69 383 | X6.0643Y-2.5957 384 | X6.1125Y-4.6905 385 | X6.15Y-2.6 386 | X6.205Y-3.09 387 | X6.21Y-3.925 388 | X6.2125Y-4.6905 389 | X6.245Y-2.895 390 | X6.25Y-2.6 391 | X6.25Y-2.69 392 | X6.26Y-3.23 393 | X6.285Y-3.89 394 | X6.3125Y-4.6905 395 | X6.315Y-3.23 396 | X6.35Y-2.6 397 | X6.37Y-3.23 398 | X6.4125Y-4.69 399 | X6.45Y-2.6 400 | X6.46Y-2.89 401 | X6.465Y-2.79 402 | X6.49Y-2.67 403 | X6.49Y-4.49 404 | X6.505Y-4.685 405 | X6.52Y-3.02 406 | X6.52Y-3.385 407 | X6.525Y-2.6 408 | X6.595Y-3.295 409 | X6.6Y-4.685 410 | X6.63Y-3.34 411 | X6.635Y-2.96 412 | X6.65Y-2.6 413 | X6.675Y-3.385 414 | X6.675Y-3.43 415 | X6.69Y-3.02 416 | X6.7Y-4.575 417 | X6.7Y-4.685 418 | X6.715Y-2.685 419 | X6.7357Y-2.5957 420 | X6.765Y-3.18 421 | X6.765Y-3.36 422 | X6.775Y-4.495 423 | X6.8Y-4.685 424 | X6.8057Y-2.5957 425 | X6.815Y-4.1 426 | X6.845Y-2.685 427 | X6.875Y-4.12 428 | X6.9Y-2.6 429 | X6.925Y-4.35 430 | X6.945Y-3.51 431 | X6.945Y-3.575 432 | X6.945Y-3.64 433 | X6.945Y-3.82 434 | X6.945Y-3.88 435 | X6.945Y-3.94 436 | X6.995Y-3.41 437 | X6.995Y-4.065 438 | X7.045Y-2.6 439 | X7.045Y-2.675 440 | X7.045Y-2.775 441 | X7.045Y-2.875 442 | X7.045Y-2.975 443 | X7.045Y-3.25 444 | X7.045Y-3.35 445 | X7.045Y-3.45 446 | X7.045Y-3.55 447 | X7.045Y-3.65 448 | X7.045Y-3.76 449 | X7.045Y-3.85 450 | X7.045Y-3.95 451 | X7.045Y-4.0 452 | X7.045Y-4.05 453 | X7.045Y-4.35 454 | X7.045Y-4.45 455 | X7.05Y-4.15 456 | X7.05Y-4.27 457 | X4.8528Y-3.7176 458 | X4.8528Y-3.812 459 | X4.9472Y-3.7148 460 | X4.9472Y-3.812 461 | T4 462 | X6.1417Y-3.1693 463 | X6.1417Y-3.3268 464 | X4.2913Y-4.4276 465 | X4.2913Y-4.5276 466 | X4.2913Y-4.6276 467 | T5 468 | X4.9Y-3.7648 469 | T3 470 | G00X4.122Y-2.6102 471 | M15 472 | G01X4.122Y-2.6496 473 | M16 474 | G05 475 | G00X4.122Y-2.8406 476 | M15 477 | G01X4.122Y-2.8957 478 | M16 479 | G05 480 | G00X4.6969Y-2.6102 481 | M15 482 | G01X4.6969Y-2.6496 483 | M16 484 | G05 485 | G00X4.6969Y-2.8406 486 | M15 487 | G01X4.6969Y-2.8957 488 | M16 489 | G05 490 | G00X6.6016Y-2.6437 491 | M15 492 | G01X6.6016Y-2.6201 493 | M16 494 | G05 495 | G00X6.6016Y-2.8142 496 | M15 497 | G01X6.6016Y-2.7787 498 | M16 499 | G05 500 | G00X6.9417Y-2.6437 501 | M15 502 | G01X6.9417Y-2.6201 503 | M16 504 | G05 505 | G00X6.9417Y-2.8142 506 | M15 507 | G01X6.9417Y-2.7787 508 | M16 509 | G05 510 | G00X5.1417Y-2.8091 511 | M15 512 | G01X5.1417Y-2.7697 513 | M16 514 | G05 515 | G00X5.6457Y-2.8091 516 | M15 517 | G01X5.6457Y-2.7697 518 | M16 519 | G05 520 | T0 521 | M30 522 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1-BOM.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1-BOM.ods -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1-BOM.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1-BOM.pdf -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1.pdf -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1.pro: -------------------------------------------------------------------------------- 1 | update=28.05.2024 (вт) 10:24:56 EEST 2 | version=1 3 | last_client=kicad 4 | [cvpcb] 5 | version=1 6 | NetIExt=net 7 | [general] 8 | version=1 9 | [eeschema] 10 | version=1 11 | LibDir= 12 | [schematic_editor] 13 | version=1 14 | PageLayoutDescrFile=/home/penko/SVN_Checkout/important_DOCs/KiCad-New_Page_Layouts/A4-Landscape-2.kicad_wks 15 | PlotDirectoryName= 16 | SubpartIdSeparator=0 17 | SubpartFirstId=65 18 | NetFmtName=Pcbnew 19 | SpiceAjustPassiveValues=0 20 | LabSize=50 21 | ERC_TestSimilarLabels=1 22 | [pcbnew] 23 | version=1 24 | PageLayoutDescrFile=/home/penko/SVN_Checkout/important_DOCs/KiCad-New_Page_Layouts/A4-Landscape-2.kicad_wks 25 | LastNetListRead=Neo6502_Rev_B1.net 26 | CopperLayerCount=2 27 | BoardThickness=1.6 28 | AllowMicroVias=0 29 | AllowBlindVias=0 30 | RequireCourtyardDefinitions=0 31 | ProhibitOverlappingCourtyards=1 32 | MinTrackWidth=0.2 33 | MinViaDiameter=0.7 34 | MinViaDrill=0.4 35 | MinMicroViaDiameter=0.7 36 | MinMicroViaDrill=0.4 37 | MinHoleToHole=0.3048 38 | TrackWidth1=0.254 39 | TrackWidth2=0.2 40 | TrackWidth3=0.254 41 | TrackWidth4=0.3048 42 | TrackWidth5=0.3556 43 | TrackWidth6=0.4064 44 | TrackWidth7=0.508 45 | TrackWidth8=0.762 46 | TrackWidth9=1.016 47 | TrackWidth10=1.27 48 | TrackWidth11=1.524 49 | TrackWidth12=1.778 50 | TrackWidth13=2.032 51 | TrackWidth14=2.286 52 | TrackWidth15=2.54 53 | ViaDiameter1=0.7 54 | ViaDrill1=0.4 55 | ViaDiameter2=1 56 | ViaDrill2=0.6 57 | dPairWidth1=0.2 58 | dPairGap1=0.508 59 | dPairViaGap1=0.25 60 | SilkLineWidth=0.254 61 | SilkTextSizeV=1.27 62 | SilkTextSizeH=1.27 63 | SilkTextSizeThickness=0.254 64 | SilkTextItalic=0 65 | SilkTextUpright=0 66 | CopperLineWidth=0.254 67 | CopperTextSizeV=1.27 68 | CopperTextSizeH=1.27 69 | CopperTextThickness=0.254 70 | CopperTextItalic=0 71 | CopperTextUpright=0 72 | EdgeCutLineWidth=0.254 73 | CourtyardLineWidth=0.05 74 | OthersLineWidth=0.254 75 | OthersTextSizeV=1.27 76 | OthersTextSizeH=1.27 77 | OthersTextSizeThickness=0.254 78 | OthersTextItalic=0 79 | OthersTextUpright=1 80 | SolderMaskClearance=0.0508 81 | SolderMaskMinWidth=0 82 | SolderPasteClearance=0 83 | SolderPasteRatio=0 84 | [pcbnew/Netclasses] 85 | [pcbnew/Netclasses/1] 86 | Name=Zdiff=100R 87 | Clearance=0.2 88 | TrackWidth=0.2 89 | ViaDiameter=0.7 90 | ViaDrill=0.4 91 | uViaDiameter=0.7 92 | uViaDrill=0.4 93 | dPairWidth=0.2 94 | dPairGap=0.508 95 | dPairViaGap=0.25 96 | [pcbnew/Netclasses/2] 97 | Name=Zdiff=90R 98 | Clearance=0.2 99 | TrackWidth=0.2 100 | ViaDiameter=0.7 101 | ViaDrill=0.4 102 | uViaDiameter=0.7 103 | uViaDrill=0.4 104 | dPairWidth=0.2 105 | dPairGap=0.2286 106 | dPairViaGap=0.25 107 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/Neo6502_Rev_B1_BOM.csv: -------------------------------------------------------------------------------- 1 | "Id";"Designator";"Package";"Quantity";"Designation";"Supplier and ref"; 2 | 1;"USB-PWR1";"USB2.0_TYPE-C(A40-00119-A52-12)_Paste";1;"USB-C-16P-F(A40-00119-A52-12)";;; 3 | 2;"NEO6502_NEW";"Neo6502_Sign_Small_NEW2";1;"LOGO";;; 4 | 3;"NEO_LOGO_SMALL*";"Neo6502_Sign_Small";1;"LOGO";;; 5 | 4;"USB-HOST1";"USB-A-SMT-6.3H_HOST_Female";1;"USB-A-SMT-6.3H";;; 6 | 5;"DVI1";"HDMI-SWM-19_Paste";1;"HDMI-SWM-19";;; 7 | 6;"BUS1";"GBH-254-SMT-40";1;"P-B-V-40-LF";;; 8 | 7;"UEXT1";"GBH-254-SMT-10";1;"P-B-V-10-LF";;; 9 | 8;"Sign_RoHS";"Sign_RoHS_1";1;"Sign_RoHS";;; 10 | 9;"Sign_RecycleBin";"Sign_RecycleBin_1";1;"Sign_RecycleBin";;; 11 | 10;"Sign_PB-Free";"Sign_PB-Free";1;"Sign_PB-Free";;; 12 | 11;"Sign_OSHW_8x8";"Sign_OSHW_8x8";1;"Sign_OSHW_8x8";;; 13 | 12;"Sign_Antistatic";"Sign_Antistatic";1;"Sign_Antistatic";;; 14 | 13;"Logo_OLIMEX_TB-Bottom,Logo_OLIMEX_TB-Top";"Logo_OLIMEX_TB";2;"Logo_OLIMEX_TB";;; 15 | 14;"Sign_CE";"CE_Sign";1;"CE_Sign";;; 16 | 15;"AUDIO1";"SCJ325P00XG0B02G";1;"PJ-3.5-365-5P";;; 17 | 16;"C22,C18,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C13,C14,C21,C26,C27,C29";"C_0402_5MIL_DWS";18;"100nF/10V/20%/X5R/C0402";;; 18 | 17;"FID2,FID3,FID5,FID6,FID4";"Fiducial1x3";5;"Fiducial";;; 19 | 18;"MH1,MH2,MH3,MH4";"Mounting_Hole_Drill-3.3mm_Clerance-7mm";4;"Mounting_Hole_NPTH";;; 20 | 19;"PWR_LED1";"LED_0603_KA";1;"LED/RED/0603";;; 21 | 20;"R13,R33,R34,R8";"R_0402_5MIL_DWS";4;"2.2k/R0402";;; 22 | 21;"R30,R1,R14,R17,R18,R19,R20,R21,R31,R32";"R_0402_5MIL_DWS";10;"10k/R0402";;; 23 | 22;"R9";"R_0402_5MIL_DWS";1;"150R/R0402";;; 24 | 23;"R11,R22,R23,R24,R25,R26,R27,R28,R29";"R_0402_5MIL_DWS";9;"270R/R0402";;; 25 | 24;"C20,C17,C19,C23,C24";"C_0603_5MIL_DWS";5;"22uF/6.3V/20%/X5R/C0603";;; 26 | 25;"D1";"SOD-123_1C-2A_KA";1;"1N4148W/SOD123";;; 27 | 26;"Q2";"SOT23";1;"BC817-40(SOT23)";;; 28 | 27;"BOOT1";"YTS-A016-X";1;"YTS-A016-X";;; 29 | 28;"C11,C12,C25,C28,C30";"C_0402_5MIL_DWS";5;"2.2uF/6.3V/20%/X5R/C0402";;; 30 | 29;"C15,C16";"C_0402_5MIL_DWS";2;"18pF/50V/5%/C0G/C0402";;; 31 | 30;"HCEC1,HHPD1,HSCL1,HSDA1";"TESTPAD_40-ROUND";4;"TESTPAD";;; 32 | 31;"FUSE1";"FUSE-1206";1;"1N5819S4(SOD-123)";;; 33 | 32;"L1";"CD32";1;"2.2uH/1.5A/DCR=58mR/20%/3.00x3.00x1.50mm/CD32(NRS3015T2R2MNGH)";;; 34 | 33;"Q1";"TSX-3.2x2.5mm_GND(3)";1;"Q12MHz/20pF/10ppm/4P/3.2x2.5mm";;; 35 | 34;"R2";"R_0402_5MIL_DWS";1;"NA(10k/R0402)";;; 36 | 35;"R3,R6";"R_0402_5MIL_DWS";2;"100R/R0402";;; 37 | 36;"R4,R5";"R_0402_5MIL_DWS";2;"27R/R0402";;; 38 | 37;"R10,R12";"R_0402_5MIL_DWS";2;"5.1k/1%/R0402";;; 39 | 38;"R15";"R_0402_5MIL_DWS";1;"220k/R0402";;; 40 | 39;"R16";"R_0402_5MIL_DWS";1;"49.9k/1%/R0402";;; 41 | 40;"RM1,RM2";"RA1206_(4X0603)_4B8_xx";2;"RA1206_(4x0603)_4B8_330R";;; 42 | 41;"SWD1";"HN1x3";1;"NA(HN1x3)";;; 43 | 42;"U1";"SO-8_208mil";1;"ZD25Q16BTIGT(SOIC-8_208mils)";;; 44 | 43;"U2";"QFN56_7x7_Pitch_0.4mm";1;"RP2040(QFN-56_7x7mm_P0.4mm)";;; 45 | 44;"U3";"SOT-23-5";1;"SY8089AAAC(SOT23-5)";;; 46 | 45;"U5,U6,U7";"TSSOP20_Pitch-0.65mm_6.6x4.5x1.2mm";3;"74LVC245APW(TSSOP20)";;; 47 | 46;"SPK1";"Speaker_QMB-09B-03_1-Plus_2-Minus";1;"Speaker_QMB-09B-03(1.5-5.0V_2.7kHz_F9.0mm*H5.5mm)";;; 48 | 47;"R7";"R_1206_5MIL_DWS";1;"47R/R1206";;; 49 | 48;"FID1";"Fiducial1x3_Past";1;"Fiducial";;; 50 | 49;"U4";"TQFP44_NEO6502";1;"W65C02S6TQTG-14(TQFP44)";;; 51 | 50;"SWITCH1";"DSHP04TS-S-1.27mm_Half_4_Slide";1;"DSHP04TS-S";;; 52 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/fp-info-cache: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /HARDWARE/Neo6502-rev-B1/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name Neo6502_Rev_B1)(type Legacy)(uri ${KIPRJMOD}/Neo6502_Rev_B.lib)(options "")(descr "")) 3 | (lib (name Neo6502_Rev_B1-rescue)(type Legacy)(uri ${KIPRJMOD}/Neo6502_Rev_B1-rescue.lib)(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/Neo6502_Rev_A-backups/Neo6502_Rev_A-2023-06-26_160604.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/New6502-Rev-A/Neo6502_Rev_A-backups/Neo6502_Rev_A-2023-06-26_160604.zip -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/Neo6502_Rev_A-backups/Neo6502_Rev_A-2023-06-27_105856.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/New6502-Rev-A/Neo6502_Rev_A-backups/Neo6502_Rev_A-2023-06-27_105856.zip -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/Neo6502_Rev_A.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "tracks": 1.0, 14 | "vias": 1.0, 15 | "zones": 0.6 16 | }, 17 | "selection_filter": { 18 | "dimensions": true, 19 | "footprints": true, 20 | "graphics": true, 21 | "keepouts": true, 22 | "lockedItems": false, 23 | "otherItems": true, 24 | "pads": true, 25 | "text": true, 26 | "tracks": true, 27 | "vias": true, 28 | "zones": true 29 | }, 30 | "visible_items": [ 31 | 0, 32 | 1, 33 | 2, 34 | 3, 35 | 4, 36 | 5, 37 | 6, 38 | 9, 39 | 10, 40 | 11, 41 | 12, 42 | 13, 43 | 14, 44 | 15, 45 | 16, 46 | 18, 47 | 19, 48 | 20, 49 | 21, 50 | 22, 51 | 23, 52 | 24, 53 | 25, 54 | 26, 55 | 27, 56 | 28, 57 | 29, 58 | 30, 59 | 32, 60 | 33, 61 | 34, 62 | 35, 63 | 36, 64 | 39, 65 | 40 66 | ], 67 | "visible_layers": "0007800_80000001", 68 | "zone_display_mode": 0 69 | }, 70 | "meta": { 71 | "filename": "Neo6502_Rev_A.kicad_prl", 72 | "version": 3 73 | }, 74 | "project": { 75 | "files": [] 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/Neo6502_Rev_A.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/HARDWARE/New6502-Rev-A/Neo6502_Rev_A.pdf -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/Neo6502_Rev_A.pro: -------------------------------------------------------------------------------- 1 | update=17.05.2023 (ср) 8:45:37 EEST 2 | version=1 3 | last_client=kicad 4 | [cvpcb] 5 | version=1 6 | NetIExt=net 7 | [general] 8 | version=1 9 | [eeschema] 10 | version=1 11 | LibDir= 12 | [schematic_editor] 13 | version=1 14 | PageLayoutDescrFile=/home/penko/SVN_Checkout/important_DOCs/KiCad-New_Page_Layouts/A4-Landscape-2.kicad_wks 15 | PlotDirectoryName= 16 | SubpartIdSeparator=0 17 | SubpartFirstId=65 18 | NetFmtName=Pcbnew 19 | SpiceAjustPassiveValues=0 20 | LabSize=50 21 | ERC_TestSimilarLabels=1 22 | [pcbnew] 23 | version=1 24 | PageLayoutDescrFile=/home/penko/SVN_Checkout/important_DOCs/KiCad-New_Page_Layouts/A4-Landscape-2.kicad_wks 25 | LastNetListRead=Neo6502_Rev_A.net 26 | CopperLayerCount=2 27 | BoardThickness=1.6 28 | AllowMicroVias=0 29 | AllowBlindVias=0 30 | RequireCourtyardDefinitions=0 31 | ProhibitOverlappingCourtyards=1 32 | MinTrackWidth=0.2 33 | MinViaDiameter=0.7 34 | MinViaDrill=0.4 35 | MinMicroViaDiameter=0.7 36 | MinMicroViaDrill=0.4 37 | MinHoleToHole=0.3048 38 | TrackWidth1=0.254 39 | TrackWidth2=0.2 40 | TrackWidth3=0.254 41 | TrackWidth4=0.3556 42 | TrackWidth5=0.4064 43 | TrackWidth6=0.508 44 | TrackWidth7=0.762 45 | TrackWidth8=1.016 46 | TrackWidth9=1.27 47 | TrackWidth10=1.524 48 | TrackWidth11=1.778 49 | TrackWidth12=2.032 50 | TrackWidth13=2.286 51 | TrackWidth14=2.54 52 | ViaDiameter1=0.7 53 | ViaDrill1=0.4 54 | ViaDiameter2=1 55 | ViaDrill2=0.6 56 | dPairWidth1=0.2 57 | dPairGap1=0.508 58 | dPairViaGap1=0.25 59 | SilkLineWidth=0.254 60 | SilkTextSizeV=1.27 61 | SilkTextSizeH=1.27 62 | SilkTextSizeThickness=0.254 63 | SilkTextItalic=0 64 | SilkTextUpright=0 65 | CopperLineWidth=0.254 66 | CopperTextSizeV=1.27 67 | CopperTextSizeH=1.27 68 | CopperTextThickness=0.254 69 | CopperTextItalic=0 70 | CopperTextUpright=0 71 | EdgeCutLineWidth=0.254 72 | CourtyardLineWidth=0.05 73 | OthersLineWidth=0.254 74 | OthersTextSizeV=1.27 75 | OthersTextSizeH=1.27 76 | OthersTextSizeThickness=0.254 77 | OthersTextItalic=0 78 | OthersTextUpright=1 79 | SolderMaskClearance=0.0508 80 | SolderMaskMinWidth=0 81 | SolderPasteClearance=0 82 | SolderPasteRatio=-0 83 | [pcbnew/Layer.F.Cu] 84 | Name=F.Cu 85 | Type=0 86 | Enabled=1 87 | [pcbnew/Layer.In1.Cu] 88 | Name=In1.Cu 89 | Type=0 90 | Enabled=0 91 | [pcbnew/Layer.In2.Cu] 92 | Name=In2.Cu 93 | Type=0 94 | Enabled=0 95 | [pcbnew/Layer.In3.Cu] 96 | Name=In3.Cu 97 | Type=0 98 | Enabled=0 99 | [pcbnew/Layer.In4.Cu] 100 | Name=In4.Cu 101 | Type=0 102 | Enabled=0 103 | [pcbnew/Layer.In5.Cu] 104 | Name=In5.Cu 105 | Type=0 106 | Enabled=0 107 | [pcbnew/Layer.In6.Cu] 108 | Name=In6.Cu 109 | Type=0 110 | Enabled=0 111 | [pcbnew/Layer.In7.Cu] 112 | Name=In7.Cu 113 | Type=0 114 | Enabled=0 115 | [pcbnew/Layer.In8.Cu] 116 | Name=In8.Cu 117 | Type=0 118 | Enabled=0 119 | [pcbnew/Layer.In9.Cu] 120 | Name=In9.Cu 121 | Type=0 122 | Enabled=0 123 | [pcbnew/Layer.In10.Cu] 124 | Name=In10.Cu 125 | Type=0 126 | Enabled=0 127 | [pcbnew/Layer.In11.Cu] 128 | Name=In11.Cu 129 | Type=0 130 | Enabled=0 131 | [pcbnew/Layer.In12.Cu] 132 | Name=In12.Cu 133 | Type=0 134 | Enabled=0 135 | [pcbnew/Layer.In13.Cu] 136 | Name=In13.Cu 137 | Type=0 138 | Enabled=0 139 | [pcbnew/Layer.In14.Cu] 140 | Name=In14.Cu 141 | Type=0 142 | Enabled=0 143 | [pcbnew/Layer.In15.Cu] 144 | Name=In15.Cu 145 | Type=0 146 | Enabled=0 147 | [pcbnew/Layer.In16.Cu] 148 | Name=In16.Cu 149 | Type=0 150 | Enabled=0 151 | [pcbnew/Layer.In17.Cu] 152 | Name=In17.Cu 153 | Type=0 154 | Enabled=0 155 | [pcbnew/Layer.In18.Cu] 156 | Name=In18.Cu 157 | Type=0 158 | Enabled=0 159 | [pcbnew/Layer.In19.Cu] 160 | Name=In19.Cu 161 | Type=0 162 | Enabled=0 163 | [pcbnew/Layer.In20.Cu] 164 | Name=In20.Cu 165 | Type=0 166 | Enabled=0 167 | [pcbnew/Layer.In21.Cu] 168 | Name=In21.Cu 169 | Type=0 170 | Enabled=0 171 | [pcbnew/Layer.In22.Cu] 172 | Name=In22.Cu 173 | Type=0 174 | Enabled=0 175 | [pcbnew/Layer.In23.Cu] 176 | Name=In23.Cu 177 | Type=0 178 | Enabled=0 179 | [pcbnew/Layer.In24.Cu] 180 | Name=In24.Cu 181 | Type=0 182 | Enabled=0 183 | [pcbnew/Layer.In25.Cu] 184 | Name=In25.Cu 185 | Type=0 186 | Enabled=0 187 | [pcbnew/Layer.In26.Cu] 188 | Name=In26.Cu 189 | Type=0 190 | Enabled=0 191 | [pcbnew/Layer.In27.Cu] 192 | Name=In27.Cu 193 | Type=0 194 | Enabled=0 195 | [pcbnew/Layer.In28.Cu] 196 | Name=In28.Cu 197 | Type=0 198 | Enabled=0 199 | [pcbnew/Layer.In29.Cu] 200 | Name=In29.Cu 201 | Type=0 202 | Enabled=0 203 | [pcbnew/Layer.In30.Cu] 204 | Name=In30.Cu 205 | Type=0 206 | Enabled=0 207 | [pcbnew/Layer.B.Cu] 208 | Name=B.Cu 209 | Type=0 210 | Enabled=1 211 | [pcbnew/Layer.B.Adhes] 212 | Enabled=1 213 | [pcbnew/Layer.F.Adhes] 214 | Enabled=1 215 | [pcbnew/Layer.B.Paste] 216 | Enabled=1 217 | [pcbnew/Layer.F.Paste] 218 | Enabled=1 219 | [pcbnew/Layer.B.SilkS] 220 | Enabled=1 221 | [pcbnew/Layer.F.SilkS] 222 | Enabled=1 223 | [pcbnew/Layer.B.Mask] 224 | Enabled=1 225 | [pcbnew/Layer.F.Mask] 226 | Enabled=1 227 | [pcbnew/Layer.Dwgs.User] 228 | Enabled=1 229 | [pcbnew/Layer.Cmts.User] 230 | Enabled=1 231 | [pcbnew/Layer.Eco1.User] 232 | Enabled=1 233 | [pcbnew/Layer.Eco2.User] 234 | Enabled=1 235 | [pcbnew/Layer.Edge.Cuts] 236 | Enabled=1 237 | [pcbnew/Layer.Margin] 238 | Enabled=1 239 | [pcbnew/Layer.B.CrtYd] 240 | Enabled=1 241 | [pcbnew/Layer.F.CrtYd] 242 | Enabled=1 243 | [pcbnew/Layer.B.Fab] 244 | Enabled=1 245 | [pcbnew/Layer.F.Fab] 246 | Enabled=1 247 | [pcbnew/Layer.Rescue] 248 | Enabled=0 249 | [pcbnew/Netclasses] 250 | [pcbnew/Netclasses/Default] 251 | Name=Default 252 | Clearance=0.2 253 | TrackWidth=0.254 254 | ViaDiameter=0.7 255 | ViaDrill=0.4 256 | uViaDiameter=0.7 257 | uViaDrill=0.4 258 | dPairWidth=0.2 259 | dPairGap=0.508 260 | dPairViaGap=0.25 261 | [pcbnew/Netclasses/1] 262 | Name=Zdiff=100R 263 | Clearance=0.2 264 | TrackWidth=0.2 265 | ViaDiameter=0.7 266 | ViaDrill=0.4 267 | uViaDiameter=0.7 268 | uViaDrill=0.4 269 | dPairWidth=0.2 270 | dPairGap=0.508 271 | dPairViaGap=0.25 272 | [pcbnew/Netclasses/2] 273 | Name=Zdiff=90R 274 | Clearance=0.2 275 | TrackWidth=0.2 276 | ViaDiameter=0.7 277 | ViaDrill=0.4 278 | uViaDiameter=0.7 279 | uViaDrill=0.4 280 | dPairWidth=0.2 281 | dPairGap=0.2286 282 | dPairViaGap=0.25 283 | -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/fp-info-cache: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /HARDWARE/New6502-Rev-A/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "Neo6502_Rev_A-rescue")(type "KiCad")(uri "${KIPRJMOD}/Neo6502_Rev_A-rescue.kicad_sym")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /HARDWARE/README.md: -------------------------------------------------------------------------------- 1 | Contains hardware design files for Olimex Neo6502 2 | 3 | Board was designed with free Open Source CAD software - KiCAD, if you have trouble opening the design files use newest KiCAD version. 4 | 5 | Folder "3D printed Case" contains STL files for multi material 3D printing of the encolosure. 6 | 7 | STL files are designed with Fusion 360 8 | 9 | Notable hardware revision changes: 10 | 11 | revision B1 12 | ====== 13 | 1. Added diode 1N5819/S4 on FUSE1 pads to enable 5V on HDMI (diode is used to prevent HDMI powering the board). You can try this adjustmest if you have older revision (with nothing placed over FUSE1) and problems with monitor, remember diode has direction and cathode has to be towards the HDMI connector. 14 | 15 | revision B 16 | ====== 17 | 18 | 1. Changed values P-B-V-40-LF and P-B-V-10-LF; 19 | 2. R7 set to 47R/R1206; 20 | 3. Added SWITCH1 for the speaker and signals go to the UEXT in case somebody needs them; 21 | 4. Added Neo6502 logo; 22 | 5. R1 changed NA to 10K; 23 | 6. Added attributions names and e-mail at the bottom; 24 | 7. C15 and C16 now 18pF; 25 | 8. A lot of small adjustmets to reduce soldering problems and yield. 26 | 27 | revision A 28 | ====== 29 | 30 | Initial release. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Neo6502 2 | Neo6502 Modern Retro Computer with W65C02S processor and RP2040 memory and peripherals emulator 3 | 4 | ![Neo6502-1](DOCUMENTS/Neo6502-1.jpg) 5 | 6 | Neo6502 is small board with dimensions 80x55mm. 7 | 8 | it consist of real W65C02S processor and RP2040 which emulates RAM memory, video, keyboard, SPI, I2C, UART, GPIOs, Sound 9 | 10 | ## Intro 11 | 12 | W65C02S lives in The Matrix and thinks there is real RAM and other interfaces around it, but the truth is that all this is emulation of the real life. The RP2040 emulates the RAM memory, video, IO and even clock the W65C02S by PWM. 13 | 14 | ## Features 15 | 16 | Neo6502 has these features: 17 | 18 | * W65C02S processor 19 | * RP2040 SOC with 2MB Flash 20 | * DVI video on HDMI connector 21 | * USB host for keyboard 22 | * Audio 3.5mm output 23 | * Speaker with enable jumper 24 | * USB-C for power supply 25 | * UEXT connector with I2C, UART and SPI 26 | * 40 pin 6502 bus connector with all W65C02 signals 27 | * Dimensions 80x55mm 28 | * 4 mount holes 29 | 30 | ## Licenses 31 | 32 | * Hardware is released under CERN Open Hardware Licence Version 2 - Strongly Reciprocal, all silkscreen credits to Olimex should remain; 33 | * Software is released under GPL3 Licensee 34 | * Documentation is released under CC BY-SA 3.0 -------------------------------------------------------------------------------- /SOFTWARE/Apple][/apple2_800x600_400MHz.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Apple][/apple2_800x600_400MHz.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Apple][/apple2_neo6502_karateka.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Apple][/apple2_neo6502_karateka.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Apple][/apple2_neo6502_lode_runner.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Apple][/apple2_neo6502_lode_runner.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Apple][/apple2_neo6502_moon_patrol.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Apple][/apple2_neo6502_moon_patrol.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Apple][/apple2_neo6502_neptune.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Apple][/apple2_neo6502_neptune.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Apple][/oric_960x540_372MHz.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Apple][/oric_960x540_372MHz.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Audio/audio.py: -------------------------------------------------------------------------------- 1 | from machine import Pin, PWM 2 | from utime import sleep 3 | 4 | buzzer = PWM(Pin(20)) 5 | 6 | tones = { 7 | "B0": 31, 8 | "C1": 33, 9 | "CS1": 35, 10 | "D1": 37, 11 | "DS1": 39, 12 | "E1": 41, 13 | "F1": 44, 14 | "FS1": 46, 15 | "G1": 49, 16 | "GS1": 52, 17 | "A1": 55, 18 | "AS1": 58, 19 | "B1": 62, 20 | "C2": 65, 21 | "CS2": 69, 22 | "D2": 73, 23 | "DS2": 78, 24 | "E2": 82, 25 | "F2": 87, 26 | "FS2": 93, 27 | "G2": 98, 28 | "GS2": 104, 29 | "A2": 110, 30 | "AS2": 117, 31 | "B2": 123, 32 | "C3": 131, 33 | "CS3": 139, 34 | "D3": 147, 35 | "DS3": 156, 36 | "E3": 165, 37 | "F3": 175, 38 | "FS3": 185, 39 | "G3": 196, 40 | "GS3": 208, 41 | "A3": 220, 42 | "AS3": 233, 43 | "B3": 247, 44 | "C4": 262, 45 | "CS4": 277, 46 | "D4": 294, 47 | "DS4": 311, 48 | "E4": 330, 49 | "F4": 349, 50 | "FS4": 370, 51 | "G4": 392, 52 | "GS4": 415, 53 | "A4": 440, 54 | "AS4": 466, 55 | "B4": 494, 56 | "C5": 523, 57 | "CS5": 554, 58 | "D5": 587, 59 | "DS5": 622, 60 | "E5": 659, 61 | "F5": 698, 62 | "FS5": 740, 63 | "G5": 784, 64 | "GS5": 831, 65 | "A5": 880, 66 | "AS5": 932, 67 | "B5": 988, 68 | "C6": 1047, 69 | "CS6": 1109, 70 | "D6": 1175, 71 | "DS6": 1245, 72 | "E6": 1319, 73 | "F6": 1397, 74 | "FS6": 1480, 75 | "G6": 1568, 76 | "GS6": 1661, 77 | "A6": 1760, 78 | "AS6": 1865, 79 | "B6": 1976, 80 | "C7": 2093, 81 | "CS7": 2217, 82 | "D7": 2349, 83 | "DS7": 2489, 84 | "E7": 2637, 85 | "F7": 2794, 86 | "FS7": 2960, 87 | "G7": 3136, 88 | "GS7": 3322, 89 | "A7": 3520, 90 | "AS7": 3729, 91 | "B7": 3951, 92 | "C8": 4186, 93 | "CS8": 4435, 94 | "D8": 4699, 95 | "DS8": 4978 96 | } 97 | 98 | song = ["E5","G5","A5","P","E5","G5","B5","A5","P","E5","G5","A5","P","G5","E5"] 99 | 100 | def playtone(frequency): 101 | buzzer.duty_u16(1000) 102 | buzzer.freq(frequency) 103 | 104 | def bequiet(): 105 | buzzer.duty_u16(0) 106 | 107 | def playsong(mysong): 108 | for i in range(len(mysong)): 109 | if (mysong[i] == "P"): 110 | bequiet() 111 | else: 112 | playtone(tones[mysong[i]]) 113 | sleep(0.3) 114 | bequiet() 115 | 116 | while 1: 117 | playsong(song) -------------------------------------------------------------------------------- /SOFTWARE/Audio/buz.py: -------------------------------------------------------------------------------- 1 | from machine import Pin, Timer 2 | 3 | buz = Pin(20, Pin.OUT) 4 | 5 | tim = Timer() 6 | 7 | def tick(timer): 8 | global buz 9 | buz.toggle() 10 | 11 | tim.init(freq=500, mode=Timer.PERIODIC, callback=tick) -------------------------------------------------------------------------------- /SOFTWARE/Audio/buzpwm.py: -------------------------------------------------------------------------------- 1 | from machine import Pin, PWM 2 | import time 3 | 4 | buz = PWM(Pin(20)) 5 | 6 | buz.freq(1000) 7 | 8 | buz.duty_u16(32768) 9 | 10 | time.sleep_ms(1000) 11 | 12 | buz.deinit() 13 | 14 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/Neo6502/a422e8fa68a1df47525e26914dfbad24353bec51/SOFTWARE/Memory Emulator/NEO6502 v0.01.uf2 -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/Pico 6502 V3.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Name: Pico_NEO6502 3 | Author: Rien Matthijsse 4 | 5 | Inspired by work http://www.8bitforce.com/blog/2019/03/12/retroshield-6502-operation/ 6 | */ 7 | 8 | #include "pico/stdio.h" 9 | 10 | #include "pico/stdlib.h" 11 | #include "pico/time.h" 12 | 13 | #ifdef OVERCLOCK 14 | #include "hardware/clocks.h" 15 | #include "hardware/vreg.h" 16 | #endif 17 | 18 | #include "mos65C02.h" 19 | #include "memory.h" 20 | #include "m6821.h" 21 | 22 | // Delay startup by so many seconds 23 | #define START_DELAY 0 24 | 25 | // 1-bit (black, white) text mode for PicoDVI. 26 | #include 27 | 28 | // Here's how an 80x30 character display is declared. 29 | DVItext1 display(DVI_RES_640x480p60, pico_neo6502_cfg); 30 | 31 | // 32 | uint32_t clockCount = 0UL; 33 | unsigned long lastClockTS; 34 | boolean statusCursor = true; 35 | 36 | /// 37 | /// performa a action on the display 38 | /// 39 | /// 40 | void setCommand(uint8_t vCmd) { 41 | switch (vCmd) { 42 | case 0x01: // clearscreen 43 | // Serial.println("CLS"); 44 | display.fillScreen(0); 45 | display.setCursor(0, 0); 46 | break; 47 | } 48 | } 49 | 50 | /// 51 | /// 52 | /// 53 | /// 54 | void showCursor(boolean vSet) { 55 | statusCursor = vSet; 56 | } 57 | 58 | /// 59 | /// get current x-pos of cursor 60 | /// 61 | /// 62 | uint8_t getCursorX() { 63 | return display.getCursorX(); 64 | } 65 | 66 | /// 67 | /// get current y-pos of cursor 68 | /// 69 | /// 70 | uint8_t getCursorY() { 71 | return display.getCursorY(); 72 | } 73 | 74 | /// 75 | /// set x-pos of cursor 76 | /// 77 | /// 78 | void setCursorX(uint8_t vX) { 79 | display.setCursor(vX % 80, display.getCursorY()); 80 | } 81 | 82 | /// 83 | /// set y-pos of cursor 84 | /// 85 | /// 86 | void setCursorY(uint8_t vY) { 87 | display.setCursor(display.getCursorX(), vY % 60); 88 | } 89 | 90 | /// 91 | /// 92 | /// 93 | inline __attribute__((always_inline)) 94 | void writeBS() { 95 | display.setCursor(display.getCursorX() - 1, display.getCursorY()); 96 | } 97 | 98 | /// 99 | /// write a char to output DVI output 100 | /// 101 | /// 102 | void writeChar(uint8_t vChar) { 103 | switch (vChar) { 104 | case 0x8D: // CR 105 | case 0x0D: // CR 106 | if (statusCursor) 107 | display.println(" "); 108 | else 109 | display.println(""); 110 | break; 111 | case 0x88: // BS 112 | case 0x08: // BS 113 | display.write(' '); 114 | writeBS(); 115 | if (statusCursor) { 116 | display.write('_'); 117 | writeBS(); 118 | } 119 | break; 120 | default: 121 | display.write(vChar); 122 | if (statusCursor) { 123 | display.write('_'); 124 | writeBS(); 125 | } 126 | } 127 | } 128 | 129 | 130 | //////////////////////////////////////////////////////////////////////////////////////////////////// 131 | /// 132 | /// setup emulator 133 | /// 134 | void setup() { 135 | Serial.begin(115200); 136 | // while (!Serial); 137 | 138 | sleep_ms(2500); 139 | Serial.println("NEO6502 memulator v0.01"); 140 | 141 | if (!display.begin()) { 142 | Serial.println("ERROR: not enough RAM available"); 143 | for (;;); 144 | } 145 | 146 | for (uint8_t i = START_DELAY; i > 0; i--) { 147 | Serial.printf("Starting in %d \n", i); 148 | sleep_ms(1000); 149 | } 150 | Serial.printf("Starting\n"); 151 | 152 | initmemory(); 153 | 154 | init6821(); 155 | 156 | init6502(); 157 | reset6502(); 158 | 159 | // 4 stats 160 | clockCount = 0UL; 161 | lastClockTS = millis(); 162 | 163 | // and we have lift off 164 | display.println("NEO6502 memulator v0.01"); 165 | } 166 | 167 | //////////////////////////////////////////////////////////////////// 168 | // Serial Event 169 | //////////////////////////////////////////////////////////////////// 170 | 171 | /* 172 | SerialEvent occurs whenever a new data comes in the 173 | hardware serial RX. Multiple bytes of data may be available. 174 | */ 175 | inline __attribute__((always_inline)) 176 | void serialEvent1() 177 | { 178 | if (Serial.available()) { 179 | if (Serial.peek() == 0x12) { // ^R 180 | byte ch = Serial.read(); 181 | Serial.println("RESET"); 182 | showCursor(true); 183 | reset6502(); 184 | } 185 | else { 186 | if ((regKBDCR & 0x80) == 0x00) { // read serial byte only if we can set 6821 interrupt 187 | cli(); // stop interrupts while changing 6821 guts. 188 | // 6821 portA is available 189 | byte ch = toupper(Serial.read()); // apple1 expects upper case 190 | regKBD = ch | 0x80; // apple1 expects bit 7 set for incoming characters. 191 | // Serial.printf("Pressed %02x\n", regKBD); 192 | regKBDCR |= 0x80; // set 6821 interrupt 193 | sei(); 194 | } 195 | } 196 | } 197 | return; 198 | } 199 | 200 | 201 | /// 202 | /// 203 | /// 204 | void loop() { 205 | static uint16_t i, j = 1; 206 | 207 | tick6502(0UL); 208 | clockCount++; 209 | 210 | // Flush USB from time to time. 211 | if (j-- == 0) { 212 | gpio_put(25, LOW); 213 | 214 | serialEvent1(); 215 | display.flush(); 216 | 217 | j = 5000; 218 | 219 | gpio_put(25, HIGH); 220 | } 221 | 222 | if (i-- == 0) { 223 | if ((millis() - lastClockTS) >= 5000UL) { 224 | Serial.printf("kHz = %0.1f\n", clockCount / 5000.0); 225 | 226 | clockCount = 0UL; 227 | lastClockTS = millis(); 228 | } 229 | 230 | i = 10000; 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/ewoz.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #include "ewoz.h" 6 | 7 | uint8_t ewoz_bin[] = { 8 | 0x20, 0xfc, 0x60, 0xfd, 0x46, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x58, 0xa2, 0xff, 0x9a, 0xa0, 0x7f, 0x8c, 0x12, 0xd0, 0xa9, 0xa7, 0x8d, 0x11, 0xd0, 0x8d, 10 | 0x13, 0xd0, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 0x50, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 11 | 0x9b, 0xc9, 0x88, 0xf0, 0x13, 0xc9, 0x9b, 0xf0, 0x03, 0xc8, 0x10, 0x19, 0xa9, 0xdc, 0x20, 0x46, 0xfd, 0xa9, 0x8d, 0x20, 0x46, 0xfd, 0xa0, 0x01, 12 | 0x88, 0x30, 0xf6, 0xa9, 0xa0, 0x20, 0x46, 0xfd, 0xa9, 0x88, 0x20, 0x46, 0xfd, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10, 0xd0, 0x99, 0x00, 0x02, 13 | 0x20, 0x46, 0xfd, 0xc9, 0x8d, 0xd0, 0xca, 0xa0, 0xff, 0xa9, 0x00, 0xaa, 0x0a, 0x85, 0x2b, 0xc8, 0xb9, 0x00, 0x02, 0xc9, 0x8d, 0xf0, 0xca, 0xc9, 14 | 0xae, 0x90, 0xf4, 0xf0, 0xf0, 0xc9, 0xba, 0xf0, 0xeb, 0xc9, 0xd2, 0xf0, 0x31, 0xc9, 0xcc, 0xf0, 0x36, 0x86, 0x28, 0x86, 0x29, 0x84, 0x2a, 0xb9, 15 | 0x00, 0x02, 0x49, 0xb0, 0xc9, 0x0a, 0x90, 0x06, 0x69, 0x88, 0xc9, 0xfa, 0x90, 0x11, 0x0a, 0x0a, 0x0a, 0x0a, 0xa2, 0x04, 0x0a, 0x26, 0x28, 0x26, 16 | 0x29, 0xca, 0xd0, 0xf8, 0xc8, 0xd0, 0xe0, 0xc4, 0x2a, 0xd0, 0x12, 0x4c, 0x54, 0xfc, 0x20, 0xd4, 0xfc, 0x4c, 0x47, 0xfc, 0x6c, 0x24, 0x00, 0x20, 17 | 0x69, 0xfd, 0x4c, 0x47, 0xfc, 0x24, 0x2b, 0x50, 0x0d, 0xa5, 0x28, 0x81, 0x26, 0xe6, 0x26, 0xd0, 0x9f, 0xe6, 0x27, 0x4c, 0x88, 0xfc, 0x30, 0x2b, 18 | 0xa2, 0x02, 0xb5, 0x27, 0x95, 0x25, 0x95, 0x23, 0xca, 0xd0, 0xf7, 0xd0, 0x14, 0xa9, 0x8d, 0x20, 0x46, 0xfd, 0xa5, 0x25, 0x20, 0x33, 0xfd, 0xa5, 19 | 0x24, 0x20, 0x33, 0xfd, 0xa9, 0xba, 0x20, 0x46, 0xfd, 0xa9, 0xa0, 0x20, 0x46, 0xfd, 0xa1, 0x24, 0x20, 0x33, 0xfd, 0x86, 0x2b, 0xa5, 0x24, 0xc5, 20 | 0x28, 0xa5, 0x25, 0xe5, 0x29, 0xb0, 0xc4, 0xe6, 0x24, 0xd0, 0x02, 0xe6, 0x25, 0xa5, 0x24, 0x29, 0x0f, 0x10, 0xc8, 0x48, 0x4a, 0x4a, 0x4a, 0x4a, 21 | 0x20, 0x3c, 0xfd, 0x68, 0x29, 0x0f, 0x09, 0xb0, 0xc9, 0xba, 0x90, 0x02, 0x69, 0x06, 0x48, 0x29, 0x7f, 0x2c, 0x12, 0xd0, 0x30, 0xfb, 0x8d, 0x12, 22 | 0xd0, 0x68, 0x60, 0xa0, 0x00, 0xb1, 0x2c, 0xf0, 0x06, 0x20, 0x46, 0xfd, 0xc8, 0xd0, 0xf6, 0x60, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10, 0xd0, 23 | 0x60, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 0x65, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa0, 0x00, 24 | 0x84, 0x30, 0x20, 0x47, 0xfe, 0x99, 0x00, 0x02, 0xc8, 0xc9, 0x1b, 0xf0, 0x67, 0xc9, 0x0d, 0xd0, 0xf1, 0xa0, 0xff, 0xc8, 0xb9, 0x00, 0x02, 0xc9, 25 | 0x3a, 0xd0, 0xf8, 0xc8, 0xa2, 0x00, 0x86, 0x2f, 0x20, 0x24, 0xfe, 0x85, 0x2e, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0x20, 0x24, 0xfe, 0x85, 0x27, 0x18, 26 | 0x65, 0x2f, 0x85, 0x2f, 0x20, 0x24, 0xfe, 0x85, 0x26, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0xa9, 0x2e, 0x20, 0x46, 0xfd, 0x20, 0x24, 0xfe, 0xc9, 0x01, 27 | 0xf0, 0x2a, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0x20, 0x24, 0xfe, 0x81, 0x26, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0xe6, 0x26, 0xd0, 0x02, 0xe6, 0x27, 0xc6, 28 | 0x2e, 0xd0, 0xec, 0x20, 0x24, 0xfe, 0xa0, 0x00, 0x18, 0x65, 0x2f, 0xf0, 0x95, 0xa9, 0x01, 0x85, 0x30, 0x4c, 0x82, 0xfd, 0xa5, 0x30, 0xf0, 0x16, 29 | 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 0x9b, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0x60, 0xa9, 0x0d, 30 | 0x20, 0x46, 0xfd, 0xa9, 0x84, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0x60, 0xb9, 0x00, 0x02, 0x49, 31 | 0x30, 0xc9, 0x0a, 0x90, 0x02, 0x69, 0x08, 0x0a, 0x0a, 0x0a, 0x0a, 0x85, 0x28, 0xc8, 0xb9, 0x00, 0x02, 0x49, 0x30, 0xc9, 0x0a, 0x90, 0x02, 0x69, 32 | 0x08, 0x29, 0x0f, 0x05, 0x28, 0xc8, 0x60, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10, 0xd0, 0x60, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 33 | 0x74, 0x6f, 0x20, 0x45, 0x57, 0x4f, 0x5a, 0x20, 0x31, 0x2e, 0x31, 0x2e, 0x00, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x6c, 34 | 0x20, 0x48, 0x65, 0x78, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x00, 0x49, 0x6e, 0x74, 0x65, 35 | 0x6c, 0x20, 0x48, 0x65, 0x78, 0x20, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x4b, 0x2e, 0x00, 0x49, 0x6e, 0x74, 0x65, 0x6c, 36 | 0x20, 0x48, 0x65, 0x78, 0x20, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 37 | 0x73, 0x75, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x00 }; 38 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/ewoz.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #ifndef _EWOZ_h 6 | #define _EWOZ_h 7 | 8 | #include "arduino.h" 9 | 10 | #define EWOZ_START 0xFC00 11 | #define EWOZ_SIZE 0x02C3 12 | 13 | extern uint8_t ewoz_bin[]; 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/m6821.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #include "m6821.h" 6 | 7 | byte regKBD; 8 | byte regKBDDIR; // Dir register when KBDCR.bit2 == 0 9 | byte regKBDCR; 10 | byte regDSP; 11 | byte regDSPDIR; // Dir register when DSPCR.bit2 == 0 12 | byte regDSPCR; 13 | 14 | 15 | /// 16 | /// 17 | /// 18 | void init6821() 19 | { 20 | regKBD = 0x00; 21 | regKBDDIR = 0x00; 22 | regKBDCR = 0x00; 23 | regDSP = 0x00; 24 | regDSPDIR = 0x00; 25 | regDSPCR = 0x00; 26 | } 27 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/m6821.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #ifndef _M6821_h 6 | #define _M6821_h 7 | 8 | #include "arduino.h" 9 | 10 | //////////////////////////////////////////////////////////////////// 11 | // 6821 Peripheral 12 | // emulate just enough so keyboard/display works thru serial port. 13 | //////////////////////////////////////////////////////////////////// 14 | // 15 | 16 | #define KBD 0xd010 17 | #define KBDCR 0xd011 18 | #define DSP 0xd012 19 | #define DSPCR 0xd013 20 | 21 | extern byte regKBD; 22 | extern byte regKBDDIR; // Dir register when KBDCR.bit2 == 0 23 | extern byte regKBDCR; 24 | extern byte regDSP; 25 | extern byte regDSPDIR; // Dir register when DSPCR.bit2 == 0 26 | extern byte regDSPCR; 27 | 28 | extern void init6821(); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/memory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | #include "memory.h" 5 | #include "m6821.h" 6 | 7 | #include "ewoz.h" 8 | #include "mon_ext.h" 9 | #include "msbasic.h" 10 | 11 | extern void writeChar(uint8_t); 12 | extern void setCommand(uint8_t); 13 | extern void showCursor(boolean); 14 | extern uint8_t getCursorX(); 15 | extern uint8_t getCursorY(); 16 | extern void setCursorX(uint8_t); 17 | extern void setCursorY(uint8_t); 18 | 19 | /// 20 | /// 64k RAM 21 | /// 22 | uint8_t mem[MEMORY_SIZE]; 23 | 24 | // address and data registers 25 | uint16_t address; 26 | uint8_t data; 27 | 28 | /// 29 | /// initialise memory 30 | /// 31 | void initmemory() { 32 | address = 0UL; 33 | data = 0; 34 | 35 | // lets install some ROMS 36 | 37 | // copy ewoz monitor ROM into RAM 38 | for (uint16_t i = 0; i < EWOZ_SIZE; i++) { 39 | mem[EWOZ_START + i] = ewoz_bin[i]; 40 | } 41 | 42 | // overrule reset vector 43 | mem[0xFFFC] = 0x20; // ewoz 44 | mem[0xFFFD] = 0xFC; // ewoz 45 | 46 | // copy monitor ext ROM into RAM 47 | for (uint16_t i = 0; i < MON_EXT_SIZE; i++) { 48 | mem[MON_EXT_START + i] = mon_ext_bin[i]; 49 | } 50 | 51 | // copy msbasic ROM into RAM 52 | for (uint16_t i = 0; i < MSBASIC_SIZE; i++) { 53 | mem[MSBASIC_START + i] = msbasic_bin[i]; 54 | } 55 | } 56 | 57 | /// 58 | /// read a byte from memory 59 | /// 60 | /// 61 | /// 62 | /// 63 | void readmemory() { 64 | // 6821? 65 | if (KBD <= address && address <= DSPCR) { 66 | // KBD? 67 | if (address == KBD) { 68 | if (regKBDCR & 0x02) { 69 | // KBD register 70 | data = regKBD; 71 | regKBDCR &= 0x7F; // clear IRQA bit upon read 72 | } 73 | else 74 | data = regKBDDIR; 75 | } 76 | else 77 | // KBDCR? 78 | if (address == KBDCR) { 79 | // KBDCR register 80 | data = regKBDCR; 81 | } 82 | else 83 | // DSP? 84 | if (address == DSP) { 85 | if (regDSPCR & 0x02) { 86 | // DSP register 87 | data = regDSP; 88 | regDSPCR &= 0x7F; // clear IRQA bit upon read 89 | } 90 | else 91 | data = regDSPDIR; 92 | } 93 | else 94 | // DSPCR? 95 | if (address == DSPCR) { 96 | // DSPCR register 97 | data = regDSPCR; 98 | } 99 | } 100 | else if (0xD020 <= address && address < 0xD030) { 101 | switch (address) { 102 | case 0XD020: 103 | data = 0x00; 104 | break; 105 | case 0xD021: 106 | data = getCursorX(); 107 | break; 108 | case 0xD022: 109 | data = getCursorY(); 110 | break; 111 | default: 112 | data = 0x00; 113 | } 114 | } 115 | else 116 | data = mem[address]; 117 | } 118 | 119 | /// 120 | /// store a byte into memory 121 | /// 122 | /// 123 | /// 124 | void writememory() { 125 | // 6821? 126 | if (KBD <= address && address <= DSPCR) { 127 | // KBD? 128 | if (address == KBD) { 129 | if (regKBDCR & 0x02) { 130 | // KBD register 131 | regKBD = data; 132 | } 133 | else 134 | regKBDDIR = data; 135 | } 136 | else 137 | // KBDCR? 138 | if (address == KBDCR) { 139 | // KBDCR register 140 | regKBDCR = data & 0X7F; 141 | } 142 | else 143 | // DSP? 144 | if (address == DSP) { 145 | if (regDSPCR & 0x02) { 146 | // DSP register 147 | writeChar(regDSP = (data & 0x7F)); 148 | } 149 | else 150 | regDSPDIR = data; 151 | } 152 | else 153 | // DSPCR? 154 | if (address == DSPCR) { 155 | // DSPCR register 156 | regDSPCR = data; 157 | } 158 | } 159 | else if (0xD020 <= address && address < 0xD030) { 160 | switch (address) { 161 | case 0XD020: 162 | setCommand(data); 163 | break; 164 | case 0xD021: 165 | setCursorX(data); 166 | break; 167 | case 0xD022: 168 | setCursorY(data); 169 | break; 170 | case 0xD02F: 171 | showCursor(data); 172 | } 173 | } 174 | else 175 | mem[address] = data; 176 | } 177 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/memory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #ifndef _MEMORY_h 6 | #define _MEMORY_h 7 | 8 | #include "arduino.h" 9 | 10 | #define MEMORY_SIZE 0x10000 // 64k 11 | 12 | extern uint8_t mem[]; 13 | extern uint16_t address; 14 | extern uint8_t data; 15 | 16 | //externally supplied functions 17 | void initmemory(); 18 | 19 | void readmemory(); 20 | 21 | void writememory(); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/mon_ext.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #include "mon_ext.h" 6 | 7 | uint8_t mon_ext_bin[] = { 8 | 0xa9, 0x14, 0x48, 0x20, 0x73, 0xf1, 0x20, 0x37, 0xf2, 0x85, 0x0a, 0x84, 0x0b, 0x68, 0x38, 0xe9, 0x01, 0xd0, 0xef, 0x20, 0xfe, 0xf1, 0x8a, 0xd0, 9 | 0x03, 0x4c, 0x54, 0xfc, 0xa0, 0x00, 0x20, 0x46, 0xf2, 0x48, 0x8a, 0xf0, 0x07, 0xb5, 0x0c, 0x95, 0x0a, 0xca, 0x10, 0xf9, 0x68, 0xc9, 0x05, 0xf0, 10 | 0xcf, 0xc9, 0x99, 0xf0, 0x04, 0xc9, 0x93, 0xd0, 0x76, 0xa9, 0x03, 0x85, 0x0d, 0x20, 0x26, 0xf2, 0x0a, 0xe9, 0xbe, 0xc9, 0xc2, 0x90, 0x68, 0x0a, 11 | 0x0a, 0xa2, 0x04, 0x0a, 0x26, 0x12, 0x26, 0x13, 0xca, 0x10, 0xf8, 0xc6, 0x0d, 0xf0, 0xf4, 0x10, 0xe4, 0xa2, 0x05, 0x20, 0x26, 0xf2, 0x84, 0x1a, 12 | 0xdd, 0xc6, 0xf2, 0xd0, 0x13, 0x20, 0x26, 0xf2, 0xdd, 0xcc, 0xf2, 0xf0, 0x0d, 0xbd, 0xcc, 0xf2, 0xf0, 0x07, 0xc9, 0xa4, 0xf0, 0x03, 0xa4, 0x1a, 13 | 0x18, 0x88, 0x26, 0x07, 0xe0, 0x03, 0xd0, 0x0d, 0x20, 0x46, 0xf2, 0xa5, 0x0f, 0xf0, 0x01, 0xe8, 0x86, 0x18, 0xa2, 0x03, 0x88, 0x86, 0x0d, 0xca, 14 | 0x10, 0xc9, 0xa5, 0x07, 0x0a, 0x0a, 0x05, 0x18, 0xc9, 0x20, 0xb0, 0x06, 0xa6, 0x18, 0xf0, 0x02, 0x09, 0x80, 0x85, 0x07, 0x84, 0x1a, 0xb9, 0x00, 15 | 0x02, 0xc9, 0xbb, 0xf0, 0x04, 0xc9, 0x8d, 0xd0, 0x2c, 0xa5, 0x0d, 0x20, 0x2d, 0xf1, 0xaa, 0xbd, 0x12, 0xf3, 0xc5, 0x12, 0xd0, 0x13, 0xbd, 0xd2, 16 | 0xf2, 0xc5, 0x13, 0xd0, 0x0c, 0xa5, 0x07, 0xa4, 0x05, 0xc0, 0x9d, 0xf0, 0x20, 0xc5, 0x05, 0xf0, 0x37, 0xc6, 0x0d, 0xd0, 0xdc, 0xe6, 0x07, 0xc6, 17 | 0x18, 0xf0, 0xd6, 0xa4, 0x1a, 0x98, 0xaa, 0x20, 0x32, 0xf2, 0x20, 0x1d, 0xf2, 0xa9, 0xde, 0x20, 0x46, 0xfd, 0x4c, 0x13, 0xf0, 0xe9, 0x81, 0x4a, 18 | 0xd0, 0xe9, 0xa4, 0x0f, 0xa6, 0x0e, 0xd0, 0x01, 0x88, 0xca, 0x8a, 0x18, 0xe5, 0x0a, 0x85, 0x0e, 0x10, 0x01, 0xc8, 0x98, 0xe5, 0x0b, 0xd0, 0xd3, 19 | 0xa4, 0x06, 0xb9, 0x0d, 0x00, 0x91, 0x0a, 0x88, 0x10, 0xf8, 0xa9, 0x01, 0x4c, 0x02, 0xf0, 0xa6, 0x0a, 0xa4, 0x0b, 0x20, 0x32, 0xf2, 0x20, 0xe3, 20 | 0xf1, 0xa0, 0x00, 0xa9, 0xad, 0x20, 0x46, 0xfd, 0x20, 0x1b, 0xf2, 0xa1, 0x0a, 0xa8, 0x4a, 0x90, 0x0b, 0x4a, 0x09, 0x80, 0xb0, 0x15, 0xc9, 0xa2, 21 | 0xf0, 0x11, 0x29, 0x87, 0x4a, 0xaa, 0xbd, 0x74, 0xf2, 0x90, 0x04, 0x4a, 0x4a, 0x4a, 0x4a, 0x29, 0x0f, 0xd0, 0x04, 0xa0, 0x80, 0xa9, 0x00, 0xaa, 22 | 0xbd, 0xb8, 0xf2, 0x85, 0x05, 0x29, 0x03, 0x85, 0x06, 0x98, 0x29, 0x8f, 0xaa, 0x98, 0xa0, 0x03, 0xe0, 0x8a, 0xf0, 0x0b, 0x4a, 0x90, 0x08, 0x4a, 23 | 0x4a, 0x09, 0x20, 0x88, 0xd0, 0xfa, 0xc8, 0x88, 0xd0, 0xf2, 0x60, 0x20, 0x17, 0xf1, 0x48, 0xb1, 0x0a, 0x20, 0x33, 0xfd, 0xa2, 0x01, 0x20, 0x1d, 24 | 0xf2, 0xc4, 0x06, 0xc8, 0x90, 0xf1, 0xa2, 0x03, 0xc0, 0x04, 0x90, 0xf2, 0x68, 0xa8, 0xb9, 0xd2, 0xf2, 0x85, 0x08, 0xb9, 0x12, 0xf3, 0x85, 0x09, 25 | 0xa9, 0x00, 0xa0, 0x05, 0x06, 0x09, 0x26, 0x08, 0x2a, 0x88, 0xd0, 0xf8, 0x69, 0xbf, 0x20, 0x46, 0xfd, 0xca, 0xd0, 0xec, 0x20, 0x1b, 0xf2, 0xa4, 26 | 0x06, 0xa2, 0x06, 0xe0, 0x03, 0xf0, 0x1c, 0x06, 0x05, 0x90, 0x0e, 0xbd, 0xc5, 0xf2, 0x20, 0x46, 0xfd, 0xbd, 0xcb, 0xf2, 0xf0, 0x03, 0x20, 0x46, 27 | 0xfd, 0xca, 0xd0, 0xe7, 0x60, 0x88, 0x30, 0xe7, 0x20, 0x33, 0xfd, 0xa5, 0x05, 0xc9, 0xe8, 0xb1, 0x0a, 0x90, 0xf2, 0x20, 0x3a, 0xf2, 0xaa, 0xe8, 28 | 0xd0, 0x01, 0xc8, 0x98, 0x20, 0x33, 0xfd, 0x8a, 0x4c, 0x33, 0xfd, 0xc9, 0x9b, 0xf0, 0x0a, 0x20, 0x46, 0xfd, 0xc9, 0xdf, 0xf0, 0x12, 0xe8, 0x10, 29 | 0x12, 0xa9, 0xdc, 0x20, 0x46, 0xfd, 0x20, 0x32, 0xf2, 0xa9, 0xa1, 0x20, 0x46, 0xfd, 0xa2, 0x01, 0xca, 0x30, 0xee, 0x2c, 0x11, 0xd0, 0x10, 0xfb, 30 | 0xad, 0x10, 0xd0, 0x9d, 0x00, 0x02, 0xc9, 0x8d, 0xd0, 0xd1, 0x60, 0xa2, 0x03, 0xa9, 0xa0, 0x20, 0x46, 0xfd, 0xca, 0xd0, 0xf8, 0x60, 0xb9, 0x00, 31 | 0x02, 0xc8, 0xc9, 0xa0, 0xf0, 0xf8, 0x60, 0x4c, 0x13, 0xf0, 0xa9, 0x8d, 0x4c, 0x46, 0xfd, 0x38, 0xa5, 0x06, 0xa4, 0x0b, 0xaa, 0x10, 0x01, 0x88, 32 | 0x65, 0x0a, 0x90, 0x01, 0xc8, 0x60, 0xa2, 0x00, 0x86, 0x0e, 0x86, 0x0f, 0xf0, 0x15, 0xa2, 0x03, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x26, 0x0e, 0x26, 33 | 0x0f, 0xca, 0x10, 0xf8, 0xb5, 0x0f, 0x95, 0x0d, 0xe8, 0xf0, 0xf9, 0xb9, 0x00, 0x02, 0xc8, 0x49, 0xb0, 0xc9, 0x0a, 0x90, 0xe1, 0x69, 0x88, 0xc9, 34 | 0xfa, 0xb0, 0xdb, 0x60, 0x04, 0x20, 0x54, 0x30, 0x0d, 0x80, 0x04, 0x90, 0x03, 0x22, 0x54, 0x33, 0x0d, 0x80, 0x04, 0x90, 0x04, 0x20, 0x54, 0x33, 35 | 0x0d, 0x80, 0x04, 0x90, 0x04, 0x20, 0x54, 0x3b, 0x0d, 0x80, 0x04, 0x90, 0x00, 0x22, 0x44, 0x33, 0x0d, 0xc8, 0x44, 0x00, 0x11, 0x22, 0x44, 0x33, 36 | 0x0d, 0xc8, 0x44, 0xa9, 0x01, 0x22, 0x44, 0x33, 0x0d, 0x80, 0x04, 0x90, 0x01, 0x22, 0x44, 0x33, 0x0d, 0x80, 0x04, 0x90, 0x26, 0x31, 0x87, 0x9a, 37 | 0x00, 0x21, 0x81, 0x82, 0x00, 0x00, 0x59, 0x4d, 0x91, 0x92, 0x86, 0x4a, 0x85, 0x9d, 0xac, 0xa9, 0xac, 0xa3, 0xa8, 0xa4, 0xd9, 0x00, 0xd8, 0xa4, 38 | 0xa4, 0x00, 0x1c, 0x8a, 0x1c, 0x23, 0x5d, 0x8b, 0x1b, 0xa1, 0x9d, 0x8a, 0x1d, 0x23, 0x9d, 0x8b, 0x1d, 0xa1, 0x00, 0x29, 0x19, 0xae, 0x69, 0xa8, 39 | 0x19, 0x23, 0x24, 0x53, 0x1b, 0x23, 0x24, 0x53, 0x19, 0xa1, 0x00, 0x1a, 0x5b, 0x5b, 0xa5, 0x69, 0x24, 0x24, 0xae, 0xae, 0xa8, 0xad, 0x29, 0x00, 40 | 0x7c, 0x00, 0x15, 0x9c, 0x6d, 0x9c, 0xa5, 0x69, 0x29, 0x53, 0x84, 0x13, 0x34, 0x11, 0xa5, 0x69, 0x23, 0xa0, 0xd8, 0x62, 0x5a, 0x48, 0x26, 0x62, 41 | 0x94, 0x88, 0x54, 0x44, 0xc8, 0x54, 0x68, 0x44, 0xe8, 0x94, 0x00, 0xb4, 0x08, 0x84, 0x74, 0xb4, 0x28, 0x6e, 0x74, 0xf4, 0xcc, 0x4a, 0x72, 0xf2, 42 | 0xa4, 0x8a, 0x00, 0xaa, 0xa2, 0xa2, 0x74, 0x74, 0x74, 0x72, 0x44, 0x68, 0xb2, 0x32, 0xb2, 0x00, 0x22, 0x00, 0x1a, 0x1a, 0x26, 0x26, 0x72, 0x72, 43 | 0x88, 0xc8, 0xc4, 0xca, 0x26, 0x48, 0x44, 0x44, 0xa2, 0xc8}; 44 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/mon_ext.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #ifndef _MON_EXT_h 6 | #define _MON_EXT_h 7 | 8 | #include "arduino.h" 9 | 10 | #define MON_EXT_START 0xF000 11 | #define MON_EXT_SIZE 0x0352 12 | 13 | extern uint8_t mon_ext_bin[]; 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/mos65C02.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | #include "mos65C02.h" 5 | 6 | #define DELAY_FACTOR_SHORT() asm volatile("nop\nnop\nnop\nnop\nnop\n"); 7 | #define DELAY_FACTOR_LONG() asm volatile("nop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\n"); 8 | 9 | // # of clock cycles to keep rest pin low 10 | #define RESET_COUNT 4 11 | 12 | // mask used for the mux address/data bus: GP0-7 13 | constexpr uint32_t BUS_MASK = 0xFF; 14 | 15 | // 16 | uint8_t resetCount; 17 | boolean inReset = false; 18 | uint8_t dataDir = 2; 19 | 20 | /// 21 | /// drive the clockpin 22 | /// 23 | /// 24 | inline __attribute__((always_inline)) 25 | void setClock(boolean clock) { 26 | gpio_put(uP_CLOCK, clock); 27 | } 28 | 29 | /// 30 | /// drive the reset pin 31 | /// 32 | /// 33 | inline __attribute__((always_inline)) 34 | void setReset(boolean reset) { 35 | gpio_put(uP_RESET, reset); 36 | } 37 | 38 | /// 39 | /// drive the enable pins 40 | /// 41 | /// 42 | inline __attribute__((always_inline)) 43 | void setEnable(uint32_t enable) { 44 | gpio_put_masked(en_MASK, enable); 45 | } 46 | 47 | /// 48 | /// set direction of databus mux 49 | /// 50 | /// 51 | inline __attribute__((always_inline)) 52 | void setDir(uint8_t direction) { 53 | if (direction != dataDir) { 54 | switch (direction) { 55 | case OUTPUT: gpio_set_dir_masked(BUS_MASK, BUS_MASK); 56 | break; 57 | case INPUT: gpio_set_dir_masked(BUS_MASK, (uint32_t)0UL); 58 | break; 59 | } 60 | 61 | dataDir = direction; 62 | } 63 | } 64 | 65 | /// 66 | /// read the R/W pin 67 | /// 68 | /// 69 | inline __attribute__((always_inline)) 70 | bool getRW() { 71 | return gpio_get(uP_RW); 72 | } 73 | 74 | /// 75 | /// read the address bus 76 | /// 77 | /// 78 | inline __attribute__((always_inline)) 79 | uint16_t getAddress() { 80 | // we are already in INPUT 81 | //setDir(INPUT); 82 | 83 | // read A0-7 84 | setEnable(en_A0_7); 85 | DELAY_FACTOR_SHORT(); 86 | uint16_t addr = gpio_get_all() & BUS_MASK; 87 | 88 | // read A8-15 89 | setEnable(en_A8_15); 90 | DELAY_FACTOR_SHORT(); 91 | addr |= (gpio_get_all() & BUS_MASK) << 8; 92 | 93 | return addr; 94 | } 95 | 96 | /// 97 | /// read the databus 98 | /// 99 | /// 100 | inline __attribute__((always_inline)) 101 | uint8_t getData() { 102 | // we are already in INPUT 103 | //setDir(INPUT); 104 | 105 | setEnable(en_D0_7); 106 | DELAY_FACTOR_SHORT(); 107 | uint8_t data = gpio_get_all() & BUS_MASK; 108 | 109 | return data; 110 | } 111 | 112 | /// 113 | /// write the databus 114 | /// 115 | /// 116 | inline __attribute__((always_inline)) 117 | void putData(uint8_t data) { 118 | 119 | setDir(OUTPUT); 120 | setEnable(en_D0_7); 121 | gpio_put_masked(BUS_MASK, (uint32_t)data); 122 | } 123 | 124 | /// 125 | /// initialise the 65C02 126 | /// 127 | void init6502() { 128 | // CLOCK 129 | pinMode(uP_CLOCK, OUTPUT); 130 | setClock(CLOCK_HIGH); 131 | 132 | // RESET 133 | pinMode(uP_RESET, OUTPUT); 134 | setReset(RESET_HIGH); 135 | 136 | // RW 137 | pinMode(uP_RW, INPUT_PULLUP); 138 | 139 | // BUS ENABLE 140 | gpio_init_mask(en_MASK); 141 | gpio_set_dir_out_masked(en_MASK); // enable as output 142 | setEnable(en_NONE); // all high 143 | 144 | // ADDRESS 145 | // DATA 146 | gpio_init_mask(BUS_MASK); 147 | setDir(INPUT); 148 | } 149 | 150 | /// 151 | /// reset the 65C02 152 | /// 153 | void reset6502() { 154 | setReset(RESET_LOW); 155 | 156 | resetCount = RESET_COUNT; 157 | inReset = true; 158 | } 159 | 160 | /// 161 | /// clock cycle 65C02 162 | /// 163 | //inline __attribute__((always_inline)) 164 | void tick6502(uint32_t delay) 165 | { 166 | setEnable(en_NONE); // all high 167 | 168 | //------------------------------------------------------------------------------------ 169 | setClock(CLOCK_LOW); 170 | // set INPUT 171 | setDir(INPUT); 172 | 173 | DELAY_FACTOR_LONG(); 174 | //#if CPU_DEBUG 175 | // delayMicroseconds(delay); 176 | //#endif 177 | 178 | //------------------------------------------------------------------------------------ 179 | setClock(CLOCK_HIGH); 180 | 181 | DELAY_FACTOR_SHORT(); 182 | 183 | address = getAddress(); 184 | 185 | // do RW action 186 | switch (getRW()) { 187 | case RW_READ: 188 | readmemory(); // data = @address 189 | putData(data); 190 | // Serial.printf("R %04X %02X\n", address, data); 191 | break; 192 | 193 | case RW_WRITE: 194 | data = getData(); 195 | writememory(); // @address = data 196 | // Serial.printf("W %04X %02X\n", address, data); 197 | break; 198 | } 199 | 200 | // reset mgmt 201 | if (inReset) { 202 | if (resetCount-- == 0) { 203 | // end of reset 204 | setReset(RESET_HIGH); 205 | inReset = false; 206 | // Serial.printf("RESET release\n"); 207 | } 208 | } 209 | } 210 | 211 | #ifdef TEST_MODE 212 | /// 213 | /// 214 | /// 215 | void test6502() { 216 | uint32_t dly = 50; 217 | 218 | Serial.println("begin"); 219 | 220 | Serial.println("RESET"); 221 | setReset(RESET_LOW); 222 | delay(dly); 223 | setReset(RESET_HIGH); 224 | 225 | Serial.println("ENABLE 1"); 226 | setEnable(en_A0_7); 227 | delay(dly); 228 | // setEnable(en_NONE); 229 | 230 | Serial.println("ENABLE 2"); 231 | setEnable(en_A8_15); 232 | delay(dly); 233 | // setEnable(en_NONE); 234 | 235 | Serial.println("ENABLE 3"); 236 | setEnable(en_D0_7); 237 | delay(dly); 238 | // setEnable(en_NONE); 239 | 240 | Serial.println("CLOCK"); 241 | setClock(CLOCK_LOW); 242 | delay(dly); 243 | setClock(CLOCK_HIGH); 244 | 245 | Serial.println("end"); 246 | } 247 | #endif 248 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/mos65C02.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #ifndef _MOS65C02_h 6 | #define _MOS65C02_h 7 | 8 | #include "arduino.h" 9 | #include "pins.h" 10 | #include "memory.h" 11 | 12 | //#define TEST_MODE 13 | 14 | #define CPU_DEBUG 1 15 | 16 | 17 | #define RESET_LOW false 18 | #define RESET_HIGH true 19 | 20 | #define ENABLE_LOW false 21 | #define ENABLE_HIGH true 22 | 23 | #define CLOCK_LOW false 24 | #define CLOCK_HIGH true 25 | 26 | #define RW_READ true 27 | #define RW_WRITE false 28 | 29 | void init6502(); 30 | void reset6502(); 31 | void tick6502(uint32_t); 32 | #ifdef TEST_MODE 33 | void test6502(); 34 | #endif 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/msbasic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Rien Matthijsse 3 | // 4 | 5 | #ifndef _MSBASIC_h 6 | #define _MSBASIC_h 7 | 8 | #include "arduino.h" 9 | 10 | #define MSBASIC_START 0xA000 11 | #define MSBASIC_SIZE 0x1ED8 12 | 13 | extern uint8_t msbasic_bin[]; 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/NEO6502 v0.01/pins.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // 3 | // Author: Rien Matthijsse 4 | // 5 | #define NEO6502 6 | 7 | // 65c02 connections 8 | // 9 | #ifdef NEO6502 10 | // NEO6502 board v1.0 11 | #define uP_RESET 26 // RESB(40) <-- UEXT pin 9 12 | #define uP_CLOCK 21 // PHI2 13 | #define uP_RW 11 // RW# 14 | 15 | #define uP_BUZZ 20 16 | 17 | /* 18 | BUS: 19 | 0 - 7 20 | HDMI: pico_neo6502_cfg 21 | 15 - 18 27 - 30 22 | */ 23 | #else 24 | // Rien's BB setup 25 | #define uP_RESET 28 // RESB 26 | #define uP_CLOCK 27 // PHI2 27 | #define uP_RW 26 // RW# 28 | 29 | /* 30 | BUS: 31 | 0 - 7 32 | HDMI: pico_sock_cfg 33 | 12 - 19 34 | */ 35 | #endif 36 | 37 | // mux bus enable pins 38 | // 2 1 0 39 | // 21098765432109876543210 40 | #ifdef NEO6502 41 | // 8 - 10 42 | constexpr uint32_t en_MASK = 0b00000000000011100000000; 43 | constexpr uint32_t en_NONE = 0b00000000000011100000000; 44 | constexpr uint32_t en_A0_7 = 0b00000000000011000000000; 45 | constexpr uint32_t en_A8_15 = 0b00000000000010100000000; 46 | constexpr uint32_t en_D0_7 = 0b00000000000001100000000; 47 | #else 48 | // 20 - 22 49 | constexpr uint32_t en_MASK = 0b11100000000000000000000; 50 | constexpr uint32_t en_NONE = 0b11100000000000000000000; 51 | constexpr uint32_t en_A0_7 = 0b01100000000000000000000; 52 | constexpr uint32_t en_A8_15 = 0b10100000000000000000000; 53 | constexpr uint32_t en_D0_7 = 0b11000000000000000000000; 54 | #endif 55 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/ewoz_v2/Makefile: -------------------------------------------------------------------------------- 1 | all: ewoz.mon 2 | 3 | ewoz.mon: ewoz.bin 4 | bintoc -3 -b 24 -v `./getaddress` ewoz.bin >ewoz.mon 5 | 6 | ewoz.bin: ewoz.o 7 | ld65 -C /usr/local/share/cc65/cfg/none.cfg -vm -m ewoz.map -o ewoz.bin ewoz.o 8 | 9 | ewoz.o: ewoz.s 10 | ca65 -g -l ewoz.lst ewoz.s 11 | 12 | clean: 13 | $(RM) *.o *.lst *.map *.bin 14 | 15 | distclean: clean 16 | $(RM) *.mon 17 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/ewoz_v2/ewoz.mon: -------------------------------------------------------------------------------- 1 | uint8_t ewoz.bin[] = { 2 | 0x20, 0xfc, 0x60, 0xfd, 0x46, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x58, 0xa2, 0xff, 0x9a, 0xa0, 0x7f, 0x8c, 0x12, 0xd0, 0xa9, 0xa7, 0x8d, 0x11, 0xd0, 0x8d, 4 | 0x13, 0xd0, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 0x50, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 5 | 0x9b, 0xc9, 0x88, 0xf0, 0x13, 0xc9, 0x9b, 0xf0, 0x03, 0xc8, 0x10, 0x19, 0xa9, 0xdc, 0x20, 0x46, 0xfd, 0xa9, 0x8d, 0x20, 0x46, 0xfd, 0xa0, 0x01, 6 | 0x88, 0x30, 0xf6, 0xa9, 0xa0, 0x20, 0x46, 0xfd, 0xa9, 0x88, 0x20, 0x46, 0xfd, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10, 0xd0, 0x99, 0x00, 0x02, 7 | 0x20, 0x46, 0xfd, 0xc9, 0x8d, 0xd0, 0xca, 0xa0, 0xff, 0xa9, 0x00, 0xaa, 0x0a, 0x85, 0x2b, 0xc8, 0xb9, 0x00, 0x02, 0xc9, 0x8d, 0xf0, 0xca, 0xc9, 8 | 0xae, 0x90, 0xf4, 0xf0, 0xf0, 0xc9, 0xba, 0xf0, 0xeb, 0xc9, 0xd2, 0xf0, 0x31, 0xc9, 0xcc, 0xf0, 0x36, 0x86, 0x28, 0x86, 0x29, 0x84, 0x2a, 0xb9, 9 | 0x00, 0x02, 0x49, 0xb0, 0xc9, 0x0a, 0x90, 0x06, 0x69, 0x88, 0xc9, 0xfa, 0x90, 0x11, 0x0a, 0x0a, 0x0a, 0x0a, 0xa2, 0x04, 0x0a, 0x26, 0x28, 0x26, 10 | 0x29, 0xca, 0xd0, 0xf8, 0xc8, 0xd0, 0xe0, 0xc4, 0x2a, 0xd0, 0x12, 0x4c, 0x54, 0xfc, 0x20, 0xd4, 0xfc, 0x4c, 0x47, 0xfc, 0x6c, 0x24, 0x00, 0x20, 11 | 0x69, 0xfd, 0x4c, 0x47, 0xfc, 0x24, 0x2b, 0x50, 0x0d, 0xa5, 0x28, 0x81, 0x26, 0xe6, 0x26, 0xd0, 0x9f, 0xe6, 0x27, 0x4c, 0x88, 0xfc, 0x30, 0x2b, 12 | 0xa2, 0x02, 0xb5, 0x27, 0x95, 0x25, 0x95, 0x23, 0xca, 0xd0, 0xf7, 0xd0, 0x14, 0xa9, 0x8d, 0x20, 0x46, 0xfd, 0xa5, 0x25, 0x20, 0x33, 0xfd, 0xa5, 13 | 0x24, 0x20, 0x33, 0xfd, 0xa9, 0xba, 0x20, 0x46, 0xfd, 0xa9, 0xa0, 0x20, 0x46, 0xfd, 0xa1, 0x24, 0x20, 0x33, 0xfd, 0x86, 0x2b, 0xa5, 0x24, 0xc5, 14 | 0x28, 0xa5, 0x25, 0xe5, 0x29, 0xb0, 0xc4, 0xe6, 0x24, 0xd0, 0x02, 0xe6, 0x25, 0xa5, 0x24, 0x29, 0x0f, 0x10, 0xc8, 0x48, 0x4a, 0x4a, 0x4a, 0x4a, 15 | 0x20, 0x3c, 0xfd, 0x68, 0x29, 0x0f, 0x09, 0xb0, 0xc9, 0xba, 0x90, 0x02, 0x69, 0x06, 0x48, 0x29, 0x7f, 0x2c, 0x12, 0xd0, 0x30, 0xfb, 0x8d, 0x12, 16 | 0xd0, 0x68, 0x60, 0xa0, 0x00, 0xb1, 0x2c, 0xf0, 0x06, 0x20, 0x46, 0xfd, 0xc8, 0xd0, 0xf6, 0x60, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10, 0xd0, 17 | 0x60, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 0x65, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa0, 0x00, 18 | 0x84, 0x30, 0x20, 0x47, 0xfe, 0x99, 0x00, 0x02, 0xc8, 0xc9, 0x1b, 0xf0, 0x67, 0xc9, 0x0d, 0xd0, 0xf1, 0xa0, 0xff, 0xc8, 0xb9, 0x00, 0x02, 0xc9, 19 | 0x3a, 0xd0, 0xf8, 0xc8, 0xa2, 0x00, 0x86, 0x2f, 0x20, 0x24, 0xfe, 0x85, 0x2e, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0x20, 0x24, 0xfe, 0x85, 0x27, 0x18, 20 | 0x65, 0x2f, 0x85, 0x2f, 0x20, 0x24, 0xfe, 0x85, 0x26, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0xa9, 0x2e, 0x20, 0x46, 0xfd, 0x20, 0x24, 0xfe, 0xc9, 0x01, 21 | 0xf0, 0x2a, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0x20, 0x24, 0xfe, 0x81, 0x26, 0x18, 0x65, 0x2f, 0x85, 0x2f, 0xe6, 0x26, 0xd0, 0x02, 0xe6, 0x27, 0xc6, 22 | 0x2e, 0xd0, 0xec, 0x20, 0x24, 0xfe, 0xa0, 0x00, 0x18, 0x65, 0x2f, 0xf0, 0x95, 0xa9, 0x01, 0x85, 0x30, 0x4c, 0x82, 0xfd, 0xa5, 0x30, 0xf0, 0x16, 23 | 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0xa9, 0x9b, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0x60, 0xa9, 0x0d, 24 | 0x20, 0x46, 0xfd, 0xa9, 0x84, 0x85, 0x2c, 0xa9, 0xfe, 0x85, 0x2d, 0x20, 0x53, 0xfd, 0xa9, 0x0d, 0x20, 0x46, 0xfd, 0x60, 0xb9, 0x00, 0x02, 0x49, 25 | 0x30, 0xc9, 0x0a, 0x90, 0x02, 0x69, 0x08, 0x0a, 0x0a, 0x0a, 0x0a, 0x85, 0x28, 0xc8, 0xb9, 0x00, 0x02, 0x49, 0x30, 0xc9, 0x0a, 0x90, 0x02, 0x69, 26 | 0x08, 0x29, 0x0f, 0x05, 0x28, 0xc8, 0x60, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10, 0xd0, 0x60, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 27 | 0x74, 0x6f, 0x20, 0x45, 0x57, 0x4f, 0x5a, 0x20, 0x31, 0x2e, 0x31, 0x2e, 0x00, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x6c, 28 | 0x20, 0x48, 0x65, 0x78, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x00, 0x49, 0x6e, 0x74, 0x65, 29 | 0x6c, 0x20, 0x48, 0x65, 0x78, 0x20, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x4b, 0x2e, 0x00, 0x49, 0x6e, 0x74, 0x65, 0x6c, 30 | 0x20, 0x48, 0x65, 0x78, 0x20, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 31 | 0x73, 0x75, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x00}; 32 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/ewoz_v2/getaddress: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Get load and run addresses from map file and output in hex in format 4 | # to be used as arguments to the bintomon program. 5 | 6 | L=`grep "RESET " ewoz.map | head -1 | awk '{ print $2 }'` 7 | R=`grep "RESET " ewoz.map | head -1 | awk '{ print $2 }'` 8 | echo "-l 0x$L -r 0x$R" 9 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/Makefile: -------------------------------------------------------------------------------- 1 | all: default 2 | 3 | default: 4 | cd msbasic ; ./make.sh 5 | 6 | clean: 7 | $(RM) -rf msbasic/msbasic.lst msbasic/tmp 8 | 9 | distclean: clean 10 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/CFFA1_API.s: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ; CFFA1_API.s Version 1.0 - 05/22/2007 3 | ; 4 | ; Equates for calling the CFFA1 API -- Firmware version 1.0 ($01) 5 | ;------------------------------------------------------------------------------ 6 | 7 | CFFA1_ID1 = $AFDC ; contains $CF when CFFA1 card is present 8 | CFFA1_ID2 = $AFDD ; contains $FA when CFFA1 card is present 9 | 10 | FirmwareVersion = $01 11 | 12 | ;------------------------------------------------------------------------------ 13 | ; Entry points to the CFFA1 firmware: 14 | ; 15 | ; MenuExitToMonitor 16 | ; JMP here to display the CFFA1 menu. 17 | ; Quit puts the user into the monitor. 18 | ; 19 | ; MenuExitToBASIC 20 | ; JMP here to display the CFFA1 menu. 21 | ; Quit puts the user into BASIC. 22 | ; 23 | ; Menu 24 | ; JSR here to display the CFFA1 menu. 25 | ; Quit returns control to your code. 26 | ; 27 | ; CFBlockDriver 28 | ; JSR here to read or write a block, after setting up pdCommandCode 29 | ; and other inputs (see below). 30 | ; Result: CLC, A = 0 31 | ; SEC, A = error code 32 | ; 33 | ; CFFA1_API 34 | ; JSR here to call one of many functions provided by the firmware. 35 | ; See "Function selectors for CFFA1_API" below. 36 | ; 37 | ;------------------------------------------------------------------------------ 38 | MenuExitToMonitor = $9000 39 | MenuExitToBASIC = $9003 40 | Menu = $9006 41 | CFBlockDriver = $9009 42 | CFFA1_API = $900C 43 | 44 | 45 | ;------------------------------------------------------------------------------ 46 | ; Inputs for CFBlockDriver - ProDOS block interface locations 47 | ;------------------------------------------------------------------------------ 48 | pdCommandCode = $42 ; see below 49 | pdUnitNumber = $43 ; always set this to 0 for firmware 1.0 50 | pdIOBufferLow = $44 51 | pdIOBufferHigh = $45 52 | pdBlockNumberLow = $46 53 | pdBlockNumberHigh = $47 54 | 55 | ; 56 | ; Values for pdCommandCode 57 | ; 58 | PRODOS_STATUS = $00 59 | PRODOS_READ = $01 60 | PRODOS_WRITE = $02 61 | PRODOS_FORMAT = $03 62 | 63 | 64 | ;------------------------------------------------------------------------------ 65 | ; Function selectors for CFFA1_API. 66 | ; 67 | ; Load one of these values into X: 68 | ; 69 | ; ldx #CFFA1_xxxxx 70 | ; jsr API 71 | ; 72 | ; Result: CLC, A = 0 73 | ; SEC, A = error code 74 | ; 75 | ; Certain functions have additional outputs, as described below. 76 | ; 77 | ;------------------------------------------------------------------------------ 78 | ; 79 | ; CFFA1_Version: 80 | ; Output: X = current firmware version 81 | ; Y = oldest compatible firmware version 82 | ; 83 | ; CFFA1_Menu: 84 | ; Result: Runs the CFFA1 menu and returns when the user chooses Quit. 85 | ; 86 | ; CFFA1_DisplayError: 87 | ; Input: A = an error code 88 | ; Result: Prints out a carriage return, the 2-digit hex error code, 89 | ; and a description of that error, if available. 90 | ; 91 | ; CFFA1_OpenDir: 92 | ; Input: None (operates on the current prefix directory) 93 | ; Result: Prepares for one or more calls to ReadDir. 94 | ; 95 | ; CFFA1_ReadDir: 96 | ; Setup: You have to call OpenDir before calling ReadDir. 97 | ; Result: If no error, EntryPtr points to the next occupied directory entry. 98 | ; 99 | ; CFFA1_FindDirEntry: 100 | ; Input: Filename = name to search for 101 | ; Result: If no error, EntryPtr points at the found item's directory entry. 102 | ; 103 | ; CFFA1_WriteFile: 104 | ; Input: Filename = name for new file (will be replaced if it already exists) 105 | ; Destination = starting address 106 | ; FileSize = number of bytes to write 107 | ; Filetype = type for new file 108 | ; Auxtype = auxiliary type for new file 109 | ; 110 | ; CFFA1_ReadFile: 111 | ; Input: Filename = file to read into memory 112 | ; Destination = starting address ($0000 to use the file's Auxtype value) 113 | ; 114 | ; CFFA1_SaveBASICFile: 115 | ; Input: Filename 116 | ; 117 | ; CFFA1_LoadBASICFile: 118 | ; Input: Filename 119 | ; 120 | ; CFFA1_Rename: 121 | ; Input: OldFilename = original name 122 | ; Filename = new name 123 | ; 124 | ; CFFA1_Delete: 125 | ; Input: Filename = file or empty directory to delete 126 | ; 127 | ; CFFA1_NewDirectoryAtRoot: 128 | ; Input: Filename = name for new directory 129 | ; 130 | ; CFFA1_FormatDrive: 131 | ; Input: Filename = name for new volume 132 | ; A = drive number (always set to 0 for firmware 1.0) 133 | ; Y = $77 (just to help avoid accidental formatting) 134 | ; Result: Disk volume is erased and given the specified name. 135 | ; 136 | ;------------------------------------------------------------------------------ 137 | CFFA1_Version = $00 138 | CFFA1_Menu = $02 139 | CFFA1_DisplayError = $04 140 | 141 | CFFA1_OpenDir = $10 142 | CFFA1_ReadDir = $12 143 | CFFA1_FindDirEntry = $14 144 | 145 | CFFA1_WriteFile = $20 146 | CFFA1_ReadFile = $22 147 | CFFA1_SaveBASICFile = $24 148 | CFFA1_LoadBASICFile = $26 149 | CFFA1_Rename = $28 150 | CFFA1_Delete = $2A 151 | CFFA1_NewDirectoryAtRoot = $2C 152 | CFFA1_FormatDrive = $2E 153 | 154 | 155 | ;------------------------------------------------------------------------------ 156 | ; Zero-page inputs and results for API functions 157 | ; 158 | ; Filename and OldFilename point to strings that begin with a length byte (from 159 | ; 1 to 15), and each character must have its high bit off. For example: 160 | ; 161 | ; Filename = $80 $280: 05 48 45 4C 4C 4F 162 | ; Filename+1 = $02 'H' 'E' 'L' 'L' 'O' 163 | ;------------------------------------------------------------------------------ 164 | Destination = $00 ; 2 bytes 165 | Filename = Destination+2 ; 2 bytes 166 | OldFilename = Filename+2 ; 2 bytes 167 | Filetype = OldFilename+2 ; 1 byte 168 | Auxtype = Filetype+1 ; 2 bytes 169 | FileSize = Auxtype+2 ; 2 bytes 170 | EntryPtr = FileSize+2 ; 2 bytes 171 | 172 | 173 | ;------------------------------------------------------------------------------ 174 | ; 175 | ; ProDOS low-level return codes 176 | ; 177 | ;------------------------------------------------------------------------------ 178 | PRODOS_NO_ERROR = $00 ; No error 179 | PRODOS_BADCMD = $01 ; Bad Command (not implemented) 180 | PRODOS_IO_ERROR = $27 ; I/O error 181 | PRODOS_NO_DEVICE = $28 ; No Device Connected 182 | PRODOS_WRITE_PROTECT = $2B ; Write Protected 183 | PRODOS_BADBLOCK = $2D ; Invalid block number requested 184 | PRODOS_OFFLINE = $2F ; Device off-line 185 | ; 186 | ; High-level return codes 187 | ; 188 | eBadPathSyntax = $40 189 | eDirNotFound = $44 190 | eFileNotFound = $46 191 | eDuplicateFile = $47 192 | eVolumeFull = $48 193 | eDirectoryFull = $49 194 | eFileFormat = $4A 195 | eBadStrgType = $4B 196 | eFileLocked = $4E 197 | eNotProDOS = $52 198 | eBadBufferAddr = $56 199 | eBakedBitmap = $5A 200 | eUnknownBASICFormat = $FE 201 | eUnimplemented = $FF 202 | 203 | 204 | ;------------------------------------------------------------------------------ 205 | ; ProDOS directory entry structure offsets 206 | ;------------------------------------------------------------------------------ 207 | oFiletype = $10 208 | oKeyBlock = $11 209 | oBlockCount = $13 210 | oFileSize = $15 211 | oCreateDateTime = $18 212 | oVersion = $1C 213 | oMinVersion = $1D 214 | oAccess = $1E 215 | oAuxtype = $1F 216 | oModDateTime = $21 217 | oHeaderPointer = $25 218 | 219 | oDirLinkPrevious = $00 220 | oDirLinkNext = $02 221 | oVolStorageType = $04 222 | oVolVersion = $20 223 | oVolAccess = $22 224 | oVolEntryLength = $23 225 | oVolEntriesPerBlock = $24 226 | oVolFileCount = $25 227 | oVolBitmapNumber = $27 228 | oVolTotalBlocks = $29 229 | 230 | ; 231 | ; ProDOS Storage types 232 | ; 233 | kSeedling = $10 234 | kSapling = $20 235 | kTree = $30 236 | kExtended = $50 237 | kDirectory = $D0 238 | kSubdirHeader = $E0 239 | kVolume = $F0 240 | kStorageTypeMask = $F0 241 | 242 | ; 243 | ; Filetypes 244 | ; 245 | kFiletypeText = $04 246 | kFiletypeBinary = $06 247 | kFiletypeDirectory = $0F 248 | kFiletypeBASIC1 = $F1 249 | kFiletypeBAS = $FC 250 | kFiletypeSYS = $FF 251 | 252 | ;------------------------------------------------------------------------------ 253 | ; end of CFFA1_API.s 254 | ;------------------------------------------------------------------------------ 255 | 256 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/README.txt: -------------------------------------------------------------------------------- 1 | look into msbasic.s for the README 2 | visit www.pagetable.com for more info 3 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/TODO.txt: -------------------------------------------------------------------------------- 1 | * convert messy init code into completely different 2 | files without ifdefs (not much in common!) 3 | * move all machine specific code into separate files 4 | * rename all labels that point to RTS to RTSn 5 | * add AppleSoft comments 6 | * look for all " $", i.e. (zeropage) constants, replace them 7 | with symbols 8 | * convert platform ifdefs in generic files into feature ifdefs or macros 9 | * reconstruct pre-CBM1, i.e. CBM1 without the patches 10 | * add some comments to every file 11 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/chrget.s: -------------------------------------------------------------------------------- 1 | .segment "CHRGET" 2 | RAMSTART1: 3 | GENERIC_CHRGET: 4 | inc TXTPTR 5 | bne GENERIC_CHRGOT 6 | inc TXTPTR+1 7 | GENERIC_CHRGOT: 8 | GENERIC_TXTPTR = GENERIC_CHRGOT + 1 9 | lda $EA60 10 | .ifdef KBD 11 | jsr LF430 12 | .endif 13 | cmp #$3A 14 | bcs L4058 15 | GENERIC_CHRGOT2: 16 | cmp #$20 17 | beq GENERIC_CHRGET 18 | sec 19 | sbc #$30 20 | sec 21 | sbc #$D0 22 | L4058: 23 | rts 24 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/defines.s: -------------------------------------------------------------------------------- 1 | .if .def(cbmbasic1) 2 | CBM1 := 1 3 | .include "defines_cbm1.s" 4 | .elseif .def(osi) 5 | OSI := 1 6 | .include "defines_osi.s" 7 | .elseif .def(applesoft) 8 | APPLE := 1 9 | .include "defines_apple.s" 10 | .elseif .def(kb9) 11 | KIM := 1 12 | .include "defines_kim.s" 13 | .elseif .def(cbmbasic2) 14 | CBM2 := 1 15 | .include "defines_cbm2.s" 16 | .elseif .def(kbdbasic) 17 | KBD := 1 18 | .include "defines_kbd.s" 19 | .elseif .def(microtan) 20 | MICROTAN := 1 21 | .include "defines_microtan.s" 22 | .endif 23 | 24 | .ifdef CONFIG_2C 25 | CONFIG_2B := 1 26 | .endif 27 | .ifdef CONFIG_2B 28 | CONFIG_2A := 1 29 | .endif 30 | .ifdef CONFIG_2A 31 | CONFIG_2 := 1 32 | .endif 33 | .ifdef CONFIG_2 34 | CONFIG_11A := 1 35 | .endif 36 | .ifdef CONFIG_11A 37 | CONFIG_11 := 1 38 | .endif 39 | .ifdef CONFIG_11 40 | CONFIG_10A := 1 41 | .endif 42 | 43 | .ifdef CONFIG_SMALL 44 | BYTES_FP := 4 45 | .else 46 | BYTES_FP := 5 47 | .endif 48 | 49 | .ifndef BYTES_PER_ELEMENT 50 | BYTES_PER_ELEMENT := BYTES_FP 51 | .endif 52 | BYTES_PER_VARIABLE := BYTES_FP+2 53 | MANTISSA_BYTES := BYTES_FP-1 54 | BYTES_PER_FRAME := 2*BYTES_FP+8 55 | FOR_STACK1 := 2*BYTES_FP+5 56 | FOR_STACK2 := BYTES_FP+4 57 | 58 | .ifndef MAX_EXPON 59 | MAX_EXPON = 10 60 | .endif 61 | 62 | STACK := $0100 63 | 64 | .ifdef INPUTBUFFER 65 | .if INPUTBUFFER >= $0100 66 | CONFIG_NO_INPUTBUFFER_ZP := 1 67 | .endif 68 | .if INPUTBUFFER = $0200 69 | CONFIG_INPUTBUFFER_0200 := 1 70 | .endif 71 | .endif 72 | INPUTBUFFERX = INPUTBUFFER & $FF00 73 | 74 | CR=13 75 | LF=10 76 | 77 | .ifndef CRLF_1 78 | CRLF_1 := CR 79 | CRLF_2 := LF 80 | .endif 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/defines_osi.s: -------------------------------------------------------------------------------- 1 | ; configuration 2 | CONFIG_11A := 1 3 | 4 | CONFIG_DATAFLG := 1 5 | CONFIG_NULL := 1 6 | CONFIG_PRINT_CR := 1 ; print CR when line end reached 7 | CONFIG_SCRTCH_ORDER := 3 8 | CONFIG_SMALL := 1 9 | 10 | CRLF_1 := CR 11 | CRLF_2 := $00 12 | 13 | ; zero page 14 | ZP_START1 = $00 15 | ZP_START2 = $0D 16 | ZP_START3 = $5B 17 | ZP_START4 = $65 18 | 19 | ;extra ZP variables 20 | USR := $000A 21 | 22 | ; constants 23 | STACK_TOP := $FC 24 | SPACE_FOR_GOSUB := $33 25 | NULL_MAX := $0A 26 | WIDTH := 72 27 | WIDTH2 := 56 28 | 29 | ; memory layout 30 | RAMSTART2 := $0300 31 | 32 | ; magic memory locations 33 | L0200 := $0200 34 | 35 | ; monitor functions 36 | MONRDKEY := $FD60 37 | MONCOUT := $FD46 38 | ;MONISCNTC := $FFF1 39 | LOAD := $FD69 40 | SAVE := $FFF7 41 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/error.s: -------------------------------------------------------------------------------- 1 | init_error_table 2 | 3 | .ifdef CONFIG_SMALL 4 | define_error ERR_NOFOR, "NF" 5 | define_error ERR_SYNTAX, "SN" 6 | define_error ERR_NOGOSUB, "RG" 7 | define_error ERR_NODATA, "OD" 8 | define_error ERR_ILLQTY, "FC" 9 | define_error ERR_OVERFLOW, "OV" 10 | define_error ERR_MEMFULL, "OM" 11 | define_error ERR_UNDEFSTAT, "US" 12 | define_error ERR_BADSUBS, "BS" 13 | define_error ERR_REDIMD, "DD" 14 | define_error ERR_ZERODIV, "/0" 15 | define_error ERR_ILLDIR, "ID" 16 | define_error ERR_BADTYPE, "TM" 17 | define_error ERR_STRLONG, "LS" 18 | define_error ERR_FRMCPX, "ST" 19 | define_error ERR_CANTCONT, "CN" 20 | define_error ERR_UNDEFFN, "UF" 21 | .else 22 | define_error ERR_NOFOR, "NEXT WITHOUT FOR" 23 | define_error ERR_SYNTAX, "SYNTAX" 24 | define_error ERR_NOGOSUB, "RETURN WITHOUT GOSUB" 25 | define_error ERR_NODATA, "OUT OF DATA" 26 | define_error ERR_ILLQTY, "ILLEGAL QUANTITY" 27 | .ifdef CBM1 28 | .byte 0,0,0,0,0 29 | .endif 30 | define_error ERR_OVERFLOW, "OVERFLOW" 31 | define_error ERR_MEMFULL, "OUT OF MEMORY" 32 | define_error ERR_UNDEFSTAT, "UNDEF'D STATEMENT" 33 | define_error ERR_BADSUBS, "BAD SUBSCRIPT" 34 | define_error ERR_REDIMD, "REDIM'D ARRAY" 35 | define_error ERR_ZERODIV, "DIVISION BY ZERO" 36 | define_error ERR_ILLDIR, "ILLEGAL DIRECT" 37 | define_error ERR_BADTYPE, "TYPE MISMATCH" 38 | define_error ERR_STRLONG, "STRING TOO LONG" 39 | .ifdef CONFIG_FILE 40 | .ifdef CBM1 41 | define_error ERR_BADDATA, "BAD DATA" 42 | .else 43 | define_error ERR_BADDATA, "FILE DATA" 44 | .endif 45 | .endif 46 | define_error ERR_FRMCPX, "FORMULA TOO COMPLEX" 47 | define_error ERR_CANTCONT, "CAN'T CONTINUE" 48 | define_error ERR_UNDEFFN, "UNDEF'D FUNCTION" 49 | .endif -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/extra.s: -------------------------------------------------------------------------------- 1 | .segment "EXTRA" 2 | 3 | .ifdef KIM 4 | .include "kim_extra.s" 5 | .endif 6 | 7 | .ifdef CONFIG_CBM1_PATCHES 8 | .include "cbm1_patches.s" 9 | .endif 10 | 11 | .ifdef KBD 12 | .include "kbd_extra.s" 13 | .endif 14 | 15 | .ifdef APPLE 16 | .include "apple_extra.s" 17 | .endif 18 | 19 | .ifdef MICROTAN 20 | .include "microtan_extra.s" 21 | .endif -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/flow1.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | ; ---------------------------------------------------------------------------- 4 | ; "FOR" STATEMENT 5 | ; 6 | ; FOR PUSHES 18 BYTES ON THE STACK: 7 | ; 2 -- TXTPTR 8 | ; 2 -- LINE NUMBER 9 | ; 5 -- INITIAL (CURRENT) FOR VARIABLE VALUE 10 | ; 1 -- STEP SIGN 11 | ; 5 -- STEP VALUE 12 | ; 2 -- ADDRESS OF FOR VARIABLE IN VARTAB 13 | ; 1 -- FOR TOKEN ($81) 14 | ; ---------------------------------------------------------------------------- 15 | FOR: 16 | lda #$80 17 | sta SUBFLG 18 | jsr LET 19 | jsr GTFORPNT 20 | bne L2619 21 | txa 22 | adc #FOR_STACK1 23 | tax 24 | txs 25 | L2619: 26 | pla 27 | pla 28 | lda #FOR_STACK2 29 | jsr CHKMEM 30 | jsr DATAN 31 | clc 32 | tya 33 | adc TXTPTR 34 | pha 35 | lda TXTPTR+1 36 | adc #$00 37 | pha 38 | lda CURLIN+1 39 | pha 40 | lda CURLIN 41 | pha 42 | lda #TOKEN_TO 43 | jsr SYNCHR 44 | jsr CHKNUM 45 | jsr FRMNUM 46 | lda FACSIGN 47 | ora #$7F 48 | and FAC+1 49 | sta FAC+1 50 | lda #STEP 52 | sta INDEX 53 | sty INDEX+1 54 | jmp FRM_STACK3 55 | 56 | ; ---------------------------------------------------------------------------- 57 | ; "STEP" PHRASE OF "FOR" STATEMENT 58 | ; ---------------------------------------------------------------------------- 59 | STEP: 60 | lda #CON_ONE 62 | jsr LOAD_FAC_FROM_YA 63 | jsr CHRGOT 64 | cmp #TOKEN_STEP 65 | bne L2665 66 | jsr CHRGET 67 | jsr FRMNUM 68 | L2665: 69 | jsr SIGN 70 | jsr FRM_STACK2 71 | lda FORPNT+1 72 | pha 73 | lda FORPNT 74 | pha 75 | lda #$81 76 | pha 77 | 78 | ; ---------------------------------------------------------------------------- 79 | ; PERFORM NEXT STATEMENT 80 | ; ---------------------------------------------------------------------------- 81 | NEWSTT: 82 | jsr ISCNTC 83 | lda TXTPTR 84 | ldy TXTPTR+1 85 | .if .def(CONFIG_NO_INPUTBUFFER_ZP) && .def(CONFIG_2) 86 | cpy #>INPUTBUFFER 87 | .ifdef CBM2 88 | nop 89 | .endif 90 | beq LC6D4 91 | .else 92 | ; BUG on AppleSoft I, 93 | ; fixed differently on AppleSoft II (ldx/inx) 94 | beq L2683 95 | .endif 96 | sta OLDTEXT 97 | sty OLDTEXT+1 98 | LC6D4: 99 | ldy #$00 100 | L2683: 101 | lda (TXTPTR),y 102 | .ifndef CONFIG_11 103 | beq LA5DC ; old: 1 cycle more on generic case 104 | cmp #$3A 105 | beq NEWSTT2 106 | SYNERR1: 107 | jmp SYNERR 108 | LA5DC: 109 | .else 110 | bne COLON; new: 1 cycle more on ":" case 111 | .endif 112 | ldy #$02 113 | lda (TXTPTR),y 114 | clc 115 | .ifdef CONFIG_2 116 | jeq L2701 117 | .else 118 | beq L2701 119 | .endif 120 | iny 121 | lda (TXTPTR),y 122 | sta CURLIN 123 | iny 124 | lda (TXTPTR),y 125 | sta CURLIN+1 126 | tya 127 | adc TXTPTR 128 | sta TXTPTR 129 | bcc NEWSTT2 130 | inc TXTPTR+1 131 | NEWSTT2: 132 | jsr CHRGET 133 | jsr EXECUTE_STATEMENT 134 | jmp NEWSTT 135 | 136 | ; ---------------------------------------------------------------------------- 137 | ; EXECUTE A STATEMENT 138 | ; 139 | ; (A) IS FIRST CHAR OF STATEMENT 140 | ; CARRY IS SET 141 | ; ---------------------------------------------------------------------------- 142 | EXECUTE_STATEMENT: 143 | .ifndef CONFIG_11A 144 | beq RET1 145 | .else 146 | beq RET2 147 | .endif 148 | .ifndef CONFIG_11 149 | sec 150 | .endif 151 | EXECUTE_STATEMENT1: 152 | sbc #$80 153 | .ifndef CONFIG_11 154 | jcc LET ; old: 1 cycle more on instr. 155 | .else 156 | bcc LET1; new: 1 cycle more on assignment 157 | .endif 158 | cmp #NUM_TOKENS 159 | .ifdef CONFIG_2 160 | bcs LC721 161 | .else 162 | bcs SYNERR1 163 | .endif 164 | asl a 165 | tay 166 | lda TOKEN_ADDRESS_TABLE+1,y 167 | pha 168 | lda TOKEN_ADDRESS_TABLE,y 169 | pha 170 | jmp CHRGET 171 | 172 | .ifdef CONFIG_11 173 | LET1: 174 | jmp LET 175 | 176 | COLON: 177 | cmp #$3A 178 | beq NEWSTT2 179 | SYNERR1: 180 | jmp SYNERR 181 | .endif 182 | 183 | .ifdef CONFIG_2; GO TO 184 | LC721: 185 | cmp #TOKEN_GO-$80 186 | bne SYNERR1 187 | jsr CHRGET 188 | lda #TOKEN_TO 189 | jsr SYNCHR 190 | jmp GOTO 191 | .endif 192 | 193 | ; ---------------------------------------------------------------------------- 194 | ; "RESTORE" STATEMENT 195 | ; ---------------------------------------------------------------------------- 196 | RESTORE: 197 | sec 198 | lda TXTTAB 199 | sbc #$01 200 | ldy TXTTAB+1 201 | bcs SETDA 202 | dey 203 | SETDA: 204 | sta DATPTR 205 | sty DATPTR+1 206 | RET2: 207 | rts 208 | 209 | .include "iscntc.s" 210 | ;!!! runs into "STOP" 211 | ; ---------------------------------------------------------------------------- 212 | ; "STOP" STATEMENT 213 | ; ---------------------------------------------------------------------------- 214 | STOP: 215 | bcs END2 216 | 217 | ; ---------------------------------------------------------------------------- 218 | ; "END" STATEMENT 219 | ; ---------------------------------------------------------------------------- 220 | END: 221 | clc 222 | END2: 223 | bne RET1 224 | lda TXTPTR 225 | ldy TXTPTR+1 226 | .if .def(CONFIG_NO_INPUTBUFFER_ZP) && .def(CONFIG_2) 227 | ; BUG on AppleSoft I 228 | ; fix exists on AppleSoft II 229 | ; TXTPTR+1 will always be > 0 230 | ldx CURLIN+1 231 | inx 232 | .endif 233 | beq END4 234 | sta OLDTEXT 235 | sty OLDTEXT+1 236 | CONTROL_C_TYPED: 237 | lda CURLIN 238 | ldy CURLIN+1 239 | sta OLDLIN 240 | sty OLDLIN+1 241 | END4: 242 | pla 243 | pla 244 | L2701: 245 | lda #QT_BREAK 247 | .ifndef KBD 248 | ldx #$00 249 | stx Z14 250 | .endif 251 | bcc L270E 252 | jmp PRINT_ERROR_LINNUM 253 | L270E: 254 | jmp RESTART 255 | .ifdef KBD 256 | LE664: 257 | tay 258 | jmp SNGFLT 259 | .endif 260 | 261 | ; ---------------------------------------------------------------------------- 262 | ; "CONT" COMMAND 263 | ; ---------------------------------------------------------------------------- 264 | CONT: 265 | bne RET1 266 | ldx #ERR_CANTCONT 267 | ldy OLDTEXT+1 268 | bne L271C 269 | jmp ERROR 270 | L271C: 271 | lda OLDTEXT 272 | sta TXTPTR 273 | sty TXTPTR+1 274 | lda OLDLIN 275 | ldy OLDLIN+1 276 | sta CURLIN 277 | sty CURLIN+1 278 | RET1: 279 | rts 280 | 281 | .ifdef KBD 282 | PRT: 283 | jsr GETBYT 284 | txa 285 | ; not ROR bug safe 286 | ror a 287 | ror a 288 | ror a 289 | sta $8F 290 | rts 291 | 292 | LE68C: 293 | ldy #$12 294 | LE68E: 295 | lda LEA30,y 296 | sta $03A2,y 297 | dey 298 | bpl LE68E 299 | rts 300 | .endif 301 | 302 | .if .def(CONFIG_NULL) || .def(CONFIG_PRINTNULLS) 303 | ; CBM1 has the keyword removed, 304 | ; but the code is still here 305 | NULL: 306 | jsr GETBYT 307 | bne RET1 308 | inx 309 | cpx #NULL_MAX 310 | bcs L2739 311 | dex 312 | stx Z15 313 | rts 314 | L2739: 315 | jmp IQERR 316 | .endif 317 | .ifndef CONFIG_11A 318 | CLEAR: 319 | bne RET1 320 | jmp CLEARC 321 | .endif 322 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/flow2.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | ; ---------------------------------------------------------------------------- 3 | ; "RUN" COMMAND 4 | ; ---------------------------------------------------------------------------- 5 | RUN: 6 | bne L27CF 7 | jmp SETPTRS 8 | L27CF: 9 | jsr CLEARC 10 | jmp L27E9 11 | 12 | ; ---------------------------------------------------------------------------- 13 | ; "GOSUB" STATEMENT 14 | ; 15 | ; LEAVES 7 BYTES ON STACK: 16 | ; 2 -- RETURN ADDRESS (NEWSTT) 17 | ; 2 -- TXTPTR 18 | ; 2 -- LINE # 19 | ; 1 -- GOSUB TOKEN 20 | ; ---------------------------------------------------------------------------- 21 | GOSUB: 22 | lda #$03 23 | jsr CHKMEM 24 | lda TXTPTR+1 25 | pha 26 | lda TXTPTR 27 | pha 28 | lda CURLIN+1 29 | pha 30 | lda CURLIN 31 | pha 32 | lda #TOKEN_GOSUB 33 | pha 34 | L27E9: 35 | jsr CHRGOT 36 | jsr GOTO 37 | jmp NEWSTT 38 | 39 | ; ---------------------------------------------------------------------------- 40 | ; "GOTO" STATEMENT 41 | ; ALSO USED BY "RUN" AND "GOSUB" 42 | ; ---------------------------------------------------------------------------- 43 | GOTO: 44 | jsr LINGET 45 | jsr REMN 46 | lda CURLIN+1 47 | cmp LINNUM+1 48 | bcs L2809 49 | tya 50 | sec 51 | adc TXTPTR 52 | ldx TXTPTR+1 53 | bcc L280D 54 | inx 55 | bcs L280D 56 | L2809: 57 | lda TXTTAB 58 | ldx TXTTAB+1 59 | L280D: 60 | .ifdef KBD 61 | jsr LF457 62 | bne UNDERR 63 | .else 64 | jsr FL1 65 | bcc UNDERR 66 | .endif 67 | lda LOWTRX 68 | sbc #$01 69 | sta TXTPTR 70 | lda LOWTRX+1 71 | sbc #$00 72 | sta TXTPTR+1 73 | L281E: 74 | rts 75 | 76 | ; ---------------------------------------------------------------------------- 77 | ; "POP" AND "RETURN" STATEMENTS 78 | ; ---------------------------------------------------------------------------- 79 | POP: 80 | bne L281E 81 | lda #$FF 82 | .ifdef CONFIG_2A 83 | sta FORPNT+1 ; bugfix, wrong in AppleSoft II 84 | .else 85 | sta FORPNT 86 | .endif 87 | jsr GTFORPNT 88 | txs 89 | cmp #TOKEN_GOSUB 90 | beq RETURN 91 | ldx #ERR_NOGOSUB 92 | .byte $2C 93 | UNDERR: 94 | ldx #ERR_UNDEFSTAT 95 | jmp ERROR 96 | ; ---------------------------------------------------------------------------- 97 | SYNERR2: 98 | jmp SYNERR 99 | ; ---------------------------------------------------------------------------- 100 | RETURN: 101 | pla 102 | pla 103 | sta CURLIN 104 | pla 105 | sta CURLIN+1 106 | pla 107 | sta TXTPTR 108 | pla 109 | sta TXTPTR+1 110 | 111 | ; ---------------------------------------------------------------------------- 112 | ; "DATA" STATEMENT 113 | ; EXECUTED BY SKIPPING TO NEXT COLON OR EOL 114 | ; ---------------------------------------------------------------------------- 115 | DATA: 116 | jsr DATAN 117 | 118 | ; ---------------------------------------------------------------------------- 119 | ; ADD (Y) TO TXTPTR 120 | ; ---------------------------------------------------------------------------- 121 | ADDON: 122 | tya 123 | clc 124 | adc TXTPTR 125 | sta TXTPTR 126 | bcc L2852 127 | inc TXTPTR+1 128 | L2852: 129 | rts 130 | 131 | ; ---------------------------------------------------------------------------- 132 | ; SCAN AHEAD TO NEXT ":" OR EOL 133 | ; ---------------------------------------------------------------------------- 134 | DATAN: 135 | ldx #$3A 136 | .byte $2C 137 | REMN: 138 | ldx #$00 139 | stx CHARAC 140 | ldy #$00 141 | sty ENDCHR 142 | L285E: 143 | lda ENDCHR 144 | ldx CHARAC 145 | sta CHARAC 146 | stx ENDCHR 147 | L2866: 148 | lda (TXTPTR),y 149 | beq L2852 150 | cmp ENDCHR 151 | beq L2852 152 | iny 153 | cmp #$22 154 | .ifndef CONFIG_11 155 | beq L285E; old: swap & cont is faster 156 | bne L2866 157 | .else 158 | bne L2866; new: cont is faster 159 | beq L285E 160 | .endif 161 | 162 | ; ---------------------------------------------------------------------------- 163 | ; "IF" STATEMENT 164 | ; ---------------------------------------------------------------------------- 165 | IF: 166 | jsr FRMEVL 167 | jsr CHRGOT 168 | cmp #TOKEN_GOTO 169 | beq L2884 170 | lda #TOKEN_THEN 171 | jsr SYNCHR 172 | L2884: 173 | lda FAC 174 | bne L288D 175 | 176 | ; ---------------------------------------------------------------------------- 177 | ; "REM" STATEMENT, OR FALSE "IF" STATEMENT 178 | ; ---------------------------------------------------------------------------- 179 | REM: 180 | jsr REMN 181 | beq ADDON 182 | L288D: 183 | jsr CHRGOT 184 | bcs L2895 185 | jmp GOTO 186 | L2895: 187 | jmp EXECUTE_STATEMENT 188 | 189 | ; ---------------------------------------------------------------------------- 190 | ; "ON" STATEMENT 191 | ; 192 | ; ON GOTO 193 | ; ON GOSUB 194 | ; ---------------------------------------------------------------------------- 195 | ON: 196 | jsr GETBYT 197 | pha 198 | cmp #TOKEN_GOSUB 199 | beq L28A4 200 | L28A0: 201 | cmp #TOKEN_GOTO 202 | bne SYNERR2 203 | L28A4: 204 | dec FAC_LAST 205 | bne L28AC 206 | pla 207 | jmp EXECUTE_STATEMENT1 208 | L28AC: 209 | jsr CHRGET 210 | jsr LINGET 211 | cmp #$2C 212 | beq L28A4 213 | pla 214 | L28B7: 215 | rts 216 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/getaddress: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Get load and run addresses from map file and output in hex in format 4 | # to be used as arguments to the bintomon program. 5 | 6 | R=`grep ".COLD_START" tmp/osi.lbl | head -1 | awk '{ print $2 }'` 7 | L=`grep ".TOKEN_ADDRESS_TABLE" tmp/osi.lbl | head -1 | awk '{ print $2 }'` 8 | echo "-l 0x$L -r 0x$R" 9 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/header.s: -------------------------------------------------------------------------------- 1 | .segment "HEADER" 2 | .ifdef KBD 3 | jmp LE68C 4 | .byte $00,$13,$56 5 | .endif 6 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/inline.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | .ifndef CONFIG_NO_INPUTBUFFER_ZP 4 | L2420: 5 | .ifdef OSI 6 | jsr OUTDO 7 | .endif 8 | dex 9 | bpl INLIN2 10 | L2423: 11 | .ifdef OSI 12 | jsr OUTDO 13 | .endif 14 | jsr CRDO 15 | .endif 16 | 17 | ; ---------------------------------------------------------------------------- 18 | ; READ A LINE, AND STRIP OFF SIGN BITS 19 | ; ---------------------------------------------------------------------------- 20 | .ifndef KBD 21 | INLIN: 22 | .ifdef APPLE 23 | ldx #$DD 24 | INLIN1: 25 | stx $33 26 | jsr L2900 27 | cpx #$EF 28 | bcs L0C32 29 | ldx #$EF 30 | L0C32: 31 | lda #$00 32 | sta INPUTBUFFER,x 33 | ldx #INPUTBUFFER-1 35 | rts 36 | .endif 37 | 38 | .ifndef APPLE 39 | ldx #$00 40 | INLIN2: 41 | jsr GETLN 42 | .ifndef CONFIG_NO_LINE_EDITING 43 | cmp #$07 44 | beq L2443 45 | .endif 46 | cmp #$0D 47 | beq L2453 48 | .ifndef CONFIG_NO_LINE_EDITING 49 | cmp #$20 50 | bcc INLIN2 51 | .ifdef MICROTAN 52 | cmp #$80 53 | .else 54 | cmp #$7D 55 | .endif 56 | bcs INLIN2 57 | cmp #$40 ; @ 58 | beq L2423 59 | .ifdef MICROTAN 60 | cmp #$7F ; DEL 61 | .else 62 | cmp #$5F ; _ 63 | .endif 64 | beq L2420 65 | L2443: 66 | .ifdef MICROTAN 67 | cpx #$4F 68 | .else 69 | cpx #$47 70 | .endif 71 | bcs L244C 72 | .endif 73 | sta INPUTBUFFER,x 74 | inx 75 | .ifdef OSI 76 | .byte $2C 77 | .else 78 | bne INLIN2 79 | .endif 80 | L244C: 81 | .ifndef CONFIG_NO_LINE_EDITING 82 | lda #$07 ; BEL 83 | jsr OUTDO 84 | bne INLIN2 85 | .endif 86 | L2453: 87 | jmp L29B9 88 | .endif 89 | .endif 90 | 91 | .ifndef KBD 92 | .ifndef APPLE 93 | GETLN: 94 | .ifdef CONFIG_FILE 95 | jsr CHRIN 96 | ldy CURDVC 97 | bne L2465 98 | .else 99 | jsr MONRDKEY 100 | .endif 101 | .ifdef OSI 102 | nop 103 | nop 104 | nop 105 | nop 106 | nop 107 | nop 108 | nop 109 | nop 110 | nop 111 | nop 112 | nop 113 | nop 114 | nop 115 | nop 116 | and #$7F 117 | .endif 118 | .endif 119 | .ifdef APPLE 120 | RDKEY: 121 | jsr LFD0C 122 | and #$7F 123 | .endif 124 | cmp #$0F 125 | bne L2465 126 | pha 127 | lda Z14 128 | eor #$FF 129 | sta Z14 130 | pla 131 | L2465: 132 | rts 133 | .endif 134 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/iscntc.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | ; ---------------------------------------------------------------------------- 3 | ; SEE IF CONTROL-C TYPED 4 | ; ---------------------------------------------------------------------------- 5 | .ifdef CONFIG_CBM_ALL 6 | .include "cbm_iscntc.s" 7 | .endif 8 | .ifdef KBD 9 | .include "kbd_iscntc.s" 10 | .endif 11 | .ifdef OSI 12 | .include "osi_iscntc.s" 13 | .endif 14 | .ifdef APPLE 15 | .include "apple_iscntc.s" 16 | .endif 17 | .ifdef KIM 18 | .include "kim_iscntc.s" 19 | .endif 20 | .ifdef MICROTAN 21 | .include "microtan_iscntc.s" 22 | .endif 23 | ;!!! runs into "STOP" 24 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/loadsave.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | .ifdef APPLE 4 | .include "apple_loadsave.s" 5 | .endif 6 | .ifdef KIM 7 | .include "kim_loadsave.s" 8 | .endif 9 | .ifdef MICROTAN 10 | .include "microtan_loadsave.s" 11 | .endif 12 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/macros.s: -------------------------------------------------------------------------------- 1 | ; htasc - set the hi bit on the last byte of a string for termination 2 | ; (by Tom Greene) 3 | .macro htasc str 4 | .repeat .strlen(str)-1,I 5 | .byte .strat(str,I) 6 | .endrep 7 | .byte .strat(str,.strlen(str)-1) | $80 8 | .endmacro 9 | 10 | ; For every token, a byte gets put into segment "DUMMY". 11 | ; This way, we count up with every token. The DUMMY segment 12 | ; doesn't get linked into the binary. 13 | .macro init_token_tables 14 | .segment "VECTORS" 15 | TOKEN_ADDRESS_TABLE: 16 | .segment "KEYWORDS" 17 | TOKEN_NAME_TABLE: 18 | .segment "DUMMY" 19 | DUMMY_START: 20 | .endmacro 21 | 22 | ; optionally define token symbol 23 | ; count up token number 24 | .macro define_token token 25 | .segment "DUMMY" 26 | .ifnblank token 27 | token := <(*-DUMMY_START)+$80 28 | .endif 29 | .res 1; count up in any case 30 | .endmacro 31 | 32 | ; lay down a keyword, optionally define a token symbol 33 | .macro keyword key, token 34 | .segment "KEYWORDS" 35 | htasc key 36 | define_token token 37 | .endmacro 38 | 39 | ; lay down a keyword and an address (RTS style), 40 | ; optionally define a token symbol 41 | .macro keyword_rts key, vec, token 42 | .segment "VECTORS" 43 | .word vec-1 44 | keyword key, token 45 | .endmacro 46 | 47 | ; lay down a keyword and an address, 48 | ; optionally define a token symbol 49 | .macro keyword_addr key, vec, token 50 | .segment "VECTORS" 51 | .addr vec 52 | keyword key, token 53 | .endmacro 54 | 55 | .macro count_tokens 56 | .segment "DUMMY" 57 | NUM_TOKENS := <(*-DUMMY_START) 58 | .endmacro 59 | 60 | .macro init_error_table 61 | .segment "ERROR" 62 | ERROR_MESSAGES: 63 | .endmacro 64 | 65 | .macro define_error error, msg 66 | .segment "ERROR" 67 | error := <(*-ERROR_MESSAGES) 68 | htasc msg 69 | .endmacro 70 | 71 | ;--------------------------------------------- 72 | ; set the MSB of every byte of a string 73 | .macro asc80 str 74 | .repeat .strlen(str),I 75 | .byte .strat(str,I)+$80 76 | .endrep 77 | .endmacro 78 | 79 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/make.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d tmp ]; then 2 | mkdir tmp 3 | fi 4 | 5 | #for i in cbmbasic1 cbmbasic2 kbdbasic osi kb9 applesoft microtan; do 6 | for i in osi; do 7 | 8 | echo $i 9 | ca65 -I /usr/local/share/cc65/asminc -l tmp/msbasic.lst -D $i msbasic.s -o tmp/$i.o && 10 | ld65 -vm -m tmp/$i.map -C $i.cfg tmp/$i.o -o tmp/$i.bin -Ln tmp/$i.lbl 11 | done 12 | 13 | # For ROM 14 | bintoc -3 -v -b 24 `./getaddress` tmp/osi.bin > tmp/osi.mon 15 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/memory.s: -------------------------------------------------------------------------------- 1 | ; generic stack and memory management code 2 | ; this code is identical across all versions of 3 | ; BASIC 4 | 5 | .segment "CODE" 6 | 7 | ; ---------------------------------------------------------------------------- 8 | ; CALLED BY "NEXT" AND "FOR" TO SCAN THROUGH 9 | ; THE STACK FOR A FRAME WITH THE SAME VARIABLE. 10 | ; 11 | ; (FORPNT) = ADDRESS OF VARIABLE IF "FOR" OR "NEXT" 12 | ; = $XXFF IF CALLED FROM "RETURN" 13 | ; <<< BUG: SHOULD BE $FFXX >>> 14 | ; 15 | ; RETURNS .NE. IF VARIABLE NOT FOUND, 16 | ; (X) = STACK PNTR AFTER SKIPPING ALL FRAMES 17 | ; 18 | ; .EQ. IF FOUND 19 | ; (X) = STACK PNTR OF FRAME FOUND 20 | ; ---------------------------------------------------------------------------- 21 | GTFORPNT: 22 | tsx 23 | inx 24 | inx 25 | inx 26 | inx 27 | L2279: 28 | lda STACK+1,x 29 | cmp #$81 30 | bne L22A1 31 | lda FORPNT+1 32 | bne L228E 33 | lda STACK+2,x 34 | sta FORPNT 35 | lda STACK+3,x 36 | sta FORPNT+1 37 | L228E: 38 | cmp STACK+3,x 39 | bne L229A 40 | lda FORPNT 41 | cmp STACK+2,x 42 | beq L22A1 43 | L229A: 44 | txa 45 | clc 46 | adc #BYTES_PER_FRAME 47 | tax 48 | bne L2279 49 | L22A1: 50 | rts 51 | 52 | ; ---------------------------------------------------------------------------- 53 | ; MOVE BLOCK OF MEMORY UP 54 | ; 55 | ; ON ENTRY: 56 | ; (Y,A) = (HIGHDS) = DESTINATION END+1 57 | ; (LOWTR) = LOWEST ADDRESS OF SOURCE 58 | ; (HIGHTR) = HIGHEST SOURCE ADDRESS+1 59 | ; ---------------------------------------------------------------------------- 60 | BLTU: 61 | jsr REASON 62 | sta STREND 63 | sty STREND+1 64 | BLTU2: 65 | sec 66 | lda HIGHTR 67 | sbc LOWTR 68 | sta INDEX 69 | tay 70 | lda HIGHTR+1 71 | sbc LOWTR+1 72 | tax 73 | inx 74 | tya 75 | beq L22DD 76 | lda HIGHTR 77 | sec 78 | sbc INDEX 79 | sta HIGHTR 80 | bcs L22C6 81 | dec HIGHTR+1 82 | sec 83 | L22C6: 84 | lda HIGHDS 85 | sbc INDEX 86 | sta HIGHDS 87 | bcs L22D6 88 | dec HIGHDS+1 89 | bcc L22D6 90 | L22D2: 91 | lda (HIGHTR),y 92 | sta (HIGHDS),y 93 | L22D6: 94 | dey 95 | bne L22D2 96 | lda (HIGHTR),y 97 | sta (HIGHDS),y 98 | L22DD: 99 | dec HIGHTR+1 100 | dec HIGHDS+1 101 | dex 102 | bne L22D6 103 | rts 104 | 105 | ; ---------------------------------------------------------------------------- 106 | ; CHECK IF ENOUGH ROOM LEFT ON STACK 107 | ; FOR "FOR", "GOSUB", OR EXPRESSION EVALUATION 108 | ; ---------------------------------------------------------------------------- 109 | CHKMEM: 110 | asl a 111 | adc #SPACE_FOR_GOSUB 112 | bcs MEMERR 113 | sta INDEX 114 | tsx 115 | cpx INDEX 116 | bcc MEMERR 117 | rts 118 | 119 | ; ---------------------------------------------------------------------------- 120 | ; CHECK IF ENOUGH ROOM BETWEEN ARRAYS AND STRINGS 121 | ; (Y,A) = ADDR ARRAYS NEED TO GROW TO 122 | ; ---------------------------------------------------------------------------- 123 | REASON: 124 | cpy FRETOP+1 125 | bcc L231E 126 | bne L22FC 127 | cmp FRETOP 128 | bcc L231E 129 | L22FC: 130 | pha 131 | ldx #FAC-TEMP1-1 132 | tya 133 | L2300: 134 | pha 135 | lda TEMP1,x 136 | dex 137 | bpl L2300 138 | jsr GARBAG 139 | ldx #<(TEMP1-FAC+1) 140 | L230B: 141 | pla 142 | sta FAC,x 143 | inx 144 | bmi L230B 145 | pla 146 | tay 147 | pla 148 | cpy FRETOP+1 149 | bcc L231E 150 | bne MEMERR 151 | cmp FRETOP 152 | bcs MEMERR 153 | L231E: 154 | rts 155 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/message.s: -------------------------------------------------------------------------------- 1 | ; global messages: "error", "in", "ready", "break" 2 | 3 | .segment "CODE" 4 | 5 | QT_ERROR: 6 | .ifdef KBD 7 | .byte " err" 8 | .else 9 | .ifdef APPLE 10 | .byte " ERR" 11 | .byte $07,$07 12 | .else 13 | .byte " ERROR" 14 | .endif 15 | .endif 16 | .byte 0 17 | 18 | .ifndef KBD 19 | QT_IN: 20 | .byte " IN " 21 | .byte $00 22 | .endif 23 | 24 | .ifdef KBD 25 | .byte $54,$D2 ; ??? 26 | OKPRT: 27 | jsr PRIMM 28 | .byte CR,CR,">>",CR,LF 29 | .byte 0 30 | rts 31 | nop 32 | .else 33 | QT_OK: 34 | .ifdef CONFIG_CBM_ALL 35 | .byte CR,LF,"READY.",CR,LF 36 | .else 37 | .ifdef APPLE 38 | ; binary patch! 39 | .byte CR,0,0,"K",CR,LF 40 | .else 41 | .byte CR,LF,"OK",CR,LF 42 | .endif 43 | .endif 44 | .byte 0 45 | .endif 46 | 47 | QT_BREAK: 48 | 49 | .ifdef KBD 50 | .byte CR,LF," Brk" 51 | .byte 0 52 | .byte $54,$D0 ; ??? 53 | .elseif .def(MICROTAN) 54 | .byte CR,LF," BREAK" 55 | .byte 0 56 | .else 57 | .byte CR,LF,"BREAK" 58 | .byte 0 59 | .endif 60 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/misc1.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | ; ---------------------------------------------------------------------------- 4 | ; CONVERT LINE NUMBER 5 | ; ---------------------------------------------------------------------------- 6 | LINGET: 7 | ldx #$00 8 | stx LINNUM 9 | stx LINNUM+1 10 | L28BE: 11 | bcs L28B7 12 | sbc #$2F 13 | sta CHARAC 14 | lda LINNUM+1 15 | sta INDEX 16 | cmp #$19 17 | bcs L28A0 18 | ; <<<<>>>> 19 | ; NOTE THAT IF (A) = $AB ON THE LINE ABOVE, 20 | ; ON.1 WILL COMPARE = AND CAUSE A CATASTROPHIC 21 | ; JUMP TO $22D9 (FOR GOTO), OR OTHER LOCATIONS 22 | ; FOR OTHER CALLS TO LINGET. 23 | ; 24 | ; YOU CAN SEE THIS IS YOU FIRST PUT "BRK" IN $22D9, 25 | ; THEN TYPE "GO TO 437761". 26 | ; 27 | ; ANY VALUE FROM 437760 THROUGH 440319 WILL CAUSE 28 | ; THE PROBLEM. ($AB00 - $ABFF) 29 | ; <<<<>>>> 30 | lda LINNUM 31 | asl a 32 | rol INDEX 33 | asl a 34 | rol INDEX 35 | adc LINNUM 36 | sta LINNUM 37 | lda INDEX 38 | adc LINNUM+1 39 | sta LINNUM+1 40 | asl LINNUM 41 | rol LINNUM+1 42 | lda LINNUM 43 | adc CHARAC 44 | sta LINNUM 45 | bcc L28EC 46 | inc LINNUM+1 47 | L28EC: 48 | jsr CHRGET 49 | jmp L28BE 50 | 51 | ; ---------------------------------------------------------------------------- 52 | ; "LET" STATEMENT 53 | ; 54 | ; LET = 55 | ; = 56 | ; ---------------------------------------------------------------------------- 57 | LET: 58 | jsr PTRGET 59 | sta FORPNT 60 | sty FORPNT+1 61 | lda #TOKEN_EQUAL 62 | jsr SYNCHR 63 | .ifndef CONFIG_SMALL 64 | lda VALTYP+1 65 | pha 66 | .endif 67 | lda VALTYP 68 | pha 69 | jsr FRMEVL 70 | pla 71 | rol a 72 | jsr CHKVAL 73 | bne LETSTRING 74 | .ifndef CONFIG_SMALL 75 | pla 76 | LET2: 77 | bpl L2923 78 | jsr ROUND_FAC 79 | jsr AYINT 80 | ldy #$00 81 | lda FAC+3 82 | sta (FORPNT),y 83 | iny 84 | lda FAC+4 85 | sta (FORPNT),y 86 | rts 87 | L2923: 88 | .endif 89 | 90 | ; ---------------------------------------------------------------------------- 91 | ; REAL VARIABLE = EXPRESSION 92 | ; ---------------------------------------------------------------------------- 93 | jmp SETFOR 94 | LETSTRING: 95 | .ifndef CONFIG_SMALL 96 | pla 97 | .endif 98 | 99 | ; ---------------------------------------------------------------------------- 100 | ; INSTALL STRING, DESCRIPTOR ADDRESS IS AT FAC+3,4 101 | ; ---------------------------------------------------------------------------- 102 | PUTSTR: 103 | .ifdef CONFIG_CBM_ALL 104 | ldy FORPNT+1 105 | .ifdef CBM1 106 | cpy #$D0 ; TI$ 107 | .else 108 | cpy #$DE 109 | .endif 110 | bne LC92B 111 | jsr FREFAC 112 | cmp #$06 113 | .ifdef CBM2 114 | bne IQERR1 115 | .else 116 | jne IQERR 117 | .endif 118 | ldy #$00 119 | sty FAC 120 | sty FACSIGN 121 | LC8E8: 122 | sty STRNG2 123 | jsr LC91C 124 | jsr MUL10 125 | inc STRNG2 126 | ldy STRNG2 127 | jsr LC91C 128 | jsr COPY_FAC_TO_ARG_ROUNDED 129 | tax 130 | beq LC902 131 | inx 132 | txa 133 | jsr LD9BF 134 | LC902: 135 | ldy STRNG2 136 | iny 137 | cpy #$06 138 | bne LC8E8 139 | jsr MUL10 140 | jsr QINT 141 | ldx #$02 142 | sei 143 | LC912: 144 | lda FAC+2,x 145 | sta TISTR,x 146 | dex 147 | bpl LC912 148 | cli 149 | rts 150 | LC91C: 151 | lda (INDEX),y 152 | jsr CHRGOT2 153 | bcc LC926 154 | IQERR1: 155 | jmp IQERR 156 | LC926: 157 | sbc #$2F 158 | jmp ADDACC 159 | LC92B: 160 | .endif 161 | ldy #$02 162 | lda (FAC_LAST-1),y 163 | cmp FRETOP+1 164 | bcc L2946 165 | bne L2938 166 | dey 167 | lda (FAC_LAST-1),y 168 | cmp FRETOP 169 | bcc L2946 170 | L2938: 171 | ldy FAC_LAST 172 | cpy VARTAB+1 173 | bcc L2946 174 | bne L294D 175 | lda FAC_LAST-1 176 | cmp VARTAB 177 | bcs L294D 178 | L2946: 179 | lda FAC_LAST-1 180 | ldy FAC_LAST 181 | jmp L2963 182 | L294D: 183 | ldy #$00 184 | lda (FAC_LAST-1),y 185 | jsr STRINI 186 | lda DSCPTR 187 | ldy DSCPTR+1 188 | sta STRNG1 189 | sty STRNG1+1 190 | jsr MOVINS 191 | lda #FAC 192 | ldy #$00 193 | L2963: 194 | sta DSCPTR 195 | sty DSCPTR+1 196 | jsr FRETMS 197 | ldy #$00 198 | lda (DSCPTR),y 199 | sta (FORPNT),y 200 | iny 201 | lda (DSCPTR),y 202 | sta (FORPNT),y 203 | iny 204 | lda (DSCPTR),y 205 | sta (FORPNT),y 206 | rts 207 | .ifdef CONFIG_FILE 208 | PRINTH: 209 | jsr CMD 210 | jmp LCAD6 211 | CMD: 212 | jsr GETBYT 213 | beq LC98F 214 | lda #$2C 215 | jsr SYNCHR 216 | LC98F: 217 | php 218 | jsr CHKOUT 219 | stx CURDVC 220 | plp 221 | jmp PRINT 222 | .endif 223 | 224 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/misc2.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | ; ---------------------------------------------------------------------------- 4 | ; "FRE" FUNCTION 5 | ; 6 | ; COLLECTS GARBAGE AND RETURNS # BYTES OF MEMORY LEFT 7 | ; ---------------------------------------------------------------------------- 8 | FRE: 9 | lda VALTYP 10 | beq L3188 11 | jsr FREFAC 12 | L3188: 13 | jsr GARBAG 14 | sec 15 | lda FRETOP 16 | sbc STREND 17 | tay 18 | lda FRETOP+1 19 | sbc STREND+1 20 | ; FALL INTO GIVAYF TO FLOAT THE VALUE 21 | ; NOTE THAT VALUES OVER 32767 WILL RETURN AS NEGATIVE 22 | 23 | ; ---------------------------------------------------------------------------- 24 | ; FLOAT THE SIGNED INTEGER IN A,Y 25 | ; ---------------------------------------------------------------------------- 26 | GIVAYF: 27 | ldx #$00 28 | stx VALTYP 29 | sta FAC+1 30 | sty FAC+2 31 | ldx #$90 32 | jmp FLOAT1 33 | POS: 34 | ldy POSX 35 | 36 | ; ---------------------------------------------------------------------------- 37 | ; FLOAT (Y) INTO FAC, GIVING VALUE 0-255 38 | ; ---------------------------------------------------------------------------- 39 | SNGFLT: 40 | lda #$00 41 | beq GIVAYF 42 | 43 | ; ---------------------------------------------------------------------------- 44 | ; CHECK FOR DIRECT OR RUNNING MODE 45 | ; GIVING ERROR IF DIRECT MODE 46 | ; ---------------------------------------------------------------------------- 47 | ERRDIR: 48 | ldx CURLIN+1 49 | inx 50 | bne RTS9 51 | ldx #ERR_ILLDIR 52 | .ifdef CONFIG_2 53 | .byte $2C 54 | LD288: 55 | ldx #ERR_UNDEFFN 56 | .endif 57 | L31AF: 58 | jmp ERROR 59 | DEF: 60 | jsr FNC 61 | jsr ERRDIR 62 | jsr CHKOPN 63 | lda #$80 64 | sta SUBFLG 65 | jsr PTRGET 66 | jsr CHKNUM 67 | jsr CHKCLS 68 | lda #TOKEN_EQUAL 69 | jsr SYNCHR 70 | .ifndef CONFIG_SMALL 71 | pha 72 | .endif 73 | lda VARPNT+1 74 | pha 75 | lda VARPNT 76 | pha 77 | lda TXTPTR+1 78 | pha 79 | lda TXTPTR 80 | pha 81 | jsr DATA 82 | jmp L3250 83 | FNC: 84 | lda #TOKEN_FN 85 | jsr SYNCHR 86 | ora #$80 87 | sta SUBFLG 88 | jsr PTRGET3 89 | sta FNCNAM 90 | sty FNCNAM+1 91 | jmp CHKNUM 92 | L31F3: 93 | jsr FNC 94 | lda FNCNAM+1 95 | pha 96 | lda FNCNAM 97 | pha 98 | jsr PARCHK 99 | jsr CHKNUM 100 | pla 101 | sta FNCNAM 102 | pla 103 | sta FNCNAM+1 104 | ldy #$02 105 | .ifndef CONFIG_2 106 | ldx #ERR_UNDEFFN 107 | .endif 108 | lda (FNCNAM),y 109 | .ifndef CONFIG_2 110 | beq L31AF 111 | .endif 112 | sta VARPNT 113 | tax 114 | iny 115 | lda (FNCNAM),y 116 | .ifdef CONFIG_2 117 | beq LD288 118 | .endif 119 | sta VARPNT+1 120 | .ifndef CONFIG_SMALL 121 | iny 122 | .endif 123 | L3219: 124 | lda (VARPNT),y 125 | pha 126 | dey 127 | bpl L3219 128 | ldy VARPNT+1 129 | jsr STORE_FAC_AT_YX_ROUNDED 130 | lda TXTPTR+1 131 | pha 132 | lda TXTPTR 133 | pha 134 | lda (FNCNAM),y 135 | sta TXTPTR 136 | iny 137 | lda (FNCNAM),y 138 | sta TXTPTR+1 139 | lda VARPNT+1 140 | pha 141 | lda VARPNT 142 | pha 143 | jsr FRMNUM 144 | pla 145 | sta FNCNAM 146 | pla 147 | sta FNCNAM+1 148 | jsr CHRGOT 149 | beq L324A 150 | jmp SYNERR 151 | L324A: 152 | pla 153 | sta TXTPTR 154 | pla 155 | sta TXTPTR+1 156 | L3250: 157 | ldy #$00 158 | pla 159 | sta (FNCNAM),y 160 | pla 161 | iny 162 | sta (FNCNAM),y 163 | pla 164 | iny 165 | sta (FNCNAM),y 166 | pla 167 | iny 168 | sta (FNCNAM),y 169 | .ifndef CONFIG_SMALL 170 | pla 171 | iny 172 | sta (FNCNAM),y 173 | .endif 174 | rts 175 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/misc3.s: -------------------------------------------------------------------------------- 1 | ; KBD specific patches 2 | 3 | .segment "CODE" 4 | 5 | .ifdef KBD 6 | VARTAB_MINUS_2_TO_AY: 7 | lda VARTAB 8 | sec 9 | sbc #$02 10 | ldy VARTAB+1 11 | bcs LF42C 12 | dey 13 | LF42C: 14 | rts 15 | 16 | ; ---------------------------------------------------------------------------- 17 | GET_UPPER: 18 | lda INPUTBUFFERX,x 19 | LF430: 20 | cmp #'a' 21 | bcc LF43A 22 | cmp #'z'+1 23 | bcs LF43A 24 | LF438: 25 | sbc #$1F 26 | LF43A: 27 | rts 28 | 29 | ; ---------------------------------------------------------------------------- 30 | GETLN: 31 | ldx #$5D 32 | LF43D: 33 | txa 34 | and #$7F 35 | cmp $0340 36 | beq LF44D 37 | sta $0340 38 | lda #$03 39 | jsr LDE48 40 | LF44D: 41 | jsr LDE7F 42 | bne RTS4 43 | cpx #$80 44 | bcc LF44D 45 | RTS4: 46 | rts 47 | 48 | ; ---------------------------------------------------------------------------- 49 | LF457: 50 | lda TXTTAB 51 | ldx TXTTAB+1 52 | LF45B: 53 | sta JMPADRS+1 54 | stx JMPADRS+2 55 | ldy #$01 56 | lda (JMPADRS+1),y 57 | beq LF438 58 | iny 59 | iny 60 | lda (JMPADRS+1),y 61 | dey 62 | cmp LINNUM+1 63 | bne LF472 64 | lda (JMPADRS+1),y 65 | cmp LINNUM 66 | LF472: 67 | bcs LF43A 68 | dey 69 | lda (JMPADRS+1),y 70 | tax 71 | dey 72 | lda (JMPADRS+1),y 73 | bcc LF45B 74 | LF47D: 75 | jmp (JMPADRS+1) 76 | .endif 77 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/msbasic.s: -------------------------------------------------------------------------------- 1 | ; Microsoft BASIC for 6502 2 | ; 3 | ; (first revision of this distribution, 20 Oct 2008, Michael Steil www.pagetable.com) 4 | ; 5 | ; This is a single integrated assembly source tree that can generate seven different versions of 6 | ; Microsoft BASIC for 6502. 7 | ; 8 | ; By running ./make.sh, this will generate all versions and compare them to the original files 9 | ; byte by byte. The CC65 compiler suite is need to build this project. 10 | ; 11 | ; These are the first eight (known) versions of Microsoft BASIC for 6502: 12 | ; 13 | ; Name Release MS Version ROM 9digit INPUTBUFFER extensions .define 14 | ;--------------------------------------------------------------------------------------------------- 15 | ; Commodore BASIC 1 1977 Y Y ZP CBM 16 | ; OSI BASIC 1977 1.0 REV 3.2 Y N ZP - CONFIG_10A 17 | ; AppleSoft I 1977 1.1 N Y $0200 Apple CONFIG_11 18 | ; KIM BASIC 1977 1.1 N Y ZP - CONFIG_11A 19 | ; AppleSoft II 1978 Y Y $0200 Apple CONFIG_2 20 | ; Commodore BASIC 2 1979 Y Y $0200 CBM CONFIG_2A 21 | ; KBD BASIC 1982 Y N $0700 KBD CONFIG_2B 22 | ; MicroTAN 1980 Y Y ZP - CONFIG_2C 23 | ; 24 | ; (Note that this assembly source cannot (yet) build AppleSoft II.) 25 | ; 26 | ; This lists the versions in the order in which they were forked from the Microsoft source base. 27 | ; Commodore BASIC 1, as used on the original PET is the oldest known version of Microsoft BASIC 28 | ; for 6502. It contains some additions to Microsoft's version, like Commodore-style file I/O. 29 | ; 30 | ; The CONFIG_n defines specify what Microsoft-version the OEM version is based on. If CONFIG_2B 31 | ; is defined, for example, CONFIG_2A, CONFIG_2, CONFIG_11A, CONFIG_11 and CONFIG_10A will be 32 | ; defined as well, and all bugfixes up to version 2B will be enabled. 33 | ; 34 | ; The following symbols can be defined in addition: 35 | ; 36 | ; CONFIG_CBM1_PATCHES jump out into CBM1's binary patches instead of doing the right thing inline 37 | ; CONFIG_CBM_ALL add all Commodore-specific additions except file I/O 38 | ; CONFIG_DATAFLG ? 39 | ; CONFIG_EASTER_EGG include the CBM2 "WAIT 6502" easter egg 40 | ; CONFIG_FILE support Commodore PRINT#, INPUT#, GET#, CMD 41 | ; CONFIG_IO_MSB all I/O has bit #7 set 42 | ; CONFIG_MONCOUT_DESTROYS_Y Y needs to be preserved when calling MONCOUT 43 | ; CONFIG_NO_CR terminal doesn't need explicit CRs on line ends 44 | ; CONFIG_NO_LINE_EDITING disable support for Microsoft-style "@", "_", BEL etc. 45 | ; CONFIG_NO_POKE don't support PEEK, POKE and WAIT 46 | ; CONFIG_NO_READ_Y_IS_ZERO_HACK don't do a very volatile trick that saves one byte 47 | ; CONFIG_NULL support for the NULL statement 48 | ; CONFIG_PEEK_SAVE_LINNUM preserve LINNUM on a PEEK 49 | ; CONFIG_PRINTNULLS whether PRINTNULLS does anything 50 | ; CONFIG_PRINT_CR print CR when line end reached 51 | ; CONFIG_RAM optimizations for RAM version of BASIC, only use on 1.x 52 | ; CONFIG_ROR_WORKAROUND use workaround for buggy 6502s from 1975/1976; not safe for CONFIG_SMALL! 53 | ; CONFIG_SAFE_NAMENOTFOUND check both bytes of the caller's address in NAMENOTFOUND 54 | ; CONFIG_SCRTCH_ORDER where in the init code to call SCRTCH 55 | ; CONFIG_SMALL use 6 digit FP instead of 9 digit, use 2 character error messages, don't have GET 56 | ; 57 | ; Changing symbol definitions can alter an existing base configuration, but it not guaranteed to assemble 58 | ; or work correctly. 59 | ; 60 | ; Credits: 61 | ; * main work by Michael Steil 62 | ; * function names and all uppercase comments taken from Bob Sander-Cederlof's excellent AppleSoft II disassembly: 63 | ; http://www.txbobsc.com/scsc/scdocumentor/ 64 | ; * Applesoft lite by Tom Greene http://cowgod.org/replica1/applesoft/ helped a lot, too. 65 | ; * Thanks to Joe Zbicak for help with Intellision Keyboard BASIC 66 | ; * This work is dedicated to the memory of my dear hacking pal Michael "acidity" Kollmann. 67 | 68 | .debuginfo + 69 | 70 | .setcpu "6502" 71 | .macpack longbranch 72 | 73 | .include "defines.s" 74 | .include "macros.s" 75 | .include "zeropage.s" 76 | 77 | .include "header.s" 78 | .include "token.s" 79 | .include "error.s" 80 | .include "message.s" 81 | .include "memory.s" 82 | .include "program.s" 83 | .include "flow1.s" 84 | .include "loadsave.s" 85 | .include "flow2.s" 86 | .include "misc1.s" 87 | .include "print.s" 88 | .include "input.s" 89 | .include "eval.s" 90 | .include "var.s" 91 | .include "array.s" 92 | .include "misc2.s" 93 | .include "string.s" 94 | .include "misc3.s" 95 | .include "poke.s" 96 | .include "float.s" 97 | .include "chrget.s" 98 | .include "rnd.s" 99 | .include "trig.s" 100 | .include "init.s" 101 | .include "extra.s" 102 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/osi.cfg: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | ZP: start = $0000, size = $0100, type = rw; 3 | BASROM: start = $A000, size = $3FFF, fill = no, file = %O; 4 | DUMMY: start = $0000, size = $00FF, file = ""; 5 | } 6 | 7 | SEGMENTS { 8 | ZEROPAGE: load = ZP, type = zp; 9 | HEADER: load = BASROM, type = ro; 10 | VECTORS: load = BASROM, type = ro; 11 | KEYWORDS: load = BASROM, type = ro; 12 | ERROR: load = BASROM, type = ro; 13 | CODE: load = BASROM, type = ro; 14 | CHRGET: load = BASROM, type = ro; 15 | INIT: load = BASROM, type = ro; 16 | EXTRA: load = BASROM, type = ro; 17 | DUMMY: load = DUMMY; # don't include 18 | } 19 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/osi_extra.s: -------------------------------------------------------------------------------- 1 | .segment "EXTRA" 2 | 3 | .include "CFFA1_API.s" 4 | 5 | ESC = $1B ; Escape character 6 | 7 | IN = $0200 ; Buffer used by GetLine. From $0200 through $027F (shared with Woz Mon) 8 | 9 | SaveZeroPage = $9140 ; Routines in CFFA1 firmware 10 | RestoreZeroPage = $9135 11 | 12 | ; Read key from keyboard. 13 | MONRDKEY: 14 | LDA $D011 ; keyboard status 15 | BPL MONRDKEY ; branch until key pressed 16 | LDA $D010 ; keyboard data 17 | RTS 18 | 19 | ; Check for presence of CFFA1 by testing for two ID bytes 20 | CheckForCFFA1: 21 | LDA CFFA1_ID1 ; First CFFA1 ID byte 22 | CMP #$CF ; Should contain $CF 23 | BNE NoCFFA1 24 | LDA CFFA1_ID2 ; Second CFFA1 ID byte 25 | CMP #$FA ; Should contain $FA 26 | BNE NoCFFA1 27 | RTS 28 | NoCFFA1: 29 | LDX #NoCFFA1String 31 | JSR PrintString 32 | PLA ; pop return address so we return to caller of calling routine 33 | PLA 34 | RTS 35 | 36 | ; Implementation of LOAD using a CFFA1 flash interface if present. 37 | LOAD: 38 | JSR CheckForCFFA1 ; returns to caller of this routine if not present 39 | 40 | ; Prompt user for filename to load 41 | 42 | LDX #FilenameString 44 | JSR PrintString 45 | 46 | ; Get filename 47 | JSR GetLine 48 | 49 | ; If user hit , cancel the load 50 | BCS Return1 51 | 52 | ; If filename was empty, call CFFA1 menu 53 | LDA IN ; string length 54 | BNE LoadFile ; Was is zero length? 55 | JSR Menu ; If so, call CFFA1 menu 56 | RTS ; and return 57 | 58 | ; Need to save the page zero locations used by the CFFA1 because they are also used by BASIC. 59 | 60 | LoadFile: 61 | JSR SaveZeroPage 62 | 63 | ; Call CFFA1 routines to load file. 64 | 65 | LDA #IN 68 | STA Filename+1 69 | 70 | LDA #$00 ; Destination of $0000 means use file's Auxtype value 71 | STA Destination 72 | STA Destination+1 73 | 74 | LDX #CFFA1_ReadFile ; Write the file 75 | JSR CFFA1_API 76 | BCC Restore1 ; Branch if succeeded 77 | LDX #CFFA1_DisplayError ; Otherwise display error message 78 | JSR CFFA1_API 79 | 80 | ; Now restore the page zero locations 81 | Restore1: 82 | JSR RestoreZeroPage 83 | 84 | Return1: 85 | RTS 86 | 87 | ; Implementation of SAVE using a CFFA1 flash interface if present. 88 | SAVE: 89 | JSR CheckForCFFA1 90 | 91 | ; Prompt user for filename to save 92 | 93 | LDX #FilenameString 95 | JSR PrintString 96 | 97 | ; Get filename 98 | JSR GetLine 99 | 100 | ; If user hit , cancel the save 101 | BCS Return2 102 | 103 | ; If filename was empty, call CFFA1 menu 104 | LDA IN ; string length 105 | BNE SaveFile ; Was is zero length? 106 | JSR Menu ; If so, call CFFA1 menu 107 | RTS ; and return 108 | 109 | ; Need to save the page zero locations used by the CFFA1 because they are also used by BASIC. 110 | SaveFile: 111 | JSR SaveZeroPage 112 | 113 | ; Call CFFA1 routines to save file. Save memory from RAMSTART2 to 114 | ; MEMSIZ. 115 | 116 | LDA #IN 119 | STA Filename+1 120 | 121 | LDA #RAMSTART2 124 | STA Destination+1 125 | 126 | SEC 127 | LDA MEMSIZ ; Length is end address minus start address 128 | SBC Destination 129 | STA FileSize 130 | 131 | LDA MEMSIZ+1 132 | SBC Destination+1 133 | STA FileSize+1 134 | 135 | LDA #kFiletypeBinary ; file type is binary 136 | STA Filetype 137 | 138 | LDA Destination ; Aux type is start address 139 | STA Auxtype 140 | LDA Destination+1 141 | STA Auxtype+1 142 | 143 | LDX #CFFA1_WriteFile ; Write the file 144 | JSR CFFA1_API 145 | BCC Restore2 ; Branch if succeeded 146 | LDX #CFFA1_DisplayError ; Otherwise display error message 147 | JSR CFFA1_API 148 | 149 | ; Now restore the page zero locations 150 | Restore2: 151 | JSR RestoreZeroPage 152 | 153 | Return2: 154 | RTS 155 | 156 | ; Print a string 157 | ; Pass address of string in X (low) and Y (high). 158 | ; String must be terminated in a null. 159 | ; Cannot be longer than 256 characters. 160 | ; Registers changed: A, Y 161 | ; 162 | PrintString: 163 | STX TEMP1 164 | STY TEMP1+1 165 | LDY #0 166 | @loop: LDA (TEMP1),Y 167 | BEQ done 168 | JSR MONCOUT 169 | INY 170 | BNE @loop ; if doesn't branch, string is too long 171 | done: RTS 172 | 173 | ; String input routine. 174 | ; Enter characters from the keyboard terminated in or . 175 | ; Characters are echoed. 176 | ; Can be up to 127 characters. 177 | ; Returns: 178 | ; Length stored at IN (doesn't include zero byte). 179 | ; Characters stored starting at IN+1 ($0201-$027F, same as Woz Monitor) 180 | ; String is terminated in a 0 byte. 181 | ; Carry set if user hit , clear if used or max string length reached. 182 | ; Registers changed: A, X 183 | GetLine: 184 | LDX #0 ; Initialize index into buffer 185 | loop: 186 | JSR MONRDKEY ; Get character from keyboard 187 | AND #$7F ; Convert to ASCII 188 | CMP #CR ; key pressed? 189 | BEQ EnterPressed ; If so, handle it 190 | CMP #ESC ; key pressed? 191 | BEQ EscapePressed ; If so, handle it 192 | JSR MONCOUT ; Echo the key pressed 193 | STA IN+1,X ; Store character in buffer (skip first length byte) 194 | INX ; Advance index into buffer 195 | CPX #$7E ; Buffer full? 196 | BEQ EnterPressed ; If so, return as if was pressed 197 | BNE loop ; Always taken 198 | EnterPressed: 199 | CLC ; Clear carry to indicate pressed and fall through 200 | EscapePressed: 201 | LDA #0 202 | STA IN+1,X ; Store 0 at end of buffer 203 | STX IN ; Store length of string 204 | RTS ; Return 205 | 206 | NoCFFA1String: 207 | .byte "?NO CFFA1 ERROR",CR,0 208 | 209 | FilenameString: 210 | .byte "FILENAME? ",0 211 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/osi_iscntc.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | ISCNTC: 3 | lda $D011 ; keyboard status 4 | bmi L0ECC ; branch if key pressed 5 | rts ; return 6 | L0ECC: 7 | lda $D010 ; get key data 8 | cmp #$83 ; is it Ctrl-C ? 9 | ;!!! *used*to* run into "STOP" 10 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/poke.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | .ifndef CONFIG_NO_POKE 4 | ; ---------------------------------------------------------------------------- 5 | ; EVALUATE "EXP1,EXP2" 6 | ; 7 | ; CONVERT EXP1 TO 16-BIT NUMBER IN LINNUM 8 | ; CONVERT EXP2 TO 8-BIT NUMBER IN X-REG 9 | ; ---------------------------------------------------------------------------- 10 | GTNUM: 11 | jsr FRMNUM 12 | jsr GETADR 13 | 14 | ; ---------------------------------------------------------------------------- 15 | ; EVALUATE ",EXPRESSION" 16 | ; CONVERT EXPRESSION TO SINGLE BYTE IN X-REG 17 | ; ---------------------------------------------------------------------------- 18 | COMBYTE: 19 | jsr CHKCOM 20 | jmp GETBYT 21 | 22 | ; ---------------------------------------------------------------------------- 23 | ; CONVERT (FAC) TO A 16-BIT VALUE IN LINNUM 24 | ; ---------------------------------------------------------------------------- 25 | GETADR: 26 | lda FACSIGN 27 | .ifdef APPLE 28 | nop ; PATCH 29 | nop 30 | .else 31 | bmi GOIQ 32 | .endif 33 | lda FAC 34 | cmp #$91 35 | bcs GOIQ 36 | jsr QINT 37 | lda FAC_LAST-1 38 | ldy FAC_LAST 39 | sty LINNUM 40 | sta LINNUM+1 41 | rts 42 | 43 | ; ---------------------------------------------------------------------------- 44 | ; "PEEK" FUNCTION 45 | ; ---------------------------------------------------------------------------- 46 | PEEK: 47 | .ifdef CONFIG_PEEK_SAVE_LINNUM 48 | lda LINNUM+1 49 | pha 50 | lda LINNUM 51 | pha 52 | .endif 53 | jsr GETADR 54 | ldy #$00 55 | .ifdef CBM1 56 | ; disallow PEEK between $C000 and $DFFF 57 | cmp #$C0 58 | bcc LD6F3 59 | cmp #$E1 60 | bcc LD6F6 61 | LD6F3: 62 | .endif 63 | .ifdef CBM2 64 | nop ; patch that disables the compares above 65 | nop 66 | nop 67 | nop 68 | nop 69 | nop 70 | nop 71 | nop 72 | .endif 73 | lda (LINNUM),y 74 | tay 75 | .ifdef CONFIG_PEEK_SAVE_LINNUM 76 | pla 77 | sta LINNUM 78 | pla 79 | sta LINNUM+1 80 | .endif 81 | LD6F6: 82 | jmp SNGFLT 83 | 84 | ; ---------------------------------------------------------------------------- 85 | ; "POKE" STATEMENT 86 | ; ---------------------------------------------------------------------------- 87 | POKE: 88 | jsr GTNUM 89 | txa 90 | ldy #$00 91 | sta (LINNUM),y 92 | rts 93 | 94 | ; ---------------------------------------------------------------------------- 95 | ; "WAIT" STATEMENT 96 | ; ---------------------------------------------------------------------------- 97 | WAIT: 98 | jsr GTNUM 99 | stx FORPNT 100 | ldx #$00 101 | jsr CHRGOT 102 | .ifdef CONFIG_EASTER_EGG 103 | beq EASTER_EGG 104 | .else 105 | beq L3628 106 | .endif 107 | jsr COMBYTE 108 | L3628: 109 | stx FORPNT+1 110 | ldy #$00 111 | L362C: 112 | lda (LINNUM),y 113 | eor FORPNT+1 114 | and FORPNT 115 | beq L362C 116 | RTS3: 117 | rts 118 | .endif 119 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/print.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | PRSTRING: 4 | jsr STRPRT 5 | L297E: 6 | jsr CHRGOT 7 | 8 | ; ---------------------------------------------------------------------------- 9 | ; "PRINT" STATEMENT 10 | ; ---------------------------------------------------------------------------- 11 | PRINT: 12 | beq CRDO 13 | PRINT2: 14 | beq L29DD 15 | cmp #TOKEN_TAB 16 | beq L29F5 17 | cmp #TOKEN_SPC 18 | .ifdef CONFIG_2 19 | clc ; also AppleSoft II 20 | .endif 21 | beq L29F5 22 | cmp #',' 23 | ; Pre-KIM had no CLC. KIM added the CLC 24 | ; here. Post-KIM moved the CLC up... 25 | ; (makes no sense on KIM, liveness = 0) 26 | .if .def(CONFIG_11A) && (!.def(CONFIG_2)) 27 | clc 28 | .endif 29 | beq L29DE 30 | cmp #$3B 31 | beq L2A0D 32 | jsr FRMEVL 33 | bit VALTYP 34 | bmi PRSTRING 35 | jsr FOUT 36 | jsr STRLIT 37 | .ifndef CONFIG_NO_CR 38 | ldy #$00 39 | lda (FAC_LAST-1),y 40 | clc 41 | adc POSX 42 | .ifdef KBD 43 | cmp #$28 44 | .else 45 | cmp Z17 46 | .endif 47 | bcc L29B1 48 | jsr CRDO 49 | L29B1: 50 | .endif 51 | jsr STRPRT 52 | .ifdef KBD 53 | jmp L297E 54 | .else 55 | jsr OUTSP 56 | bne L297E ; branch always 57 | .endif 58 | 59 | .ifdef KBD 60 | ; PATCHES 61 | LE86C: 62 | pla 63 | jmp CONTROL_C_TYPED 64 | LE870: 65 | jsr GETBYT 66 | txa 67 | LE874: 68 | beq LE878 69 | bpl LE8F2 70 | LE878: 71 | jmp IQERR 72 | ; PATCHES 73 | .endif 74 | 75 | 76 | 77 | .ifndef KBD 78 | L29B9: 79 | .ifdef CBM2 80 | lda #$00 81 | sta INPUTBUFFER,x 82 | ldx #<(INPUTBUFFER-1) 83 | ldy #>(INPUTBUFFER-1) 84 | .else 85 | .ifndef APPLE 86 | ldy #$00 87 | sty INPUTBUFFER,x 88 | ldx #LINNUM+1 89 | .endif 90 | .ifdef MICROTAN 91 | bne CRDO2 92 | .endif 93 | .endif 94 | .ifdef CONFIG_FILE 95 | lda CURDVC 96 | bne L29DD 97 | .endif 98 | .endif 99 | 100 | 101 | CRDO: 102 | .if .def(CONFIG_PRINTNULLS) && .def(CONFIG_FILE) 103 | lda CURDVC 104 | bne LC9D8 105 | sta POSX 106 | LC9D8: 107 | .endif 108 | lda #CRLF_1 109 | .ifndef CONFIG_CBM_ALL 110 | sta POSX 111 | .endif 112 | jsr OUTDO 113 | CRDO2: 114 | lda #CRLF_2 115 | jsr OUTDO 116 | 117 | PRINTNULLS: 118 | .ifdef KBD 119 | lda #$00 120 | sta POSX 121 | eor #$FF 122 | .else 123 | .if .def(CONFIG_NULL) || .def(CONFIG_PRINTNULLS) 124 | .ifdef CONFIG_FILE 125 | ; Although there is no statement for it, 126 | ; CBM1 had NULL support and ignores 127 | ; it when not targeting the screen, 128 | ; CBM2 dropped it completely. 129 | lda CURDVC 130 | bne L29DD 131 | .endif 132 | txa 133 | pha 134 | ldx Z15 135 | beq L29D9 136 | lda #$00 137 | L29D3: 138 | jsr OUTDO 139 | dex 140 | bne L29D3 141 | L29D9: 142 | stx POSX 143 | pla 144 | tax 145 | .else 146 | .ifndef CONFIG_2 147 | lda #$00 148 | sta POSX 149 | .endif 150 | eor #$FF 151 | .endif 152 | .endif 153 | L29DD: 154 | rts 155 | L29DE: 156 | lda POSX 157 | .ifndef CONFIG_NO_CR 158 | .ifdef KBD 159 | cmp #$1A 160 | .else 161 | cmp Z18 162 | .endif 163 | bcc L29EA 164 | jsr CRDO 165 | jmp L2A0D 166 | L29EA: 167 | .endif 168 | sec 169 | L29EB: 170 | .ifdef CONFIG_CBM_ALL 171 | sbc #$0A 172 | .else 173 | .ifdef KBD 174 | sbc #$0D 175 | .else 176 | sbc #$0E 177 | .endif 178 | .endif 179 | bcs L29EB 180 | eor #$FF 181 | adc #$01 182 | bne L2A08 183 | L29F5: 184 | .ifdef CONFIG_11A 185 | php 186 | .else 187 | pha 188 | .endif 189 | jsr GTBYTC 190 | cmp #')' 191 | .ifdef CONFIG_11A 192 | .ifdef CONFIG_2 193 | bne SYNERR4 194 | .else 195 | jne SYNERR 196 | .endif 197 | plp 198 | bcc L2A09 199 | .else 200 | .ifdef CONFIG_11 201 | jne SYNERR 202 | .else 203 | bne SYNERR4 204 | .endif 205 | pla 206 | cmp #TOKEN_TAB 207 | .ifdef CONFIG_11 208 | bne L2A09 209 | .else 210 | bne L2A0A 211 | .endif 212 | .endif 213 | txa 214 | sbc POSX 215 | bcc L2A0D 216 | .ifndef CONFIG_11 217 | beq L2A0D 218 | .endif 219 | L2A08: 220 | tax 221 | .ifdef CONFIG_11 222 | L2A09: 223 | inx 224 | .endif 225 | L2A0A: 226 | .ifndef CONFIG_11 227 | jsr OUTSP 228 | .endif 229 | dex 230 | .ifndef CONFIG_11 231 | bne L2A0A 232 | .else 233 | bne L2A13 234 | .endif 235 | L2A0D: 236 | jsr CHRGET 237 | jmp PRINT2 238 | .ifdef CONFIG_11 239 | L2A13: 240 | jsr OUTSP 241 | bne L2A0A 242 | .endif 243 | 244 | ; ---------------------------------------------------------------------------- 245 | ; PRINT STRING AT (Y,A) 246 | ; ---------------------------------------------------------------------------- 247 | STROUT: 248 | jsr STRLIT 249 | 250 | ; ---------------------------------------------------------------------------- 251 | ; PRINT STRING AT (FACMO,FACLO) 252 | ; ---------------------------------------------------------------------------- 253 | STRPRT: 254 | jsr FREFAC 255 | tax 256 | ldy #$00 257 | inx 258 | L2A22: 259 | dex 260 | beq L29DD 261 | lda (INDEX),y 262 | jsr OUTDO 263 | iny 264 | cmp #$0D 265 | bne L2A22 266 | jsr PRINTNULLS 267 | jmp L2A22 268 | ; ---------------------------------------------------------------------------- 269 | OUTSP: 270 | .ifdef CONFIG_FILE 271 | .ifndef CBM1 272 | ; on non-screen devices, print SPACE 273 | ; instead of CRSR RIGHT 274 | lda CURDVC 275 | beq LCA40 276 | lda #$20 277 | .byte $2C 278 | LCA40: 279 | .endif 280 | lda #$1D ; CRSR RIGHT 281 | .else 282 | lda #$20 283 | .endif 284 | .byte $2C 285 | OUTQUES: 286 | lda #$3F 287 | 288 | ; ---------------------------------------------------------------------------- 289 | ; PRINT CHAR FROM (A) 290 | ; ---------------------------------------------------------------------------- 291 | OUTDO: 292 | .ifndef KBD 293 | bit Z14 294 | bmi L2A56 295 | .endif 296 | .if .def(CONFIG_PRINT_CR) || .def(CBM1) 297 | ; Commodore forgot to remove this in CBM1 298 | pha 299 | .endif 300 | .ifdef CBM1 301 | cmp #$1D ; CRSR RIGHT 302 | beq LCA6A 303 | cmp #$9D ; CRSR LEFT 304 | beq LCA5A 305 | cmp #$14 ; DEL 306 | bne LCA64 307 | LCA5A: 308 | lda POSX 309 | beq L2A4E 310 | lda CURDVC 311 | bne L2A4E 312 | dec POSX 313 | LCA64: 314 | and #$7F 315 | .endif 316 | .ifndef CBM2 317 | cmp #$20 318 | bcc L2A4E 319 | .endif 320 | LCA6A: 321 | .ifdef CONFIG_CBM1_PATCHES 322 | lda CURDVC 323 | jsr PATCH6 324 | nop 325 | .endif 326 | .ifdef CONFIG_PRINT_CR 327 | lda POSX 328 | cmp Z17 329 | bne L2A4C 330 | .ifdef APPLE 331 | nop ; PATCH! 332 | nop ; don't print CR 333 | nop 334 | .else 335 | jsr CRDO 336 | .endif 337 | L2A4C: 338 | .endif 339 | .ifndef CONFIG_CBM_ALL 340 | inc POSX 341 | .endif 342 | L2A4E: 343 | .if .def(CONFIG_PRINT_CR) || .def(CBM1) 344 | ; Commodore forgot to remove this in CBM1 345 | pla 346 | .endif 347 | .ifdef CONFIG_MONCOUT_DESTROYS_Y 348 | sty DIMFLG 349 | .endif 350 | .ifdef CONFIG_IO_MSB 351 | ora #$80 352 | .endif 353 | jsr MONCOUT 354 | .ifdef CONFIG_IO_MSB 355 | and #$7F 356 | .endif 357 | .ifdef CONFIG_MONCOUT_DESTROYS_Y 358 | ldy DIMFLG 359 | .endif 360 | .ifdef OSI 361 | nop 362 | nop 363 | nop 364 | nop 365 | .endif 366 | L2A56: 367 | and #$FF 368 | LE8F2: 369 | rts 370 | 371 | ; ---------------------------------------------------------------------------- 372 | ; ??? 373 | ; ---------------------------------------------------------------------------- 374 | .ifdef KBD 375 | LE8F3: 376 | pha 377 | lda $047F 378 | clc 379 | beq LE900 380 | lda #$00 381 | sta $047F 382 | sec 383 | LE900: 384 | pla 385 | rts 386 | .endif 387 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/regress.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d orig ]; then 2 | echo Please first run make.sh on the original .s files, create 3 | echo the directory \"orig\", and copy all .bin files from \"tmp\" 4 | echo into \"orig\". 5 | exit; 6 | fi 7 | 8 | for i in cbmbasic1 cbmbasic2 kbdbasic osi kb9 applesoft microtan; do 9 | 10 | echo $i 11 | ca65 -D $i msbasic.s -o tmp/$i.o && 12 | ld65 -C $i.cfg tmp/$i.o -o tmp/$i-new.bin -Ln tmp/$i.lbl && 13 | xxd -g 1 orig/$i.bin > tmp/$i.bin.txt 14 | xxd -g 1 tmp/$i-new.bin > tmp/$i-new.bin.txt 15 | diff -u tmp/$i.bin.txt tmp/$i-new.bin.txt | head 16 | 17 | done 18 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/rnd.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | ; ---------------------------------------------------------------------------- 4 | ; "RND" FUNCTION 5 | ; ---------------------------------------------------------------------------- 6 | 7 | .ifdef KBD 8 | RND: 9 | ldx #$10 10 | jsr SIGN 11 | beq LFC26 12 | bmi LFC10 13 | lda RNDSEED 14 | ldy RNDSEED+1 15 | LFBFA: 16 | sta FAC+2 17 | sty FAC+1 18 | LFBFE: 19 | asl a 20 | asl a 21 | eor FAC+2 22 | asl a 23 | eor FAC+1 24 | asl a 25 | asl a 26 | asl a 27 | asl a 28 | eor FAC+1 29 | asl a 30 | rol FAC+2 31 | rol FAC+1 32 | LFC10: 33 | lda FAC+2 34 | dex 35 | bne LFBFE 36 | sta RNDSEED 37 | sta FAC+3 38 | lda FAC+1 39 | sta RNDSEED+1 40 | lda #$80 41 | sta FAC 42 | stx FACSIGN 43 | jmp NORMALIZE_FAC2 44 | LFC26: 45 | ldy $03CA 46 | lda $03C7 47 | ora #$01 48 | GOMOVMF: 49 | bne LFBFA 50 | .byte $F0 51 | .else 52 | ; <<< THESE ARE MISSING ONE BYTE FOR FP VALUES >>> 53 | ; (non CONFIG_SMALL) 54 | CONRND1: 55 | .byte $98,$35,$44,$7A 56 | CONRND2: 57 | .byte $68,$28,$B1,$46 58 | RND: 59 | jsr SIGN 60 | .ifdef CONFIG_CBM_ALL 61 | bmi L3F01 62 | bne LDF63 63 | lda ENTROPY 64 | sta FAC+1 65 | lda ENTROPY+4 66 | sta FAC+2 67 | lda ENTROPY+1 68 | sta FAC+3 69 | lda ENTROPY+5 70 | sta FAC+4 71 | jmp LDF88 72 | LDF63: 73 | .else 74 | tax 75 | bmi L3F01 76 | .endif 77 | lda #RNDSEED 79 | jsr LOAD_FAC_FROM_YA 80 | .ifndef CONFIG_CBM_ALL 81 | txa 82 | beq RTS19 83 | .endif 84 | lda #CONRND1 86 | jsr FMULT 87 | lda #CONRND2 89 | jsr FADD 90 | L3F01: 91 | ldx FAC_LAST 92 | lda FAC+1 93 | sta FAC_LAST 94 | stx FAC+1 95 | .ifdef CONFIG_CBM_ALL 96 | ldx FAC+2 97 | lda FAC+3 98 | sta FAC+2 99 | stx FAC+3 100 | LDF88: 101 | .endif 102 | lda #$00 103 | sta FACSIGN 104 | lda FAC 105 | sta FACEXTENSION 106 | lda #$80 107 | sta FAC 108 | jsr NORMALIZE_FAC2 109 | ldx #RNDSEED 111 | GOMOVMF: 112 | jmp STORE_FAC_AT_YX_ROUNDED 113 | .endif 114 | 115 | .segment "CHRGET" 116 | ; ---------------------------------------------------------------------------- 117 | ; INITIAL VALUE FOR RANDOM NUMBER, ALSO COPIED 118 | ; IN ALONG WITH CHRGET, BUT ERRONEOUSLY: 119 | ; <<< THE LAST BYTE IS NOT COPIED >>> 120 | ; (on all non-CONFIG_SMALL) 121 | ; ---------------------------------------------------------------------------- 122 | GENERIC_RNDSEED: 123 | .ifndef KBD 124 | ; random number seed 125 | .ifdef CONFIG_SMALL 126 | .byte $80,$4F,$C7,$52 127 | .else 128 | .ifdef CONFIG_11 129 | .byte $80,$4F,$C7,$52,$58 130 | .else 131 | .byte $80,$4F,$C7,$52,$59 132 | .endif 133 | .endif 134 | .endif 135 | GENERIC_CHRGET_END: 136 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/token.s: -------------------------------------------------------------------------------- 1 | init_token_tables 2 | 3 | keyword_rts "END", END 4 | keyword_rts "FOR", FOR 5 | keyword_rts "NEXT", NEXT 6 | keyword_rts "DATA", DATA 7 | .ifdef CONFIG_FILE 8 | keyword_rts "INPUT#", INPUTH 9 | .endif 10 | keyword_rts "INPUT", INPUT 11 | keyword_rts "DIM", DIM 12 | keyword_rts "READ", READ 13 | .ifdef APPLE 14 | keyword_rts "PLT", PLT 15 | .else 16 | keyword_rts "LET", LET 17 | .endif 18 | keyword_rts "GOTO", GOTO, TOKEN_GOTO 19 | keyword_rts "RUN", RUN 20 | keyword_rts "IF", IF 21 | keyword_rts "RESTORE", RESTORE 22 | keyword_rts "GOSUB", GOSUB, TOKEN_GOSUB 23 | keyword_rts "RETURN", POP 24 | .ifdef APPLE 25 | keyword_rts "TEX", TEX, TOKEN_REM 26 | .else 27 | keyword_rts "REM", REM, TOKEN_REM 28 | .endif 29 | keyword_rts "STOP", STOP 30 | keyword_rts "ON", ON 31 | .ifdef CONFIG_NULL 32 | keyword_rts "NULL", NULL 33 | .endif 34 | .ifdef KBD 35 | keyword_rts "PLOD", PLOD 36 | keyword_rts "PSAV", PSAV 37 | keyword_rts "VLOD", VLOD 38 | keyword_rts "VSAV", VSAV 39 | .endif 40 | .ifndef CONFIG_NO_POKE 41 | keyword_rts "WAIT", WAIT 42 | .endif 43 | .ifndef KBD 44 | keyword_rts "LOAD", LOAD 45 | keyword_rts "SAVE", SAVE 46 | .endif 47 | .ifdef CONFIG_CBM_ALL 48 | keyword_rts "VERIFY", VERIFY 49 | .endif 50 | keyword_rts "DEF", DEF 51 | .ifdef KBD 52 | keyword_rts "SLOD", SLOD 53 | .endif 54 | .ifndef CONFIG_NO_POKE 55 | keyword_rts "POKE", POKE 56 | .endif 57 | .ifdef CONFIG_FILE 58 | keyword_rts "PRINT#", PRINTH 59 | .endif 60 | keyword_rts "PRINT", PRINT, TOKEN_PRINT 61 | keyword_rts "CONT", CONT 62 | keyword_rts "LIST", LIST 63 | .ifdef CONFIG_CBM_ALL 64 | keyword_rts "CLR", CLEAR 65 | .else 66 | keyword_rts "CLEAR", CLEAR 67 | .endif 68 | .ifdef CONFIG_FILE 69 | keyword_rts "CMD", CMD 70 | keyword_rts "SYS", SYS 71 | keyword_rts "OPEN", OPEN 72 | keyword_rts "CLOSE", CLOSE 73 | .endif 74 | .ifndef CONFIG_SMALL 75 | keyword_rts "GET", GET 76 | .endif 77 | .ifdef KBD 78 | keyword_rts "PRT", PRT 79 | .endif 80 | keyword_rts "NEW", NEW 81 | 82 | count_tokens 83 | 84 | keyword "TAB(", TOKEN_TAB 85 | keyword "TO", TOKEN_TO 86 | keyword "FN", TOKEN_FN 87 | keyword "SPC(", TOKEN_SPC 88 | keyword "THEN", TOKEN_THEN 89 | keyword "NOT", TOKEN_NOT 90 | keyword "STEP", TOKEN_STEP 91 | keyword "+", TOKEN_PLUS 92 | keyword "-", TOKEN_MINUS 93 | keyword "*" 94 | keyword "/" 95 | .ifdef KBD 96 | keyword "#" 97 | .else 98 | keyword "^" 99 | .endif 100 | keyword "AND" 101 | keyword "OR" 102 | keyword ">", TOKEN_GREATER 103 | keyword "=", TOKEN_EQUAL 104 | keyword "<" 105 | 106 | .segment "VECTORS" 107 | UNFNC: 108 | 109 | keyword_addr "SGN", SGN, TOKEN_SGN 110 | keyword_addr "INT", INT 111 | keyword_addr "ABS", ABS 112 | .ifdef KBD 113 | keyword_addr "VER", VER 114 | .endif 115 | .ifndef CONFIG_NO_POKE 116 | .ifdef CONFIG_RAM 117 | keyword_addr "USR", IQERR 118 | .else 119 | keyword_addr "USR", USR 120 | .endif 121 | .endif 122 | keyword_addr "FRE", FRE 123 | keyword_addr "POS", POS 124 | keyword_addr "SQR", SQR 125 | keyword_addr "RND", RND 126 | keyword_addr "LOG", LOG 127 | keyword_addr "EXP", EXP 128 | .segment "VECTORS" 129 | UNFNC_COS: 130 | keyword_addr "COS", COS 131 | .segment "VECTORS" 132 | UNFNC_SIN: 133 | keyword_addr "SIN", SIN 134 | .segment "VECTORS" 135 | UNFNC_TAN: 136 | keyword_addr "TAN", TAN 137 | .segment "VECTORS" 138 | UNFNC_ATN: 139 | keyword_addr "ATN", ATN 140 | .ifdef KBD 141 | keyword_addr "GETC", GETC 142 | .endif 143 | .ifndef CONFIG_NO_POKE 144 | keyword_addr "PEEK", PEEK 145 | .endif 146 | keyword_addr "LEN", LEN 147 | keyword_addr "STR$", STR 148 | keyword_addr "VAL", VAL 149 | keyword_addr "ASC", ASC 150 | keyword_addr "CHR$", CHRSTR 151 | keyword_addr "LEFT$", LEFTSTR, TOKEN_LEFTSTR 152 | keyword_addr "RIGHT$", RIGHTSTR 153 | keyword_addr "MID$", MIDSTR 154 | .ifdef CONFIG_2 155 | keyword "GO", TOKEN_GO 156 | .endif 157 | .segment "KEYWORDS" 158 | .byte 0 159 | 160 | .segment "VECTORS" 161 | MATHTBL: 162 | .byte $79 163 | .word FADDT-1 164 | .byte $79 165 | .word FSUBT-1 166 | .byte $7B 167 | .word FMULTT-1 168 | .byte $7B 169 | .word FDIVT-1 170 | .byte $7F 171 | .word FPWRT-1 172 | .byte $50 173 | .word TAND-1 174 | .byte $46 175 | .word OR-1 176 | .byte $7D 177 | .word NEGOP-1 178 | .byte $5A 179 | .word EQUOP-1 180 | .byte $64 181 | .word RELOPS-1 182 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/trig.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | SIN_COS_TAN_ATN: 4 | ; ---------------------------------------------------------------------------- 5 | ; "COS" FUNCTION 6 | ; ---------------------------------------------------------------------------- 7 | COS: 8 | lda #CON_PI_HALF 10 | jsr FADD 11 | 12 | ; ---------------------------------------------------------------------------- 13 | ; "SIN" FUNCTION 14 | ; ---------------------------------------------------------------------------- 15 | SIN: 16 | jsr COPY_FAC_TO_ARG_ROUNDED 17 | lda #CON_PI_DOUB 19 | ldx ARGSIGN 20 | jsr DIV 21 | jsr COPY_FAC_TO_ARG_ROUNDED 22 | jsr INT 23 | lda #$00 24 | sta STRNG1 25 | jsr FSUBT 26 | ; ---------------------------------------------------------------------------- 27 | ; (FAC) = ANGLE AS A FRACTION OF A FULL CIRCLE 28 | ; 29 | ; NOW FOLD THE RANGE INTO A QUARTER CIRCLE 30 | ; 31 | ; <<< THERE ARE MUCH SIMPLER WAYS TO DO THIS >>> 32 | ; ---------------------------------------------------------------------------- 33 | lda #QUARTER 35 | jsr FSUB 36 | lda FACSIGN 37 | pha 38 | bpl SIN1 39 | jsr FADDH 40 | lda FACSIGN 41 | bmi L3F5B 42 | lda CPRMASK 43 | eor #$FF 44 | sta CPRMASK 45 | ; ---------------------------------------------------------------------------- 46 | ; IF FALL THRU, RANGE IS 0...1/2 47 | ; IF BRANCH HERE, RANGE IS 0...1/4 48 | ; ---------------------------------------------------------------------------- 49 | SIN1: 50 | jsr NEGOP 51 | ; ---------------------------------------------------------------------------- 52 | ; IF FALL THRU, RANGE IS -1/2...0 53 | ; IF BRANCH HERE, RANGE IS -1/4...0 54 | ; ---------------------------------------------------------------------------- 55 | L3F5B: 56 | lda #QUARTER 58 | jsr FADD 59 | pla 60 | bpl L3F68 61 | jsr NEGOP 62 | L3F68: 63 | lda #POLY_SIN 65 | jmp POLYNOMIAL_ODD 66 | 67 | ; ---------------------------------------------------------------------------- 68 | ; "TAN" FUNCTION 69 | ; 70 | ; COMPUTE TAN(X) = SIN(X) / COS(X) 71 | ; ---------------------------------------------------------------------------- 72 | TAN: 73 | jsr STORE_FAC_IN_TEMP1_ROUNDED 74 | lda #$00 75 | sta CPRMASK 76 | jsr SIN 77 | ldx #TEMP3 78 | ldy #$00 79 | jsr GOMOVMF 80 | lda #TEMP1+(5-BYTES_FP) 81 | ldy #$00 82 | jsr LOAD_FAC_FROM_YA 83 | lda #$00 84 | sta FACSIGN 85 | lda CPRMASK 86 | jsr TAN1 87 | lda #TEMP3 88 | ldy #$00 89 | jmp FDIV 90 | TAN1: 91 | pha 92 | jmp SIN1 93 | 94 | ; ---------------------------------------------------------------------------- 95 | .ifdef CONFIG_SMALL 96 | CON_PI_HALF: 97 | .byte $81,$49,$0F,$DB 98 | CON_PI_DOUB: 99 | .byte $83,$49,$0F,$DB 100 | QUARTER: 101 | .byte $7F,$00,$00,$00 102 | POLY_SIN: 103 | .byte $04,$86,$1E,$D7,$FB,$87,$99,$26 104 | .byte $65,$87,$23,$34,$58,$86,$A5,$5D 105 | .byte $E1,$83,$49,$0F,$DB 106 | .else 107 | CON_PI_HALF: 108 | .byte $81,$49,$0F,$DA,$A2 109 | CON_PI_DOUB: 110 | .byte $83,$49,$0F,$DA,$A2 111 | QUARTER: 112 | .byte $7F,$00,$00,$00,$00 113 | POLY_SIN: 114 | .byte $05,$84,$E6,$1A,$2D,$1B,$86,$28 115 | .byte $07,$FB,$F8,$87,$99,$68,$89,$01 116 | .byte $87,$23,$35,$DF,$E1,$86,$A5,$5D 117 | .byte $E7,$28,$83,$49,$0F,$DA,$A2 118 | .ifndef CONFIG_11 119 | ; no easter egg text before BASIC 1.1 120 | .elseif !.def(CONFIG_2A) 121 | ; ASCII encoded easter egg 122 | MICROSOFT: 123 | .byte $A6,$D3,$C1,$C8,$D4,$C8,$D5,$C4 124 | .byte $CE,$CA 125 | .else 126 | ; PET encoded easter egg text since CBM2 127 | MICROSOFT: 128 | .byte $A1,$54,$46,$8F,$13,$8F,$52,$43 129 | .byte $89,$CD 130 | .endif 131 | .endif 132 | 133 | ; ---------------------------------------------------------------------------- 134 | ; "ATN" FUNCTION 135 | ; ---------------------------------------------------------------------------- 136 | ATN: 137 | lda FACSIGN 138 | pha 139 | bpl L3FDB 140 | jsr NEGOP 141 | L3FDB: 142 | lda FAC 143 | pha 144 | cmp #$81 145 | bcc L3FE9 146 | lda #CON_ONE 148 | jsr FDIV 149 | ; ---------------------------------------------------------------------------- 150 | ; 0 <= X <= 1 151 | ; 0 <= ATN(X) <= PI/8 152 | ; ---------------------------------------------------------------------------- 153 | L3FE9: 154 | lda #POLY_ATN 156 | jsr POLYNOMIAL_ODD 157 | pla 158 | cmp #$81 159 | bcc L3FFC 160 | lda #CON_PI_HALF 162 | jsr FSUB 163 | L3FFC: 164 | pla 165 | bpl L4002 166 | jmp NEGOP 167 | L4002: 168 | rts 169 | 170 | ; ---------------------------------------------------------------------------- 171 | POLY_ATN: 172 | .ifdef CONFIG_SMALL 173 | .byte $08 174 | .byte $78,$3A,$C5,$37 175 | .byte $7B,$83,$A2,$5C 176 | .byte $7C,$2E,$DD,$4D 177 | .byte $7D,$99,$B0,$1E 178 | .byte $7D,$59,$ED,$24 179 | .byte $7E,$91,$72,$00 180 | .byte $7E,$4C,$B9,$73 181 | .byte $7F,$AA,$AA,$53 182 | .byte $81,$00,$00,$00 183 | .else 184 | .byte $0B 185 | .byte $76,$B3,$83,$BD,$D3 186 | .byte $79,$1E,$F4,$A6,$F5 187 | .byte $7B,$83,$FC,$B0,$10 188 | .byte $7C,$0C,$1F,$67,$CA 189 | .byte $7C,$DE,$53,$CB,$C1 190 | .byte $7D,$14,$64,$70,$4C 191 | .byte $7D,$B7,$EA,$51,$7A 192 | .byte $7D,$63,$30,$88,$7E 193 | .byte $7E,$92,$44,$99,$3A 194 | .byte $7E,$4C,$CC,$91,$C7 195 | .byte $7F,$AA,$AA,$AA,$13 196 | .byte $81,$00,$00,$00,$00 197 | .endif 198 | 199 | .if .def(CONFIG_11A) && (!.def(CONFIG_2)) 200 | .byte $00 ; XXX 201 | .endif 202 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/var.s: -------------------------------------------------------------------------------- 1 | .segment "CODE" 2 | 3 | ; ---------------------------------------------------------------------------- 4 | ; "DIM" STATEMENT 5 | ; ---------------------------------------------------------------------------- 6 | NXDIM: 7 | jsr CHKCOM 8 | DIM: 9 | tax 10 | jsr PTRGET2 11 | jsr CHRGOT 12 | bne NXDIM 13 | rts 14 | 15 | ; ---------------------------------------------------------------------------- 16 | ; PTRGET -- GENERAL VARIABLE SCAN 17 | ; 18 | ; SCANS VARIABLE NAME AT TXTPTR, AND SEARCHES THE 19 | ; VARTAB AND ARYTAB FOR THE NAME. 20 | ; IF NOT FOUND, CREATE VARIABLE OF APPROPRIATE TYPE. 21 | ; RETURN WITH ADDRESS IN VARPNT AND Y,A 22 | ; 23 | ; ACTUAL ACTIVITY CONTROLLED SOMEWHAT BY TWO FLAGS: 24 | ; DIMFLG -- NONZERO IF CALLED FROM "DIM" 25 | ; ELSE = 0 26 | ; 27 | ; SUBFLG -- = $00 28 | ; = $40 IF CALLED FROM "GETARYPT" 29 | ; ---------------------------------------------------------------------------- 30 | PTRGET: 31 | ldx #$00 32 | jsr CHRGOT 33 | PTRGET2: 34 | stx DIMFLG 35 | PTRGET3: 36 | sta VARNAM 37 | jsr CHRGOT 38 | jsr ISLETC 39 | bcs NAMOK 40 | SYNERR3: 41 | jmp SYNERR 42 | NAMOK: 43 | ldx #$00 44 | stx VALTYP 45 | .ifndef CONFIG_SMALL 46 | stx VALTYP+1 47 | .endif 48 | jsr CHRGET 49 | bcc L2ECD 50 | jsr ISLETC 51 | bcc L2ED8 52 | L2ECD: 53 | tax 54 | L2ECE: 55 | jsr CHRGET 56 | bcc L2ECE 57 | jsr ISLETC 58 | bcs L2ECE 59 | L2ED8: 60 | cmp #$24 61 | .ifdef CONFIG_SMALL 62 | bne L2EF9 63 | .else 64 | bne L2EE2 65 | .endif 66 | lda #$FF 67 | sta VALTYP 68 | .ifndef CONFIG_SMALL 69 | bne L2EF2 70 | L2EE2: 71 | cmp #$25 72 | bne L2EF9 73 | lda SUBFLG 74 | bne SYNERR3 75 | lda #$80 76 | sta VALTYP+1 77 | ora VARNAM 78 | sta VARNAM 79 | L2EF2: 80 | .endif 81 | txa 82 | ora #$80 83 | tax 84 | jsr CHRGET 85 | L2EF9: 86 | stx VARNAM+1 87 | sec 88 | ora SUBFLG 89 | sbc #$28 90 | bne L2F05 91 | jmp ARRAY 92 | L2F05: 93 | lda #$00 94 | sta SUBFLG 95 | lda VARTAB 96 | ldx VARTAB+1 97 | ldy #$00 98 | L2F0F: 99 | stx LOWTR+1 100 | L2F11: 101 | sta LOWTR 102 | cpx ARYTAB+1 103 | bne L2F1B 104 | cmp ARYTAB 105 | beq NAMENOTFOUND 106 | L2F1B: 107 | lda VARNAM 108 | cmp (LOWTR),y 109 | bne L2F29 110 | lda VARNAM+1 111 | iny 112 | cmp (LOWTR),y 113 | beq SET_VARPNT_AND_YA 114 | dey 115 | L2F29: 116 | clc 117 | lda LOWTR 118 | adc #BYTES_PER_VARIABLE 119 | bcc L2F11 120 | inx 121 | bne L2F0F 122 | 123 | ; ---------------------------------------------------------------------------- 124 | ; CHECK IF (A) IS ASCII LETTER A-Z 125 | ; 126 | ; RETURN CARRY = 1 IF A-Z 127 | ; = 0 IF NOT 128 | ; ---------------------------------------------------------------------------- 129 | ISLETC: 130 | cmp #$41 131 | bcc L2F3C 132 | sbc #$5B 133 | sec 134 | sbc #$A5 135 | L2F3C: 136 | rts 137 | 138 | ; ---------------------------------------------------------------------------- 139 | ; VARIABLE NOT FOUND, SO MAKE ONE 140 | ; ---------------------------------------------------------------------------- 141 | NAMENOTFOUND: 142 | pla 143 | pha 144 | cmp #FRM_VARIABLE_CALL 150 | bne MAKENEWVARIABLE 151 | .endif 152 | LD015: 153 | lda #C_ZERO 155 | rts 156 | 157 | ; ---------------------------------------------------------------------------- 158 | .ifndef CONFIG_2 159 | C_ZERO: 160 | .byte $00,$00 161 | .endif 162 | 163 | ; ---------------------------------------------------------------------------- 164 | ; MAKE A NEW SIMPLE VARIABLE 165 | ; 166 | ; MOVE ARRAYS UP 7 BYTES TO MAKE ROOM FOR NEW VARIABLE 167 | ; ENTER 7-BYTE VARIABLE DATA IN THE HOLE 168 | ; ---------------------------------------------------------------------------- 169 | MAKENEWVARIABLE: 170 | .ifdef CONFIG_CBM_ALL 171 | lda VARNAM 172 | ldy VARNAM+1 173 | cmp #$54 174 | bne LD02F 175 | cpy #$C9 176 | beq LD015 177 | cpy #$49 178 | bne LD02F 179 | LD02C: 180 | jmp SYNERR 181 | LD02F: 182 | cmp #$53 183 | bne LD037 184 | cpy #$54 185 | beq LD02C 186 | LD037: 187 | .endif 188 | lda ARYTAB 189 | ldy ARYTAB+1 190 | sta LOWTR 191 | sty LOWTR+1 192 | lda STREND 193 | ldy STREND+1 194 | sta HIGHTR 195 | sty HIGHTR+1 196 | clc 197 | adc #BYTES_PER_VARIABLE 198 | bcc L2F68 199 | iny 200 | L2F68: 201 | sta HIGHDS 202 | sty HIGHDS+1 203 | jsr BLTU 204 | lda HIGHDS 205 | ldy HIGHDS+1 206 | iny 207 | sta ARYTAB 208 | sty ARYTAB+1 209 | ldy #$00 210 | lda VARNAM 211 | sta (LOWTR),y 212 | iny 213 | lda VARNAM+1 214 | sta (LOWTR),y 215 | lda #$00 216 | iny 217 | sta (LOWTR),y 218 | iny 219 | sta (LOWTR),y 220 | iny 221 | sta (LOWTR),y 222 | iny 223 | sta (LOWTR),y 224 | .ifndef CONFIG_SMALL 225 | iny 226 | sta (LOWTR),y 227 | .endif 228 | 229 | ; ---------------------------------------------------------------------------- 230 | ; PUT ADDRESS OF VALUE OF VARIABLE IN VARPNT AND Y,A 231 | ; ---------------------------------------------------------------------------- 232 | SET_VARPNT_AND_YA: 233 | lda LOWTR 234 | clc 235 | adc #$02 236 | ldy LOWTR+1 237 | bcc L2F9E 238 | iny 239 | L2F9E: 240 | sta VARPNT 241 | sty VARPNT+1 242 | rts 243 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/msbasic/msbasic/zeropage.s: -------------------------------------------------------------------------------- 1 | 2 | .feature org_per_seg 3 | .zeropage 4 | 5 | .org ZP_START1 6 | 7 | GORESTART: 8 | .res 3 9 | GOSTROUT: 10 | .res 3 11 | GOAYINT: 12 | .res 2 13 | GOGIVEAYF: 14 | .res 2 15 | 16 | .org ZP_START2 17 | Z15: 18 | .res 1 19 | .ifndef POSX; allow override 20 | POSX: 21 | .endif 22 | .res 1 23 | .ifndef Z17; allow override 24 | Z17: 25 | .endif 26 | .res 1 27 | .ifndef Z18; allow override 28 | Z18: 29 | .endif 30 | .res 1 31 | LINNUM: 32 | .ifndef TXPSV; allow override 33 | TXPSV: 34 | .endif 35 | .res 2 36 | .ifndef INPUTBUFFER; allow override 37 | INPUTBUFFER: 38 | .endif 39 | 40 | .org ZP_START3 41 | 42 | CHARAC: 43 | .res 1 44 | ENDCHR: 45 | .res 1 46 | EOLPNTR: 47 | .res 1 48 | DIMFLG: 49 | .res 1 50 | VALTYP: 51 | .ifdef CONFIG_SMALL 52 | .res 1 53 | .else 54 | .res 2 55 | .endif 56 | DATAFLG: 57 | .res 1 58 | SUBFLG: 59 | .res 1 60 | INPUTFLG: 61 | .res 1 62 | CPRMASK: 63 | .res 1 64 | Z14: 65 | .res 1 66 | 67 | .org ZP_START4 68 | 69 | TEMPPT: 70 | .res 1 71 | LASTPT: 72 | .res 2 73 | TEMPST: 74 | .res 9 75 | INDEX: 76 | .res 2 77 | DEST: 78 | .res 2 79 | RESULT: 80 | .res BYTES_FP 81 | RESULT_LAST = RESULT + BYTES_FP-1 82 | TXTTAB: 83 | .res 2 84 | VARTAB: 85 | .res 2 86 | ARYTAB: 87 | .res 2 88 | STREND: 89 | .res 2 90 | FRETOP: 91 | .res 2 92 | FRESPC: 93 | .res 2 94 | MEMSIZ: 95 | .res 2 96 | CURLIN: 97 | .res 2 98 | OLDLIN: 99 | .res 2 100 | OLDTEXT: 101 | .res 2 102 | Z8C: 103 | .res 2 104 | DATPTR: 105 | .res 2 106 | INPTR: 107 | .res 2 108 | VARNAM: 109 | .res 2 110 | VARPNT: 111 | .res 2 112 | FORPNT: 113 | .res 2 114 | LASTOP: 115 | .res 2 116 | CPRTYP: 117 | .res 1 118 | FNCNAM: 119 | TEMP3: 120 | .res 2 121 | DSCPTR: 122 | .ifdef CONFIG_SMALL 123 | .res 2 124 | .else 125 | .res 3 126 | .endif 127 | DSCLEN: 128 | .res 2 129 | .ifndef JMPADRS ; allow override 130 | JMPADRS := DSCLEN + 1 131 | .endif 132 | Z52: 133 | .res 1 134 | ARGEXTENSION: 135 | .ifndef CONFIG_SMALL 136 | .res 1 137 | .endif 138 | TEMP1: 139 | .res 1 140 | HIGHDS: 141 | .res 2 142 | HIGHTR: 143 | .res 2 144 | .ifndef CONFIG_SMALL 145 | TEMP2: 146 | .res 1 147 | .endif 148 | INDX: 149 | TMPEXP: 150 | .ifdef CONFIG_SMALL 151 | TEMP2: 152 | .endif 153 | .res 1 154 | EXPON: 155 | .res 1 156 | LOWTR: 157 | .ifndef LOWTRX ; allow override 158 | LOWTRX: 159 | .endif 160 | .res 1 161 | EXPSGN: 162 | .res 1 163 | FAC: 164 | .res BYTES_FP 165 | FAC_LAST = FAC + BYTES_FP-1 166 | FACSIGN: 167 | .res 1 168 | SERLEN: 169 | .res 1 170 | SHIFTSIGNEXT: 171 | .res 1 172 | ARG: 173 | .res BYTES_FP 174 | ARG_LAST = ARG + BYTES_FP-1 175 | ARGSIGN: 176 | .res 1 177 | STRNG1: 178 | .res 2 179 | SGNCPR = STRNG1 180 | FACEXTENSION = STRNG1+1 181 | STRNG2: 182 | .res 2 183 | CHRGET: 184 | TXTPTR = <(GENERIC_TXTPTR-GENERIC_CHRGET + CHRGET) 185 | CHRGOT = <(GENERIC_CHRGOT-GENERIC_CHRGET + CHRGET) 186 | CHRGOT2 = <(GENERIC_CHRGOT2-GENERIC_CHRGET + CHRGET) 187 | RNDSEED = <(GENERIC_RNDSEED-GENERIC_CHRGET + CHRGET) 188 | 189 | 190 | -------------------------------------------------------------------------------- /SOFTWARE/Memory Emulator/readme.md: -------------------------------------------------------------------------------- 1 | # Neo6502 memory emulator no PIO 2 | 3 | This is work in progress code, use HDMI to connect to monitor and terminal to connect to COM port which Neo6502 will create. 4 | In Linux it's usually dev/ttyACM0 5 | 6 | ##Ewoz commands: 7 | 8 | start.end memory dump i.e. 0.100 will display memory content 0x000-0x100 9 | 10 | addressR run code from address 11 | 12 | BASIC entry point is BD1B you can run the BASIC with BD1BR 13 | 14 | It will ask for amount of memory: enter 32769 15 | then number of columns: enter 80 16 | 17 | If you connect UEXT.10 pin to Neo6502BUS.40 you can use aldo Ctrl-R to reset the 6502. 18 | -------------------------------------------------------------------------------- /SOFTWARE/PicoDVI/common_dvi_pin_configs.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMMON_DVI_PIN_CONFIGS_H 2 | #define _COMMON_DVI_PIN_CONFIGS_H 3 | 4 | // This file defines the TMDS pair layouts on a handful of boards I have been 5 | // developing on. It's not a particularly important file -- just saves some 6 | // copy + paste. 7 | 8 | #include "dvi_serialiser.h" 9 | 10 | //#ifndef DVI_DEFAULT_SERIAL_CONFIG 11 | #define DVI_DEFAULT_SERIAL_CONFIG pico_neo6502_cfg 12 | //#endif 13 | 14 | #ifndef DVI_DEFAULT_PIO_INST 15 | #define DVI_DEFAULT_PIO_INST pio0 16 | #endif 17 | 18 | // ---------------------------------------------------------------------------- 19 | // PicoDVI boards 20 | 21 | // Legacy pin mapping for Rev A PicoDVI boards -- I think just Graham and I 22 | // have these :) 23 | static const struct dvi_serialiser_cfg picodvi_reva_dvi_cfg = { 24 | .pio = DVI_DEFAULT_PIO_INST, 25 | .sm_tmds = {0, 1, 2}, 26 | .pins_tmds = {24, 26, 28}, 27 | .pins_clk = 22, 28 | .invert_diffpairs = true 29 | }; 30 | 31 | // The not-HDMI socket on Rev C PicoDVI boards 32 | // (we don't talk about Rev B) 33 | static const struct dvi_serialiser_cfg picodvi_dvi_cfg = { 34 | .pio = DVI_DEFAULT_PIO_INST, 35 | .sm_tmds = {0, 1, 2}, 36 | .pins_tmds = {10, 12, 14}, 37 | .pins_clk = 8, 38 | .invert_diffpairs = true 39 | }; 40 | 41 | // You can jam an adapter board into either of the PMOD sockets on a PicoDVI! 42 | static const struct dvi_serialiser_cfg picodvi_pmod0_cfg = { 43 | .pio = DVI_DEFAULT_PIO_INST, 44 | .sm_tmds = {0, 1, 2}, 45 | .pins_tmds = {2, 4, 0}, 46 | .pins_clk = 6, 47 | .invert_diffpairs = false 48 | }; 49 | 50 | // ---------------------------------------------------------------------------- 51 | // Other boards 52 | 53 | // The not-HDMI socket on SparkX HDMI carrier board with RP2040 MicroMod 54 | // inserted. 55 | static const struct dvi_serialiser_cfg micromod_cfg = { 56 | .pio = DVI_DEFAULT_PIO_INST, 57 | .sm_tmds = {0, 1, 2}, 58 | .pins_tmds = {18, 20, 22}, 59 | .pins_clk = 16, 60 | .invert_diffpairs = true 61 | }; 62 | 63 | // Pico DVI Sock (small hat on the bottom) which solders to the end of a Pico 64 | static const struct dvi_serialiser_cfg pico_sock_cfg = { 65 | .pio = DVI_DEFAULT_PIO_INST, 66 | .sm_tmds = {0, 1, 2}, 67 | .pins_tmds = {12, 18, 16}, 68 | .pins_clk = 14, 69 | .invert_diffpairs = false 70 | }; 71 | 72 | // Pico HDMI for Olimex Neo6502 73 | static const struct dvi_serialiser_cfg pico_neo6502_cfg = { 74 | .pio = DVI_DEFAULT_PIO_INST, 75 | .sm_tmds = {0, 1, 2}, 76 | .pins_tmds = {14, 18, 16}, 77 | .pins_clk = 12, 78 | .invert_diffpairs = true 79 | }; 80 | 81 | // The HDMI socket on Pimoroni Pico Demo HDMI 82 | // (we would talk about rev B if we had a rev B...) 83 | static const struct dvi_serialiser_cfg pimoroni_demo_hdmi_cfg = { 84 | .pio = DVI_DEFAULT_PIO_INST, 85 | .sm_tmds = {0, 1, 2}, 86 | .pins_tmds = {8, 10, 12}, 87 | .pins_clk = 6, 88 | .invert_diffpairs = true 89 | }; 90 | 91 | // Not HDMI Featherwing 92 | static const struct dvi_serialiser_cfg not_hdmi_featherwing_cfg = { 93 | .pio = pio0, 94 | .sm_tmds = {0, 1, 2}, 95 | .pins_tmds = {11, 9, 7}, 96 | .pins_clk = 24, 97 | .invert_diffpairs = true 98 | }; 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /SOFTWARE/UEXT/uext.py: -------------------------------------------------------------------------------- 1 | from machine import Pin, Timer 2 | 3 | gp22 = Pin(22, Pin.OUT) 4 | gp23 = Pin(23, Pin.OUT) 5 | gp24 = Pin(24, Pin.OUT) 6 | gp25 = Pin(25, Pin.OUT) 7 | gp26 = Pin(26, Pin.OUT) 8 | gp27 = Pin(27, Pin.OUT) 9 | gp28 = Pin(28, Pin.OUT) 10 | gp29 = Pin(29, Pin.OUT) 11 | 12 | tim = Timer() 13 | 14 | def tick(timer): 15 | global gp22,gp23,gp24,gp25,gp26,gp27,gp28,gp29 16 | gp22.toggle() 17 | gp23.toggle() 18 | gp24.toggle() 19 | gp25.toggle() 20 | gp26.toggle() 21 | gp27.toggle() 22 | gp28.toggle() 23 | gp29.toggle() 24 | 25 | tim.init(freq=1, mode=Timer.PERIODIC, callback=tick) -------------------------------------------------------------------------------- /SOFTWARE/ps2pico/ps2pico.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2022 No0ne (https://github.com/No0ne) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | */ 25 | 26 | #include "ps2device.pio.h" 27 | #include "hardware/gpio.h" 28 | #include "bsp/board.h" 29 | #include "tusb.h" 30 | #include "pico/stdlib.h" 31 | 32 | #define CLKIN 22 33 | #define CLKOUT 23 34 | #define DATIN 28 35 | #define DATOUT 29 36 | 37 | uint8_t const led2ps2[] = { 0, 4, 1, 5, 2, 6, 3, 7 }; 38 | uint8_t const mod2ps2[] = { 0x14, 0x12, 0x11, 0x1f, 0x14, 0x59, 0x11, 0x27 }; 39 | uint8_t const hid2ps2[] = { 40 | 0x00, 0x00, 0xfc, 0x00, 0x1c, 0x32, 0x21, 0x23, 0x24, 0x2b, 0x34, 0x33, 0x43, 0x3b, 0x42, 0x4b, 41 | 0x3a, 0x31, 0x44, 0x4d, 0x15, 0x2d, 0x1b, 0x2c, 0x3c, 0x2a, 0x1d, 0x22, 0x35, 0x1a, 0x16, 0x1e, 42 | 0x26, 0x25, 0x2e, 0x36, 0x3d, 0x3e, 0x46, 0x45, 0x5a, 0x76, 0x66, 0x0d, 0x29, 0x4e, 0x55, 0x54, 43 | 0x5b, 0x5d, 0x5d, 0x4c, 0x52, 0x0e, 0x41, 0x49, 0x4a, 0x58, 0x05, 0x06, 0x04, 0x0c, 0x03, 0x0b, 44 | 0x83, 0x0a, 0x01, 0x09, 0x78, 0x07, 0x7c, 0x7e, 0x7e, 0x70, 0x6c, 0x7d, 0x71, 0x69, 0x7a, 0x74, 45 | 0x6b, 0x72, 0x75, 0x77, 0x4a, 0x7c, 0x7b, 0x79, 0x5a, 0x69, 0x72, 0x7a, 0x6b, 0x73, 0x74, 0x6c, 46 | 0x75, 0x7d, 0x70, 0x71, 0x61, 0x2f, 0x37, 0x0f, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, 0x40, 47 | 0x48, 0x50, 0x57, 0x5f 48 | }; 49 | uint8_t const maparray = sizeof(hid2ps2) / sizeof(uint8_t); 50 | 51 | PIO pio = pio0; 52 | uint sm; 53 | uint offset; 54 | 55 | bool kbd_enabled = true; 56 | uint8_t kbd_addr = 0; 57 | uint8_t kbd_inst = 0; 58 | 59 | bool blinking = false; 60 | bool repeating = false; 61 | uint32_t repeat_us = 35000; 62 | uint16_t delay_ms = 250; 63 | alarm_id_t repeater; 64 | 65 | uint8_t prev_rpt[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 66 | uint8_t prev_ps2 = 0; 67 | uint8_t resend = 0; 68 | uint8_t repeat = 0; 69 | uint8_t leds = 0; 70 | 71 | int64_t repeat_callback(alarm_id_t id, void *user_data) { 72 | if(repeat) { 73 | repeating = true; 74 | return repeat_us; 75 | } 76 | 77 | repeater = 0; 78 | return 0; 79 | } 80 | 81 | uint16_t ps2_frame(uint8_t data) { 82 | uint8_t parity = 1; 83 | for(uint8_t i = 0; i < 8; i++) { 84 | parity = parity ^ (data >> i & 1); 85 | } 86 | 87 | return ((1 << 10) | (parity << 9) | (data << 1)) ^ 0x7ff; 88 | } 89 | 90 | void ps2_send(uint8_t data) { 91 | // uint8_t timeout = 10; 92 | // gpio_put(25, 1); 93 | resend = data; 94 | pio_sm_put(pio, sm, ps2_frame(data)); 95 | // gpio_put(25, 0); 96 | } 97 | 98 | void maybe_send_e0(uint8_t data) { 99 | if(data == 0x46 || 100 | data >= 0x48 && data <= 0x52 || 101 | data == 0x54 || data == 0x58 || 102 | data == 0x65 || data == 0x66 || 103 | data >= 0x81) { 104 | ps2_send(0xe0); 105 | } 106 | } 107 | 108 | void kbd_set_leds(uint8_t data) { 109 | if(data > 7) data = 0; 110 | leds = led2ps2[data]; 111 | tuh_hid_set_report(kbd_addr, kbd_inst, 0, HID_REPORT_TYPE_OUTPUT, &leds, sizeof(leds)); 112 | } 113 | 114 | int64_t blink_callback(alarm_id_t id, void *user_data) { 115 | if(kbd_addr) { 116 | if(blinking) { 117 | kbd_set_leds(7); 118 | blinking = false; 119 | return 500000; 120 | } else { 121 | kbd_set_leds(0); 122 | ps2_send(0xaa); 123 | } 124 | } 125 | return 0; 126 | } 127 | 128 | void ps2_receive(uint32_t fifo) { 129 | fifo = fifo >> 23; 130 | 131 | uint8_t parity = 1; 132 | for(uint8_t i = 0; i < 8; i++) { 133 | parity = parity ^ (fifo >> i & 1); 134 | } 135 | 136 | if(parity != fifo & 0x100) { 137 | ps2_send(0xfe); 138 | return; 139 | } 140 | 141 | uint8_t data = fifo; 142 | 143 | switch(prev_ps2) { 144 | case 0xed: // CMD: Set LEDs 145 | prev_ps2 = 0; 146 | kbd_set_leds(data); 147 | break; 148 | 149 | case 0xf3: // CMD: Set typematic rate and delay 150 | prev_ps2 = 0; 151 | repeat_us = data & 0x1f; 152 | delay_ms = data & 0x60; 153 | 154 | repeat_us = 35000 + repeat_us * 15000; 155 | 156 | if(delay_ms == 0x00) delay_ms = 250; 157 | if(delay_ms == 0x20) delay_ms = 500; 158 | if(delay_ms == 0x40) delay_ms = 750; 159 | if(delay_ms == 0x60) delay_ms = 1000; 160 | break; 161 | 162 | default: 163 | switch(data) { 164 | case 0xff: // CMD: Reset 165 | kbd_enabled = true; 166 | blinking = true; 167 | add_alarm_in_ms(1, blink_callback, NULL, false); 168 | 169 | pio_sm_clear_fifos(pio, sm); 170 | pio_sm_drain_tx_fifo(pio, sm); 171 | ps2_send(0xfa); 172 | return; 173 | 174 | case 0xfe: // CMD: Resend 175 | ps2_send(resend); 176 | return; 177 | 178 | case 0xee: // CMD: Echo 179 | ps2_send(0xee); 180 | return; 181 | 182 | case 0xf2: // CMD: Identify keyboard 183 | ps2_send(0xfa); 184 | ps2_send(0xab); 185 | ps2_send(0x83); 186 | return; 187 | 188 | case 0xf3: // CMD: Set typematic rate and delay 189 | case 0xed: // CMD: Set LEDs 190 | prev_ps2 = data; 191 | break; 192 | 193 | case 0xf4: // CMD: Enable scanning 194 | kbd_enabled = true; 195 | break; 196 | 197 | case 0xf5: // CMD: Disable scanning, restore default parameters 198 | case 0xf6: // CMD: Set default parameters 199 | kbd_enabled = data == 0xf6; 200 | repeat_us = 35000; 201 | delay_ms = 250; 202 | kbd_set_leds(0); 203 | break; 204 | } 205 | break; 206 | } 207 | 208 | ps2_send(0xfa); 209 | } 210 | 211 | void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len) { 212 | if(tuh_hid_interface_protocol(dev_addr, instance) == HID_ITF_PROTOCOL_KEYBOARD) { 213 | kbd_addr = dev_addr; 214 | kbd_inst = instance; 215 | 216 | blinking = true; 217 | add_alarm_in_ms(1, blink_callback, NULL, false); 218 | 219 | tuh_hid_receive_report(dev_addr, instance); 220 | } 221 | } 222 | 223 | void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance) { 224 | if(dev_addr == kbd_addr && instance == kbd_inst) { 225 | kbd_addr = 0; 226 | kbd_inst = 0; 227 | } 228 | } 229 | 230 | void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len) { 231 | if(dev_addr == kbd_addr && instance == kbd_inst) { 232 | 233 | if(!kbd_enabled || report[1] != 0) { 234 | tuh_hid_receive_report(dev_addr, instance); 235 | return; 236 | } 237 | 238 | board_led_write(1); 239 | 240 | if(report[0] != prev_rpt[0]) { 241 | uint8_t rbits = report[0]; 242 | uint8_t pbits = prev_rpt[0]; 243 | 244 | for(uint8_t j = 0; j < 8; j++) { 245 | 246 | if((rbits & 0x01) != (pbits & 0x01)) { 247 | if(j > 2 && j != 5) ps2_send(0xe0); 248 | 249 | if(rbits & 0x01) { 250 | ps2_send(mod2ps2[j]); 251 | } else { 252 | ps2_send(0xf0); 253 | ps2_send(mod2ps2[j]); 254 | } 255 | } 256 | 257 | rbits = rbits >> 1; 258 | pbits = pbits >> 1; 259 | 260 | } 261 | 262 | prev_rpt[0] = report[0]; 263 | } 264 | 265 | for(uint8_t i = 2; i < 8; i++) { 266 | if(prev_rpt[i]) { 267 | bool brk = true; 268 | 269 | for(uint8_t j = 2; j < 8; j++) { 270 | if(prev_rpt[i] == report[j]) { 271 | brk = false; 272 | break; 273 | } 274 | } 275 | 276 | if(brk && report[i] < maparray) { 277 | if(prev_rpt[i] == 0x48) continue; 278 | if(prev_rpt[i] == repeat) repeat = 0; 279 | 280 | maybe_send_e0(prev_rpt[i]); 281 | ps2_send(0xf0); 282 | ps2_send(hid2ps2[prev_rpt[i]]); 283 | } 284 | } 285 | 286 | if(report[i]) { 287 | bool make = true; 288 | 289 | for(uint8_t j = 2; j < 8; j++) { 290 | if(report[i] == prev_rpt[j]) { 291 | make = false; 292 | break; 293 | } 294 | } 295 | 296 | if(make && report[i] < maparray) { 297 | if(report[i] == 0x48) { 298 | 299 | if(report[0] & 0x1 || report[0] & 0x10) { 300 | ps2_send(0xe0); ps2_send(0x7e); ps2_send(0xe0); ps2_send(0xf0); ps2_send(0x7e); 301 | } else { 302 | ps2_send(0xe1); ps2_send(0x14); ps2_send(0x77); ps2_send(0xe1); 303 | ps2_send(0xf0); ps2_send(0x14); ps2_send(0xf0); ps2_send(0x77); 304 | } 305 | 306 | continue; 307 | } 308 | 309 | repeat = report[i]; 310 | if(repeater) cancel_alarm(repeater); 311 | repeater = add_alarm_in_ms(delay_ms, repeat_callback, NULL, false); 312 | 313 | maybe_send_e0(report[i]); 314 | ps2_send(hid2ps2[report[i]]); 315 | } 316 | } 317 | 318 | prev_rpt[i] = report[i]; 319 | } 320 | 321 | tuh_hid_receive_report(dev_addr, instance); 322 | board_led_write(0); 323 | 324 | } 325 | } 326 | 327 | void irq_callback(uint gpio, uint32_t events) { 328 | if(!gpio_get(DATIN) && !pio_interrupt_get(pio, 0)) { 329 | board_led_write(1); 330 | pio_sm_drain_tx_fifo(pio, sm); 331 | pio_sm_exec(pio, sm, pio_encode_jmp(offset + 2)); 332 | } 333 | } 334 | 335 | void main() { 336 | 337 | //gpio_init(25); 338 | //gpio_set_dir(25, GPIO_OUT); 339 | //gpio_put(25, 1); 340 | 341 | board_init(); 342 | 343 | sm = pio_claim_unused_sm(pio, true); 344 | offset = pio_add_program(pio, &ps2dev_program); 345 | ps2dev_program_init(pio, sm, offset, CLKIN, CLKOUT, DATIN, DATOUT); 346 | 347 | gpio_set_irq_enabled_with_callback(CLKIN, GPIO_IRQ_EDGE_RISE, true, &irq_callback); 348 | tusb_init(); 349 | 350 | while(true) { 351 | tuh_task(); 352 | 353 | if(!pio_sm_is_rx_fifo_empty(pio, sm)) { 354 | ps2_receive(pio_sm_get(pio, sm)); 355 | board_led_write(0); 356 | } 357 | 358 | if(repeating) { 359 | repeating = false; 360 | 361 | if(repeat) { 362 | maybe_send_e0(repeat); 363 | ps2_send(hid2ps2[repeat]); 364 | } 365 | } 366 | } 367 | } 368 | 369 | 370 | -------------------------------------------------------------------------------- /SOFTWARE/readme.md: -------------------------------------------------------------------------------- 1 | 2 | Apple ][ and Oric Atmos emulators: https://github.com/vsladkov/reload-emulator 3 | ============================================================================== 4 | 5 | 6502 firmware: https://github.com/paulscottrobson/neo6502-firmware 6 | ============================================================================================ 7 | 8 | Arduino project with BBC BASIC: https://github.com/marobi/Pico_6502_v4 9 | ====================================================================== 10 | 11 | Same project ported to PlatformIO: https://github.com/astralaster/Pico_6502_v4_platformio 12 | ========================================================================================= 13 | 14 | Neo6502 hardware check: 15 | 16 | Video uses PicoDVI https://github.com/Wren6991/PicoDVI 17 | ====================================================== 18 | With these modifications fo match the hardware wiring of the DVI signals: 19 | 20 | in common_dvi_pin_configs.h 21 | 22 | must be set: 23 | 24 | #define DVI_DEFAULT_SERIAL_CONFIG pico_neo6502_cfg 25 | 26 | and the hardware definition: 27 | 28 | // Pico HDMI for Olimex Neo6502 29 | static const struct dvi_serialiser_cfg pico_neo6502_cfg = { 30 | .pio = DVI_DEFAULT_PIO_INST, 31 | .sm_tmds = {0, 1, 2}, 32 | .pins_tmds = {14, 18, 16}, 33 | .pins_clk = 12, 34 | .invert_diffpairs = true 35 | }; 36 | 37 | Keyboard and mouse uses usb2serial https://github.com/OLIMEX/usb2serial 38 | ======= 39 | usb2serial is based on which is based on https://github.com/No0ne/ps2x2pico 40 | Keyboard or/and mouse can be connected to Neo6502 and if DEBUG is set it will stream on the SERUAL port the received Keyboard and Mouse data 41 | 42 | UEXT is tested with python code 43 | =============================== 44 | 45 | Audio is tested with python code 46 | =============================== 47 | 48 | --------------------------------------------------------------------------------