Initial commit

This commit is contained in:
Anders Nielsen 2021-10-21 09:59:53 +02:00
commit a30084cb1d
30 changed files with 38655 additions and 0 deletions

BIN
PMS171-VGA/OBJ/PMS171-VGA.LB0 Executable file

Binary file not shown.

BIN
PMS171-VGA/OBJ/PMS171-VGA.PJ0 Executable file

Binary file not shown.

82
PMS171-VGA/PMS171-VGA.C Executable file
View File

@ -0,0 +1,82 @@
#include "extern.h"
// P#, VDD, PA0, PA3, PA4, PA5, PA6, PA7, GND, MASK1, MASK2, SHIF#
.writer package 16, 5, 11, 9, 10, 8, 7, 6, 12, 0x00, 0x00, 0
VSYNC BIT PA.4;
//HSYNC BIT PA.4;
//HBLANK BIT PA.6;
VBLANK BIT PA.7;
A13 BIT PA.3
byte mode = 0;
word line = 0;
word count = 0;
void FPPA0 (void)
{
// .ADJUST_IC SYSCLK=IHRC/2, IHRC=15734375Hz, Vdd=5.0V // SYSCLK=IHRC/2
.ADJUST_IC SYSCLK=IHRC/2, IHRC=16000KHz, Vdd=5.0V // SYSCLK=IHRC/2
// clkmd.En_Reset = 0; // PA.5 as Reset pin
CLKMD = 0x35;
// Insert Initial Code
paph.5 = 1; //Does this work?
$ VSYNC HIGH, OUT;
$ VBLANK HIGH, OUT;
$ A13 LOW, OUT;
PBC = 0xFF;
PB = 0;
line = 0;
$ INTEN PA0;
INTEGS = 0b0;
INTRQ = 0;
ENGINT;
while (1)
{
if (line.8 == 1){
A13 = 1;
} else
{
A13 = 0;
}
if (line == 490) {
$ VSYNC LOW;
}
if (line == 492) {
$ VSYNC HIGH;
}
if (line == 524) {
line = 0;
}
} //While 1
} //FPPA0
void Interrupt (void)
{
pushaf; //We don't care about flags - only timing... Or maybe we do?
if (Intrq.PA0)
{
line++;
PB = line;
Intrq.PA0 = 0;
}
popaf;
}

BIN
PMS171-VGA/PMS171-VGA.PDK Executable file

Binary file not shown.

25
PMS171-VGA/PMS171-VGA.PRE Executable file
View File

@ -0,0 +1,25 @@
.CHIP PMS171B
//{{PADAUK_CODE_OPTION
.Code_Option LVR 3.0V
.Code_Option Comparator_Edge All_Edge
.Code_Option GPC_PWM Disable
.Code_Option TM2_Out1 PB2
.Code_Option TMx_Bit 7BIT
.Code_Option TMx_Source 16MHz
.Code_Option Interrupt_Src1 PB.0
.Code_Option Interrupt_Src0 PA.0
.Code_Option Bootup_Time Fast
.Code_Option PB4_PB5_Drive Strong
.Code_Option Security Enable // Security 7/8 words Enable
//}}PADAUK_CODE_OPTION
// ----------- IMPORTANT -------------
// Please don't change the follow code
// It only be used for internal Mini-C
// -----------------------------------
.JMP FPPA0 <?>, 0
.ROMADR 0x10
.PUT Interrupt <reti>, 8

29
PMS171-VGA/PMS171-VGA.PRJ Executable file
View File

@ -0,0 +1,29 @@
[INI]
PROJECT=PRE_FILE
[LINKS]
~PMS171-VGA.C
[HEAD]
~extern.h
[DEPEND]
~$:INC_PDK\PMS171B.INC
~PMS171-VGA.PRE
[Ram_Break]
Break1=No 0000
Break2=No 0000
Break3=No 0000
Break4=No 0000
[Stack_Break]
Break1=Au 0000 00FF
Break2=Au 0000 00FF
Break3=Au 0000 00FF
Break4=Au 0000 00FF
Break5=Au 0000 00FF
Break6=Au 0000 00FF
Break7=Au 0000 00FF
Break8=Au 0000 00FF
[Ctrl_Break]
Mark=51 1
ICE=0 6 2 1388
[PRE]
~PMS171-VGA.PRJ
~PMS171-VGA.PRE

16
PMS171-VGA/extern.h Executable file
View File

@ -0,0 +1,16 @@
System_Clock EQU 15734375/2 // Used at UART, PS2, ...
/* // A example for use ADCRH & ADCR
#if defined(ADCC)
#if defined(ADCR)
ADCRH EQU ADCR
ADCRL EQU 0
#else
ADCR EQU ADCRH
#endif
#endif
*/

734
abn6502rom.s Executable file
View File

@ -0,0 +1,734 @@
.feature string_escapes ; Allow c-style string escapes when using ca65
.feature org_per_seg
PORTB = $6000
PORTA = $6001
DDRB = $6002
DDRA = $6003
T1CL = $6004
T1CH = $6005
T1LL = $6006
T1LH = $6007
T2CL = $6008
T2CH = $6009
SR1 = $600A
ACR = $600B
PCR = $600C
IFR = $600D
IER = $600E
PORTANHS = $600F
TIMEOUT = 1999 ; Should be around 1ms
kb_wptr = $0000
kb_rptr = $0001
kb_flags = $0002
RELEASE = %00000001
SHIFT = %00000010
kb_buffer = $0200 ; 256-byte kb buffer 0200-02ff
MILLIS = $40
MILLISH = $41
HXH = $44
MONCNT = $46
TMP = $50;
CRSRPNT = $52
CRSRPNT2 = CRSRPNT+1
CHPNT = $54
CHPNT2 = CHPNT+1
SCREENSTARTH = $20
SCREENSTARTL = $4B
LINESTART = 11
MONH = $59
MONL = $58
ABUF = $5A
;to $61
uservia = PORTB
.segment "RODATA"
;.org $8000 Not needed with CA65
nmi:
reset:
cld ; Because you never know
;CLEAR RAM
ldx #$0
clearram:
lda #0
sta $00,x
inx
bne clearram
lda #$01 ; CA1 positive active edge
sta PCR
lda #%11000010 ; Set CA1 + T1 interrupts
sta IER
LDA #%01011000
STA ACR ; T1 continuous, PB7 disabled, Shift Out Ø2
cli ; Enable interrupts
noclear: ;Soft reset point
LDA #<TIMEOUT
STA T1CL ; Set low byte of timer1 counter
LDA #>TIMEOUT
STA T1CH ; Set high byte of timer1 counter
lda #SCREENSTARTL
sta CRSRPNT
lda #SCREENSTARTH
sta CRSRPNT2
lda #$FF
sta DDRA
tax
txs
jsr clrscn
lda #2
sta PORTB ; Set SPI CS high
lda #%01000111 ; Port B DDR for SPI
sta DDRB
lda #0
sta DDRA ; Port A all inputs
sta kb_rptr ; Init keyboard pointers before enabling interrupts
sta kb_wptr
cli
;lda #0 ; Don't have to do this because we start by clearing RAM
;sta MONL
;sta MONH
ldx #0
loadwelcome:
lda message,x
beq main
sta kb_buffer,x
inc kb_wptr
inx
jmp loadwelcome
lda CRSRPNT ; Newline after welcome.
jsr crnl
sta CRSRPNT
main:
nomsg:
lda CRSRPNT
pha
lda CRSRPNT2
pha
LDA #$7c
sta CRSRPNT
lda #$20
sta CRSRPNT2
lda MILLISH
jsr printbyte
pla
sta CRSRPNT2
pla
sta CRSRPNT
sei
lda kb_rptr
cmp kb_wptr
cli
bne key_pressed
jmp main
key_pressed:
ldx kb_rptr
lda kb_buffer, x
cmp #$0a ; enter - go new line
beq enter_pressed
cmp #$1b ; escape - clear display
beq esc
cmp #$08
beq back
cmp #$FE ;Scan code $05
beq f1
cmp #$FD
beq f2
cmp #$FC
beq f3
cmp #$FB
beq f4
cmp #$FA
beq f5
cmp #$F9
beq f6
cmp #$F8
beq f7
cmp #$F7
beq f8
jsr printk
jmp main
back:
jmp backspace_pressed
f8:
jmp f8_pressed
f7:
jmp f7_pressed
f6:
jmp f6_pressed
f5:
jmp f5_pressed
f4:
jmp f4_pressed
f3:
jmp f3_pressed
f2:
jmp f2_pressed
f1:
jmp f1_pressed
esc:
jmp esc_pressed
enter_pressed:
ldx #0
lda kb_buffer,x
parsecmd:
cmp #'r'
beq read
cmp #'w'
beq write
cmp #'H'
beq strangegame
cmp #'h'
beq strangegame
jmp err
strangegame:
ldx #0
lda #0
sta kb_wptr
sta kb_rptr
printgtnw:
lda gtnw,x
beq wrotegtnw
sta kb_buffer,x
inc kb_wptr
inx
jmp printgtnw
lda CRSRPNT ; Newline after welcome.
jsr crnl
sta CRSRPNT
wrotegtnw:
jmp main
write:
ldy #$FF
inx
lda kb_buffer,x
cmp #'r'
bne err
ldx #6
jsr asctobyte
sta MONH ; Maybe we'll find a better place
inx
jsr asctobyte
sta MONL
nextbyte:
inx
lda kb_buffer,x
cmp #' '
beq nextbyte
cmp '.'
beq nextbyte
cmp ','
beq nextbyte
cmp '$'
beq nextbyte
cmp #$0a
beq exitwrite
stbyte:
jsr asctobyte
iny
sta (MONL),y
jmp nextbyte
exitwrite:
inc kb_rptr
jmp newmon
read:
inx
lda kb_buffer,x
cmp #'u'
beq run
cmp #'e'
bne err
ldx #5
jsr asctobyte
sta MONH
inx
jsr asctobyte
sta MONL
inc kb_rptr
jmp newmon
err:
lda CRSRPNT
jsr crnl
sta CRSRPNT
bcc clkbptr
inc CRSRPNT2
clkbptr:
; Clear keyboard pointers if this is the end of message
inc kb_rptr
sei
lda kb_rptr
cmp kb_wptr
cli
bne notdone
eom:
lda #0
sta kb_rptr
sta kb_wptr
notdone:
jmp main
run:
lda #0
sta kb_rptr
sta kb_wptr
jmp ($0030)
esc_pressed:
jsr clrscn
lda #SCREENSTARTL
sta CRSRPNT
lda #SCREENSTARTH
sta CRSRPNT2
jmp clkbptr
backspace_pressed:
dec CRSRPNT
lda CRSRPNT
cmp #255
bne notunder
dec CRSRPNT2
notunder:
lda #' '
ldy #0
sta (CRSRPNT),y
dec kb_rptr
dec kb_wptr
dec kb_wptr
jmp main
f1_pressed:
lda #0
sta kb_rptr
sta kb_wptr
jsr clrscn
jmp monmon
f2_pressed:
jmp eom
f3_pressed:
jmp eom
f4_pressed:
jmp eom
f5_pressed:
jmp f2_pressed
f6_pressed:
jmp f2_pressed
f7_pressed:
jmp f2_pressed
f8_pressed:
jmp f2_pressed
newmon:
jsr clrscn
monmon:
lda #27
sta MONCNT
lda MONH
pha
lda MONL
pha
jsr mon
pla
sta MONL
pla
sta MONH
sei
lda kb_rptr
cmp kb_wptr
cli
beq monmon
ldx kb_rptr
inc kb_rptr
lda kb_buffer, x
cmp #$1b ; escape - exit
beq exitmon
; Let's loop here until keypress
jmp monmon ; No data - restart monitor
exitmon:
jsr clrscn ; Clear screen on monitor exit
jmp eom
; lda #0
; sta MILLISH
asctohex:
cmp #$60
bcc caps
sbc #$20
caps:
sbc #'0'-1
cmp #10
bcc nothex
sbc #8
nothex:
rts
blink:
lda #$AA
sta PORTA
jsr delay
lda #$55
sta PORTA
jsr delay
rts
delay: ;
lda #1
sta $25
inner:
lda $25 ; Keep loading T1L until it rolls over
bne inner
rts
clrscn:
lda #0
sta CRSRPNT
lda #$1F ; Clear before screen to after screen
sta CRSRPNT+1
ldy #0
tya
ldx #9
clrloop:
sta (CRSRPNT),y
iny
bne clrloop
inc CRSRPNT+1 ; increasing HI-byte of the clearing address.
dex
bne clrloop
rts
crnl: ; Carriage return new line - needs cursor pointer in A
and #%11000000 ; keep only section bits
ora #LINESTART ;
clc
adc #$40 ; CR
rts
hextoa:
; wozmon-style
; and #%00001111 ; Mask LSD for hex print.
; Already masked when we get here.
ora #'0' ; Add '0'.
cmp #'9'+1 ; Is it a decimal digit?
bcc ascr ; Yes, output it.
adc #$06 ; Add offset for letter.
ascr:
rts
bytetoa: ;This SR puts LSB in A and MSB in HXH - as ascii using hextoa.
pha
lsr
lsr
lsr
lsr
clc
jsr hextoa
sta HXH
pla
and #$0F
jsr hextoa
rts
asctobyte: ; Reads two hex characters from keyboard buffer, x indexed, and returns a byte in A
lda kb_buffer,x ; MSD
jsr asctohex
asl a
asl a
asl a
asl a
sta TMP
inx
lda kb_buffer,x ; LSD
jsr asctohex
ora TMP
; Return value in A
rts
mon:
; Print line starting address
; Print 8 ascii hex bytes separated by ' '
; Print same 8 bytes as ASCII
;newline
;Let's start by resetting start pos
lda #SCREENSTARTH ; If we are, then reset to top of screen
sta CRSRPNT2
lda #SCREENSTARTL
sta CRSRPNT
nextline:
ldx #8
lda #'$'
jsr printa
lda MONH
jsr printbyte
lda MONL
jsr printbyte
lda #':'
jsr printa
lda #' '
jsr printa
ldy #0
nexthex:
lda (MONL),y
sta ABUF,x
jsr printbyte
inc CRSRPNT ; Make a space
inc MONL
bne notof
inc MONH
notof:
dex
bne nexthex
; Print ascii
ldx #8
printabuf:
lda ABUF,x
jsr printa
dex
bne printabuf
; Get ready for a new line
lda CRSRPNT
jsr crnl ; Carriage Return New Line
sta CRSRPNT
and #$E0 ; If msn is 0 then ++section
bne gonext
inc CRSRPNT2
gonext:
dec MONCNT
bne nextline ; Was this the last line? No, nextline.
rts
printbyte:
jsr bytetoa
pha
lda HXH
jsr printa
pla
jsr printa
rts
printa:
ldy #0
sta (CRSRPNT),y
inc CRSRPNT
bne printeda
inc CRSRPNT2
printeda:
rts
printk:
pha
checkl: ; This is user input, so we have to make sure we don't hit VGA blanking by mistake
lda CRSRPNT
and #$3F ; Discard MS bits since we only care about current line
cmp #$3e
bcc chs ; A < 62 == Not Front porch
lda CRSRPNT
jsr crnl
sta CRSRPNT
and #$E0 ; If msn is 0 then ++section
bne chs
inc CRSRPNT2
chs:
lda CRSRPNT2 ; Check if we're off screen
cmp #$27
bcc rpa ; if we're not
lda #SCREENSTARTH ; If we are, then reset to top of screen ; Or start scrolling?
sta CRSRPNT2
lda #SCREENSTARTL
sta CRSRPNT
rpa:
pla
jsr printa
inc kb_rptr
rts
message: .asciiz "GREETINGS PROFESSOR FALKEN.", "\n", "SHALL WE PLAY A GAME?", "\n"
gtnw:
.asciiz "\n", "A STRANGE GAME. THE ONLY WINNING ", "\n", "MOVE IS NOT TO PLAY.", "\n"
; IRQ vector points here ; Thanks to Ben Eater for a very useful PS2->Ascii interface
irq:
pha
txa
pha
tsx
lda $0103,x ; Pull status register off stack and check break flag
and #$10
bne hitbrk
bit IFR
bvs t1_irq
lda IFR
and #2
bne keyboard_interrupt
rti
hitbrk:
; jmp reset
inc $08
lda #$55
sta $6000
jmp noclear ; Exit brk irq by going to soft reset
keyboard_interrupt:
lda kb_flags
and #RELEASE ; check if we're releasing a key
beq read_key ; otherwise, read the key
lda kb_flags
eor #RELEASE ; flip the releasing bit
sta kb_flags
lda PORTA ; read key value that's being released
cmp #$12 ; left shift
beq shift_up
cmp #$59 ; right shift
beq shift_up
jmp exit
shift_up:
lda kb_flags
eor #SHIFT ; flip the shift bit
sta kb_flags
jmp exit
read_key:
lda PORTA
cmp #$f0 ; if releasing a key
beq key_release ; set the releasing bit
cmp #$12 ; left shift
beq shift_down
cmp #$59 ; right shift
beq shift_down
tax
lda kb_flags
and #SHIFT
bne shifted_key
lda keymap, x ; map to character code
jmp push_key
shifted_key:
lda keymap_shifted, x ; map to character code
push_key:
ldx kb_wptr
sta kb_buffer, x
inc kb_wptr
jmp exit
shift_down:
lda kb_flags
ora #SHIFT
sta kb_flags
jmp exit
key_release:
lda kb_flags
ora #RELEASE
sta kb_flags
exit:
pla
tax
pla
rti
t1_irq:
bit T1CL ; Clear irq
inc $25
inc MILLIS
bne t1_irq_exit
inc MILLIS+1
t1_irq_exit:
jmp exit
; Thanks to Ben Eater for a very useful PS2->Ascii interface
keymap:
.byte "???",$FA,$FC,$FE,$FD,"???",$F7,$F9,$FB," `?" ; 00-0F
;F1, F2, F3,F4, F5, F6, F7, F8 key bound to $FE, $FD, $FC, $FB, $FA, $F9, $F8, $F7 for no particular reason
.byte "?????q1???zsaw2?" ; 10-1F
.byte "?cxde43?? vftr5?" ; 20-2F
.byte "?nbhgy6???mju78?" ; 30-3F
.byte "?,kio09??./l;p-?" ; 40-4F
.byte "??\'?[=????",$0a,"]?\\??" ; 50-5F
.byte "??????",$08,"??1?47???" ; 60-6F
.byte "0.2568",$1b,"??+3-*9??" ; 70-7F
.byte "???",$F8,"????????????" ; 80-8F $F8 = F7 key
.byte "????????????????" ; 90-9F
.byte "????????????????" ; A0-AF
.byte "????????????????" ; B0-BF
.byte "????????????????" ; C0-CF
.byte "????????????????" ; D0-DF
.byte "????????????????" ; E0-EF
.byte "????????????????" ; F0-FF
keymap_shifted:
.byte "????????????? ~?" ; 00-0F
.byte "?????Q!???ZSAW@?" ; 10-1F
.byte "?CXDE#$?? VFTR%?" ; 20-2F
.byte "?NBHGY^???MJU&*?" ; 30-3F
.byte "?<KIO)(??>?L:P_?" ; 40-4F
.byte "??\"?{+?????}?|??" ; 50-5F
.byte "?????????1?47???" ; 60-6F
.byte "0.2568???+3-*9??" ; 70-7F
.byte "???",$F8,"????????????" ; 80-8F $F8 = F7 key
.byte "????????????????" ; 90-9F
.byte "????????????????" ; A0-AF
.byte "????????????????" ; B0-BF
.byte "????????????????" ; C0-CF
.byte "????????????????" ; D0-DF
.byte "????????????????" ; E0-EF
.byte "????????????????" ; F0-FF
.segment "VECTORS"
.ORG $fffa
.word nmi,reset,irq
.reloc

5
assemble.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
ca65 --cpu 6502 -l build/listing.txt -o build/abn6502rom.o abn6502rom.s
ca65 crom.s -o build/crom.o
ld65 -o build/abn6502rom.bin -C memmap.cfg "./build/abn6502rom.o" "./build/crom.o"
minipro -s -p "SST39SF010A" -w build/abn6502rom.bin

1
burncrom.sh Normal file
View File

@ -0,0 +1 @@
minipro -s -p "W27C512@DIP28" -w build/crom.bin

10
crom.s Normal file
View File

@ -0,0 +1,10 @@
; CROM source
.segment "CROM"
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$66,$66,$18,$62,$3c,$06,$0c,$30,$00,$00,$00,$00,$00,$00,$3c,$18,$3c,$3c,$06,$7e,$3c,$7e,$3c,$3c,$00,$00,$0e,$00,$70,$3c,$3c,$18,$7c,$3c,$78,$7e,$7e,$3c,$66,$3c,$1e,$66,$60,$63,$66,$3c,$7c,$3c,$7c,$3c,$7e,$66,$66,$63,$66,$66,$7e,$3c,$00,$3c,$00,$00,$3c,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0e,$08,$70,$00,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$66,$66,$3e,$66,$66,$0c,$18,$18,$66,$18,$00,$00,$00,$03,$66,$18,$66,$66,$0e,$60,$66,$66,$66,$66,$00,$00,$18,$00,$18,$66,$66,$3c,$66,$66,$6c,$60,$60,$66,$66,$18,$0c,$6c,$60,$77,$76,$66,$66,$66,$66,$66,$18,$66,$66,$63,$66,$66,$06,$30,$60,$0c,$18,$00,$66,$00,$60,$00,$06,$00,$0e,$00,$60,$18,$06,$60,$38,$00,$00,$00,$00,$00,$00,$00,$18,$00,$00,$00,$00,$00,$00,$18,$18,$18,$00,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$66,$ff,$60,$0c,$3c,$18,$30,$0c,$3c,$18,$00,$00,$00,$06,$6e,$38,$06,$06,$1e,$7c,$60,$0c,$66,$66,$18,$18,$30,$7e,$0c,$06,$6e,$66,$66,$60,$66,$60,$60,$60,$66,$18,$0c,$78,$60,$7f,$7e,$66,$66,$66,$66,$60,$18,$66,$66,$63,$3c,$66,$0c,$30,$30,$0c,$3c,$00,$6e,$3c,$60,$3c,$06,$3c,$18,$3e,$60,$00,$00,$60,$18,$66,$7c,$3c,$7c,$3e,$7c,$3e,$7e,$66,$66,$63,$66,$66,$7e,$18,$18,$18,$00,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$00,$66,$3c,$18,$38,$00,$30,$0c,$ff,$7e,$00,$7e,$00,$0c,$76,$18,$0c,$1c,$66,$06,$7c,$18,$3c,$3e,$00,$00,$60,$00,$06,$0c,$6e,$7e,$7c,$60,$66,$78,$78,$6e,$7e,$18,$0c,$70,$60,$6b,$7e,$66,$7c,$66,$7c,$3c,$18,$66,$66,$6b,$18,$3c,$18,$30,$18,$0c,$7e,$00,$6e,$06,$7c,$60,$3e,$66,$3e,$66,$7c,$38,$06,$6c,$18,$7f,$66,$66,$66,$66,$66,$60,$18,$66,$66,$6b,$3c,$66,$0c,$70,$18,$0e,$3b,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ff,$06,$30,$67,$00,$30,$0c,$3c,$18,$00,$00,$00,$18,$66,$18,$30,$06,$7f,$06,$66,$18,$66,$06,$00,$00,$30,$7e,$0c,$18,$60,$66,$66,$60,$66,$60,$60,$66,$66,$18,$0c,$78,$60,$63,$6e,$66,$60,$66,$78,$06,$18,$66,$66,$7f,$3c,$18,$30,$30,$0c,$0c,$18,$00,$60,$3e,$66,$60,$66,$7e,$18,$66,$66,$18,$06,$78,$18,$7f,$66,$66,$66,$66,$60,$3c,$18,$66,$66,$7f,$18,$66,$18,$18,$18,$18,$6e,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$66,$7c,$66,$66,$00,$18,$18,$66,$18,$18,$00,$18,$30,$66,$18,$60,$66,$06,$66,$66,$18,$66,$66,$18,$18,$18,$00,$18,$00,$66,$66,$66,$66,$6c,$60,$60,$66,$66,$18,$6c,$6c,$60,$63,$66,$66,$60,$3c,$6c,$66,$18,$66,$3c,$77,$66,$18,$60,$30,$06,$0c,$18,$00,$66,$66,$66,$60,$66,$60,$18,$3e,$66,$18,$06,$6c,$18,$6b,$66,$66,$7c,$3e,$60,$06,$18,$66,$3c,$3e,$3c,$3e,$30,$18,$18,$18,$00,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$00,$66,$18,$46,$3f,$00,$0c,$30,$00,$00,$18,$00,$18,$60,$3c,$7e,$7e,$3c,$06,$3c,$3c,$18,$3c,$3c,$00,$18,$0e,$00,$70,$18,$3c,$66,$7c,$3c,$78,$7e,$60,$3c,$66,$3c,$38,$66,$7e,$63,$66,$3c,$60,$0e,$66,$3c,$18,$3c,$18,$63,$66,$18,$7e,$3c,$03,$3c,$18,$00,$3c,$3e,$7c,$3c,$3e,$3c,$18,$06,$66,$3c,$06,$66,$3c,$63,$66,$3c,$60,$06,$60,$7c,$0e,$3e,$18,$36,$66,$0c,$7e,$0e,$18,$70,$00,$ff
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$30,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$30,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$ff,$00,$00,$00,$00,$00,$00,$00,$7c,$00,$00,$3c,$00,$00,$00,$00,$00,$60,$06,$00,$00,$00,$00,$00,$00,$00,$78,$00,$00,$18,$00,$00,$ff

BIN
hardware/.DS_Store vendored Normal file

Binary file not shown.

1292
hardware/6502-cache.lib Normal file

File diff suppressed because it is too large Load Diff

3
hardware/6502-rescue.dcm Normal file
View File

@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

108
hardware/6502-rescue.lib Normal file
View File

@ -0,0 +1,108 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# R6502-65xx
#
DEF R6502-65xx U 0 40 Y Y 1 F N
F0 "U" 0 -200 50 H V C CNN
F1 "R6502-65xx" 0 0 50 H V C CNN
F2 "" -200 100 50 H I C CNN
F3 "" -200 100 50 H I C CNN
DRAW
S -400 300 400 -1800 0 1 0 f
X VSS 1 -500 200 100 R 50 50 1 1 W
X A1 10 -500 -700 100 R 50 50 1 1 O
X A2 11 -500 -800 100 R 50 50 1 1 O
X A3 12 -500 -900 100 R 50 50 1 1 O
X A4 13 -500 -1000 100 R 50 50 1 1 O
X A5 14 -500 -1100 100 R 50 50 1 1 O
X A6 15 -500 -1200 100 R 50 50 1 1 O
X A7 16 -500 -1300 100 R 50 50 1 1 O
X A8 17 -500 -1400 100 R 50 50 1 1 O
X A9 18 -500 -1500 100 R 50 50 1 1 O
X A10 19 -500 -1600 100 R 50 50 1 1 O
X RDY 2 -500 100 100 R 50 50 1 1 I
X A11 20 -500 -1700 100 R 50 50 1 1 O
X VSS 21 500 -1700 100 L 50 50 1 1 I
X A12 22 500 -1600 100 L 50 50 1 1 O
X A13 23 500 -1500 100 L 50 50 1 1 O
X A14 24 500 -1400 100 L 50 50 1 1 O
X A15 25 500 -1300 100 L 50 50 1 1 O
X D7 26 500 -1200 100 L 50 50 1 1 B
X D6 27 500 -1100 100 L 50 50 1 1 B
X D5 28 500 -1000 100 L 50 50 1 1 B
X D4 29 500 -900 100 L 50 50 1 1 B
X Ø1 3 -500 0 100 R 50 50 1 1 O
X D3 30 500 -800 100 L 50 50 1 1 B
X D2 31 500 -700 100 L 50 50 1 1 B
X D1 32 500 -600 100 L 50 50 1 1 B
X D0 33 500 -500 100 L 50 50 1 1 B
X R/~W 34 500 -400 100 L 50 50 1 1 O
X NC 35 500 -300 100 L 50 50 1 1 N
X NC 36 500 -200 100 L 50 50 1 1 N
X Ø0 37 500 -100 100 L 50 50 1 1 I
X ~SO 38 500 0 100 L 50 50 1 1 I
X Ø2 39 500 100 100 L 50 50 1 1 O
X ~IRQ 4 -500 -100 100 R 50 50 1 1 I
X ~RES 40 500 200 100 L 50 50 1 1 I
X NC 5 -500 -200 100 R 50 50 1 1 N
X ~NMI 6 -500 -300 100 R 50 50 1 1 I
X SYNC 7 -500 -400 100 R 50 50 1 1 O
X VCC 8 -500 -500 100 R 50 50 1 1 W
X A0 9 -500 -600 100 R 50 50 1 1 O
ENDDRAW
ENDDEF
#
# R6522-65xx
#
DEF R6522-65xx U 0 40 Y Y 1 F N
F0 "U" 0 -200 50 H V C CNN
F1 "R6522-65xx" 0 0 50 H V C CNN
F2 "" -200 100 50 H I C CNN
F3 "" -200 100 50 H I C CNN
DRAW
S -400 300 400 -1800 0 1 0 f
X VSS 1 0 -1900 100 U 50 50 1 1 W
X PB0 10 -500 -600 100 R 50 50 1 1 B
X PB1 11 -500 -700 100 R 50 50 1 1 B
X PB2 12 -500 -800 100 R 50 50 1 1 B
X PB3 13 -500 -900 100 R 50 50 1 1 B
X PB4 14 -500 -1000 100 R 50 50 1 1 B
X PB5 15 -500 -1100 100 R 50 50 1 1 B
X PB6 16 -500 -1200 100 R 50 50 1 1 B
X PB7 17 -500 -1300 100 R 50 50 1 1 B
X CB1 18 500 -700 100 L 50 50 1 1 B
X CB2 19 500 -800 100 L 50 50 1 1 B
X PA0 2 -500 200 100 R 50 50 1 1 B
X VCC 20 0 400 100 D 50 50 1 1 W
X ~IRQ 21 500 0 100 L 50 50 1 1 O
X R/~W 22 500 -100 100 L 50 50 1 1 I
X ~CS2 23 500 -200 100 L 50 50 1 1 I
X CS1 24 500 -300 100 L 50 50 1 1 I
X Ø2 25 500 100 100 L 50 50 1 1 I
X D7 26 500 -1700 100 L 50 50 1 1 B
X D6 27 500 -1600 100 L 50 50 1 1 B
X D5 28 500 -1500 100 L 50 50 1 1 B
X D4 29 500 -1400 100 L 50 50 1 1 B
X PA1 3 -500 100 100 R 50 50 1 1 B
X D3 30 500 -1300 100 L 50 50 1 1 B
X D2 31 500 -1200 100 L 50 50 1 1 B
X D1 32 500 -1100 100 L 50 50 1 1 B
X D0 33 500 -1000 100 L 50 50 1 1 B
X ~RES 34 500 200 100 L 50 50 1 1 I
X RS3 35 -500 -1400 100 R 50 50 1 1 I
X RS2 36 -500 -1500 100 R 50 50 1 1 I
X RS1 37 -500 -1600 100 R 50 50 1 1 I
X RS0 38 -500 -1700 100 R 50 50 1 1 I
X CA2 39 500 -600 100 L 50 50 1 1 B
X PA2 4 -500 0 100 R 50 50 1 1 B
X CA1 40 500 -500 100 L 50 50 1 1 B
X PA3 5 -500 -100 100 R 50 50 1 1 B
X PA4 6 -500 -200 100 R 50 50 1 1 B
X PA5 7 -500 -300 100 R 50 50 1 1 B
X PA6 8 -500 -400 100 R 50 50 1 1 B
X PA7 9 -500 -500 100 R 50 50 1 1 B
ENDDRAW
ENDDEF
#
#End Library

12852
hardware/6502.kicad_pcb Normal file

File diff suppressed because it is too large Load Diff

12852
hardware/6502.kicad_pcb-bak Normal file

File diff suppressed because it is too large Load Diff

2131
hardware/6502.net Normal file

File diff suppressed because it is too large Load Diff

BIN
hardware/6502.pdf Normal file

Binary file not shown.

259
hardware/6502.pro Normal file
View File

@ -0,0 +1,259 @@
update=Thursday, 21 October 2021 at 07:41:30
version=1
last_client=kicad
[general]
version=1
RootSch=
BoardNm=
[cvpcb]
version=1
NetIExt=net
[eeschema]
version=1
LibDir=
[eeschema/libraries]
[schematic_editor]
version=1
PageLayoutDescrFile=
PlotDirectoryName=
SubpartIdSeparator=0
SubpartFirstId=65
NetFmtName=Pcbnew
SpiceAjustPassiveValues=0
LabSize=50
ERC_TestSimilarLabels=1
[pcbnew]
version=1
PageLayoutDescrFile=
LastNetListRead=6502.net
CopperLayerCount=2
BoardThickness=1.6
AllowMicroVias=0
AllowBlindVias=0
RequireCourtyardDefinitions=0
ProhibitOverlappingCourtyards=1
MinTrackWidth=0.13
MinViaDiameter=0.6
MinViaDrill=0.3
MinMicroViaDiameter=0.2
MinMicroViaDrill=0.09999999999999999
MinHoleToHole=0.25
TrackWidth1=0.13
ViaDiameter1=0.6
ViaDrill1=0.3
dPairWidth1=0.2
dPairGap1=0.25
dPairViaGap1=0.25
SilkLineWidth=0.12
SilkTextSizeV=1
SilkTextSizeH=1
SilkTextSizeThickness=0.15
SilkTextItalic=0
SilkTextUpright=1
CopperLineWidth=0.2
CopperTextSizeV=1.5
CopperTextSizeH=1.5
CopperTextThickness=0.3
CopperTextItalic=0
CopperTextUpright=1
EdgeCutLineWidth=0.05
CourtyardLineWidth=0.05
OthersLineWidth=0.15
OthersTextSizeV=1
OthersTextSizeH=1
OthersTextSizeThickness=0.15
OthersTextItalic=0
OthersTextUpright=1
SolderMaskClearance=0.051
SolderMaskMinWidth=0.25
SolderPasteClearance=0
SolderPasteRatio=0
[pcbnew/Layer.F.Cu]
Name=F.Cu
Type=0
Enabled=1
[pcbnew/Layer.In1.Cu]
Name=In1.Cu
Type=0
Enabled=0
[pcbnew/Layer.In2.Cu]
Name=In2.Cu
Type=0
Enabled=0
[pcbnew/Layer.In3.Cu]
Name=In3.Cu
Type=0
Enabled=0
[pcbnew/Layer.In4.Cu]
Name=In4.Cu
Type=0
Enabled=0
[pcbnew/Layer.In5.Cu]
Name=In5.Cu
Type=0
Enabled=0
[pcbnew/Layer.In6.Cu]
Name=In6.Cu
Type=0
Enabled=0
[pcbnew/Layer.In7.Cu]
Name=In7.Cu
Type=0
Enabled=0
[pcbnew/Layer.In8.Cu]
Name=In8.Cu
Type=0
Enabled=0
[pcbnew/Layer.In9.Cu]
Name=In9.Cu
Type=0
Enabled=0
[pcbnew/Layer.In10.Cu]
Name=In10.Cu
Type=0
Enabled=0
[pcbnew/Layer.In11.Cu]
Name=In11.Cu
Type=0
Enabled=0
[pcbnew/Layer.In12.Cu]
Name=In12.Cu
Type=0
Enabled=0
[pcbnew/Layer.In13.Cu]
Name=In13.Cu
Type=0
Enabled=0
[pcbnew/Layer.In14.Cu]
Name=In14.Cu
Type=0
Enabled=0
[pcbnew/Layer.In15.Cu]
Name=In15.Cu
Type=0
Enabled=0
[pcbnew/Layer.In16.Cu]
Name=In16.Cu
Type=0
Enabled=0
[pcbnew/Layer.In17.Cu]
Name=In17.Cu
Type=0
Enabled=0
[pcbnew/Layer.In18.Cu]
Name=In18.Cu
Type=0
Enabled=0
[pcbnew/Layer.In19.Cu]
Name=In19.Cu
Type=0
Enabled=0
[pcbnew/Layer.In20.Cu]
Name=In20.Cu
Type=0
Enabled=0
[pcbnew/Layer.In21.Cu]
Name=In21.Cu
Type=0
Enabled=0
[pcbnew/Layer.In22.Cu]
Name=In22.Cu
Type=0
Enabled=0
[pcbnew/Layer.In23.Cu]
Name=In23.Cu
Type=0
Enabled=0
[pcbnew/Layer.In24.Cu]
Name=In24.Cu
Type=0
Enabled=0
[pcbnew/Layer.In25.Cu]
Name=In25.Cu
Type=0
Enabled=0
[pcbnew/Layer.In26.Cu]
Name=In26.Cu
Type=0
Enabled=0
[pcbnew/Layer.In27.Cu]
Name=In27.Cu
Type=0
Enabled=0
[pcbnew/Layer.In28.Cu]
Name=In28.Cu
Type=0
Enabled=0
[pcbnew/Layer.In29.Cu]
Name=In29.Cu
Type=0
Enabled=0
[pcbnew/Layer.In30.Cu]
Name=In30.Cu
Type=0
Enabled=0
[pcbnew/Layer.B.Cu]
Name=B.Cu
Type=0
Enabled=1
[pcbnew/Layer.B.Adhes]
Enabled=1
[pcbnew/Layer.F.Adhes]
Enabled=1
[pcbnew/Layer.B.Paste]
Enabled=1
[pcbnew/Layer.F.Paste]
Enabled=1
[pcbnew/Layer.B.SilkS]
Enabled=1
[pcbnew/Layer.F.SilkS]
Enabled=1
[pcbnew/Layer.B.Mask]
Enabled=1
[pcbnew/Layer.F.Mask]
Enabled=1
[pcbnew/Layer.Dwgs.User]
Enabled=1
[pcbnew/Layer.Cmts.User]
Enabled=1
[pcbnew/Layer.Eco1.User]
Enabled=1
[pcbnew/Layer.Eco2.User]
Enabled=1
[pcbnew/Layer.Edge.Cuts]
Enabled=1
[pcbnew/Layer.Margin]
Enabled=1
[pcbnew/Layer.B.CrtYd]
Enabled=1
[pcbnew/Layer.F.CrtYd]
Enabled=1
[pcbnew/Layer.B.Fab]
Enabled=1
[pcbnew/Layer.F.Fab]
Enabled=1
[pcbnew/Layer.Rescue]
Enabled=0
[pcbnew/Netclasses]
[pcbnew/Netclasses/Default]
Name=Default
Clearance=0.13
TrackWidth=0.13
ViaDiameter=0.6
ViaDrill=0.3
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25
[pcbnew/Netclasses/1]
Name=Power
Clearance=0.2
TrackWidth=0.25
ViaDiameter=0.6
ViaDrill=0.3
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25

1992
hardware/6502.sch Normal file

File diff suppressed because it is too large Load Diff

1992
hardware/6502.sch-bak Normal file

File diff suppressed because it is too large Load Diff

BIN
hardware/6502pcb.pdf Normal file

Binary file not shown.

BIN
hardware/Gerbers.zip Normal file

Binary file not shown.

46
hardware/bom.txt Normal file
View File

@ -0,0 +1,46 @@
v C1, C2 18pF Capacitor_SMD:C_0805_2012Metric
C1 18pF Capacitor_SMD:C_0805_2012Metric
C2 18pF Capacitor_SMD:C_0805_2012Metric
> C3-C11, C15-C18 100nF Capacitor_SMD:C_0603_1608Metric
C12 470uF Capacitor_SMD:CP_Elec_6.3x7.7
> C13, C14 1uF Capacitor_SMD:C_0805_2012Metric
C19 C_Small Capacitor_SMD:C_0603_1608Metric
> D1-D8 RED LED_SMD:LED_0805_2012Metric
D-3v3 3v3 LED_SMD:LED_0805_2012Metric
D-5V1 5v LED_SMD:LED_0805_2012Metric
> J1, J10 JMP Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical
> J2, J16 Conn_01x16_Male Connector_PinHeader_2.54mm:PinHeader_1x16_P2.54mm_Vertical
J3 CA Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical
J4 CB Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical
J5 W27c512? Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical
J6 DB15_Female_HighDensity Connector_Dsub:DSUB-15-HD_Female_Horizontal_P2.29x2.54mm_EdgePinOffset9.40mm-Mountingholes
J7 Conn_01x12_Male Connector_PinHeader_2.54mm:PinHeader_1x12_P2.54mm_Vertical
J8 Barrel_Jack_MountingPin Connector_BarrelJack:BarrelJack_Horizontal
J9 USB_B_Micro Connector_USB:USB-B-MICRO-SMD_V03-fixed
J11 Conn_01x04_Male Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical
J14 Conn_01x06_Male Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical
> J12, J13, J15 Conn_01x08_Male Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical
> R1-R4, R8, R9 Pull Resistor_SMD:R_0805_2012Metric
R5 1M Resistor_SMD:R_0805_2012Metric
R6 470 Resistor_SMD:R_0805_2012Metric
R7 150 Resistor_SMD:R_0805_2012Metric
> R10, R11 lim Resistor_SMD:R_0805_2012Metric
R12 R_Pull Resistor_SMD:R_0805_2012Metric
RN1 R_Network08 Resistor_THT:R_Array_SIP9
SW1 SW_Push Button_Switch_SMD:SW_SPST_TL3342
U1 74HC00 Package_DIP:DIP-14_W7.62mm
U2 R6502 Package_DIP:DIP-40_W15.24mm
U3 R6522 Package_DIP:DIP-40_W15.24mm
U4 74HC273 Package_DIP:DIP-20_W7.62mm
U5 SST39SF010 Socket:DIP_Socket-32_W11.9_W12.7_W15.24_W17.78_W18.5_3M_232-1285-00-0602J
> U6, U7, U19 74LS161 Package_DIP:DIP-16_W7.62mm
U8 74LS32 Package_DIP:DIP-14_W7.62mm
> U9-U11, U13 74HC245 Package_DIP:DIP-20_W7.62mm
U12 PMS171B-SOP16_150mil Package_SO:SOIC-16_3.9x9.9mm_P1.27mm
U14 74HC04 Package_DIP:DIP-14_W7.62mm
U15 MIC5504-3.3YM5 Package_TO_SOT_SMD:SOT-23-5
U16 62256 Package_DIP:DIP-28_W15.24mm
U17 74LS00 Package_DIP:DIP-14_W7.62mm
U18 w27C512 Package_DIP:DIP-28_W15.24mm
U20 74LS165 Package_DIP:DIP-16_W7.62mm
Y1 16Mhz Crystal:Crystal_HC49-U_Vertical

1
hardware/fp-info-cache Normal file
View File

@ -0,0 +1 @@
0

2105
hardware/ram-vga.sch Normal file

File diff suppressed because it is too large Load Diff

2105
hardware/ram-vga.sch-bak Normal file

File diff suppressed because it is too large Load Diff

3
hardware/sym-lib-table Normal file
View File

@ -0,0 +1,3 @@
(sym_lib_table
(lib (name 6502-rescue)(type Legacy)(uri ${KIPRJMOD}/6502-rescue.lib)(options "")(descr ""))
)

12
memmap.cfg Normal file
View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $0, size = $100, type = rw, define = yes;
RAM: start = $200, size = $3E00, define = yes;
ROM: start = $8000, size = $8000, file = %O;
CROM: start = $10000, size = $10000, file = "build/crom.bin";
}
SEGMENTS {
RODATA: load = ROM, type = ro;
VECTORS: load = ROM, type = ro, offset = $7FFA;
CROM: load = CROM, type = ro;
}